@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.
Files changed (74) hide show
  1. package/dist/cjs/{ShadowViewAddon-721bb748.js → ShadowViewAddon-c3e91cee.js} +55 -30
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mint-components.cjs.js +1 -1
  4. package/dist/cjs/sqm-banking-info-form_16.cjs.entry.js +57 -33
  5. package/dist/cjs/sqm-big-stat_38.cjs.entry.js +64 -23
  6. package/dist/cjs/sqm-empty_4.cjs.entry.js +8 -1
  7. package/dist/cjs/{sqm-portal-container-view-5fb2ad49.js → sqm-portal-container-view-990a85a3.js} +1 -1
  8. package/dist/cjs/sqm-stencilbook.cjs.entry.js +153 -30
  9. package/dist/collection/components/sqm-empty/EmptyState.stories.js +1 -1
  10. package/dist/collection/components/sqm-image/sqm-image-view.js +1 -1
  11. package/dist/collection/components/sqm-image/sqm-image.js +20 -0
  12. package/dist/collection/components/sqm-leaderboard/Leaderboard.stories.js +130 -24
  13. package/dist/collection/components/sqm-leaderboard/sqm-leaderboard-view.js +55 -29
  14. package/dist/collection/components/sqm-leaderboard/sqm-leaderboard.js +93 -29
  15. package/dist/collection/components/sqm-leaderboard/useLeaderboard.js +40 -4
  16. package/dist/collection/components/sqm-portal-container/PortalContainer.stories.js +12 -0
  17. package/dist/collection/components/sqm-portal-container/sqm-portal-container-view.js +1 -1
  18. package/dist/collection/components/sqm-portal-container/sqm-portal-container.js +37 -0
  19. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.js +2 -1
  20. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +55 -32
  21. package/dist/esm/{ShadowViewAddon-31eb5b16.js → ShadowViewAddon-e012b2aa.js} +55 -30
  22. package/dist/esm/loader.js +1 -1
  23. package/dist/esm/mint-components.js +1 -1
  24. package/dist/esm/sqm-banking-info-form_16.entry.js +57 -33
  25. package/dist/esm/sqm-big-stat_38.entry.js +64 -23
  26. package/dist/esm/sqm-empty_4.entry.js +8 -1
  27. package/dist/esm/{sqm-portal-container-view-ab89c6cc.js → sqm-portal-container-view-6c582684.js} +1 -1
  28. package/dist/esm/sqm-stencilbook.entry.js +153 -30
  29. package/dist/esm-es5/ShadowViewAddon-e012b2aa.js +1 -0
  30. package/dist/esm-es5/loader.js +1 -1
  31. package/dist/esm-es5/mint-components.js +1 -1
  32. package/dist/esm-es5/sqm-banking-info-form_16.entry.js +1 -1
  33. package/dist/esm-es5/sqm-big-stat_38.entry.js +1 -1
  34. package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
  35. package/dist/esm-es5/sqm-portal-container-view-6c582684.js +1 -0
  36. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  37. package/dist/mint-components/mint-components.esm.js +1 -1
  38. package/dist/mint-components/{p-d6474614.js → p-10685090.js} +23 -23
  39. package/dist/mint-components/p-2ffefa3b.entry.js +223 -0
  40. package/dist/mint-components/{p-b45ba369.entry.js → p-31e810e9.entry.js} +2 -2
  41. package/dist/mint-components/p-5de21018.system.entry.js +1 -0
  42. package/dist/mint-components/p-7497a4f6.system.entry.js +1 -0
  43. package/dist/mint-components/{p-bf723ae9.entry.js → p-81689347.entry.js} +2 -2
  44. package/dist/mint-components/p-84361da0.system.entry.js +1 -0
  45. package/dist/mint-components/p-95771f79.system.js +1 -0
  46. package/dist/mint-components/p-9f0629ba.system.entry.js +1 -0
  47. package/dist/mint-components/{p-e704842c.js → p-c7fd9e16.js} +1 -1
  48. package/dist/mint-components/p-d8d2de11.entry.js +1 -0
  49. package/dist/mint-components/p-ed17e637.system.js +1 -1
  50. package/dist/mint-components/p-ed6ebd60.system.js +1 -0
  51. package/dist/types/components/sqm-image/sqm-image-view.d.ts +1 -0
  52. package/dist/types/components/sqm-image/sqm-image.d.ts +5 -0
  53. package/dist/types/components/sqm-leaderboard/Leaderboard.stories.d.ts +5 -1
  54. package/dist/types/components/sqm-leaderboard/sqm-leaderboard-view.d.ts +6 -4
  55. package/dist/types/components/sqm-leaderboard/sqm-leaderboard.d.ts +23 -6
  56. package/dist/types/components/sqm-leaderboard/useLeaderboard.d.ts +4 -2
  57. package/dist/types/components/sqm-portal-container/PortalContainer.stories.d.ts +1 -0
  58. package/dist/types/components/sqm-portal-container/sqm-portal-container-view.d.ts +1 -0
  59. package/dist/types/components/sqm-portal-container/sqm-portal-container.d.ts +7 -0
  60. package/dist/types/components.d.ts +64 -12
  61. package/docs/docs.docx +0 -0
  62. package/docs/raisins.json +1 -1
  63. package/grapesjs/grapesjs.js +1 -1
  64. package/package.json +2 -2
  65. package/dist/esm-es5/ShadowViewAddon-31eb5b16.js +0 -1
  66. package/dist/esm-es5/sqm-portal-container-view-ab89c6cc.js +0 -1
  67. package/dist/mint-components/p-0d39c815.system.entry.js +0 -1
  68. package/dist/mint-components/p-1fe65a36.entry.js +0 -1
  69. package/dist/mint-components/p-27bd5535.entry.js +0 -187
  70. package/dist/mint-components/p-34fd1229.system.entry.js +0 -1
  71. package/dist/mint-components/p-922578e4.system.js +0 -1
  72. package/dist/mint-components/p-b567780d.system.js +0 -1
  73. package/dist/mint-components/p-c34a507e.system.entry.js +0 -1
  74. 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,
@@ -116,7 +116,8 @@ const style = {
116
116
  background: "var(--sl-color-gray-200)",
117
117
  },
118
118
  LargeSkeleton: {
119
- width: "320px",
119
+ width: "100%",
120
+ maxWidth: "320px",
120
121
  height: "40px",
121
122
  borderRadius: "50px",
122
123
  background: "var(--sl-color-gray-200)",
@@ -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: 450px;
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", { style: { display: "flex", gap: "4px" } },
195
- h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", label: text.phoneNumber, style: { minWidth: "140px" }, 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) ? {
196
- class: classes.ErrorInput,
197
- }
198
- : {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
199
- h("sl-input", { class: classes.SearchInput, placeholder: text.searchForCountryText, onKeyDown: (e) => {
200
- // Stop shoelace intercepting key presses
201
- e.stopPropagation();
202
- }, "onSl-input": (e) => {
203
- callbacks.setPhoneCountrySearch(e.target.value);
204
- } }), (_h = data === null || data === void 0 ? void 0 : data.phoneCountries) === null || _h === void 0 ? void 0 :
205
- _h.map((c) => {
206
- var _a, _b;
207
- return (h("sl-menu-item", { style: { width: "500px" }, value: c.countryCode },
208
- h("div", { slot: "prefix", style: { marginRight: "8px" } }, `${(_a = PHONE_EXTENSIONS[c.countryCode]) === null || _a === void 0 ? void 0 : _a.name} `), (_b = PHONE_EXTENSIONS[c.countryCode]) === null || _b === void 0 ? void 0 :
209
- _b.dial_code));
210
- }), (_j = data === null || data === void 0 ? void 0 : data.allCountries) === null || _j === void 0 ? void 0 :
211
- _j.map((c) => {
212
- var _a, _b;
213
- return (h("sl-menu-item", { value: c.countryCode, style: { display: "none" } },
214
- h("div", { slot: "prefix", style: { marginRight: "8px" } }, `${(_a = PHONE_EXTENSIONS[c.countryCode]) === null || _a === void 0 ? void 0 : _a.name} `), (_b = PHONE_EXTENSIONS[c.countryCode]) === null || _b === void 0 ? void 0 :
215
- _b.dial_code));
216
- })),
217
- h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: " ", id: "phoneNumber", name: "/phoneNumber", value: formState.phoneNumber, style: { marginTop: "2px", width: "362px" }, validationError: ({ value }) =>
218
- // Naive phone number validation
219
- validateBillingField(/[a-zA-Z]+/, value) &&
220
- formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError), disabled: states.disabled || states.isPartner }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
221
- class: classes.ErrorInput,
222
- helpText: formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
223
- }
224
- : {}), { required: true }))),
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-ab89c6cc.js';
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: "center",
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, _d, _e, _f, _g, _h, _j, _k, _l;
147
+ var _a, _b, _c;
141
148
  const { states, data, elements } = props;
142
149
  const { styles } = states;
143
- if (states.loading)
144
- return (h("div", { class: sheet$1.classes.Leaderboard },
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
- elements.loadingstate));
149
- if (states.isEssentials)
150
- return elements.essentials;
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
- return (h("div", { class: sheet$1.classes.Leaderboard, part: "sqm-base" },
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: "Rank" }, styles.rankheading),
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
- return (h("tr", { class: !styles.hideViewer &&
169
- user.rowNumber === ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rowNumber)
170
- ? "highlight"
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" }, ((_c = data.viewerRank) === null || _c === void 0 ? void 0 : _c.firstName) && ((_d = data.viewerRank) === null || _d === void 0 ? void 0 : _d.lastInitial)
186
- ? ((_e = data.viewerRank) === null || _e === void 0 ? void 0 : _e.firstName) +
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 = {