@everymatrix/casino-tournaments-table 0.0.245 → 0.0.249

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-tournaments-table",
3
- "version": "0.0.245",
3
+ "version": "0.0.249",
4
4
  "main": "dist/casino-tournaments-table.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "d96554d716d8c3b41f947c85c9b8cae8f03aa5bf"
39
+ "gitHead": "38af455e241b6ef7ccabb2367be2be59e6b24352"
40
40
  }
@@ -39,6 +39,17 @@
39
39
  columns = e.data.tableColumns;
40
40
  }
41
41
 
42
+ // set view after current user row defined.
43
+ if (e.data && e.data.type === 'CasinoTableCurrentUserData'){
44
+ if(data){
45
+ data.forEach(item => {
46
+ if(item.userID == e.data.tableData.userID){
47
+ item.isCurrentUser = true;
48
+ }
49
+ });
50
+ display = data;
51
+ }
52
+ }
42
53
  if (firstrow) {
43
54
  if (e.data && e.data.type === 'CasinoTableFirstRowData') {
44
55
  firstRowData = e.data.tableData;
@@ -132,67 +143,63 @@
132
143
 
133
144
  {#if data.length > 0 || firstRowData}
134
145
  {#if isMobile(userAgent) == true}
135
- <div class="LeaderboardContainer" part="LeaderboardContainer">
136
- <div class="Leaderboard" part="Leaderboard">{$_('tournamentsTable.leaderboard')}</div>
137
- <div class="RightButton { isMobile(userAgent) ? 'MobileClass' : '' }" part="RightButton { isMobile(userAgent) ? 'MobileClass' : '' }">
138
- <div class="CollapseButton" part="CollapseButton" on:click={() => collapseTable()}>
139
- {#if showTable}
140
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
141
- <path d="M18 15l-6-6-6 6"/>
142
- </svg>
146
+ <div class="TableContent" part="TableContent">
147
+ <div class="TableUser TableHeadRow" part="TableHeadRow">
148
+ {#each columns as column}
149
+ <div class="TableCell Table{column}">
150
+ {#if sortable == 'true'}
151
+ <button on:click={() => sortBy(column)} data-sort={sort}>
152
+ {$_(`tournamentsTable.${column}`)}
153
+ </button>
154
+ {:else}
155
+ <p data-sort={sort}>{$_(`tournamentsTable.${column}`)}</p>
156
+ {/if}
157
+ </div>
158
+ {/each}
159
+ </div>
160
+ {#if firstrow == 'true' && firstRowData}
161
+ <div class="TableUser CurrentUserRow {firstRowData.Unqualified ? 'UnqualifiedRow' : ''}" part="TableUser">
162
+ <div class="TableCell TableRank {firstRowData.Prize? 'Qualified' : ''}">{firstRowData.Rank}</div>
163
+ <div class="TableCell TablePlayer">{firstRowData.Player}</div>
164
+ <div class="TableCell TablePoints">{firstRowData.Points}</div>
165
+ {#if firstRowData.Prize}
166
+ <div class="TableCell TablePrize {!firstRowData.Unqualified? 'Qualified' : ''}">{firstRowData.Prize}</div>
143
167
  {:else}
144
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
145
- <path d="M6 9l6 6 6-6"/>
146
- </svg>
168
+ <div class="TableCell TablePrize">-</div>
147
169
  {/if}
148
170
  </div>
149
- </div>
150
- </div>
151
-
152
- {#if firstrow == 'true' && firstRowData}
153
- <div class="TableContent TableContentFirstRow" part="TableContent TableContentFirstRow">
154
- <div class="TableUser" part="TableUser"><span>{firstRowData.Position}</span><span>{firstRowData.Name}</span></div>
155
-
156
- <div class="TableUserDetails" part="TableUserDetails">
157
- <div>
158
- <p>{$_('tournamentsTable.score')}</p>
159
- <p>{firstRowData.Score}</p>
160
- </div>
161
- <!-- <div>
162
- <p>{$_('tournamentsTable.betcounts')}</p>
163
- <p>{firstRowData.Score}</p>
164
- </div>
165
- <div>
166
- <p>{$_('tournamentsTable.qualified')}</p>
167
- <p>{firstRowData.Score}</p>
168
- </div> -->
171
+ {#if firstRowData.Unqualified}
172
+ <div class="TableUserTooltips" part="TableUserTooltips">
173
+ <svg class="ExclamationMark" width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
174
+ <path d="M9.03087 3.14062C8.71521 2.56443 8.27722 2.06437 7.74767 1.67553C7.21811 1.28669 6.60971 1.01855 5.96544 0.889885C5.32118 0.761222 4.65646 0.775158 4.01817 0.930778C3.37988 1.0864 2.78361 1.37989 2.27086 1.79064C1.68689 2.25306 1.22358 2.85008 0.920762 3.53063C0.679091 4.08921 0.556377 4.69205 0.560655 5.30065C0.562354 5.92327 0.693172 6.53873 0.944444 7.10839C1.19572 7.67806 1.5622 8.18953 2.02086 8.61059C2.83307 9.36649 3.89773 9.79259 5.00719 9.80553C6.11665 9.81848 7.19124 9.4174 8.02086 8.68066C8.3779 8.38276 8.67913 8.0238 8.91075 7.6206C9.34355 6.92428 9.57213 6.12051 9.57066 5.30065C9.57316 4.54694 9.38776 3.80448 9.03087 3.14062V3.14062ZM4.43077 7.39062C4.41666 7.24208 4.44786 7.09281 4.52013 6.96227C4.59239 6.83174 4.70243 6.72606 4.8358 6.65917C4.96917 6.59228 5.11961 6.56724 5.26744 6.58739C5.41528 6.60754 5.55357 6.67195 5.66417 6.77209C5.77477 6.87223 5.85238 7.00344 5.88707 7.14855C5.92176 7.29367 5.91186 7.44586 5.85851 7.5852C5.80516 7.72454 5.71098 7.84448 5.58824 7.92931C5.46551 8.01415 5.31996 8.05999 5.17076 8.06066C5.0777 8.06746 4.9841 8.05526 4.89586 8.02489C4.80762 7.99453 4.72651 7.94653 4.65733 7.8839C4.58816 7.82127 4.53247 7.74531 4.49352 7.66051C4.45456 7.57572 4.43323 7.4839 4.43077 7.39062V7.39062ZM5.05065 2.69067H5.25084C5.32609 2.69062 5.40056 2.70571 5.46983 2.7351C5.53911 2.76448 5.60165 2.80755 5.65392 2.86169C5.70619 2.91582 5.7471 2.9799 5.77403 3.05016C5.80097 3.12043 5.81334 3.19542 5.81066 3.27062L5.7108 5.66064C5.70312 5.8039 5.64068 5.93873 5.53649 6.03735C5.43229 6.13596 5.29421 6.19087 5.15074 6.19067C5.00827 6.19076 4.87125 6.13559 4.76866 6.03674C4.66607 5.93788 4.60587 5.80301 4.60069 5.66064L4.50084 3.27062C4.49817 3.19625 4.51016 3.12209 4.53648 3.05248C4.5628 2.98287 4.60295 2.91923 4.65416 2.86523C4.70537 2.81123 4.76671 2.76801 4.83483 2.73803C4.90294 2.70805 4.97624 2.69195 5.05065 2.69067V2.69067Z" fill="#B5B5B5"/>
175
+ </svg>
176
+ <em>Minimum bet count not completed. Check Rules.</em>
169
177
  </div>
170
-
171
- </div>
172
- {/if}
173
- {#if showTable}
174
- {#each display as row}
175
- <div class="TableContent" part="TableContent">
176
- <div class="TableUser" part="TableUser"><span>{row.Position}</span><span>{row.Name}</span></div>
177
-
178
- <div class="TableUserDetails" part="TableUserDetails">
179
- <div>
180
- <p>{$_('tournamentsTable.score')}</p>
181
- <p>{row.Score}</p>
182
- </div>
183
- <!-- <div>
184
- <p>{$_('tournamentsTable.betcounts')}</p>
185
- <p>{row.Score}</p>
186
- </div> -->
187
- <!-- <div>
188
- <p>{$_('tournamentsTable.qualified')}</p>
189
- <p>{row.Score}</p>
190
- </div> -->
178
+ {/if}
179
+ {/if}
180
+ {#if showTable}
181
+ {#each display as row}
182
+ <div class="TableUser {row.isCurrentUser ? 'CurrentUserRow' : ''}">
183
+ <div class="TableCell TableRank {row.Prize? 'Qualified' : ''}">{row.Rank}</div>
184
+ <div class="TableCell TablePlayer">{row.Player}</div>
185
+ <div class="TableCell TablePoints">{row.Points}</div>
186
+ {#if row.Prize}
187
+ <div class="TableCell TablePrize {!row.Unqualified? 'Qualified' : ''}">{row.Prize}</div>
188
+ {:else}
189
+ <div class="TableCell TablePrize">-</div>
190
+ {/if}
191
191
  </div>
192
-
193
- </div>
194
- {/each}
195
- {/if}
192
+ {#if row.isCurrentUser && row.Unqualified}
193
+ <div class="TableUserTooltips {row.Unqualified ? 'UnqualifiedRow' : ''}">
194
+ <svg class="ExclamationMark" width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
195
+ <path d="M9.03087 3.14062C8.71521 2.56443 8.27722 2.06437 7.74767 1.67553C7.21811 1.28669 6.60971 1.01855 5.96544 0.889885C5.32118 0.761222 4.65646 0.775158 4.01817 0.930778C3.37988 1.0864 2.78361 1.37989 2.27086 1.79064C1.68689 2.25306 1.22358 2.85008 0.920762 3.53063C0.679091 4.08921 0.556377 4.69205 0.560655 5.30065C0.562354 5.92327 0.693172 6.53873 0.944444 7.10839C1.19572 7.67806 1.5622 8.18953 2.02086 8.61059C2.83307 9.36649 3.89773 9.79259 5.00719 9.80553C6.11665 9.81848 7.19124 9.4174 8.02086 8.68066C8.3779 8.38276 8.67913 8.0238 8.91075 7.6206C9.34355 6.92428 9.57213 6.12051 9.57066 5.30065C9.57316 4.54694 9.38776 3.80448 9.03087 3.14062V3.14062ZM4.43077 7.39062C4.41666 7.24208 4.44786 7.09281 4.52013 6.96227C4.59239 6.83174 4.70243 6.72606 4.8358 6.65917C4.96917 6.59228 5.11961 6.56724 5.26744 6.58739C5.41528 6.60754 5.55357 6.67195 5.66417 6.77209C5.77477 6.87223 5.85238 7.00344 5.88707 7.14855C5.92176 7.29367 5.91186 7.44586 5.85851 7.5852C5.80516 7.72454 5.71098 7.84448 5.58824 7.92931C5.46551 8.01415 5.31996 8.05999 5.17076 8.06066C5.0777 8.06746 4.9841 8.05526 4.89586 8.02489C4.80762 7.99453 4.72651 7.94653 4.65733 7.8839C4.58816 7.82127 4.53247 7.74531 4.49352 7.66051C4.45456 7.57572 4.43323 7.4839 4.43077 7.39062V7.39062ZM5.05065 2.69067H5.25084C5.32609 2.69062 5.40056 2.70571 5.46983 2.7351C5.53911 2.76448 5.60165 2.80755 5.65392 2.86169C5.70619 2.91582 5.7471 2.9799 5.77403 3.05016C5.80097 3.12043 5.81334 3.19542 5.81066 3.27062L5.7108 5.66064C5.70312 5.8039 5.64068 5.93873 5.53649 6.03735C5.43229 6.13596 5.29421 6.19087 5.15074 6.19067C5.00827 6.19076 4.87125 6.13559 4.76866 6.03674C4.66607 5.93788 4.60587 5.80301 4.60069 5.66064L4.50084 3.27062C4.49817 3.19625 4.51016 3.12209 4.53648 3.05248C4.5628 2.98287 4.60295 2.91923 4.65416 2.86523C4.70537 2.81123 4.76671 2.76801 4.83483 2.73803C4.90294 2.70805 4.97624 2.69195 5.05065 2.69067V2.69067Z" fill="#B5B5B5"/>
196
+ </svg>
197
+ <em>Minimum bet count not completed. Check Rules.</em>
198
+ </div>
199
+ {/if}
200
+ {/each}
201
+ {/if}
202
+ </div>
196
203
  {:else}
197
204
  <div class="TournamentsTable" part="TournamentsTable">
198
205
  <table class="LeftTable" part="LeftTable">
@@ -214,17 +221,31 @@
214
221
  <tbody>
215
222
  {#if firstrow == 'true' && firstRowData}
216
223
  <tr class="FirstRow" part="FirstRow">
217
- <td><strong><em>#{firstRowData.Position}</em></strong></td>
218
- <td>{firstRowData.Name}</td>
219
- <td><div class="Flex" part="Flex">{firstRowData.Score}</div></td>
224
+ <td><strong><em>#{firstRowData.Rank}</em></strong></td>
225
+ <td>{firstRowData.Player}</td>
226
+ <td><div class="Flex" part="Flex">{firstRowData.Points}</div></td>
227
+ <td>
228
+ {#if firstRowData.Prize}
229
+ {firstRowData.Prize}
230
+ {:else}
231
+ -
232
+ {/if}
233
+ </td>
220
234
  </tr>
221
235
  {/if}
222
236
  {#if showTable}
223
237
  {#each display as row}
224
- <tr>
225
- <td><strong><em>#{row.Position}</em></strong></td>
226
- <td>{row.Name}</td>
227
- <td><div class="Flex" part="Flex">{row.Score}</div></td>
238
+ <tr class="{row.isCurrentUser ? 'FirstRow' : ''}" >
239
+ <td><strong><em>#{row.Rank}</em></strong></td>
240
+ <td>{row.Player}</td>
241
+ <td><div class="Flex" part="Flex">{row.Points}</div></td>
242
+ <td>
243
+ {#if row.Prize}
244
+ {row.Prize}
245
+ {:else}
246
+ -
247
+ {/if}
248
+ </td>
228
249
  </tr>
229
250
  {/each}
230
251
  {/if}
@@ -247,23 +268,6 @@
247
268
  {/if}
248
269
  {:else}
249
270
  {#if isMobile(userAgent) == true}
250
- <div class="LeaderboardContainer" part="LeaderboardContainer">
251
- <div class="Leaderboard" part="Leaderboard">{$_('tournamentsTable.leaderboard')}</div>
252
- <div class="RightButton { isMobile(userAgent) ? 'MobileClass' : '' }" part="RightButton { isMobile(userAgent) ? 'MobileClass' : '' }">
253
- <div class="CollapseButton" part="CollapseButton" on:click={() => collapseTable()}>
254
- {#if showTable}
255
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
256
- <path d="M18 15l-6-6-6 6"/>
257
- </svg>
258
- {:else}
259
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
260
- <path d="M6 9l6 6 6-6"/>
261
- </svg>
262
- {/if}
263
- </div>
264
- </div>
265
- </div>
266
-
267
271
  {#if showTable}
268
272
  <div class="TableContent" part="TableContent">
269
273
  <div class="TableUser" part="TableUser"><p>{$_('tournamentsTable.nowinners')}</p></div>
@@ -289,7 +293,7 @@
289
293
  </thead>
290
294
  <tbody>
291
295
  <tr>
292
- <td colspan="3">{$_('tournamentsTable.nowinners')}</td>
296
+ <td colspan="4">{$_('tournamentsTable.nowinners')}</td>
293
297
  </tr>
294
298
  </tbody>
295
299
  </table>
@@ -315,21 +319,25 @@
315
319
 
316
320
  .LeaderboardContainer {
317
321
  background: var(--emfe-w-color-contrast, #07072A);
322
+ color: #fff;
318
323
  display: flex;
319
324
  width: 100%;
325
+ height: 52px;
326
+ align-items: center;
320
327
  justify-content: space-between;
328
+ gap: 20px;
321
329
  }
322
330
 
323
331
  .Leaderboard {
324
- width: calc(100% - 50px);
325
- height: 52px;
332
+ width: 100%;
333
+ height: 44px;
326
334
  display: flex;
327
335
  align-items: center;
328
336
  padding-left: 20px;
329
337
  }
330
338
 
331
339
  .TableContent {
332
- width: calc(100% - 46px);
340
+ width: 100%;
333
341
  font-size: 14px;
334
342
  margin-bottom: 2px;
335
343
  border-bottom: solid 1px var(--emfe-w-color-white, #FFFFFF);
@@ -340,15 +348,52 @@
340
348
  }
341
349
 
342
350
  .TableUser {
343
- background: var(--emfe-w-color-contrast, #07072A);
344
- height: 52px;
351
+ background: var(--emfe-w-table-bg, #282828);
352
+ height: 44px;
345
353
  display: flex;
346
354
  align-items: center;
347
- gap: 20px;
348
- padding-left: 20px;
349
- font-weight: bold;
355
+ border-bottom: solid 1px var(--emfe-w-table-border, #3a3a3a);
356
+ &.TableHeadRow {
357
+ background: var(--emfe-w-table-header-bg, #1c1c1c);
358
+ color: var(--emfe-w-color-white, #fff);
359
+ }
360
+ &.CurrentUserRow {
361
+ box-sizing: border-box;
362
+ background: var(--emfe-w-table-currentuser-bg, #533a34);
363
+ }
364
+ &.UnqualifiedRow {
365
+ border-bottom: 0;
366
+ }
367
+ }
368
+ .TableUserTooltips{
369
+ background: var(--emfe-w-table-currentuser-bg, #533a34);
370
+ width: 100%;
371
+ height: 18px;
372
+ text-align: center;
373
+ font-size: 0.8rem;
374
+ }
375
+ .TableCell {
376
+ padding:10px;
377
+ flex: 2;
378
+ text-align: center;
379
+ }
380
+ .TableRank {
381
+ flex: 1 50px;
382
+ }
383
+ .TablePlayer{
384
+ flex: 5;
385
+ }
386
+ .TablePrize {
387
+ flex: 5;
388
+ }
389
+ .Qualified {
390
+ color: var(--emfe-w-highlight, #debb05);
391
+ }
392
+ .ExclamationMark {
393
+ vertical-align: text-top;
394
+ width: 14px;
395
+ height: 14px;
350
396
  }
351
-
352
397
  .TableUserDetails {
353
398
  background: var(--emfe-w-color-contrast, #07072A);
354
399
  display: flex;
@@ -6,9 +6,10 @@ export const TournamentsTableTranslations = {
6
6
  betcounts: 'Bet Counts',
7
7
  qualified: 'Qualified',
8
8
  nowinners: 'No winners for the time being. Be one of them!',
9
- Position: 'Position',
10
- Name: 'Name',
11
- Score: 'Score',
9
+ Rank: 'Rank',
10
+ Player: 'Player',
11
+ Points: 'Points',
12
+ Prize: 'Prize'
12
13
  }
13
14
  },
14
15
  tr: {
@@ -18,9 +19,10 @@ export const TournamentsTableTranslations = {
18
19
  betcounts: 'Bahis Sayısı',
19
20
  qualified: 'Tur atlamış',
20
21
  nowinners: 'Kazanan yok. Kazananlardan birisi ol!',
21
- Position: 'Pozisyon',
22
- Name: 'İsim',
23
- Score: 'Skor',
22
+ Rank: 'Rütbe',
23
+ Player: 'oyuncu',
24
+ Points: 'Puan',
25
+ Prize: 'Ödül'
24
26
  }
25
27
  },
26
28
  el: {
@@ -30,9 +32,10 @@ export const TournamentsTableTranslations = {
30
32
  betcounts: 'Αριθμός Πονταρισμάτων',
31
33
  qualified: 'Προκρίθηκε',
32
34
  nowinners: 'Δεν υπάρχουν νικητές ακόμα.',
33
- Position: 'Θέση',
34
- Name: 'Ονομα',
35
- Score: 'Σκορ',
35
+ Rank: 'Τάξη',
36
+ Player: 'Παίχτης',
37
+ Points: 'Πόντοι',
38
+ Prize: 'Βραβείο'
36
39
  }
37
40
  },
38
41
  };