@everymatrix/casino-tournaments-table 0.0.410 → 0.0.412
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.
|
|
3
|
+
"version": "0.0.412",
|
|
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": "
|
|
39
|
+
"gitHead": "915e53c91820558c3cedd66aa2fa8a4343a6d67b"
|
|
40
40
|
}
|
|
@@ -14,6 +14,12 @@
|
|
|
14
14
|
export let lang:String = 'en';
|
|
15
15
|
export let fractiondigit: string = '2'
|
|
16
16
|
|
|
17
|
+
export let clientstyling:string = '';
|
|
18
|
+
export let clientstylingurl:string = '';
|
|
19
|
+
|
|
20
|
+
let customStylingContainer: HTMLElement;
|
|
21
|
+
let displayNone:boolean = false;
|
|
22
|
+
|
|
17
23
|
let columns:any = [];
|
|
18
24
|
let data:any = [];
|
|
19
25
|
let sortColumn:any = null;
|
|
@@ -180,6 +186,30 @@
|
|
|
180
186
|
showTable = !showTable;
|
|
181
187
|
}
|
|
182
188
|
|
|
189
|
+
const setClientStyling = ():void => {
|
|
190
|
+
let sheet = document.createElement('style');
|
|
191
|
+
sheet.innerHTML = clientstyling;
|
|
192
|
+
customStylingContainer.appendChild(sheet);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const setClientStylingURL = ():void => {
|
|
196
|
+
displayNone = true;
|
|
197
|
+
|
|
198
|
+
let url:URL = new URL(clientstylingurl);
|
|
199
|
+
let cssFile:HTMLElement = document.createElement('style');
|
|
200
|
+
|
|
201
|
+
fetch(url.href)
|
|
202
|
+
.then((res:any) => res.text())
|
|
203
|
+
.then((data:any) => {
|
|
204
|
+
cssFile.innerHTML = data
|
|
205
|
+
|
|
206
|
+
if (customStylingContainer) {
|
|
207
|
+
setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
|
|
208
|
+
setTimeout(() => { displayNone = false; }, 500);
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
183
213
|
onMount(() => {
|
|
184
214
|
window.addEventListener('message', messageHandler, false);
|
|
185
215
|
return () => {
|
|
@@ -187,6 +217,8 @@
|
|
|
187
217
|
}
|
|
188
218
|
});
|
|
189
219
|
|
|
220
|
+
$: customStylingContainer && clientstyling && setClientStyling();
|
|
221
|
+
$: customStylingContainer && clientstylingurl && setClientStylingURL();
|
|
190
222
|
$: display = sortColumn && sortDirection ? sortData() : [...data];
|
|
191
223
|
$: sort = column === sortColumn ? sortDirection : null;
|
|
192
224
|
|
|
@@ -195,7 +227,7 @@
|
|
|
195
227
|
|
|
196
228
|
{#if data.length > 0 || firstRowData}
|
|
197
229
|
{#if isMobile(userAgent) == true}
|
|
198
|
-
<div class="TableContent" part="TableContent">
|
|
230
|
+
<div bind:this={customStylingContainer} class="TableContent" part="TableContent">
|
|
199
231
|
<div class="TableUser TableHeadRow" part="TableUser TableHeadRow">
|
|
200
232
|
{#each columns as column}
|
|
201
233
|
<div class="TableCell Table{column}" part="TableCell Table{column}">
|
|
@@ -255,7 +287,7 @@
|
|
|
255
287
|
{/if}
|
|
256
288
|
</div>
|
|
257
289
|
{:else}
|
|
258
|
-
<div class="TournamentsTable" part="TournamentsTable">
|
|
290
|
+
<div bind:this={customStylingContainer} class="TournamentsTable" part="TournamentsTable">
|
|
259
291
|
<table class="LeftTable" part="LeftTable">
|
|
260
292
|
<thead part="LeftTableThead">
|
|
261
293
|
<tr part="LeftTableTr">
|
|
@@ -358,7 +390,7 @@
|
|
|
358
390
|
{:else}
|
|
359
391
|
{#if isMobile(userAgent) == true}
|
|
360
392
|
{#if showTable}
|
|
361
|
-
<div class="TableContent" part="TableContent">
|
|
393
|
+
<div bind:this={customStylingContainer} class="TableContent" part="TableContent">
|
|
362
394
|
<div class="TableUser" part="TableUser"><p>{$_('tournamentsTable.nowinners')}</p></div>
|
|
363
395
|
</div>
|
|
364
396
|
{/if}
|