@saasquatch/mint-components 1.10.3 → 1.11.0-1
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-c3e91cee.js → ShadowViewAddon-21aa34f8.js} +32 -57
- package/dist/cjs/{email-registration-view-248652bb.js → email-registration-view-5170d9f1.js} +1 -1
- package/dist/cjs/{global-02e50f09.js → global-4a59a374.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mint-components.cjs.js +2 -2
- package/dist/cjs/sqm-banking-info-form_16.cjs.entry.js +115 -142
- package/dist/cjs/sqm-big-stat_38.cjs.entry.js +24 -65
- package/dist/cjs/sqm-empty_4.cjs.entry.js +2 -9
- package/dist/cjs/sqm-instant-access-registration.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-invoice-table-view-28b14d28.js → sqm-invoice-table-view-c26fb670.js} +6 -8
- package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +1 -1
- package/dist/cjs/sqm-logout-current-user.cjs.entry.js +10 -9
- package/dist/cjs/{sqm-portal-container-view-990a85a3.js → sqm-portal-container-view-5fb2ad49.js} +1 -1
- package/dist/cjs/{sqm-portal-email-verification-view-292b5bf4.js → sqm-portal-email-verification-view-07161940.js} +1 -1
- package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +2 -2
- package/dist/cjs/{sqm-portal-profile-view-fde54e35.js → sqm-portal-profile-view-07b99f80.js} +1 -1
- package/dist/cjs/sqm-portal-profile.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table_11.cjs.entry.js +1 -1
- package/dist/cjs/sqm-referred-registration.cjs.entry.js +1 -1
- package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +1 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +57 -180
- package/dist/collection/components/sqm-card-feed/sqm-card-feed.js +1 -1
- package/dist/collection/components/sqm-empty/EmptyState.stories.js +1 -1
- package/dist/collection/components/sqm-image/sqm-image-view.js +1 -1
- package/dist/collection/components/sqm-image/sqm-image.js +0 -20
- package/dist/collection/components/sqm-leaderboard/Leaderboard.stories.js +24 -130
- package/dist/collection/components/sqm-leaderboard/sqm-leaderboard-view.js +29 -55
- package/dist/collection/components/sqm-leaderboard/sqm-leaderboard.js +29 -93
- package/dist/collection/components/sqm-leaderboard/useLeaderboard.js +4 -40
- package/dist/collection/components/sqm-logout-current-user/useLogoutCurrentUser.js +10 -9
- package/dist/collection/components/sqm-portal-container/PortalContainer.stories.js +7 -19
- package/dist/collection/components/sqm-portal-container/sqm-portal-container-view.js +1 -1
- package/dist/collection/components/sqm-portal-container/sqm-portal-container.js +0 -37
- package/dist/collection/components/sqm-referral-card/ReferralCard.stories.js +1 -1
- package/dist/collection/components/sqm-share-button/ShareButton.stories.js +1 -1
- package/dist/collection/components/sqm-share-button/sqm-share-button-view.js +1 -1
- package/dist/collection/components/sqm-share-button/sqm-share-button.js +2 -2
- package/dist/collection/components/sqm-task-card/UseTaskCard.stories.js +1 -1
- package/dist/collection/components/sqm-task-card/sqm-task-card.js +1 -1
- package/dist/collection/components/tax-and-cash/TaxForm.stories.js +1 -0
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.js +1 -2
- package/dist/collection/components/tax-and-cash/sqm-docusign-form/docusign-iframe/DocusignIframe.js +18 -11
- package/dist/collection/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form-view.js +3 -19
- package/dist/collection/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form.js +3 -2
- package/dist/collection/components/tax-and-cash/sqm-docusign-form/useDocusignForm.js +43 -36
- package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +2 -2
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +2 -3
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js +12 -12
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +32 -55
- package/dist/collection/components/tax-and-cash/utils.js +4 -7
- package/dist/collection/components/views/email-registration-view.js +1 -1
- package/dist/collection/global/global.js +1 -1
- package/dist/collection/stories/NewPortal.stories.js +1 -1
- package/dist/esm/{ShadowViewAddon-e012b2aa.js → ShadowViewAddon-90897c22.js} +32 -57
- package/dist/esm/{email-registration-view-a89a88bf.js → email-registration-view-07d80492.js} +1 -1
- package/dist/esm/{global-04c7d3b5.js → global-e7bb0343.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/mint-components.js +2 -2
- package/dist/esm/sqm-banking-info-form_16.entry.js +115 -142
- package/dist/esm/sqm-big-stat_38.entry.js +24 -65
- package/dist/esm/sqm-empty_4.entry.js +2 -9
- package/dist/esm/sqm-instant-access-registration.entry.js +1 -1
- package/dist/esm/{sqm-invoice-table-view-34ac7513.js → sqm-invoice-table-view-2175569f.js} +6 -8
- package/dist/esm/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm/sqm-logout-current-user.entry.js +10 -9
- package/dist/esm/{sqm-portal-container-view-6c582684.js → sqm-portal-container-view-ab89c6cc.js} +1 -1
- package/dist/esm/{sqm-portal-email-verification-view-4307c992.js → sqm-portal-email-verification-view-0b32261f.js} +1 -1
- package/dist/esm/sqm-portal-email-verification.entry.js +2 -2
- package/dist/esm/{sqm-portal-profile-view-ffe955c8.js → sqm-portal-profile-view-03026a5e.js} +1 -1
- package/dist/esm/sqm-portal-profile.entry.js +2 -2
- package/dist/esm/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm/sqm-referred-registration.entry.js +1 -1
- package/dist/esm/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm/sqm-stencilbook.entry.js +57 -180
- package/dist/esm-es5/ShadowViewAddon-90897c22.js +1 -0
- package/dist/esm-es5/email-registration-view-07d80492.js +1 -0
- package/dist/esm-es5/{global-04c7d3b5.js → global-e7bb0343.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-banking-info-form_16.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_38.entry.js +1 -1
- package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
- package/dist/esm-es5/sqm-instant-access-registration.entry.js +1 -1
- package/dist/esm-es5/sqm-invoice-table-view-2175569f.js +1 -0
- package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm-es5/sqm-logout-current-user.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-container-view-ab89c6cc.js +1 -0
- package/dist/esm-es5/{sqm-portal-email-verification-view-4307c992.js → sqm-portal-email-verification-view-0b32261f.js} +1 -1
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-profile-view-ffe955c8.js → sqm-portal-profile-view-03026a5e.js} +1 -1
- package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm-es5/sqm-referred-registration.entry.js +1 -1
- package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/mint-components.js +1 -1
- package/dist/mint-components/p-007383e1.entry.js +9 -0
- package/dist/mint-components/{p-10685090.js → p-05948592.js} +23 -23
- package/dist/mint-components/p-05a9bc83.entry.js +9 -0
- package/dist/mint-components/{p-4d233cd4.js → p-0e556260.js} +1 -1
- package/dist/mint-components/p-10036f16.js +1 -0
- package/dist/mint-components/p-227dec48.js +1 -0
- package/dist/mint-components/p-3dbf752a.system.entry.js +1 -0
- package/dist/mint-components/p-445ffcfd.system.entry.js +1 -0
- package/dist/mint-components/p-482bf487.system.js +1 -0
- package/dist/mint-components/{p-b6fc1227.system.entry.js → p-4864ed8a.system.entry.js} +1 -1
- package/dist/mint-components/p-5301a2da.system.entry.js +1 -0
- package/dist/mint-components/{p-01cfff8a.system.entry.js → p-55a782cf.system.entry.js} +1 -1
- package/dist/mint-components/{p-59fe4ad1.system.js → p-573fab0f.system.js} +1 -1
- package/dist/mint-components/{p-56f14840.entry.js → p-57e4ef5f.entry.js} +1 -1
- package/dist/mint-components/p-5956a47e.entry.js +1 -0
- package/dist/mint-components/{p-7049e9b0.entry.js → p-5d485450.entry.js} +1 -1
- package/dist/mint-components/p-64491c96.system.entry.js +1 -0
- package/dist/mint-components/{p-ce621bcc.js → p-66172a05.js} +1 -1
- package/dist/mint-components/p-6bf41e0d.system.js +1 -0
- package/dist/mint-components/p-76b69493.entry.js +174 -0
- package/dist/mint-components/{p-b4c52c5a.entry.js → p-7a572b34.entry.js} +1 -1
- package/dist/mint-components/{p-be4b748a.system.entry.js → p-8fe21979.system.entry.js} +1 -1
- package/dist/mint-components/p-922578e4.system.js +1 -0
- package/dist/mint-components/{p-3ec16698.entry.js → p-956ed10a.entry.js} +1 -1
- package/dist/mint-components/p-97198e2c.system.js +1 -0
- package/dist/mint-components/{p-4ea58025.system.entry.js → p-973f6501.system.entry.js} +1 -1
- package/dist/mint-components/{p-8704937c.js → p-9774fbc5.js} +1 -1
- package/dist/mint-components/{p-35d84041.system.entry.js → p-a61e6394.system.entry.js} +1 -1
- package/dist/mint-components/{p-1dd69917.system.entry.js → p-b8dbb809.system.entry.js} +1 -1
- package/dist/mint-components/p-be38de26.system.js +1 -0
- package/dist/mint-components/{p-ed095674.system.js → p-c7a3fd1b.system.js} +1 -1
- package/dist/mint-components/p-cf158064.entry.js +33 -0
- package/dist/mint-components/p-d51eb656.entry.js +187 -0
- package/dist/mint-components/{p-4df8f1d2.system.js → p-d7df3dfd.system.js} +1 -1
- package/dist/mint-components/{p-32d1d162.entry.js → p-dab544d9.entry.js} +1 -1
- package/dist/mint-components/{p-c7fd9e16.js → p-e704842c.js} +1 -1
- package/dist/mint-components/{p-8679ed9f.system.entry.js → p-e84a74fe.system.entry.js} +1 -1
- package/dist/mint-components/{p-7f088154.entry.js → p-ebcec043.entry.js} +1 -1
- package/dist/mint-components/p-f8f6c99d.system.entry.js +1 -0
- package/dist/types/components/sqm-card-feed/sqm-card-feed.d.ts +1 -1
- package/dist/types/components/sqm-image/sqm-image-view.d.ts +0 -1
- package/dist/types/components/sqm-image/sqm-image.d.ts +0 -5
- package/dist/types/components/sqm-leaderboard/Leaderboard.stories.d.ts +1 -5
- package/dist/types/components/sqm-leaderboard/sqm-leaderboard-view.d.ts +4 -6
- package/dist/types/components/sqm-leaderboard/sqm-leaderboard.d.ts +6 -23
- package/dist/types/components/sqm-leaderboard/useLeaderboard.d.ts +2 -4
- package/dist/types/components/sqm-portal-container/PortalContainer.stories.d.ts +0 -1
- package/dist/types/components/sqm-portal-container/sqm-portal-container-view.d.ts +0 -1
- package/dist/types/components/sqm-portal-container/sqm-portal-container.d.ts +0 -7
- package/dist/types/components/sqm-share-button/sqm-share-button.d.ts +2 -2
- package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +1 -1
- package/dist/types/components/tax-and-cash/sqm-docusign-form/docusign-iframe/DocusignIframe.d.ts +5 -3
- package/dist/types/components/tax-and-cash/sqm-docusign-form/useDocusignForm.d.ts +2 -1
- package/dist/types/components/tax-and-cash/utils.d.ts +2 -2
- package/dist/types/components.d.ts +14 -66
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +2 -2
- package/dist/esm-es5/ShadowViewAddon-e012b2aa.js +0 -1
- package/dist/esm-es5/email-registration-view-a89a88bf.js +0 -1
- package/dist/esm-es5/sqm-invoice-table-view-34ac7513.js +0 -1
- package/dist/esm-es5/sqm-portal-container-view-6c582684.js +0 -1
- package/dist/mint-components/p-1c857edb.entry.js +0 -33
- package/dist/mint-components/p-2ffefa3b.entry.js +0 -223
- package/dist/mint-components/p-31e810e9.entry.js +0 -168
- package/dist/mint-components/p-509e29e6.js +0 -1
- package/dist/mint-components/p-5de21018.system.entry.js +0 -1
- package/dist/mint-components/p-7497a4f6.system.entry.js +0 -1
- package/dist/mint-components/p-81689347.entry.js +0 -9
- package/dist/mint-components/p-84361da0.system.entry.js +0 -1
- package/dist/mint-components/p-95771f79.system.js +0 -1
- package/dist/mint-components/p-9f0629ba.system.entry.js +0 -1
- package/dist/mint-components/p-a1dba9a1.system.entry.js +0 -1
- package/dist/mint-components/p-a51533cb.system.js +0 -1
- package/dist/mint-components/p-b23d5520.js +0 -1
- package/dist/mint-components/p-bc51264d.system.js +0 -1
- package/dist/mint-components/p-d8d2de11.entry.js +0 -1
- package/dist/mint-components/p-e3735866.entry.js +0 -11
- package/dist/mint-components/p-ed17e637.system.js +0 -1
- package/dist/mint-components/p-ed6ebd60.system.js +0 -1
|
@@ -6,7 +6,7 @@ import { CardFeedView } from "./sqm-card-feed-view";
|
|
|
6
6
|
* @uiName Card Feed
|
|
7
7
|
* @slots [{"name":"","title":"Cards"}]
|
|
8
8
|
* @exampleGroup Rewards
|
|
9
|
-
* @example Task Card Feed - <sqm-card-feed gap="24" width="347"> <sqm-task-card reward-amount="20" goal="1" card-title="Complete a Survey" description="Fill out our NPS survey and get 20 points for giving us honest feedback." button-text="Take survey" reward-unit="Points" completed-text="Completed {finite, select, 0 {{count, plural, =1 {{count} time} other {{count} times}}} other {{count}/{finite} times}}" ended-message="Ended {endDate}" expiry-message="Ends {endDate}" finite="0" starts-on-message="Starts {startDate}" > </sqm-task-card> <sqm-task-card reward-amount="250" goal="500" show-progress-bar card-title="Spend $500" description="Earn 250 points when you spend $500 or more." button-text="See plans" completed-text="Completed {finite, select, 0 {{count, plural, =1 {{count} time} other {{count} times}}} other {{count}/{finite} times}}" ended-message="Ended {endDate}" expiry-message="Ends {endDate}" progress-bar-unit="$" finite="0" reward-unit="Points" starts-on-message="Starts {startDate}" > </sqm-task-card> <sqm-task-card goal="1" reward-amount="50" card-title="Follow Us on
|
|
9
|
+
* @example Task Card Feed - <sqm-card-feed gap="24" width="347"> <sqm-task-card reward-amount="20" goal="1" card-title="Complete a Survey" description="Fill out our NPS survey and get 20 points for giving us honest feedback." button-text="Take survey" reward-unit="Points" completed-text="Completed {finite, select, 0 {{count, plural, =1 {{count} time} other {{count} times}}} other {{count}/{finite} times}}" ended-message="Ended {endDate}" expiry-message="Ends {endDate}" finite="0" starts-on-message="Starts {startDate}" > </sqm-task-card> <sqm-task-card reward-amount="250" goal="500" show-progress-bar card-title="Spend $500" description="Earn 250 points when you spend $500 or more." button-text="See plans" completed-text="Completed {finite, select, 0 {{count, plural, =1 {{count} time} other {{count} times}}} other {{count}/{finite} times}}" ended-message="Ended {endDate}" expiry-message="Ends {endDate}" progress-bar-unit="$" finite="0" reward-unit="Points" starts-on-message="Starts {startDate}" > </sqm-task-card> <sqm-task-card goal="1" reward-amount="50" card-title="Follow Us on Twitter" description="Earn 50 points when you follow us on Twitter!" button-text="Follow" button-link="https://twitter.com/" open-new-tab="true" event-key="socialFollow" completed-text="Completed {finite, select, 0 {{count, plural, =1 {{count} time} other {{count} times}}} other {{count}/{finite} times}}" ended-message="Ended {endDate}" expiry-message="Ends {endDate}" finite="0" reward-unit="Points" starts-on-message="Starts {startDate}" > </sqm-task-card> <sqm-task-card reward-amount="1" reward-unit="Free Month" goal="1" card-title="Upgrade Your Plan" description="Receive one free month for being a committed customer when you upgrade your plan." button-text="Upgrade" completed-text="Completed {finite, select, 0 {{count, plural, =1 {{count} time} other {{count} times}}} other {{count}/{finite} times}}" ended-message="Ended {endDate}" expiry-message="Ends {endDate}" open-new-tab="false" finite="0" starts-on-message="Starts {startDate}" > </sqm-task-card> </sqm-card-feed>
|
|
10
10
|
*/
|
|
11
11
|
export class CardFeed {
|
|
12
12
|
constructor() {
|
|
@@ -126,26 +126,6 @@ export class Image {
|
|
|
126
126
|
},
|
|
127
127
|
"attribute": "min-height",
|
|
128
128
|
"reflect": false
|
|
129
|
-
},
|
|
130
|
-
"width": {
|
|
131
|
-
"type": "string",
|
|
132
|
-
"mutable": false,
|
|
133
|
-
"complexType": {
|
|
134
|
-
"original": "string",
|
|
135
|
-
"resolved": "string",
|
|
136
|
-
"references": {}
|
|
137
|
-
},
|
|
138
|
-
"required": false,
|
|
139
|
-
"optional": true,
|
|
140
|
-
"docs": {
|
|
141
|
-
"tags": [{
|
|
142
|
-
"text": "Width",
|
|
143
|
-
"name": "uiName"
|
|
144
|
-
}],
|
|
145
|
-
"text": "(Optional) Constrains the width of the image. Can be a pixel value or a percentage i.e. \"500px\", \"33%\", etc."
|
|
146
|
-
},
|
|
147
|
-
"attribute": "width",
|
|
148
|
-
"reflect": false
|
|
149
129
|
}
|
|
150
130
|
}; }
|
|
151
131
|
}
|
|
@@ -81,8 +81,8 @@ const users = [
|
|
|
81
81
|
];
|
|
82
82
|
const pointsUsers = [
|
|
83
83
|
{
|
|
84
|
-
firstName: "
|
|
85
|
-
lastInitial: "
|
|
84
|
+
firstName: "",
|
|
85
|
+
lastInitial: "",
|
|
86
86
|
textValue: "82 Points",
|
|
87
87
|
rank: 1,
|
|
88
88
|
rowNumber: 1,
|
|
@@ -156,13 +156,18 @@ const defaultStyles = {
|
|
|
156
156
|
statsheading: "Referrals",
|
|
157
157
|
rankheading: "Rank",
|
|
158
158
|
anonymousUser: "Anonymous User",
|
|
159
|
-
viewingUserText: "You",
|
|
160
|
-
rankSuffix: "{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}",
|
|
161
159
|
};
|
|
162
160
|
const link = h("a", null, "Support");
|
|
163
161
|
const tag = "Contact" + link + "about upgrading your plan";
|
|
164
162
|
const defaultElements = {
|
|
165
163
|
empty: (h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png", "empty-state-header": "View your rank in the leaderboard", "empty-state-text": "Be the first to refer a friend and reach the top of the leaderboard" })),
|
|
164
|
+
essentials: (h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1715360191/squatch-assets/Leaderboard_Not_Available.svg", "empty-state-header": "Leaderboards aren\u2019t available on your plan", "empty-state-text": "Contact {supportText} to upgrade your plan and start leveraging gamification in your program.", "support-text": "Support" })),
|
|
165
|
+
loadingstate: (h("slot", { name: "loading" },
|
|
166
|
+
h("table", null, [...Array(10)].map(() => {
|
|
167
|
+
return (h("tr", null,
|
|
168
|
+
h("td", null,
|
|
169
|
+
h("sl-skeleton", null))));
|
|
170
|
+
})))),
|
|
166
171
|
};
|
|
167
172
|
export const Empty = () => {
|
|
168
173
|
const props = {
|
|
@@ -191,10 +196,11 @@ export const Empty = () => {
|
|
|
191
196
|
};
|
|
192
197
|
return h(LeaderboardView, Object.assign({}, props));
|
|
193
198
|
};
|
|
194
|
-
export const
|
|
199
|
+
export const Essentials = () => {
|
|
195
200
|
const props = {
|
|
196
201
|
states: {
|
|
197
|
-
loading:
|
|
202
|
+
loading: false,
|
|
203
|
+
isEssentials: true,
|
|
198
204
|
hasLeaders: false,
|
|
199
205
|
styles: {
|
|
200
206
|
...defaultStyles,
|
|
@@ -202,8 +208,15 @@ export const Loading = () => {
|
|
|
202
208
|
},
|
|
203
209
|
data: {
|
|
204
210
|
rankType: "rowNumber",
|
|
205
|
-
rowNumber: 10,
|
|
206
211
|
leaderboard: [],
|
|
212
|
+
rowNumber: 10,
|
|
213
|
+
viewerRank: {
|
|
214
|
+
firstName: "Kutay",
|
|
215
|
+
lastInitial: "C",
|
|
216
|
+
textValue: "8",
|
|
217
|
+
rowNumber: 11,
|
|
218
|
+
rank: 23,
|
|
219
|
+
},
|
|
207
220
|
},
|
|
208
221
|
elements: {
|
|
209
222
|
...defaultElements,
|
|
@@ -211,11 +224,10 @@ export const Loading = () => {
|
|
|
211
224
|
};
|
|
212
225
|
return h(LeaderboardView, Object.assign({}, props));
|
|
213
226
|
};
|
|
214
|
-
export const
|
|
227
|
+
export const Loading = () => {
|
|
215
228
|
const props = {
|
|
216
229
|
states: {
|
|
217
|
-
loading:
|
|
218
|
-
isEssentials: true,
|
|
230
|
+
loading: true,
|
|
219
231
|
hasLeaders: false,
|
|
220
232
|
styles: {
|
|
221
233
|
...defaultStyles,
|
|
@@ -223,15 +235,8 @@ export const Essentials = () => {
|
|
|
223
235
|
},
|
|
224
236
|
data: {
|
|
225
237
|
rankType: "rowNumber",
|
|
226
|
-
leaderboard: [],
|
|
227
238
|
rowNumber: 10,
|
|
228
|
-
|
|
229
|
-
firstName: "Kutay",
|
|
230
|
-
lastInitial: "C",
|
|
231
|
-
textValue: "8",
|
|
232
|
-
rowNumber: 11,
|
|
233
|
-
rank: 23,
|
|
234
|
-
},
|
|
239
|
+
leaderboard: [],
|
|
235
240
|
},
|
|
236
241
|
elements: {
|
|
237
242
|
...defaultElements,
|
|
@@ -368,38 +373,6 @@ export const ReferralLeaderboard = () => {
|
|
|
368
373
|
};
|
|
369
374
|
return h(LeaderboardView, Object.assign({}, props));
|
|
370
375
|
};
|
|
371
|
-
export const ReferralLeaderboardWithMaxWidth = () => {
|
|
372
|
-
const props = {
|
|
373
|
-
states: {
|
|
374
|
-
loading: false,
|
|
375
|
-
hasLeaders: true,
|
|
376
|
-
styles: {
|
|
377
|
-
...defaultStyles,
|
|
378
|
-
rankheading: "Rank",
|
|
379
|
-
usersheading: "User",
|
|
380
|
-
statsheading: "Referrals",
|
|
381
|
-
showRank: false,
|
|
382
|
-
maxWidth: "300px",
|
|
383
|
-
},
|
|
384
|
-
},
|
|
385
|
-
data: {
|
|
386
|
-
rankType: "rowNumber",
|
|
387
|
-
leaderboard: users,
|
|
388
|
-
rowNumber: 10,
|
|
389
|
-
viewerRank: {
|
|
390
|
-
firstName: "Viktor",
|
|
391
|
-
lastInitial: "V",
|
|
392
|
-
textValue: "82",
|
|
393
|
-
rank: 1,
|
|
394
|
-
rowNumber: 1,
|
|
395
|
-
},
|
|
396
|
-
},
|
|
397
|
-
elements: {
|
|
398
|
-
...defaultElements,
|
|
399
|
-
},
|
|
400
|
-
};
|
|
401
|
-
return h(LeaderboardView, Object.assign({}, props));
|
|
402
|
-
};
|
|
403
376
|
export const PointsLeaderboard = () => {
|
|
404
377
|
const props = {
|
|
405
378
|
states: {
|
|
@@ -478,7 +451,7 @@ export const ViewerOutside = () => {
|
|
|
478
451
|
lastInitial: "C",
|
|
479
452
|
textValue: "8",
|
|
480
453
|
rowNumber: 11,
|
|
481
|
-
rank:
|
|
454
|
+
rank: 23,
|
|
482
455
|
},
|
|
483
456
|
},
|
|
484
457
|
elements: {
|
|
@@ -509,33 +482,6 @@ export const ViewerAnonymous = () => {
|
|
|
509
482
|
};
|
|
510
483
|
return h(LeaderboardView, Object.assign({}, props));
|
|
511
484
|
};
|
|
512
|
-
export const HideNamesWithViewerOutside = () => {
|
|
513
|
-
const props = {
|
|
514
|
-
states: {
|
|
515
|
-
loading: false,
|
|
516
|
-
hasLeaders: true,
|
|
517
|
-
styles: {
|
|
518
|
-
...defaultStyles,
|
|
519
|
-
showRank: true,
|
|
520
|
-
hideNames: true,
|
|
521
|
-
},
|
|
522
|
-
},
|
|
523
|
-
data: {
|
|
524
|
-
rankType: "rowNumber",
|
|
525
|
-
leaderboard: users,
|
|
526
|
-
rowNumber: 10,
|
|
527
|
-
viewerRank: {
|
|
528
|
-
textValue: "8",
|
|
529
|
-
rowNumber: 11,
|
|
530
|
-
rank: 42,
|
|
531
|
-
},
|
|
532
|
-
},
|
|
533
|
-
elements: {
|
|
534
|
-
...defaultElements,
|
|
535
|
-
},
|
|
536
|
-
};
|
|
537
|
-
return h(LeaderboardView, Object.assign({}, props));
|
|
538
|
-
};
|
|
539
485
|
export const HideViewer = () => {
|
|
540
486
|
const props = {
|
|
541
487
|
states: {
|
|
@@ -566,55 +512,3 @@ export const HideViewer = () => {
|
|
|
566
512
|
};
|
|
567
513
|
return h(LeaderboardView, Object.assign({}, props));
|
|
568
514
|
};
|
|
569
|
-
export const HideNames = () => {
|
|
570
|
-
const props = {
|
|
571
|
-
states: {
|
|
572
|
-
loading: false,
|
|
573
|
-
hasLeaders: true,
|
|
574
|
-
rowNumber: 10,
|
|
575
|
-
styles: {
|
|
576
|
-
...defaultStyles,
|
|
577
|
-
showRank: true,
|
|
578
|
-
hideNames: true,
|
|
579
|
-
},
|
|
580
|
-
},
|
|
581
|
-
data: {
|
|
582
|
-
rankType: "rowNumber",
|
|
583
|
-
leaderboard: users,
|
|
584
|
-
rowNumber: 10,
|
|
585
|
-
viewerRank: {
|
|
586
|
-
firstName: "Viktor",
|
|
587
|
-
lastInitial: "V",
|
|
588
|
-
textValue: "82",
|
|
589
|
-
rowNumber: 1,
|
|
590
|
-
rank: 1,
|
|
591
|
-
},
|
|
592
|
-
},
|
|
593
|
-
elements: {
|
|
594
|
-
...defaultElements,
|
|
595
|
-
},
|
|
596
|
-
};
|
|
597
|
-
return h(LeaderboardView, Object.assign({}, props));
|
|
598
|
-
};
|
|
599
|
-
export const LeaderboardWithNoNamesAndGraphic = () => {
|
|
600
|
-
return (h("div", { style: {
|
|
601
|
-
display: "flex",
|
|
602
|
-
alignItems: "flex-start",
|
|
603
|
-
justifyContent: "center",
|
|
604
|
-
width: "100%",
|
|
605
|
-
gap: "50px",
|
|
606
|
-
} },
|
|
607
|
-
h("div", { style: {
|
|
608
|
-
display: "flex",
|
|
609
|
-
flexDirection: "column",
|
|
610
|
-
alignItems: "center",
|
|
611
|
-
justifyContent: "center",
|
|
612
|
-
gap: "10px",
|
|
613
|
-
maxWidth: "30%",
|
|
614
|
-
} },
|
|
615
|
-
h("sqm-image", { width: "70%", alignment: "center", imageUrl: "https://res.cloudinary.com/saasquatch-staging/image/upload/v1729728469/Leaderboard_image_z87lsm.png" }),
|
|
616
|
-
h("h2", { style: { margin: "auto" } }, " Top Performers"),
|
|
617
|
-
h("p", { style: { margin: "0" } }, "The leaderboard highlights the top performers in real-time. Stay motivated, stay competitive!")),
|
|
618
|
-
h("sqm-leaderboard", { width: "300px", usersheading: "Referrer", statsheading: "Referrals", "rank-type": "rank", "leaderboard-type": "topStartedReferrers", rankheading: "Rank", "show-rank": "true", "hide-names": "true", "hide-viewer": "true" },
|
|
619
|
-
h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png", "empty-state-header": "View your rank in the leaderboard", "empty-state-text": "Be the first to refer a friend and reach the top of the leaderboard" }))));
|
|
620
|
-
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { createStyleSheet } from "../../styling/JSS";
|
|
3
|
-
import { intl } from "../../global/global";
|
|
4
3
|
const style = {
|
|
5
4
|
Leaderboard: {
|
|
6
5
|
"& table": {
|
|
@@ -22,10 +21,9 @@ const style = {
|
|
|
22
21
|
fontWeight: "var(--sl-font-weight-normal)",
|
|
23
22
|
},
|
|
24
23
|
"& .ellipses": {
|
|
25
|
-
textAlign: "
|
|
24
|
+
textAlign: "center",
|
|
26
25
|
padding: "0",
|
|
27
26
|
color: "var(--sl-color-neutral-500)",
|
|
28
|
-
paddingLeft: "25%",
|
|
29
27
|
},
|
|
30
28
|
"& .highlight": {
|
|
31
29
|
background: "var(--sl-color-primary-50)",
|
|
@@ -41,12 +39,6 @@ const style = {
|
|
|
41
39
|
width: "auto",
|
|
42
40
|
whiteSpace: "nowrap",
|
|
43
41
|
},
|
|
44
|
-
"& .Rank": {
|
|
45
|
-
whiteSpace: "nowrap",
|
|
46
|
-
},
|
|
47
|
-
"& .fullWidth": {
|
|
48
|
-
width: "100%",
|
|
49
|
-
},
|
|
50
42
|
},
|
|
51
43
|
};
|
|
52
44
|
const sheet = createStyleSheet(style);
|
|
@@ -57,74 +49,56 @@ const vanillaStyle = `
|
|
|
57
49
|
}
|
|
58
50
|
`;
|
|
59
51
|
export function LeaderboardView(props) {
|
|
60
|
-
var _a, _b, _c;
|
|
52
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
61
53
|
const { states, data, elements } = props;
|
|
62
54
|
const { styles } = states;
|
|
63
|
-
if (states.
|
|
64
|
-
return (h("
|
|
65
|
-
}
|
|
66
|
-
if (states.loading) {
|
|
67
|
-
return (h("div", { class: sheet.classes.Leaderboard, style: { width: styles.width || "100%" } },
|
|
55
|
+
if (states.loading)
|
|
56
|
+
return (h("div", { class: sheet.classes.Leaderboard },
|
|
68
57
|
h("style", { type: "text/css" },
|
|
69
58
|
styleString,
|
|
70
59
|
vanillaStyle),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
h("sl-skeleton", null))));
|
|
75
|
-
}))));
|
|
76
|
-
}
|
|
60
|
+
elements.loadingstate));
|
|
61
|
+
if (states.isEssentials)
|
|
62
|
+
return elements.essentials;
|
|
77
63
|
if (!states.hasLeaders)
|
|
78
64
|
return elements.empty;
|
|
79
65
|
let userSeenFlag = false;
|
|
80
|
-
|
|
81
|
-
if (!user.firstName && !user.lastInitial)
|
|
82
|
-
return styles.anonymousUser;
|
|
83
|
-
const { firstName, lastInitial } = user;
|
|
84
|
-
if (firstName && lastInitial)
|
|
85
|
-
return `${firstName} ${lastInitial}`;
|
|
86
|
-
if (firstName || lastInitial)
|
|
87
|
-
return firstName || lastInitial;
|
|
88
|
-
return styles.anonymousUser;
|
|
89
|
-
};
|
|
90
|
-
const getRankCellText = (userRank, isViewingUsersRow) => {
|
|
91
|
-
if (!userRank) {
|
|
92
|
-
return styles.hideNames ? `${styles.viewingUserText}` : "-";
|
|
93
|
-
}
|
|
94
|
-
const viewingUserText = ` - ${styles.viewingUserText}`;
|
|
95
|
-
return styles.rankSuffix
|
|
96
|
-
? intl.formatMessage({
|
|
97
|
-
id: "rank",
|
|
98
|
-
defaultMessage: styles.rankSuffix,
|
|
99
|
-
}, {
|
|
100
|
-
rank: userRank,
|
|
101
|
-
}) + `${isViewingUsersRow && styles.hideNames ? viewingUserText : ""}`
|
|
102
|
-
: `${userRank} ${isViewingUsersRow && styles.hideNames ? viewingUserText : ""}`;
|
|
103
|
-
};
|
|
104
|
-
return (h("div", { class: sheet.classes.Leaderboard, part: "sqm-base", style: { width: styles.width || "100%" } },
|
|
66
|
+
return (h("div", { class: sheet.classes.Leaderboard, part: "sqm-base" },
|
|
105
67
|
h("style", { type: "text/css" },
|
|
106
68
|
styleString,
|
|
107
69
|
vanillaStyle),
|
|
70
|
+
h("div", null, "Leaderboards"),
|
|
108
71
|
h("table", { part: "sqm-table" },
|
|
109
72
|
h("tr", null,
|
|
110
|
-
styles.showRank &&
|
|
111
|
-
|
|
73
|
+
styles.showRank && h("th", { class: "Rank" }, styles.rankheading),
|
|
74
|
+
h("th", { class: "User" }, styles.usersheading),
|
|
112
75
|
h("th", { class: "Score" }, styles.statsheading)), (_a = data.leaderboard) === null || _a === void 0 ? void 0 :
|
|
113
76
|
_a.map((user) => {
|
|
114
77
|
var _a, _b;
|
|
115
78
|
if (user.rowNumber === ((_a = data.viewerRank) === null || _a === void 0 ? void 0 : _a.rowNumber))
|
|
116
79
|
userSeenFlag = true;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
80
|
+
return (h("tr", { class: !styles.hideViewer &&
|
|
81
|
+
user.rowNumber === ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rowNumber)
|
|
82
|
+
? "highlight"
|
|
83
|
+
: "" },
|
|
84
|
+
styles.showRank && h("td", { class: "Rank" }, user.rank),
|
|
85
|
+
h("td", { class: "User" }, user.firstName && user.lastInitial
|
|
86
|
+
? user.firstName + " " + user.lastInitial
|
|
87
|
+
: user.firstName || user.lastInitial
|
|
88
|
+
? user.firstName || user.lastInitial
|
|
89
|
+
: styles.anonymousUser),
|
|
121
90
|
h("td", { class: "Score" }, user.textValue)));
|
|
122
91
|
}),
|
|
123
92
|
!userSeenFlag && !styles.hideViewer && (h("tr", null,
|
|
124
93
|
h("td", { colSpan: 100, class: "ellipses" },
|
|
125
94
|
h("sl-icon", { name: "three-dots", style: { verticalAlign: "middle" } })))),
|
|
126
95
|
!userSeenFlag && !styles.hideViewer && (h("tr", { class: "highlight" },
|
|
127
|
-
styles.showRank && (h("td", { class: "Rank" },
|
|
128
|
-
|
|
129
|
-
|
|
96
|
+
styles.showRank && (h("td", { class: "Rank" }, ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rank) || "-")),
|
|
97
|
+
h("td", { class: "User" }, ((_c = data.viewerRank) === null || _c === void 0 ? void 0 : _c.firstName) && ((_d = data.viewerRank) === null || _d === void 0 ? void 0 : _d.lastInitial)
|
|
98
|
+
? ((_e = data.viewerRank) === null || _e === void 0 ? void 0 : _e.firstName) +
|
|
99
|
+
" " + ((_f = data.viewerRank) === null || _f === void 0 ? void 0 : _f.lastInitial)
|
|
100
|
+
: ((_g = data.viewerRank) === null || _g === void 0 ? void 0 : _g.firstName) || ((_h = data.viewerRank) === null || _h === void 0 ? void 0 : _h.lastInitial)
|
|
101
|
+
? ((_j = data.viewerRank) === null || _j === void 0 ? void 0 : _j.firstName) || ((_k = data.viewerRank) === null || _k === void 0 ? void 0 : _k.lastInitial)
|
|
102
|
+
: styles.anonymousUser),
|
|
103
|
+
h("td", { class: "Score" }, ((_l = data.viewerRank) === null || _l === void 0 ? void 0 : _l.textValue) || "0"))))));
|
|
130
104
|
}
|
|
@@ -10,20 +10,13 @@ import { useLeaderboard } from "./useLeaderboard";
|
|
|
10
10
|
* @slots [{"name":"empty", "title":"Empty State"}]
|
|
11
11
|
* @requiredFeatures ["LEADERBOARDS"]
|
|
12
12
|
* @exampleGroup Leaderboard
|
|
13
|
-
* @example Referral Started Leaderboard - <sqm-leaderboard usersheading="Referrer"
|
|
14
|
-
* @example Referral Converted Leaderboard - <sqm-leaderboard usersheading="Referrer"
|
|
15
|
-
* @example Points Earned Leaderboard - <sqm-leaderboard usersheading="Name"
|
|
16
|
-
* @example Anonymous Leaderboard - <div style="display: flex; align-items: flex-start; justify-content: center; width: 100%; gap: 50px;"><div style="display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; max-width: 30%;"><sqm-image width="70%" alignment="center" image-url="https://res.cloudinary.com/saasquatch-staging/image/upload/v1729728469/Leaderboard_image_z87lsm.png"></sqm-image><h2 style="margin: auto;">Top Performers</h2><p style="margin: 0; text-align: center;">The leaderboard highlights the top performers in real-time. Stay motivated, stay competitive!</p></div><sqm-leaderboard width="300px" usersheading="Referrer" rank-suffix="{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}" statsheading="Referrals" rank-type="rank" leaderboard-type="topStartedReferrers" rankheading="Rank" show-rank="true" hide-names="true" hide-viewer="true"><sqm-empty empty-state-image="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png" empty-state-header="View your rank in the leaderboard" empty-state-text="Be the first to refer a friend and reach the top of the leaderboard"></sqm-empty></sqm-leaderboard></div>
|
|
13
|
+
* @example Referral Started Leaderboard - <sqm-leaderboard usersheading="Referrer" statsheading="Referrals" rank-type="rank" leaderboard-type="topStartedReferrers" rankheading="Rank" show-rank="true"><sqm-empty empty-state-image="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png" empty-state-header="View your rank in the leaderboard" empty-state-text="Be the first to refer a friend and reach the top of the leaderboard" ></sqm-empty></sqm-leaderboard>
|
|
14
|
+
* @example Referral Converted Leaderboard - <sqm-leaderboard usersheading="Referrer" statsheading="Referrals" rank-type="rank" leaderboard-type="topConvertedReferrers" rankheading="Rank" show-rank="true"><sqm-empty empty-state-image="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png" empty-state-header="View your rank in the leaderboard" empty-state-text="Be the first to refer a friend and reach the top of the leaderboard" ></sqm-empty></sqm-leaderboard>
|
|
15
|
+
* @example Points Earned Leaderboard - <sqm-leaderboard usersheading="Name" statsheading="Points" rank-type="rank" leaderboard-type="topPointEarners" rankheading="Rank" show-rank="true"><sqm-empty empty-state-image="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png" empty-state-header="View your rank in the leaderboard" empty-state-text="Be the first to refer a friend and reach the top of the leaderboard" ></sqm-empty></sqm-leaderboard>
|
|
17
16
|
* @featureTooltip <div>Motivate your participants by gamifying your program. Contact <a href="mailto:saasquatch-support%40impact.com?subject=Next steps for Leaderboards feature&body=Hi Support Team, %0D%0A%0D%0A I am interested in learning more about how Leaderboards can support the growth of our referral program. Please connect me with a program strategy manager to discuss this feature further, and determine the next steps.%0D%0A%0D%0A%0D%0AThank you,%0D%0A[Add your name here]">Support</a> to upgrade your plan and add a leaderboard.</div>
|
|
18
17
|
*/
|
|
19
18
|
export class Leaderboard {
|
|
20
19
|
constructor() {
|
|
21
|
-
/**
|
|
22
|
-
* Restrict the width of the leaderboard (Can be a pixel value or a percentage i.e. "500px", "33%", etc.)
|
|
23
|
-
*
|
|
24
|
-
* @uiName Width
|
|
25
|
-
*/
|
|
26
|
-
this.width = "100%";
|
|
27
20
|
/**
|
|
28
21
|
* Hide the viewer's leaderboard row if not in the top results.
|
|
29
22
|
*
|
|
@@ -32,16 +25,12 @@ export class Leaderboard {
|
|
|
32
25
|
*/
|
|
33
26
|
this.hideViewer = false;
|
|
34
27
|
/**
|
|
35
|
-
*
|
|
36
|
-
*/
|
|
37
|
-
this.viewingUserText = "You";
|
|
38
|
-
/**
|
|
39
|
-
* Hide the Names of users to protect personal identifiable information
|
|
28
|
+
* Hides the leaderboard if user is on Essentials plan
|
|
40
29
|
*
|
|
41
|
-
* @uiName Hide
|
|
30
|
+
* @uiName Hide viewing user
|
|
42
31
|
* @default
|
|
43
32
|
*/
|
|
44
|
-
this.
|
|
33
|
+
this.isEssentials = false;
|
|
45
34
|
/**
|
|
46
35
|
* Title displayed for users without names
|
|
47
36
|
* @uiName Unknown user text
|
|
@@ -61,6 +50,8 @@ export class Leaderboard {
|
|
|
61
50
|
render() {
|
|
62
51
|
const props = {
|
|
63
52
|
empty: h(EmptySlot, null),
|
|
53
|
+
essentials: h(EssentialsSlot, null),
|
|
54
|
+
loadingstate: h(LoadingSlot, null),
|
|
64
55
|
usersheading: this.usersheading,
|
|
65
56
|
statsheading: this.statsheading,
|
|
66
57
|
rankheading: this.rankheading,
|
|
@@ -71,11 +62,8 @@ export class Leaderboard {
|
|
|
71
62
|
anonymousUser: this.anonymousUser,
|
|
72
63
|
interval: this.interval,
|
|
73
64
|
hideViewer: this.hideViewer,
|
|
74
|
-
viewingUserText: this.viewingUserText,
|
|
75
|
-
hideNames: this.hideNames,
|
|
76
65
|
showRank: this.showRank,
|
|
77
|
-
|
|
78
|
-
width: this.width,
|
|
66
|
+
isEssentials: this.isEssentials,
|
|
79
67
|
};
|
|
80
68
|
const demoProps = { ...props, demoData: this.demoData };
|
|
81
69
|
const viewprops = isDemo()
|
|
@@ -189,47 +177,6 @@ export class Leaderboard {
|
|
|
189
177
|
"attribute": "show-rank",
|
|
190
178
|
"reflect": false
|
|
191
179
|
},
|
|
192
|
-
"width": {
|
|
193
|
-
"type": "string",
|
|
194
|
-
"mutable": false,
|
|
195
|
-
"complexType": {
|
|
196
|
-
"original": "string",
|
|
197
|
-
"resolved": "string",
|
|
198
|
-
"references": {}
|
|
199
|
-
},
|
|
200
|
-
"required": false,
|
|
201
|
-
"optional": false,
|
|
202
|
-
"docs": {
|
|
203
|
-
"tags": [{
|
|
204
|
-
"text": "Width",
|
|
205
|
-
"name": "uiName"
|
|
206
|
-
}],
|
|
207
|
-
"text": "Restrict the width of the leaderboard (Can be a pixel value or a percentage i.e. \"500px\", \"33%\", etc.)"
|
|
208
|
-
},
|
|
209
|
-
"attribute": "width",
|
|
210
|
-
"reflect": false,
|
|
211
|
-
"defaultValue": "\"100%\""
|
|
212
|
-
},
|
|
213
|
-
"rankSuffix": {
|
|
214
|
-
"type": "string",
|
|
215
|
-
"mutable": false,
|
|
216
|
-
"complexType": {
|
|
217
|
-
"original": "string",
|
|
218
|
-
"resolved": "string",
|
|
219
|
-
"references": {}
|
|
220
|
-
},
|
|
221
|
-
"required": false,
|
|
222
|
-
"optional": false,
|
|
223
|
-
"docs": {
|
|
224
|
-
"tags": [{
|
|
225
|
-
"text": "Rank Suffix",
|
|
226
|
-
"name": "uiName"
|
|
227
|
-
}],
|
|
228
|
-
"text": "A JSONata string that formats the rank with the appropriate ordinal suffix (e.g., \"st\" for 1st, \"nd\" for 2nd, \"rd\" for 3rd, and \"th\" for all others)."
|
|
229
|
-
},
|
|
230
|
-
"attribute": "rank-suffix",
|
|
231
|
-
"reflect": false
|
|
232
|
-
},
|
|
233
180
|
"hideViewer": {
|
|
234
181
|
"type": "boolean",
|
|
235
182
|
"mutable": false,
|
|
@@ -254,28 +201,7 @@ export class Leaderboard {
|
|
|
254
201
|
"reflect": false,
|
|
255
202
|
"defaultValue": "false"
|
|
256
203
|
},
|
|
257
|
-
"
|
|
258
|
-
"type": "string",
|
|
259
|
-
"mutable": false,
|
|
260
|
-
"complexType": {
|
|
261
|
-
"original": "string",
|
|
262
|
-
"resolved": "string",
|
|
263
|
-
"references": {}
|
|
264
|
-
},
|
|
265
|
-
"required": false,
|
|
266
|
-
"optional": false,
|
|
267
|
-
"docs": {
|
|
268
|
-
"tags": [{
|
|
269
|
-
"text": "Viewing user text",
|
|
270
|
-
"name": "uiName"
|
|
271
|
-
}],
|
|
272
|
-
"text": ""
|
|
273
|
-
},
|
|
274
|
-
"attribute": "viewing-user-text",
|
|
275
|
-
"reflect": false,
|
|
276
|
-
"defaultValue": "\"You\""
|
|
277
|
-
},
|
|
278
|
-
"hideNames": {
|
|
204
|
+
"isEssentials": {
|
|
279
205
|
"type": "boolean",
|
|
280
206
|
"mutable": false,
|
|
281
207
|
"complexType": {
|
|
@@ -284,18 +210,18 @@ export class Leaderboard {
|
|
|
284
210
|
"references": {}
|
|
285
211
|
},
|
|
286
212
|
"required": false,
|
|
287
|
-
"optional":
|
|
213
|
+
"optional": true,
|
|
288
214
|
"docs": {
|
|
289
215
|
"tags": [{
|
|
290
|
-
"text": "Hide
|
|
216
|
+
"text": "Hide viewing user",
|
|
291
217
|
"name": "uiName"
|
|
292
218
|
}, {
|
|
293
219
|
"text": undefined,
|
|
294
220
|
"name": "default"
|
|
295
221
|
}],
|
|
296
|
-
"text": "
|
|
222
|
+
"text": "Hides the leaderboard if user is on Essentials plan"
|
|
297
223
|
},
|
|
298
|
-
"attribute": "
|
|
224
|
+
"attribute": "is-essentials",
|
|
299
225
|
"reflect": false,
|
|
300
226
|
"defaultValue": "false"
|
|
301
227
|
},
|
|
@@ -433,7 +359,7 @@ export class Leaderboard {
|
|
|
433
359
|
"mutable": false,
|
|
434
360
|
"complexType": {
|
|
435
361
|
"original": "DemoData<LeaderboardViewProps>",
|
|
436
|
-
"resolved": "{ states?: { loading: boolean; hasLeaders: boolean; isEssentials?: boolean; styles: { usersheading: string; statsheading: string; rankheading?: string; showRank?: boolean; hideViewer?: boolean;
|
|
362
|
+
"resolved": "{ states?: { loading: boolean; hasLeaders: boolean; isEssentials?: boolean; styles: { usersheading: string; statsheading: string; rankheading?: string; showRank?: boolean; hideViewer?: boolean; anonymousUser?: string; }; }; data?: { rankType: string; leaderboard: { textValue: string; rank: number; firstName: string; lastInitial: string; rowNumber: number; }[]; viewerRank?: { textValue: string; rank: number; firstName: string; lastInitial: string; rowNumber: number; }; }; elements?: { empty: VNode; essentials: VNode; loadingstate: VNode; }; }",
|
|
437
363
|
"references": {
|
|
438
364
|
"DemoData": {
|
|
439
365
|
"location": "import",
|
|
@@ -467,6 +393,18 @@ function EmptySlot() {
|
|
|
467
393
|
return (h("slot", { name: "empty" },
|
|
468
394
|
h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png", "empty-state-header": "View your rank in the leaderboard", "empty-state-text": "Be the first to refer a friend and reach the top of the leaderboard" })));
|
|
469
395
|
}
|
|
396
|
+
function EssentialsSlot() {
|
|
397
|
+
return (h("slot", { name: "essentials" },
|
|
398
|
+
h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1715360191/squatch-assets/Leaderboard_Not_Available.svg", "empty-state-header": "Leaderboards aren\u2019t available on your plan", "empty-state-text": "Contact {supportText} to upgrade your plan and start leveraging gamification in your program.", "support-text": "Support", "missing-feature": "Leaderboards" })));
|
|
399
|
+
}
|
|
400
|
+
function LoadingSlot() {
|
|
401
|
+
return (h("slot", { name: "loading" },
|
|
402
|
+
h("table", null, [...Array(10)].map(() => {
|
|
403
|
+
return (h("tr", null,
|
|
404
|
+
h("td", null,
|
|
405
|
+
h("sl-skeleton", null))));
|
|
406
|
+
}))));
|
|
407
|
+
}
|
|
470
408
|
function useLeaderboardDemo(props) {
|
|
471
409
|
var _a, _b;
|
|
472
410
|
const data = ((_b = (_a = props.demoData) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.leaderboard) || [
|
|
@@ -522,10 +460,6 @@ function useLeaderboardDemo(props) {
|
|
|
522
460
|
: "Anonymous User",
|
|
523
461
|
showRank: props.showRank,
|
|
524
462
|
hideViewer: props.hideViewer,
|
|
525
|
-
viewingUserText: props.viewingUserText,
|
|
526
|
-
hideNames: props.hideNames,
|
|
527
|
-
rankSuffix: props.rankSuffix,
|
|
528
|
-
width: props.width,
|
|
529
463
|
},
|
|
530
464
|
},
|
|
531
465
|
data: {
|
|
@@ -534,6 +468,8 @@ function useLeaderboardDemo(props) {
|
|
|
534
468
|
},
|
|
535
469
|
elements: {
|
|
536
470
|
empty: h(EmptySlot, null),
|
|
471
|
+
essentials: h(EssentialsSlot, null),
|
|
472
|
+
loadingstate: h(LoadingSlot, null),
|
|
537
473
|
},
|
|
538
474
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
539
475
|
}
|