@saasquatch/mint-components 1.3.2-9 → 1.3.3-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-a85b8c8d.js → ShadowViewAddon-b021dc8c.js} +1 -1
- package/dist/cjs/{global-ff7fbc86.js → global-5610b310.js} +70 -279
- package/dist/cjs/{index.module-7dd4b981.js → index.module-03ce03c2.js} +1 -3
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/mint-components.cjs.js +3 -3
- package/dist/cjs/{re-render-6111d4bd.js → re-render-b5efae5f.js} +1 -1
- package/dist/cjs/sqm-asset-card.cjs.entry.js +1 -1
- package/dist/cjs/sqm-big-stat.cjs.entry.js +2 -2
- package/dist/cjs/{sqm-divided-layout_30.cjs.entry.js → sqm-divided-layout_26.cjs.entry.js} +501 -2901
- package/dist/cjs/sqm-graphql-client-provider.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-leaderboard-rank-view-a99b4cd9.js → sqm-leaderboard-rank-view-c287ac06.js} +2 -2
- package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +3 -3
- package/dist/cjs/sqm-leaderboard.cjs.entry.js +2 -2
- package/dist/cjs/sqm-name-fields.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-navigation-sidebar-item-view-6c7f78e6.js → sqm-navigation-sidebar-item-view-153503f0.js} +1 -1
- package/dist/cjs/sqm-navigation-sidebar-item.cjs.entry.js +2 -2
- package/dist/cjs/sqm-popup-container.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-portal-email-verification-view-2cebd06b.js → sqm-portal-email-verification-view-1d8728f9.js} +1 -1
- package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +3 -3
- package/dist/cjs/{sqm-portal-footer-view-de1763c4.js → sqm-portal-footer-view-dc4b0667.js} +1 -1
- package/dist/cjs/sqm-portal-footer.cjs.entry.js +3 -3
- package/dist/cjs/sqm-portal-forgot-password.cjs.entry.js +9 -4
- package/dist/cjs/sqm-portal-logout.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-portal-profile-view-680ee551.js → sqm-portal-profile-view-a7519f19.js} +1 -1
- package/dist/cjs/sqm-portal-profile.cjs.entry.js +3 -3
- package/dist/cjs/sqm-portal-protected-route.cjs.entry.js +1 -1
- package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +1 -1
- package/dist/cjs/sqm-portal-verify-email.cjs.entry.js +1 -1
- package/dist/cjs/sqm-referral-table-column.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table-date-column.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table-rewards-column.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table-status-column.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table-user-column.cjs.entry.js +2 -2
- package/dist/cjs/sqm-share-code.cjs.entry.js +1 -1
- package/dist/cjs/{useDemoBigStat-2786227e.js → useDemoBigStat-2025ee9b.js} +21 -117
- package/dist/collection/collection-manifest.json +3 -7
- package/dist/collection/components/sqm-big-stat/sqm-big-stat.js +1 -1
- package/dist/collection/components/sqm-big-stat/useBigStat.js +20 -115
- package/dist/collection/components/sqm-big-stat/useDemoBigStat.js +0 -1
- package/dist/collection/components/sqm-portal-forgot-password/sqm-portal-forgot-password.js +28 -3
- package/dist/collection/components/sqm-portal-forgot-password/usePortalForgotPassword.js +2 -1
- package/dist/collection/components/sqm-portal-login/sqm-portal-login.js +59 -4
- package/dist/collection/components/sqm-portal-login/usePortalLogin.js +4 -2
- package/dist/collection/components/sqm-portal-register/sqm-portal-register.js +28 -2
- package/dist/collection/components/sqm-portal-register/usePortalRegister.js +1 -0
- package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-column.js +1 -1
- package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-date-column.js +1 -1
- package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-rewards-column.js +1 -1
- package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-status-column.js +1 -1
- package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-user-column.js +1 -1
- package/dist/collection/{tables → components/sqm-referral-table}/re-render.js +0 -0
- package/dist/collection/{tables → components/sqm-referral-table}/sqm-table-cell.js +0 -0
- package/dist/collection/{tables → components/sqm-referral-table}/sqm-table-row.js +0 -0
- package/dist/collection/{tables → components/sqm-referral-table}/useChildElements.js +0 -0
- package/dist/collection/components/sqm-referral-table/useReferralTable.js +2 -2
- package/dist/collection/components/sqm-share-button/sqm-share-button.js +1 -1
- package/dist/collection/components/sqm-stencilbook/CucumberAddon.js +1 -3
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +36 -48
- package/dist/collection/global/styles.js +69 -278
- package/dist/collection/global/styles.ts +69 -278
- package/dist/collection/{components/sqm-asset-card → stories}/AssetCard.stories.js +2 -2
- package/dist/collection/{components/sqm-big-stat → stories}/BigStat.stories.js +3 -10
- package/dist/collection/{components/sqm-portal-change-password → stories}/ChangePassword.stories.js +3 -3
- package/dist/collection/{components/sqm-divided-layout → stories}/DividedLayout.stories.js +4 -4
- package/dist/collection/{components/sqm-edit-profile → stories}/EditProfileForm.stories.js +2 -2
- package/dist/collection/{components/sqm-form-message → stories}/FormMessage.stories.js +1 -1
- package/dist/collection/{components/sqm-hero → stories}/Hero.stories.js +2 -2
- package/dist/collection/{components/sqm-leaderboard → stories}/Leaderboard.stories.js +2 -2
- package/dist/collection/{components/sqm-leaderboard-rank → stories}/LeaderboardRank.stories.js +2 -2
- package/dist/collection/{components/sqm-name-fields → stories}/NameFields.stories.js +2 -2
- package/dist/collection/{components/sqm-navigation-sidebar → stories}/NavigationSidebar.stories.js +3 -3
- package/dist/collection/stories/NewPortal.stories.js +15 -15
- package/dist/collection/{components/sqm-password-field → stories}/PasswordField.stories.js +1 -1
- package/dist/collection/{components/sqm-portal-email-verification → stories}/PortalEmailVerification.stories.js +3 -3
- package/dist/collection/{components/sqm-portal-footer → stories}/PortalFooter.stories.js +2 -2
- package/dist/collection/{components/sqm-portal-forgot-password → stories}/PortalForgotPassword.stories.js +7 -3
- package/dist/collection/{components/sqm-portal-frame → stories}/PortalFrame.stories.js +2 -2
- package/dist/collection/{components/sqm-portal-login → stories}/PortalLogin.stories.js +8 -2
- package/dist/collection/{components/sqm-portal-profile → stories}/PortalProfile.stories.js +2 -2
- package/dist/collection/{components/sqm-portal-register → stories}/PortalRegister.stories.js +7 -2
- package/dist/collection/{components/sqm-portal-reset-password → stories}/PortalResetPassword.stories.js +3 -3
- package/dist/collection/{components/sqm-portal-verify-email → stories}/PortalVerifyEmail.stories.js +3 -3
- package/dist/collection/{components/sqm-program-menu → stories}/ProgramMenu.stories.js +2 -2
- package/dist/collection/{components/sqm-referral-iframe → stories}/ReferralIframe.stories.js +2 -2
- package/dist/collection/{components/sqm-referral-table → stories}/ReferralTable.stories.js +2 -2
- package/dist/collection/{components/sqm-referral-table → stories}/ReferralTableCell.stories.js +1 -1
- package/dist/collection/{components/sqm-referral-table → stories}/ReferralTableRewardsCell.stories.js +1 -1
- package/dist/collection/{components/sqm-router → stories}/Router.stories.js +1 -1
- package/dist/collection/{components/sqm-share-button → stories}/ShareButton.stories.js +2 -2
- package/dist/collection/{components/sqm-share-link → stories}/ShareLink.stories.js +2 -2
- package/dist/collection/{components/sqm-navigation-sidebar-item → stories}/SidebarItem.stories.js +2 -2
- package/dist/collection/{components/sqm-big-stat → stories}/UseBigStat.stories.js +4 -7
- package/dist/collection/{components/sqm-edit-profile → stories}/UseEditProfile.stories.js +1 -1
- package/dist/collection/{components/sqm-leaderboard → stories}/UseLeaderboard.stories.js +3 -3
- package/dist/collection/{components/sqm-share-button → stories}/UseShareButton.stories.js +2 -2
- package/dist/collection/{components/sqm-share-link → stories}/UseShareLink.stories.js +3 -3
- package/dist/collection/{components/sqm-user-name → stories}/UserName.stories.js +3 -3
- package/dist/esm/{ShadowViewAddon-a3f510db.js → ShadowViewAddon-2e3ea31f.js} +1 -1
- package/dist/esm/{global-923aa737.js → global-cc82aa03.js} +70 -279
- package/dist/esm/{index.module-90d2c3ad.js → index.module-33c313d2.js} +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mint-components.js +3 -3
- package/dist/esm/{re-render-e06f2f7f.js → re-render-338d931e.js} +1 -1
- package/dist/esm/sqm-asset-card.entry.js +1 -1
- package/dist/esm/sqm-big-stat.entry.js +2 -2
- package/dist/esm/{sqm-divided-layout_30.entry.js → sqm-divided-layout_26.entry.js} +503 -2899
- package/dist/esm/sqm-graphql-client-provider.entry.js +1 -1
- package/dist/esm/{sqm-leaderboard-rank-view-747ffda8.js → sqm-leaderboard-rank-view-4f48da0c.js} +2 -2
- package/dist/esm/sqm-leaderboard-rank.entry.js +3 -3
- package/dist/esm/sqm-leaderboard.entry.js +2 -2
- package/dist/esm/sqm-name-fields.entry.js +1 -1
- package/dist/esm/{sqm-navigation-sidebar-item-view-f2304ad9.js → sqm-navigation-sidebar-item-view-5dfa535f.js} +1 -1
- package/dist/esm/sqm-navigation-sidebar-item.entry.js +2 -2
- package/dist/esm/sqm-popup-container.entry.js +1 -1
- package/dist/esm/{sqm-portal-email-verification-view-a3ebc4a2.js → sqm-portal-email-verification-view-87bf8191.js} +1 -1
- package/dist/esm/sqm-portal-email-verification.entry.js +3 -3
- package/dist/esm/{sqm-portal-footer-view-7b8a02b1.js → sqm-portal-footer-view-da135cff.js} +1 -1
- package/dist/esm/sqm-portal-footer.entry.js +3 -3
- package/dist/esm/sqm-portal-forgot-password.entry.js +9 -4
- package/dist/esm/sqm-portal-logout.entry.js +1 -1
- package/dist/esm/{sqm-portal-profile-view-4ce8d89d.js → sqm-portal-profile-view-8781176c.js} +1 -1
- package/dist/esm/sqm-portal-profile.entry.js +3 -3
- package/dist/esm/sqm-portal-protected-route.entry.js +1 -1
- package/dist/esm/sqm-portal-reset-password.entry.js +1 -1
- package/dist/esm/sqm-portal-verify-email.entry.js +1 -1
- package/dist/esm/sqm-referral-table-column.entry.js +2 -2
- package/dist/esm/sqm-referral-table-date-column.entry.js +2 -2
- package/dist/esm/sqm-referral-table-rewards-column.entry.js +2 -2
- package/dist/esm/sqm-referral-table-status-column.entry.js +2 -2
- package/dist/esm/sqm-referral-table-user-column.entry.js +2 -2
- package/dist/esm/sqm-share-code.entry.js +1 -1
- package/dist/esm/{useDemoBigStat-c3b955b7.js → useDemoBigStat-2fe92931.js} +21 -117
- package/dist/esm-es5/{ShadowViewAddon-a3f510db.js → ShadowViewAddon-2e3ea31f.js} +1 -1
- package/dist/esm-es5/{global-923aa737.js → global-cc82aa03.js} +2 -2
- package/dist/esm-es5/{index.module-90d2c3ad.js → index.module-33c313d2.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/{re-render-e06f2f7f.js → re-render-338d931e.js} +1 -1
- package/dist/esm-es5/sqm-asset-card.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat.entry.js +1 -1
- package/dist/esm-es5/sqm-divided-layout_26.entry.js +1 -0
- package/dist/esm-es5/sqm-graphql-client-provider.entry.js +1 -1
- package/dist/esm-es5/{sqm-leaderboard-rank-view-747ffda8.js → sqm-leaderboard-rank-view-4f48da0c.js} +1 -1
- package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm-es5/sqm-leaderboard.entry.js +1 -1
- package/dist/esm-es5/sqm-name-fields.entry.js +1 -1
- package/dist/esm-es5/{sqm-navigation-sidebar-item-view-f2304ad9.js → sqm-navigation-sidebar-item-view-5dfa535f.js} +1 -1
- package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
- package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-email-verification-view-a3ebc4a2.js → sqm-portal-email-verification-view-87bf8191.js} +1 -1
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-footer-view-7b8a02b1.js → sqm-portal-footer-view-da135cff.js} +1 -1
- package/dist/esm-es5/sqm-portal-footer.entry.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-4ce8d89d.js → sqm-portal-profile-view-8781176c.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-reset-password.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-verify-email.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table-column.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table-date-column.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table-rewards-column.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table-status-column.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table-user-column.entry.js +1 -1
- package/dist/esm-es5/sqm-share-code.entry.js +1 -1
- package/dist/esm-es5/useDemoBigStat-2fe92931.js +1 -0
- package/dist/mint-components/global/styles.ts +69 -278
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/mint-components.js +1 -1
- package/dist/mint-components/{p-3397167c.entry.js → p-01722953.entry.js} +1 -1
- package/dist/mint-components/{p-1a09e4e1.system.entry.js → p-086aaa1e.system.entry.js} +1 -1
- package/dist/mint-components/{p-8435a22d.entry.js → p-0f84ebfe.entry.js} +1 -1
- package/dist/mint-components/{p-304e6c82.system.entry.js → p-1369c11a.system.entry.js} +1 -1
- package/dist/mint-components/{p-29fab29b.entry.js → p-156464b2.entry.js} +1 -1
- package/dist/mint-components/p-1915df27.system.entry.js +1 -0
- package/dist/mint-components/{p-3ce2fb83.system.js → p-1996e9c8.system.js} +1 -1
- package/dist/mint-components/{p-08e75345.system.entry.js → p-21bb74aa.system.entry.js} +1 -1
- package/dist/mint-components/{p-69bcf4fa.system.entry.js → p-2a6f038c.system.entry.js} +1 -1
- package/dist/mint-components/{p-0c67ccfd.system.entry.js → p-2ad23b02.system.entry.js} +1 -1
- package/dist/mint-components/p-33b57b39.system.entry.js +1 -0
- package/dist/mint-components/{p-24c9a599.system.entry.js → p-34dea514.system.entry.js} +1 -1
- package/dist/mint-components/{p-221a4097.entry.js → p-36de7c74.entry.js} +1 -1
- package/dist/mint-components/p-39c466fb.entry.js +1 -0
- package/dist/mint-components/{p-b7ea778a.js → p-4843c461.js} +1 -1
- package/dist/mint-components/{p-563253e8.js → p-48cdbd66.js} +1 -1
- package/dist/mint-components/{p-a2c3cff3.js → p-4a313a31.js} +1 -1
- package/dist/mint-components/p-4cabd25b.entry.js +1 -0
- package/dist/mint-components/{p-ffbe112d.system.js → p-4e61f958.system.js} +1 -1
- package/dist/mint-components/{p-5480e4ee.entry.js → p-5950e58a.entry.js} +1 -1
- package/dist/mint-components/{p-55508395.system.entry.js → p-683a4971.system.entry.js} +1 -1
- package/dist/mint-components/p-6a44136e.js +227 -0
- package/dist/mint-components/p-7129015b.system.js +1 -0
- package/dist/mint-components/{p-c79c608d.system.entry.js → p-713ea21e.system.entry.js} +1 -1
- package/dist/mint-components/{p-593d2266.system.js → p-754060c8.system.js} +2 -2
- package/dist/mint-components/{p-d174d0bc.system.entry.js → p-772341ce.system.entry.js} +1 -1
- package/dist/mint-components/{p-be2738b0.system.entry.js → p-775529b9.system.entry.js} +1 -1
- package/dist/mint-components/{p-24b3c6f0.system.entry.js → p-7b7613cf.system.entry.js} +1 -1
- package/dist/mint-components/{p-cca9026f.system.entry.js → p-7c3a270c.system.entry.js} +1 -1
- package/dist/mint-components/{p-c9e3b7bc.js → p-83bdbf25.js} +1 -1
- package/dist/mint-components/{p-d35b0366.js → p-846cebe7.js} +1 -1
- package/dist/mint-components/{p-43fc3f99.system.js → p-871ed4c8.system.js} +1 -1
- package/dist/mint-components/p-8cbc24b8.entry.js +9 -0
- package/dist/mint-components/{p-b7fc2c67.entry.js → p-8d65fef3.entry.js} +1 -1
- package/dist/mint-components/{p-1bfed119.system.js → p-8e87084e.system.js} +1 -1
- package/dist/mint-components/{p-45c752a0.entry.js → p-a011c13c.entry.js} +1 -1
- package/dist/mint-components/{p-9d6dbb2d.entry.js → p-b1e03222.entry.js} +1 -1
- package/dist/mint-components/p-b3bda4e8.entry.js +1 -0
- package/dist/mint-components/{p-ade44a4e.entry.js → p-b3e976e0.entry.js} +1 -1
- package/dist/mint-components/p-b462e84e.system.js +1 -0
- package/dist/mint-components/{p-dc75a335.js → p-b4fc47a0.js} +2 -2
- package/dist/mint-components/{p-224504ad.js → p-bbb3ff09.js} +1 -1
- package/dist/mint-components/{p-0382a7b0.entry.js → p-c03c68c1.entry.js} +1 -1
- package/dist/mint-components/{p-a4c2c7ed.entry.js → p-c1cadf29.entry.js} +1 -1
- package/dist/mint-components/p-c324b1e8.system.js +1 -0
- package/dist/mint-components/{p-3d856985.entry.js → p-c32fb8e5.entry.js} +1 -1
- package/dist/mint-components/{p-0b4af41a.system.entry.js → p-c35bb682.system.entry.js} +1 -1
- package/dist/mint-components/{p-412a9226.system.entry.js → p-c434c33a.system.entry.js} +1 -1
- package/dist/mint-components/{p-8ee4c2d2.system.js → p-c43f3b6b.system.js} +1 -1
- package/dist/mint-components/p-cff66d2e.entry.js +1 -0
- package/dist/mint-components/p-d1604020.system.js +1 -0
- package/dist/mint-components/p-d482d10c.entry.js +1 -0
- package/dist/mint-components/p-d8a80855.entry.js +1 -0
- package/dist/mint-components/{p-4052b948.system.entry.js → p-dd0b0a4a.system.entry.js} +1 -1
- package/dist/mint-components/{p-73148868.system.entry.js → p-e2fc8abf.system.entry.js} +1 -1
- package/dist/mint-components/{p-2e43ba45.entry.js → p-e52c77cd.entry.js} +2 -2
- package/dist/mint-components/p-e835c56c.system.entry.js +1 -0
- package/dist/mint-components/{p-e817ca6b.js → p-e83632dd.js} +1 -1
- package/dist/mint-components/{p-396bf448.system.entry.js → p-ead730e0.system.entry.js} +1 -1
- package/dist/mint-components/p-ec3b7256.entry.js +230 -0
- package/dist/mint-components/p-ec8f1962.system.entry.js +1 -0
- package/dist/mint-components/p-ee6f5a1c.system.js +1 -0
- package/dist/mint-components/{p-ad0f47dc.js → p-f02360c9.js} +1 -1
- package/dist/mint-components/{p-772f52da.entry.js → p-f4a9712a.entry.js} +2 -2
- package/dist/mint-components/p-fa20e730.entry.js +1 -0
- package/dist/mint-components/{p-223b42bd.system.entry.js → p-ff3c9d53.system.entry.js} +1 -1
- package/dist/mint-components/{p-d60085ae.system.entry.js → p-ff3d1ed1.system.entry.js} +1 -1
- package/dist/types/components/sqm-big-stat/sqm-big-stat-view.d.ts +0 -1
- package/dist/types/components/sqm-big-stat/useBigStat.d.ts +1 -4
- package/dist/types/components/sqm-portal-forgot-password/sqm-portal-forgot-password-view.d.ts +1 -0
- package/dist/types/components/sqm-portal-forgot-password/sqm-portal-forgot-password.d.ts +4 -0
- package/dist/types/components/sqm-portal-forgot-password/usePortalForgotPassword.d.ts +2 -1
- package/dist/types/components/sqm-portal-login/sqm-portal-login-view.d.ts +2 -0
- package/dist/types/components/sqm-portal-login/sqm-portal-login.d.ts +8 -0
- package/dist/types/components/sqm-portal-login/usePortalLogin.d.ts +3 -3
- package/dist/types/components/sqm-portal-register/sqm-portal-register-view.d.ts +1 -0
- package/dist/types/components/sqm-portal-register/sqm-portal-register.d.ts +4 -0
- package/dist/types/components/sqm-portal-register/usePortalRegister.d.ts +1 -0
- package/dist/types/{tables → components/sqm-referral-table}/re-render.d.ts +0 -0
- package/dist/types/{tables → components/sqm-referral-table}/sqm-table-cell.d.ts +0 -0
- package/dist/types/{tables → components/sqm-referral-table}/sqm-table-row.d.ts +0 -0
- package/dist/types/{tables → components/sqm-referral-table}/useChildElements.d.ts +0 -0
- package/dist/types/components.d.ts +32 -269
- package/dist/types/global/styles.d.ts +1 -1
- package/dist/types/{components/sqm-asset-card → stories}/AssetCard.stories.d.ts +0 -0
- package/dist/types/{components/sqm-big-stat → stories}/BigStat.stories.d.ts +0 -0
- package/dist/types/{components/sqm-portal-change-password → stories}/ChangePassword.stories.d.ts +0 -0
- package/dist/types/{components/sqm-divided-layout → stories}/DividedLayout.stories.d.ts +0 -0
- package/dist/types/{components/sqm-edit-profile → stories}/EditProfileForm.stories.d.ts +0 -0
- package/dist/types/{components/sqm-form-message → stories}/FormMessage.stories.d.ts +0 -0
- package/dist/types/{components/sqm-hero → stories}/Hero.stories.d.ts +0 -0
- package/dist/types/{components/sqm-leaderboard → stories}/Leaderboard.stories.d.ts +0 -0
- package/dist/types/{components/sqm-leaderboard-rank → stories}/LeaderboardRank.stories.d.ts +0 -0
- package/dist/types/{components/sqm-name-fields → stories}/NameFields.stories.d.ts +0 -0
- package/dist/types/{components/sqm-navigation-sidebar → stories}/NavigationSidebar.stories.d.ts +0 -0
- package/dist/types/{components/sqm-password-field → stories}/PasswordField.stories.d.ts +0 -0
- package/dist/types/{components/sqm-portal-email-verification → stories}/PortalEmailVerification.stories.d.ts +0 -0
- package/dist/types/{components/sqm-portal-footer → stories}/PortalFooter.stories.d.ts +0 -0
- package/dist/types/{components/sqm-portal-forgot-password → stories}/PortalForgotPassword.stories.d.ts +0 -0
- package/dist/types/{components/sqm-portal-frame → stories}/PortalFrame.stories.d.ts +0 -0
- package/dist/types/{components/sqm-portal-login → stories}/PortalLogin.stories.d.ts +0 -0
- package/dist/types/{components/sqm-portal-profile → stories}/PortalProfile.stories.d.ts +0 -0
- package/dist/types/{components/sqm-portal-register → stories}/PortalRegister.stories.d.ts +0 -0
- package/dist/types/{components/sqm-portal-reset-password → stories}/PortalResetPassword.stories.d.ts +0 -0
- package/dist/types/{components/sqm-portal-verify-email → stories}/PortalVerifyEmail.stories.d.ts +0 -0
- package/dist/types/{components/sqm-program-menu → stories}/ProgramMenu.stories.d.ts +0 -0
- package/dist/types/{components/sqm-referral-iframe → stories}/ReferralIframe.stories.d.ts +0 -0
- package/dist/types/{components/sqm-referral-table → stories}/ReferralTable.stories.d.ts +0 -0
- package/dist/types/{components/sqm-referral-table → stories}/ReferralTableCell.stories.d.ts +0 -0
- package/dist/types/{components/sqm-referral-table → stories}/ReferralTableRewardsCell.stories.d.ts +0 -0
- package/dist/types/{components/sqm-router → stories}/Router.stories.d.ts +0 -0
- package/dist/types/{components/sqm-share-button → stories}/ShareButton.stories.d.ts +0 -0
- package/dist/types/{components/sqm-share-link → stories}/ShareLink.stories.d.ts +0 -0
- package/dist/types/{components/sqm-navigation-sidebar-item → stories}/SidebarItem.stories.d.ts +0 -0
- package/dist/types/{components/sqm-big-stat → stories}/UseBigStat.stories.d.ts +0 -6
- package/dist/types/{components/sqm-edit-profile → stories}/UseEditProfile.stories.d.ts +0 -0
- package/dist/types/{components/sqm-leaderboard → stories}/UseLeaderboard.stories.d.ts +0 -0
- package/dist/types/{components/sqm-share-button → stories}/UseShareButton.stories.d.ts +0 -0
- package/dist/types/{components/sqm-share-link → stories}/UseShareLink.stories.d.ts +0 -0
- package/dist/types/stories/UserName.stories.d.ts +6 -0
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +2 -2
- package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeList.stories.js +0 -21
- package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeListData.js +0 -218
- package/dist/collection/components/sqm-reward-exchange-list/SVGs.js +0 -8
- package/dist/collection/components/sqm-reward-exchange-list/UseRewardExchangeList.stories.js +0 -143
- package/dist/collection/components/sqm-reward-exchange-list/assets/Reward-icon.png +0 -0
- package/dist/collection/components/sqm-reward-exchange-list/progressBar.js +0 -60
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +0 -270
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +0 -121
- package/dist/collection/components/sqm-reward-exchange-list/useRewardExchangeList.js +0 -198
- package/dist/collection/components/sqm-rewards-table/UseRewardsTable.stories.js +0 -53
- package/dist/collection/components/sqm-rewards-table/sqm-rewards-table-column.js +0 -120
- package/dist/collection/components/sqm-rewards-table/sqm-rewards-table.js +0 -222
- package/dist/collection/components/sqm-rewards-table/useRewardsTable.js +0 -194
- package/dist/collection/components/sqm-task-card/Matrix.js +0 -63
- package/dist/collection/components/sqm-task-card/SVGs.js +0 -9
- package/dist/collection/components/sqm-task-card/TaskCard.stories.js +0 -330
- package/dist/collection/components/sqm-task-card/UseTaskCard.stories.js +0 -41
- package/dist/collection/components/sqm-task-card/progress-bar/SVGs.js +0 -7
- package/dist/collection/components/sqm-task-card/progress-bar/progress-bar-view.js +0 -311
- package/dist/collection/components/sqm-task-card/progress-bar/progress-bar.stories.js +0 -53
- package/dist/collection/components/sqm-task-card/sqm-task-card-view.js +0 -164
- package/dist/collection/components/sqm-task-card/sqm-task-card.js +0 -384
- package/dist/collection/tables/GenericTableView.js +0 -51
- package/dist/collection/tables/TableSlots.js +0 -22
- package/dist/esm-es5/sqm-divided-layout_30.entry.js +0 -1
- package/dist/esm-es5/useDemoBigStat-c3b955b7.js +0 -1
- package/dist/mint-components/assets/Reward-icon.png +0 -0
- package/dist/mint-components/p-160bd62f.entry.js +0 -1
- package/dist/mint-components/p-1c8b0290.entry.js +0 -1
- package/dist/mint-components/p-1dcdca58.system.entry.js +0 -1
- package/dist/mint-components/p-20d41ab1.entry.js +0 -1
- package/dist/mint-components/p-3b97aed8.system.js +0 -1
- package/dist/mint-components/p-6e245fa3.system.entry.js +0 -1
- package/dist/mint-components/p-883a32e7.entry.js +0 -1
- package/dist/mint-components/p-8a7ac67b.entry.js +0 -335
- package/dist/mint-components/p-9c554ca0.system.js +0 -1
- package/dist/mint-components/p-9e4fee30.system.entry.js +0 -1
- package/dist/mint-components/p-b8bd2607.entry.js +0 -1
- package/dist/mint-components/p-bbf5ba89.system.entry.js +0 -1
- package/dist/mint-components/p-c6114bfe.system.js +0 -1
- package/dist/mint-components/p-cd410a05.entry.js +0 -9
- package/dist/mint-components/p-cdeae699.system.js +0 -1
- package/dist/mint-components/p-f17050de.entry.js +0 -1
- package/dist/mint-components/p-f90486ca.js +0 -235
- package/dist/mint-components/p-fce1dbf6.entry.js +0 -1
- package/dist/mint-components/p-ff616282.system.js +0 -1
- package/dist/types/components/sqm-reward-exchange-list/RewardExchangeList.stories.d.ts +0 -6
- package/dist/types/components/sqm-reward-exchange-list/RewardExchangeListData.d.ts +0 -81
- package/dist/types/components/sqm-reward-exchange-list/SVGs.d.ts +0 -3
- package/dist/types/components/sqm-reward-exchange-list/UseRewardExchangeList.stories.d.ts +0 -28
- package/dist/types/components/sqm-reward-exchange-list/progressBar.d.ts +0 -4
- package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.d.ts +0 -25
- package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list.d.ts +0 -20
- package/dist/types/components/sqm-reward-exchange-list/useRewardExchangeList.d.ts +0 -43
- package/dist/types/components/sqm-rewards-table/UseRewardsTable.stories.d.ts +0 -16
- package/dist/types/components/sqm-rewards-table/sqm-rewards-table-column.d.ts +0 -20
- package/dist/types/components/sqm-rewards-table/sqm-rewards-table.d.ts +0 -32
- package/dist/types/components/sqm-rewards-table/useRewardsTable.d.ts +0 -38
- package/dist/types/components/sqm-task-card/Matrix.d.ts +0 -11
- package/dist/types/components/sqm-task-card/SVGs.d.ts +0 -2
- package/dist/types/components/sqm-task-card/TaskCard.stories.d.ts +0 -11
- package/dist/types/components/sqm-task-card/UseTaskCard.stories.d.ts +0 -10
- package/dist/types/components/sqm-task-card/progress-bar/SVGs.d.ts +0 -1
- package/dist/types/components/sqm-task-card/progress-bar/progress-bar-view.d.ts +0 -9
- package/dist/types/components/sqm-task-card/progress-bar/progress-bar.stories.d.ts +0 -12
- package/dist/types/components/sqm-task-card/sqm-task-card-view.d.ts +0 -16
- package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +0 -73
- package/dist/types/components/sqm-user-name/UserName.stories.d.ts +0 -6
- package/dist/types/tables/GenericTableView.d.ts +0 -29
- package/dist/types/tables/TableSlots.d.ts +0 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { h, r as registerInstance, c as Host
|
|
1
|
+
import { h, r as registerInstance, c as Host } from './index-17b4da69.js';
|
|
2
2
|
import { m as h$1, j as useState, e as useEffect, f as useRef, n as d$2, y as y$1, b as browser, u as useReducer, c as createCommonjsModule, a as commonjsGlobal, k as useMemo } from './extends-3a3f9fe2.js';
|
|
3
|
-
import { i as intl, a as insertCSS } from './global-
|
|
3
|
+
import { i as intl, a as insertCSS } from './global-cc82aa03.js';
|
|
4
4
|
import { u as useCallback } from './use-callback-b38a1523.js';
|
|
5
|
-
import { d as dist, T as T$1, e as en, b as be, j as j$1, Z as Ze, r as rn, D as De, q as qe, P as P$1, E as Ee, M as M$1, a as sn, c as an, x as x$1, f as D$1, L as L$1
|
|
5
|
+
import { d as dist, T as T$1, e as en, b as be, j as j$1, Z as Ze, r as rn, D as De, q as qe, P as P$1, E as Ee, M as M$1, a as sn, c as an, x as x$1, f as D$1, L as L$1 } from './index.module-33c313d2.js';
|
|
6
6
|
import { j as jsonpointer } from './jsonpointer-388a7082.js';
|
|
7
7
|
import { j as jss, c as create } from './jss-preset-default.esm-71fae192.js';
|
|
8
8
|
import { g as getProps, a as getMissingProps } from './utils-454405f5.js';
|
|
@@ -11,21 +11,21 @@ import { E as ErrorStyles, H as HostBlock, A as AuthWrapper, a as AuthColumn, b
|
|
|
11
11
|
import { P as PortalContainerView } from './sqm-portal-container-view-73757ca5.js';
|
|
12
12
|
import { P as PortalSectionView } from './sqm-portal-section-view-f0876545.js';
|
|
13
13
|
import { T as TextSpanView } from './sqm-text-span-view-1781df94.js';
|
|
14
|
-
import { g as gql, L as LeaderboardRankView } from './sqm-leaderboard-rank-view-
|
|
15
|
-
import { u as useRerenderListener
|
|
16
|
-
import { p as pathToRegexp, B as BigStatView, u as useBigStat, a as useDemoBigStat } from './useDemoBigStat-
|
|
14
|
+
import { g as gql, L as LeaderboardRankView } from './sqm-leaderboard-rank-view-4f48da0c.js';
|
|
15
|
+
import { u as useRerenderListener } from './re-render-338d931e.js';
|
|
16
|
+
import { p as pathToRegexp, B as BigStatView, u as useBigStat, a as useDemoBigStat } from './useDemoBigStat-2fe92931.js';
|
|
17
17
|
import { S as ShareLinkView } from './sqm-share-link-view-9282b8e8.js';
|
|
18
|
-
import { L as LeaderboardView, u as useLeaderboard, S as ShadowViewAddon } from './ShadowViewAddon-
|
|
18
|
+
import { L as LeaderboardView, u as useLeaderboard, S as ShadowViewAddon } from './ShadowViewAddon-2e3ea31f.js';
|
|
19
19
|
import { N as NavigationSidebarView } from './sqm-navigation-sidebar-view-2242502c.js';
|
|
20
|
-
import { N as NavigationSidebarItemView } from './sqm-navigation-sidebar-item-view-
|
|
20
|
+
import { N as NavigationSidebarItemView } from './sqm-navigation-sidebar-item-view-5dfa535f.js';
|
|
21
21
|
import { S as StatContainerView } from './sqm-stat-container-view-4133feb6.js';
|
|
22
|
-
import { P as PortalProfileView } from './sqm-portal-profile-view-
|
|
22
|
+
import { P as PortalProfileView } from './sqm-portal-profile-view-8781176c.js';
|
|
23
23
|
import { P as PortalForgotPasswordView } from './sqm-portal-forgot-password-view-e3a6a716.js';
|
|
24
|
-
import { P as PortalEmailVerificationView } from './sqm-portal-email-verification-view-
|
|
24
|
+
import { P as PortalEmailVerificationView } from './sqm-portal-email-verification-view-87bf8191.js';
|
|
25
25
|
import { P as PortalResetPasswordView$1 } from './sqm-portal-reset-password-view-a4e50da2.js';
|
|
26
26
|
import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-6f18bac2.js';
|
|
27
27
|
import { A as AssetCardView } from './sqm-asset-card-view-6f360937.js';
|
|
28
|
-
import { P as PoweredByImg$1, a as PortalFooterView } from './sqm-portal-footer-view-
|
|
28
|
+
import { P as PoweredByImg$1, a as PortalFooterView } from './sqm-portal-footer-view-da135cff.js';
|
|
29
29
|
import { H as HeroView } from './sqm-hero-view-bfd8abd1.js';
|
|
30
30
|
import { N as NameFieldsView } from './sqm-name-fields-view-4162fb7b.js';
|
|
31
31
|
|
|
@@ -1390,7 +1390,7 @@ function PortalLoginView(props) {
|
|
|
1390
1390
|
content.secondaryButton))));
|
|
1391
1391
|
}
|
|
1392
1392
|
|
|
1393
|
-
function usePortalLogin(
|
|
1393
|
+
function usePortalLogin(props) {
|
|
1394
1394
|
var _a, _b, _c, _d;
|
|
1395
1395
|
const [request, { loading, errors, data }] = qe();
|
|
1396
1396
|
const [error, setError] = useState("");
|
|
@@ -1410,7 +1410,7 @@ function usePortalLogin({ nextPage }) {
|
|
|
1410
1410
|
if ((_a = data === null || data === void 0 ? void 0 : data.authenticateManagedIdentityWithEmailAndPassword) === null || _a === void 0 ? void 0 : _a.token) {
|
|
1411
1411
|
urlParams.delete("nextPage");
|
|
1412
1412
|
rn.push({
|
|
1413
|
-
pathname: nextPageOverride || nextPage,
|
|
1413
|
+
pathname: nextPageOverride || props.nextPage,
|
|
1414
1414
|
search: urlParams.toString() && "?" + urlParams.toString(),
|
|
1415
1415
|
});
|
|
1416
1416
|
}
|
|
@@ -1426,6 +1426,8 @@ function usePortalLogin({ nextPage }) {
|
|
|
1426
1426
|
states: {
|
|
1427
1427
|
loading,
|
|
1428
1428
|
error: errorMessage,
|
|
1429
|
+
registerPath: props.registerPath,
|
|
1430
|
+
forgotPasswordPath: props.registerPath
|
|
1429
1431
|
},
|
|
1430
1432
|
callbacks: {
|
|
1431
1433
|
submit,
|
|
@@ -1465,6 +1467,14 @@ const PortalLogin = class {
|
|
|
1465
1467
|
* @uiName Heading label
|
|
1466
1468
|
*/
|
|
1467
1469
|
this.pageLabel = "Sign in to your account";
|
|
1470
|
+
/**
|
|
1471
|
+
* @uiName Routing path to register page
|
|
1472
|
+
*/
|
|
1473
|
+
this.registerPath = "/register";
|
|
1474
|
+
/**
|
|
1475
|
+
* @uiName Routing path to forgot password page
|
|
1476
|
+
*/
|
|
1477
|
+
this.forgotPasswordPath = "/forgotPassword";
|
|
1468
1478
|
h$1(this);
|
|
1469
1479
|
}
|
|
1470
1480
|
disconnectedCallback() { }
|
|
@@ -1473,8 +1483,8 @@ const PortalLogin = class {
|
|
|
1473
1483
|
? useLoginDemo(this)
|
|
1474
1484
|
: usePortalLogin(this);
|
|
1475
1485
|
const content = {
|
|
1476
|
-
forgotPasswordButton: (h("slot", { name: "forgotPassword" }, h("a", { onClick: () => rn.push(
|
|
1477
|
-
secondaryButton: (h("slot", { name: "secondaryButton" }, h("sl-button", { type: "text", disabled: states.loading, onClick: () => rn.push(
|
|
1486
|
+
forgotPasswordButton: (h("slot", { name: "forgotPassword" }, h("a", { onClick: () => rn.push(states.forgotPasswordPath) }, this.forgotPasswordLabel))),
|
|
1487
|
+
secondaryButton: (h("slot", { name: "secondaryButton" }, h("sl-button", { type: "text", disabled: states.loading, onClick: () => rn.push(states.registerPath) }, this.registerLabel))),
|
|
1478
1488
|
emailLabel: this.emailLabel,
|
|
1479
1489
|
passwordLabel: this.passwordLabel,
|
|
1480
1490
|
submitLabel: this.submitLabel,
|
|
@@ -1485,7 +1495,12 @@ const PortalLogin = class {
|
|
|
1485
1495
|
};
|
|
1486
1496
|
function useLoginDemo(props) {
|
|
1487
1497
|
return cjs({
|
|
1488
|
-
states: {
|
|
1498
|
+
states: {
|
|
1499
|
+
error: "",
|
|
1500
|
+
loading: false,
|
|
1501
|
+
forgotPasswordPath: "/forgotPassword",
|
|
1502
|
+
registerPath: "/register",
|
|
1503
|
+
},
|
|
1489
1504
|
callbacks: {
|
|
1490
1505
|
submit: async (_event) => {
|
|
1491
1506
|
console.log("submit");
|
|
@@ -5540,6 +5555,7 @@ function usePortalRegister(props) {
|
|
|
5540
5555
|
validationState,
|
|
5541
5556
|
confirmPassword: props.confirmPassword,
|
|
5542
5557
|
hideInputs: props.hideInputs,
|
|
5558
|
+
loginPath: props.loginPath
|
|
5543
5559
|
},
|
|
5544
5560
|
callbacks: {
|
|
5545
5561
|
submit,
|
|
@@ -5595,6 +5611,10 @@ const PortalRegister = class {
|
|
|
5595
5611
|
* @uiName Heading label
|
|
5596
5612
|
*/
|
|
5597
5613
|
this.pageLabel = "Register";
|
|
5614
|
+
/**
|
|
5615
|
+
* @uiName Routing path to login page
|
|
5616
|
+
*/
|
|
5617
|
+
this.loginPath = "/login";
|
|
5598
5618
|
h$1(this);
|
|
5599
5619
|
}
|
|
5600
5620
|
disconnectedCallback() { }
|
|
@@ -5604,7 +5624,7 @@ const PortalRegister = class {
|
|
|
5604
5624
|
: usePortalRegister(this);
|
|
5605
5625
|
const content = {
|
|
5606
5626
|
formData: h("slot", { name: "formData" }),
|
|
5607
|
-
secondaryButton: (h("slot", { name: "secondaryButton" }, h("sl-button", { type: "text", disabled: states.loading, onClick: () => rn.push(
|
|
5627
|
+
secondaryButton: (h("slot", { name: "secondaryButton" }, h("sl-button", { type: "text", disabled: states.loading, onClick: () => rn.push(states.loginPath) }, this.loginLabel))),
|
|
5608
5628
|
emailLabel: this.emailLabel,
|
|
5609
5629
|
passwordLabel: this.passwordLabel,
|
|
5610
5630
|
submitLabel: this.submitLabel,
|
|
@@ -5622,6 +5642,7 @@ function useRegisterDemo(props) {
|
|
|
5622
5642
|
confirmPassword: true,
|
|
5623
5643
|
hideInputs: props.hideInputs || false,
|
|
5624
5644
|
customPasswordField: false,
|
|
5645
|
+
loginPath: "/login",
|
|
5625
5646
|
},
|
|
5626
5647
|
callbacks: {
|
|
5627
5648
|
submit: async (_event) => {
|
|
@@ -14745,1271 +14766,345 @@ const ReferralTableUserCell = class {
|
|
|
14745
14766
|
}
|
|
14746
14767
|
};
|
|
14747
14768
|
|
|
14748
|
-
const
|
|
14749
|
-
|
|
14750
|
-
|
|
14751
|
-
|
|
14752
|
-
|
|
14753
|
-
|
|
14754
|
-
|
|
14755
|
-
|
|
14756
|
-
|
|
14757
|
-
|
|
14758
|
-
|
|
14759
|
-
|
|
14760
|
-
|
|
14761
|
-
|
|
14762
|
-
|
|
14763
|
-
|
|
14764
|
-
|
|
14765
|
-
|
|
14766
|
-
|
|
14767
|
-
|
|
14768
|
-
|
|
14769
|
-
|
|
14770
|
-
|
|
14771
|
-
|
|
14772
|
-
|
|
14773
|
-
globalRewardKey
|
|
14774
|
-
destinationUnit
|
|
14775
|
-
steps {
|
|
14776
|
-
sourceValue
|
|
14777
|
-
prettySourceValue
|
|
14778
|
-
destinationValue
|
|
14779
|
-
prettyDestinationValue
|
|
14780
|
-
available
|
|
14781
|
-
unavailableReasonCode
|
|
14782
|
-
}
|
|
14783
|
-
}
|
|
14784
|
-
totalCount
|
|
14785
|
-
}
|
|
14786
|
-
}
|
|
14787
|
-
}
|
|
14788
|
-
}
|
|
14789
|
-
`;
|
|
14790
|
-
const EXCHANGE = dist.gql `
|
|
14791
|
-
mutation exchange($exchangeRewardInput: ExchangeRewardInput!) {
|
|
14792
|
-
exchangeReward(exchangeRewardInput: $exchangeRewardInput) {
|
|
14793
|
-
reward {
|
|
14794
|
-
id
|
|
14795
|
-
fuelTankCode
|
|
14796
|
-
}
|
|
14797
|
-
}
|
|
14798
|
-
}
|
|
14799
|
-
`;
|
|
14800
|
-
function useRewardExchangeList(props) {
|
|
14801
|
-
var _a, _b, _c, _d;
|
|
14802
|
-
const drawerRef = useRef();
|
|
14803
|
-
const [exchangeState, setExchangeState] = useReducer((state, next) => ({
|
|
14804
|
-
...state,
|
|
14805
|
-
...next,
|
|
14806
|
-
}), {
|
|
14807
|
-
selectedItem: undefined,
|
|
14808
|
-
selectedStep: undefined,
|
|
14809
|
-
redeemStage: "chooseReward",
|
|
14810
|
-
amount: 0,
|
|
14811
|
-
exchangeError: false,
|
|
14812
|
-
});
|
|
14813
|
-
const { selectedItem, selectedStep, redeemStage, amount, exchangeError } = exchangeState;
|
|
14814
|
-
const user = T$1();
|
|
14815
|
-
const [exchange, { data: exchangeResponse, errors }] = be(EXCHANGE);
|
|
14816
|
-
const { data, loading } = en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
14769
|
+
const debug$1 = browser("sq:useRouter");
|
|
14770
|
+
function matchPath(pattern, page) {
|
|
14771
|
+
if (!pattern)
|
|
14772
|
+
return;
|
|
14773
|
+
const regexp = pathToRegexp(pattern);
|
|
14774
|
+
return regexp.exec(page);
|
|
14775
|
+
}
|
|
14776
|
+
function useRouter() {
|
|
14777
|
+
const location = an();
|
|
14778
|
+
const host = P$1();
|
|
14779
|
+
const [slot, setSlot] = useState(undefined);
|
|
14780
|
+
const [container, setContainer] = useState(undefined);
|
|
14781
|
+
const page = location.pathname;
|
|
14782
|
+
// convert sqm-routes into templates
|
|
14783
|
+
useEffect(() => {
|
|
14784
|
+
const routes = host.querySelectorAll(`sqm-route`);
|
|
14785
|
+
const routesArray = Array.from(routes);
|
|
14786
|
+
routesArray.forEach((route) => {
|
|
14787
|
+
const newTemplate = document.createElement("template");
|
|
14788
|
+
newTemplate.setAttribute("path", route.path);
|
|
14789
|
+
newTemplate.innerHTML = route.innerHTML;
|
|
14790
|
+
route.parentNode.appendChild(newTemplate);
|
|
14791
|
+
route.parentNode.removeChild(route);
|
|
14792
|
+
});
|
|
14793
|
+
}, []);
|
|
14817
14794
|
useEffect(() => {
|
|
14818
14795
|
var _a, _b;
|
|
14819
|
-
if (
|
|
14820
|
-
|
|
14821
|
-
}
|
|
14822
|
-
if (!!errors) {
|
|
14823
|
-
console.log("YEA");
|
|
14824
|
-
setExchangeState({ exchangeError: true });
|
|
14825
|
-
}
|
|
14826
|
-
}, [exchangeResponse, errors]);
|
|
14827
|
-
function openDrawer() {
|
|
14828
|
-
var _a;
|
|
14829
|
-
setExchangeState({ redeemStage: "chooseReward" });
|
|
14830
|
-
(_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.show();
|
|
14831
|
-
}
|
|
14832
|
-
function exchangeReward() {
|
|
14833
|
-
if (!selectedItem)
|
|
14796
|
+
if (!container || !slot) {
|
|
14797
|
+
debug$1("DOM not ready for navigation rendering on:", page);
|
|
14834
14798
|
return;
|
|
14835
|
-
let exchangeVariables = {
|
|
14836
|
-
accountId: user === null || user === void 0 ? void 0 : user.accountId,
|
|
14837
|
-
userId: user.id,
|
|
14838
|
-
};
|
|
14839
|
-
switch (selectedItem.ruleType) {
|
|
14840
|
-
case "FIXED_GLOBAL_REWARD":
|
|
14841
|
-
exchangeVariables = {
|
|
14842
|
-
...exchangeVariables,
|
|
14843
|
-
redeemCreditInput: {
|
|
14844
|
-
amount: selectedItem.sourceValue,
|
|
14845
|
-
unit: selectedItem.sourceUnit,
|
|
14846
|
-
},
|
|
14847
|
-
globalRewardKey: selectedItem.globalRewardKey,
|
|
14848
|
-
};
|
|
14849
|
-
break;
|
|
14850
|
-
case "VARIABLE_GLOBAL_REWARD":
|
|
14851
|
-
exchangeVariables = {
|
|
14852
|
-
...exchangeVariables,
|
|
14853
|
-
redeemCreditInput: {
|
|
14854
|
-
amount: amount,
|
|
14855
|
-
unit: selectedItem.sourceUnit,
|
|
14856
|
-
},
|
|
14857
|
-
globalRewardKey: selectedItem.globalRewardKey,
|
|
14858
|
-
rewardInput: {
|
|
14859
|
-
valueInCents: selectedStep.destinationValue,
|
|
14860
|
-
},
|
|
14861
|
-
};
|
|
14862
|
-
break;
|
|
14863
|
-
case "VARIABLE_CREDIT_REWARD":
|
|
14864
|
-
exchangeVariables = {
|
|
14865
|
-
...exchangeVariables,
|
|
14866
|
-
redeemCreditInput: {
|
|
14867
|
-
amount: amount,
|
|
14868
|
-
unit: selectedItem.sourceUnit,
|
|
14869
|
-
},
|
|
14870
|
-
rewardInput: {
|
|
14871
|
-
type: "CREDIT",
|
|
14872
|
-
unit: selectedItem.destinationUnit,
|
|
14873
|
-
assignedCredit: selectedStep.destinationValue,
|
|
14874
|
-
},
|
|
14875
|
-
};
|
|
14876
|
-
break;
|
|
14877
|
-
default:
|
|
14878
|
-
exchangeVariables = {
|
|
14879
|
-
...exchangeVariables,
|
|
14880
|
-
redeemCreditInput: {
|
|
14881
|
-
amount: selectedItem.sourceValue,
|
|
14882
|
-
unit: selectedItem.sourceUnit,
|
|
14883
|
-
},
|
|
14884
|
-
globalRewardKey: selectedItem.globalRewardKey,
|
|
14885
|
-
};
|
|
14886
14799
|
}
|
|
14887
|
-
|
|
14888
|
-
|
|
14889
|
-
|
|
14890
|
-
|
|
14891
|
-
|
|
14892
|
-
|
|
14893
|
-
|
|
14894
|
-
|
|
14895
|
-
|
|
14896
|
-
amount: 0,
|
|
14897
|
-
selectedStep: undefined,
|
|
14898
|
-
selectedItem: undefined,
|
|
14899
|
-
exchangeError: false,
|
|
14800
|
+
// <template>
|
|
14801
|
+
const templates = slot.querySelectorAll(`template`);
|
|
14802
|
+
const templatesArray = Array.from(templates);
|
|
14803
|
+
const template = templatesArray.find((template) => {
|
|
14804
|
+
var _a, _b, _c;
|
|
14805
|
+
//@ts-ignore
|
|
14806
|
+
const path = (_b = (_a = template.attributes) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.nodeValue;
|
|
14807
|
+
if ((_c = matchPath(path, page)) === null || _c === void 0 ? void 0 : _c.length)
|
|
14808
|
+
return template;
|
|
14900
14809
|
});
|
|
14901
|
-
|
|
14902
|
-
|
|
14903
|
-
|
|
14810
|
+
//@ts-ignore - can't access template attributes directly
|
|
14811
|
+
const templatePath = (_b = (_a = template === null || template === void 0 ? void 0 : template.attributes) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.nodeValue;
|
|
14812
|
+
debug$1({
|
|
14813
|
+
containerDatasetPage: container.dataset.page,
|
|
14814
|
+
templatePath,
|
|
14815
|
+
page,
|
|
14816
|
+
});
|
|
14817
|
+
// if no routes found, and the old route doesn't match the new route
|
|
14818
|
+
if (!template) {
|
|
14819
|
+
// No matching page, display nothing
|
|
14820
|
+
debug$1("No matching page found for ", page, ", so render nothing");
|
|
14821
|
+
container.innerHTML = "";
|
|
14822
|
+
container.dataset.page = page;
|
|
14904
14823
|
return;
|
|
14905
|
-
|
|
14906
|
-
|
|
14907
|
-
|
|
14908
|
-
|
|
14909
|
-
|
|
14910
|
-
|
|
14911
|
-
|
|
14912
|
-
|
|
14913
|
-
|
|
14914
|
-
|
|
14824
|
+
}
|
|
14825
|
+
debug$1("Page updated to ", page, template);
|
|
14826
|
+
// if pathToRegexp results truthy or page is an exact match
|
|
14827
|
+
if (!!matchPath(templatePath, container.dataset.page)) {
|
|
14828
|
+
debug$1("don't rerender");
|
|
14829
|
+
// Same page, do not re-render
|
|
14830
|
+
// Reduces dom mutations, speeds up page speed
|
|
14831
|
+
}
|
|
14832
|
+
else if (template) {
|
|
14833
|
+
container.innerHTML = template.innerHTML;
|
|
14834
|
+
container.dataset.page = page;
|
|
14835
|
+
}
|
|
14836
|
+
}, [slot, container, page]);
|
|
14915
14837
|
return {
|
|
14916
|
-
states: {
|
|
14917
|
-
content: {
|
|
14918
|
-
text: props,
|
|
14919
|
-
},
|
|
14920
|
-
selectedItem,
|
|
14921
|
-
redeemStage,
|
|
14922
|
-
amount,
|
|
14923
|
-
selectedStep,
|
|
14924
|
-
exchangeError,
|
|
14925
|
-
loading,
|
|
14926
|
-
},
|
|
14927
|
-
data: {
|
|
14928
|
-
exchangeList: (_b = (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.visibleRewardExchangeItems) === null || _b === void 0 ? void 0 : _b.data,
|
|
14929
|
-
//@ts-ignore
|
|
14930
|
-
fuelTankCode: (_d = (_c = exchangeResponse === null || exchangeResponse === void 0 ? void 0 : exchangeResponse.exchangeReward) === null || _c === void 0 ? void 0 : _c.reward) === null || _d === void 0 ? void 0 : _d.fuelTankCode,
|
|
14931
|
-
},
|
|
14932
14838
|
callbacks: {
|
|
14933
|
-
|
|
14934
|
-
|
|
14935
|
-
setExchangeState,
|
|
14936
|
-
setStage,
|
|
14937
|
-
},
|
|
14938
|
-
refs: {
|
|
14939
|
-
drawerRef,
|
|
14839
|
+
setSlot,
|
|
14840
|
+
setContainer,
|
|
14940
14841
|
},
|
|
14941
14842
|
};
|
|
14942
14843
|
}
|
|
14943
14844
|
|
|
14944
|
-
const
|
|
14945
|
-
h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.34655 1.90573C7.75405 2.31323 7.75405 2.97392 7.34655 3.38143L3.56266 7.16531H14.9565C15.5328 7.16531 16 7.6325 16 8.20879C16 8.78509 15.5328 9.25227 14.9565 9.25227H3.56266L7.69437 13.384C8.10188 13.7915 8.10188 14.4522 7.69437 14.8597C7.28687 15.2672 6.62617 15.2672 6.21867 14.8597L0.305628 8.94664C-0.101876 8.53914 -0.101876 7.87845 0.305628 7.47094L5.87084 1.90573C6.27835 1.49822 6.93904 1.49822 7.34655 1.90573Z", fill: "#858585" })));
|
|
14946
|
-
const ExchangeArrows = () => (h("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
14947
|
-
h("circle", { cx: "15", cy: "15", r: "15", fill: "white" }),
|
|
14948
|
-
h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10.6255 21.783C10.5129 21.8963 10.3597 21.96 10.2 21.96C10.0402 21.96 9.88705 21.8963 9.77442 21.783L5.87442 17.8597C5.64081 17.6247 5.64194 17.2448 5.87695 17.0112C6.11197 16.7775 6.49186 16.7787 6.72548 17.0137L9.59995 19.9054V8.52001C9.59995 8.18864 9.86858 7.92001 10.2 7.92001C10.5313 7.92001 10.8 8.18864 10.8 8.52001V19.9054L13.6744 17.0137C13.908 16.7787 14.2879 16.7775 14.5229 17.0112C14.758 17.2448 14.7591 17.6247 14.5255 17.8597L10.6255 21.783ZM20.2255 8.09707C20.1129 7.98378 19.9597 7.92007 19.8 7.92007C19.6402 7.92007 19.487 7.98378 19.3744 8.09707L15.4744 12.0204C15.2408 12.2554 15.2419 12.6353 15.477 12.8689C15.712 13.1025 16.0919 13.1014 16.3255 12.8664L19.2 9.97473V21.3601C19.2 21.6914 19.4686 21.9601 19.8 21.9601C20.1313 21.9601 20.4 21.6914 20.4 21.3601V9.97473L23.2744 12.8664C23.508 13.1014 23.8879 13.1025 24.1229 12.8689C24.358 12.6353 24.3591 12.2554 24.1255 12.0204L20.2255 8.09707Z", fill: "#333333" })));
|
|
14949
|
-
const CheckMark = () => (h("svg", { style: { top: "-4px", position: "relative", left: "2px" }, xmlns: "http://www.w3.org/2000/svg", width: "10", height: "7", viewBox: "0 0 10 7", fill: "none" },
|
|
14950
|
-
h("path", { d: "M2.12828 2.71485C1.72536 2.33712 1.09253 2.35754 0.714799 2.76045C0.337068 3.16336 0.357483 3.7962 0.760395 4.17393L2.12828 2.71485ZM3.81471 5.66661L3.13076 6.39615C3.51542 6.75677 4.11399 6.75677 4.49865 6.39615L3.81471 5.66661ZM9.23939 1.95171C9.6423 1.57397 9.66271 0.941139 9.28498 0.538227C8.90725 0.135315 8.27442 0.114901 7.87151 0.492631L9.23939 1.95171ZM0.760395 4.17393L3.13076 6.39615L4.49865 4.93708L2.12828 2.71485L0.760395 4.17393ZM4.49865 6.39615L9.23939 1.95171L7.87151 0.492631L3.13076 4.93708L4.49865 6.39615Z", fill: "white" })));
|
|
14951
|
-
|
|
14952
|
-
function Dot({ active, completed, incomplete, }) {
|
|
14953
|
-
return (h("div", { style: {
|
|
14954
|
-
flex: "0 0 0",
|
|
14955
|
-
content: "''",
|
|
14956
|
-
height: "4px",
|
|
14957
|
-
borderRadius: "4px",
|
|
14958
|
-
background: incomplete ? "#E5E5E5" : "#9E9E9E",
|
|
14959
|
-
position: "relative",
|
|
14960
|
-
bottom: "0",
|
|
14961
|
-
left: "0",
|
|
14962
|
-
display: "flex",
|
|
14963
|
-
justifyContent: "center",
|
|
14964
|
-
columnGap: "50px",
|
|
14965
|
-
marginRight: "-2px",
|
|
14966
|
-
boxSizing: "content-box",
|
|
14967
|
-
} },
|
|
14968
|
-
h("div", { style: {
|
|
14969
|
-
backgroundColor: completed ? "#9E9E9E" : "#FFF",
|
|
14970
|
-
border: active
|
|
14971
|
-
? "2px solid #9E9E9E"
|
|
14972
|
-
: incomplete
|
|
14973
|
-
? "2px solid #E5E5E5"
|
|
14974
|
-
: "none",
|
|
14975
|
-
borderRadius: "50%",
|
|
14976
|
-
width: completed ? "14px" : "10px",
|
|
14977
|
-
height: completed ? "14px" : "10px",
|
|
14978
|
-
margin: "-5px auto 0px",
|
|
14979
|
-
zIndex: "1",
|
|
14980
|
-
boxSizing: "content-box",
|
|
14981
|
-
} }, completed && h(CheckMark, null))));
|
|
14982
|
-
}
|
|
14983
|
-
function ProgressLine({ incomplete = false, active = false }) {
|
|
14984
|
-
return (h("div", { style: {
|
|
14985
|
-
content: "''",
|
|
14986
|
-
flex: "0.5 0.5 0",
|
|
14987
|
-
height: "4px",
|
|
14988
|
-
borderRadius: "4px",
|
|
14989
|
-
background: incomplete || active ? "#E5E5E5" : "#9E9E9E",
|
|
14990
|
-
position: "relative",
|
|
14991
|
-
bottom: "0",
|
|
14992
|
-
left: "0",
|
|
14993
|
-
display: "flex",
|
|
14994
|
-
justifyContent: "center",
|
|
14995
|
-
columnGap: "50px",
|
|
14996
|
-
marginRight: "-2px",
|
|
14997
|
-
boxSizing: "content-box",
|
|
14998
|
-
} }));
|
|
14999
|
-
}
|
|
15000
|
-
function Progress({ active, completed, incomplete }) {
|
|
15001
|
-
return [
|
|
15002
|
-
h(ProgressLine, { incomplete: incomplete }),
|
|
15003
|
-
h(Dot, { active: active, completed: completed, incomplete: incomplete }),
|
|
15004
|
-
h(ProgressLine, { incomplete: incomplete, active: active }),
|
|
15005
|
-
];
|
|
15006
|
-
}
|
|
15007
|
-
function ProgressBar({ stageCount, currentStage, }) {
|
|
15008
|
-
return (h("div", { style: { display: "flex", columnGap: "-2px" } }, Array.from(Array(stageCount).keys()).map((stage) => (h(Progress, { active: currentStage === stage, completed: currentStage > stage, incomplete: currentStage < stage })))));
|
|
15009
|
-
}
|
|
15010
|
-
|
|
15011
|
-
const stageList = ["chooseReward", "chooseAmount", "confirmation", "success"];
|
|
15012
|
-
const stageProgressList = {
|
|
15013
|
-
chooseReward: "Choose reward",
|
|
15014
|
-
chooseAmount: "Amount",
|
|
15015
|
-
confirmation: "Confirm",
|
|
15016
|
-
};
|
|
15017
|
-
function RewardExchangeView(props) {
|
|
15018
|
-
const style = {
|
|
15019
|
-
Container: {
|
|
15020
|
-
position: "relative",
|
|
15021
|
-
display: "flex",
|
|
15022
|
-
},
|
|
15023
|
-
CardContainer: {
|
|
15024
|
-
"&:hover": {
|
|
15025
|
-
boxShadow: "0 3px 10px #87ceeb6e!important",
|
|
15026
|
-
},
|
|
15027
|
-
},
|
|
15028
|
-
Base: {
|
|
15029
|
-
display: "flex",
|
|
15030
|
-
cursor: "pointer",
|
|
15031
|
-
textAlign: "center",
|
|
15032
|
-
height: "120px",
|
|
15033
|
-
"&::part(base)": {
|
|
15034
|
-
width: "100%",
|
|
15035
|
-
maxWidth: "350px",
|
|
15036
|
-
display: "flex",
|
|
15037
|
-
margin: "0 auto",
|
|
15038
|
-
},
|
|
15039
|
-
"&::part(body)": {
|
|
15040
|
-
padding: 0,
|
|
15041
|
-
display: "flex",
|
|
15042
|
-
width: "100%",
|
|
15043
|
-
},
|
|
15044
|
-
},
|
|
15045
|
-
Drawer: {
|
|
15046
|
-
"&::part(base)": {
|
|
15047
|
-
minWidth: "400px",
|
|
15048
|
-
maxWidth: "700px",
|
|
15049
|
-
width: "50%",
|
|
15050
|
-
margin: "0 auto",
|
|
15051
|
-
right: "0",
|
|
15052
|
-
},
|
|
15053
|
-
"&::part(panel)": {
|
|
15054
|
-
height: "85vh",
|
|
15055
|
-
width: "100%",
|
|
15056
|
-
},
|
|
15057
|
-
},
|
|
15058
|
-
FullImage: {
|
|
15059
|
-
objectFit: "contain",
|
|
15060
|
-
maxWidth: "100%",
|
|
15061
|
-
height: "100px",
|
|
15062
|
-
},
|
|
15063
|
-
PreviewImage: {
|
|
15064
|
-
objectFit: "contain",
|
|
15065
|
-
width: "120px",
|
|
15066
|
-
height: "120px",
|
|
15067
|
-
flex: 0.33,
|
|
15068
|
-
},
|
|
15069
|
-
InputBox: {
|
|
15070
|
-
width: "100%",
|
|
15071
|
-
marginBottom: "20px",
|
|
15072
|
-
},
|
|
15073
|
-
Select: {
|
|
15074
|
-
"&::part(base)": {
|
|
15075
|
-
flex: "0.75",
|
|
15076
|
-
},
|
|
15077
|
-
"&::part(menu)": {
|
|
15078
|
-
maxHeight: "40vh",
|
|
15079
|
-
},
|
|
15080
|
-
},
|
|
15081
|
-
Buttons: {
|
|
15082
|
-
marginLeft: "auto",
|
|
15083
|
-
width: "100%",
|
|
15084
|
-
maxWidth: "300px",
|
|
15085
|
-
},
|
|
15086
|
-
Button: {
|
|
15087
|
-
margin: "10px 0",
|
|
15088
|
-
display: "block",
|
|
15089
|
-
textAlign: "center",
|
|
15090
|
-
cursor: "pointer",
|
|
15091
|
-
},
|
|
15092
|
-
ProgressBar: {
|
|
15093
|
-
fontSize: "80%",
|
|
15094
|
-
marginBottom: "20px",
|
|
15095
|
-
"& .text-area": {
|
|
15096
|
-
marginTop: "5px",
|
|
15097
|
-
display: "flex",
|
|
15098
|
-
justifyContent: "center",
|
|
15099
|
-
textAlign: "center",
|
|
15100
|
-
whiteSpace: "nowrap",
|
|
15101
|
-
marginBottom: "6px",
|
|
15102
|
-
"& .text": {
|
|
15103
|
-
flex: "1 1 0",
|
|
15104
|
-
},
|
|
15105
|
-
"& .text.subdued": {
|
|
15106
|
-
color: "#BDBDBD",
|
|
15107
|
-
},
|
|
15108
|
-
},
|
|
15109
|
-
},
|
|
15110
|
-
};
|
|
15111
|
-
// JSS config
|
|
15112
|
-
jss.setup(create());
|
|
15113
|
-
const sheet = jss.createStyleSheet(style);
|
|
15114
|
-
const styleString = sheet.toString();
|
|
15115
|
-
const { states, data, callbacks, refs } = props;
|
|
15116
|
-
const { selectedItem, selectedStep } = states;
|
|
15117
|
-
function getInput() {
|
|
15118
|
-
var _a, _b;
|
|
15119
|
-
const item = states.selectedItem;
|
|
15120
|
-
if (!item || (item === null || item === void 0 ? void 0 : item.ruleType) === "FIXED_GLOBAL_REWARD")
|
|
15121
|
-
return h("span", null);
|
|
15122
|
-
if (!((_a = item.steps) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
15123
|
-
return h("p", null,
|
|
15124
|
-
"Not enough ",
|
|
15125
|
-
item.sourceUnit,
|
|
15126
|
-
" to redeem for this reward.");
|
|
15127
|
-
}
|
|
15128
|
-
return (h("sl-select", { style: { width: "auto" }, label: "Select amount to receive", class: sheet.classes.Select, value: states.selectedStep, "onSl-select": (e) => {
|
|
15129
|
-
var _a, _b, _c, _d, _e;
|
|
15130
|
-
return callbacks.setExchangeState({
|
|
15131
|
-
amount: (_c = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.sourceValue,
|
|
15132
|
-
selectedStep: (_e = (_d = e.detail) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.value,
|
|
15133
|
-
});
|
|
15134
|
-
} }, (_b = item.steps) === null || _b === void 0 ? void 0 : _b.map((step) => (h("sl-menu-item", { value: step, disabled: !step.available },
|
|
15135
|
-
step.prettyDestinationValue,
|
|
15136
|
-
h("div", { slot: "suffix", style: { fontSize: "75%", float: "right" } },
|
|
15137
|
-
step.prettySourceValue,
|
|
15138
|
-
step.unavailableReasonCode && (h("p", { style: { fontSize: "70%", color: "#F2994A" } }, step.unavailableReasonCode))))))));
|
|
15139
|
-
}
|
|
15140
|
-
function chooseReward() {
|
|
15141
|
-
var _a;
|
|
15142
|
-
const nextStage = "chooseAmount";
|
|
15143
|
-
// console.log({ nextStage, ruleType: selectedItem?.ruleType });
|
|
15144
|
-
return [
|
|
15145
|
-
h("div", { style: {
|
|
15146
|
-
display: "grid",
|
|
15147
|
-
justifyContent: "center",
|
|
15148
|
-
gap: "20px",
|
|
15149
|
-
gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
15150
|
-
} }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
|
|
15151
|
-
const style = {
|
|
15152
|
-
boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) ? "0 1px 8px #87ceeb" : "none",
|
|
15153
|
-
marginBottom: "10px 0",
|
|
15154
|
-
flex: "1",
|
|
15155
|
-
minWidth: "100%",
|
|
15156
|
-
color: !item.available && "#eee",
|
|
15157
|
-
};
|
|
15158
|
-
const amount = item.ruleType === "FIXED_GLOBAL_REWARD"
|
|
15159
|
-
? item.prettySourceValue
|
|
15160
|
-
: `${item.sourceMinValue} to ${item.prettySourceMaxValue}`;
|
|
15161
|
-
return (h("div", { key: item.key, class: item.available ? sheet.classes.CardContainer : "", style: style },
|
|
15162
|
-
h("sl-card", { class: sheet.classes.Base, onClick: () => item.available &&
|
|
15163
|
-
callbacks.setExchangeState({ selectedItem: item }) },
|
|
15164
|
-
// item?.imageUrl &&
|
|
15165
|
-
h("img", { class: sheet.classes.PreviewImage, src: (item === null || item === void 0 ? void 0 : item.imageUrl) || getAssetPath("./assets/Reward-icon.png") }),
|
|
15166
|
-
h("p", { style: {
|
|
15167
|
-
textAlign: "left",
|
|
15168
|
-
margin: "0",
|
|
15169
|
-
flex: "1",
|
|
15170
|
-
fontSize: "90%",
|
|
15171
|
-
padding: "8px"
|
|
15172
|
-
} },
|
|
15173
|
-
h("b", null, item.description),
|
|
15174
|
-
h("p", { style: { margin: "0" } }, amount),
|
|
15175
|
-
item.unavailableReasonCode && (h("p", { style: {
|
|
15176
|
-
fontSize: "70%",
|
|
15177
|
-
color: "#F2994A",
|
|
15178
|
-
marginTop: "0",
|
|
15179
|
-
} }, item.unavailableReasonCode ===
|
|
15180
|
-
"INSUFFICIENT_REDEEMABLE_CREDIT"
|
|
15181
|
-
? "Not enough points"
|
|
15182
|
-
: item.unavailableReasonCode))))));
|
|
15183
|
-
})),
|
|
15184
|
-
h("div", { class: sheet.classes.Buttons },
|
|
15185
|
-
h("sl-button", { onClick: () => callbacks.setStage(nextStage), style: { display: "block" }, class: sheet.classes.Button, disabled: !states.selectedItem }, "Continue"),
|
|
15186
|
-
h("a", {
|
|
15187
|
-
// onClick={() => refs.drawerRef.current?.hide()}
|
|
15188
|
-
style: { display: "block" }, class: sheet.classes.Button }, "Cancel")),
|
|
15189
|
-
];
|
|
15190
|
-
}
|
|
15191
|
-
function chooseAmount() {
|
|
15192
|
-
const input = getInput();
|
|
15193
|
-
return (h("div", null,
|
|
15194
|
-
h("div", { style: { width: "50%", margin: "0 auto" } }, (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) && (h("img", { class: sheet.classes.FullImage, src: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl }))),
|
|
15195
|
-
h("p", null, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description),
|
|
15196
|
-
h("div", { class: sheet.classes.InputBox }, input),
|
|
15197
|
-
h("div", { class: sheet.classes.Buttons },
|
|
15198
|
-
h("sl-button", { onClick: () => callbacks.setStage("confirmation"), disabled: input && !states.amount, style: { display: "block" }, class: sheet.classes.Button }, "Continue"),
|
|
15199
|
-
h("a", { onClick: () => callbacks.setStage("chooseReward"), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
|
|
15200
|
-
}
|
|
15201
|
-
// console.log({ selectedItem, selectedStep });
|
|
15202
|
-
function confirmation() {
|
|
15203
|
-
const previousStage = "chooseAmount";
|
|
15204
|
-
return (h("div", null,
|
|
15205
|
-
h("h2", null, "Confirm and redeem"),
|
|
15206
|
-
h("div", { style: { textAlign: "center" } },
|
|
15207
|
-
h("p", null,
|
|
15208
|
-
h("b", null, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettySourceValue)),
|
|
15209
|
-
h("p", null,
|
|
15210
|
-
h(ExchangeArrows, null)),
|
|
15211
|
-
h("div", { class: sheet.classes.CardContainer, style: {
|
|
15212
|
-
boxShadow: "none",
|
|
15213
|
-
marginBottom: "10px",
|
|
15214
|
-
flex: "1",
|
|
15215
|
-
minWidth: "100%",
|
|
15216
|
-
} },
|
|
15217
|
-
h("sl-card", { class: sheet.classes.Base },
|
|
15218
|
-
h("img", { class: sheet.classes.PreviewImage, src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
|
|
15219
|
-
getAssetPath("./assets/Reward-icon.png") }),
|
|
15220
|
-
h("p", { style: { marginBottom: "0", flex: "1" } }, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue)))),
|
|
15221
|
-
h("div", { class: sheet.classes.Buttons },
|
|
15222
|
-
h("sl-button", { onClick: callbacks.exchangeReward, style: { display: "block" }, class: sheet.classes.Button }, "Redeem"),
|
|
15223
|
-
h("a", { onClick: () => callbacks.setStage(previousStage), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
|
|
15224
|
-
}
|
|
15225
|
-
function success() {
|
|
15226
|
-
return (h("div", { style: { textAlign: "center" } },
|
|
15227
|
-
h("img", { class: sheet.classes.FullImage, src: getAssetPath("./assets/Reward-icon.png") }),
|
|
15228
|
-
h("p", { style: { color: "forestgreen" } }, "Reward Redeemed"),
|
|
15229
|
-
(data === null || data === void 0 ? void 0 : data.fuelTankCode) && h("pre", null, data === null || data === void 0 ? void 0 : data.fuelTankCode)));
|
|
15230
|
-
}
|
|
15231
|
-
const stages = {
|
|
15232
|
-
chooseReward: () => chooseReward(),
|
|
15233
|
-
chooseAmount: () => chooseAmount(),
|
|
15234
|
-
confirmation: () => confirmation(),
|
|
15235
|
-
success: () => success(),
|
|
15236
|
-
};
|
|
15237
|
-
const currentStage = stages[states.redeemStage];
|
|
15238
|
-
function stageMap() {
|
|
15239
|
-
const stageNumber = stageList.indexOf(states.redeemStage);
|
|
15240
|
-
return (h("div", { class: sheet.classes.ProgressBar },
|
|
15241
|
-
h("div", { class: "text-area" }, Object.keys(stageProgressList).map((stage) => {
|
|
15242
|
-
if (stage === states.redeemStage) {
|
|
15243
|
-
return h("span", { class: "text" }, stageProgressList[stage]);
|
|
15244
|
-
}
|
|
15245
|
-
else {
|
|
15246
|
-
return (h("span", { class: "text subdued" }, stageProgressList[stage]));
|
|
15247
|
-
}
|
|
15248
|
-
})),
|
|
15249
|
-
h(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
|
|
15250
|
-
}
|
|
15251
|
-
const BackButton = () => {
|
|
15252
|
-
if (states.redeemStage === "success")
|
|
15253
|
-
return "";
|
|
15254
|
-
let previousStage = "";
|
|
15255
|
-
if (states.redeemStage === "confirmation") {
|
|
15256
|
-
previousStage = "chooseAmount";
|
|
15257
|
-
}
|
|
15258
|
-
else if (states.redeemStage === "chooseAmount") {
|
|
15259
|
-
previousStage = "chooseReward";
|
|
15260
|
-
}
|
|
15261
|
-
return (h("div", { slot: "label" },
|
|
15262
|
-
h("a", { style: { cursor: "pointer", fontSize: "80%", color: "#858585" }, onClick: () => callbacks.setStage(previousStage) },
|
|
15263
|
-
h(LeftArrow, null),
|
|
15264
|
-
" Back")));
|
|
15265
|
-
};
|
|
15266
|
-
console.log(props);
|
|
15267
|
-
return (h("div", { class: sheet.classes.Container },
|
|
15268
|
-
h("style", { type: "text/css" }, styleString),
|
|
15269
|
-
h("div", { style: { width: "1920px" } },
|
|
15270
|
-
h(BackButton, null),
|
|
15271
|
-
stageMap(),
|
|
15272
|
-
currentStage && currentStage(),
|
|
15273
|
-
states.exchangeError &&
|
|
15274
|
-
"Something went wrong. Please contact support or try again.")));
|
|
15275
|
-
}
|
|
14845
|
+
const sqmRouterCss = "sqm-router{display:contents}";
|
|
15276
14846
|
|
|
15277
|
-
const
|
|
14847
|
+
const SqmRouter = class {
|
|
15278
14848
|
constructor(hostRef) {
|
|
15279
14849
|
registerInstance(this, hostRef);
|
|
15280
14850
|
this.ignored = true;
|
|
15281
|
-
/**
|
|
15282
|
-
* @uiName Exchange button text
|
|
15283
|
-
*/
|
|
15284
|
-
this.buttonText = "Exchange Rewards";
|
|
15285
14851
|
h$1(this);
|
|
15286
14852
|
}
|
|
15287
14853
|
disconnectedCallback() { }
|
|
15288
14854
|
render() {
|
|
15289
|
-
|
|
15290
|
-
|
|
15291
|
-
// attribute: "listType",
|
|
15292
|
-
// value: this.listType,
|
|
15293
|
-
// },
|
|
15294
|
-
// ]);
|
|
15295
|
-
// if (missingProps) {
|
|
15296
|
-
// return <RequiredPropsError missingProps={missingProps} />;
|
|
15297
|
-
// }
|
|
15298
|
-
const { states, data, callbacks, refs } = j$1()
|
|
15299
|
-
? useRewardExchangeListDemo(getProps(this))
|
|
15300
|
-
: useRewardExchangeList(getProps(this));
|
|
15301
|
-
return (h(Host, { style: { display: "contents" } }, h(RewardExchangeView, { states: states, data: data, callbacks: callbacks, refs: refs })));
|
|
14855
|
+
const { callbacks } = useRouter();
|
|
14856
|
+
return (h(Host, null, h("div", { ref: callbacks.setSlot, style: { display: "none" } }, h("slot", null)), h("div", { style: { display: "contents" }, ref: callbacks.setContainer })));
|
|
15302
14857
|
}
|
|
15303
|
-
static get assetsDirs() { return ["assets"]; }
|
|
15304
14858
|
};
|
|
15305
|
-
|
|
15306
|
-
return cjs({
|
|
15307
|
-
states: {
|
|
15308
|
-
content: {
|
|
15309
|
-
text: props,
|
|
15310
|
-
},
|
|
15311
|
-
redeemStage: "chooseReward",
|
|
15312
|
-
amount: 0,
|
|
15313
|
-
selectedStep: undefined,
|
|
15314
|
-
exchangeError: false,
|
|
15315
|
-
loading: false,
|
|
15316
|
-
},
|
|
15317
|
-
data: {
|
|
15318
|
-
shareCode: "SHARECODE123",
|
|
15319
|
-
},
|
|
15320
|
-
callbacks: {
|
|
15321
|
-
exchangeReward: () => { },
|
|
15322
|
-
openDrawer: () => { },
|
|
15323
|
-
setExchangeState: (_) => { },
|
|
15324
|
-
setStage: (_) => { },
|
|
15325
|
-
},
|
|
15326
|
-
refs: {
|
|
15327
|
-
drawerRef: {},
|
|
15328
|
-
},
|
|
15329
|
-
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
15330
|
-
}
|
|
14859
|
+
SqmRouter.style = sqmRouterCss;
|
|
15331
14860
|
|
|
15332
14861
|
const style$7 = {
|
|
15333
|
-
|
|
15334
|
-
|
|
15335
|
-
|
|
15336
|
-
},
|
|
15337
|
-
TCell: {
|
|
15338
|
-
padding: "var(--sl-spacing-small) var(--sl-spacing-medium) var(--sl-spacing-small) 0",
|
|
15339
|
-
},
|
|
15340
|
-
TRow: {
|
|
15341
|
-
"border-top": "1px solid #EAEAEA",
|
|
15342
|
-
},
|
|
15343
|
-
Table: {
|
|
15344
|
-
"border-collapse": "collapse",
|
|
15345
|
-
width: "100%",
|
|
15346
|
-
},
|
|
15347
|
-
ButtonContainer: {
|
|
15348
|
-
display: "flex",
|
|
15349
|
-
"justify-content": "flex-end",
|
|
15350
|
-
"margin-top": "var(--sl-spacing-small)",
|
|
15351
|
-
...gap({ direction: "row", size: "var(--sl-spacing-small)" }),
|
|
14862
|
+
HostBlock: HostBlock,
|
|
14863
|
+
buttonStyle: {
|
|
14864
|
+
display: "block",
|
|
15352
14865
|
},
|
|
15353
14866
|
};
|
|
15354
14867
|
jss.setup(create());
|
|
15355
14868
|
const sheet$7 = jss.createStyleSheet(style$7);
|
|
15356
14869
|
const styleString$7 = sheet$7.toString();
|
|
15357
|
-
function
|
|
15358
|
-
|
|
15359
|
-
const { columns, rows } = elements;
|
|
15360
|
-
const { show } = states;
|
|
15361
|
-
return (h("div", null,
|
|
14870
|
+
function ShareButtonView(props, children) {
|
|
14871
|
+
return props.hide ? (h(Host, { style: { display: "none" } })) : (h("div", null,
|
|
15362
14872
|
h("style", { type: "text/css" }, styleString$7),
|
|
15363
|
-
h("
|
|
15364
|
-
|
|
15365
|
-
|
|
15366
|
-
|
|
15367
|
-
h("tbody", null,
|
|
15368
|
-
show === "loading" && elements.loadingElement,
|
|
15369
|
-
show === "empty" && elements.emptyElement,
|
|
15370
|
-
show === "rows" && (rows === null || rows === void 0 ? void 0 : rows.map((row, i) => (h("tr", { class: sheet$7.classes.TRow, style: {
|
|
15371
|
-
borderTop: `${!data.textOverrides.showLabels && i === 0 ? "none" : ""}`,
|
|
15372
|
-
}, part: "table-row" }, row.map((cell) => (h("td", { class: sheet$7.classes.TCell },
|
|
15373
|
-
h(TextSpanView, { type: "p" }, cell)))))))))),
|
|
15374
|
-
h("div", { class: sheet$7.classes.ButtonContainer, part: states.namespace + "-button-wrapper" },
|
|
15375
|
-
h("sl-button", { size: "small", disabled: !states.hasPrev, loading: show === "loading", onClick: callbacks.prevPage, exportparts: "base: defaultbutton-base" }, data.textOverrides.prevLabel),
|
|
15376
|
-
h("sl-button", { size: "small", loading: show === "loading", disabled: !states.hasNext, onClick: callbacks.nextPage, exportparts: "base: defaultbutton-base" }, data.textOverrides.moreLabel))));
|
|
15377
|
-
}
|
|
15378
|
-
|
|
15379
|
-
function LoadingSlot$1() {
|
|
15380
|
-
return (h("slot", { name: "loading" },
|
|
15381
|
-
h(LoadingSkeleton, null)));
|
|
15382
|
-
}
|
|
15383
|
-
function LoadingSkeleton() {
|
|
15384
|
-
return (h("div", { style: { width: "100%" } },
|
|
15385
|
-
h("sl-skeleton", { style: { marginBottom: "28px" } }),
|
|
15386
|
-
h("sl-skeleton", { style: { marginBottom: "28px" } }),
|
|
15387
|
-
h("sl-skeleton", { style: { marginBottom: "28px" } }),
|
|
15388
|
-
h("sl-skeleton", { style: { marginBottom: "28px" } }),
|
|
15389
|
-
h("sl-skeleton", null)));
|
|
15390
|
-
}
|
|
15391
|
-
function EmptySlot$1({ label }) {
|
|
15392
|
-
return (h("slot", { name: "empty" },
|
|
15393
|
-
h(EmptySkeleton, { label: label })));
|
|
15394
|
-
}
|
|
15395
|
-
function EmptySkeleton({ label }) {
|
|
15396
|
-
return (h("div", { style: { width: "100%" } },
|
|
15397
|
-
h("sqm-text", null,
|
|
15398
|
-
h("h3", { style: { color: "#777777" } }, label))));
|
|
15399
|
-
}
|
|
14873
|
+
h("sl-button", { class: sheet$7.classes.buttonStyle, loading: props.loading, disabled: props.disabled, pill: props.pill, size: props.size, type: props.type, onClick: props.onClick, exportparts: `base: ${props.type}sharebutton-base` },
|
|
14874
|
+
!props.hideicon && (h("sl-icon", { slot: props.iconslot, name: props.icon ? props.icon : props.medium, exportparts: "icon" })),
|
|
14875
|
+
!props.hidetext && children)));
|
|
14876
|
+
}
|
|
15400
14877
|
|
|
15401
|
-
const
|
|
15402
|
-
|
|
15403
|
-
|
|
15404
|
-
$
|
|
15405
|
-
$
|
|
15406
|
-
$rewardFilter: RewardFilterInput
|
|
14878
|
+
const MessageLinkQuery = gql `
|
|
14879
|
+
query (
|
|
14880
|
+
$programId: ID
|
|
14881
|
+
$engagementMedium: UserEngagementMedium!
|
|
14882
|
+
$shareMedium: ReferralShareMedium!
|
|
15407
14883
|
) {
|
|
15408
14884
|
viewer {
|
|
15409
14885
|
... on User {
|
|
15410
|
-
|
|
15411
|
-
|
|
15412
|
-
|
|
15413
|
-
|
|
15414
|
-
|
|
15415
|
-
|
|
15416
|
-
type
|
|
15417
|
-
value
|
|
15418
|
-
unit
|
|
15419
|
-
name
|
|
15420
|
-
dateGiven
|
|
15421
|
-
dateExpires
|
|
15422
|
-
dateCancelled
|
|
15423
|
-
dateRedeemed
|
|
15424
|
-
dateScheduledFor
|
|
15425
|
-
fuelTankCode
|
|
15426
|
-
fuelTankType
|
|
15427
|
-
currency
|
|
15428
|
-
prettyValue
|
|
15429
|
-
statuses
|
|
15430
|
-
globalRewardKey
|
|
15431
|
-
programRewardKey
|
|
15432
|
-
rewardRedemptionTransactions {
|
|
15433
|
-
data {
|
|
15434
|
-
exchangedRewards {
|
|
15435
|
-
data {
|
|
15436
|
-
prettyValue
|
|
15437
|
-
type
|
|
15438
|
-
fuelTankCode
|
|
15439
|
-
globalRewardKey
|
|
15440
|
-
}
|
|
15441
|
-
}
|
|
15442
|
-
}
|
|
15443
|
-
}
|
|
15444
|
-
}
|
|
15445
|
-
}
|
|
14886
|
+
messageLink(
|
|
14887
|
+
programId: $programId
|
|
14888
|
+
engagementMedium: $engagementMedium
|
|
14889
|
+
shareMedium: $shareMedium
|
|
14890
|
+
)
|
|
14891
|
+
shareLink(programId: $programId, engagementMedium: $engagementMedium)
|
|
15446
14892
|
}
|
|
15447
14893
|
}
|
|
15448
14894
|
}
|
|
15449
14895
|
`;
|
|
15450
|
-
function
|
|
15451
|
-
|
|
15452
|
-
const
|
|
15453
|
-
|
|
15454
|
-
|
|
15455
|
-
const programId = (_a = props.programId) !== null && _a !== void 0 ? _a : programIdContext;
|
|
15456
|
-
const rewardFilter = {
|
|
15457
|
-
userId_eq: user === null || user === void 0 ? void 0 : user.id,
|
|
15458
|
-
accountId_eq: user === null || user === void 0 ? void 0 : user.accountId,
|
|
15459
|
-
// If no program ID, shows all programs
|
|
15460
|
-
...(programId
|
|
15461
|
-
? programId === "classic"
|
|
15462
|
-
? { programId_exists: false }
|
|
15463
|
-
: { programId_eq: programId }
|
|
15464
|
-
: {}),
|
|
15465
|
-
};
|
|
15466
|
-
const [content, setContent] = useReducer((state, next) => ({
|
|
15467
|
-
...state,
|
|
15468
|
-
...next,
|
|
15469
|
-
}), {
|
|
15470
|
-
columns: [],
|
|
15471
|
-
rows: [],
|
|
15472
|
-
loading: false,
|
|
15473
|
-
page: 0,
|
|
15474
|
-
});
|
|
15475
|
-
const { envelope: rewardsData, states, callbacks, } = sn(GET_REWARDS, (data) => { var _a; return (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.rewards; }, {
|
|
15476
|
-
limit: props.perPage,
|
|
15477
|
-
offset: 0,
|
|
15478
|
-
}, {
|
|
15479
|
-
rewardFilter,
|
|
15480
|
-
}, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
15481
|
-
const tick = useRerenderListener();
|
|
15482
|
-
const components = useChildElements();
|
|
15483
|
-
const data = rewardsData === null || rewardsData === void 0 ? void 0 : rewardsData.data;
|
|
15484
|
-
async function getComponentData(components) {
|
|
15485
|
-
// filter out loading and empty states from columns array
|
|
15486
|
-
const columnComponents = components.filter((component) => component.slot !== "loading" && component.slot !== "empty");
|
|
15487
|
-
// get the column titles (renderLabel is asynchronous)
|
|
15488
|
-
const columnsPromise = columnComponents === null || columnComponents === void 0 ? void 0 : columnComponents.map(async (c) => tryMethod$1(c, () => c.renderLabel()));
|
|
15489
|
-
// get the column cells (renderCell is asynchronous)
|
|
15490
|
-
const cellsPromise = data === null || data === void 0 ? void 0 : data.map(async (r) => {
|
|
15491
|
-
const cellPromise = columnComponents === null || columnComponents === void 0 ? void 0 : columnComponents.map(async (c) => tryMethod$1(c, () => c.renderCell([r], c)));
|
|
15492
|
-
const cells = await Promise.all(cellPromise);
|
|
15493
|
-
return cells;
|
|
15494
|
-
});
|
|
15495
|
-
const rows = cellsPromise && (await Promise.all(cellsPromise)).filter((i) => i);
|
|
15496
|
-
setContent({ rows });
|
|
15497
|
-
const columns = columnsPromise && (await Promise.all(columnsPromise));
|
|
15498
|
-
// Set the content to render and finish loading components
|
|
15499
|
-
setContent({ columns, loading: false, page: states.currentPage });
|
|
14896
|
+
function NativeShare(props, directLink) {
|
|
14897
|
+
const title = props.sharetitle || "Share title";
|
|
14898
|
+
const text = props.sharetext || "Share text";
|
|
14899
|
+
if (directLink === "undefined") {
|
|
14900
|
+
return alert("error: message link undefined!");
|
|
15500
14901
|
}
|
|
15501
|
-
|
|
15502
|
-
|
|
15503
|
-
|
|
15504
|
-
|
|
15505
|
-
|
|
15506
|
-
|
|
15507
|
-
|
|
15508
|
-
|
|
15509
|
-
states.loading || content.loading
|
|
15510
|
-
? "loading"
|
|
15511
|
-
: // 2 - Empty if empty
|
|
15512
|
-
isEmpty
|
|
15513
|
-
? "empty"
|
|
15514
|
-
: // 3 - Then show rows
|
|
15515
|
-
"rows";
|
|
15516
|
-
return {
|
|
15517
|
-
states: {
|
|
15518
|
-
hasNext: states.currentPage < states.pageCount - 1,
|
|
15519
|
-
hasPrev: states.currentPage > 0,
|
|
15520
|
-
show,
|
|
15521
|
-
namespace: CSS_NAMESPACE,
|
|
15522
|
-
},
|
|
15523
|
-
data: {
|
|
15524
|
-
textOverrides: {
|
|
15525
|
-
showLabels: props.showLabels,
|
|
15526
|
-
prevLabel: props.prevLabel,
|
|
15527
|
-
moreLabel: props.moreLabel,
|
|
15528
|
-
},
|
|
15529
|
-
},
|
|
15530
|
-
elements: {
|
|
15531
|
-
columns: content.columns,
|
|
15532
|
-
rows: content.rows,
|
|
15533
|
-
emptyElement,
|
|
15534
|
-
loadingElement,
|
|
15535
|
-
},
|
|
15536
|
-
callbacks: {
|
|
15537
|
-
nextPage: () => {
|
|
15538
|
-
if (states.currentPage === 0)
|
|
15539
|
-
callbacks.setLimit(props.perPage);
|
|
15540
|
-
callbacks.setCurrentPage(states.currentPage + 1);
|
|
15541
|
-
},
|
|
15542
|
-
prevPage: () => {
|
|
15543
|
-
if (states.currentPage === 1)
|
|
15544
|
-
callbacks.setLimit(props.perPage - 1);
|
|
15545
|
-
callbacks.setCurrentPage(states.currentPage - 1);
|
|
15546
|
-
},
|
|
15547
|
-
},
|
|
15548
|
-
};
|
|
15549
|
-
}
|
|
15550
|
-
function generateUserError$1(e) {
|
|
15551
|
-
try {
|
|
15552
|
-
return JSON.stringify(e);
|
|
14902
|
+
if (window.navigator.share) {
|
|
14903
|
+
window.navigator
|
|
14904
|
+
.share({
|
|
14905
|
+
title,
|
|
14906
|
+
text,
|
|
14907
|
+
url: directLink,
|
|
14908
|
+
})
|
|
14909
|
+
.catch((error) => console.error("Error on web share", error));
|
|
15553
14910
|
}
|
|
15554
|
-
|
|
15555
|
-
|
|
14911
|
+
else {
|
|
14912
|
+
alert("Not on a supported device");
|
|
15556
14913
|
}
|
|
15557
14914
|
}
|
|
15558
|
-
|
|
15559
|
-
|
|
15560
|
-
|
|
15561
|
-
|
|
15562
|
-
|
|
15563
|
-
labelPromise = callback();
|
|
14915
|
+
function FacebookShare(directLink, res) {
|
|
14916
|
+
var _a, _b;
|
|
14917
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.messageLink) === "undefined" ||
|
|
14918
|
+
directLink === "undefined") {
|
|
14919
|
+
return alert("error: message link undefined!");
|
|
15564
14920
|
}
|
|
15565
|
-
|
|
15566
|
-
|
|
15567
|
-
|
|
15568
|
-
|
|
15569
|
-
|
|
14921
|
+
if (typeof SquatchAndroid.shareOnFacebook !== "undefined") {
|
|
14922
|
+
return SquatchAndroid.shareOnFacebook(directLink, res.data.viewer.messageLink);
|
|
14923
|
+
}
|
|
14924
|
+
else {
|
|
14925
|
+
return GenericShare(res);
|
|
14926
|
+
}
|
|
14927
|
+
}
|
|
14928
|
+
function GenericShare(res) {
|
|
14929
|
+
var _a, _b;
|
|
14930
|
+
return ((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.messageLink) ? window.open(res.data.viewer.messageLink)
|
|
14931
|
+
: alert("error: message link undefined!");
|
|
14932
|
+
}
|
|
14933
|
+
function useShareButton(props) {
|
|
14934
|
+
var _a, _b;
|
|
14935
|
+
const { sharetitle, sharetext, medium } = props;
|
|
14936
|
+
const programId = props.programId ? props.programId : M$1();
|
|
14937
|
+
const user = T$1();
|
|
14938
|
+
const variables = {
|
|
14939
|
+
engagementMedium: x$1(),
|
|
14940
|
+
programId: programId,
|
|
14941
|
+
shareMedium: medium.toUpperCase(),
|
|
14942
|
+
};
|
|
14943
|
+
// only queries if a programId is available
|
|
14944
|
+
const res = en(MessageLinkQuery, variables, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId);
|
|
14945
|
+
const directLink = (_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.shareLink;
|
|
14946
|
+
const environment = D$1();
|
|
14947
|
+
const hide = (medium.toLocaleUpperCase() === "SMS" &&
|
|
14948
|
+
window.orientation === undefined) ||
|
|
14949
|
+
(medium.toLocaleUpperCase() === "DIRECT" && !window.navigator.share);
|
|
14950
|
+
function onClick() {
|
|
14951
|
+
if (medium.toLocaleUpperCase() === "FACEBOOK" &&
|
|
14952
|
+
environment.type === "SquatchAndroid") {
|
|
14953
|
+
FacebookShare(directLink, res);
|
|
14954
|
+
}
|
|
14955
|
+
else if (medium.toLocaleUpperCase() === "DIRECT") {
|
|
14956
|
+
NativeShare({ sharetitle, sharetext }, directLink);
|
|
15570
14957
|
}
|
|
15571
14958
|
else {
|
|
15572
|
-
|
|
14959
|
+
GenericShare(res);
|
|
15573
14960
|
}
|
|
15574
|
-
return h("span", null);
|
|
15575
|
-
}
|
|
15576
|
-
try {
|
|
15577
|
-
return await labelPromise;
|
|
15578
|
-
}
|
|
15579
|
-
catch (e) {
|
|
15580
|
-
// The column returned a promise, and that promise failed.
|
|
15581
|
-
// This should not happen so we fail fast
|
|
15582
|
-
console.error("Error rendering label", e);
|
|
15583
|
-
const userError = generateUserError$1(e);
|
|
15584
|
-
return (h("details", null,
|
|
15585
|
-
h("summary", null, "Error"),
|
|
15586
|
-
userError));
|
|
15587
14961
|
}
|
|
14962
|
+
return { ...props, loading: res.loading, onClick, hide };
|
|
15588
14963
|
}
|
|
15589
14964
|
|
|
15590
|
-
const
|
|
14965
|
+
const sqmShareButtonCss = ":host{display:block}:host([hidden]){display:none}sl-button{display:block}";
|
|
14966
|
+
|
|
14967
|
+
const ShareButton = class {
|
|
15591
14968
|
constructor(hostRef) {
|
|
15592
14969
|
registerInstance(this, hostRef);
|
|
15593
|
-
/**
|
|
15594
|
-
|
|
15595
|
-
|
|
15596
|
-
|
|
15597
|
-
|
|
15598
|
-
this.
|
|
15599
|
-
/**
|
|
15600
|
-
|
|
15601
|
-
|
|
15602
|
-
|
|
14970
|
+
/**
|
|
14971
|
+
* @uiType string
|
|
14972
|
+
* @uiName Button Style
|
|
14973
|
+
* @uiEnum ["primary" , "success", "info", "warning", "danger", "default", "text" ]
|
|
14974
|
+
*/
|
|
14975
|
+
this.type = "default";
|
|
14976
|
+
/**
|
|
14977
|
+
* @uiName Icon Location
|
|
14978
|
+
* @uiType string
|
|
14979
|
+
* @uiEnum ["prefix", "suffix" ]
|
|
14980
|
+
* @uiEnumNames ["Prefix", "Suffix"]
|
|
14981
|
+
*/
|
|
14982
|
+
this.iconslot = "prefix";
|
|
14983
|
+
/**
|
|
14984
|
+
* @uiName Hide the icon
|
|
14985
|
+
*/
|
|
14986
|
+
this.hideicon = false;
|
|
14987
|
+
/**
|
|
14988
|
+
* @uiName Hide the text
|
|
14989
|
+
*/
|
|
14990
|
+
this.hidetext = false;
|
|
15603
14991
|
h$1(this);
|
|
15604
14992
|
}
|
|
15605
14993
|
disconnectedCallback() { }
|
|
15606
14994
|
render() {
|
|
15607
|
-
const
|
|
15608
|
-
const
|
|
15609
|
-
|
|
15610
|
-
|
|
15611
|
-
|
|
15612
|
-
return (h(GenericTableView, { states: states, data: data, callbacks: callbacks, elements: elements }));
|
|
14995
|
+
const thisProps = getProps(this);
|
|
14996
|
+
const props = j$1()
|
|
14997
|
+
? useDemoShareButton(thisProps)
|
|
14998
|
+
: useShareButton(thisProps);
|
|
14999
|
+
return (h(ShareButtonView, Object.assign({}, props), h("slot", null)));
|
|
15613
15000
|
}
|
|
15614
15001
|
};
|
|
15615
|
-
function
|
|
15002
|
+
function useDemoShareButton(props) {
|
|
15616
15003
|
return cjs({
|
|
15617
|
-
|
|
15618
|
-
|
|
15619
|
-
|
|
15620
|
-
|
|
15621
|
-
|
|
15622
|
-
|
|
15623
|
-
|
|
15624
|
-
|
|
15625
|
-
|
|
15626
|
-
|
|
15627
|
-
|
|
15628
|
-
|
|
15629
|
-
|
|
15630
|
-
prevLabel: props.prevLabel,
|
|
15631
|
-
moreLabel: props.moreLabel,
|
|
15632
|
-
},
|
|
15633
|
-
referralData: [],
|
|
15634
|
-
},
|
|
15635
|
-
elements: {
|
|
15636
|
-
emptyElement: h(EmptySkeleton, { label: "No Rewards Yet" }),
|
|
15637
|
-
loadingElement: h(LoadingSkeleton, null),
|
|
15638
|
-
// TODO: This should be smarter
|
|
15639
|
-
columns: [h("div", null, "Name"), h("div", null, "Email"), h("div", null, "DOB")],
|
|
15640
|
-
rows: [],
|
|
15004
|
+
medium: props.medium,
|
|
15005
|
+
loading: false,
|
|
15006
|
+
disabled: props.disabled,
|
|
15007
|
+
pill: props.pill,
|
|
15008
|
+
type: props.type,
|
|
15009
|
+
size: props.size,
|
|
15010
|
+
hideicon: props.hideicon,
|
|
15011
|
+
hidetext: props.hidetext,
|
|
15012
|
+
iconslot: props.iconslot,
|
|
15013
|
+
icon: props.icon,
|
|
15014
|
+
hide: false,
|
|
15015
|
+
onClick: () => {
|
|
15016
|
+
// TODO: Provide visual feedback
|
|
15641
15017
|
},
|
|
15642
15018
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
15019
|
+
}
|
|
15020
|
+
ShareButton.style = sqmShareButtonCss;
|
|
15021
|
+
|
|
15022
|
+
const MessageLinkQuery$1 = dist.gql `
|
|
15023
|
+
query ($programId: ID) {
|
|
15024
|
+
user: viewer {
|
|
15025
|
+
... on User {
|
|
15026
|
+
shareLink(programId: $programId)
|
|
15027
|
+
}
|
|
15028
|
+
}
|
|
15029
|
+
}
|
|
15030
|
+
`;
|
|
15031
|
+
function useShareLink(props) {
|
|
15032
|
+
var _a, _b;
|
|
15033
|
+
const { programId = M$1() } = props;
|
|
15034
|
+
const user = T$1();
|
|
15035
|
+
const { data } = en(MessageLinkQuery$1, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
15036
|
+
const shareString = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink) !== null && _b !== void 0 ? _b :
|
|
15037
|
+
// Shown during loading
|
|
15038
|
+
"...";
|
|
15039
|
+
const [open, setOpen] = useState(false);
|
|
15040
|
+
function onClick() {
|
|
15041
|
+
// Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
|
|
15042
|
+
// Only if called from a user-initiated event
|
|
15043
|
+
navigator.clipboard.writeText(shareString);
|
|
15044
|
+
setOpen(true);
|
|
15045
|
+
setTimeout(() => setOpen(false), props.tooltiplifespan);
|
|
15046
|
+
}
|
|
15047
|
+
return { ...props, onClick, open, shareString };
|
|
15643
15048
|
}
|
|
15644
15049
|
|
|
15645
|
-
const
|
|
15050
|
+
const DEFAULT_TOOLTIP_LIFESPAN = 1000;
|
|
15051
|
+
const ShareLink = class {
|
|
15646
15052
|
constructor(hostRef) {
|
|
15647
15053
|
registerInstance(this, hostRef);
|
|
15648
15054
|
/**
|
|
15649
|
-
*
|
|
15055
|
+
* This is shown after someone has successfully copied the link to the clipboard.
|
|
15056
|
+
*
|
|
15057
|
+
* @uiName Tooltip text
|
|
15650
15058
|
*/
|
|
15651
|
-
this.
|
|
15059
|
+
this.tooltiptext = "Copied to Clipboard";
|
|
15652
15060
|
/**
|
|
15653
|
-
*
|
|
15061
|
+
* The number of milliseconds that the tooltip will appear for
|
|
15062
|
+
*
|
|
15063
|
+
* @uiName Tooltip lifespan
|
|
15654
15064
|
*/
|
|
15655
|
-
this.
|
|
15065
|
+
this.tooltiplifespan = DEFAULT_TOOLTIP_LIFESPAN;
|
|
15656
15066
|
h$1(this);
|
|
15657
15067
|
}
|
|
15658
15068
|
disconnectedCallback() { }
|
|
15659
|
-
//@ts-ignore
|
|
15660
|
-
async renderCell(data) {
|
|
15661
|
-
// TODO: Do the right thing with many rewards, pending rewards, canceled rewards
|
|
15662
|
-
console.log({ data });
|
|
15663
|
-
return (h("sqm-referral-table-rewards-cell", { rewards: data, hideDetails: this.hideDetails }));
|
|
15664
|
-
}
|
|
15665
|
-
async renderLabel() {
|
|
15666
|
-
return this.columnTitle;
|
|
15667
|
-
}
|
|
15668
15069
|
render() {
|
|
15669
|
-
|
|
15670
|
-
|
|
15070
|
+
const thisProps = getProps(this);
|
|
15071
|
+
const props = j$1()
|
|
15072
|
+
? useDemoShareLink(thisProps)
|
|
15073
|
+
: useShareLink(thisProps);
|
|
15074
|
+
return h(ShareLinkView, Object.assign({}, props));
|
|
15671
15075
|
}
|
|
15672
|
-
};
|
|
15673
|
-
|
|
15674
|
-
const
|
|
15675
|
-
|
|
15676
|
-
|
|
15677
|
-
|
|
15678
|
-
|
|
15679
|
-
|
|
15680
|
-
|
|
15681
|
-
|
|
15682
|
-
|
|
15683
|
-
|
|
15684
|
-
|
|
15685
|
-
|
|
15686
|
-
const page = location.pathname;
|
|
15687
|
-
// convert sqm-routes into templates
|
|
15688
|
-
useEffect(() => {
|
|
15689
|
-
const routes = host.querySelectorAll(`sqm-route`);
|
|
15690
|
-
const routesArray = Array.from(routes);
|
|
15691
|
-
routesArray.forEach((route) => {
|
|
15692
|
-
const newTemplate = document.createElement("template");
|
|
15693
|
-
newTemplate.setAttribute("path", route.path);
|
|
15694
|
-
newTemplate.innerHTML = route.innerHTML;
|
|
15695
|
-
route.parentNode.appendChild(newTemplate);
|
|
15696
|
-
route.parentNode.removeChild(route);
|
|
15697
|
-
});
|
|
15698
|
-
}, []);
|
|
15699
|
-
useEffect(() => {
|
|
15700
|
-
var _a, _b;
|
|
15701
|
-
if (!container || !slot) {
|
|
15702
|
-
debug$1("DOM not ready for navigation rendering on:", page);
|
|
15703
|
-
return;
|
|
15704
|
-
}
|
|
15705
|
-
// <template>
|
|
15706
|
-
const templates = slot.querySelectorAll(`template`);
|
|
15707
|
-
const templatesArray = Array.from(templates);
|
|
15708
|
-
const template = templatesArray.find((template) => {
|
|
15709
|
-
var _a, _b, _c;
|
|
15710
|
-
//@ts-ignore
|
|
15711
|
-
const path = (_b = (_a = template.attributes) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.nodeValue;
|
|
15712
|
-
if ((_c = matchPath(path, page)) === null || _c === void 0 ? void 0 : _c.length)
|
|
15713
|
-
return template;
|
|
15714
|
-
});
|
|
15715
|
-
//@ts-ignore - can't access template attributes directly
|
|
15716
|
-
const templatePath = (_b = (_a = template === null || template === void 0 ? void 0 : template.attributes) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.nodeValue;
|
|
15717
|
-
debug$1({
|
|
15718
|
-
containerDatasetPage: container.dataset.page,
|
|
15719
|
-
templatePath,
|
|
15720
|
-
page,
|
|
15721
|
-
});
|
|
15722
|
-
// if no routes found, and the old route doesn't match the new route
|
|
15723
|
-
if (!template) {
|
|
15724
|
-
// No matching page, display nothing
|
|
15725
|
-
debug$1("No matching page found for ", page, ", so render nothing");
|
|
15726
|
-
container.innerHTML = "";
|
|
15727
|
-
container.dataset.page = page;
|
|
15728
|
-
return;
|
|
15729
|
-
}
|
|
15730
|
-
debug$1("Page updated to ", page, template);
|
|
15731
|
-
// if pathToRegexp results truthy or page is an exact match
|
|
15732
|
-
if (!!matchPath(templatePath, container.dataset.page)) {
|
|
15733
|
-
debug$1("don't rerender");
|
|
15734
|
-
// Same page, do not re-render
|
|
15735
|
-
// Reduces dom mutations, speeds up page speed
|
|
15736
|
-
}
|
|
15737
|
-
else if (template) {
|
|
15738
|
-
container.innerHTML = template.innerHTML;
|
|
15739
|
-
container.dataset.page = page;
|
|
15740
|
-
}
|
|
15741
|
-
}, [slot, container, page]);
|
|
15742
|
-
return {
|
|
15743
|
-
callbacks: {
|
|
15744
|
-
setSlot,
|
|
15745
|
-
setContainer,
|
|
15076
|
+
};
|
|
15077
|
+
function useDemoShareLink(props) {
|
|
15078
|
+
const [open, setOpen] = useState(false);
|
|
15079
|
+
const shareString = "https://www.example.com/sharelink/abc";
|
|
15080
|
+
return cjs({
|
|
15081
|
+
shareString,
|
|
15082
|
+
tooltiptext: props.tooltiptext,
|
|
15083
|
+
open,
|
|
15084
|
+
onClick: () => {
|
|
15085
|
+
// Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
|
|
15086
|
+
// Only if called from a user-initiated event
|
|
15087
|
+
navigator.clipboard.writeText(shareString);
|
|
15088
|
+
setOpen(true);
|
|
15089
|
+
setTimeout(() => setOpen(false), props.tooltiplifespan);
|
|
15746
15090
|
},
|
|
15747
|
-
};
|
|
15091
|
+
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
15748
15092
|
}
|
|
15749
15093
|
|
|
15750
|
-
|
|
15094
|
+
/**
|
|
15095
|
+
* lodash (Custom Build) <https://lodash.com/>
|
|
15096
|
+
* Build: `lodash modularize exports="npm" -o ./`
|
|
15097
|
+
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
15098
|
+
* Released under MIT license <https://lodash.com/license>
|
|
15099
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
15100
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
15101
|
+
*/
|
|
15751
15102
|
|
|
15752
|
-
|
|
15753
|
-
|
|
15754
|
-
registerInstance(this, hostRef);
|
|
15755
|
-
this.ignored = true;
|
|
15756
|
-
h$1(this);
|
|
15757
|
-
}
|
|
15758
|
-
disconnectedCallback() { }
|
|
15759
|
-
render() {
|
|
15760
|
-
const { callbacks } = useRouter();
|
|
15761
|
-
return (h(Host, null, h("div", { ref: callbacks.setSlot, style: { display: "none" } }, h("slot", null)), h("div", { style: { display: "contents" }, ref: callbacks.setContainer })));
|
|
15762
|
-
}
|
|
15763
|
-
};
|
|
15764
|
-
SqmRouter.style = sqmRouterCss;
|
|
15103
|
+
/** Used as references for various `Number` constants. */
|
|
15104
|
+
var INFINITY = 1 / 0;
|
|
15765
15105
|
|
|
15766
|
-
|
|
15767
|
-
|
|
15768
|
-
buttonStyle: {
|
|
15769
|
-
display: "block",
|
|
15770
|
-
},
|
|
15771
|
-
};
|
|
15772
|
-
jss.setup(create());
|
|
15773
|
-
const sheet$8 = jss.createStyleSheet(style$8);
|
|
15774
|
-
const styleString$8 = sheet$8.toString();
|
|
15775
|
-
function ShareButtonView(props, children) {
|
|
15776
|
-
return props.hide ? (h(Host, { style: { display: "none" } })) : (h("div", null,
|
|
15777
|
-
h("style", { type: "text/css" }, styleString$8),
|
|
15778
|
-
h("sl-button", { class: sheet$8.classes.buttonStyle, loading: props.loading, disabled: props.disabled, pill: props.pill, size: props.size, type: props.type, onClick: props.onClick, exportparts: `base: ${props.type}sharebutton-base` },
|
|
15779
|
-
!props.hideicon && (h("sl-icon", { slot: props.iconslot, name: props.icon ? props.icon : props.medium, exportparts: "icon" })),
|
|
15780
|
-
!props.hidetext && children)));
|
|
15781
|
-
}
|
|
15782
|
-
|
|
15783
|
-
const MessageLinkQuery = gql `
|
|
15784
|
-
query (
|
|
15785
|
-
$programId: ID
|
|
15786
|
-
$engagementMedium: UserEngagementMedium!
|
|
15787
|
-
$shareMedium: ReferralShareMedium!
|
|
15788
|
-
) {
|
|
15789
|
-
viewer {
|
|
15790
|
-
... on User {
|
|
15791
|
-
messageLink(
|
|
15792
|
-
programId: $programId
|
|
15793
|
-
engagementMedium: $engagementMedium
|
|
15794
|
-
shareMedium: $shareMedium
|
|
15795
|
-
)
|
|
15796
|
-
shareLink(programId: $programId, engagementMedium: $engagementMedium)
|
|
15797
|
-
}
|
|
15798
|
-
}
|
|
15799
|
-
}
|
|
15800
|
-
`;
|
|
15801
|
-
function NativeShare(props, directLink) {
|
|
15802
|
-
const title = props.sharetitle || "Share title";
|
|
15803
|
-
const text = props.sharetext || "Share text";
|
|
15804
|
-
if (directLink === "undefined") {
|
|
15805
|
-
return alert("error: message link undefined!");
|
|
15806
|
-
}
|
|
15807
|
-
if (window.navigator.share) {
|
|
15808
|
-
window.navigator
|
|
15809
|
-
.share({
|
|
15810
|
-
title,
|
|
15811
|
-
text,
|
|
15812
|
-
url: directLink,
|
|
15813
|
-
})
|
|
15814
|
-
.catch((error) => console.error("Error on web share", error));
|
|
15815
|
-
}
|
|
15816
|
-
else {
|
|
15817
|
-
alert("Not on a supported device");
|
|
15818
|
-
}
|
|
15819
|
-
}
|
|
15820
|
-
function FacebookShare(directLink, res) {
|
|
15821
|
-
var _a, _b;
|
|
15822
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.messageLink) === "undefined" ||
|
|
15823
|
-
directLink === "undefined") {
|
|
15824
|
-
return alert("error: message link undefined!");
|
|
15825
|
-
}
|
|
15826
|
-
if (typeof SquatchAndroid.shareOnFacebook !== "undefined") {
|
|
15827
|
-
return SquatchAndroid.shareOnFacebook(directLink, res.data.viewer.messageLink);
|
|
15828
|
-
}
|
|
15829
|
-
else {
|
|
15830
|
-
return GenericShare(res);
|
|
15831
|
-
}
|
|
15832
|
-
}
|
|
15833
|
-
function GenericShare(res) {
|
|
15834
|
-
var _a, _b;
|
|
15835
|
-
return ((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.messageLink) ? window.open(res.data.viewer.messageLink)
|
|
15836
|
-
: alert("error: message link undefined!");
|
|
15837
|
-
}
|
|
15838
|
-
function useShareButton(props) {
|
|
15839
|
-
var _a, _b;
|
|
15840
|
-
const { sharetitle, sharetext, medium } = props;
|
|
15841
|
-
const programId = props.programId ? props.programId : M$1();
|
|
15842
|
-
const user = T$1();
|
|
15843
|
-
const variables = {
|
|
15844
|
-
engagementMedium: x$1(),
|
|
15845
|
-
programId: programId,
|
|
15846
|
-
shareMedium: medium.toUpperCase(),
|
|
15847
|
-
};
|
|
15848
|
-
// only queries if a programId is available
|
|
15849
|
-
const res = en(MessageLinkQuery, variables, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId);
|
|
15850
|
-
const directLink = (_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.shareLink;
|
|
15851
|
-
const environment = D$1();
|
|
15852
|
-
const hide = (medium.toLocaleUpperCase() === "SMS" &&
|
|
15853
|
-
window.orientation === undefined) ||
|
|
15854
|
-
(medium.toLocaleUpperCase() === "DIRECT" && !window.navigator.share);
|
|
15855
|
-
function onClick() {
|
|
15856
|
-
if (medium.toLocaleUpperCase() === "FACEBOOK" &&
|
|
15857
|
-
environment.type === "SquatchAndroid") {
|
|
15858
|
-
FacebookShare(directLink, res);
|
|
15859
|
-
}
|
|
15860
|
-
else if (medium.toLocaleUpperCase() === "DIRECT") {
|
|
15861
|
-
NativeShare({ sharetitle, sharetext }, directLink);
|
|
15862
|
-
}
|
|
15863
|
-
else {
|
|
15864
|
-
GenericShare(res);
|
|
15865
|
-
}
|
|
15866
|
-
}
|
|
15867
|
-
return { ...props, loading: res.loading, onClick, hide };
|
|
15868
|
-
}
|
|
15869
|
-
|
|
15870
|
-
const sqmShareButtonCss = ":host{display:block}:host([hidden]){display:none}sl-button{display:block}";
|
|
15871
|
-
|
|
15872
|
-
const ShareButton = class {
|
|
15873
|
-
constructor(hostRef) {
|
|
15874
|
-
registerInstance(this, hostRef);
|
|
15875
|
-
/**
|
|
15876
|
-
* @uiType string
|
|
15877
|
-
* @uiName Button Style
|
|
15878
|
-
* @uiEnum ["primary" , "success", "info", "warning", "danger", "default", "text" ]
|
|
15879
|
-
*/
|
|
15880
|
-
this.type = "default";
|
|
15881
|
-
/**
|
|
15882
|
-
* @uiName Icon Location
|
|
15883
|
-
* @uiType string
|
|
15884
|
-
* @uiEnum ["prefix", "suffix" ]
|
|
15885
|
-
* @uiEnumNames ["Prefix", "Suffix"]
|
|
15886
|
-
*/
|
|
15887
|
-
this.iconslot = "prefix";
|
|
15888
|
-
/**
|
|
15889
|
-
* @uiName Hide the icon
|
|
15890
|
-
*/
|
|
15891
|
-
this.hideicon = false;
|
|
15892
|
-
/**
|
|
15893
|
-
* @uiName Hide the text
|
|
15894
|
-
*/
|
|
15895
|
-
this.hidetext = false;
|
|
15896
|
-
h$1(this);
|
|
15897
|
-
}
|
|
15898
|
-
disconnectedCallback() { }
|
|
15899
|
-
render() {
|
|
15900
|
-
const thisProps = getProps(this);
|
|
15901
|
-
const props = j$1()
|
|
15902
|
-
? useDemoShareButton(thisProps)
|
|
15903
|
-
: useShareButton(thisProps);
|
|
15904
|
-
return (h(ShareButtonView, Object.assign({}, props), h("slot", null)));
|
|
15905
|
-
}
|
|
15906
|
-
};
|
|
15907
|
-
function useDemoShareButton(props) {
|
|
15908
|
-
return cjs({
|
|
15909
|
-
medium: props.medium,
|
|
15910
|
-
loading: false,
|
|
15911
|
-
disabled: props.disabled,
|
|
15912
|
-
pill: props.pill,
|
|
15913
|
-
type: props.type,
|
|
15914
|
-
size: props.size,
|
|
15915
|
-
hideicon: props.hideicon,
|
|
15916
|
-
hidetext: props.hidetext,
|
|
15917
|
-
iconslot: props.iconslot,
|
|
15918
|
-
icon: props.icon,
|
|
15919
|
-
hide: false,
|
|
15920
|
-
onClick: () => {
|
|
15921
|
-
// TODO: Provide visual feedback
|
|
15922
|
-
},
|
|
15923
|
-
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
15924
|
-
}
|
|
15925
|
-
ShareButton.style = sqmShareButtonCss;
|
|
15926
|
-
|
|
15927
|
-
const MessageLinkQuery$1 = dist.gql `
|
|
15928
|
-
query ($programId: ID) {
|
|
15929
|
-
user: viewer {
|
|
15930
|
-
... on User {
|
|
15931
|
-
shareLink(programId: $programId)
|
|
15932
|
-
}
|
|
15933
|
-
}
|
|
15934
|
-
}
|
|
15935
|
-
`;
|
|
15936
|
-
function useShareLink(props) {
|
|
15937
|
-
var _a, _b;
|
|
15938
|
-
const { programId = M$1() } = props;
|
|
15939
|
-
const user = T$1();
|
|
15940
|
-
const { data } = en(MessageLinkQuery$1, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
15941
|
-
const shareString = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink) !== null && _b !== void 0 ? _b :
|
|
15942
|
-
// Shown during loading
|
|
15943
|
-
"...";
|
|
15944
|
-
const [open, setOpen] = useState(false);
|
|
15945
|
-
function onClick() {
|
|
15946
|
-
// Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
|
|
15947
|
-
// Only if called from a user-initiated event
|
|
15948
|
-
navigator.clipboard.writeText(shareString);
|
|
15949
|
-
setOpen(true);
|
|
15950
|
-
setTimeout(() => setOpen(false), props.tooltiplifespan);
|
|
15951
|
-
}
|
|
15952
|
-
return { ...props, onClick, open, shareString };
|
|
15953
|
-
}
|
|
15954
|
-
|
|
15955
|
-
const DEFAULT_TOOLTIP_LIFESPAN = 1000;
|
|
15956
|
-
const ShareLink = class {
|
|
15957
|
-
constructor(hostRef) {
|
|
15958
|
-
registerInstance(this, hostRef);
|
|
15959
|
-
/**
|
|
15960
|
-
* This is shown after someone has successfully copied the link to the clipboard.
|
|
15961
|
-
*
|
|
15962
|
-
* @uiName Tooltip text
|
|
15963
|
-
*/
|
|
15964
|
-
this.tooltiptext = "Copied to Clipboard";
|
|
15965
|
-
/**
|
|
15966
|
-
* The number of milliseconds that the tooltip will appear for
|
|
15967
|
-
*
|
|
15968
|
-
* @uiName Tooltip lifespan
|
|
15969
|
-
*/
|
|
15970
|
-
this.tooltiplifespan = DEFAULT_TOOLTIP_LIFESPAN;
|
|
15971
|
-
h$1(this);
|
|
15972
|
-
}
|
|
15973
|
-
disconnectedCallback() { }
|
|
15974
|
-
render() {
|
|
15975
|
-
const thisProps = getProps(this);
|
|
15976
|
-
const props = j$1()
|
|
15977
|
-
? useDemoShareLink(thisProps)
|
|
15978
|
-
: useShareLink(thisProps);
|
|
15979
|
-
return h(ShareLinkView, Object.assign({}, props));
|
|
15980
|
-
}
|
|
15981
|
-
};
|
|
15982
|
-
function useDemoShareLink(props) {
|
|
15983
|
-
const [open, setOpen] = useState(false);
|
|
15984
|
-
const shareString = "https://www.example.com/sharelink/abc";
|
|
15985
|
-
return cjs({
|
|
15986
|
-
shareString,
|
|
15987
|
-
tooltiptext: props.tooltiptext,
|
|
15988
|
-
open,
|
|
15989
|
-
onClick: () => {
|
|
15990
|
-
// Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
|
|
15991
|
-
// Only if called from a user-initiated event
|
|
15992
|
-
navigator.clipboard.writeText(shareString);
|
|
15993
|
-
setOpen(true);
|
|
15994
|
-
setTimeout(() => setOpen(false), props.tooltiplifespan);
|
|
15995
|
-
},
|
|
15996
|
-
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
15997
|
-
}
|
|
15998
|
-
|
|
15999
|
-
/**
|
|
16000
|
-
* lodash (Custom Build) <https://lodash.com/>
|
|
16001
|
-
* Build: `lodash modularize exports="npm" -o ./`
|
|
16002
|
-
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
16003
|
-
* Released under MIT license <https://lodash.com/license>
|
|
16004
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
16005
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
16006
|
-
*/
|
|
16007
|
-
|
|
16008
|
-
/** Used as references for various `Number` constants. */
|
|
16009
|
-
var INFINITY = 1 / 0;
|
|
16010
|
-
|
|
16011
|
-
/** `Object#toString` result references. */
|
|
16012
|
-
var symbolTag = '[object Symbol]';
|
|
15106
|
+
/** `Object#toString` result references. */
|
|
15107
|
+
var symbolTag = '[object Symbol]';
|
|
16013
15108
|
|
|
16014
15109
|
/** Used to match words composed of alphanumeric characters. */
|
|
16015
15110
|
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
@@ -17413,7 +16508,7 @@ var _createEmotion = createEmotion({
|
|
|
17413
16508
|
function i$1(){return (i$1=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r]);}return n}).apply(this,arguments)}function s(n,t){return t||(t=n.slice(0)),n.raw=t,n}var a$1,l,u,c$1=css(a$1||(a$1=s(['\n width: 100vw;\n height: 100vh;\n\n .story-book-outer-div {\n .story-div {\n font-family: "Arial", sans-serif;\n font-size: 12px;\n }\n padding-bottom: 500px;\n }\n\n .story-div {\n position: fixed;\n box-sizing: border-box;\n top: 0;\n width: 250px;\n height: 100vh;\n z-index: 999;\n overflow-y: scroll;\n background: white;\n margin-bottom: 32px;\n }\n\n .header {\n padding: 24px 0 16px 16px;\n margin-bottom: 24px;\n color: white;\n background: #333;\n cursor: pointer;\n\n h2 {\n letter-spacing: 3px;\n font-weight: 400;\n }\n }\n\n .parentStoryList {\n list-style: none;\n padding-left: 16px;\n\n summary {\n margin-bottom: 4px;\n }\n }\n .parentStory {\n cursor: pointer;\n }\n .parentStory.selected {\n font-weight: bold;\n }\n\n .subStory {\n font-size: 12px;\n cursor: pointer;\n line-height: 1.5em;\n margin-top: 4px;\n\n a {\n display: block;\n padding: 4px 4px 4px 16px;\n }\n }\n .subStory:hover {\n background-color: #eee;\n }\n .subStory.selected {\n background-color: lightgreen;\n }\n\n .component {\n padding: 24px 16px;\n }\n\n h4.group-header {\n margin: 8px 0;\n text-transform: uppercase;\n font-weight: 600;\n font-size: 14px;\n color: #575757;\n }\n\n .group-wrapper {\n margin-bottom: 24px;\n }\n\n .dynamic-display-wrapper {\n position: fixed;\n display: flex;\n flex-direction: column;\n bottom: 0;\n left: 100%;\n padding: 16px;\n z-index: 1000;\n background: white;\n transform: translateX(-100%);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n\n & > :not(:first-child) {\n margin-top: 12px;\n }\n\n p {\n font-size: 12px;\n margin: 0;\n padding: 0;\n }\n\n .button-wrapper {\n display: flex;\n\n & > :not(:first-child) {\n margin-left: 12px;\n }\n }\n\n & button {\n border: 1px solid #eaeaea;\n background: white;\n border-radius: 4px;\n color: #777;\n padding: 4px 12px;\n justify-content: center;\n align-items: center;\n text-align: center;\n\n &.active {\n background: #555;\n border-color: #555;\n color: white;\n }\n }\n }\n'])));function p$1(n,t){var o,r=t.story.title.split("/"),e=r[1]?r[0]:"_";return i$1({},n,((o={})[e]=[].concat(n[e]||[],[{story:i$1({},t.story,{title:r[1]||r[0]}),subs:t.subs}]).sort(function(n,t){return n.story.title.localeCompare(t.story.title)}),o))}function d$1(n){return {story:n.default,subs:function(n,t){if(null==n)return {};var o,r,e={},i=Object.keys(n);for(r=0;r<i.length;r++)t.indexOf(o=i[r])>=0||(e[o]=n[o]);return e}(n,["default"])}}function f(a,f){var b=f.h,y=void 0===b?h:b,g=f.title,m=void 0===g?"Stencilbook":g,x=f.homepage,h$1=void 0===x?y("h3",null,"Select a story!"):x,v=f.addons,k=void 0===v?[]:v,w=useMemo(function(){return a.map(d$1).reduce(p$1,{_:[]})},a),S=useState(void 0),C=S[0],z=S[1],O=null==C?void 0:C.key,j=useState("desktop"),T=j[0],_=j[1],B=useState(!0),D=B[0],L=B[1],N=useState(!1),q=N[0],A=N[1],M=function(){return y("div",{class:"dynamic-display-wrapper"},y("div",{class:"button-wrapper"},y("button",{class:"desktop"===T?"active":"",onClick:function(){return _("desktop")}},"Desktop"),y("button",{class:"tablet"===T?"active":"",onClick:function(){return _("tablet")}},"Tablet"),y("button",{class:"mobile"===T?"active":"",onClick:function(){return _("mobile")}},"Mobile")),y("p",null,"Note: Currently doesn't test breakpoints, use the native tester for now"),y("hr",null),y("button",{class:q?"active":"",onClick:function(){return A(function(n){return !n})}},"Toggle Dark Background"),y("hr",null),y("button",{class:D?"active":"",onClick:function(){return L(function(n){return !n})}},"Toggle Sidebar"))},P="mobile"===T?"375px":"tablet"===T?"768px":"1124px",V=css(l||(l=s(["\n max-width: ",";\n margin-left: ",";\n "])),P,D?"250px":"0px"),X=css(u||(u=s(["\n display: none;\n "])));document.body.style.backgroundColor=q?"#232323":"#fafafa";var E=function(n){var t=n.selected,o=k.reduce(function(n,o){return function(){return y(o,{story:i$1({},t)},y(n,null))}},null==t?void 0:t.story);return y(o,null)},F=function(){return y("div",{class:"story-book-outer-div"},y("div",{class:"story-div "+(D?"":X)},y("div",{class:"header",onClick:function(){z(void 0);}},y("h2",null,m)),y("ul",{class:"parentStoryList"},Object.keys(w).sort().map(function(n){return y("div",{class:"group-wrapper"},"_"!==n&&y("h4",{class:"group-header"},n),w[n].map(function(t){return y("li",{class:"parentStory"},y("details",{style:{marginBottom:"10px"}},y("summary",{style:{outline:"none"}},t.story.title),t.subs&&Object.keys(t.subs).map(function(o){var e=n+"/"+o,i=t.subs[o],s=i.storyName||lodash_startcase(o);return y("div",{class:"subStory "+(O===e?"selected":"")},y("a",{onClick:function(){return function(n,t,o,r){z({key:t,story:n,parent:o,label:r});}(i,e,t.story,s)}},s))})))}))}))),y(M,null),y("div",{class:"component "+V},!O&&h$1,O&&y("div",null,y("h3",null,C.label),y(E,{selected:C}))))};return {class:c$1,children:y(F,null),View:F,selected:C}}
|
|
17414
16509
|
|
|
17415
16510
|
const ShareButton_stories = {
|
|
17416
|
-
title: "
|
|
16511
|
+
title: "Share Button",
|
|
17417
16512
|
};
|
|
17418
16513
|
const WithIcon = () => {
|
|
17419
16514
|
const props = { medium: "facebook", iconslot: "suffix" };
|
|
@@ -17469,7 +16564,7 @@ const ShareButton$1 = /*#__PURE__*/Object.freeze({
|
|
|
17469
16564
|
});
|
|
17470
16565
|
|
|
17471
16566
|
const ShareLink_stories = {
|
|
17472
|
-
title: "
|
|
16567
|
+
title: "Share Link",
|
|
17473
16568
|
};
|
|
17474
16569
|
const Default = () => {
|
|
17475
16570
|
const props = {
|
|
@@ -17510,15 +16605,14 @@ const ShareLink$1 = /*#__PURE__*/Object.freeze({
|
|
|
17510
16605
|
});
|
|
17511
16606
|
|
|
17512
16607
|
const BigStat_stories = {
|
|
17513
|
-
title: "
|
|
16608
|
+
title: "Big Stat",
|
|
17514
16609
|
};
|
|
17515
16610
|
const Default$1 = () => {
|
|
17516
|
-
const props = {
|
|
16611
|
+
const props = { statvalue: "9.900,00" };
|
|
17517
16612
|
return h(BigStatView, Object.assign({}, props), "Big stat");
|
|
17518
16613
|
};
|
|
17519
16614
|
const LeftAlign = () => {
|
|
17520
16615
|
const props = {
|
|
17521
|
-
value: 500,
|
|
17522
16616
|
statvalue: "500",
|
|
17523
16617
|
alignment: "left",
|
|
17524
16618
|
};
|
|
@@ -17526,7 +16620,6 @@ const LeftAlign = () => {
|
|
|
17526
16620
|
};
|
|
17527
16621
|
const RightAlign = () => {
|
|
17528
16622
|
const props = {
|
|
17529
|
-
value: 500,
|
|
17530
16623
|
statvalue: "500",
|
|
17531
16624
|
alignment: "right",
|
|
17532
16625
|
};
|
|
@@ -17534,7 +16627,6 @@ const RightAlign = () => {
|
|
|
17534
16627
|
};
|
|
17535
16628
|
const FlexReverse = () => {
|
|
17536
16629
|
const props = {
|
|
17537
|
-
value: 500,
|
|
17538
16630
|
statvalue: "500",
|
|
17539
16631
|
flexReverse: true,
|
|
17540
16632
|
};
|
|
@@ -17542,7 +16634,6 @@ const FlexReverse = () => {
|
|
|
17542
16634
|
};
|
|
17543
16635
|
const FlexReverseRight = () => {
|
|
17544
16636
|
const props = {
|
|
17545
|
-
value: 500,
|
|
17546
16637
|
statvalue: "500",
|
|
17547
16638
|
flexReverse: true,
|
|
17548
16639
|
alignment: "right",
|
|
@@ -17551,7 +16642,6 @@ const FlexReverseRight = () => {
|
|
|
17551
16642
|
};
|
|
17552
16643
|
const FlexReverseLeft = () => {
|
|
17553
16644
|
const props = {
|
|
17554
|
-
value: 500,
|
|
17555
16645
|
statvalue: "500",
|
|
17556
16646
|
flexReverse: true,
|
|
17557
16647
|
alignment: "left",
|
|
@@ -17560,14 +16650,12 @@ const FlexReverseLeft = () => {
|
|
|
17560
16650
|
};
|
|
17561
16651
|
const NoStatValue = () => {
|
|
17562
16652
|
const props = {
|
|
17563
|
-
value: 0,
|
|
17564
16653
|
statvalue: "...",
|
|
17565
16654
|
};
|
|
17566
16655
|
return h(BigStatView, Object.assign({}, props), "Big stat");
|
|
17567
16656
|
};
|
|
17568
16657
|
const InvalidStatValue = () => {
|
|
17569
16658
|
const props = {
|
|
17570
|
-
value: 0,
|
|
17571
16659
|
statvalue: "!!!",
|
|
17572
16660
|
};
|
|
17573
16661
|
return h(BigStatView, Object.assign({}, props), "Big stat");
|
|
@@ -17587,7 +16675,7 @@ const BigStat = /*#__PURE__*/Object.freeze({
|
|
|
17587
16675
|
});
|
|
17588
16676
|
|
|
17589
16677
|
const Leaderboard_stories = {
|
|
17590
|
-
title: "
|
|
16678
|
+
title: "Leaderboard",
|
|
17591
16679
|
parameters: {
|
|
17592
16680
|
tagname: "sqm-leaderboard",
|
|
17593
16681
|
},
|
|
@@ -17864,7 +16952,7 @@ const Router = /*#__PURE__*/Object.freeze({
|
|
|
17864
16952
|
});
|
|
17865
16953
|
|
|
17866
16954
|
const LeaderboardRank_stories = {
|
|
17867
|
-
title: "
|
|
16955
|
+
title: "Leaderboard Rank",
|
|
17868
16956
|
};
|
|
17869
16957
|
const First = () => {
|
|
17870
16958
|
const props = { data: { rank: "1st" } };
|
|
@@ -17911,7 +16999,7 @@ function setupLoggedOut() {
|
|
|
17911
16999
|
};
|
|
17912
17000
|
}
|
|
17913
17001
|
const PortalFrame_stories = {
|
|
17914
|
-
title: "
|
|
17002
|
+
title: "Portal Frame",
|
|
17915
17003
|
};
|
|
17916
17004
|
const defaultProps = {
|
|
17917
17005
|
data: {
|
|
@@ -18006,7 +17094,7 @@ const PortalFrame$1 = /*#__PURE__*/Object.freeze({
|
|
|
18006
17094
|
});
|
|
18007
17095
|
|
|
18008
17096
|
const EditProfileForm_stories = {
|
|
18009
|
-
title: "
|
|
17097
|
+
title: "Edit Profile Form",
|
|
18010
17098
|
};
|
|
18011
17099
|
const defaultProps$1 = {
|
|
18012
17100
|
states: {
|
|
@@ -18293,9 +17381,6 @@ const RewardBalanceCashUSD = createHookStory(() => {
|
|
|
18293
17381
|
const ProgramGoals = createHookStory(() => {
|
|
18294
17382
|
const dummy = encodeURIComponent("Paid-Member-Goal/referrals");
|
|
18295
17383
|
return View(`/programGoals/count/${dummy}`, "/(programGoals)/:metricType/:goalId");
|
|
18296
|
-
});
|
|
18297
|
-
const CustomField = createHookStory(() => {
|
|
18298
|
-
return View(`/customFields/thingCount`, "/(customFields)/:customField");
|
|
18299
17384
|
});
|
|
18300
17385
|
|
|
18301
17386
|
const UseBigStat = /*#__PURE__*/Object.freeze({
|
|
@@ -18327,8 +17412,7 @@ const UseBigStat = /*#__PURE__*/Object.freeze({
|
|
|
18327
17412
|
RewardsAvailableWithSlash: RewardsAvailableWithSlash,
|
|
18328
17413
|
RewardBalance: RewardBalance,
|
|
18329
17414
|
RewardBalanceCashUSD: RewardBalanceCashUSD,
|
|
18330
|
-
ProgramGoals: ProgramGoals
|
|
18331
|
-
CustomField: CustomField
|
|
17415
|
+
ProgramGoals: ProgramGoals
|
|
18332
17416
|
});
|
|
18333
17417
|
|
|
18334
17418
|
function setupGraphQL$4() {
|
|
@@ -18457,7 +17541,7 @@ const UseLeaderboard = /*#__PURE__*/Object.freeze({
|
|
|
18457
17541
|
});
|
|
18458
17542
|
|
|
18459
17543
|
const FormMessage_stories = {
|
|
18460
|
-
title: "
|
|
17544
|
+
title: "Form Message",
|
|
18461
17545
|
};
|
|
18462
17546
|
const SuccessAlert = () => {
|
|
18463
17547
|
return (h("sqm-form-message", { type: "success" },
|
|
@@ -18493,255 +17577,31 @@ const FormMessage$1 = /*#__PURE__*/Object.freeze({
|
|
|
18493
17577
|
FullStackSuccess: FullStackSuccess
|
|
18494
17578
|
});
|
|
18495
17579
|
|
|
18496
|
-
const
|
|
18497
|
-
|
|
18498
|
-
exchangeReward(exchangeRewardInput: $exchangeRewardInput) {
|
|
18499
|
-
reward {
|
|
18500
|
-
id
|
|
18501
|
-
}
|
|
18502
|
-
}
|
|
18503
|
-
}
|
|
18504
|
-
`;
|
|
18505
|
-
const UseRewardExchangeList_stories = {
|
|
18506
|
-
title: "Hooks / useRewardExchange",
|
|
17580
|
+
const NewPortal_stories = {
|
|
17581
|
+
title: "New Portal",
|
|
18507
17582
|
};
|
|
18508
|
-
|
|
18509
|
-
|
|
18510
|
-
|
|
18511
|
-
|
|
18512
|
-
|
|
18513
|
-
window.widgetIdent = {
|
|
18514
|
-
tenantAlias: "test_a8b41jotf8a1v",
|
|
18515
|
-
appDomain: "https://staging.referralsaasquatch.com",
|
|
18516
|
-
programId,
|
|
18517
|
-
};
|
|
18518
|
-
useEffect(() => {
|
|
18519
|
-
L$1({
|
|
18520
|
-
accountId,
|
|
18521
|
-
id,
|
|
18522
|
-
jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImFjY291bnRJZCI6InRlc3Rlc3Rlc3QiLCJpZCI6InRlc3Rlc3Rlc3QifX0.qYnU5hNeIj9C_G3NogfG7btgCPGZC7JRXY0MG6a63zs",
|
|
18523
|
-
});
|
|
18524
|
-
return () => {
|
|
18525
|
-
window.widgetIdent = undefined;
|
|
18526
|
-
L$1(undefined);
|
|
18527
|
-
};
|
|
18528
|
-
}, []);
|
|
18529
|
-
return { id, accountId };
|
|
18530
|
-
}
|
|
18531
|
-
function useExchangeButton() {
|
|
18532
|
-
const { id, accountId } = setupGraphQL$6();
|
|
18533
|
-
const [points, setPoints] = useState(10);
|
|
18534
|
-
const [rate, setRate] = useState(100);
|
|
18535
|
-
const [exchange, { data, errors }] = Ne(EXCHANGE$1);
|
|
18536
|
-
return {
|
|
18537
|
-
states: {
|
|
18538
|
-
points,
|
|
18539
|
-
rate,
|
|
18540
|
-
},
|
|
18541
|
-
data: {
|
|
18542
|
-
id,
|
|
18543
|
-
accountId,
|
|
18544
|
-
data,
|
|
18545
|
-
errors,
|
|
18546
|
-
},
|
|
18547
|
-
callbacks: {
|
|
18548
|
-
exchange,
|
|
18549
|
-
setPoints,
|
|
18550
|
-
setRate,
|
|
18551
|
-
},
|
|
18552
|
-
};
|
|
18553
|
-
}
|
|
18554
|
-
const DefaultView = (props) => {
|
|
18555
|
-
const { states, data, callbacks } = props;
|
|
18556
|
-
return (h("div", null,
|
|
18557
|
-
h("div", null,
|
|
18558
|
-
h("label", null, "Rate:"),
|
|
18559
|
-
h("input", { value: states.rate, onInput: (e) =>
|
|
18560
|
-
// @ts-ignore
|
|
18561
|
-
callbacks.setRate(e.target.value) })),
|
|
18562
|
-
h("input", { value: states.points, onInput: (e) =>
|
|
18563
|
-
// @ts-ignore
|
|
18564
|
-
callbacks.setPoints(e.target.value) }),
|
|
18565
|
-
h("button", { onClick: () => callbacks.exchange(props.input) }, "Exchange"),
|
|
18566
|
-
h("details", null,
|
|
18567
|
-
h("summary", null, "response"),
|
|
18568
|
-
h("h4", null, "data"),
|
|
18569
|
-
h("div", { style: { maxWidth: "500px" } },
|
|
18570
|
-
h("pre", { style: { width: "500px", whiteSpace: "pre-wrap" } }, JSON.stringify(data.data))),
|
|
18571
|
-
h("h4", null, "errors"),
|
|
18572
|
-
h("div", { style: { maxWidth: "500px" } },
|
|
18573
|
-
h("pre", { style: { maxWidth: "500px", whiteSpace: "pre-wrap" } }, JSON.stringify(data.errors))))));
|
|
17583
|
+
const style$8 = {
|
|
17584
|
+
HeaderSubtitleBold: {
|
|
17585
|
+
"font-weight": 500,
|
|
17586
|
+
"text-decoration": "underline",
|
|
17587
|
+
},
|
|
18574
17588
|
};
|
|
18575
|
-
|
|
18576
|
-
|
|
18577
|
-
|
|
18578
|
-
|
|
18579
|
-
|
|
18580
|
-
|
|
18581
|
-
|
|
18582
|
-
|
|
18583
|
-
|
|
18584
|
-
accountId: data.accountId,
|
|
18585
|
-
redeemCreditInput: {
|
|
18586
|
-
amount: states.points,
|
|
18587
|
-
unit: "POINT",
|
|
18588
|
-
},
|
|
18589
|
-
globalRewardKey: "gc1",
|
|
18590
|
-
},
|
|
18591
|
-
} }));
|
|
18592
|
-
});
|
|
18593
|
-
const VariableGlobalReward = createHookStory(() => {
|
|
18594
|
-
const { states, data, callbacks } = useExchangeButton();
|
|
18595
|
-
return (h(DefaultView, { states: states, data: data, callbacks: callbacks, input: {
|
|
18596
|
-
exchangeRewardInput: {
|
|
18597
|
-
userId: data.id,
|
|
18598
|
-
accountId: data.accountId,
|
|
18599
|
-
redeemCreditInput: {
|
|
18600
|
-
amount: states.points,
|
|
18601
|
-
unit: "POINT",
|
|
18602
|
-
},
|
|
18603
|
-
globalRewardKey: "gc1",
|
|
18604
|
-
rewardInput: {
|
|
18605
|
-
valueInCents: Math.ceil(states.points * states.rate),
|
|
18606
|
-
},
|
|
17589
|
+
jss.setup(create());
|
|
17590
|
+
const sheet$8 = jss.createStyleSheet(style$8);
|
|
17591
|
+
const styleString$8 = sheet$8.toString();
|
|
17592
|
+
const barProps = {
|
|
17593
|
+
data: {
|
|
17594
|
+
programs: [
|
|
17595
|
+
{
|
|
17596
|
+
key: "program1",
|
|
17597
|
+
label: "My Referral Program",
|
|
18607
17598
|
},
|
|
18608
|
-
|
|
18609
|
-
|
|
18610
|
-
|
|
18611
|
-
const { states, data, callbacks } = useExchangeButton();
|
|
18612
|
-
return (h(DefaultView, { states: states, data: data, callbacks: callbacks, input: {
|
|
18613
|
-
exchangeRewardInput: {
|
|
18614
|
-
userId: data.id,
|
|
18615
|
-
accountId: data.accountId,
|
|
18616
|
-
redeemCreditInput: {
|
|
18617
|
-
amount: states.points,
|
|
18618
|
-
unit: "POINT",
|
|
18619
|
-
},
|
|
18620
|
-
rewardInput: {
|
|
18621
|
-
type: "CREDIT",
|
|
18622
|
-
unit: "foo",
|
|
18623
|
-
assignedCredit: Math.ceil(states.points * states.rate),
|
|
18624
|
-
},
|
|
17599
|
+
{
|
|
17600
|
+
key: "program2",
|
|
17601
|
+
label: "My Rewards Program",
|
|
18625
17602
|
},
|
|
18626
|
-
|
|
18627
|
-
}
|
|
18628
|
-
|
|
18629
|
-
const UseRewardExchangeList = /*#__PURE__*/Object.freeze({
|
|
18630
|
-
__proto__: null,
|
|
18631
|
-
'default': UseRewardExchangeList_stories,
|
|
18632
|
-
RewardList: RewardList,
|
|
18633
|
-
FixedGlobalReward: FixedGlobalReward,
|
|
18634
|
-
VariableGlobalReward: VariableGlobalReward,
|
|
18635
|
-
VariableCreditReward: VariableCreditReward
|
|
18636
|
-
});
|
|
18637
|
-
|
|
18638
|
-
const UseRewardsTable_stories = {
|
|
18639
|
-
title: "Hooks / useRewardsTable",
|
|
18640
|
-
};
|
|
18641
|
-
function setupGraphQL$7() {
|
|
18642
|
-
const id = "testestest";
|
|
18643
|
-
const accountId = id;
|
|
18644
|
-
//@ts-ignore
|
|
18645
|
-
window.widgetIdent = {
|
|
18646
|
-
tenantAlias: "test_a8b41jotf8a1v",
|
|
18647
|
-
appDomain: "https://staging.referralsaasquatch.com",
|
|
18648
|
-
};
|
|
18649
|
-
useEffect(() => {
|
|
18650
|
-
L$1({
|
|
18651
|
-
accountId,
|
|
18652
|
-
id,
|
|
18653
|
-
jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImFjY291bnRJZCI6InRlc3Rlc3Rlc3QiLCJpZCI6InRlc3Rlc3Rlc3QifX0.qYnU5hNeIj9C_G3NogfG7btgCPGZC7JRXY0MG6a63zs",
|
|
18654
|
-
});
|
|
18655
|
-
return () => {
|
|
18656
|
-
window.widgetIdent = undefined;
|
|
18657
|
-
L$1(undefined);
|
|
18658
|
-
};
|
|
18659
|
-
}, []);
|
|
18660
|
-
return { id, accountId };
|
|
18661
|
-
}
|
|
18662
|
-
const RewardsTableWithProgram = createHookStory(() => {
|
|
18663
|
-
setupGraphQL$7();
|
|
18664
|
-
A$1("sam-partner-test-2");
|
|
18665
|
-
return (h("sqm-rewards-table", null,
|
|
18666
|
-
h("sqm-rewards-table-column", null)));
|
|
18667
|
-
});
|
|
18668
|
-
const RewardsTableNoProgram = createHookStory(() => {
|
|
18669
|
-
setupGraphQL$7();
|
|
18670
|
-
A$1(undefined);
|
|
18671
|
-
return (h("sqm-rewards-table", null,
|
|
18672
|
-
h("sqm-rewards-table-column", null)));
|
|
18673
|
-
});
|
|
18674
|
-
|
|
18675
|
-
const UseRewardsTable = /*#__PURE__*/Object.freeze({
|
|
18676
|
-
__proto__: null,
|
|
18677
|
-
'default': UseRewardsTable_stories,
|
|
18678
|
-
RewardsTableWithProgram: RewardsTableWithProgram,
|
|
18679
|
-
RewardsTableNoProgram: RewardsTableNoProgram
|
|
18680
|
-
});
|
|
18681
|
-
|
|
18682
|
-
const JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoic2FtK2tsaXBAc2Fhc3F1YXQuY2giLCJhY2NvdW50SWQiOiJzYW0ra2xpcEBzYWFzcXVhdC5jaCJ9fQ.FMNZ6oajyr6SiCcRqKKdyPqvNTvWROQ60MKAyfvWGfc";
|
|
18683
|
-
const UseTaskCard_stories = {
|
|
18684
|
-
title: "Hooks / useTaskCard",
|
|
18685
|
-
};
|
|
18686
|
-
function setupGraphQL$8() {
|
|
18687
|
-
const id = "sam+klip@saasquat.ch";
|
|
18688
|
-
const accountId = id;
|
|
18689
|
-
const programId = "klip-referral-program";
|
|
18690
|
-
//@ts-ignore
|
|
18691
|
-
window.widgetIdent = {
|
|
18692
|
-
tenantAlias: "test_a74miwdpofztj",
|
|
18693
|
-
appDomain: "https://staging.referralsaasquatch.com",
|
|
18694
|
-
programId,
|
|
18695
|
-
};
|
|
18696
|
-
useEffect(() => {
|
|
18697
|
-
L$1({
|
|
18698
|
-
accountId,
|
|
18699
|
-
id,
|
|
18700
|
-
jwt: JWT,
|
|
18701
|
-
});
|
|
18702
|
-
return () => {
|
|
18703
|
-
window.widgetIdent = undefined;
|
|
18704
|
-
L$1(undefined);
|
|
18705
|
-
};
|
|
18706
|
-
}, []);
|
|
18707
|
-
return { id, accountId };
|
|
18708
|
-
}
|
|
18709
|
-
const TaskCard = createHookStory(() => {
|
|
18710
|
-
setupGraphQL$8();
|
|
18711
|
-
return (h("sqm-task-card", { "card-title": "Comment on 5 articles", "button-text": "Start reading", goal: 5, steps: true, "show-progress-bar": true }));
|
|
18712
|
-
});
|
|
18713
|
-
|
|
18714
|
-
const UseTaskCard = /*#__PURE__*/Object.freeze({
|
|
18715
|
-
__proto__: null,
|
|
18716
|
-
'default': UseTaskCard_stories,
|
|
18717
|
-
TaskCard: TaskCard
|
|
18718
|
-
});
|
|
18719
|
-
|
|
18720
|
-
const NewPortal_stories = {
|
|
18721
|
-
title: "New Portal",
|
|
18722
|
-
};
|
|
18723
|
-
const style$9 = {
|
|
18724
|
-
HeaderSubtitleBold: {
|
|
18725
|
-
"font-weight": 500,
|
|
18726
|
-
"text-decoration": "underline",
|
|
18727
|
-
},
|
|
18728
|
-
};
|
|
18729
|
-
jss.setup(create());
|
|
18730
|
-
const sheet$9 = jss.createStyleSheet(style$9);
|
|
18731
|
-
const styleString$9 = sheet$9.toString();
|
|
18732
|
-
const barProps = {
|
|
18733
|
-
data: {
|
|
18734
|
-
programs: [
|
|
18735
|
-
{
|
|
18736
|
-
key: "program1",
|
|
18737
|
-
label: "My Referral Program",
|
|
18738
|
-
},
|
|
18739
|
-
{
|
|
18740
|
-
key: "program2",
|
|
18741
|
-
label: "My Rewards Program",
|
|
18742
|
-
},
|
|
18743
|
-
],
|
|
18744
|
-
},
|
|
17603
|
+
],
|
|
17604
|
+
},
|
|
18745
17605
|
};
|
|
18746
17606
|
const item1Props = {
|
|
18747
17607
|
states: {
|
|
@@ -18823,7 +17683,7 @@ const Dashboard = () => {
|
|
|
18823
17683
|
hide: false,
|
|
18824
17684
|
};
|
|
18825
17685
|
return (h("sqm-divided-layout", { direction: "row" },
|
|
18826
|
-
h("style", { type: "text/css" }, styleString$
|
|
17686
|
+
h("style", { type: "text/css" }, styleString$8),
|
|
18827
17687
|
h(Sidebar, null),
|
|
18828
17688
|
h("sqm-divided-layout", { direction: "column" },
|
|
18829
17689
|
h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
|
|
@@ -18836,10 +17696,10 @@ const Dashboard = () => {
|
|
|
18836
17696
|
h("h1", null, "John Smith"))),
|
|
18837
17697
|
})),
|
|
18838
17698
|
h(StatContainerView, Object.assign({}, { space: "64px" }),
|
|
18839
|
-
h(BigStatView, Object.assign({}, { statvalue: "2,345"
|
|
18840
|
-
h(BigStatView, Object.assign({}, { statvalue: "58"
|
|
18841
|
-
h(BigStatView, Object.assign({}, { statvalue: "$10,540"
|
|
18842
|
-
h(BigStatView, Object.assign({}, { statvalue: "$2,305"
|
|
17699
|
+
h(BigStatView, Object.assign({}, { statvalue: "2,345" }), "Clicks"),
|
|
17700
|
+
h(BigStatView, Object.assign({}, { statvalue: "58" }), "Referrals"),
|
|
17701
|
+
h(BigStatView, Object.assign({}, { statvalue: "$10,540" }), "Earned"),
|
|
17702
|
+
h(BigStatView, Object.assign({}, { statvalue: "$2,305" }), "Awaiting Payout"))),
|
|
18843
17703
|
h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
|
|
18844
17704
|
h(PortalSectionView, Object.assign({}, {
|
|
18845
17705
|
labelMargin: "x-large",
|
|
@@ -18881,7 +17741,7 @@ const Dashboard = () => {
|
|
|
18881
17741
|
};
|
|
18882
17742
|
const EditProfile$2 = () => {
|
|
18883
17743
|
return (h("sqm-divided-layout", { direction: "row" },
|
|
18884
|
-
h("style", { type: "text/css" }, styleString$
|
|
17744
|
+
h("style", { type: "text/css" }, styleString$8),
|
|
18885
17745
|
h(Sidebar, null),
|
|
18886
17746
|
h("sqm-divided-layout", { direction: "column" },
|
|
18887
17747
|
h(PortalProfileView, Object.assign({}, {
|
|
@@ -18945,7 +17805,7 @@ const EditProfile$2 = () => {
|
|
|
18945
17805
|
};
|
|
18946
17806
|
const Commissions = () => {
|
|
18947
17807
|
return (h("sqm-divided-layout", { direction: "row" },
|
|
18948
|
-
h("style", { type: "text/css" }, styleString$
|
|
17808
|
+
h("style", { type: "text/css" }, styleString$8),
|
|
18949
17809
|
h(Sidebar, null),
|
|
18950
17810
|
h("sqm-divided-layout", { direction: "column" },
|
|
18951
17811
|
h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
|
|
@@ -18958,19 +17818,19 @@ const Commissions = () => {
|
|
|
18958
17818
|
h("p", null,
|
|
18959
17819
|
"for the",
|
|
18960
17820
|
" ",
|
|
18961
|
-
h("span", { class: sheet$
|
|
17821
|
+
h("span", { class: sheet$8.classes.HeaderSubtitleBold }, "Partner Program #1"),
|
|
18962
17822
|
" ",
|
|
18963
17823
|
"program"))),
|
|
18964
17824
|
})),
|
|
18965
17825
|
h(StatContainerView, Object.assign({}, { space: "64px" }),
|
|
18966
|
-
h(BigStatView, Object.assign({}, { statvalue: "$ 1,000"
|
|
18967
|
-
h(BigStatView, Object.assign({}, { statvalue: "$ 800"
|
|
18968
|
-
h(BigStatView, Object.assign({}, { statvalue: "$ 180"
|
|
18969
|
-
h(BigStatView, Object.assign({}, { statvalue: "$ 20"
|
|
17826
|
+
h(BigStatView, Object.assign({}, { statvalue: "$ 1,000" }), "Total Earned"),
|
|
17827
|
+
h(BigStatView, Object.assign({}, { statvalue: "$ 800" }), "Available"),
|
|
17828
|
+
h(BigStatView, Object.assign({}, { statvalue: "$ 180" }), "Pending"),
|
|
17829
|
+
h(BigStatView, Object.assign({}, { statvalue: "$ 20" }), "Redeemed"))))));
|
|
18970
17830
|
};
|
|
18971
17831
|
const Activity = () => {
|
|
18972
17832
|
return (h("sqm-divided-layout", { direction: "row" },
|
|
18973
|
-
h("style", { type: "text/css" }, styleString$
|
|
17833
|
+
h("style", { type: "text/css" }, styleString$8),
|
|
18974
17834
|
h(Sidebar, null),
|
|
18975
17835
|
h("sqm-divided-layout", { direction: "column" },
|
|
18976
17836
|
h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
|
|
@@ -18983,7 +17843,7 @@ const Activity = () => {
|
|
|
18983
17843
|
h("p", null,
|
|
18984
17844
|
"for the",
|
|
18985
17845
|
" ",
|
|
18986
|
-
h("span", { class: sheet$
|
|
17846
|
+
h("span", { class: sheet$8.classes.HeaderSubtitleBold }, "Partner Program #1"),
|
|
18987
17847
|
" ",
|
|
18988
17848
|
"program"))),
|
|
18989
17849
|
})),
|
|
@@ -18993,10 +17853,10 @@ const Activity = () => {
|
|
|
18993
17853
|
label: (h("sqm-text", null,
|
|
18994
17854
|
h("h3", null, "Referral Activity"))),
|
|
18995
17855
|
content: (h(StatContainerView, Object.assign({}, { space: "64px" }),
|
|
18996
|
-
h(BigStatView, Object.assign({}, { statvalue: "1,000"
|
|
18997
|
-
h(BigStatView, Object.assign({}, { statvalue: "800"
|
|
18998
|
-
h(BigStatView, Object.assign({}, { statvalue: "180"
|
|
18999
|
-
h(BigStatView, Object.assign({}, { statvalue: "20"
|
|
17856
|
+
h(BigStatView, Object.assign({}, { statvalue: "1,000" }), "Total Referrals"),
|
|
17857
|
+
h(BigStatView, Object.assign({}, { statvalue: "800" }), "Converted"),
|
|
17858
|
+
h(BigStatView, Object.assign({}, { statvalue: "180" }), "Pending"),
|
|
17859
|
+
h(BigStatView, Object.assign({}, { statvalue: "20" }), "Disqualified"))),
|
|
19000
17860
|
}))),
|
|
19001
17861
|
h(PortalSectionView, Object.assign({}, {
|
|
19002
17862
|
labelMargin: "x-large",
|
|
@@ -19004,9 +17864,9 @@ const Activity = () => {
|
|
|
19004
17864
|
label: (h("sqm-text", null,
|
|
19005
17865
|
h("h3", null, "Traffic Generated"))),
|
|
19006
17866
|
content: (h(StatContainerView, Object.assign({}, { space: "64px" }),
|
|
19007
|
-
h(BigStatView, Object.assign({}, { statvalue: "1,000"
|
|
19008
|
-
h(BigStatView, Object.assign({}, { statvalue: "800"
|
|
19009
|
-
h(BigStatView, Object.assign({}, { statvalue: "180"
|
|
17867
|
+
h(BigStatView, Object.assign({}, { statvalue: "1,000" }), "Clicks"),
|
|
17868
|
+
h(BigStatView, Object.assign({}, { statvalue: "800" }), "From share link"),
|
|
17869
|
+
h(BigStatView, Object.assign({}, { statvalue: "180" }), "From share mediums"))),
|
|
19010
17870
|
})))));
|
|
19011
17871
|
};
|
|
19012
17872
|
|
|
@@ -19020,7 +17880,7 @@ const NewPortal = /*#__PURE__*/Object.freeze({
|
|
|
19020
17880
|
});
|
|
19021
17881
|
|
|
19022
17882
|
const SidebarItem_stories = {
|
|
19023
|
-
title: "
|
|
17883
|
+
title: "Sidebar Item",
|
|
19024
17884
|
};
|
|
19025
17885
|
const InactiveItem = () => {
|
|
19026
17886
|
const props = {
|
|
@@ -19057,7 +17917,7 @@ const SidebarItem = /*#__PURE__*/Object.freeze({
|
|
|
19057
17917
|
});
|
|
19058
17918
|
|
|
19059
17919
|
const NavigationSidebar_stories = {
|
|
19060
|
-
title: "
|
|
17920
|
+
title: "Navigation Sidebar",
|
|
19061
17921
|
};
|
|
19062
17922
|
const DefaultNavigationSidebar = () => {
|
|
19063
17923
|
const barProps = {
|
|
@@ -19106,12 +17966,14 @@ const NavigationSidebar = /*#__PURE__*/Object.freeze({
|
|
|
19106
17966
|
});
|
|
19107
17967
|
|
|
19108
17968
|
const PortalLogin_stories = {
|
|
19109
|
-
title: "
|
|
17969
|
+
title: "Portal Login",
|
|
19110
17970
|
};
|
|
19111
17971
|
const defaultProps$2 = {
|
|
19112
17972
|
states: {
|
|
19113
17973
|
error: "",
|
|
19114
17974
|
loading: false,
|
|
17975
|
+
forgotPasswordPath: "/forgotPassword",
|
|
17976
|
+
registerPath: "/register",
|
|
19115
17977
|
},
|
|
19116
17978
|
callbacks: {
|
|
19117
17979
|
submit: async (e) => await e,
|
|
@@ -19122,6 +17984,8 @@ const errorProps = {
|
|
|
19122
17984
|
states: {
|
|
19123
17985
|
error: "Something went wrong. Please try again.",
|
|
19124
17986
|
loading: false,
|
|
17987
|
+
forgotPasswordPath: "/forgotPassword",
|
|
17988
|
+
registerPath: "/register",
|
|
19125
17989
|
},
|
|
19126
17990
|
callbacks: {
|
|
19127
17991
|
submit: async (e) => await e,
|
|
@@ -19132,6 +17996,8 @@ const loadingProps = {
|
|
|
19132
17996
|
states: {
|
|
19133
17997
|
error: "",
|
|
19134
17998
|
loading: true,
|
|
17999
|
+
forgotPasswordPath: "/forgotPassword",
|
|
18000
|
+
registerPath: "/register",
|
|
19135
18001
|
},
|
|
19136
18002
|
callbacks: {
|
|
19137
18003
|
submit: async (e) => await e,
|
|
@@ -19151,7 +18017,7 @@ const PortalLogin$1 = /*#__PURE__*/Object.freeze({
|
|
|
19151
18017
|
});
|
|
19152
18018
|
|
|
19153
18019
|
const PortalRegister_stories = {
|
|
19154
|
-
title: "
|
|
18020
|
+
title: "Portal Register",
|
|
19155
18021
|
};
|
|
19156
18022
|
const defaultProps$3 = {
|
|
19157
18023
|
states: {
|
|
@@ -19159,6 +18025,7 @@ const defaultProps$3 = {
|
|
|
19159
18025
|
loading: false,
|
|
19160
18026
|
confirmPassword: true,
|
|
19161
18027
|
hideInputs: false,
|
|
18028
|
+
loginPath: "/login"
|
|
19162
18029
|
},
|
|
19163
18030
|
callbacks: {
|
|
19164
18031
|
submit: () => console.log("Submit!"),
|
|
@@ -19175,6 +18042,7 @@ const errorProps$1 = {
|
|
|
19175
18042
|
loading: false,
|
|
19176
18043
|
confirmPassword: true,
|
|
19177
18044
|
hideInputs: false,
|
|
18045
|
+
loginPath: "/login"
|
|
19178
18046
|
},
|
|
19179
18047
|
callbacks: {
|
|
19180
18048
|
submit: () => console.log("Submit!"),
|
|
@@ -19194,6 +18062,7 @@ const loadingProps$1 = {
|
|
|
19194
18062
|
loading: true,
|
|
19195
18063
|
confirmPassword: true,
|
|
19196
18064
|
hideInputs: false,
|
|
18065
|
+
loginPath: "/login"
|
|
19197
18066
|
},
|
|
19198
18067
|
callbacks: {
|
|
19199
18068
|
submit: () => console.log("Submit!"),
|
|
@@ -19210,6 +18079,7 @@ const slottedProps = {
|
|
|
19210
18079
|
loading: false,
|
|
19211
18080
|
confirmPassword: true,
|
|
19212
18081
|
hideInputs: false,
|
|
18082
|
+
loginPath: "/login"
|
|
19213
18083
|
},
|
|
19214
18084
|
callbacks: {
|
|
19215
18085
|
submit: () => console.log("Submit!"),
|
|
@@ -19236,6 +18106,7 @@ const FieldsHidden = () => {
|
|
|
19236
18106
|
loading: true,
|
|
19237
18107
|
confirmPassword: true,
|
|
19238
18108
|
hideInputs: true,
|
|
18109
|
+
loginPath: "/login"
|
|
19239
18110
|
},
|
|
19240
18111
|
} }));
|
|
19241
18112
|
};
|
|
@@ -19254,7 +18125,7 @@ const PortalRegister$1 = /*#__PURE__*/Object.freeze({
|
|
|
19254
18125
|
const scenario = "@author:\r\n@owner:ian\r\nFeature: Forgot Password\r\n\r\n @motivating\r\n Scenario: Users can request to reset their password\r\n Given a user enters their email address\r\n And that email address is linked to a previously created account\r\n When they click \"Reset Password\"\r\n Then the button enters a loading state\r\n When the password reset email is sent\r\n Then a confirmation banner is shown stating a password reset email was sent\r\n\r\n @motivating\r\n Scenario: Users are notified if sending their password reset email fails\r\n Given a user enters their email address\r\n And that email address is linked to a previously created account\r\n When they click \"Reset Password\"\r\n Then the button enters a loading state\r\n When the password reset email fails to send\r\n Then the user will not receive a password reset email\r\n And an error banner is shown stating that they should try again\r\n\r\n @motivating\r\n @landmine\r\n Scenario: If the input email is not associated to an account a success banner will be shown but an email will not be sent\r\n Given the user entered an email address that is not associated to an accoun\r\n When they click \"Reset Password\"\r\n Then the button enters a loading state\r\n But no email will be sent\r\n And a success banner is shown stating a password reset email was sent if the given email was associated to an account\r\n\r\n @motivating\r\n Scenario: Users can resend password reset email\r\n Given a user had previously requested to reset their password\r\n When they enter their email address\r\n And that email address is linked to a previously created account\r\n And they click \"Reset Password\"\r\n Then the user will receive a second password reset email\r\n And a success banner is shown stating that their email was sent\r\n";
|
|
19255
18126
|
|
|
19256
18127
|
const PortalForgotPassword_stories = {
|
|
19257
|
-
title: "
|
|
18128
|
+
title: "Portal Forgot Password",
|
|
19258
18129
|
parameters: {
|
|
19259
18130
|
scenario,
|
|
19260
18131
|
},
|
|
@@ -19264,6 +18135,7 @@ const defaultProps$4 = {
|
|
|
19264
18135
|
error: "",
|
|
19265
18136
|
loading: false,
|
|
19266
18137
|
success: false,
|
|
18138
|
+
loginPath: "/login",
|
|
19267
18139
|
},
|
|
19268
18140
|
callbacks: {
|
|
19269
18141
|
submit: async (e) => await e,
|
|
@@ -19278,6 +18150,7 @@ const errorProps$2 = {
|
|
|
19278
18150
|
error: "Something went wrong. Please try again.",
|
|
19279
18151
|
loading: false,
|
|
19280
18152
|
success: false,
|
|
18153
|
+
loginPath: "/login",
|
|
19281
18154
|
},
|
|
19282
18155
|
callbacks: {
|
|
19283
18156
|
submit: async (e) => await e,
|
|
@@ -19292,6 +18165,7 @@ const loadingProps$2 = {
|
|
|
19292
18165
|
error: "",
|
|
19293
18166
|
loading: true,
|
|
19294
18167
|
success: false,
|
|
18168
|
+
loginPath: "/login",
|
|
19295
18169
|
},
|
|
19296
18170
|
callbacks: {
|
|
19297
18171
|
submit: async (e) => await e,
|
|
@@ -19306,6 +18180,7 @@ const successProps = {
|
|
|
19306
18180
|
error: "",
|
|
19307
18181
|
loading: false,
|
|
19308
18182
|
success: true,
|
|
18183
|
+
loginPath: "/login",
|
|
19309
18184
|
},
|
|
19310
18185
|
callbacks: {
|
|
19311
18186
|
submit: async (e) => await e,
|
|
@@ -19332,7 +18207,7 @@ const PortalForgotPassword = /*#__PURE__*/Object.freeze({
|
|
|
19332
18207
|
const scenario$1 = "@author:\r\n@owner: ian\r\nFeature: Email Verification\r\n\r\n @minutae\r\n Scenario: User's redirected from registration can re-send their verification email\r\n Given a user has registered\r\n And they have been sent a verification email\r\n When they are redirected to the email verification page\r\n Then a message will be displayed\r\n And it will reflect that a email has already been sent to their email\r\n But they can still re-send the email\r\n When they click to \"Resend-Email\"\r\n Then the user will receive a verification email\r\n\r\n @motivating\r\n Scenario: Users are notified if sending the email verification message fails\r\n Given a user with an email was stored in session data from registration\r\n When they click to \"Resend-Email\"\r\n Then the button enters a loading state\r\n When an error occurs trying to send the verification email\r\n Then the user will not receive a verification email\r\n And an error banner is shown stating that they should try again\r\n\r\n @motivating\r\n Scenario: Users are notified if sending the email verification message succeeds\r\n Given a user with an email was stored in session data from registration\r\n When they click to \"Resend-Email\"\r\n Then the button enters a loading state\r\n When the email verification message sends\r\n Then the user will receive a verification email\r\n And a success banner is shown stating that their email was resent";
|
|
19333
18208
|
|
|
19334
18209
|
const PortalEmailVerification_stories = {
|
|
19335
|
-
title: "
|
|
18210
|
+
title: "Portal Email Verification",
|
|
19336
18211
|
parameters: {
|
|
19337
18212
|
scenario: scenario$1,
|
|
19338
18213
|
},
|
|
@@ -19418,7 +18293,7 @@ const PortalEmailVerification = /*#__PURE__*/Object.freeze({
|
|
|
19418
18293
|
const scenario$2 = "@author:\r\n@owner:ian\r\nFeature: Reset Password\r\n\r\n\r\n Background: A user in on the password reset page\r\n Given a user who has been redirected to the password reset page\r\n\r\n @motivating\r\n Scenario: Users can reset their password\r\n Given a user has a valid oob code as a url query parameter\r\n When they enter their password twice\r\n And they click \"Update\"\r\n Then their password is updated\r\n And a banner with a success message will be displayed\r\n And they can log in with their new password\r\n\r\n @motivating\r\n Scenario Outline: Users cannot reset their password with an invalid or missing oob code\r\n Given a user has a <oobCode> as a url query parameter\r\n Then they will see an error message saying that their password reset code is invalid or expired\r\n When they click \"Continue\"\r\n Then they will be redirected to \"/\"\r\n Examples:\r\n | oobCode |\r\n | invalid oob code |\r\n | non existant oob code |\r\n\r\n @motivating\r\n Scenario: Users must enter the same password twice to successfully reset their password\r\n Given a user has been redirected to the password reset page\r\n And they have a valid oob code as a url query parameter\r\n When they enter two different passwords into the password reset form\r\n And they click \"Update\"\r\n Then their password is not be reset\r\n And an error banner stating the input passwords must match appears\r\n And their password will not be reset\r\n When they enter the same password twice\r\n And they click \"Update\"\r\n Then a banner appears with a success message\r\n And they can log in with their new password\r\n\r\n @motivating\r\n Scenario: Users are redirected to \"/\" by default\r\n Given the component does not have prop \"nextPage\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has entered their password twice\r\n When they click \"Update\"\r\n Then their password is updated\r\n And they are redirected to \"/\"\r\n\r\n @motivating\r\n Scenario: Custom redirection can be configured\r\n Given the component has prop \"nextPage\" with value \"/activity\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has entered their password twice\r\n When they click \"Update\"\r\n Then their password is updated\r\n And they are redirected to \"/activity\"";
|
|
19419
18294
|
|
|
19420
18295
|
const PortalResetPassword_stories = {
|
|
19421
|
-
title: "
|
|
18296
|
+
title: "Portal Reset Password",
|
|
19422
18297
|
parameters: {
|
|
19423
18298
|
scenario: scenario$2,
|
|
19424
18299
|
},
|
|
@@ -19582,7 +18457,7 @@ const PortalResetPassword = /*#__PURE__*/Object.freeze({
|
|
|
19582
18457
|
const scenario$3 = "@author:\r\n@owner:ian\r\nFeature: Verify Email\r\n\r\n\r\n Background: A user is on the email verification page\r\n Given a user who has been redirected to the email verification page\r\n\r\n @motivating\r\n Scenario: Verifying your email will take you to the portal login page\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button will enter a loading state\r\n When their email is validated\r\n Then a button that says \"Continue\" will appear\r\n When they click \"Continue\"\r\n Then they will be redirected to login\r\n\r\n @motivating\r\n Scenario: Users will be automatically redirected if they dont click \"Continue\"\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button will enter a loading state\r\n When their email is validated\r\n Then a button that says \"Continue\" will appear\r\n When they wait 5 seconds\r\n Then they will be redirected to login\r\n\r\n @motivating\r\n Scenario: Users are notified if verifying their email has failed\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button will enter a loading state\r\n When their email fails to be validated\r\n Then an banner is shown stating that an error occured\r\n\r\n @motivating\r\n Scenario Outline: Users cannot verify their email with an invalid or missing oob code\r\n Given a user has a <oobCode> as a url query parameter\r\n Then they will see an error message saying that their verification code is invalid or expired\r\n When they click \"Continue\"\r\n Then they will be redirected to \"/\"\r\n Examples:\r\n | oobCode |\r\n | invalid oob code |\r\n | non existant oob code |\r\n\r\n @motivating\r\n Scenario: Users are redirected to \"/\" by default\r\n Given the component does not have prop \"nextPage\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has verified their email\r\n When they click \"Continue\"\r\n Then they will be redirected to \"/\"\r\n\r\n @motivating\r\n Scenario: Custom redirection can be configured\r\n Given the component has prop \"nextPage\" with value \"/activity\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has verified their email\r\n When they click \"Continue\"\r\n Then they will be redirected to \"/activity\"\r\n\r\n @motivating\r\n Scenario Outline: Users will be redirected to the value of the nextPage url parameter if it exists\r\n Given the component <mayHave> prop \"nextPage\" with <nextPageValue>\r\n And the users url contains a \"nextPage\" query paramater with <nextPageParamValue>\r\n And the user has verified their email\r\n When they click \"Continue\"\r\n Then they are redirected to <nextPageParamValue>\r\n Examples:\r\n | mayHave | nextPageValue | nextPageParamValue |\r\n | has | /dashboard | /activity |\r\n | does not have | N/A | /activity |";
|
|
19583
18458
|
|
|
19584
18459
|
const PortalVerifyEmail_stories = {
|
|
19585
|
-
title: "
|
|
18460
|
+
title: "Portal Verify Email",
|
|
19586
18461
|
parameters: {
|
|
19587
18462
|
scenario: scenario$3,
|
|
19588
18463
|
},
|
|
@@ -19626,7 +18501,7 @@ const PortalVerifyEmail = /*#__PURE__*/Object.freeze({
|
|
|
19626
18501
|
});
|
|
19627
18502
|
|
|
19628
18503
|
const AssetCard_stories = {
|
|
19629
|
-
title: "
|
|
18504
|
+
title: "Asset Card",
|
|
19630
18505
|
};
|
|
19631
18506
|
const Default$7 = () => {
|
|
19632
18507
|
const props = {
|
|
@@ -19662,7 +18537,7 @@ const AssetCard = /*#__PURE__*/Object.freeze({
|
|
|
19662
18537
|
});
|
|
19663
18538
|
|
|
19664
18539
|
const DividedLayout_stories = {
|
|
19665
|
-
title: "
|
|
18540
|
+
title: "Divided Layout",
|
|
19666
18541
|
};
|
|
19667
18542
|
const barProps$1 = {
|
|
19668
18543
|
data: {
|
|
@@ -19754,7 +18629,7 @@ const DividedLayout$1 = /*#__PURE__*/Object.freeze({
|
|
|
19754
18629
|
const scenario$4 = "Feature: Change Password\r\n\r\n @motivating\r\n Scenario: Users can change their password\r\n Given a user has registered for the portal\r\n And they have a password\r\n When they navigate to the edit profile page\r\n And click \"Change your password...\"\r\n Then a popup will appear\r\n When they enter their new password\r\n And confirm it\r\n And click \"Change Password\"\r\n Then they will see a success banner stating that the change was successful\r\n When they logout\r\n And try to login\r\n Then they will not be able to login with their old password\r\n But they will be able to login with their new password\r\n\r\n @motivating\r\n Scenario: Users must confirm their password change\r\n Given a user has registered for the portal\r\n When they navigate to the edit profile page\r\n And click \"Change your password...\"\r\n Then a popup will appear\r\n When they enter their new password\r\n But they enter a different password to confirm\r\n And click \"Change Password\"\r\n Then they will see an error banner stating that the passwords didnt match\r\n When they logout\r\n And try to login\r\n Then they will be able to login with their existing password\r\n\r\n @motivating\r\n Scenario: Users must enter a new password and confirm it to change their password\r\n Given a user has registered for the portal\r\n When they navigate to the edit profile page\r\n And click \"Change your password...\"\r\n Then a popup will appear\r\n When they click \"Change password\"\r\n Then a validation error will appear for the new password field\r\n And their password will not be changed\r\n When they enter a new password\r\n And they click \"Change password\"\r\n Then a validation error will appear for the confirm new password field\r\n And their password will not be changed\r\n\r\n @motivating\r\n Scenario: An error banner will be displayed if the password change fails\r\n Given a user has registered for the portal\r\n When they navigate to the edit profile page\r\n And click \"Change your password...\"\r\n When they enter their new password\r\n And confirm it\r\n And click \"Change Password\"\r\n But the change fails\r\n Then they will see an error banner stating that the change failed\r\n When they logout\r\n And try to login\r\n Then they will be able to login with their existing password";
|
|
19755
18630
|
|
|
19756
18631
|
const ChangePassword_stories = {
|
|
19757
|
-
title: "
|
|
18632
|
+
title: "Change Password",
|
|
19758
18633
|
parameters: {
|
|
19759
18634
|
scenario: scenario$4,
|
|
19760
18635
|
},
|
|
@@ -19910,7 +18785,7 @@ const ChangePassword = /*#__PURE__*/Object.freeze({
|
|
|
19910
18785
|
});
|
|
19911
18786
|
|
|
19912
18787
|
const PortalProfile_stories = {
|
|
19913
|
-
title: "
|
|
18788
|
+
title: "Portal Profile",
|
|
19914
18789
|
};
|
|
19915
18790
|
// const style = {};
|
|
19916
18791
|
jss.setup(create());
|
|
@@ -20151,7 +19026,7 @@ const PortalProfile = /*#__PURE__*/Object.freeze({
|
|
|
20151
19026
|
});
|
|
20152
19027
|
|
|
20153
19028
|
const ReferralTableRewardsCell_stories = {
|
|
20154
|
-
title: "
|
|
19029
|
+
title: "Referral Table Rewards Cell",
|
|
20155
19030
|
};
|
|
20156
19031
|
const baseReward = {
|
|
20157
19032
|
id: "123",
|
|
@@ -20383,7 +19258,7 @@ const ReferralTableRewardsCell$1 = /*#__PURE__*/Object.freeze({
|
|
|
20383
19258
|
});
|
|
20384
19259
|
|
|
20385
19260
|
const ReferralTable_stories = {
|
|
20386
|
-
title: "
|
|
19261
|
+
title: "Referral Table",
|
|
20387
19262
|
};
|
|
20388
19263
|
const loadingElement = (h("div", { slot: "loading", style: { display: "contents" } },
|
|
20389
19264
|
h("sqm-table-row", null,
|
|
@@ -20870,7 +19745,7 @@ const ReferralTable$1 = /*#__PURE__*/Object.freeze({
|
|
|
20870
19745
|
});
|
|
20871
19746
|
|
|
20872
19747
|
const ReferralTableCell_stories = {
|
|
20873
|
-
title: "
|
|
19748
|
+
title: "Referral Table Cell",
|
|
20874
19749
|
};
|
|
20875
19750
|
const TableCell = () => {
|
|
20876
19751
|
return (h("sqm-referral-table-cell", { innerTemplate: "Table Cell Text" }));
|
|
@@ -20889,1073 +19764,126 @@ const DateCell = () => {
|
|
|
20889
19764
|
};
|
|
20890
19765
|
/*
|
|
20891
19766
|
TODO'S:
|
|
20892
|
-
- Add more rewards
|
|
20893
|
-
- Empty and Loading states for tables
|
|
20894
|
-
- Build rewards for every type of reward
|
|
20895
|
-
*/
|
|
20896
|
-
const rewardsData = {
|
|
20897
|
-
id: "123",
|
|
20898
|
-
type: "CREDIT",
|
|
20899
|
-
value: 19,
|
|
20900
|
-
unit: "POINT",
|
|
20901
|
-
name: "test",
|
|
20902
|
-
dateGiven: 1627427794891,
|
|
20903
|
-
dateScheduledFor: 1628146800000,
|
|
20904
|
-
dateExpires: 1629010800000,
|
|
20905
|
-
dateCancelled: 134400,
|
|
20906
|
-
fuelTankCode: "ABC",
|
|
20907
|
-
fuelTankType: "Code",
|
|
20908
|
-
currency: "null",
|
|
20909
|
-
prettyValue: "19 Points",
|
|
20910
|
-
statuses: ["AVAILABLE"],
|
|
20911
|
-
globalRewardKey: "Key",
|
|
20912
|
-
rewardRedemptionTransactions: {
|
|
20913
|
-
data: [
|
|
20914
|
-
{
|
|
20915
|
-
exchangedRewards: {
|
|
20916
|
-
data: [
|
|
20917
|
-
{
|
|
20918
|
-
prettyValue: "19 Points",
|
|
20919
|
-
type: "CREDIT",
|
|
20920
|
-
fuelTankCode: "ABC",
|
|
20921
|
-
globalRewardKey: "Key",
|
|
20922
|
-
},
|
|
20923
|
-
],
|
|
20924
|
-
},
|
|
20925
|
-
},
|
|
20926
|
-
],
|
|
20927
|
-
},
|
|
20928
|
-
};
|
|
20929
|
-
const rewards = [rewardsData];
|
|
20930
|
-
const RewardsCell = () => {
|
|
20931
|
-
return (h("sqm-referral-table-rewards-cell", { rewards: rewards }));
|
|
20932
|
-
};
|
|
20933
|
-
|
|
20934
|
-
const ReferralTableCell$1 = /*#__PURE__*/Object.freeze({
|
|
20935
|
-
__proto__: null,
|
|
20936
|
-
'default': ReferralTableCell_stories,
|
|
20937
|
-
TableCell: TableCell,
|
|
20938
|
-
TableUserCell: TableUserCell,
|
|
20939
|
-
EmptyCell: EmptyCell$1,
|
|
20940
|
-
StatusCell: StatusCell,
|
|
20941
|
-
DateCell: DateCell,
|
|
20942
|
-
RewardsCell: RewardsCell
|
|
20943
|
-
});
|
|
20944
|
-
|
|
20945
|
-
const UserName_stories = {
|
|
20946
|
-
title: "Tests/User Name",
|
|
20947
|
-
};
|
|
20948
|
-
const DemoData = () => {
|
|
20949
|
-
return (h("sqm-user-name", { demoData: {
|
|
20950
|
-
loading: false,
|
|
20951
|
-
loadingText: "...",
|
|
20952
|
-
username: "Test Testerson",
|
|
20953
|
-
} }));
|
|
20954
|
-
};
|
|
20955
|
-
const Username = () => {
|
|
20956
|
-
return h("sqm-user-name", null);
|
|
20957
|
-
};
|
|
20958
|
-
|
|
20959
|
-
const UserName = /*#__PURE__*/Object.freeze({
|
|
20960
|
-
__proto__: null,
|
|
20961
|
-
'default': UserName_stories,
|
|
20962
|
-
DemoData: DemoData,
|
|
20963
|
-
Username: Username
|
|
20964
|
-
});
|
|
20965
|
-
|
|
20966
|
-
const PasswordField_stories = {
|
|
20967
|
-
title: "Components/Portal Password Field",
|
|
20968
|
-
};
|
|
20969
|
-
const Start = () => {
|
|
20970
|
-
return (h("sqm-password-field", { demoData: {
|
|
20971
|
-
initValue: "",
|
|
20972
|
-
states: {
|
|
20973
|
-
enableValidation: true,
|
|
20974
|
-
validationErrors: {},
|
|
20975
|
-
content: {
|
|
20976
|
-
fieldLabel: "Password",
|
|
20977
|
-
},
|
|
20978
|
-
},
|
|
20979
|
-
} }));
|
|
20980
|
-
};
|
|
20981
|
-
const EmptyError = () => {
|
|
20982
|
-
return (h("sqm-password-field", { demoData: {
|
|
20983
|
-
initValue: "",
|
|
20984
|
-
states: {
|
|
20985
|
-
enableValidation: true,
|
|
20986
|
-
validationErrors: { password: "Cannot be empty" },
|
|
20987
|
-
content: {
|
|
20988
|
-
fieldLabel: "Password",
|
|
20989
|
-
},
|
|
20990
|
-
},
|
|
20991
|
-
} }));
|
|
20992
|
-
};
|
|
20993
|
-
const ValidationError = () => {
|
|
20994
|
-
return (h("sqm-password-field", { demoData: {
|
|
20995
|
-
initValue: "asdf",
|
|
20996
|
-
states: {
|
|
20997
|
-
enableValidation: true,
|
|
20998
|
-
validationErrors: { password: "Incomplete" },
|
|
20999
|
-
content: {
|
|
21000
|
-
fieldLabel: "Password",
|
|
21001
|
-
},
|
|
21002
|
-
},
|
|
21003
|
-
} }));
|
|
21004
|
-
};
|
|
21005
|
-
|
|
21006
|
-
const PasswordField = /*#__PURE__*/Object.freeze({
|
|
21007
|
-
__proto__: null,
|
|
21008
|
-
'default': PasswordField_stories,
|
|
21009
|
-
Start: Start,
|
|
21010
|
-
EmptyError: EmptyError,
|
|
21011
|
-
ValidationError: ValidationError
|
|
21012
|
-
});
|
|
21013
|
-
|
|
21014
|
-
const checkmark_circle = () => {
|
|
21015
|
-
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18" },
|
|
21016
|
-
h("path", { fill: "currentColor", "fill-rule": "evenodd", d: "M1.636 9a7.364 7.364 0 1114.728 0A7.364 7.364 0 011.636 9zM9 0a9 9 0 100 18A9 9 0 009 0zm5.192 6.266a.982.982 0 00-1.548-1.208l-4.787 6.137-2.58-2.58a.982.982 0 00-1.39 1.388l3.367 3.366a.982.982 0 001.468-.09l5.47-7.013z", "clip-rule": "evenodd" })));
|
|
21017
|
-
};
|
|
21018
|
-
const arrow_left_right = () => {
|
|
21019
|
-
return (h("svg", { width: 11, height: 12, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
21020
|
-
h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10.265 2.789a.346.346 0 000-.489L8.066.101a.346.346 0 10-.489.489l1.61 1.609H2.073a.691.691 0 00-.69.691v1.728a.346.346 0 00.69 0V2.89h7.114L7.577 4.5a.346.346 0 10.49.488l2.198-2.2zM.101 9.21a.346.346 0 000 .489l2.2 2.199a.346.346 0 00.488-.489l-1.61-1.609h7.114c.382 0 .691-.31.691-.691V7.382a.346.346 0 00-.691 0V9.11H1.18L2.789 7.5a.346.346 0 10-.489-.488l-2.199 2.2z", fill: "currentColor" })));
|
|
21021
|
-
};
|
|
21022
|
-
|
|
21023
|
-
const gift = () => {
|
|
21024
|
-
return (h("svg", { width: 16, height: 16, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
21025
|
-
h("path", { d: "M15 5H9v11h4.5a1 1 0 001-1V9h.5a1 1 0 001-1V6a1 1 0 00-1-1zM1.5 9v6a1 1 0 001 1H7V5H1a1 1 0 00-1 1v2a1 1 0 001 1h.5z", fill: "var(--sl-color-primary-200)" }),
|
|
21026
|
-
h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.5 9v1h13V9h-13z", fill: "var(--sl-color-primary-300)" }),
|
|
21027
|
-
h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M14 2.71c0 .886-1.33 2.227-2 2.29H9v11H7.002V5H4.588C3.212 4.702 2 3.645 2 2.52 2 1.426 2.476.558 3.342.183 4.169-.176 5.125.02 5.88.545c.927.643 1.447 1.851 1.919 2.947l.123.286.12-.272C8.51 2.45 9.045 1.243 9.94.596c.793-.573 1.801-.79 2.672-.397.9.405 1.388 1.336 1.388 2.51zM10.612 1.5c.48-.347 1.056-.41 1.548 0 .428.357.45.525.506.93l.01.07c0 .599-.516 1.5-1.032 1.5-.366 0-.653-.003-.922-.006-.49-.005-.92-.01-1.657.006.14-.272.252-.533.36-.782.285-.667.534-1.246 1.187-1.718zm-5.673 0c-.233-.161-.766-.09-.987.006-.183.08-.456.32-.456 1.015 0 .674 1.092 1.257 1.092 1.257S5.454 4 7.002 4c-.527-1.305-1.273-1.951-2.063-2.5z", fill: "var(--sl-color-primary-600)" })));
|
|
21028
|
-
};
|
|
21029
|
-
|
|
21030
|
-
function ProgressBarView(props) {
|
|
21031
|
-
const { progress = 0, goal = 1, steps = false, progressBarUnit = "", repeatable = false, } = props;
|
|
21032
|
-
console.log("progress bar props", props);
|
|
21033
|
-
const gift1 = gift();
|
|
21034
|
-
const gift2 = gift();
|
|
21035
|
-
const gift3 = gift();
|
|
21036
|
-
var items = [];
|
|
21037
|
-
var columns = "";
|
|
21038
|
-
var repetitions = Math.floor(progress / goal);
|
|
21039
|
-
if (repeatable) {
|
|
21040
|
-
if (steps) {
|
|
21041
|
-
addStepsRepeatable();
|
|
21042
|
-
}
|
|
21043
|
-
else {
|
|
21044
|
-
addLinearRepeatable();
|
|
21045
|
-
}
|
|
21046
|
-
}
|
|
21047
|
-
// non repeatable
|
|
21048
|
-
else {
|
|
21049
|
-
if (steps) {
|
|
21050
|
-
addSteps();
|
|
21051
|
-
}
|
|
21052
|
-
else {
|
|
21053
|
-
addLinear();
|
|
21054
|
-
}
|
|
21055
|
-
}
|
|
21056
|
-
const style = {
|
|
21057
|
-
ProgressBar: {
|
|
21058
|
-
"& .progress-bar": {
|
|
21059
|
-
height: "15px",
|
|
21060
|
-
marginTop: steps ? "var(--sl-spacing-x-large)" : "var(--sl-spacing-xx-large)",
|
|
21061
|
-
marginBottom: "var(--sl-spacing-xx-large)",
|
|
21062
|
-
marginRight: "var(--sl-spacing-x-small)",
|
|
21063
|
-
fontSize: "var(--sl-font-size-x-small)",
|
|
21064
|
-
display: "grid",
|
|
21065
|
-
gridTemplateColumns: columns,
|
|
21066
|
-
lineHeight: "45px",
|
|
21067
|
-
userSelect: "none",
|
|
21068
|
-
},
|
|
21069
|
-
"& .progress-bar.repeatable-steps": {
|
|
21070
|
-
marginLeft: "var(--sl-spacing-x-small)",
|
|
21071
|
-
},
|
|
21072
|
-
"& .filled:after": {
|
|
21073
|
-
content: '""',
|
|
21074
|
-
display: "flex",
|
|
21075
|
-
width: "100%",
|
|
21076
|
-
height: "4px",
|
|
21077
|
-
borderRadius: "4px",
|
|
21078
|
-
backgroundColor: "var(--sl-color-primary-500)",
|
|
21079
|
-
},
|
|
21080
|
-
"& .progress": {
|
|
21081
|
-
display: "block",
|
|
21082
|
-
textAlign: "center",
|
|
21083
|
-
marginLeft: "-100px",
|
|
21084
|
-
marginRight: "-100px",
|
|
21085
|
-
},
|
|
21086
|
-
"& .progress::after": {
|
|
21087
|
-
content: '""',
|
|
21088
|
-
width: "12px",
|
|
21089
|
-
height: "12px",
|
|
21090
|
-
display: "flex",
|
|
21091
|
-
backgroundColor: "var(--sl-color-primary-500)",
|
|
21092
|
-
borderRadius: "50%",
|
|
21093
|
-
position: "relative",
|
|
21094
|
-
left: "47%",
|
|
21095
|
-
top: "-85%",
|
|
21096
|
-
},
|
|
21097
|
-
"& .progress.bg:after": {
|
|
21098
|
-
width: "0",
|
|
21099
|
-
height: "0",
|
|
21100
|
-
border: "none",
|
|
21101
|
-
},
|
|
21102
|
-
"& .progress.top": {
|
|
21103
|
-
position: "relative",
|
|
21104
|
-
top: "-40px",
|
|
21105
|
-
},
|
|
21106
|
-
"& .progress.top:after": {
|
|
21107
|
-
top: "-16%",
|
|
21108
|
-
},
|
|
21109
|
-
"& .empty": {
|
|
21110
|
-
display: "block",
|
|
21111
|
-
textAlign: "center",
|
|
21112
|
-
marginLeft: "-100px",
|
|
21113
|
-
marginRight: "-100px",
|
|
21114
|
-
},
|
|
21115
|
-
"& .empty::after": {
|
|
21116
|
-
content: '""',
|
|
21117
|
-
width: "12px",
|
|
21118
|
-
height: "12px",
|
|
21119
|
-
border: "2px solid #E0E0E0",
|
|
21120
|
-
margin: "-2px",
|
|
21121
|
-
display: "flex",
|
|
21122
|
-
backgroundColor: "white",
|
|
21123
|
-
borderRadius: "50%",
|
|
21124
|
-
position: "relative",
|
|
21125
|
-
left: "47%",
|
|
21126
|
-
top: "-85%",
|
|
21127
|
-
},
|
|
21128
|
-
"& .empty.bg:after": {
|
|
21129
|
-
width: "0",
|
|
21130
|
-
height: "0",
|
|
21131
|
-
border: "none",
|
|
21132
|
-
},
|
|
21133
|
-
"& .remain:after": {
|
|
21134
|
-
content: '""',
|
|
21135
|
-
display: "flex",
|
|
21136
|
-
width: "100%",
|
|
21137
|
-
height: "4px",
|
|
21138
|
-
borderRadius: "4px",
|
|
21139
|
-
backgroundColor: "#E0E0E0",
|
|
21140
|
-
},
|
|
21141
|
-
"& .gift.bw": {
|
|
21142
|
-
filter: "grayscale(100%)",
|
|
21143
|
-
},
|
|
21144
|
-
"& .gift.start": {
|
|
21145
|
-
transform: "scale(80%)",
|
|
21146
|
-
top: "-20px",
|
|
21147
|
-
},
|
|
21148
|
-
"& .gift": {
|
|
21149
|
-
textAlign: "center",
|
|
21150
|
-
marginLeft: "-100px",
|
|
21151
|
-
marginRight: "-100px",
|
|
21152
|
-
position: "relative",
|
|
21153
|
-
display: "list-item",
|
|
21154
|
-
listStyleType: "none",
|
|
21155
|
-
top: "-18px",
|
|
21156
|
-
filter: goal <= progress ? "" : "grayscale(100%)",
|
|
21157
|
-
zIndex: "1",
|
|
21158
|
-
},
|
|
21159
|
-
},
|
|
21160
|
-
};
|
|
21161
|
-
jss.setup(create());
|
|
21162
|
-
const sheet = jss.createStyleSheet(style);
|
|
21163
|
-
const styleString = sheet.toString();
|
|
21164
|
-
return (h("div", { class: sheet.classes.ProgressBar },
|
|
21165
|
-
h("style", { type: "text/css" }, styleString),
|
|
21166
|
-
h("div", { class: repetitions > 1 ? "progress-bar repeatable-steps" : "progress-bar" }, items)));
|
|
21167
|
-
function clamp(x, min, max) {
|
|
21168
|
-
return Math.min(Math.max(x, min), max);
|
|
21169
|
-
}
|
|
21170
|
-
function addLinear() {
|
|
21171
|
-
const ratio = progress / goal;
|
|
21172
|
-
columns =
|
|
21173
|
-
clamp(ratio, 0, 1) + "fr 0fr " + clamp(1 - ratio, 0, 1) + "fr 0fr 0fr";
|
|
21174
|
-
items.push(h("div", { class: "filled" }));
|
|
21175
|
-
items.push(h("div", { class: clamp(progress, 0, goal) == goal ? "progress top bg" : "progress top" }, clamp(progress, 0, goal) == goal
|
|
21176
|
-
? ""
|
|
21177
|
-
: progressBarUnit + clamp(progress, 0, goal)));
|
|
21178
|
-
items.push(h("div", { class: "remain" }));
|
|
21179
|
-
items.push(h("div", { class: "progress bg" }, goal));
|
|
21180
|
-
items.push(h("div", { class: "gift" }, gift1));
|
|
21181
|
-
}
|
|
21182
|
-
function addSteps() {
|
|
21183
|
-
let ratio = 1 / goal;
|
|
21184
|
-
for (let i = 1; i < goal; i++) {
|
|
21185
|
-
columns += ratio + "fr 0fr ";
|
|
21186
|
-
if (i > progress) {
|
|
21187
|
-
items.push(h("div", { class: "remain" }));
|
|
21188
|
-
items.push(h("div", { class: "empty" }, i));
|
|
21189
|
-
}
|
|
21190
|
-
else {
|
|
21191
|
-
items.push(h("div", { class: "filled" }));
|
|
21192
|
-
items.push(h("div", { class: "progress" }, i));
|
|
21193
|
-
}
|
|
21194
|
-
}
|
|
21195
|
-
columns += ratio + "fr 0fr ";
|
|
21196
|
-
// reward success
|
|
21197
|
-
if (goal <= progress) {
|
|
21198
|
-
columns += "0fr ";
|
|
21199
|
-
items.push(h("div", { class: "filled" }));
|
|
21200
|
-
items.push(h("div", { class: "progress bg" }, goal));
|
|
21201
|
-
items.push(h("div", { class: "gift" }, gift1));
|
|
21202
|
-
}
|
|
21203
|
-
// reward fail
|
|
21204
|
-
else {
|
|
21205
|
-
columns += "0fr ";
|
|
21206
|
-
items.push(h("div", { class: "remain" }));
|
|
21207
|
-
items.push(h("div", { class: "empty bg" }, goal));
|
|
21208
|
-
items.push(h("div", { class: "gift" }, gift1));
|
|
21209
|
-
}
|
|
21210
|
-
}
|
|
21211
|
-
function addLinearRepeatable() {
|
|
21212
|
-
let repetitions = Math.floor(progress / goal);
|
|
21213
|
-
let ratio = ((progress % goal) / goal) * 0.5;
|
|
21214
|
-
// 0 repetition
|
|
21215
|
-
if (repetitions == 0) {
|
|
21216
|
-
columns = ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr 0.5fr 0fr 0fr";
|
|
21217
|
-
items.push(h("div", { class: "filled" }));
|
|
21218
|
-
items.push(h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progressBarUnit + progress));
|
|
21219
|
-
items.push(h("div", { class: "remain" }));
|
|
21220
|
-
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal));
|
|
21221
|
-
items.push(h("div", { class: "gift" }, gift1));
|
|
21222
|
-
items.push(h("div", { class: "remain" }));
|
|
21223
|
-
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
|
|
21224
|
-
items.push(h("div", { class: "gift bw" }, gift2));
|
|
21225
|
-
}
|
|
21226
|
-
// single repetition
|
|
21227
|
-
else if (repetitions == 1) {
|
|
21228
|
-
columns =
|
|
21229
|
-
"0.5fr 0fr 0fr " + ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr";
|
|
21230
|
-
items.push(h("div", { class: "filled" }));
|
|
21231
|
-
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal));
|
|
21232
|
-
items.push(h("div", { class: "gift" }, gift1));
|
|
21233
|
-
items.push(h("div", { class: "filled" }));
|
|
21234
|
-
items.push(h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progress == goal ? "" : progressBarUnit + progress));
|
|
21235
|
-
items.push(h("div", { class: "remain" }));
|
|
21236
|
-
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
|
|
21237
|
-
items.push(h("div", { class: "gift bw" }, gift2));
|
|
21238
|
-
}
|
|
21239
|
-
// multiple repetitions
|
|
21240
|
-
else {
|
|
21241
|
-
columns =
|
|
21242
|
-
"0fr 0fr 0.5fr 0fr 0fr " +
|
|
21243
|
-
ratio +
|
|
21244
|
-
"fr 0fr " +
|
|
21245
|
-
(0.5 - ratio) +
|
|
21246
|
-
"fr 0fr 0fr";
|
|
21247
|
-
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions - 1)));
|
|
21248
|
-
items.push(h("div", { class: "gift start" }, gift1));
|
|
21249
|
-
items.push(h("div", { class: "filled" }));
|
|
21250
|
-
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * repetitions));
|
|
21251
|
-
items.push(h("div", { class: "gift" }, gift2));
|
|
21252
|
-
items.push(h("div", { class: "filled" }));
|
|
21253
|
-
items.push(h("div", { class: progress == goal * repetitions ? "progress top bg" : "progress top" }, progress == goal * repetitions ? "" : progressBarUnit + progress));
|
|
21254
|
-
items.push(h("div", { class: "remain" }));
|
|
21255
|
-
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions + 1)));
|
|
21256
|
-
items.push(h("div", { class: "gift bw" }, gift3));
|
|
21257
|
-
}
|
|
21258
|
-
}
|
|
21259
|
-
function addStepsRepeatable() {
|
|
21260
|
-
let repetitions = Math.floor(progress / goal);
|
|
21261
|
-
// no or single repetition
|
|
21262
|
-
if (repetitions < 2) {
|
|
21263
|
-
let ratio = 1 / goal;
|
|
21264
|
-
for (let i = 1; i < goal * 2 + 1; i++) {
|
|
21265
|
-
columns += ratio + "fr 0fr ";
|
|
21266
|
-
if (i > progress) {
|
|
21267
|
-
if (i == goal) {
|
|
21268
|
-
columns += "0fr ";
|
|
21269
|
-
items.push(h("div", { class: "remain" }));
|
|
21270
|
-
items.push(h("div", { class: "empty bg" }, goal));
|
|
21271
|
-
items.push(h("div", { class: "gift bw" }, gift1));
|
|
21272
|
-
}
|
|
21273
|
-
else if (i == goal * 2) {
|
|
21274
|
-
columns += "0fr 0fr";
|
|
21275
|
-
items.push(h("div", { class: "remain" }));
|
|
21276
|
-
items.push(h("div", { class: "empty bg" }, goal * 2));
|
|
21277
|
-
items.push(h("div", { class: "gift bw" }, gift2));
|
|
21278
|
-
}
|
|
21279
|
-
else {
|
|
21280
|
-
items.push(h("div", { class: "remain" }));
|
|
21281
|
-
items.push(h("div", { class: "empty" }, progressBarUnit + i));
|
|
21282
|
-
}
|
|
21283
|
-
}
|
|
21284
|
-
else if (i == goal) {
|
|
21285
|
-
columns += "0fr ";
|
|
21286
|
-
items.push(h("div", { class: "filled" }));
|
|
21287
|
-
items.push(h("div", { class: "progress bg" }, i));
|
|
21288
|
-
items.push(h("div", { class: "gift" }, gift3));
|
|
21289
|
-
}
|
|
21290
|
-
else {
|
|
21291
|
-
items.push(h("div", { class: "filled" }));
|
|
21292
|
-
items.push(h("div", { class: "progress" }, i));
|
|
21293
|
-
}
|
|
21294
|
-
}
|
|
21295
|
-
}
|
|
21296
|
-
// case repetition many
|
|
21297
|
-
else {
|
|
21298
|
-
let position = (progress % goal) + goal;
|
|
21299
|
-
let ratio = 1 / goal;
|
|
21300
|
-
columns += "0fr 0fr ";
|
|
21301
|
-
items.push(h("div", { class: "progress bg" }, goal * (repetitions - 1)));
|
|
21302
|
-
items.push(h("div", { class: "gift start" }, gift1));
|
|
21303
|
-
for (let i = 1; i < goal * 2 + 1; i++) {
|
|
21304
|
-
columns += ratio + "fr 0fr ";
|
|
21305
|
-
if (i <= goal) {
|
|
21306
|
-
if (i == goal) {
|
|
21307
|
-
columns += "0fr ";
|
|
21308
|
-
items.push(h("div", { class: "filled" }));
|
|
21309
|
-
items.push(h("div", { class: "progress bg" }, i + goal * (repetitions - 1)));
|
|
21310
|
-
items.push(h("div", { class: "gift" }, gift2));
|
|
21311
|
-
}
|
|
21312
|
-
else {
|
|
21313
|
-
items.push(h("div", { class: "filled" }));
|
|
21314
|
-
items.push(h("div", { class: "progress" }, i + goal * (repetitions - 1)));
|
|
21315
|
-
}
|
|
21316
|
-
}
|
|
21317
|
-
else if (i > position) {
|
|
21318
|
-
if (i == goal * 2) {
|
|
21319
|
-
columns += "0fr 0fr";
|
|
21320
|
-
items.push(h("div", { class: "remain" }));
|
|
21321
|
-
items.push(h("div", { class: "empty bg" }, i + goal * (repetitions - 1)));
|
|
21322
|
-
items.push(h("div", { class: "gift bw" }, gift3));
|
|
21323
|
-
}
|
|
21324
|
-
else {
|
|
21325
|
-
items.push(h("div", { class: "remain" }));
|
|
21326
|
-
items.push(h("div", { class: "empty" }, i + goal * (repetitions - 1)));
|
|
21327
|
-
}
|
|
21328
|
-
}
|
|
21329
|
-
else {
|
|
21330
|
-
items.push(h("div", { class: "filled" }));
|
|
21331
|
-
items.push(h("div", { class: "progress" }, i + goal * (repetitions - 1)));
|
|
21332
|
-
}
|
|
21333
|
-
}
|
|
21334
|
-
}
|
|
21335
|
-
}
|
|
21336
|
-
}
|
|
21337
|
-
|
|
21338
|
-
function TaskCardView(props) {
|
|
21339
|
-
const { rewardAmount, cardTitle, description, showProgressBar, progress = 0, goal, rewardUnit, repeatable, showExpiry, dateExpires, buttonText, buttonLink, loading, } = props;
|
|
21340
|
-
console.log({ props });
|
|
21341
|
-
const checkmark_circle$1 = checkmark_circle();
|
|
21342
|
-
const arrow_left_right$1 = arrow_left_right();
|
|
21343
|
-
const style = {
|
|
21344
|
-
HostBlock: HostBlock,
|
|
21345
|
-
TaskCard: {
|
|
21346
|
-
"& .main > div": {
|
|
21347
|
-
margin: "var(--sl-spacing-medium)",
|
|
21348
|
-
},
|
|
21349
|
-
"& .main": {
|
|
21350
|
-
position: "relative",
|
|
21351
|
-
boxSizing: "border-box",
|
|
21352
|
-
minWidth: "347px",
|
|
21353
|
-
background: "var(--sl-color-white)",
|
|
21354
|
-
border: "1px solid var(--sl-color-gray-300)",
|
|
21355
|
-
borderRadius: "var(--sl-border-radius-medium)",
|
|
21356
|
-
fontSize: "var(--sl-font-size-small)",
|
|
21357
|
-
lineHeight: "var(--sl-line-height-dense)",
|
|
21358
|
-
},
|
|
21359
|
-
"& .main.complete": {
|
|
21360
|
-
background: "var(--sl-color-primary-50)",
|
|
21361
|
-
borderColor: "var(--sl-color-primary-700)",
|
|
21362
|
-
},
|
|
21363
|
-
},
|
|
21364
|
-
Header: {
|
|
21365
|
-
display: "flex",
|
|
21366
|
-
"& .icon": {
|
|
21367
|
-
alignSelf: "center",
|
|
21368
|
-
lineHeight: "0",
|
|
21369
|
-
color: "var(--sl-color-primary-700)",
|
|
21370
|
-
fontSize: "var(--sl-font-size-large)",
|
|
21371
|
-
marginRight: "var(--sl-spacing-x-small)",
|
|
21372
|
-
},
|
|
21373
|
-
"& .value": {
|
|
21374
|
-
alignSelf: "center",
|
|
21375
|
-
color: "var(--sl-color-black)",
|
|
21376
|
-
fontSize: "var(--sl-font-size-x-large)",
|
|
21377
|
-
fontWeight: "var(--sl-font-weight-semibold)",
|
|
21378
|
-
lineHeight: "100%",
|
|
21379
|
-
marginRight: "var(--sl-spacing-xx-small)",
|
|
21380
|
-
},
|
|
21381
|
-
"& .text": {
|
|
21382
|
-
alignSelf: "end",
|
|
21383
|
-
textTransform: "uppercase",
|
|
21384
|
-
color: "var(--sl-color-gray-600)",
|
|
21385
|
-
fontSize: "var(--sl-font-size-x-small)",
|
|
21386
|
-
lineHeight: "var(--sl-font-size-medium)",
|
|
21387
|
-
marginRight: "var(--sl-spacing-xx-small)",
|
|
21388
|
-
},
|
|
21389
|
-
},
|
|
21390
|
-
Title: {
|
|
21391
|
-
color: "var(--sl-color-black)",
|
|
21392
|
-
fontSize: "var(--sl-font-size-small)",
|
|
21393
|
-
},
|
|
21394
|
-
Footer: {
|
|
21395
|
-
display: "flex",
|
|
21396
|
-
"& .icon": {
|
|
21397
|
-
fontSize: "var(--sl-font-size-xx-small)",
|
|
21398
|
-
marginRight: "var(--sl-spacing-xx-small)",
|
|
21399
|
-
},
|
|
21400
|
-
"& .text": {
|
|
21401
|
-
marginTop: "auto",
|
|
21402
|
-
fontSize: "var(--sl-font-size-x-small)",
|
|
21403
|
-
color: "var(--sl-color-gray-600)",
|
|
21404
|
-
},
|
|
21405
|
-
"& .action": {
|
|
21406
|
-
marginTop: "auto",
|
|
21407
|
-
marginLeft: "auto",
|
|
21408
|
-
},
|
|
21409
|
-
"& sl-button.action::part(base) ": {
|
|
21410
|
-
color: "var(--sl-color-white)",
|
|
21411
|
-
background: "var(--sl-color-primary-500)",
|
|
21412
|
-
border: "1px solid var(--sl-color-primary-500)",
|
|
21413
|
-
borderRadius: "var(--sl-border-radius-medium)",
|
|
21414
|
-
},
|
|
21415
|
-
},
|
|
21416
|
-
};
|
|
21417
|
-
jss.setup(create());
|
|
21418
|
-
const sheet = jss.createStyleSheet(style);
|
|
21419
|
-
const styleString = sheet.toString();
|
|
21420
|
-
const showComplete = progress >= goal;
|
|
21421
|
-
const repetitions = showProgressBar ? Math.floor(progress / goal) : progress;
|
|
21422
|
-
console.log({ showProgressBar, loading });
|
|
21423
|
-
return (h("div", { class: sheet.classes.TaskCard },
|
|
21424
|
-
h("div", { class: showComplete ? "main complete" : "main" },
|
|
21425
|
-
h("style", { type: "text/css" }, styleString),
|
|
21426
|
-
h("div", { class: sheet.classes.Header },
|
|
21427
|
-
showComplete && h("span", { class: "icon" }, checkmark_circle$1),
|
|
21428
|
-
h("span", { class: "value" }, rewardAmount),
|
|
21429
|
-
h("span", { class: "text" }, rewardUnit)),
|
|
21430
|
-
h("div", { class: sheet.classes.Title }, cardTitle),
|
|
21431
|
-
h(Details, { description: description }),
|
|
21432
|
-
showProgressBar && loading ? (h("sl-skeleton", { style: { width: "98%", margin: "0 auto" } })) : (showProgressBar && h(ProgressBarView, Object.assign({}, props))),
|
|
21433
|
-
h("div", { class: sheet.classes.Footer },
|
|
21434
|
-
h("span", { class: "text" },
|
|
21435
|
-
repeatable && (h("div", null,
|
|
21436
|
-
h("span", { class: "icon" }, arrow_left_right$1),
|
|
21437
|
-
h("span", null,
|
|
21438
|
-
"Completed ",
|
|
21439
|
-
repetitions,
|
|
21440
|
-
" times"))),
|
|
21441
|
-
showExpiry && (h("span", null,
|
|
21442
|
-
"Ends ",
|
|
21443
|
-
" ",
|
|
21444
|
-
dateExpires))),
|
|
21445
|
-
h("sl-button", { class: "action", size: "small", onClick: () => window.open(buttonLink), disabled: showComplete && repeatable == false }, showComplete && repeatable == false
|
|
21446
|
-
? "Task completed"
|
|
21447
|
-
: buttonText)))));
|
|
21448
|
-
}
|
|
21449
|
-
function Details(props) {
|
|
21450
|
-
const style = {
|
|
21451
|
-
Description: {
|
|
21452
|
-
"& input[type=checkbox]": {
|
|
21453
|
-
display: "none",
|
|
21454
|
-
},
|
|
21455
|
-
"& input:checked ~ .details": {
|
|
21456
|
-
transform: "rotate(-180deg)",
|
|
21457
|
-
},
|
|
21458
|
-
"& .details": {
|
|
21459
|
-
position: "absolute",
|
|
21460
|
-
top: "var(--sl-spacing-medium)",
|
|
21461
|
-
right: "var(--sl-spacing-medium)",
|
|
21462
|
-
color: "var(--sl-color-gray-700)",
|
|
21463
|
-
fontSize: "var(--sl-font-size-large)",
|
|
21464
|
-
"& :hover": {
|
|
21465
|
-
color: "var(--sl-color-primary-700)",
|
|
21466
|
-
},
|
|
21467
|
-
transformOrigin: "50% 37%",
|
|
21468
|
-
transition: "transform var(--sl-transition-medium) ease",
|
|
21469
|
-
},
|
|
21470
|
-
"& input:checked ~ .summary": {
|
|
21471
|
-
transition: "max-height var(--sl-transition-medium) ease",
|
|
21472
|
-
maxHeight: "300px",
|
|
21473
|
-
},
|
|
21474
|
-
"& .summary": {
|
|
21475
|
-
display: "block",
|
|
21476
|
-
overflow: "hidden",
|
|
21477
|
-
color: "var(--sl-color-gray-700)",
|
|
21478
|
-
fontSize: "var(--sl-font-size-x-small)",
|
|
21479
|
-
maxHeight: "0px",
|
|
21480
|
-
transition: "max-height var(--sl-transition-fast) ease-out",
|
|
21481
|
-
},
|
|
21482
|
-
},
|
|
21483
|
-
};
|
|
21484
|
-
jss.setup(create());
|
|
21485
|
-
const sheet = jss.createStyleSheet(style);
|
|
21486
|
-
const styleString = sheet.toString();
|
|
21487
|
-
const rid = Math.random().toString(36).slice(2);
|
|
21488
|
-
return (h("div", null,
|
|
21489
|
-
h("style", { type: "text/css" }, styleString),
|
|
21490
|
-
h("span", { class: sheet.classes.Description },
|
|
21491
|
-
h("input", { type: "checkbox", id: "details-" + rid }),
|
|
21492
|
-
h("label", { class: "details", htmlFor: "details-" + rid },
|
|
21493
|
-
h("sl-icon", { name: "chevron-down" })),
|
|
21494
|
-
h("span", { class: "summary" }, props.description))));
|
|
21495
|
-
}
|
|
21496
|
-
|
|
21497
|
-
const scenario$5 = "@author:\r\n@owner:\r\nFeature: Task Card\r\n\r\n\tScenario Outline: Task Card View\r\n\r\n\t\tGiven <points>, <title>, <description>, <progress>, <goal>, <buttonText>, <buttonLink>,\r\n\t\tThen <points> is shown on the top left corner of the header area\r\n\t\tAnd <title> is shown in the body area left aligned and in bold text\r\n\t\tAnd <buttonText> is shown on the bottom right corner of the footer area\r\n\t\tWhen the user clicks on details icon\r\n\t\tThen <description> becomes visible\r\n\r\n\t\tExamples:\r\n\t\t\t| points | title | description | progress | goal | buttonText | buttonLink |\r\n\t\t\t| 20 | Complete a survey | Description of action | 0 | 1 | Take Survey | www.example.com |\r\n\r\n\tScenario Outline: Task Card Single Action\r\n\r\n\t\tGiven a task card\r\n\t\tAnd showProgressBar has value false\r\n\r\n\tScenario Outline: Single Action Repeatable\r\n\r\n\r\n\tScenario Outline: Task Card Expiry\r\n\r\n\t\tGiven a task card component\r\n\t\tAnd it has expire value true\r\n\t\tAnd it has <dateExpire>\r\n\t\tThen <dateExpire> is shown on the lower left corner of the task card\r\n";
|
|
21498
|
-
|
|
21499
|
-
const TaskCard_stories = {
|
|
21500
|
-
title: "Components/Task Card/",
|
|
21501
|
-
parameters: {
|
|
21502
|
-
scenario: scenario$5,
|
|
21503
|
-
},
|
|
21504
|
-
};
|
|
21505
|
-
const resizable = {
|
|
21506
|
-
width: "347px",
|
|
21507
|
-
minWidth: "347px",
|
|
21508
|
-
resize: "horizontal",
|
|
21509
|
-
height: "fit-content",
|
|
21510
|
-
overflow: "hidden",
|
|
21511
|
-
};
|
|
21512
|
-
const NotRepeatable = () => {
|
|
21513
|
-
const oneAction = {
|
|
21514
|
-
rewardAmount: 20,
|
|
21515
|
-
showExpiry: false,
|
|
21516
|
-
rewardUnit: "Points",
|
|
21517
|
-
cardTitle: "Complete a survey",
|
|
21518
|
-
repeatable: false,
|
|
21519
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21520
|
-
buttonText: "Take survey",
|
|
21521
|
-
goal: 1,
|
|
21522
|
-
buttonLink: "https://example.com/",
|
|
21523
|
-
showProgressBar: false,
|
|
21524
|
-
loading: false,
|
|
21525
|
-
};
|
|
21526
|
-
const coupleActions = {
|
|
21527
|
-
rewardAmount: 40,
|
|
21528
|
-
rewardUnit: "Points",
|
|
21529
|
-
cardTitle: "Comment on 5 articles",
|
|
21530
|
-
showProgressBar: true,
|
|
21531
|
-
showExpiry: false,
|
|
21532
|
-
goal: 5,
|
|
21533
|
-
repeatable: false,
|
|
21534
|
-
steps: true,
|
|
21535
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21536
|
-
buttonText: "Start reading",
|
|
21537
|
-
buttonLink: "https://example.com/",
|
|
21538
|
-
loading: false,
|
|
21539
|
-
};
|
|
21540
|
-
const manyActions = {
|
|
21541
|
-
rewardAmount: 150,
|
|
21542
|
-
rewardUnit: "Points",
|
|
21543
|
-
cardTitle: "Spend $500 at our Store",
|
|
21544
|
-
showProgressBar: true,
|
|
21545
|
-
showExpiry: false,
|
|
21546
|
-
goal: 500,
|
|
21547
|
-
repeatable: false,
|
|
21548
|
-
unit: "$",
|
|
21549
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21550
|
-
buttonText: "Visit our Store",
|
|
21551
|
-
buttonLink: "https://example.com/",
|
|
21552
|
-
loading: false,
|
|
21553
|
-
};
|
|
21554
|
-
return (h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
21555
|
-
h("div", { style: resizable },
|
|
21556
|
-
h("h4", null, "One Action"),
|
|
21557
|
-
h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
21558
|
-
" ",
|
|
21559
|
-
h("h5", null),
|
|
21560
|
-
h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
|
|
21561
|
-
" ",
|
|
21562
|
-
h("h5", null)),
|
|
21563
|
-
h("div", { style: resizable },
|
|
21564
|
-
h("h4", null, "A Couple Actions"),
|
|
21565
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 0 })),
|
|
21566
|
-
" ",
|
|
21567
|
-
h("h5", null),
|
|
21568
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
|
|
21569
|
-
" ",
|
|
21570
|
-
h("h5", null),
|
|
21571
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
|
|
21572
|
-
" ",
|
|
21573
|
-
h("h5", null)),
|
|
21574
|
-
h("div", { style: resizable },
|
|
21575
|
-
h("h4", null, "Many Actions"),
|
|
21576
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 0 })),
|
|
21577
|
-
" ",
|
|
21578
|
-
h("h5", null),
|
|
21579
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 230 })),
|
|
21580
|
-
" ",
|
|
21581
|
-
h("h5", null),
|
|
21582
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
|
|
21583
|
-
" ",
|
|
21584
|
-
h("h5", null))));
|
|
21585
|
-
};
|
|
21586
|
-
const NotRepeatableWithExpiry = () => {
|
|
21587
|
-
const oneAction = {
|
|
21588
|
-
rewardAmount: 20,
|
|
21589
|
-
rewardUnit: "Points",
|
|
21590
|
-
cardTitle: "Complete a survey",
|
|
21591
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21592
|
-
buttonText: "Take survey",
|
|
21593
|
-
goal: 1,
|
|
21594
|
-
showExpiry: true,
|
|
21595
|
-
repeatable: false,
|
|
21596
|
-
dateExpires: "Nov 1, 2021",
|
|
21597
|
-
buttonLink: "https://example.com/",
|
|
21598
|
-
showProgressBar: false,
|
|
21599
|
-
loading: false,
|
|
21600
|
-
};
|
|
21601
|
-
const coupleActions = {
|
|
21602
|
-
rewardAmount: 40,
|
|
21603
|
-
rewardUnit: "Points",
|
|
21604
|
-
cardTitle: "Comment on 5 articles",
|
|
21605
|
-
showProgressBar: true,
|
|
21606
|
-
goal: 5,
|
|
21607
|
-
steps: true,
|
|
21608
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21609
|
-
buttonText: "Start reading",
|
|
21610
|
-
showExpiry: true,
|
|
21611
|
-
repeatable: false,
|
|
21612
|
-
dateExpires: "Nov 1, 2021",
|
|
21613
|
-
buttonLink: "https://example.com/",
|
|
21614
|
-
loading: false,
|
|
21615
|
-
};
|
|
21616
|
-
const manyActions = {
|
|
21617
|
-
rewardAmount: 150,
|
|
21618
|
-
rewardUnit: "Points",
|
|
21619
|
-
repeatable: false,
|
|
21620
|
-
cardTitle: "Spend $500 at our Store",
|
|
21621
|
-
showProgressBar: true,
|
|
21622
|
-
goal: 500,
|
|
21623
|
-
unit: "$",
|
|
21624
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21625
|
-
buttonText: "Visit our Store",
|
|
21626
|
-
showExpiry: true,
|
|
21627
|
-
dateExpires: "Nov 1, 2021",
|
|
21628
|
-
buttonLink: "https://example.com/",
|
|
21629
|
-
loading: false,
|
|
21630
|
-
};
|
|
21631
|
-
return (h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
21632
|
-
h("div", { style: resizable },
|
|
21633
|
-
h("h4", null, "One Action"),
|
|
21634
|
-
h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
21635
|
-
" ",
|
|
21636
|
-
h("h5", null),
|
|
21637
|
-
h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
|
|
21638
|
-
" ",
|
|
21639
|
-
h("h5", null)),
|
|
21640
|
-
h("div", { style: resizable },
|
|
21641
|
-
h("h4", null, "A Couple Actions"),
|
|
21642
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 0 })),
|
|
21643
|
-
" ",
|
|
21644
|
-
h("h5", null),
|
|
21645
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
|
|
21646
|
-
" ",
|
|
21647
|
-
h("h5", null),
|
|
21648
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
|
|
21649
|
-
" ",
|
|
21650
|
-
h("h5", null)),
|
|
21651
|
-
h("div", { style: resizable },
|
|
21652
|
-
h("h4", null, "Many Actions"),
|
|
21653
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 0 })),
|
|
21654
|
-
" ",
|
|
21655
|
-
h("h5", null),
|
|
21656
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 230 })),
|
|
21657
|
-
" ",
|
|
21658
|
-
h("h5", null),
|
|
21659
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
|
|
21660
|
-
" ",
|
|
21661
|
-
h("h5", null))));
|
|
21662
|
-
};
|
|
21663
|
-
const Repeatable = () => {
|
|
21664
|
-
const oneAction = {
|
|
21665
|
-
rewardAmount: 20,
|
|
21666
|
-
rewardUnit: "Points",
|
|
21667
|
-
showExpiry: false,
|
|
21668
|
-
cardTitle: "Complete a survey",
|
|
21669
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21670
|
-
buttonText: "Take survey",
|
|
21671
|
-
goal: 1,
|
|
21672
|
-
repeatable: true,
|
|
21673
|
-
buttonLink: "https://example.com/",
|
|
21674
|
-
showProgressBar: false,
|
|
21675
|
-
loading: false,
|
|
21676
|
-
};
|
|
21677
|
-
const coupleActions = {
|
|
21678
|
-
rewardAmount: 40,
|
|
21679
|
-
rewardUnit: "Points",
|
|
21680
|
-
showExpiry: false,
|
|
21681
|
-
cardTitle: "Comment on 5 articles",
|
|
21682
|
-
showProgressBar: true,
|
|
21683
|
-
repeatable: true,
|
|
21684
|
-
goal: 5,
|
|
21685
|
-
steps: true,
|
|
21686
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21687
|
-
buttonText: "Start reading",
|
|
21688
|
-
buttonLink: "https://example.com/",
|
|
21689
|
-
loading: false,
|
|
21690
|
-
};
|
|
21691
|
-
const manyActions = {
|
|
21692
|
-
rewardAmount: 150,
|
|
21693
|
-
rewardUnit: "Points",
|
|
21694
|
-
showExpiry: false,
|
|
21695
|
-
cardTitle: "Spend $500 at our Store",
|
|
21696
|
-
showProgressBar: true,
|
|
21697
|
-
repeatable: true,
|
|
21698
|
-
goal: 500,
|
|
21699
|
-
unit: "$",
|
|
21700
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21701
|
-
buttonText: "Visit our Store",
|
|
21702
|
-
buttonLink: "https://example.com/",
|
|
21703
|
-
loading: false,
|
|
21704
|
-
};
|
|
21705
|
-
return (h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
21706
|
-
h("div", { style: resizable },
|
|
21707
|
-
h("h4", null, "One Action"),
|
|
21708
|
-
h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
21709
|
-
" ",
|
|
21710
|
-
h("h5", null),
|
|
21711
|
-
h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
|
|
21712
|
-
" ",
|
|
21713
|
-
h("h5", null)),
|
|
21714
|
-
h("div", { style: resizable },
|
|
21715
|
-
h("h4", null, "A Couple Actions"),
|
|
21716
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
|
|
21717
|
-
" ",
|
|
21718
|
-
h("h5", null),
|
|
21719
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
|
|
21720
|
-
" ",
|
|
21721
|
-
h("h5", null),
|
|
21722
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 7 })),
|
|
21723
|
-
" ",
|
|
21724
|
-
h("h5", null),
|
|
21725
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
|
|
21726
|
-
" ",
|
|
21727
|
-
h("h5", null)),
|
|
21728
|
-
h("div", { style: resizable },
|
|
21729
|
-
h("h4", null, "Many Actions"),
|
|
21730
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 100 })),
|
|
21731
|
-
" ",
|
|
21732
|
-
h("h5", null),
|
|
21733
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
|
|
21734
|
-
" ",
|
|
21735
|
-
h("h5", null),
|
|
21736
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 650 })),
|
|
21737
|
-
" ",
|
|
21738
|
-
h("h5", null),
|
|
21739
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
|
|
21740
|
-
" ",
|
|
21741
|
-
h("h5", null))));
|
|
19767
|
+
- Add more rewards
|
|
19768
|
+
- Empty and Loading states for tables
|
|
19769
|
+
- Build rewards for every type of reward
|
|
19770
|
+
*/
|
|
19771
|
+
const rewardsData = {
|
|
19772
|
+
id: "123",
|
|
19773
|
+
type: "CREDIT",
|
|
19774
|
+
value: 19,
|
|
19775
|
+
unit: "POINT",
|
|
19776
|
+
name: "test",
|
|
19777
|
+
dateGiven: 1627427794891,
|
|
19778
|
+
dateScheduledFor: 1628146800000,
|
|
19779
|
+
dateExpires: 1629010800000,
|
|
19780
|
+
dateCancelled: 134400,
|
|
19781
|
+
fuelTankCode: "ABC",
|
|
19782
|
+
fuelTankType: "Code",
|
|
19783
|
+
currency: "null",
|
|
19784
|
+
prettyValue: "19 Points",
|
|
19785
|
+
statuses: ["AVAILABLE"],
|
|
19786
|
+
globalRewardKey: "Key",
|
|
19787
|
+
rewardRedemptionTransactions: {
|
|
19788
|
+
data: [
|
|
19789
|
+
{
|
|
19790
|
+
exchangedRewards: {
|
|
19791
|
+
data: [
|
|
19792
|
+
{
|
|
19793
|
+
prettyValue: "19 Points",
|
|
19794
|
+
type: "CREDIT",
|
|
19795
|
+
fuelTankCode: "ABC",
|
|
19796
|
+
globalRewardKey: "Key",
|
|
19797
|
+
},
|
|
19798
|
+
],
|
|
19799
|
+
},
|
|
19800
|
+
},
|
|
19801
|
+
],
|
|
19802
|
+
},
|
|
21742
19803
|
};
|
|
21743
|
-
const
|
|
21744
|
-
|
|
21745
|
-
|
|
21746
|
-
rewardUnit: "Points",
|
|
21747
|
-
cardTitle: "Complete a survey",
|
|
21748
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21749
|
-
buttonText: "Take survey",
|
|
21750
|
-
goal: 1,
|
|
21751
|
-
repeatable: true,
|
|
21752
|
-
showExpiry: true,
|
|
21753
|
-
dateExpires: "Nov 1, 2021",
|
|
21754
|
-
buttonLink: "https://example.com/",
|
|
21755
|
-
showProgressBar: false,
|
|
21756
|
-
loading: false,
|
|
21757
|
-
};
|
|
21758
|
-
const coupleActions = {
|
|
21759
|
-
rewardAmount: 40,
|
|
21760
|
-
rewardUnit: "Points",
|
|
21761
|
-
cardTitle: "Comment on 5 articles",
|
|
21762
|
-
showProgressBar: true,
|
|
21763
|
-
repeatable: true,
|
|
21764
|
-
goal: 5,
|
|
21765
|
-
steps: true,
|
|
21766
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21767
|
-
buttonText: "Start reading",
|
|
21768
|
-
showExpiry: true,
|
|
21769
|
-
dateExpires: "Nov 1, 2021",
|
|
21770
|
-
buttonLink: "https://example.com/",
|
|
21771
|
-
loading: false,
|
|
21772
|
-
};
|
|
21773
|
-
const manyActions = {
|
|
21774
|
-
rewardAmount: 150,
|
|
21775
|
-
rewardUnit: "Points",
|
|
21776
|
-
cardTitle: "Spend $500 at our Store",
|
|
21777
|
-
showProgressBar: true,
|
|
21778
|
-
repeatable: true,
|
|
21779
|
-
goal: 500,
|
|
21780
|
-
unit: "$",
|
|
21781
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21782
|
-
buttonText: "Visit our Store",
|
|
21783
|
-
showExpiry: true,
|
|
21784
|
-
dateExpires: "Nov 1, 2021",
|
|
21785
|
-
buttonLink: "https://example.com/",
|
|
21786
|
-
loading: false,
|
|
21787
|
-
};
|
|
21788
|
-
return (h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
21789
|
-
h("div", { style: resizable },
|
|
21790
|
-
h("h4", null, "One Action"),
|
|
21791
|
-
h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
21792
|
-
" ",
|
|
21793
|
-
h("h5", null),
|
|
21794
|
-
h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
|
|
21795
|
-
" ",
|
|
21796
|
-
h("h5", null)),
|
|
21797
|
-
h("div", { style: resizable },
|
|
21798
|
-
h("h4", null, "A Couple Actions"),
|
|
21799
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
|
|
21800
|
-
" ",
|
|
21801
|
-
h("h5", null),
|
|
21802
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
|
|
21803
|
-
" ",
|
|
21804
|
-
h("h5", null),
|
|
21805
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 7 })),
|
|
21806
|
-
" ",
|
|
21807
|
-
h("h5", null),
|
|
21808
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
|
|
21809
|
-
" ",
|
|
21810
|
-
h("h5", null)),
|
|
21811
|
-
h("div", { style: resizable },
|
|
21812
|
-
h("h4", null, "Many Actions"),
|
|
21813
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 100 })),
|
|
21814
|
-
" ",
|
|
21815
|
-
h("h5", null),
|
|
21816
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
|
|
21817
|
-
" ",
|
|
21818
|
-
h("h5", null),
|
|
21819
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 650 })),
|
|
21820
|
-
" ",
|
|
21821
|
-
h("h5", null),
|
|
21822
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
|
|
21823
|
-
" ",
|
|
21824
|
-
h("h5", null))));
|
|
19804
|
+
const rewards = [rewardsData];
|
|
19805
|
+
const RewardsCell = () => {
|
|
19806
|
+
return (h("sqm-referral-table-rewards-cell", { rewards: rewards }));
|
|
21825
19807
|
};
|
|
21826
19808
|
|
|
21827
|
-
const
|
|
19809
|
+
const ReferralTableCell$1 = /*#__PURE__*/Object.freeze({
|
|
21828
19810
|
__proto__: null,
|
|
21829
|
-
'default':
|
|
21830
|
-
|
|
21831
|
-
|
|
21832
|
-
|
|
21833
|
-
|
|
19811
|
+
'default': ReferralTableCell_stories,
|
|
19812
|
+
TableCell: TableCell,
|
|
19813
|
+
TableUserCell: TableUserCell,
|
|
19814
|
+
EmptyCell: EmptyCell$1,
|
|
19815
|
+
StatusCell: StatusCell,
|
|
19816
|
+
DateCell: DateCell,
|
|
19817
|
+
RewardsCell: RewardsCell
|
|
21834
19818
|
});
|
|
21835
19819
|
|
|
21836
|
-
|
|
21837
|
-
|
|
21838
|
-
*
|
|
21839
|
-
* @returns
|
|
21840
|
-
*/
|
|
21841
|
-
function MatrixStory({ matrix, props, Component, }) {
|
|
21842
|
-
const propMatrix = Object.keys(matrix).map((propKey) => {
|
|
21843
|
-
const propValues = matrix[propKey];
|
|
21844
|
-
return propValues.map((val) => {
|
|
21845
|
-
return {
|
|
21846
|
-
[propKey]: val,
|
|
21847
|
-
};
|
|
21848
|
-
});
|
|
21849
|
-
});
|
|
21850
|
-
const combinations = cartesian(...propMatrix);
|
|
21851
|
-
const propsCombinations = combinations.map((combo) => {
|
|
21852
|
-
return combo.reduce((props, prop) => {
|
|
21853
|
-
return {
|
|
21854
|
-
...props,
|
|
21855
|
-
...prop,
|
|
21856
|
-
};
|
|
21857
|
-
}, {});
|
|
21858
|
-
});
|
|
21859
|
-
return propsCombinations.map((combo) => {
|
|
21860
|
-
const example = { ...props, ...combo };
|
|
21861
|
-
return (h("div", null,
|
|
21862
|
-
h(PropsTable, { values: example }),
|
|
21863
|
-
h("hr", null),
|
|
21864
|
-
h(Component, Object.assign({}, example))));
|
|
21865
|
-
});
|
|
21866
|
-
}
|
|
21867
|
-
function PropsTable({ values }) {
|
|
21868
|
-
return (h("table", null,
|
|
21869
|
-
h("tbody", null, Object.keys(values).map((key) => {
|
|
21870
|
-
return (h("tr", null,
|
|
21871
|
-
h("th", null, key),
|
|
21872
|
-
h("td", null, JSON.stringify(values[key]))));
|
|
21873
|
-
}))));
|
|
21874
|
-
}
|
|
21875
|
-
/**
|
|
21876
|
-
* Source: https://stackoverflow.com/questions/15298912/javascript-generating-combinations-from-n-arrays-with-m-elements
|
|
21877
|
-
*
|
|
21878
|
-
* TODO: Could replace with a fork of https://www.npmjs.com/package/cartesian
|
|
21879
|
-
*
|
|
21880
|
-
* @param args - an array of arrays
|
|
21881
|
-
* @returns combinations of the elements in those array
|
|
21882
|
-
*/
|
|
21883
|
-
function cartesian(...args) {
|
|
21884
|
-
var r = [], max = args.length - 1;
|
|
21885
|
-
function helper(arr, i) {
|
|
21886
|
-
for (var j = 0, l = args[i].length; j < l; j++) {
|
|
21887
|
-
var a = arr.slice(0); // clone arr
|
|
21888
|
-
a.push(args[i][j]);
|
|
21889
|
-
if (i == max)
|
|
21890
|
-
r.push(a);
|
|
21891
|
-
else
|
|
21892
|
-
helper(a, i + 1);
|
|
21893
|
-
}
|
|
21894
|
-
}
|
|
21895
|
-
helper([], 0);
|
|
21896
|
-
return r;
|
|
21897
|
-
}
|
|
21898
|
-
|
|
21899
|
-
const scenario$6 = "@author:\r\n@owner:\r\nFeature: Task Card Progress Bar\r\n\r\n\tScenario Outline: Progress Bar\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> shows <progress> with <unit> above\r\n\t\tAnd gift icon has <color>\r\n\t\tAnd gift icon shows <goal> with <unit> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | unit | color |\r\n\t\t\t| -100 | 500 | ●――――――――――――――――――🎁 | $ | no |\r\n\t\t\t| 0 | 500 | ●――――――――――――――――――🎁 | $ | no |\r\n\t\t\t| 250 | 500 | ―――――――――●―――――――――🎁 | $ | no |\r\n\t\t\t| 500 | 500 | ―――――――――――――――――――🎁 | $ | yes |\r\n\t\t\t| 1000 | 500 | ―――――――――――――――――――🎁 | $ | yes |\r\n\r\n\tScenario Outline: Progress Bar Steps\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tAnd steps is enabled\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> has incrementing steps from 1 to <goal>\r\n\t\tAnd gift icon has <color>\r\n\t\tAnd gift icon shows <goal> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | color |\r\n\t\t\t| -1 | 5 | ―――○―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 0 | 5 | ―――○―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 1 | 5 | ―――●―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 5 | 5 | ―――○―――○―――○―――●―――🎁 | yes |\r\n\t\t\t| 7 | 5 | ―――○―――○―――○―――●―――🎁 | yes |\r\n\r\n\r\n\tScenario Outline: Progress Bar Repeatable\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> shows <progress> with <unit> above\r\n\t\tAnd <icon1> has <color1>\r\n\t\tAnd <icon2> has <color2>\r\n\t\tAnd <icon3> has <color3>\r\n\t\tAnd <icon1> shows <text1> below\r\n\t\tAnd <icon2> shows <text2> below\r\n\t\tAnd <icon3> shows <text3> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | unit | icon1 | icon2 | icon3 | color1 | color2 | color3 | text 1 | text 2 | text 3 |\r\n\t\t\t| 250 | 500 | ――――●――――🎁―――――――🎁 | $ | NA | gift | gift | NA | no | no | NA | 500 | 1000 |\r\n\t\t\t| 500 | 500 | ―――――――――🎁―――――――🎁 | $ | NA | gift | gift | NA | yes | no | NA | 500 | 1000 |\r\n\t\t\t| 750 | 500 | ―――――――――🎁―――●―――🎁 | $ | NA | gift | gift | NA | yes | no | NA | 500 | 1000 |\r\n\t\t\t| 1000 | 500 | 🎁―――――――🎁―――――――🎁 | $ | gift | gift | gift | yes | yes | no | 500 | 1000 | 1500 |\r\n\t\t\t| 1250 | 500 | 🎁―――――――🎁―――●―――🎁 | $ | gift | gift | gift | yes | yes | no | 500 | 1000 | 1500 |\r\n\r\n\t# \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t math logic inside text ?\r\n\t# | 1250 | 500 | 🎁―――――――🎁―――●―――🎁 | gift | gift | gift | yes | yes | no | goal * (⌊ progress / goal ⌋ - 1) | goal * ⌊ progress / goal ⌋ | goal * (⌊ progress / goal ⌋ +1) |\r\n\r\n\r\n\tScenario Outline: Progress Bar Steps Repeatable\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tAnd steps is enabled\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> has incrementing steps\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar |";
|
|
21900
|
-
|
|
21901
|
-
const progressBar_stories = {
|
|
21902
|
-
title: "Components/Task Card Progress Bar",
|
|
21903
|
-
parameters: {
|
|
21904
|
-
scenario: scenario$6,
|
|
21905
|
-
},
|
|
19820
|
+
const UserName_stories = {
|
|
19821
|
+
title: "User Name",
|
|
21906
19822
|
};
|
|
21907
|
-
const
|
|
21908
|
-
return h(
|
|
19823
|
+
const FullStack$1 = () => {
|
|
19824
|
+
return (h("sqm-user-name", { demoData: {
|
|
19825
|
+
loading: false,
|
|
19826
|
+
loadingText: "...",
|
|
19827
|
+
username: "Test Testerson",
|
|
19828
|
+
} }));
|
|
21909
19829
|
};
|
|
21910
|
-
const
|
|
21911
|
-
|
|
21912
|
-
|
|
21913
|
-
|
|
21914
|
-
|
|
21915
|
-
|
|
21916
|
-
|
|
21917
|
-
|
|
19830
|
+
const FullStackDefault = () => {
|
|
19831
|
+
return h("sqm-user-name", null);
|
|
19832
|
+
};
|
|
19833
|
+
|
|
19834
|
+
const UserName = /*#__PURE__*/Object.freeze({
|
|
19835
|
+
__proto__: null,
|
|
19836
|
+
'default': UserName_stories,
|
|
19837
|
+
FullStack: FullStack$1,
|
|
19838
|
+
FullStackDefault: FullStackDefault
|
|
19839
|
+
});
|
|
19840
|
+
|
|
19841
|
+
const PasswordField_stories = {
|
|
19842
|
+
title: "Portal Password Field",
|
|
21918
19843
|
};
|
|
21919
|
-
const
|
|
21920
|
-
|
|
21921
|
-
|
|
21922
|
-
|
|
21923
|
-
|
|
21924
|
-
|
|
21925
|
-
|
|
21926
|
-
|
|
21927
|
-
|
|
19844
|
+
const Start = () => {
|
|
19845
|
+
return (h("sqm-password-field", { demoData: {
|
|
19846
|
+
initValue: "",
|
|
19847
|
+
states: {
|
|
19848
|
+
enableValidation: true,
|
|
19849
|
+
validationErrors: {},
|
|
19850
|
+
content: {
|
|
19851
|
+
fieldLabel: "Password",
|
|
19852
|
+
},
|
|
19853
|
+
},
|
|
19854
|
+
} }));
|
|
21928
19855
|
};
|
|
21929
|
-
const
|
|
21930
|
-
|
|
21931
|
-
|
|
21932
|
-
|
|
21933
|
-
|
|
21934
|
-
|
|
21935
|
-
|
|
21936
|
-
|
|
21937
|
-
|
|
19856
|
+
const EmptyError = () => {
|
|
19857
|
+
return (h("sqm-password-field", { demoData: {
|
|
19858
|
+
initValue: "",
|
|
19859
|
+
states: {
|
|
19860
|
+
enableValidation: true,
|
|
19861
|
+
validationErrors: { password: "Cannot be empty" },
|
|
19862
|
+
content: {
|
|
19863
|
+
fieldLabel: "Password",
|
|
19864
|
+
},
|
|
19865
|
+
},
|
|
19866
|
+
} }));
|
|
21938
19867
|
};
|
|
21939
|
-
const
|
|
21940
|
-
|
|
21941
|
-
|
|
21942
|
-
|
|
21943
|
-
|
|
21944
|
-
|
|
21945
|
-
|
|
21946
|
-
|
|
21947
|
-
|
|
21948
|
-
|
|
19868
|
+
const ValidationError = () => {
|
|
19869
|
+
return (h("sqm-password-field", { demoData: {
|
|
19870
|
+
initValue: "asdf",
|
|
19871
|
+
states: {
|
|
19872
|
+
enableValidation: true,
|
|
19873
|
+
validationErrors: { password: "Incomplete" },
|
|
19874
|
+
content: {
|
|
19875
|
+
fieldLabel: "Password",
|
|
19876
|
+
},
|
|
19877
|
+
},
|
|
19878
|
+
} }));
|
|
21949
19879
|
};
|
|
21950
19880
|
|
|
21951
|
-
const
|
|
19881
|
+
const PasswordField = /*#__PURE__*/Object.freeze({
|
|
21952
19882
|
__proto__: null,
|
|
21953
|
-
'default':
|
|
21954
|
-
|
|
21955
|
-
|
|
21956
|
-
|
|
21957
|
-
ProgressBarRepeatable: ProgressBarRepeatable,
|
|
21958
|
-
ProgressBarStepsRepeatable: ProgressBarStepsRepeatable
|
|
19883
|
+
'default': PasswordField_stories,
|
|
19884
|
+
Start: Start,
|
|
19885
|
+
EmptyError: EmptyError,
|
|
19886
|
+
ValidationError: ValidationError
|
|
21959
19887
|
});
|
|
21960
19888
|
|
|
21961
19889
|
const portalTemplate = "<sqm-portal-frame>\r\n <a slot=\"header\" href=\"/\">\r\n <sqm-text style=\"height: 60px\">\r\n <img\r\n style=\"height: 60px\"\r\n src=\"https://res.cloudinary.com/saasquatch/image/upload/v1634255445/squatch-assets/Copy_of_saasquatch-logo-tree-large-horizontal.png\"\r\n />\r\n </sqm-text>\r\n </a>\r\n <sqb-program-section program-id=\"referral-program\">\r\n <sqm-router>\r\n <template\r\n path=\"/:path(\\bregister\\b|\\bemailVerification\\b|\\blogin\\b|\\bverifyEmail\\b|\\bforgotPassword\\b|\\bresetPassword\\b|\\blogout\\b)\"\r\n >\r\n <sqm-graphql-client-provider\r\n domain=\"https://managed-identity.saasquatch.com\"\r\n >\r\n <sqm-hero\r\n background=\"https://images.unsplash.com/photo-1599676821464-3555954838dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1939&q=80\"\r\n >\r\n <sqm-router>\r\n <template path=\"/register\">\r\n <sqm-portal-register>\r\n <sqm-name-fields slot=\"formData\"></sqm-name-fields>\r\n </sqm-portal-register>\r\n </template>\r\n\r\n <template path=\"/emailVerification\">\r\n <sqm-portal-protected-route\r\n redirect-to=\"/login\"\r\n ></sqm-portal-protected-route>\r\n <sqm-portal-email-verification></sqm-portal-email-verification>\r\n </template>\r\n\r\n <template path=\"/login\">\r\n <sqm-portal-login></sqm-portal-login>\r\n </template>\r\n\r\n <template path=\"/verifyEmail\">\r\n <sqm-portal-verify-email></sqm-portal-verify-email>\r\n </template>\r\n\r\n <template path=\"/forgotPassword\">\r\n <sqm-portal-forgot-password\r\n email-label=\"Business Email\"\r\n ></sqm-portal-forgot-password>\r\n </template>\r\n\r\n <template path=\"/resetPassword\">\r\n <sqm-portal-reset-password\r\n confirm-password=\"true\"\r\n ></sqm-portal-reset-password>\r\n </template>\r\n <template path=\"/logout\">\r\n <sqm-portal-logout next-page=\"/login\"></sqm-portal-logout>\r\n </template>\r\n </sqm-router>\r\n </sqm-hero>\r\n </sqm-graphql-client-provider>\r\n </template>\r\n </sqm-router>\r\n <sqm-router>\r\n <template path=\"/:path(\\bactivity\\b|\\beditProfile\\b)?\">\r\n <sqm-divided-layout\r\n direction=\"row\"\r\n style=\"\r\n border-top: 1px solid #eaeaea;\r\n border-bottom: 1px solid #eaeaea;\r\n \"\r\n >\r\n <sqm-navigation-sidebar>\r\n <sqm-navigation-sidebar-item\r\n path=\"/\"\r\n icon=\"house\"\r\n label=\"Dashboard\"\r\n ></sqm-navigation-sidebar-item>\r\n <sqm-navigation-sidebar-item\r\n path=\"/activity\"\r\n icon=\"bar-chart\"\r\n label=\"Activity\"\r\n ></sqm-navigation-sidebar-item>\r\n <sqm-navigation-sidebar-item\r\n path=\"/editProfile\"\r\n icon=\"person\"\r\n label=\"Edit Profile\"\r\n ></sqm-navigation-sidebar-item>\r\n <sqm-navigation-sidebar-item\r\n path=\"/logout\"\r\n icon=\"box-arrow-right\"\r\n label=\"Logout\"\r\n ></sqm-navigation-sidebar-item>\r\n </sqm-navigation-sidebar>\r\n <sqm-divided-layout direction=\"column\">\r\n <sqm-router>\r\n <template path=\"/\">\r\n <sqm-portal-protected-route\r\n require-email-verification=\"true\"\r\n redirect-to=\"/login\"\r\n redirect-to-unverified=\"/emailVerification\"\r\n ></sqm-portal-protected-route>\r\n <sqb-widget\r\n widget-type=\"p/referral-program/w/referrerWidget\"\r\n track-loads=\"true\"\r\n ></sqb-widget>\r\n </template>\r\n <template path=\"/editProfile\">\r\n <sqm-portal-protected-route\r\n require-email-verification=\"true\"\r\n redirect-to=\"/login\"\r\n redirect-to-unverified=\"/emailVerification\"\r\n ></sqm-portal-protected-route>\r\n <sqm-portal-container direction=\"column\" gap=\"xxx-large\">\r\n <sqm-portal-profile></sqm-portal-profile> </sqm-portal-container\r\n ><sqm-portal-container direction=\"column\" gap=\"xxx-large\">\r\n <sqm-graphql-client-provider\r\n domain=\"https://managed-identity.saasquatch.com\"\r\n >\r\n <sqm-portal-change-password></sqm-portal-change-password>\r\n </sqm-graphql-client-provider>\r\n </sqm-portal-container>\r\n </template>\r\n\r\n <template path=\"/activity\">\r\n <sqm-portal-protected-route\r\n require-email-verification=\"true\"\r\n redirect-to=\"/login\"\r\n redirect-to-unverified=\"/emailVerification\"\r\n ></sqm-portal-protected-route>\r\n <sqm-portal-container\r\n direction=\"column\"\r\n padding=\"xxx-large\"\r\n gap=\"xxx-large\"\r\n >\r\n <sqm-text> <h1>Activity</h1></sqm-text>\r\n <sqm-stat-container space=\"xxxx-large\"\r\n ><sqm-big-stat\r\n flex-reverse=\"true\"\r\n alignment=\"left\"\r\n stat-type=\"/referralsCount\"\r\n ><sqm-text><p>Referrals</p></sqm-text></sqm-big-stat\r\n >\r\n <sqm-big-stat\r\n flex-reverse=\"true\"\r\n alignment=\"left\"\r\n stat-type=\"/rewardsCountFiltered/AVAILABLE\"\r\n ><sqm-text><p>Rewards Earned</p></sqm-text></sqm-big-stat\r\n >\r\n <sqm-big-stat\r\n flex-reverse=\"true\"\r\n alignment=\"left\"\r\n stat-type=\"/rewardBalance/CREDIT/CENTS\"\r\n ><sqm-text><p>Reward Balance</p></sqm-text></sqm-big-stat\r\n >\r\n </sqm-stat-container>\r\n <sqm-referral-table>\r\n <sqm-referral-table-user-column></sqm-referral-table-user-column>\r\n <sqm-referral-table-rewards-column></sqm-referral-table-rewards-column>\r\n <sqm-referral-table-status-column></sqm-referral-table-status-column>\r\n <sqm-referral-table-date-column\r\n column-title=\"Referred\"\r\n date-shown=\"dateReferralStarted\"\r\n ></sqm-referral-table-date-column> </sqm-referral-table\r\n ></sqm-portal-container>\r\n </template>\r\n </sqm-router>\r\n </sqm-divided-layout>\r\n </sqm-divided-layout>\r\n </template>\r\n </sqm-router>\r\n </sqb-program-section>\r\n <sqm-portal-footer\r\n slot=\"footer\"\r\n support-email=\"support@example.com\"\r\n terms-link=\"https://example.com\"\r\n faq-link=\"https://example.com\"\r\n terms-text=\"Terms And Conditions\"\r\n faq-text=\"FAQ\"\r\n show-powered-by=\"true\"\r\n ></sqm-portal-footer>\r\n</sqm-portal-frame>\r\n";
|
|
@@ -24964,13 +22892,13 @@ var marked = createCommonjsModule(function (module, exports) {
|
|
|
24964
22892
|
})));
|
|
24965
22893
|
});
|
|
24966
22894
|
|
|
24967
|
-
const LoginReadme = "# sqm-portal-login\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\
|
|
22895
|
+
const LoginReadme = "# sqm-portal-login\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\n\n\n## Properties\n\n| Property | Attribute | Description | Type | Default |\n| --------------------- | ----------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; forgotPasswordPath: string; registerPath: string; }; content?: { forgotPasswordButton?: any; secondaryButton?: any; emailLabel?: string; passwordLabel?: string; submitLabel?: string; pageLabel?: string; }; }` | `undefined` |\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\n| `forgotPasswordLabel` | `forgot-password-label` | | `string` | `\"Forgot Password?\"` |\n| `forgotPasswordPath` | `forgot-password-path` | | `string` | `\"/forgotPassword\"` |\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\n| `pageLabel` | `page-label` | | `string` | `\"Sign in to your account\"` |\n| `passwordLabel` | `password-label` | | `string` | `\"Password\"` |\n| `registerLabel` | `register-label` | | `string` | `\"Register\"` |\n| `registerPath` | `register-path` | | `string` | `\"/register\"` |\n| `submitLabel` | `submit-label` | | `string` | `\"Sign In\"` |\n\n\n## Dependencies\n\n### Used by\n\n - [sqm-stencilbook](../sqm-stencilbook)\n\n### Depends on\n\n- [sqm-form-message](../sqm-form-message)\n\n### Graph\n```mermaid\ngraph TD;\n sqm-portal-login --> sqm-form-message\n sqm-stencilbook --> sqm-portal-login\n style sqm-portal-login fill:#f9f,stroke:#333,stroke-width:4px\n```\n\n----------------------------------------------\n\n*Built with [StencilJS](https://stenciljs.com/)*\n";
|
|
24968
22896
|
|
|
24969
22897
|
const ReferralIframeReadme = "# sqm-referral-iframe\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| -------------- | --------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------ | ----------- |\r\n| `demoData` | -- | | `{ states?: { content: { iframeSrc: string; iframeHeight: string; iframeWidth: string; }; }; data?: { shareCode: string; }; }` | `undefined` |\r\n| `iframeHeight` | `iframe-height` | | `string` | `\"100%\"` |\r\n| `iframeSrc` | `iframe-src` | | `string` | `undefined` |\r\n| `iframeWidth` | `iframe-width` | | `string` | `\"100%\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Used by\r\n\r\n - [sqm-stencilbook](../sqm-stencilbook)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-stencilbook --> sqm-referral-iframe\r\n style sqm-referral-iframe fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
|
|
24970
22898
|
|
|
24971
|
-
const ForgotPasswordReadme = "# sqm-portal-forgot-password\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\
|
|
22899
|
+
const ForgotPasswordReadme = "# sqm-portal-forgot-password\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\n\n\n## Properties\n\n| Property | Attribute | Description | Type | Default |\n| ------------- | -------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; success: boolean; loginPath: string; }; content?: { secondaryButton: any; messageSlot: any; emailLabel?: string; submitLabel?: string; }; }` | `undefined` |\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\n| `loginPath` | `login-path` | | `string` | `\"/login\"` |\n| `submitLabel` | `submit-label` | | `string` | `\"Request Password Reset\"` |\n\n\n## Dependencies\n\n### Depends on\n\n- [sqm-form-message](../sqm-form-message)\n\n### Graph\n```mermaid\ngraph TD;\n sqm-portal-forgot-password --> sqm-form-message\n style sqm-portal-forgot-password fill:#f9f,stroke:#333,stroke-width:4px\n```\n\n----------------------------------------------\n\n*Built with [StencilJS](https://stenciljs.com/)*\n";
|
|
24972
22900
|
|
|
24973
|
-
const RegisterReadme = "# sqm-portal-register\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\n\n\n## Properties\n\n| Property | Attribute | Description | Type
|
|
22901
|
+
const RegisterReadme = "# sqm-portal-register\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\n\n\n## Properties\n\n| Property | Attribute | Description | Type | Default |\n| -------------------------- | ---------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |\n| `confirmPassword` | `confirm-password` | | `boolean` | `false` |\n| `confirmPasswordLabel` | `confirm-password-label` | | `string` | `\"Confirm Password\"` |\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; confirmPassword: boolean; hideInputs: boolean; validationState?: FormState; enablePasswordValidation?: boolean; loginPath: string; }; refs?: { formRef: any; }; content?: { formData?: any; passwordField?: any; secondaryButton?: any; emailLabel?: string; passwordLabel?: string; submitLabel?: string; pageLabel?: string; confirmPasswordLabel: string; }; }` | `undefined` |\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\n| `enablePasswordValidation` | `enable-password-validation` | | `boolean` | `true` |\n| `hideInputs` | `hide-inputs` | | `boolean` | `false` |\n| `loginLabel` | `login-label` | | `string` | `\"Sign in\"` |\n| `loginPath` | `login-path` | | `string` | `\"/login\"` |\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\n| `pageLabel` | `page-label` | | `string` | `\"Register\"` |\n| `passwordLabel` | `password-label` | | `string` | `\"Password\"` |\n| `submitLabel` | `submit-label` | | `string` | `\"Register\"` |\n\n\n## Dependencies\n\n### Used by\n\n - [sqm-stencilbook](../sqm-stencilbook)\n\n### Depends on\n\n- [sqm-form-message](../sqm-form-message)\n- [sqm-password-field](../sqm-password-field)\n\n### Graph\n```mermaid\ngraph TD;\n sqm-portal-register --> sqm-form-message\n sqm-portal-register --> sqm-password-field\n sqm-stencilbook --> sqm-portal-register\n style sqm-portal-register fill:#f9f,stroke:#333,stroke-width:4px\n```\n\n----------------------------------------------\n\n*Built with [StencilJS](https://stenciljs.com/)*\n";
|
|
24974
22902
|
|
|
24975
22903
|
const EditProfileReadme = "# sqm-portal-profile\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ------------------------ | --------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |\r\n| `countrytext` | `countrytext` | | `string` | `\"Country\"` |\r\n| `demoData` | -- | | `{ states?: { success: boolean; loading: boolean; submitDisabled: boolean; showCountry: boolean; formState: { country: string; firstName: string; lastName: string; errors: any; error: string; }; user: { id: string; accountId: string; firstName: string; lastName: string; email: string; countryCode: string; }; text: { firstnametext: string; lastnametext: string; emailtext: string; countrytext: string; editProfileHeader: string; editProfileSubHeader: string; submitChangeButtonText: string; }; }; }` | `undefined` |\r\n| `editProfileHeader` | `edit-profile-header` | | `string` | `\"Edit your profile\"` |\r\n| `editProfileSubHeader` | `edit-profile-sub-header` | | `string` | `\"Personal Information\"` |\r\n| `emailtext` | `emailtext` | | `string` | `\"Email\"` |\r\n| `firstnametext` | `firstnametext` | | `string` | `\"First Name\"` |\r\n| `lastnametext` | `lastnametext` | | `string` | `\"Last Name\"` |\r\n| `showCountry` | `show-country` | | `boolean` | `true` |\r\n| `submitChangeButtonText` | `submit-change-button-text` | | `string` | `\"Submit Changes\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-profile --> sqm-form-message\r\n style sqm-portal-profile fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
|
|
24976
22904
|
|
|
@@ -24978,7 +22906,7 @@ const ResetPasswordReadme = "# sqm-portal-reset-password\r\n\r\n\r\n\r\n<!-- Aut
|
|
|
24978
22906
|
|
|
24979
22907
|
const EmailVerificationReadme = "# sqm-portal-email-verification\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ------------------------- | --------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; success: boolean; }; content?: { email: string; verifyMessage: string; emailVerificationHeader: string; resendEmailButtonText: string; }; }` | `undefined` |\r\n| `emailVerificationHeader` | `email-verification-header` | | `string` | `\"Verify your email\"` |\r\n| `resendEmailButtonText` | `resend-email-button-text` | | `string` | `\"Re-send Email\"` |\r\n| `verifyMessage` | `verify-message` | | `string` | `\"A verification email was sent to {email}. Please verify your email to continue to the portal.\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-email-verification --> sqm-form-message\r\n style sqm-portal-email-verification fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
|
|
24980
22908
|
|
|
24981
|
-
const EmailVerifiedReadme = "# sqm-portal-verify-email\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\
|
|
22909
|
+
const EmailVerifiedReadme = "# sqm-portal-verify-email\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\n\n\n## Properties\n\n| Property | Attribute | Description | Type | Default |\n| ---------- | ----------- | ----------- | ---------------------------------------------------------------------------------------------------- | ----------- |\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; verified: boolean; }; data?: { oobCode: string; }; }` | `undefined` |\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\n\n\n## Dependencies\n\n### Depends on\n\n- [sqm-form-message](../sqm-form-message)\n\n### Graph\n```mermaid\ngraph TD;\n sqm-portal-verify-email --> sqm-form-message\n style sqm-portal-verify-email fill:#f9f,stroke:#333,stroke-width:4px\n```\n\n----------------------------------------------\n\n*Built with [StencilJS](https://stenciljs.com/)*\n";
|
|
24982
22910
|
|
|
24983
22911
|
const PortalTemplates_stories = {
|
|
24984
22912
|
title: "Templates / Portal",
|
|
@@ -25176,7 +23104,7 @@ const ProgramMenu$1 = /*#__PURE__*/Object.freeze({
|
|
|
25176
23104
|
const PoweredByImg_stories = {
|
|
25177
23105
|
title: "Powered By",
|
|
25178
23106
|
};
|
|
25179
|
-
const Default$
|
|
23107
|
+
const Default$a = () => {
|
|
25180
23108
|
return h(PoweredByImg$1, null);
|
|
25181
23109
|
};
|
|
25182
23110
|
const CustomColor = () => {
|
|
@@ -25189,17 +23117,17 @@ const CustomWidthAndHeight = () => {
|
|
|
25189
23117
|
const PoweredByImg = /*#__PURE__*/Object.freeze({
|
|
25190
23118
|
__proto__: null,
|
|
25191
23119
|
'default': PoweredByImg_stories,
|
|
25192
|
-
Default: Default$
|
|
23120
|
+
Default: Default$a,
|
|
25193
23121
|
CustomColor: CustomColor,
|
|
25194
23122
|
CustomWidthAndHeight: CustomWidthAndHeight
|
|
25195
23123
|
});
|
|
25196
23124
|
|
|
25197
|
-
const scenario$
|
|
23125
|
+
const scenario$5 = "Feature: Portal Footer\r\n\r\n Background: A user is viewing the portal\r\n Given a hosted portal\r\n And a user is viewing the portal\r\n And the portal has a footer\r\n\r\n Scenario Outline: FAQ and T&C links/text are configurable and open in a new page when clicked\r\n Given the footer has prop \"terms-link\" with value \"https://example.com/terms\"\r\n And prop \"terms-text\" with value \"Terms and Conditions\"\r\n And prop \"faq-link\" with value \"https://example.com/FAQ\"\r\n And prop \"faq-text\" with value \"Visit FAQ\"\r\n When a user clicks on the \"Visit FAQ\" link\r\n Then they will be redirected to \"https://example.com/FAQ\" in a new page\r\n When they go back to the portal\r\n And click on the \"Terms and Conditions\" link\r\n Then they will be redirected to \"https://example.com/terms\" in a new page\r\n\r\n Scenario Outline: FAQ/T&C Links are not shown if a link is not provided\r\n Given the footer does not have <linkProp>\r\n But it <mayHave> <textProp> with <value>\r\n Then the <link> will not be shown in the footer\r\n Examples:\r\n | linkProp | mayHave | textProp | value | link |\r\n | terms-link | has | termsText | Terms and Conditions | T&C Link |\r\n | faq-link | has | faqText | Visit FAQ | FAQ Link |\r\n | terms-link | doesn't have | | | T&C Link |\r\n | faq-link | doesn't have | | | FAQ Link |\r\n\r\n Scenario Outline: The support email and text is configurable but has a default\r\n Given the footer <mayHave> <emailPropWithValue>\r\n And the footer <mayAlsoHave> <textPropWithValue>\r\n Then the footer's support email text is <renderedEmailText>\r\n And the email address will be a mailto link with <mailtoEmail>\r\n When the user clicks on the email address mailto Link\r\n Then the users preferred email client will open with a draft email to <mailtoEmail>\r\n Examples:\r\n | mayHave | emailPropWithValue | mayAlsoHave | textPropWithValue | mailtoEmail | renderedEmailText |\r\n | has | support@saasquatch.com | has | For support please contact {email} | support@saasquatch.com | For support please contact support@saasquatch.com |\r\n | doesn't have | N/A | doesn't have | N/A | support@example.com | For program support, contact support@example.com |\r\n\r\n Scenario Outline: Powered by SaaSquatch is shown by default\r\n Given the footer <mayHaveProp> \"show-powered-by\" with <value>\r\n Then the powered by SaaSquatch image <mayBeShown>\r\n Examples:\r\n | mayHaveProp | value | mayBeShown |\r\n | has prop | true | is shown |\r\n | has prop | false | isn't shown |\r\n | has prop | test | is shown |\r\n | has prop | | is shown |\r\n | doesn't have prop | | is shown |\r\n\r\n Scenario: Powered By Saasquatch links out to \"https://saasquatch.com\"\r\n Given the footer has the powered by SaaSquatch image\r\n When a user clicks on it\r\n Then they will be redirected to \"https://saasquatch.com\" in a new page";
|
|
25198
23126
|
|
|
25199
23127
|
const PortalFooter_stories = {
|
|
25200
23128
|
title: "Portal Footer",
|
|
25201
23129
|
parameters: {
|
|
25202
|
-
scenario: scenario$
|
|
23130
|
+
scenario: scenario$5,
|
|
25203
23131
|
},
|
|
25204
23132
|
};
|
|
25205
23133
|
const defaultProps$9 = {
|
|
@@ -25228,12 +23156,12 @@ const PortalFooter = /*#__PURE__*/Object.freeze({
|
|
|
25228
23156
|
FooterNoPoweredBy: FooterNoPoweredBy
|
|
25229
23157
|
});
|
|
25230
23158
|
|
|
25231
|
-
const scenario$
|
|
23159
|
+
const scenario$6 = "Feature: Hero Unit\r\n\r\n Background: A portal with a hero unit exists\r\n Given a hosted portal\r\n And the portal has hero unit on the login page\r\n And a user is viewing the login page\r\n\r\n Scenario: The hero unit defaults to a single column layout\r\n Given a hero unit does not have a \"columns\" prop\r\n But the following html is wrapped by the hero unit\r\n \"\"\"\r\n <sqm-portal-login></sqm-portal-login>\r\n <div slot=\"secondary-column\">\r\n <h1 style=\"text-align:center\">Get Referring!</h1>\r\n <p style=\"text-align:center\">\r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\r\n eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim\r\n ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut\r\n aliquip ex ea commodo consequat. Duis aute irure dolor in\r\n reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla\r\n pariatur.\r\n </p>\r\n </div>\r\n \"\"\"\r\n Then only a single column will be displayed\r\n And within it will be the login component\r\n\r\n Scenario Outline: The hero unit supports single or dual column layouts\r\n Given a hero unit with prop \"columns\" having <columnValue>\r\n And it wraps <html>\r\n Then the hero unit displays <columnValue> columns\r\n Examples:\r\n | columnValue | html |\r\n | 1 | <h1>Column 1!</h1> |\r\n | 2 | <h1>Column 1!</h1><div slot=\"secondary-column\"><h1 style=\"text-align:center\">Column 2!</h1></div> |\r\n\r\n Scenario: HTML to be displayed in the second column comes from the \"secondary-column\" slot\r\n Given a hero unit with \"columns\" \"2\"\r\n And the following html\r\n \"\"\"\r\n <h1>Column 1!</h1>\r\n <div>\r\n <h1 style=\"text-align:center\">Column 2!</h1>\r\n </div>\r\n \"\"\"\r\n When the hero unit is rendered\r\n Then only one column is displayed with content\r\n And column 1 will contain the \"Column 1!\" text\r\n And column 1 will contain the \"Column 2!\" text\r\n When the div for column two is updated to have 'slot=\"secondary-column\"'\r\n Then the two columns are displayed with content\r\n And column 1 will contain the \"Column 1!\" text\r\n And column 2 will contain the \"Column 2!\" text\r\n\r\n Scenario Outline: A background for the hero unit can be set as an image or colour\r\n Given a hero unit with <backgroundPropValue>\r\n Then the background will be <background>\r\n Examples:\r\n | background | background |\r\n | https://images.unsplash.com/photo-1599676821464-3555954838d | image of misty mountains |\r\n | LightSlateGrey | light slate grey |\r\n | #00FF00 | green |\r\n | rgb(128,0,128) | purple |\r\n\r\n Scenario Outline: Wrap Direction can be configured for mobile experiences\r\n Given a hero unit with the following HTML\r\n \"\"\"\r\n <h1>Column 1!</h1>\r\n <div slot=\"secondary-column\">\r\n <h1 style=\"text-align:center\">Column 2!</h1>\r\n </div>\r\n \"\"\"\r\n And prop \"wrap-direction\" has <value>\r\n When the window width is less than 600px\r\n Then the two columns will stack\r\n And <column> will be on top\r\n Examples:\r\n | value | column |\r\n | wrap | 1 |\r\n | wrap-reverse | 2 |\r\n | | 1 |";
|
|
25232
23160
|
|
|
25233
23161
|
const Hero_stories = {
|
|
25234
23162
|
title: "Hero Layout",
|
|
25235
23163
|
parameters: {
|
|
25236
|
-
scenario: scenario$
|
|
23164
|
+
scenario: scenario$6,
|
|
25237
23165
|
},
|
|
25238
23166
|
};
|
|
25239
23167
|
const LoginOneColumn = () => {
|
|
@@ -25410,12 +23338,12 @@ const Hero = /*#__PURE__*/Object.freeze({
|
|
|
25410
23338
|
TwoColumnLoginWithImgElement: TwoColumnLoginWithImgElement
|
|
25411
23339
|
});
|
|
25412
23340
|
|
|
25413
|
-
const scenario$
|
|
23341
|
+
const scenario$7 = "@owner:sam\r\n@author:sam\r\n\r\nFeature: Referral Iframe\r\n\r\n Used to provide an external form for submitting referral leads using the current user's referral code\r\n\r\n Background: A user is logged in\r\n Given there is a logged in user\r\n\r\n @motivating\r\n Scenario: Referral code is passed to the iframe as a query parameter\r\n Given the \"iframe-src\" is \"https://example.com\"\r\n And the user has navigated to \"/refer\"\r\n And the user's referral code is \"BOBBYREFER\"\r\n When the iframe content is loaded\r\n Then the iframe url will be \"https://example.com?rsCode=BOBBYREFER\"\r\n\r\n @ui\r\n Scenario Outline: The height and width of the iFrame can be controlled via props\r\n Given the \"iframe-src\" is \"https://example.com\"\r\n And the iframe content is 1000x1000\r\n And the \"iframe-height\" is set to <heightValue>\r\n And the \"iframe-width\" is set to <widthValue>\r\n Then the content of the iframe will be displayed with scrollbars\r\n And the dimension of the iFrame displayed will be 500x500\r\n When the \"iframe-height\" is set to <heightValue>\r\n And the \"iframe-width\" is set to <widthValue>\r\n Then the full content of the iframe will be displayed on the page\r\n And the dimension of the iFrame displayed will be 1000x1000\r\n Examples:\r\n | heightValue | widthValue |\r\n | 500px | 500px |\r\n | 50% | 50% |\r\n\r\n @minutae\r\n Scenario Outline: The iFrame will fail fast if a iFrame source isn't provided\r\n Given \"iframe-src\" <mayBeAnAttribute>\r\n And it <mayHaveValue>\r\n When a user views the referral iFrame component\r\n Then an alert with an error message is displayed in place of the iFrame\r\n And it has a details section\r\n When \"More details\" is clicked\r\n Then the following information will be displayed\r\n | component being used |\r\n | missing attribute(s) |\r\n\r\n Examples:\r\n | mayBeAnAttribute | mayHaveValue |\r\n | is not an attribute | N/A |\r\n | is an attribute | \"\" |\r\n | is an attribute | |";
|
|
25414
23342
|
|
|
25415
23343
|
const ReferralIframe_stories = {
|
|
25416
23344
|
title: "Referral Iframe",
|
|
25417
23345
|
parameters: {
|
|
25418
|
-
scenario: scenario$
|
|
23346
|
+
scenario: scenario$7,
|
|
25419
23347
|
},
|
|
25420
23348
|
};
|
|
25421
23349
|
const props = {
|
|
@@ -25446,12 +23374,12 @@ const ReferralIframe$1 = /*#__PURE__*/Object.freeze({
|
|
|
25446
23374
|
ReferralIframeError: ReferralIframeError
|
|
25447
23375
|
});
|
|
25448
23376
|
|
|
25449
|
-
const scenario$
|
|
23377
|
+
const scenario$8 = "@owner:sam\r\n@author:sam\r\n\r\nFeature: Name Fields\r\n\r\n Fields to be used to fill the first and last name of a user during registration\r\n\r\n Background:\r\n Given the current page is \"/register\"\r\n\r\n @motivating\r\n Scenario: Both first name and last name are required\r\n Given the email field has valid input\r\n And the password field has valid input\r\n And first name field is empty\r\n And last name field is empty\r\n When register is clicked\r\n Then the name fields will be highlighted in red\r\n And the error messages will say \"Cannot be empty\"\r\n\r\n @motivating\r\n Scenario: First and last name are upserted with the SaaSquatch user\r\n Given all fields have been filled with data\r\n | firstName | lastName | email | password |\r\n | Bob | Testerson | bob@example.com | SecurePassword1 |\r\n When register is clicked\r\n Then the email verification page will be loaded\r\n And the user will be upserted\r\n And the SaaSquatch user will contain data\r\n | firstName | lastName | email |\r\n | Bob | Testerson | bob@example.com |\r\n\r\n";
|
|
25450
23378
|
|
|
25451
23379
|
const NameFields_stories = {
|
|
25452
23380
|
title: "Name Fields",
|
|
25453
23381
|
parameters: {
|
|
25454
|
-
scenario: scenario$
|
|
23382
|
+
scenario: scenario$8,
|
|
25455
23383
|
},
|
|
25456
23384
|
};
|
|
25457
23385
|
const props$1 = {
|
|
@@ -25489,251 +23417,6 @@ const NameFields$1 = /*#__PURE__*/Object.freeze({
|
|
|
25489
23417
|
NameFieldsWithErrors: NameFieldsWithErrors
|
|
25490
23418
|
});
|
|
25491
23419
|
|
|
25492
|
-
const baseResponse = (data) => ({
|
|
25493
|
-
states: {
|
|
25494
|
-
content: null,
|
|
25495
|
-
redeemStage: "chooseReward",
|
|
25496
|
-
amount: 0,
|
|
25497
|
-
exchangeError: false,
|
|
25498
|
-
loading: false,
|
|
25499
|
-
selectedItem: null,
|
|
25500
|
-
selectedStep: null,
|
|
25501
|
-
},
|
|
25502
|
-
data: {
|
|
25503
|
-
exchangeList: data,
|
|
25504
|
-
},
|
|
25505
|
-
callbacks: {
|
|
25506
|
-
exchangeReward: null,
|
|
25507
|
-
openDrawer: null,
|
|
25508
|
-
setStage: null,
|
|
25509
|
-
setExchangeState: null,
|
|
25510
|
-
refs: null,
|
|
25511
|
-
},
|
|
25512
|
-
refs: null,
|
|
25513
|
-
});
|
|
25514
|
-
const baseReward$2 = {
|
|
25515
|
-
key: "",
|
|
25516
|
-
name: "",
|
|
25517
|
-
description: "",
|
|
25518
|
-
imageUrl: "",
|
|
25519
|
-
available: true,
|
|
25520
|
-
unavailableReason: null,
|
|
25521
|
-
unavailableReasonCode: null,
|
|
25522
|
-
ruleType: "FIXED_GLOBAL_REWARD",
|
|
25523
|
-
sourceUnit: "POINT",
|
|
25524
|
-
sourceValue: 10,
|
|
25525
|
-
prettySourceValue: "10 SaaSquatch Points",
|
|
25526
|
-
sourceMinValue: null,
|
|
25527
|
-
prettySourceMinValue: null,
|
|
25528
|
-
sourceMaxValue: null,
|
|
25529
|
-
prettySourceMaxValue: null,
|
|
25530
|
-
destinationMinValue: null,
|
|
25531
|
-
prettyDestinationMinValue: null,
|
|
25532
|
-
destinationMaxValue: null,
|
|
25533
|
-
prettyDestinationMaxValue: null,
|
|
25534
|
-
globalRewardKey: "",
|
|
25535
|
-
destinationUnit: null,
|
|
25536
|
-
steps: [],
|
|
25537
|
-
};
|
|
25538
|
-
const notEnoughPoints = {
|
|
25539
|
-
available: false,
|
|
25540
|
-
unavailableReasonCode: "INSUFFICIENT_REDEEMABLE_CREDIT",
|
|
25541
|
-
};
|
|
25542
|
-
const usTax = {
|
|
25543
|
-
available: false,
|
|
25544
|
-
unavailableReasonCode: "US_TAX",
|
|
25545
|
-
};
|
|
25546
|
-
const imageUrl = (props) => ({
|
|
25547
|
-
imageUrl: props,
|
|
25548
|
-
});
|
|
25549
|
-
const description = (props) => ({
|
|
25550
|
-
description: props,
|
|
25551
|
-
});
|
|
25552
|
-
const fixedValue = (props) => ({
|
|
25553
|
-
prettySourceValue: props,
|
|
25554
|
-
});
|
|
25555
|
-
const variableValue = (min, max, text) => ({
|
|
25556
|
-
ruleType: "VARIABLE_CREDIT_REWARD",
|
|
25557
|
-
sourceMinValue: min,
|
|
25558
|
-
prettySourceMinValue: min + " " + text,
|
|
25559
|
-
sourceMaxValue: max,
|
|
25560
|
-
prettySourceMaxValue: max + " " + text,
|
|
25561
|
-
});
|
|
25562
|
-
const test = {
|
|
25563
|
-
...baseResponse([
|
|
25564
|
-
{
|
|
25565
|
-
...baseReward$2,
|
|
25566
|
-
...description("Free swag with a promo code"),
|
|
25567
|
-
...imageUrl("https://i.imgur.com/Ds7M19I.png"),
|
|
25568
|
-
...fixedValue("40 SaaSquatch Points"),
|
|
25569
|
-
},
|
|
25570
|
-
{
|
|
25571
|
-
...baseReward$2,
|
|
25572
|
-
...description("Visa® Prepaid Card USD"),
|
|
25573
|
-
...imageUrl("https://i.imgur.com/4s3q2zz.png"),
|
|
25574
|
-
...variableValue(20, 80, "SaaSquatch Points"),
|
|
25575
|
-
},
|
|
25576
|
-
{
|
|
25577
|
-
...baseReward$2,
|
|
25578
|
-
...description("A very exclusive gift box"),
|
|
25579
|
-
...imageUrl("https://i.imgur.com/XuiJi4l.png"),
|
|
25580
|
-
...fixedValue("30 SaaSquatch Points"),
|
|
25581
|
-
},
|
|
25582
|
-
{
|
|
25583
|
-
...baseReward$2,
|
|
25584
|
-
...description("$50 Store credit"),
|
|
25585
|
-
...imageUrl("https://i.imgur.com/WkCMVSE.png"),
|
|
25586
|
-
...fixedValue("100 SaaSquatch Points"),
|
|
25587
|
-
},
|
|
25588
|
-
{
|
|
25589
|
-
...baseReward$2,
|
|
25590
|
-
...description("Variable amount of store credit"),
|
|
25591
|
-
...imageUrl("https://i.imgur.com/Jn2fE0s.png"),
|
|
25592
|
-
...variableValue(20, 100, "SaaSquatch Points"),
|
|
25593
|
-
},
|
|
25594
|
-
{
|
|
25595
|
-
...baseReward$2,
|
|
25596
|
-
...notEnoughPoints,
|
|
25597
|
-
...description("A very rare cactus"),
|
|
25598
|
-
...imageUrl("https://i.imgur.com/CvCdpXc.png"),
|
|
25599
|
-
...fixedValue("2000 SaaSquatch Points"),
|
|
25600
|
-
},
|
|
25601
|
-
{
|
|
25602
|
-
...baseReward$2,
|
|
25603
|
-
...usTax,
|
|
25604
|
-
...description("$1000 Store credit"),
|
|
25605
|
-
...imageUrl("https://i.imgur.com/I9FCh9Z.png"),
|
|
25606
|
-
...fixedValue("2000 SaaSquatch Points"),
|
|
25607
|
-
},
|
|
25608
|
-
{
|
|
25609
|
-
...baseReward$2,
|
|
25610
|
-
...notEnoughPoints,
|
|
25611
|
-
...description("A holiday gift box"),
|
|
25612
|
-
...imageUrl("https://i.imgur.com/HBJS1WH.png"),
|
|
25613
|
-
...fixedValue("100 SaaSquatch Points"),
|
|
25614
|
-
},
|
|
25615
|
-
]),
|
|
25616
|
-
};
|
|
25617
|
-
const test2 = {
|
|
25618
|
-
states: {
|
|
25619
|
-
content: {
|
|
25620
|
-
text: {
|
|
25621
|
-
buttonText: "Exchange Rewards",
|
|
25622
|
-
ignored: true,
|
|
25623
|
-
},
|
|
25624
|
-
},
|
|
25625
|
-
redeemStage: "chooseAmount",
|
|
25626
|
-
amount: 0,
|
|
25627
|
-
exchangeError: false,
|
|
25628
|
-
loading: false,
|
|
25629
|
-
selectedItem: {
|
|
25630
|
-
key: "r4",
|
|
25631
|
-
name: "Salmon Coins",
|
|
25632
|
-
description: "Points for Salmon Coins",
|
|
25633
|
-
imageUrl: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoHCBUWFRgWFRYYGRgZGh4cHBocHR4aHxwdGRwZHBwfHh4cIS4lHB4rHxoYJjgnKy8xNTU1GiQ7QD00Py40NTEBDAwMEA8QHhISHzQrJCs0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NP/AABEIAIABiQMBIgACEQEDEQH/xAAcAAEAAQUBAQAAAAAAAAAAAAAABAECAwUGBwj/xAA+EAABAwICBgYHBwQCAwAAAAABAAIRAyEEMQUSQVFhcQYTgZGhsQciMkJScvAUYoKSwdHhorLC8SMzFUNj/8QAGAEBAQEBAQAAAAAAAAAAAAAAAAECAwT/xAAfEQEBAQEBAQEAAwEBAAAAAAAAARECEiExE0FRYQP/2gAMAwEAAhEDEQA/APZkREBERAREQEREBERAREQEREBERAREQERY6jw0EkgACSTYADMk7AgvVjHgzBBixgzBXmfSjpqapNLDuLaeTqgs58Zhl/Vbx28BnA0Lj3UXNcx0G0tmxHwkW1tvLhks3qRZHryqtdonSjK7dZtnCzmzJaf1HFbFWXUERFQREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBFSVqdNafoYVoNaoAT7LBdzvlaLxxyG0oNlUqBoLnEAASSTAAFySTkF5H0z6WHEuNKiSKANx7JqkXl20MFoHfsAidKemVTFeo31KPwAgl0ZF7hY7IaLA39aBHNsIO0cv34eaCVSeBlcnblb/FqnYatxz3WLhw+FnHMrVMfx7/MjyCkMI5znx+Y7flCx1NajqNGaUdTIex2qRYRkRuj3h+y9D0Lp2nXETq1APWb5xv5ZjxXj9Ovt8dsdmXIHmVKw+OIg62rGWqQIINvWs1vZJWeZeVuV7gi5Xoj0j+0g03kGowSSMnNkCTYAOkjK17cOqXSXWBERUEREBERAREQEREBERAREQEREBERBRFjq1WtaXOcGtAkuJAAG8k2C5LS/TukyW0GGq74j6jO83PcAd6DslQFeI6Y6VYmvOvWcG/BS9RvIwZcODiV1vomonq69QWa57Wht82N1i6+ZIe0diD0JERAREQEREBERARFgxOJZTaX1HtY0ZucQAOZNkGdFxmkvSJg2SGa9Y5eo2G/mdEji2VzmO9JWIdalTp0xvcS93+IHcUHqyiYvH0qQmpUYwb3ua3+4rxTG9IsbV9vEVI3NPVjuZC1XUyST7RvfM85zQezYrptgGW68OO5jXP8AFojxWoxHpMw49ilVfxOowH+onwXmzcKdqudhrG0oOyr+k+qfYwzG/M9zvANatfX9ImOd7Ios5NJI/M4+S55lCQREFXvoaosJU0ScV0u0g+ZxL28GtYzxa2fFaKs173F73ue45uc4uceZcSStuyiI8+zmqfZNvDJNGlGGVww5W21BFh2eCubSMAxCmrjUCkruqK2v2dUNAxZTVazUdlJU7A6Rq0rs1J3vp06jvzPYXeKyCiQL5jzhUZhrXAngg2+H6c41lmmnx/42j+2FLZ6RcbtFA/gd+j1z4o8Fa2lJNoTTHV0/SVifeo0Ty1m+bipdL0nO9/DDm2p+hZ+q4p9A7B3rG7D7ldR6NR9JlA+1Qqj5Sx3m4KfR9IOCd7RqM+ZhP9msvKjQVr6B2Jo9oodLcC/LEsHzSz+8BbLDaRo1P+urTf8AK9rvIrwQUSrTSDtxummPohF4Dh8VXZ/11qrAPhe9o7gYUmp0kxzmln2mrB3EB35wNYd6uo9oxukqNETWqspg5a7mtnlJute3pbgSYGJp9pgd5svC6mHc5xcXFzjmXEknmTcqVo3Btc8Nq1RSZHt6jn8hqtuVLf8AFkfQVGs17Q5rg5pyIIIPIjNZFxnQgYXDsdTZjadUvdrBtqcWizC4mTtPALswVZUVREVBEWr0tpujh2k1HXiQwXc7k3ntMBBs1y+nOmFKjLaUVXjODDW/M7aeA3XIXHae6XVq8tE06RkBjbufwc7ad7R6oyOstA8SBrmBsYMvC7nclm0TdJ6Zq4l01Hl8GzR6rGn7rbxzu6+ajOpW9cwPhH6/RVGHdYcBJ7hYfVlewxlnvzPfkPBc63GsxNODkQBsi8cBGXYAvbui+jxQwtFgEHUDncXP9Z09pK8r6N4QV8XSY4Swv1nWMEMBeQTx1YjivbF1n4wIiKgiIgIoOkdJUaDdatUaxuzWMExsAzceAuuG016RjduFpz/9KgMfhYDPeRyQeh1KgaC5xAAuSTAA4k5LldJ9PsHSkNc6s7dTEt/OYaRyleZY/FVq/rYis525rnta0cmWaOwBR6VJvZs4q4mur0j6Q8U+RRYykN//AGO4GXANH5SuWxlWrWdr13ve7e8zHyjJo4CFIpU5dnEe7CzMpgkGO02gBTYIlHCNOWaq7CxnCmsLGky4H9O7MqSXMd7Jnz7Vf0a84Y7M1e3DAGTErOQcoVGAgXud6xeo1jC+iDsmLgHfCyNZa43LIAeCrqu4f6UvS4w06bRIBvtG76/VXhuYiwyWRtMzO+yv1Dv3qejEcuEScuSqy4BG0LK6mdpsVXqSs+lxHfRsdWATwVWstfwUjqztOfJWll4m5k5d6noxH1A4R5KoZsj+Fnbh4yt2BVFMzF8s7J6XGBzIyEo1ucgjmpXUcSqvpwJv5p6MRXU4KPZAsCeA4qUKMDWEmc8haMzKvFDinpMQxTtzWGphSQIMR4rZ9TxKtFDVMTmdt8k9JiA6lA9bZmVa2nrXGV4Wy6kn/SCieCejGt+z7xmqNw42dotmtmKBz3oaJ2Af7V0xrRQWB2GcTIIjzW2dhycx9cVUUjuWtRqeom8Kx1K4EEzt3dq2tXCuIgerfNXtoHIieJj9E1WndhQsuHxFWkJp1XsH3HOb4A3WxNI5kW7FjfhpvfMfUKWkS8J0xxzBPWB42B7GnxbB8Vs6HpHrCzsOxzvuuczwId5rROpDYIUX7MdbIRGe8/tmp7MbLSXS/F1zGv1TDbVpktJ5vnW7iBwWrNSZtebn6vzOfFVdRGcXG/gsRBDshzlX2YvNM5iBPvHyaNg4eG1YjTGwEnaTf67SFKaRffynyusVWmTcz2sJ7tdat2J/axur7zm8p1u5rLDvV9erAsCecADs/hVYHDIv7NRo8FHxTnfAT+L9LrEm1b+Oz9GGj9Z9XEOAloFNsTm71nk615jU/MV6UuX9HmC6vBMMQajnVD+Iw3+lrV1C7MiIiAuO9IHSKthWU20GEvqlw19XWDA3VyGRcS4RNrGxXYrnOk2lMTRNPqKTHtdOs5xIAgthoIyLpME2tkUHj+OOIc7rq7aznEj13tI5Aa1o3NFuCuwrdbWE6riLS3IjxFoyBXqjelDXtLK+FqesIcwalQXzBDi0kfhXKaVwNBjvUa4U3e44arqZ+66TLfEdsiejHLvwuIBa6wMga4aHsc0DIyQGk2sYNjvKtpawqOLWwwxbjAkwbiTPet7UoPp2JljvZeNvBw913gdig1KV5XK3LrUmzGLDTrtaTMmOU2/lS37ABbb/AAsOFoE1GQPeb5hSXsHblO1T18Xz9Ryxu5VwLTDzuj/L9JVXtUmizOMnF3c0GPM9y1OrSxjartiFiqAufVakUoP1hJEZrK6mSRBi97Z71cwZdir9d4WNXFdVXNEqx0ERvVW2Fgp6XyuLFY5h1gda0XEZ9queyYuREG31krnH+fruU9LimomoMz2LIFR0C5OXYI4p6MYxTOtMjVjLirnTcNF4tOXarmNMkmI2b+9Zm7Pr6/hPRjBTa7Ii+/YVke0xbPYs4CAJ6MYg3KyvaxXGYnM7BvVackXEHd2/68U9GMb6YIIOX6K3qwIHYJ+tyyUmOvr6udonLjO1XagsSMtvZCejGCjh2tsNu03klZQxYsSx9tRwF7yFlkNgE3yE7SrOk8mp9fXasLcOQ4nXJnJuwfWaz6xmIsRnbPkriP3VnR5Y9S/P/StbB+uav2fXFY2MDRAgBb1PK5zARBEqxrCTIJABiIF/4V7XAHNXdYO1X6mLKtEOBaQSCLqw4Yauq31Rsjv2rKao+vFKeHcSS1r3TsDSc+Q4KWUYxTsNvNW1mgA2mPFTv/H4g5Uan5CPNYq2isRBmg8j5Z8FPPRsatzgXECLfV9ywOpif45fXapr6DwdUtLTuIIPcVb1WrcxuG4fynMpsQyyPLb+gPkotRzQbhp5kDwICmVXjeQOYjucIBUWq8jcR94FvcW2K758xz36xlrfgj8MjwJUSs1v3B4f3BSw5o90s4tgjvb+yxYydWQ6RxA8wYWZ+rXqfo9x/WYNjSQTSJpmDsEFv9JA7CuqXlPotx5biKlLJr6etH3mERH4XOmNwXqy6siIiArHNBEG4KvRBp8XoNjrsJpncAHM7WnIfKWrVVKGKpWcwPZvpme9jr90rrEQcBUbQMyzVM3nWaAeAB1QeS1dbRjM2vjg6/iP2XpOJwTH+00ExEizo5i8cFrH9Gqcy2AeLWu8gFiytS44puHYy4cHOi0ZDZKgVMPORlegO0PUbZmpHzOb4AR4qK/RNfiB90yfF58li87+rOscTTwT5HqnmRAHG+alDDRyFu/+JK6N2BLTdpHF0yVKo4VgF4KvM35C2OKqtDZLnBvMxMhRnYpnuBzvlB8yt5pvo/TZrVWAu2lusZ7Jz5LRMqUzsaOcHzlZ65y/VnSprH4I+ZzR5lOsd8LOx7VIAaBIcR2D9WfqrqYJMes7dZpn8oXOyNzWClUJIBaR4/QUkMU+ngY4k5/sPFX/AGXZ9bFm81djWOaRECZsrw1T/syDDeaxjSG1nmq9XkpzMMq9QfBXE1DDFka3fkpXUHcqmgdmcJhqKykGiGgDkq6ql9QqUsKAIE773vxKmLqMGqrWKaMOrm4fbClVE1FaaUrYjDqvUKfVa80bz3KvUeS2LcNfKyzNw4GasqfGpOFJtcRe23f2LL9iO7gtoQR7LHu+Vrj5BafFaRfJaPVjOxkcxs7V2541z66g/CATrEfsoVUMBzJ2WvdYMRUnN2tO0u1e45FYX1CPasD8Q1f62+qe0Ld5iemdzm7bc7HslZcO9jXAlrXfdfrDuDSCe2QorfxAb7Fve2W94UzDwLWjgBHhY9wUsw/XUaG0i1zmsZh2NnMtgQNp9n9V1C0fR3AajNciC4WERDc9m+3gt4u/O59crm/FURFpEfE4Zjxqva1w3ET3blz2keh9N96bi0/C712nhJ9bvJ5LqUQeTaX6P1qMl7SGj32+s3tOwcHRwXPPBbmNXc5t2nmNy95IXM6W6H0Ksup/8Tz8Ilp5sy7oWbB5WwbQPxM/Vv8AEJUo6wkAO4tMH9j2Qttpbo5Xw51ns9Uf+xhJb2mJbycAOK1vWA3zO8eq79ncslj7rSnRrGNw+Mo1HEta18O1rQ14LHE2yAdO3Je7r54xFyYMjcQAe79oXsvQfSn2jCUy6demOrfOZLAIPa3VPMncuusujREQEREBERAREQEREFpaCIN1FqaPpu92OVvJTEQaitoVpye4c4P7LWV+i0/A7iRB7wupRZvMqy2OHf0OvIZB3tcP8lJo6EcwWYRvPtE9sldeiniL6rlRgnDNju4qx2F4fWxdakJeIeq5A0An2ZdaWDcO5WdQz4W9wWP4v+r7rlxhQs1LBt2roDhGfC3uT7Iz4fNanGJ6rmK1WgDAlxytsO6+SjPxLB7rwOQPkV02J0PRqTrNgxGsLOHbt5GQua0hoavSksHWM+7JcObMxzaT8oTrn5+Lz1/qjcVSPvgfN6v91ipjKQNxF1znXcOBvEcJH6iVJ0bpHq3TAc33mOEC+4gEA5XcvPLNyt38+N6KKuZQnIE8gt9hyxzQ5oaQdwH1KkQuv8Mv9se655mCecmHtt5rMNFvPwt8fJbtFqf+PKe61bNED3nk8gB5ypFLR7GmYk/eMxyGSmItTjmfkS21VRcXgqdQRUY10ZEi45HMHkpSLaOS0l0Qa6TRcWnc4m/4oJI+YOXLYvRVagfWa5g+JsBp5gkscTwIPBeqqhErN5laleTUmkH2Rzb/AMZ7Wmx71v8AQOB6yqJ9lvrOnbGw75MeK6itoOg6/VgH7stHcLHuUjBYFlIEMETcnMlSc1fXxMREW2BERAREQEREBc3pbodha8nV6t596nDZ5tjVPOJ4rpEQeU6U9H+Ibem5lYbB7Du5xj+rsW89HuiMThzVFZmoxwbAJBlwJuIOUE35dncopn1dVREVQREQEREBERAREQEREBERAREQEREBERAREQEREGuxuiqNW72An4hLXfmbBjhktFi+h+2nV5B4y/EyI7l1qLN5l/VlsaDo9oytQLmvc0sI2OJOtaDBYItO07Fv0RWTJhbqqIiqCIiAiIgIiICIiAiIgIiICIiAiIgIiICIiAiIg//Z",
|
|
25634
|
-
available: true,
|
|
25635
|
-
unavailableReason: null,
|
|
25636
|
-
unavailableReasonCode: null,
|
|
25637
|
-
ruleType: "VARIABLE_CREDIT_REWARD",
|
|
25638
|
-
sourceUnit: "POINT",
|
|
25639
|
-
sourceValue: null,
|
|
25640
|
-
prettySourceValue: null,
|
|
25641
|
-
sourceMinValue: 1,
|
|
25642
|
-
prettySourceMinValue: "1 Point",
|
|
25643
|
-
sourceMaxValue: 100,
|
|
25644
|
-
prettySourceMaxValue: "100 Points",
|
|
25645
|
-
destinationMinValue: 1,
|
|
25646
|
-
prettyDestinationMinValue: "1 Salmon Coin",
|
|
25647
|
-
destinationMaxValue: 100,
|
|
25648
|
-
prettyDestinationMaxValue: "100 Salmons",
|
|
25649
|
-
globalRewardKey: null,
|
|
25650
|
-
destinationUnit: "TESTUNIT",
|
|
25651
|
-
steps: [
|
|
25652
|
-
{
|
|
25653
|
-
sourceValue: 1,
|
|
25654
|
-
prettySourceValue: "1 Point",
|
|
25655
|
-
destinationValue: 1,
|
|
25656
|
-
prettyDestinationValue: "1 Salmon Coin",
|
|
25657
|
-
available: true,
|
|
25658
|
-
unavailableReasonCode: null,
|
|
25659
|
-
},
|
|
25660
|
-
{
|
|
25661
|
-
sourceValue: 2,
|
|
25662
|
-
prettySourceValue: "2 Points",
|
|
25663
|
-
destinationValue: 2,
|
|
25664
|
-
prettyDestinationValue: "2 Salmons",
|
|
25665
|
-
available: true,
|
|
25666
|
-
unavailableReasonCode: null,
|
|
25667
|
-
},
|
|
25668
|
-
{
|
|
25669
|
-
sourceValue: 3,
|
|
25670
|
-
prettySourceValue: "3 Points",
|
|
25671
|
-
destinationValue: 3,
|
|
25672
|
-
prettyDestinationValue: "3 Salmons",
|
|
25673
|
-
available: true,
|
|
25674
|
-
unavailableReasonCode: null,
|
|
25675
|
-
},
|
|
25676
|
-
{
|
|
25677
|
-
sourceValue: 4,
|
|
25678
|
-
prettySourceValue: "4 Points",
|
|
25679
|
-
destinationValue: 4,
|
|
25680
|
-
prettyDestinationValue: "4 Salmons",
|
|
25681
|
-
available: true,
|
|
25682
|
-
unavailableReasonCode: null,
|
|
25683
|
-
},
|
|
25684
|
-
{
|
|
25685
|
-
sourceValue: 5,
|
|
25686
|
-
prettySourceValue: "5 Points",
|
|
25687
|
-
destinationValue: 5,
|
|
25688
|
-
prettyDestinationValue: "5 Salmons",
|
|
25689
|
-
available: true,
|
|
25690
|
-
unavailableReasonCode: null,
|
|
25691
|
-
},
|
|
25692
|
-
],
|
|
25693
|
-
},
|
|
25694
|
-
selectedStep: null,
|
|
25695
|
-
},
|
|
25696
|
-
data: {
|
|
25697
|
-
exchangeList: null,
|
|
25698
|
-
},
|
|
25699
|
-
callbacks: {
|
|
25700
|
-
exchangeReward: null,
|
|
25701
|
-
openDrawer: null,
|
|
25702
|
-
setStage: null,
|
|
25703
|
-
setExchangeState: null,
|
|
25704
|
-
refs: {
|
|
25705
|
-
drawerRef: {},
|
|
25706
|
-
},
|
|
25707
|
-
},
|
|
25708
|
-
refs: null,
|
|
25709
|
-
};
|
|
25710
|
-
|
|
25711
|
-
const RewardExchangeList_stories = {
|
|
25712
|
-
title: "Components/Reward Exchange List",
|
|
25713
|
-
};
|
|
25714
|
-
const resizable$1 = {
|
|
25715
|
-
width: "683px",
|
|
25716
|
-
minWidth: "260px",
|
|
25717
|
-
resize: "horizontal",
|
|
25718
|
-
height: "fit-content",
|
|
25719
|
-
overflow: "hidden",
|
|
25720
|
-
};
|
|
25721
|
-
const Default$c = () => {
|
|
25722
|
-
return (h("div", { style: resizable$1 },
|
|
25723
|
-
h(RewardExchangeView, Object.assign({}, test))));
|
|
25724
|
-
};
|
|
25725
|
-
const Default2 = () => {
|
|
25726
|
-
return (h("div", { style: { ...resizable$1, height: "700px" } },
|
|
25727
|
-
h(RewardExchangeView, Object.assign({}, test2))));
|
|
25728
|
-
};
|
|
25729
|
-
|
|
25730
|
-
const RewardExchangeList = /*#__PURE__*/Object.freeze({
|
|
25731
|
-
__proto__: null,
|
|
25732
|
-
'default': RewardExchangeList_stories,
|
|
25733
|
-
Default: Default$c,
|
|
25734
|
-
Default2: Default2
|
|
25735
|
-
});
|
|
25736
|
-
|
|
25737
23420
|
function deepFreeze(obj) {
|
|
25738
23421
|
if (obj instanceof Map) {
|
|
25739
23422
|
obj.clear = obj.delete = obj.set = function () {
|
|
@@ -28314,9 +25997,7 @@ const CucumberAddon = ({ story }, children) => {
|
|
|
28314
25997
|
// No scenario or invalid. Ignoring.
|
|
28315
25998
|
}
|
|
28316
25999
|
return (h("div", null,
|
|
28317
|
-
h("
|
|
28318
|
-
h("summary", null, "Specs"),
|
|
28319
|
-
result && h("pre", { innerHTML: result.value })),
|
|
26000
|
+
result && h("pre", { innerHTML: result.value }),
|
|
28320
26001
|
children));
|
|
28321
26002
|
};
|
|
28322
26003
|
|
|
@@ -28353,8 +26034,6 @@ const stories = [
|
|
|
28353
26034
|
ReferralTableRewardsCell$1,
|
|
28354
26035
|
UserName,
|
|
28355
26036
|
PasswordField,
|
|
28356
|
-
TaskCard$1,
|
|
28357
|
-
TaskCardProgressBar,
|
|
28358
26037
|
PortalTemplates,
|
|
28359
26038
|
ProgramMenu$1,
|
|
28360
26039
|
PoweredByImg,
|
|
@@ -28362,10 +26041,6 @@ const stories = [
|
|
|
28362
26041
|
Hero,
|
|
28363
26042
|
ReferralIframe$1,
|
|
28364
26043
|
NameFields$1,
|
|
28365
|
-
RewardExchangeList,
|
|
28366
|
-
UseRewardExchangeList,
|
|
28367
|
-
UseTaskCard,
|
|
28368
|
-
UseRewardsTable
|
|
28369
26044
|
];
|
|
28370
26045
|
const StencilStorybook = class {
|
|
28371
26046
|
constructor(hostRef) {
|
|
@@ -28405,77 +26080,6 @@ const TableRow = class {
|
|
|
28405
26080
|
}
|
|
28406
26081
|
};
|
|
28407
26082
|
|
|
28408
|
-
const TaskCard$2 = class {
|
|
28409
|
-
constructor(hostRef) {
|
|
28410
|
-
registerInstance(this, hostRef);
|
|
28411
|
-
this.ignored = true;
|
|
28412
|
-
/**
|
|
28413
|
-
* @uiName Reward Amount
|
|
28414
|
-
*/
|
|
28415
|
-
this.rewardAmount = 0;
|
|
28416
|
-
/**
|
|
28417
|
-
* @uiName Reward Unit
|
|
28418
|
-
*/
|
|
28419
|
-
this.rewardUnit = "Points";
|
|
28420
|
-
/**
|
|
28421
|
-
* @uiName Title Text
|
|
28422
|
-
*/
|
|
28423
|
-
this.cardTitle = "Title Text";
|
|
28424
|
-
/**
|
|
28425
|
-
* @uiName Description Text
|
|
28426
|
-
*/
|
|
28427
|
-
this.description = "Description Text";
|
|
28428
|
-
/**
|
|
28429
|
-
* @uiName Goal Repeatable
|
|
28430
|
-
*/
|
|
28431
|
-
this.repeatable = false;
|
|
28432
|
-
/**
|
|
28433
|
-
* @uiName Show Progress Bar
|
|
28434
|
-
*/
|
|
28435
|
-
this.showProgressBar = false;
|
|
28436
|
-
/**
|
|
28437
|
-
* @uiName Goal Progress Source
|
|
28438
|
-
*/
|
|
28439
|
-
this.progressSource = "";
|
|
28440
|
-
/**
|
|
28441
|
-
* @uiName Goal Completion Number
|
|
28442
|
-
*/
|
|
28443
|
-
this.goal = 1;
|
|
28444
|
-
/**
|
|
28445
|
-
* @uiName Progress Bar Steps
|
|
28446
|
-
*/
|
|
28447
|
-
this.steps = false;
|
|
28448
|
-
/**
|
|
28449
|
-
* @uiName Show Goal Expiry
|
|
28450
|
-
*/
|
|
28451
|
-
this.showExpiry = false;
|
|
28452
|
-
/**
|
|
28453
|
-
* @uiName CTA Button Text
|
|
28454
|
-
*/
|
|
28455
|
-
this.buttonText = "Complete Action";
|
|
28456
|
-
/**
|
|
28457
|
-
* @uiName CTA Button Link
|
|
28458
|
-
*/
|
|
28459
|
-
this.buttonLink = "https://example.com/";
|
|
28460
|
-
/**
|
|
28461
|
-
* Select what type of stat to display for the goal. Manual paths are also supported.
|
|
28462
|
-
*
|
|
28463
|
-
* @uiWidget StatTypeSelectWidget
|
|
28464
|
-
* @uiName Stat Type
|
|
28465
|
-
* @uiOptions {"version": 1.1}
|
|
28466
|
-
*/
|
|
28467
|
-
this.statType = "/programGoals/count/Referral-Started%2Freferrals";
|
|
28468
|
-
h$1(this);
|
|
28469
|
-
}
|
|
28470
|
-
disconnectedCallback() { }
|
|
28471
|
-
render() {
|
|
28472
|
-
const { props } = j$1() ? useDemoBigStat(this) : useBigStat(this);
|
|
28473
|
-
const { value, statvalue } = props;
|
|
28474
|
-
console.log(props, j$1());
|
|
28475
|
-
return (h(TaskCardView, Object.assign({}, getProps(this), { progress: value, loading: value === undefined })));
|
|
28476
|
-
}
|
|
28477
|
-
};
|
|
28478
|
-
|
|
28479
26083
|
const debug$2 = browser("sq:global");
|
|
28480
26084
|
const textStyles = `
|
|
28481
26085
|
sqm-text {
|
|
@@ -28601,4 +26205,4 @@ function useUserNameDemo(props) {
|
|
|
28601
26205
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
28602
26206
|
}
|
|
28603
26207
|
|
|
28604
|
-
export { DividedLayout as sqm_divided_layout, EditProfile as sqm_edit_profile, FormMessage as sqm_form_message, SqmHookStoryContainer as sqm_hook_story_container, NavigationMenu as sqm_navigation_menu, PortalPasswordField as sqm_password_field, PortalChangePassword as sqm_portal_change_password, PortalFrame as sqm_portal_frame, PortalLogin as sqm_portal_login, PortalRegister as sqm_portal_register, ProgramMenu as sqm_program_menu, SqmReferralIframe as sqm_referral_iframe, ReferralTable as sqm_referral_table, ReferralTableCell as sqm_referral_table_cell, ReferralTableDateCell as sqm_referral_table_date_cell, ReferralTableRewardsCell as sqm_referral_table_rewards_cell, ReferralTableStatusCell as sqm_referral_table_status_cell, ReferralTableUserCell as sqm_referral_table_user_cell,
|
|
26208
|
+
export { DividedLayout as sqm_divided_layout, EditProfile as sqm_edit_profile, FormMessage as sqm_form_message, SqmHookStoryContainer as sqm_hook_story_container, NavigationMenu as sqm_navigation_menu, PortalPasswordField as sqm_password_field, PortalChangePassword as sqm_portal_change_password, PortalFrame as sqm_portal_frame, PortalLogin as sqm_portal_login, PortalRegister as sqm_portal_register, ProgramMenu as sqm_program_menu, SqmReferralIframe as sqm_referral_iframe, ReferralTable as sqm_referral_table, ReferralTableCell as sqm_referral_table_cell, ReferralTableDateCell as sqm_referral_table_date_cell, ReferralTableRewardsCell as sqm_referral_table_rewards_cell, ReferralTableStatusCell as sqm_referral_table_status_cell, ReferralTableUserCell as sqm_referral_table_user_cell, SqmRouter as sqm_router, ShareButton as sqm_share_button, ShareLink as sqm_share_link, StencilStorybook as sqm_stencilbook, TableCell$1 as sqm_table_cell, TableRow as sqm_table_row, Text as sqm_text, UserName$1 as sqm_user_name };
|