@saasquatch/mint-components 1.10.2-9 → 1.10.3-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-721bb748.js → ShadowViewAddon-c3e91cee.js} +55 -30
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-banking-info-form_16.cjs.entry.js +57 -33
- package/dist/cjs/sqm-big-stat_38.cjs.entry.js +64 -23
- package/dist/cjs/sqm-empty_4.cjs.entry.js +8 -1
- package/dist/cjs/{sqm-portal-container-view-5fb2ad49.js → sqm-portal-container-view-990a85a3.js} +1 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +153 -30
- 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 +20 -0
- package/dist/collection/components/sqm-leaderboard/Leaderboard.stories.js +130 -24
- package/dist/collection/components/sqm-leaderboard/sqm-leaderboard-view.js +55 -29
- package/dist/collection/components/sqm-leaderboard/sqm-leaderboard.js +93 -29
- package/dist/collection/components/sqm-leaderboard/useLeaderboard.js +40 -4
- package/dist/collection/components/sqm-portal-container/PortalContainer.stories.js +12 -0
- 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 +37 -0
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.js +2 -1
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +55 -32
- package/dist/esm/{ShadowViewAddon-31eb5b16.js → ShadowViewAddon-e012b2aa.js} +55 -30
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-banking-info-form_16.entry.js +57 -33
- package/dist/esm/sqm-big-stat_38.entry.js +64 -23
- package/dist/esm/sqm-empty_4.entry.js +8 -1
- package/dist/esm/{sqm-portal-container-view-ab89c6cc.js → sqm-portal-container-view-6c582684.js} +1 -1
- package/dist/esm/sqm-stencilbook.entry.js +153 -30
- package/dist/esm-es5/ShadowViewAddon-e012b2aa.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-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-portal-container-view-6c582684.js +1 -0
- 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-d6474614.js → p-10685090.js} +23 -23
- package/dist/mint-components/p-2ffefa3b.entry.js +223 -0
- package/dist/mint-components/{p-b45ba369.entry.js → p-31e810e9.entry.js} +2 -2
- package/dist/mint-components/p-5de21018.system.entry.js +1 -0
- package/dist/mint-components/p-7497a4f6.system.entry.js +1 -0
- package/dist/mint-components/{p-bf723ae9.entry.js → p-81689347.entry.js} +2 -2
- package/dist/mint-components/p-84361da0.system.entry.js +1 -0
- package/dist/mint-components/p-95771f79.system.js +1 -0
- package/dist/mint-components/p-9f0629ba.system.entry.js +1 -0
- package/dist/mint-components/{p-e704842c.js → p-c7fd9e16.js} +1 -1
- package/dist/mint-components/p-d8d2de11.entry.js +1 -0
- package/dist/mint-components/p-ed17e637.system.js +1 -1
- package/dist/mint-components/p-ed6ebd60.system.js +1 -0
- 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 +5 -1
- package/dist/types/components/sqm-leaderboard/sqm-leaderboard-view.d.ts +6 -4
- package/dist/types/components/sqm-leaderboard/sqm-leaderboard.d.ts +23 -6
- package/dist/types/components/sqm-leaderboard/useLeaderboard.d.ts +4 -2
- package/dist/types/components/sqm-portal-container/PortalContainer.stories.d.ts +1 -0
- package/dist/types/components/sqm-portal-container/sqm-portal-container-view.d.ts +1 -0
- package/dist/types/components/sqm-portal-container/sqm-portal-container.d.ts +7 -0
- package/dist/types/components.d.ts +64 -12
- 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/esm-es5/sqm-portal-container-view-ab89c6cc.js +0 -1
- package/dist/mint-components/p-0d39c815.system.entry.js +0 -1
- package/dist/mint-components/p-1fe65a36.entry.js +0 -1
- package/dist/mint-components/p-27bd5535.entry.js +0 -187
- package/dist/mint-components/p-34fd1229.system.entry.js +0 -1
- package/dist/mint-components/p-922578e4.system.js +0 -1
- package/dist/mint-components/p-b567780d.system.js +0 -1
- package/dist/mint-components/p-c34a507e.system.entry.js +0 -1
- package/dist/mint-components/p-f1a1e7f3.system.entry.js +0 -1
|
@@ -81,6 +81,18 @@ export const SpaceEvenly = () => {
|
|
|
81
81
|
h("p", null, "Points Balance")))),
|
|
82
82
|
h("sqm-scroll", { "scroll-id": "tab-2", outline: true, "button-type": "primary", "button-text": "Redeem your rewards", mobile: true }))));
|
|
83
83
|
};
|
|
84
|
+
export const ResponsiveBox = () => {
|
|
85
|
+
return (h("div", { style: { width: "100%", maxWidth: "1000px", border: "1px dashed grey" } },
|
|
86
|
+
h("sqm-portal-container", { center: true, direction: "row", display: "flex", "justify-content": "space-between", "flex-wrap": "nowrap" },
|
|
87
|
+
h("sqm-stat-container", { space: "xxx-large", display: "flex" },
|
|
88
|
+
h("sqm-big-stat", { "flex-reverse": "true", alignment: "left", "stat-type": "/rewardsRedeemed/CREDIT/global" },
|
|
89
|
+
h("sqm-text", null,
|
|
90
|
+
h("p", null, "Rewards Redeemed"))),
|
|
91
|
+
h("sqm-big-stat", { "flex-reverse": "true", alignment: "left", "stat-type": "/rewardBalance/CREDIT/POINT/value/global" },
|
|
92
|
+
h("sqm-text", null,
|
|
93
|
+
h("p", null, "Points Balance")))),
|
|
94
|
+
h("sqm-scroll", { "scroll-id": "tab-2", outline: true, "button-type": "primary", "button-text": "Redeem your rewards", mobile: true }))));
|
|
95
|
+
};
|
|
84
96
|
export const Start = () => {
|
|
85
97
|
return (h("div", { style: { width: "1000px", border: "1px dashed grey" } },
|
|
86
98
|
h("sqm-portal-container", { center: true, direction: "row", display: "flex", "justify-content": "start" },
|
|
@@ -5,7 +5,7 @@ export function PortalContainerView(props, children) {
|
|
|
5
5
|
Container: {
|
|
6
6
|
boxSizing: "border-box",
|
|
7
7
|
display: props.display || "grid",
|
|
8
|
-
flexWrap: "wrap",
|
|
8
|
+
flexWrap: props.flexWrap || "wrap",
|
|
9
9
|
"grid-template-columns": props.direction === "row"
|
|
10
10
|
? `repeat(auto-fill, minmax(${props.minWidth}, auto))`
|
|
11
11
|
: "100%",
|
|
@@ -37,6 +37,13 @@ export class PortalContainer {
|
|
|
37
37
|
* @uiName Maximum width
|
|
38
38
|
*/
|
|
39
39
|
this.maxWidth = "100%";
|
|
40
|
+
/**
|
|
41
|
+
* @uiName Flex wrap behavior
|
|
42
|
+
* @uiType string
|
|
43
|
+
* @uiEnum ["wrap", "nowrap"]
|
|
44
|
+
* @uiEnumNames ["Wrap", "No Wrap"]
|
|
45
|
+
*/
|
|
46
|
+
this.flexWrap = "wrap";
|
|
40
47
|
/**
|
|
41
48
|
* @uiName Background color
|
|
42
49
|
* @uiWidget color
|
|
@@ -253,6 +260,36 @@ export class PortalContainer {
|
|
|
253
260
|
"reflect": false,
|
|
254
261
|
"defaultValue": "\"100%\""
|
|
255
262
|
},
|
|
263
|
+
"flexWrap": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"mutable": false,
|
|
266
|
+
"complexType": {
|
|
267
|
+
"original": "string",
|
|
268
|
+
"resolved": "string",
|
|
269
|
+
"references": {}
|
|
270
|
+
},
|
|
271
|
+
"required": false,
|
|
272
|
+
"optional": true,
|
|
273
|
+
"docs": {
|
|
274
|
+
"tags": [{
|
|
275
|
+
"text": "Flex wrap behavior",
|
|
276
|
+
"name": "uiName"
|
|
277
|
+
}, {
|
|
278
|
+
"text": "string",
|
|
279
|
+
"name": "uiType"
|
|
280
|
+
}, {
|
|
281
|
+
"text": "[\"wrap\", \"nowrap\"]",
|
|
282
|
+
"name": "uiEnum"
|
|
283
|
+
}, {
|
|
284
|
+
"text": "[\"Wrap\", \"No Wrap\"]",
|
|
285
|
+
"name": "uiEnumNames"
|
|
286
|
+
}],
|
|
287
|
+
"text": ""
|
|
288
|
+
},
|
|
289
|
+
"attribute": "flex-wrap",
|
|
290
|
+
"reflect": false,
|
|
291
|
+
"defaultValue": "\"wrap\""
|
|
292
|
+
},
|
|
256
293
|
"center": {
|
|
257
294
|
"type": "boolean",
|
|
258
295
|
"mutable": false,
|
package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js
CHANGED
|
@@ -83,6 +83,27 @@ const style = {
|
|
|
83
83
|
color: "var(--sl-color-neutral-500)",
|
|
84
84
|
fontSize: "var(--sl-font-size-medium)",
|
|
85
85
|
},
|
|
86
|
+
PhoneInputsSection: {
|
|
87
|
+
display: "flex",
|
|
88
|
+
alignItems: "flex-start",
|
|
89
|
+
flexDirection: "column",
|
|
90
|
+
gap: "4px",
|
|
91
|
+
"& p": {
|
|
92
|
+
fontSize: "var(--sl-font-size-small)",
|
|
93
|
+
color: "var(--sl-input-label-color)",
|
|
94
|
+
fontWeight: "var(--sl-font-weight-semibold)",
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
PhoneInputsContainer: {
|
|
98
|
+
display: "flex",
|
|
99
|
+
alignItems: "flex-start",
|
|
100
|
+
gap: "4px",
|
|
101
|
+
width: "100%",
|
|
102
|
+
"& #phoneNumber": {
|
|
103
|
+
width: "100%",
|
|
104
|
+
minWidth: "0px",
|
|
105
|
+
},
|
|
106
|
+
},
|
|
86
107
|
};
|
|
87
108
|
const sheet = createStyleSheet(style);
|
|
88
109
|
const styleString = sheet.toString();
|
|
@@ -108,7 +129,7 @@ const vanillaStyle = `
|
|
|
108
129
|
}
|
|
109
130
|
|
|
110
131
|
sl-select#phoneNumberCountryCode::part(menu) {
|
|
111
|
-
width:
|
|
132
|
+
min-width: 250px;
|
|
112
133
|
}
|
|
113
134
|
`;
|
|
114
135
|
export const UserInfoFormView = (props) => {
|
|
@@ -191,37 +212,39 @@ export const UserInfoFormView = (props) => {
|
|
|
191
212
|
} }), (_e = data === null || data === void 0 ? void 0 : data.countries) === null || _e === void 0 ? void 0 :
|
|
192
213
|
_e.map((c) => (h("sl-menu-item", { value: c.countryCode }, c.displayName))), (_f = data === null || data === void 0 ? void 0 : data.allCountries) === null || _f === void 0 ? void 0 :
|
|
193
214
|
_f.map((c) => (h("sl-menu-item", { value: c.countryCode, style: { display: "none" } }, c.displayName)))),
|
|
194
|
-
h("div", {
|
|
195
|
-
h("
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
215
|
+
h("div", { class: classes.PhoneInputsSection },
|
|
216
|
+
h("p", null, text.phoneNumber),
|
|
217
|
+
h("div", { class: classes.PhoneInputsContainer },
|
|
218
|
+
h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled || states.isPartner, ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
|
|
219
|
+
class: classes.ErrorInput,
|
|
220
|
+
}
|
|
221
|
+
: {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
|
|
222
|
+
h("sl-input", { class: classes.SearchInput, placeholder: text.searchForCountryText, onKeyDown: (e) => {
|
|
223
|
+
// Stop shoelace intercepting key presses
|
|
224
|
+
e.stopPropagation();
|
|
225
|
+
}, "onSl-input": (e) => {
|
|
226
|
+
callbacks.setPhoneCountrySearch(e.target.value);
|
|
227
|
+
} }), (_h = data === null || data === void 0 ? void 0 : data.phoneCountries) === null || _h === void 0 ? void 0 :
|
|
228
|
+
_h.map((c) => {
|
|
229
|
+
var _a, _b;
|
|
230
|
+
return (h("sl-menu-item", { value: c.countryCode },
|
|
231
|
+
h("div", { slot: "prefix" }, `${(_a = PHONE_EXTENSIONS[c.countryCode]) === null || _a === void 0 ? void 0 : _a.name} `), (_b = PHONE_EXTENSIONS[c.countryCode]) === null || _b === void 0 ? void 0 :
|
|
232
|
+
_b.dial_code));
|
|
233
|
+
}), (_j = data === null || data === void 0 ? void 0 : data.allCountries) === null || _j === void 0 ? void 0 :
|
|
234
|
+
_j.map((c) => {
|
|
235
|
+
var _a, _b;
|
|
236
|
+
return (h("sl-menu-item", { value: c.countryCode, style: { display: "none" } },
|
|
237
|
+
h("div", { slot: "prefix" }, `${(_a = PHONE_EXTENSIONS[c.countryCode]) === null || _a === void 0 ? void 0 : _a.name} `), (_b = PHONE_EXTENSIONS[c.countryCode]) === null || _b === void 0 ? void 0 :
|
|
238
|
+
_b.dial_code));
|
|
239
|
+
})),
|
|
240
|
+
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", id: "phoneNumber", name: "/phoneNumber", value: formState.phoneNumber, validationError: ({ value }) =>
|
|
241
|
+
// Naive phone number validation
|
|
242
|
+
validateBillingField(/[a-zA-Z]+/, value) &&
|
|
243
|
+
formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError), disabled: states.disabled || states.isPartner }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
|
|
244
|
+
class: classes.ErrorInput,
|
|
245
|
+
helpText: formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
|
|
246
|
+
}
|
|
247
|
+
: {}), { required: true })))),
|
|
225
248
|
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.address, id: "address", name: "/address", value: formState.address, validationError: ({ value }) =>
|
|
226
249
|
// Checks for non-ASCII characters
|
|
227
250
|
!validateBillingField(/^[\x20-\xFF]+$/, value) &&
|
|
@@ -11,7 +11,7 @@ import { l as luxonLocale } from './utils-334c1e34.js';
|
|
|
11
11
|
import { T as TextSpanView } from './sqm-text-span-view-8d140661.js';
|
|
12
12
|
import { p as pathToRegexp } from './index-ffa26b43.js';
|
|
13
13
|
import { a as isValidColor, b as isMobile } from './utilities-3f5bba22.js';
|
|
14
|
-
import { a as PortalSectionView, P as PortalContainerView } from './sqm-portal-container-view-
|
|
14
|
+
import { a as PortalSectionView, P as PortalContainerView } from './sqm-portal-container-view-6c582684.js';
|
|
15
15
|
|
|
16
16
|
const medium = {
|
|
17
17
|
facebook: { color: "#1877f2", text: "#fff", icon: "facebook" },
|
|
@@ -109,9 +109,10 @@ const style$1 = {
|
|
|
109
109
|
fontWeight: "var(--sl-font-weight-normal)",
|
|
110
110
|
},
|
|
111
111
|
"& .ellipses": {
|
|
112
|
-
textAlign: "
|
|
112
|
+
textAlign: "left",
|
|
113
113
|
padding: "0",
|
|
114
114
|
color: "var(--sl-color-neutral-500)",
|
|
115
|
+
paddingLeft: "25%",
|
|
115
116
|
},
|
|
116
117
|
"& .highlight": {
|
|
117
118
|
background: "var(--sl-color-primary-50)",
|
|
@@ -127,6 +128,12 @@ const style$1 = {
|
|
|
127
128
|
width: "auto",
|
|
128
129
|
whiteSpace: "nowrap",
|
|
129
130
|
},
|
|
131
|
+
"& .Rank": {
|
|
132
|
+
whiteSpace: "nowrap",
|
|
133
|
+
},
|
|
134
|
+
"& .fullWidth": {
|
|
135
|
+
width: "100%",
|
|
136
|
+
},
|
|
130
137
|
},
|
|
131
138
|
};
|
|
132
139
|
const sheet$1 = createStyleSheet(style$1);
|
|
@@ -137,58 +144,76 @@ const vanillaStyle = `
|
|
|
137
144
|
}
|
|
138
145
|
`;
|
|
139
146
|
function LeaderboardView(props) {
|
|
140
|
-
var _a, _b, _c
|
|
147
|
+
var _a, _b, _c;
|
|
141
148
|
const { states, data, elements } = props;
|
|
142
149
|
const { styles } = states;
|
|
143
|
-
if (states.
|
|
144
|
-
return (h("
|
|
150
|
+
if (states.isEssentials) {
|
|
151
|
+
return (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" }));
|
|
152
|
+
}
|
|
153
|
+
if (states.loading) {
|
|
154
|
+
return (h("div", { class: sheet$1.classes.Leaderboard, style: { width: styles.width || "100%" } },
|
|
145
155
|
h("style", { type: "text/css" },
|
|
146
156
|
styleString$1,
|
|
147
157
|
vanillaStyle),
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
158
|
+
h("table", null, [...Array(10)].map(() => {
|
|
159
|
+
return (h("tr", null,
|
|
160
|
+
h("td", null,
|
|
161
|
+
h("sl-skeleton", null))));
|
|
162
|
+
}))));
|
|
163
|
+
}
|
|
151
164
|
if (!states.hasLeaders)
|
|
152
165
|
return elements.empty;
|
|
153
166
|
let userSeenFlag = false;
|
|
154
|
-
|
|
167
|
+
const getUsersName = (user) => {
|
|
168
|
+
if (!user.firstName && !user.lastInitial)
|
|
169
|
+
return styles.anonymousUser;
|
|
170
|
+
const { firstName, lastInitial } = user;
|
|
171
|
+
if (firstName && lastInitial)
|
|
172
|
+
return `${firstName} ${lastInitial}`;
|
|
173
|
+
if (firstName || lastInitial)
|
|
174
|
+
return firstName || lastInitial;
|
|
175
|
+
return styles.anonymousUser;
|
|
176
|
+
};
|
|
177
|
+
const getRankCellText = (userRank, isViewingUsersRow) => {
|
|
178
|
+
if (!userRank) {
|
|
179
|
+
return styles.hideNames ? `${styles.viewingUserText}` : "-";
|
|
180
|
+
}
|
|
181
|
+
const viewingUserText = ` - ${styles.viewingUserText}`;
|
|
182
|
+
return styles.rankSuffix
|
|
183
|
+
? intl.formatMessage({
|
|
184
|
+
id: "rank",
|
|
185
|
+
defaultMessage: styles.rankSuffix,
|
|
186
|
+
}, {
|
|
187
|
+
rank: userRank,
|
|
188
|
+
}) + `${isViewingUsersRow && styles.hideNames ? viewingUserText : ""}`
|
|
189
|
+
: `${userRank} ${isViewingUsersRow && styles.hideNames ? viewingUserText : ""}`;
|
|
190
|
+
};
|
|
191
|
+
return (h("div", { class: sheet$1.classes.Leaderboard, part: "sqm-base", style: { width: styles.width || "100%" } },
|
|
155
192
|
h("style", { type: "text/css" },
|
|
156
193
|
styleString$1,
|
|
157
194
|
vanillaStyle),
|
|
158
|
-
h("div", null, "Leaderboards"),
|
|
159
195
|
h("table", { part: "sqm-table" },
|
|
160
196
|
h("tr", null,
|
|
161
|
-
styles.showRank && h("th", { class:
|
|
162
|
-
h("th", { class: "User" }, styles.usersheading),
|
|
197
|
+
styles.showRank && (h("th", { class: `Rank ${styles.hideNames ? "fullWidth" : ""}` }, styles.rankheading)),
|
|
198
|
+
!styles.hideNames && h("th", { class: "User" }, styles.usersheading),
|
|
163
199
|
h("th", { class: "Score" }, styles.statsheading)), (_a = data.leaderboard) === null || _a === void 0 ? void 0 :
|
|
164
200
|
_a.map((user) => {
|
|
165
201
|
var _a, _b;
|
|
166
202
|
if (user.rowNumber === ((_a = data.viewerRank) === null || _a === void 0 ? void 0 : _a.rowNumber))
|
|
167
203
|
userSeenFlag = true;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
styles.showRank && h("td", { class: "Rank" }, user.rank),
|
|
173
|
-
h("td", { class: "User" }, user.firstName && user.lastInitial
|
|
174
|
-
? user.firstName + " " + user.lastInitial
|
|
175
|
-
: user.firstName || user.lastInitial
|
|
176
|
-
? user.firstName || user.lastInitial
|
|
177
|
-
: styles.anonymousUser),
|
|
204
|
+
const isViewingUsersRow = !styles.hideViewer && user.rowNumber === ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rowNumber);
|
|
205
|
+
return (h("tr", { class: isViewingUsersRow ? "highlight" : "" },
|
|
206
|
+
styles.showRank && (h("td", { class: "Rank" }, getRankCellText(user.rank, isViewingUsersRow))),
|
|
207
|
+
!styles.hideNames && h("td", { class: "User" }, getUsersName(user)),
|
|
178
208
|
h("td", { class: "Score" }, user.textValue)));
|
|
179
209
|
}),
|
|
180
210
|
!userSeenFlag && !styles.hideViewer && (h("tr", null,
|
|
181
211
|
h("td", { colSpan: 100, class: "ellipses" },
|
|
182
212
|
h("sl-icon", { name: "three-dots", style: { verticalAlign: "middle" } })))),
|
|
183
213
|
!userSeenFlag && !styles.hideViewer && (h("tr", { class: "highlight" },
|
|
184
|
-
styles.showRank && (h("td", { class: "Rank" }, ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rank
|
|
185
|
-
h("td", { class: "User" }, (
|
|
186
|
-
|
|
187
|
-
" " + ((_f = data.viewerRank) === null || _f === void 0 ? void 0 : _f.lastInitial)
|
|
188
|
-
: ((_g = data.viewerRank) === null || _g === void 0 ? void 0 : _g.firstName) || ((_h = data.viewerRank) === null || _h === void 0 ? void 0 : _h.lastInitial)
|
|
189
|
-
? ((_j = data.viewerRank) === null || _j === void 0 ? void 0 : _j.firstName) || ((_k = data.viewerRank) === null || _k === void 0 ? void 0 : _k.lastInitial)
|
|
190
|
-
: styles.anonymousUser),
|
|
191
|
-
h("td", { class: "Score" }, ((_l = data.viewerRank) === null || _l === void 0 ? void 0 : _l.textValue) || "0"))))));
|
|
214
|
+
styles.showRank && (h("td", { class: "Rank" }, getRankCellText((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rank, true))),
|
|
215
|
+
!styles.hideNames && (h("td", { class: "User" }, getUsersName(data.viewerRank || {}))),
|
|
216
|
+
h("td", { class: "Score" }, ((_c = data.viewerRank) === null || _c === void 0 ? void 0 : _c.textValue) || "0"))))));
|
|
192
217
|
}
|
|
193
218
|
|
|
194
219
|
const style$2 = {
|