@everymatrix/casino-games-category-section 1.9.3 → 1.10.0
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-games-category-section",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"main": "dist/casino-games-category-section.js",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "9ccf680032da454b5c7417f978da996ec52e4554"
|
|
39
39
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import '@everymatrix/casino-game-thumbnail';
|
|
12
12
|
import '@everymatrix/casino-filter';
|
|
13
|
-
|
|
13
|
+
import '@everymatrix/casino-sort';
|
|
14
14
|
|
|
15
15
|
const MASONRY_CLASS_PREFIX = 'game-tile-';
|
|
16
16
|
|
|
@@ -85,6 +85,7 @@
|
|
|
85
85
|
let thumbnailContainer:Array<HTMLElement> = new Array(10000);
|
|
86
86
|
let intersectingIndexes:Object = {};
|
|
87
87
|
let visibilityconnect:string = '';
|
|
88
|
+
let sortedBy:string = '';
|
|
88
89
|
let hidden;
|
|
89
90
|
let visibilityChange;
|
|
90
91
|
let dataloaded;
|
|
@@ -184,10 +185,10 @@
|
|
|
184
185
|
// @TODO categoryId type
|
|
185
186
|
const getData = (categoryId:any, offset:number, limit:number, filterArray:Array<Object> = []) => {
|
|
186
187
|
isLoading = true;
|
|
187
|
-
|
|
188
188
|
let categoryidparsed = '';
|
|
189
189
|
let url:any = '';
|
|
190
190
|
let vendorFilters = JSON.parse(localStorage.getItem('vendorFiltersByCategory'));
|
|
191
|
+
let vendorSort = JSON.parse(localStorage.getItem('vendorSortingBy'));
|
|
191
192
|
|
|
192
193
|
let tempEndpoint:string = endpoint.replace(/.$/, "2"); // @TODO remove after we migrate with all endpoints to v2 - hack for the endpoint since the filtering of categories functionality was developed only for the v2 api
|
|
193
194
|
if((categoryid.match(/\$/g) || []).length > 1) {
|
|
@@ -204,7 +205,7 @@
|
|
|
204
205
|
url.searchParams.append("platform", getDevice(userAgent));
|
|
205
206
|
url.searchParams.append("pagination", `games(offset=${offset},limit=${limit})`);
|
|
206
207
|
url.searchParams.append('language', lang);
|
|
207
|
-
|
|
208
|
+
|
|
208
209
|
// if vendor filters are active, get filtered games
|
|
209
210
|
window.postMessage({ type: 'CategoryVendors', categoryid }, window.location.href);
|
|
210
211
|
|
|
@@ -217,7 +218,7 @@
|
|
|
217
218
|
vendorFilters[categoryid].forEach(vendorId => {
|
|
218
219
|
queryParamVendorId = queryParamVendorId + (queryParamVendorId ? `,games(vendor(id=${vendorId}))` : `games(vendor(id=${vendorId}))`);
|
|
219
220
|
});
|
|
220
|
-
|
|
221
|
+
|
|
221
222
|
url.searchParams.append('filter', ((vendorFilters && vendorFilters[categoryid].length < 2) ? `$and` : `$or`) + `(${queryParamVendorId})`);
|
|
222
223
|
} else {
|
|
223
224
|
filteresPresent = false;
|
|
@@ -225,6 +226,28 @@
|
|
|
225
226
|
}
|
|
226
227
|
}
|
|
227
228
|
|
|
229
|
+
if(vendorSort){
|
|
230
|
+
if (vendorSort[categoryid]) {
|
|
231
|
+
if (vendorSort[categoryid] && vendorSort[categoryid]!= 'All') {
|
|
232
|
+
if(vendorSort[categoryid] == 'isNew' || vendorSort[categoryid] == 'advancedTags(name(hot))'){
|
|
233
|
+
url.searchParams.append('sortedField', `games(${vendorSort[categoryid]})`);
|
|
234
|
+
url.searchParams.append('orderBy', `DES`);
|
|
235
|
+
} else {
|
|
236
|
+
url.searchParams.append('sortedField', `games(${vendorSort[categoryid]})`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
} else {
|
|
240
|
+
if (sortedBy && sortedBy!= 'All') {
|
|
241
|
+
if(sortedBy == 'advancedTags(name(hot))' || sortedBy == 'isNew'){
|
|
242
|
+
url.searchParams.append('sortedField', `games(${sortedBy})`);
|
|
243
|
+
url.searchParams.append('orderBy', `DES`);
|
|
244
|
+
} else {
|
|
245
|
+
url.searchParams.append('sortedField', `games(${sortedBy})`);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
228
251
|
fetch(url)
|
|
229
252
|
.then((res:any) => res.json())
|
|
230
253
|
.then((categoryData:any) => {
|
|
@@ -357,6 +380,16 @@
|
|
|
357
380
|
limit = 20;
|
|
358
381
|
break;
|
|
359
382
|
|
|
383
|
+
case 'ApplySorter':
|
|
384
|
+
categoryid = e.data.itemId;
|
|
385
|
+
sortedBy = e.data.sortBy;
|
|
386
|
+
|
|
387
|
+
getData(categoryid, 0, limit).then((res:any) => {
|
|
388
|
+
categoryData = res;
|
|
389
|
+
shownCategoryData = categoryData.games.items;
|
|
390
|
+
showLoadCategory = false;
|
|
391
|
+
});
|
|
392
|
+
break;
|
|
360
393
|
|
|
361
394
|
case 'CategoryUpdate':
|
|
362
395
|
searched = false;
|
|
@@ -696,6 +729,15 @@
|
|
|
696
729
|
{filterbylogo}>
|
|
697
730
|
</casino-filter>
|
|
698
731
|
{/if}
|
|
732
|
+
{#if addsortingselector == "true"}
|
|
733
|
+
<casino-sort
|
|
734
|
+
{clientstylingurl}
|
|
735
|
+
{clientstyling}
|
|
736
|
+
{lang}
|
|
737
|
+
{categoryid}
|
|
738
|
+
{addsortingselector}>
|
|
739
|
+
</casino-sort>
|
|
740
|
+
{/if}
|
|
699
741
|
</div>
|
|
700
742
|
{/if}
|
|
701
743
|
</div>
|
|
@@ -1011,8 +1053,9 @@
|
|
|
1011
1053
|
.CategoryFilterContainer {
|
|
1012
1054
|
display: grid;
|
|
1013
1055
|
grid-template-columns: 1fr 1fr;
|
|
1014
|
-
gap:
|
|
1015
|
-
|
|
1056
|
+
gap: 17px;
|
|
1057
|
+
justify-items: center;
|
|
1058
|
+
}
|
|
1016
1059
|
|
|
1017
1060
|
@media screen and (max-width: 385px) {
|
|
1018
1061
|
.CasinoGamesGrid {
|
|
@@ -1048,6 +1091,7 @@
|
|
|
1048
1091
|
.CasinoGamesHeader {
|
|
1049
1092
|
align-items: unset;
|
|
1050
1093
|
flex-direction: row;
|
|
1094
|
+
flex-wrap: wrap;
|
|
1051
1095
|
}
|
|
1052
1096
|
|
|
1053
1097
|
.CategoryName {
|