@saasquatch/mint-components 1.10.1 → 1.10.2-10
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-721bb748.js → ShadowViewAddon-3e537eb3.js} +25 -18
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-big-stat_38.cjs.entry.js +65 -5
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +94 -6
- package/dist/collection/components/sqm-empty/EmptyState.stories.js +1 -1
- package/dist/collection/components/sqm-image/sqm-image-view.js +2 -1
- package/dist/collection/components/sqm-image/sqm-image.js +20 -0
- package/dist/collection/components/sqm-leaderboard/Leaderboard.stories.js +87 -2
- package/dist/collection/components/sqm-leaderboard/sqm-leaderboard-view.js +26 -18
- package/dist/collection/components/sqm-leaderboard/sqm-leaderboard.js +93 -3
- package/dist/collection/components/sqm-leaderboard/useLeaderboard.js +40 -2
- package/dist/esm/{ShadowViewAddon-31eb5b16.js → ShadowViewAddon-2ac771ca.js} +25 -18
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-big-stat_38.entry.js +65 -5
- package/dist/esm/sqm-stencilbook.entry.js +94 -6
- package/dist/esm-es5/ShadowViewAddon-2ac771ca.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-big-stat_38.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/p-0e507dfe.system.entry.js +1 -0
- package/dist/mint-components/p-4348de13.system.js +1 -0
- package/dist/mint-components/{p-bf723ae9.entry.js → p-560f7316.entry.js} +2 -2
- package/dist/mint-components/p-5a1b4b5d.entry.js +223 -0
- package/dist/mint-components/{p-d6474614.js → p-a7949e42.js} +1 -1
- package/dist/mint-components/p-e82b056c.system.entry.js +1 -0
- package/dist/mint-components/p-ed17e637.system.js +1 -1
- package/dist/types/components/sqm-image/sqm-image-view.d.ts +1 -0
- package/dist/types/components/sqm-image/sqm-image.d.ts +5 -0
- package/dist/types/components/sqm-leaderboard/Leaderboard.stories.d.ts +3 -0
- package/dist/types/components/sqm-leaderboard/sqm-leaderboard-view.d.ts +3 -0
- package/dist/types/components/sqm-leaderboard/sqm-leaderboard.d.ts +19 -1
- package/dist/types/components/sqm-leaderboard/useLeaderboard.d.ts +3 -0
- package/dist/types/components.d.ts +40 -2
- 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-31eb5b16.js +0 -1
- package/dist/mint-components/p-0d39c815.system.entry.js +0 -1
- package/dist/mint-components/p-27bd5535.entry.js +0 -187
- package/dist/mint-components/p-b567780d.system.js +0 -1
- package/dist/mint-components/p-f1a1e7f3.system.entry.js +0 -1
|
@@ -28,7 +28,7 @@ const sqmPortalProfileView = require('./sqm-portal-profile-view-fde54e35.js');
|
|
|
28
28
|
require('./utilities-cec9dd36.js');
|
|
29
29
|
const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-96f329ed.js');
|
|
30
30
|
const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-7ffcc0d4.js');
|
|
31
|
-
const ShadowViewAddon = require('./ShadowViewAddon-
|
|
31
|
+
const ShadowViewAddon = require('./ShadowViewAddon-3e537eb3.js');
|
|
32
32
|
const sqmPortalContainerView = require('./sqm-portal-container-view-5fb2ad49.js');
|
|
33
33
|
const sqmInvoiceTableView = require('./sqm-invoice-table-view-28b14d28.js');
|
|
34
34
|
|
|
@@ -1604,8 +1604,8 @@ const SlottedIntoComponent = () => {
|
|
|
1604
1604
|
data: {
|
|
1605
1605
|
rankType: "rowNumber",
|
|
1606
1606
|
leaderboard: [],
|
|
1607
|
-
showUser: true,
|
|
1608
1607
|
rowNumber: 10,
|
|
1608
|
+
showUser: true,
|
|
1609
1609
|
userRank: {
|
|
1610
1610
|
firstName: "Kutay",
|
|
1611
1611
|
lastInitial: "C",
|
|
@@ -1813,7 +1813,7 @@ const BigStat = /*#__PURE__*/Object.freeze({
|
|
|
1813
1813
|
MultipleStats: MultipleStats
|
|
1814
1814
|
});
|
|
1815
1815
|
|
|
1816
|
-
const scenario$4 = "@owner:noah @author:noah\nFeature: Leaderboard\n\tThe leaderboard supports three main cases\n\t- Top Started Referrers\n\t- Top Converted Referrers\n\t- Top Point Earners\n\tTo display these different types of leaderboards it uses the backends pre-canned options.\n\tThe backend supports filtering on programId and interval, programId is sourced from program context.\n\n Background: A user exists\n Given a user\n And they are viewing the leaderboard\n\n @motivating\n Scenario Outline: Two types of referrals leaderboards can be displayed\n Given a leaderboard has prop \"leaderboard-type\" with <value>\n And there are started referrals on the tenant\n And there are started converted on the tenant\n When the user views the leaderboard\n Then they see the referral <referralType> leaderboard\n\n Examples:\n | value | referralType |\n | topStartedReferrers | started |\n | topConvertedReferrers | converted |\n\n @motivating\n Scenario: The top point earners leaderboard can be displayed\n Given a leaderboard has prop \"leaderboard-type\" with value \"topPointEarners\"\n And there are users with points\n When the user views the leaderboard\n Then they see the top point earners leaderboard\n And text values are displayed for point counts\n\n @minutia\n Scenario Outline: Reward pretty value is used on the top point earners leaderboard\n Given top point earners leaderboard\n And the \"POINT\" reward unit has a pretty value for the following locales\n | locale |\n | en |\n | fr |\n | tr |\n When the user views the leaderboard\n And they have <locale>\n Then they see the translated pretty value in the stat value column\n\n @motivating\n Scenario Outline: Program Context is used by default to filter leaderboard results\n Given a <leaderboardType> leaderboard loaded with program context for \"my-program\"\n When the user views the leaderboard\n Then they only see <results> from \"my-program\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Program Id context can be overwritten with a prop\n Given a <leaderboardType> leaderboard has prop \"program-Id\" with value \"my-test-program\"\n When the user views the leaderboard\n Then they only see <results> from \"my-test-program\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Global leaderboards can be displayed by clearing program context\n\t\t#This is important for clients with use cases like StaffTracks global points leaderboard\n\t\t#This can also be done with a program section in a similar manner\n Given a <leaderboardType> leaderboard has prop \"program-Id\" with value \"\"\n When the user views the leaderboard\n Then they see global <results>\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario: Leaderboard results are shown in descending order\n Given there are leaderboard results\n When the user views the leaderboard\n Then they see up to the 10 top leaderboard results\n And leaderboard is in descending order\n\n @motivating\n Scenario Outline: Leaderboard results can be filtered with a time interval\n Given a <leaderboardType> leaderboard\n And it has prop \"interval\" with value \"2021-11-02T07:00:00.000Z/2021-11-07T07:00:00.000Z\"\n When the user views the leaderboard\n Then they only see <results> from within \"2021-11-02T07:00:00.000Z/2021-11-07T07:00:00.000Z\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Leaderboard rank type can be configured\n Given a leaderboard has prop \"rank-type\" with <value>\n When the user views the leaderboard\n Then their leaderboard rank is their <rank>\n\n Examples:\n | value | rank |\n | rowNumber | row number |\n | denseRank | dense rank |\n | rank | rank |\n\n @minutia\n Scenario Outline: The max number of leaderboard rows displayed can be configured but defaults to 10\n Given a leaderboard has prop \"max-rows\" with <value>\n And the leaderboard has <resultCount>\n When the user views the leaderboard\n Then they see <number> rows\n\n Examples:\n | value | resultCount | number |\n | | 10 | 10 |\n | 5 | 10 | 5 |\n | 3 | 1 | 1 |\n | 25 | 15 | 15 |\n\n @minutiae @ui\n Scenario: Leaderboards with no results show an empty state\n Given a leaderboard has no results\n When the user views the leaderboard\n Then an empty state is dislayed\n And they see an image of a leaderboard\n And below they see \"View your rank in the leaderboard\"\n And below they see \"Be the first to refer a friend and reach the top of the leaderboard\"\n And the text is center aligned\n\n @minutiae @ui\n Scenario: A custom empty state can be provided\n Given a leaderboard has no results\n When the user views the leaderboard\n Then the contents of the \"empty\" slot are displayed\n\n @minutiae @ui\n Scenario: User is on Essentials plan\n Given the user has an Essentials plan\n When they view the leaderboard\n Then a message telling them to upgrade their plan appears:\n \"\"\"\n Contact Support to upgrade your plan and start leveraging\n gamification in your program.\n \"\"\"\n And an empty table image is displayed\n\n @minutiae @ui\n Scenario: Leaderboard headings can be customized\n Given a leaderboard\n And it has the following props\n | prop | value |\n | rankheading | Place |\n | usersheading | Customer |\n | statsheading | Referral Count |\n | show-rank | true |\n When the user views the leaderboard\n Then they see the following columns with headings\n | column | heading |\n | rank | Place |\n | user | Customer |\n | stat | Referral Count |\n\n @motivating @ui\n Scenario Outline: Leaderboard rank can be hidden or shown\n Given a leaderboard\n And it has prop \"show-rank\" with <propValue>\n When the user views the leaderboard\n Then they <maySee> the rank column\n\n Examples:\n | propValue | maySee |\n | true | see |\n | false | don't see |\n | | don't see |\n\n @motivating @ui\n Scenario: Users in the top 10 of the leaderboard results see their leaderboard row highlighted\n Given a user in the top 10 of the leaderboard results\n When they view the leaderboard\n Then they see the row with their name highlighted with brand colour\n\n @motivating @ui\n Scenario Outline: Users not in the top 10 leaderboard results can see their progress at the bottom of the leaderboard\n Given a user <mayHave> completed actions counted by the leaderboard\n And they are not in the top 10 leaderboard results\n And the leaderboard has prop \"show-user\" with <value>\n When they view the leaderboard\n Then they <maySee> \"...\" under the top 10 leaderboard results\n And under \"...\" they <maySee> a row highlighted with brand colour\n And they <maySee> their name\n And they <maySee> their leaderboard value\n And they <maySeeRank>\n\n Examples:\n | mayHave | value | maySee | maySeeRank |\n | has | true | see | see their rank |\n | hasn't | true | see | don't see their rank |\n | N/A | false | don't see | don't see their rank |\n | hasn't | | see | don't see their rank |\n\n @minutiae\n Scenario: Users without names are displayed as an \"Anonymous User\"\n Given a user\n And they do not have a first name\n And they do not have a last initial\n When they view the leaderboard\n Then they see the user displayed as \"Anonymous User\"\n\n @minutiae\n Scenario Outline: If a user only has a first or last name, then only that is displayed\n Given a user\n And they only have a <name>\n When they view the leaderboard\n Then they only see their <name>\n\n Examples:\n | name |\n | firstName |\n | lastName |\n";
|
|
1816
|
+
const scenario$4 = "@owner:noah @author:noah\nFeature: Leaderboard\n\tThe leaderboard supports three main cases\n\t- Top Started Referrers\n\t- Top Converted Referrers\n\t- Top Point Earners\n\tTo display these different types of leaderboards it uses the backends pre-canned options.\n\tThe backend supports filtering on programId and interval, programId is sourced from program context.\n\n Background: A user exists\n Given a user\n And they are viewing the leaderboard\n\n @motivating\n Scenario Outline: Two types of referrals leaderboards can be displayed\n Given a leaderboard has prop \"leaderboard-type\" with <value>\n And there are started referrals on the tenant\n And there are started converted on the tenant\n When the user views the leaderboard\n Then they see the referral <referralType> leaderboard\n\n Examples:\n | value | referralType |\n | topStartedReferrers | started |\n | topConvertedReferrers | converted |\n\n @motivating\n Scenario: The top point earners leaderboard can be displayed\n Given a leaderboard has prop \"leaderboard-type\" with value \"topPointEarners\"\n And there are users with points\n When the user views the leaderboard\n Then they see the top point earners leaderboard\n And text values are displayed for point counts\n\n @minutia\n Scenario Outline: Reward pretty value is used on the top point earners leaderboard\n Given top point earners leaderboard\n And the \"POINT\" reward unit has a pretty value for the following locales\n | locale |\n | en |\n | fr |\n | tr |\n When the user views the leaderboard\n And they have <locale>\n Then they see the translated pretty value in the stat value column\n\n @motivating\n Scenario Outline: Program Context is used by default to filter leaderboard results\n Given a <leaderboardType> leaderboard loaded with program context for \"my-program\"\n When the user views the leaderboard\n Then they only see <results> from \"my-program\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Program Id context can be overwritten with a prop\n Given a <leaderboardType> leaderboard has prop \"program-Id\" with value \"my-test-program\"\n When the user views the leaderboard\n Then they only see <results> from \"my-test-program\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Global leaderboards can be displayed by clearing program context\n\t\t#This is important for clients with use cases like StaffTracks global points leaderboard\n\t\t#This can also be done with a program section in a similar manner\n Given a <leaderboardType> leaderboard has prop \"program-Id\" with value \"\"\n When the user views the leaderboard\n Then they see global <results>\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario: Leaderboard results are shown in descending order\n Given there are leaderboard results\n When the user views the leaderboard\n Then they see up to the 10 top leaderboard results\n And leaderboard is in descending order\n\n @motivating\n Scenario Outline: Leaderboard results can be filtered with a time interval\n Given a <leaderboardType> leaderboard\n And it has prop \"interval\" with value \"2021-11-02T07:00:00.000Z/2021-11-07T07:00:00.000Z\"\n When the user views the leaderboard\n Then they only see <results> from within \"2021-11-02T07:00:00.000Z/2021-11-07T07:00:00.000Z\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Leaderboard rank type can be configured\n Given a leaderboard has prop \"rank-type\" with <value>\n When the user views the leaderboard\n Then their leaderboard rank is their <rank>\n\n Examples:\n | value | rank |\n | rowNumber | row number |\n | denseRank | dense rank |\n | rank | rank |\n\n @minutia\n Scenario Outline: The max number of leaderboard rows displayed can be configured but defaults to 10\n Given a leaderboard has prop \"max-rows\" with <value>\n And the leaderboard has <resultCount>\n When the user views the leaderboard\n Then they see <number> rows\n\n Examples:\n | value | resultCount | number |\n | | 10 | 10 |\n | 5 | 10 | 5 |\n | 3 | 1 | 1 |\n | 25 | 15 | 15 |\n\n @minutiae @ui\n Scenario: Leaderboards with no results show an empty state\n Given a leaderboard has no results\n When the user views the leaderboard\n Then an empty state is dislayed\n And they see an image of a leaderboard\n And below they see \"View your rank in the leaderboard\"\n And below they see \"Be the first to refer a friend and reach the top of the leaderboard\"\n And the text is center aligned\n\n @minutiae @ui\n Scenario: A custom empty state can be provided\n Given a leaderboard has no results\n When the user views the leaderboard\n Then the contents of the \"empty\" slot are displayed\n\n @minutiae @ui\n Scenario: User is on Essentials plan\n Given the user has an Essentials plan\n When they view the leaderboard\n Then a message telling them to upgrade their plan appears:\n \"\"\"\n Contact Support to upgrade your plan and start leveraging\n gamification in your program.\n \"\"\"\n And an empty table image is displayed\n\n @minutiae @ui\n Scenario: Leaderboard headings can be customized\n Given a leaderboard\n And it has the following props\n | prop | value |\n | rankheading | Place |\n | usersheading | Customer |\n | statsheading | Referral Count |\n | show-rank | true |\n When the user views the leaderboard\n Then they see the following columns with headings\n | column | heading |\n | rank | Place |\n | user | Customer |\n | stat | Referral Count |\n\n @motivating @ui\n Scenario Outline: Leaderboard rank can be hidden or shown\n Given a leaderboard\n And it has prop \"show-rank\" with <propValue>\n When the user views the leaderboard\n Then they <maySee> the rank column\n\n Examples:\n | propValue | maySee |\n | true | see |\n | false | don't see |\n | | don't see |\n\n Scenario Outline: Users names can be hidden or shown\n Given a leaderboard\n And it has prop \"hide-names\" with <propValue>\n When the user views the leaderboard\n Then they <maySee> the referrer column\n\n Examples:\n | propValue | maySee |\n | true | don't see |\n | false | see |\n | | see |\n\n @motivating @ui\n Scenario: Users in the top 10 of the leaderboard results see their leaderboard row highlighted\n Given a user in the top 10 of the leaderboard results\n When they view the leaderboard\n Then they see the row with their name highlighted with brand colour\n\n @motivating @ui\n Scenario Outline: Users not in the top 10 leaderboard results can see their progress at the bottom of the leaderboard\n Given a user <mayHave> completed actions counted by the leaderboard\n And they are not in the top 10 leaderboard results\n And the leaderboard has prop \"show-user\" with <value>\n When they view the leaderboard\n Then they <maySee> \"...\" under the top 10 leaderboard results\n And under \"...\" they <maySee> a row highlighted with brand colour\n And they <maySee> their name\n And they <maySee> their leaderboard value\n And they <maySeeRank>\n\n Examples:\n | mayHave | value | maySee | maySeeRank |\n | has | true | see | see their rank |\n | hasn't | true | see | don't see their rank |\n | N/A | false | don't see | don't see their rank |\n | hasn't | | see | don't see their rank |\n\n @minutiae\n Scenario: Users without names are displayed as an \"Anonymous User\"\n Given a user\n And they do not have a first name\n And they do not have a last initial\n When they view the leaderboard\n Then they see the user displayed as \"Anonymous User\"\n\n @minutiae\n Scenario Outline: If a user only has a first or last name, then only that is displayed\n Given a user\n And they only have a <name>\n When they view the leaderboard\n Then they only see their <name>\n\n Examples:\n | name |\n | firstName |\n | lastName |\n";
|
|
1817
1817
|
|
|
1818
1818
|
const Leaderboard_stories = {
|
|
1819
1819
|
title: "Components/Leaderboard",
|
|
@@ -1895,8 +1895,8 @@ const users = [
|
|
|
1895
1895
|
];
|
|
1896
1896
|
const pointsUsers = [
|
|
1897
1897
|
{
|
|
1898
|
-
firstName: "",
|
|
1899
|
-
lastInitial: "",
|
|
1898
|
+
firstName: "Tom",
|
|
1899
|
+
lastInitial: "Smith",
|
|
1900
1900
|
textValue: "82 Points",
|
|
1901
1901
|
rank: 1,
|
|
1902
1902
|
rowNumber: 1,
|
|
@@ -1970,6 +1970,7 @@ const defaultStyles$1 = {
|
|
|
1970
1970
|
statsheading: "Referrals",
|
|
1971
1971
|
rankheading: "Rank",
|
|
1972
1972
|
anonymousUser: "Anonymous User",
|
|
1973
|
+
rankSuffix: "{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}",
|
|
1973
1974
|
};
|
|
1974
1975
|
const link = index.h("a", null, "Support");
|
|
1975
1976
|
const defaultElements$1 = {
|
|
@@ -2186,6 +2187,38 @@ const ReferralLeaderboard = () => {
|
|
|
2186
2187
|
};
|
|
2187
2188
|
return index.h(ShadowViewAddon.LeaderboardView, Object.assign({}, props));
|
|
2188
2189
|
};
|
|
2190
|
+
const ReferralLeaderboardWithMaxWidth = () => {
|
|
2191
|
+
const props = {
|
|
2192
|
+
states: {
|
|
2193
|
+
loading: false,
|
|
2194
|
+
hasLeaders: true,
|
|
2195
|
+
styles: {
|
|
2196
|
+
...defaultStyles$1,
|
|
2197
|
+
rankheading: "Rank",
|
|
2198
|
+
usersheading: "User",
|
|
2199
|
+
statsheading: "Referrals",
|
|
2200
|
+
showRank: false,
|
|
2201
|
+
maxWidth: "300px",
|
|
2202
|
+
},
|
|
2203
|
+
},
|
|
2204
|
+
data: {
|
|
2205
|
+
rankType: "rowNumber",
|
|
2206
|
+
leaderboard: users,
|
|
2207
|
+
rowNumber: 10,
|
|
2208
|
+
viewerRank: {
|
|
2209
|
+
firstName: "Viktor",
|
|
2210
|
+
lastInitial: "V",
|
|
2211
|
+
textValue: "82",
|
|
2212
|
+
rank: 1,
|
|
2213
|
+
rowNumber: 1,
|
|
2214
|
+
},
|
|
2215
|
+
},
|
|
2216
|
+
elements: {
|
|
2217
|
+
...defaultElements$1,
|
|
2218
|
+
},
|
|
2219
|
+
};
|
|
2220
|
+
return index.h(ShadowViewAddon.LeaderboardView, Object.assign({}, props));
|
|
2221
|
+
};
|
|
2189
2222
|
const PointsLeaderboard = () => {
|
|
2190
2223
|
const props = {
|
|
2191
2224
|
states: {
|
|
@@ -2325,6 +2358,58 @@ const HideViewer = () => {
|
|
|
2325
2358
|
};
|
|
2326
2359
|
return index.h(ShadowViewAddon.LeaderboardView, Object.assign({}, props));
|
|
2327
2360
|
};
|
|
2361
|
+
const HideNames = () => {
|
|
2362
|
+
const props = {
|
|
2363
|
+
states: {
|
|
2364
|
+
loading: false,
|
|
2365
|
+
hasLeaders: true,
|
|
2366
|
+
rowNumber: 10,
|
|
2367
|
+
styles: {
|
|
2368
|
+
...defaultStyles$1,
|
|
2369
|
+
showRank: true,
|
|
2370
|
+
hideNames: true,
|
|
2371
|
+
},
|
|
2372
|
+
},
|
|
2373
|
+
data: {
|
|
2374
|
+
rankType: "rowNumber",
|
|
2375
|
+
leaderboard: users,
|
|
2376
|
+
rowNumber: 10,
|
|
2377
|
+
viewerRank: {
|
|
2378
|
+
firstName: "Viktor",
|
|
2379
|
+
lastInitial: "V",
|
|
2380
|
+
textValue: "82",
|
|
2381
|
+
rowNumber: 1,
|
|
2382
|
+
rank: 1,
|
|
2383
|
+
},
|
|
2384
|
+
},
|
|
2385
|
+
elements: {
|
|
2386
|
+
...defaultElements$1,
|
|
2387
|
+
},
|
|
2388
|
+
};
|
|
2389
|
+
return index.h(ShadowViewAddon.LeaderboardView, Object.assign({}, props));
|
|
2390
|
+
};
|
|
2391
|
+
const LeaderboardWithNoNamesAndGraphic = () => {
|
|
2392
|
+
return (index.h("div", { style: {
|
|
2393
|
+
display: "flex",
|
|
2394
|
+
alignItems: "flex-start",
|
|
2395
|
+
justifyContent: "center",
|
|
2396
|
+
width: "100%",
|
|
2397
|
+
gap: "50px",
|
|
2398
|
+
} },
|
|
2399
|
+
index.h("div", { style: {
|
|
2400
|
+
display: "flex",
|
|
2401
|
+
flexDirection: "column",
|
|
2402
|
+
alignItems: "center",
|
|
2403
|
+
justifyContent: "center",
|
|
2404
|
+
gap: "10px",
|
|
2405
|
+
maxWidth: "30%",
|
|
2406
|
+
} },
|
|
2407
|
+
index.h("sqm-image", { width: "70%", alignment: "center", imageUrl: "https://res.cloudinary.com/saasquatch-staging/image/upload/v1729728469/Leaderboard_image_z87lsm.png" }),
|
|
2408
|
+
index.h("h2", { style: { margin: "auto" } }, " Top Performers"),
|
|
2409
|
+
index.h("p", { style: { margin: "0" } }, "The leaderboard highlights the top performers in real-time. Stay motivated, stay competitive!")),
|
|
2410
|
+
index.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" },
|
|
2411
|
+
index.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" }))));
|
|
2412
|
+
};
|
|
2328
2413
|
|
|
2329
2414
|
const Leaderboard = /*#__PURE__*/Object.freeze({
|
|
2330
2415
|
__proto__: null,
|
|
@@ -2335,11 +2420,14 @@ const Leaderboard = /*#__PURE__*/Object.freeze({
|
|
|
2335
2420
|
One: One,
|
|
2336
2421
|
Five: Five,
|
|
2337
2422
|
ReferralLeaderboard: ReferralLeaderboard,
|
|
2423
|
+
ReferralLeaderboardWithMaxWidth: ReferralLeaderboardWithMaxWidth,
|
|
2338
2424
|
PointsLeaderboard: PointsLeaderboard,
|
|
2339
2425
|
TenWithRank: TenWithRank,
|
|
2340
2426
|
ViewerOutside: ViewerOutside,
|
|
2341
2427
|
ViewerAnonymous: ViewerAnonymous,
|
|
2342
|
-
HideViewer: HideViewer
|
|
2428
|
+
HideViewer: HideViewer,
|
|
2429
|
+
HideNames: HideNames,
|
|
2430
|
+
LeaderboardWithNoNamesAndGraphic: LeaderboardWithNoNamesAndGraphic
|
|
2343
2431
|
});
|
|
2344
2432
|
|
|
2345
2433
|
const HookStoryAddon = ({ story }, children) => {
|
|
@@ -5,13 +5,14 @@ export function ImageView(props) {
|
|
|
5
5
|
const style = {
|
|
6
6
|
Container: {
|
|
7
7
|
display: "flex",
|
|
8
|
+
// width: props.width || "100%",
|
|
8
9
|
width: "100%",
|
|
9
10
|
justifyContent: props.alignment || "center",
|
|
10
11
|
background: props.backgroundColor || "",
|
|
11
12
|
},
|
|
12
13
|
Image: {
|
|
13
14
|
minHeight: props.minHeight || "100%",
|
|
14
|
-
width: "100%",
|
|
15
|
+
width: props.width || "100%",
|
|
15
16
|
maxWidth: "max-content",
|
|
16
17
|
objectFit: "cover",
|
|
17
18
|
},
|
|
@@ -126,6 +126,26 @@ 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
|
|
129
149
|
}
|
|
130
150
|
}; }
|
|
131
151
|
}
|
|
@@ -81,8 +81,8 @@ const users = [
|
|
|
81
81
|
];
|
|
82
82
|
const pointsUsers = [
|
|
83
83
|
{
|
|
84
|
-
firstName: "",
|
|
85
|
-
lastInitial: "",
|
|
84
|
+
firstName: "Tom",
|
|
85
|
+
lastInitial: "Smith",
|
|
86
86
|
textValue: "82 Points",
|
|
87
87
|
rank: 1,
|
|
88
88
|
rowNumber: 1,
|
|
@@ -156,6 +156,7 @@ const defaultStyles = {
|
|
|
156
156
|
statsheading: "Referrals",
|
|
157
157
|
rankheading: "Rank",
|
|
158
158
|
anonymousUser: "Anonymous User",
|
|
159
|
+
rankSuffix: "{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}",
|
|
159
160
|
};
|
|
160
161
|
const link = h("a", null, "Support");
|
|
161
162
|
const tag = "Contact" + link + "about upgrading your plan";
|
|
@@ -373,6 +374,38 @@ export const ReferralLeaderboard = () => {
|
|
|
373
374
|
};
|
|
374
375
|
return h(LeaderboardView, Object.assign({}, props));
|
|
375
376
|
};
|
|
377
|
+
export const ReferralLeaderboardWithMaxWidth = () => {
|
|
378
|
+
const props = {
|
|
379
|
+
states: {
|
|
380
|
+
loading: false,
|
|
381
|
+
hasLeaders: true,
|
|
382
|
+
styles: {
|
|
383
|
+
...defaultStyles,
|
|
384
|
+
rankheading: "Rank",
|
|
385
|
+
usersheading: "User",
|
|
386
|
+
statsheading: "Referrals",
|
|
387
|
+
showRank: false,
|
|
388
|
+
maxWidth: "300px",
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
data: {
|
|
392
|
+
rankType: "rowNumber",
|
|
393
|
+
leaderboard: users,
|
|
394
|
+
rowNumber: 10,
|
|
395
|
+
viewerRank: {
|
|
396
|
+
firstName: "Viktor",
|
|
397
|
+
lastInitial: "V",
|
|
398
|
+
textValue: "82",
|
|
399
|
+
rank: 1,
|
|
400
|
+
rowNumber: 1,
|
|
401
|
+
},
|
|
402
|
+
},
|
|
403
|
+
elements: {
|
|
404
|
+
...defaultElements,
|
|
405
|
+
},
|
|
406
|
+
};
|
|
407
|
+
return h(LeaderboardView, Object.assign({}, props));
|
|
408
|
+
};
|
|
376
409
|
export const PointsLeaderboard = () => {
|
|
377
410
|
const props = {
|
|
378
411
|
states: {
|
|
@@ -512,3 +545,55 @@ export const HideViewer = () => {
|
|
|
512
545
|
};
|
|
513
546
|
return h(LeaderboardView, Object.assign({}, props));
|
|
514
547
|
};
|
|
548
|
+
export const HideNames = () => {
|
|
549
|
+
const props = {
|
|
550
|
+
states: {
|
|
551
|
+
loading: false,
|
|
552
|
+
hasLeaders: true,
|
|
553
|
+
rowNumber: 10,
|
|
554
|
+
styles: {
|
|
555
|
+
...defaultStyles,
|
|
556
|
+
showRank: true,
|
|
557
|
+
hideNames: true,
|
|
558
|
+
},
|
|
559
|
+
},
|
|
560
|
+
data: {
|
|
561
|
+
rankType: "rowNumber",
|
|
562
|
+
leaderboard: users,
|
|
563
|
+
rowNumber: 10,
|
|
564
|
+
viewerRank: {
|
|
565
|
+
firstName: "Viktor",
|
|
566
|
+
lastInitial: "V",
|
|
567
|
+
textValue: "82",
|
|
568
|
+
rowNumber: 1,
|
|
569
|
+
rank: 1,
|
|
570
|
+
},
|
|
571
|
+
},
|
|
572
|
+
elements: {
|
|
573
|
+
...defaultElements,
|
|
574
|
+
},
|
|
575
|
+
};
|
|
576
|
+
return h(LeaderboardView, Object.assign({}, props));
|
|
577
|
+
};
|
|
578
|
+
export const LeaderboardWithNoNamesAndGraphic = () => {
|
|
579
|
+
return (h("div", { style: {
|
|
580
|
+
display: "flex",
|
|
581
|
+
alignItems: "flex-start",
|
|
582
|
+
justifyContent: "center",
|
|
583
|
+
width: "100%",
|
|
584
|
+
gap: "50px",
|
|
585
|
+
} },
|
|
586
|
+
h("div", { style: {
|
|
587
|
+
display: "flex",
|
|
588
|
+
flexDirection: "column",
|
|
589
|
+
alignItems: "center",
|
|
590
|
+
justifyContent: "center",
|
|
591
|
+
gap: "10px",
|
|
592
|
+
maxWidth: "30%",
|
|
593
|
+
} },
|
|
594
|
+
h("sqm-image", { width: "70%", alignment: "center", imageUrl: "https://res.cloudinary.com/saasquatch-staging/image/upload/v1729728469/Leaderboard_image_z87lsm.png" }),
|
|
595
|
+
h("h2", { style: { margin: "auto" } }, " Top Performers"),
|
|
596
|
+
h("p", { style: { margin: "0" } }, "The leaderboard highlights the top performers in real-time. Stay motivated, stay competitive!")),
|
|
597
|
+
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" },
|
|
598
|
+
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" }))));
|
|
599
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { createStyleSheet } from "../../styling/JSS";
|
|
3
|
+
import { intl } from "../../global/global";
|
|
3
4
|
const style = {
|
|
4
5
|
Leaderboard: {
|
|
5
6
|
"& table": {
|
|
@@ -39,6 +40,9 @@ const style = {
|
|
|
39
40
|
width: "auto",
|
|
40
41
|
whiteSpace: "nowrap",
|
|
41
42
|
},
|
|
43
|
+
"& .fullWidth": {
|
|
44
|
+
width: "100%",
|
|
45
|
+
},
|
|
42
46
|
},
|
|
43
47
|
};
|
|
44
48
|
const sheet = createStyleSheet(style);
|
|
@@ -49,7 +53,7 @@ const vanillaStyle = `
|
|
|
49
53
|
}
|
|
50
54
|
`;
|
|
51
55
|
export function LeaderboardView(props) {
|
|
52
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
56
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
53
57
|
const { states, data, elements } = props;
|
|
54
58
|
const { styles } = states;
|
|
55
59
|
if (states.loading)
|
|
@@ -63,17 +67,18 @@ export function LeaderboardView(props) {
|
|
|
63
67
|
if (!states.hasLeaders)
|
|
64
68
|
return elements.empty;
|
|
65
69
|
let userSeenFlag = false;
|
|
66
|
-
|
|
70
|
+
console.log("The rank is: ", (_a = data.viewerRank) === null || _a === void 0 ? void 0 : _a.rank);
|
|
71
|
+
console.log("The rank suffix is: ", styles.width);
|
|
72
|
+
return (h("div", { class: sheet.classes.Leaderboard, part: "sqm-base", style: { width: styles.width || "100%" } },
|
|
67
73
|
h("style", { type: "text/css" },
|
|
68
74
|
styleString,
|
|
69
75
|
vanillaStyle),
|
|
70
|
-
h("div", null, "Leaderboards"),
|
|
71
76
|
h("table", { part: "sqm-table" },
|
|
72
77
|
h("tr", null,
|
|
73
|
-
styles.showRank && h("th", { class:
|
|
74
|
-
h("th", { class: "User" }, styles.usersheading),
|
|
75
|
-
h("th", { class: "Score" }, styles.statsheading)), (
|
|
76
|
-
|
|
78
|
+
styles.showRank && (h("th", { class: `Rank ${styles.hideNames ? "fullWidth" : ""}` }, styles.rankheading)),
|
|
79
|
+
!styles.hideNames && h("th", { class: "User" }, styles.usersheading),
|
|
80
|
+
h("th", { class: "Score" }, styles.statsheading)), (_b = data.leaderboard) === null || _b === void 0 ? void 0 :
|
|
81
|
+
_b.map((user) => {
|
|
77
82
|
var _a, _b;
|
|
78
83
|
if (user.rowNumber === ((_a = data.viewerRank) === null || _a === void 0 ? void 0 : _a.rowNumber))
|
|
79
84
|
userSeenFlag = true;
|
|
@@ -81,24 +86,27 @@ export function LeaderboardView(props) {
|
|
|
81
86
|
user.rowNumber === ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rowNumber)
|
|
82
87
|
? "highlight"
|
|
83
88
|
: "" },
|
|
84
|
-
styles.showRank && h("td", { class: "Rank" },
|
|
85
|
-
|
|
89
|
+
styles.showRank && (h("td", { class: "Rank" }, intl.formatMessage({
|
|
90
|
+
id: "rank",
|
|
91
|
+
defaultMessage: styles.rankSuffix,
|
|
92
|
+
}, { rank: user.rank }))),
|
|
93
|
+
!styles.hideNames && (h("td", { class: "User" }, user.firstName && user.lastInitial
|
|
86
94
|
? user.firstName + " " + user.lastInitial
|
|
87
95
|
: user.firstName || user.lastInitial
|
|
88
96
|
? user.firstName || user.lastInitial
|
|
89
|
-
: styles.anonymousUser),
|
|
97
|
+
: styles.anonymousUser)),
|
|
90
98
|
h("td", { class: "Score" }, user.textValue)));
|
|
91
99
|
}),
|
|
92
100
|
!userSeenFlag && !styles.hideViewer && (h("tr", null,
|
|
93
101
|
h("td", { colSpan: 100, class: "ellipses" },
|
|
94
102
|
h("sl-icon", { name: "three-dots", style: { verticalAlign: "middle" } })))),
|
|
95
103
|
!userSeenFlag && !styles.hideViewer && (h("tr", { class: "highlight" },
|
|
96
|
-
styles.showRank && (h("td", { class: "Rank" }, ((
|
|
97
|
-
h("td", { class: "User" }, ((
|
|
98
|
-
? ((
|
|
99
|
-
" " + ((
|
|
100
|
-
: ((
|
|
101
|
-
? ((
|
|
102
|
-
: styles.anonymousUser),
|
|
103
|
-
h("td", { class: "Score" }, ((
|
|
104
|
+
styles.showRank && (h("td", { class: "Rank" }, ((_c = data.viewerRank) === null || _c === void 0 ? void 0 : _c.rank) || "-")),
|
|
105
|
+
!styles.hideNames && (h("td", { class: "User" }, ((_d = data.viewerRank) === null || _d === void 0 ? void 0 : _d.firstName) && ((_e = data.viewerRank) === null || _e === void 0 ? void 0 : _e.lastInitial)
|
|
106
|
+
? ((_f = data.viewerRank) === null || _f === void 0 ? void 0 : _f.firstName) +
|
|
107
|
+
" " + ((_g = data.viewerRank) === null || _g === void 0 ? void 0 : _g.lastInitial)
|
|
108
|
+
: ((_h = data.viewerRank) === null || _h === void 0 ? void 0 : _h.firstName) || ((_j = data.viewerRank) === null || _j === void 0 ? void 0 : _j.lastInitial)
|
|
109
|
+
? ((_k = data.viewerRank) === null || _k === void 0 ? void 0 : _k.firstName) || ((_l = data.viewerRank) === null || _l === void 0 ? void 0 : _l.lastInitial)
|
|
110
|
+
: styles.anonymousUser)),
|
|
111
|
+
h("td", { class: "Score" }, ((_m = data.viewerRank) === null || _m === void 0 ? void 0 : _m.textValue) || "0"))))));
|
|
104
112
|
}
|
|
@@ -9,14 +9,25 @@ import { useLeaderboard } from "./useLeaderboard";
|
|
|
9
9
|
* @uiName Leaderboard
|
|
10
10
|
* @slots [{"name":"empty", "title":"Empty State"}]
|
|
11
11
|
* @requiredFeatures ["LEADERBOARDS"]
|
|
12
|
+
* @validParents ["div"]
|
|
12
13
|
* @exampleGroup Leaderboard
|
|
13
14
|
* @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
15
|
* @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
16
|
* @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
|
+
* @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" imageUrl="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;">The leaderboard highlights the top performers in real-time. Stay motivated, stay competitive!</p></div><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"><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>
|
|
18
|
+
* @example Test - <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>
|
|
16
19
|
* @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>
|
|
17
20
|
*/
|
|
18
21
|
export class Leaderboard {
|
|
19
22
|
constructor() {
|
|
23
|
+
/**
|
|
24
|
+
* @uiName Place text
|
|
25
|
+
*/
|
|
26
|
+
this.width = "100%";
|
|
27
|
+
/**
|
|
28
|
+
* @uiName Rank Suffix
|
|
29
|
+
*/
|
|
30
|
+
this.rankSuffix = "{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}";
|
|
20
31
|
/**
|
|
21
32
|
* Hide the viewer's leaderboard row if not in the top results.
|
|
22
33
|
*
|
|
@@ -24,10 +35,17 @@ export class Leaderboard {
|
|
|
24
35
|
* @default
|
|
25
36
|
*/
|
|
26
37
|
this.hideViewer = false;
|
|
38
|
+
/**
|
|
39
|
+
* Hide the Names of users to protect personal identifiable information
|
|
40
|
+
*
|
|
41
|
+
* @uiName Hide users names
|
|
42
|
+
* @default
|
|
43
|
+
*/
|
|
44
|
+
this.hideNames = false;
|
|
27
45
|
/**
|
|
28
46
|
* Hides the leaderboard if user is on Essentials plan
|
|
29
47
|
*
|
|
30
|
-
* @uiName Hide
|
|
48
|
+
* @uiName Hide leaderboard for essentials user
|
|
31
49
|
* @default
|
|
32
50
|
*/
|
|
33
51
|
this.isEssentials = false;
|
|
@@ -62,8 +80,11 @@ export class Leaderboard {
|
|
|
62
80
|
anonymousUser: this.anonymousUser,
|
|
63
81
|
interval: this.interval,
|
|
64
82
|
hideViewer: this.hideViewer,
|
|
83
|
+
hideNames: this.hideNames,
|
|
65
84
|
showRank: this.showRank,
|
|
66
85
|
isEssentials: this.isEssentials,
|
|
86
|
+
rankSuffix: this.rankSuffix,
|
|
87
|
+
width: this.width,
|
|
67
88
|
};
|
|
68
89
|
const demoProps = { ...props, demoData: this.demoData };
|
|
69
90
|
const viewprops = isDemo()
|
|
@@ -177,6 +198,48 @@ export class Leaderboard {
|
|
|
177
198
|
"attribute": "show-rank",
|
|
178
199
|
"reflect": false
|
|
179
200
|
},
|
|
201
|
+
"width": {
|
|
202
|
+
"type": "string",
|
|
203
|
+
"mutable": false,
|
|
204
|
+
"complexType": {
|
|
205
|
+
"original": "string",
|
|
206
|
+
"resolved": "string",
|
|
207
|
+
"references": {}
|
|
208
|
+
},
|
|
209
|
+
"required": false,
|
|
210
|
+
"optional": false,
|
|
211
|
+
"docs": {
|
|
212
|
+
"tags": [{
|
|
213
|
+
"text": "Place text",
|
|
214
|
+
"name": "uiName"
|
|
215
|
+
}],
|
|
216
|
+
"text": ""
|
|
217
|
+
},
|
|
218
|
+
"attribute": "width",
|
|
219
|
+
"reflect": false,
|
|
220
|
+
"defaultValue": "\"100%\""
|
|
221
|
+
},
|
|
222
|
+
"rankSuffix": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"mutable": false,
|
|
225
|
+
"complexType": {
|
|
226
|
+
"original": "string",
|
|
227
|
+
"resolved": "string",
|
|
228
|
+
"references": {}
|
|
229
|
+
},
|
|
230
|
+
"required": false,
|
|
231
|
+
"optional": false,
|
|
232
|
+
"docs": {
|
|
233
|
+
"tags": [{
|
|
234
|
+
"text": "Rank Suffix",
|
|
235
|
+
"name": "uiName"
|
|
236
|
+
}],
|
|
237
|
+
"text": ""
|
|
238
|
+
},
|
|
239
|
+
"attribute": "rank-suffix",
|
|
240
|
+
"reflect": false,
|
|
241
|
+
"defaultValue": "\"{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}\""
|
|
242
|
+
},
|
|
180
243
|
"hideViewer": {
|
|
181
244
|
"type": "boolean",
|
|
182
245
|
"mutable": false,
|
|
@@ -201,6 +264,30 @@ export class Leaderboard {
|
|
|
201
264
|
"reflect": false,
|
|
202
265
|
"defaultValue": "false"
|
|
203
266
|
},
|
|
267
|
+
"hideNames": {
|
|
268
|
+
"type": "boolean",
|
|
269
|
+
"mutable": false,
|
|
270
|
+
"complexType": {
|
|
271
|
+
"original": "boolean",
|
|
272
|
+
"resolved": "boolean",
|
|
273
|
+
"references": {}
|
|
274
|
+
},
|
|
275
|
+
"required": false,
|
|
276
|
+
"optional": false,
|
|
277
|
+
"docs": {
|
|
278
|
+
"tags": [{
|
|
279
|
+
"text": "Hide users names",
|
|
280
|
+
"name": "uiName"
|
|
281
|
+
}, {
|
|
282
|
+
"text": undefined,
|
|
283
|
+
"name": "default"
|
|
284
|
+
}],
|
|
285
|
+
"text": "Hide the Names of users to protect personal identifiable information"
|
|
286
|
+
},
|
|
287
|
+
"attribute": "hide-names",
|
|
288
|
+
"reflect": false,
|
|
289
|
+
"defaultValue": "false"
|
|
290
|
+
},
|
|
204
291
|
"isEssentials": {
|
|
205
292
|
"type": "boolean",
|
|
206
293
|
"mutable": false,
|
|
@@ -213,7 +300,7 @@ export class Leaderboard {
|
|
|
213
300
|
"optional": true,
|
|
214
301
|
"docs": {
|
|
215
302
|
"tags": [{
|
|
216
|
-
"text": "Hide
|
|
303
|
+
"text": "Hide leaderboard for essentials user",
|
|
217
304
|
"name": "uiName"
|
|
218
305
|
}, {
|
|
219
306
|
"text": undefined,
|
|
@@ -359,7 +446,7 @@ export class Leaderboard {
|
|
|
359
446
|
"mutable": false,
|
|
360
447
|
"complexType": {
|
|
361
448
|
"original": "DemoData<LeaderboardViewProps>",
|
|
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; }; }",
|
|
449
|
+
"resolved": "{ states?: { loading: boolean; hasLeaders: boolean; isEssentials?: boolean; styles: { usersheading: string; statsheading: string; rankheading?: string; showRank?: boolean; hideViewer?: boolean; hideNames?: boolean; anonymousUser?: string; rankSuffix?: string; width?: 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; }; }",
|
|
363
450
|
"references": {
|
|
364
451
|
"DemoData": {
|
|
365
452
|
"location": "import",
|
|
@@ -460,6 +547,9 @@ function useLeaderboardDemo(props) {
|
|
|
460
547
|
: "Anonymous User",
|
|
461
548
|
showRank: props.showRank,
|
|
462
549
|
hideViewer: props.hideViewer,
|
|
550
|
+
hideNames: props.hideNames,
|
|
551
|
+
rankSuffix: props.rankSuffix,
|
|
552
|
+
width: props.width,
|
|
463
553
|
},
|
|
464
554
|
},
|
|
465
555
|
data: {
|