@everymatrix/player-bonus-history 1.0.15 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-bonus-history",
3
- "version": "1.0.15",
3
+ "version": "1.1.0",
4
4
  "main": "dist/player-bonus-history",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -37,5 +37,5 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "0ee1d4bccc4964628711251119148f0a04ba10df"
40
+ "gitHead": "62036ada223f2b4f7b64d99a81ab2229ecba3cf1"
41
41
  }
@@ -13,8 +13,11 @@
13
13
  export let session:string = '';
14
14
  export let playerid:string = '';
15
15
  export let lang:string = 'en';
16
+ export let clientstyling:string = '';
17
+ export let clientstylingurl:string = '';
16
18
  export let translationUrl:string = '';
17
19
 
20
+ let customStylingContainer:HTMLElement;
18
21
  let isLoading:boolean = false;
19
22
  let userAgent:string = window.navigator.userAgent;
20
23
  let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
@@ -122,86 +125,113 @@
122
125
  setLocale(lang);
123
126
  }
124
127
 
128
+ const setClientStyling = ():void => {
129
+ let sheet:HTMLElement = document.createElement('style');
130
+ sheet.innerHTML = clientstyling;
131
+ customStylingContainer.appendChild(sheet);
132
+ }
133
+
134
+ const setClientStylingURL = ():void => {
135
+ let url:URL = new URL(clientstylingurl);
136
+ let cssFile:HTMLElement = document.createElement('style');
137
+
138
+ fetch(url.href)
139
+ .then((res:any) => res.text())
140
+ .then((data:any) => {
141
+ cssFile.innerHTML = data
142
+
143
+ setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
144
+ });
145
+ }
146
+
125
147
  $: lang && initialLoad();
126
148
  $: startCalendar && endCalendar && setCalendarEventListener();
127
149
  $: session && playerid && endpoint && getBonuses(0);
150
+ $: clientstylingurl && customStylingContainer && setClientStylingURL();
151
+ $: clientstyling && customStylingContainer && setClientStyling();
128
152
  $: translationUrl && setTranslationUrl();
129
153
  </script>
130
154
 
131
- {#if isLoading}
132
- <div class="ModalLoader" part="ModalLoader"></div>
133
- {:else}
134
- <div class="BonusesWrapper {isMobile ? 'BonusesWrapperMobile' : ''}" part="BonusesWrapper {isMobile ? 'BonusesWrapperMobile' : ''}">
135
- {#if isMobile}
136
- <div class="MenuReturnButton" part="MenuReturnButton" on:click={() => toggleScreen()}>
137
- <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><defs><style>.aaa{fill:var(--emfe-w-color-primary, #D0046C);}</style></defs><g transform="translate(-20 -158)">
138
- <g transform="translate(20 158)">
139
- <path class="aaa" d="M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z" transform="translate(15 15) rotate(180)"/>
140
- </g></g>
141
- </svg>
142
- <h2 class="BonusesTitleMobile" part="BonusesTitleMobile">{$_('bonusHistory.title')}</h2>
143
- </div>
144
- {/if}
145
- <h2 class="BonusesTitle {isMobile ? 'BonusesTitleNone' : ''}" part="BonusesTitle {isMobile ? 'BonusesTitleNone' : ''}">{$_('bonusHistory.title')}</h2>
146
-
147
- <div class="BonusCalendarWrapper {isMobile ? 'BonusCalendarWrapperMobile' : ''}" part="BonusCalendarWrapper {isMobile ? 'BonusCalendarWrapperMobile' : ''}">
148
- <div class="BonusesCalendarContainer {isMobile ? 'BonusesCalendarContainerMobile' : ''}" part="BonusesCalendarContainer {isMobile ? 'BonusesCalendarContainerMobile' : ''}">
149
- <div class="BonusesCalendarStartDate {isMobile ? 'BonusesCalendarMobile' : ''}" part="BonusesCalendarStartDate {isMobile ? 'BonusesCalendarMobile' : ''}">
150
- <label for="BonusCalendarStartDate">{$_('bonusHistory.dateFrom')}</label>
151
- <vaadin-date-picker bind:this={startCalendar} max={maxDate} value={lastMonth} placeholder="From" class="VaadinDatePicker" part="VaadinDatePicker"></vaadin-date-picker>
155
+ <div bind:this={customStylingContainer}>
156
+ {#if isLoading}
157
+ <div class="ModalLoader" part="ModalLoader"></div>
158
+ {:else}
159
+ <div class="BonusesWrapper {isMobile ? 'BonusesWrapperMobile' : ''}" part="BonusesWrapper {isMobile ? 'BonusesWrapperMobile' : ''}">
160
+ {#if isMobile}
161
+ <div class="MenuReturnButton" part="MenuReturnButton" on:click={() => toggleScreen()}>
162
+ <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><defs><style>.aaa{fill:var(--emfe-w-color-primary, #D0046C);}</style></defs><g transform="translate(-20 -158)">
163
+ <g transform="translate(20 158)">
164
+ <path class="aaa" d="M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z" transform="translate(15 15) rotate(180)"/>
165
+ </g></g>
166
+ </svg>
167
+ <h2 class="BonusesTitleMobile" part="BonusesTitleMobile">{$_('bonusHistory.title')}</h2>
152
168
  </div>
153
- <div class="BonusesCalendarEndDate {isMobile ? 'BonusesCalendarMobile' : ''}" part="BonusesCalendarEndDate {isMobile ? 'BonusesCalendarMobile' : ''}">
154
- <label for="BonusesCalendarEndDate">{$_('bonusHistory.dateTo')}</label>
155
- <vaadin-date-picker bind:this={endCalendar} max={maxDate} value={maxDate} placeholder="To" class="VaadinDatePicker" part="VaadinDatePicker"></vaadin-date-picker>
169
+ {/if}
170
+ <h2 class="BonusesTitle {isMobile ? 'BonusesTitleNone' : ''}" part="BonusesTitle {isMobile ? 'BonusesTitleNone' : ''}">{$_('bonusHistory.title')}</h2>
171
+
172
+ <div class="BonusCalendarWrapper {isMobile ? 'BonusCalendarWrapperMobile' : ''}" part="BonusCalendarWrapper {isMobile ? 'BonusCalendarWrapperMobile' : ''}">
173
+ <div class="BonusesCalendarContainer {isMobile ? 'BonusesCalendarContainerMobile' : ''}" part="BonusesCalendarContainer {isMobile ? 'BonusesCalendarContainerMobile' : ''}">
174
+ <div class="BonusesCalendarStartDate {isMobile ? 'BonusesCalendarMobile' : ''}" part="BonusesCalendarStartDate {isMobile ? 'BonusesCalendarMobile' : ''}">
175
+ <label for="BonusCalendarStartDate">{$_('bonusHistory.dateFrom')}</label>
176
+ <vaadin-date-picker bind:this={startCalendar} max={maxDate} value={lastMonth} placeholder="From" class="VaadinDatePicker" part="VaadinDatePicker"></vaadin-date-picker>
177
+ </div>
178
+ <div class="BonusesCalendarEndDate {isMobile ? 'BonusesCalendarMobile' : ''}" part="BonusesCalendarEndDate {isMobile ? 'BonusesCalendarMobile' : ''}">
179
+ <label for="BonusesCalendarEndDate">{$_('bonusHistory.dateTo')}</label>
180
+ <vaadin-date-picker bind:this={endCalendar} max={maxDate} value={maxDate} placeholder="To" class="VaadinDatePicker" part="VaadinDatePicker"></vaadin-date-picker>
181
+ </div>
156
182
  </div>
183
+ <button class="BonusesCalendarFilter {isMobile ? 'BonusesCalendarFilterMobile' : ''}" part="BonusesCalendarFilter {isMobile ? 'BonusesCalendarFilterMobile' : ''}" on:click={() => getBonuses(0)}>{$_('bonusHistory.dateFilter')}</button>
157
184
  </div>
158
- <button class="BonusesCalendarFilter {isMobile ? 'BonusesCalendarFilterMobile' : ''}" part="BonusesCalendarFilter {isMobile ? 'BonusesCalendarFilterMobile' : ''}" on:click={() => getBonuses(0)}>{$_('bonusHistory.dateFilter')}</button>
159
- </div>
160
- <div class="BonusesGrid {isMobile ? 'BonusesGridMobile' : ''}" part="BonusesGrid {isMobile ? 'BonusesGridMobile' : ''}">
161
- {#if bonusesList.length === 0}
162
- <p>{$_('bonusHistory.noBonusHistory')}</p>
163
- {:else}
164
- {#each bonusesList as bonus}
165
- {#if bonus.type === 'freeRound'}
166
- <player-bonus-card
167
- bonuswalletid={bonus.walletId}
168
- bonusdate={bonus.granted}
169
- bonusstatus={bonus.status}
170
- bonusname={bonus.name}
171
- bonustype={bonus.type}
172
- bonuscurrency={bonus.currency}
173
- {lang}
174
- ></player-bonus-card>
175
- {:else}
176
- <player-bonus-card
177
- bonuswalletid={bonus.walletId}
178
- bonusdate={bonus.granted}
179
- bonusstatus={bonus.status}
180
- bonusname={bonus.name}
181
- bonustype={bonus.type}
182
- bonusamount={bonus.grantedAmount}
183
- bonuswageringamount={bonus.totalWR}
184
- bonusremainingamount={bonus.currentAmount}
185
- bonuscurrency={bonus.currency}
186
- {lang}
187
- ></player-bonus-card>
188
- {/if}
189
- {/each}
185
+ <div class="BonusesGrid {isMobile ? 'BonusesGridMobile' : ''}" part="BonusesGrid {isMobile ? 'BonusesGridMobile' : ''}">
186
+ {#if bonusesList.length === 0}
187
+ <p>{$_('bonusHistory.noBonusHistory')}</p>
188
+ {:else}
189
+ {#each bonusesList as bonus}
190
+ {#if bonus.type === 'freeRound'}
191
+ <player-bonus-card
192
+ bonuswalletid={bonus.walletId}
193
+ bonusdate={bonus.granted}
194
+ bonusstatus={bonus.status}
195
+ bonusname={bonus.name}
196
+ bonustype={bonus.type}
197
+ bonuscurrency={bonus.currency}
198
+ {lang}
199
+ {clientstyling}
200
+ {clientstylingurl}
201
+ ></player-bonus-card>
202
+ {:else}
203
+ <player-bonus-card
204
+ bonuswalletid={bonus.walletId}
205
+ bonusdate={bonus.granted}
206
+ bonusstatus={bonus.status}
207
+ bonusname={bonus.name}
208
+ bonustype={bonus.type}
209
+ bonusamount={bonus.grantedAmount}
210
+ bonuswageringamount={bonus.totalWR}
211
+ bonusremainingamount={bonus.currentAmount}
212
+ bonuscurrency={bonus.currency}
213
+ {lang}
214
+ {clientstyling}
215
+ {clientstylingurl}
216
+ ></player-bonus-card>
217
+ {/if}
218
+ {/each}
219
+ {/if}
220
+ </div>
221
+ {#if bonusesList.length !== 0}
222
+ <div class="BonusesPaginationWrapper {isMobile ? 'BonusesPaginationWrapperMobile' : ''}" part="BonusesPaginationWrapper {isMobile ? 'BonusesPaginationWrapperMobile' : ''}">
223
+ <span class="BonusesFirst {currentPage === 0 ? 'Inactive' : ''}" part="BonusesFirst {currentPage === 0 ? 'Inactive' : ''}" on:click={() => getBonuses(0)}>&vert;&lt;</span>
224
+ <span class="BonusesPrev {currentPage === 0 ? 'Inactive' : ''}" part="BonusesPrev {currentPage === 0 ? 'Inactive' : ''}" on:click={() => getBonuses(bonusesPrevPage)}>&lt;</span>
225
+ {#each Array(numberOfPages) as _, i}
226
+ <span class="BonusesPage {i === currentPage ? 'BonusPageActive' : ''}" part="BonusesPage {i === currentPage ? 'BonusPageActive' : ''}" on:click={() => getBonuses(i*bonusesPerPage)}>{i+1}</span>
227
+ {/each}
228
+ <span class="BonusesNext {currentPage === (numberOfPages - 1) ? 'Inactive' : ''}" part="BonusesNext {currentPage === (numberOfPages - 1) ? 'Inactive' : ''}" on:click={() => getBonuses(bonusesNextPage)}>&gt;</span>
229
+ <span class="BonusesLast {currentPage === (numberOfPages - 1) ? 'Inactive' : ''}" part="BonusesLast {currentPage === (numberOfPages - 1) ? 'Inactive' : ''}" on:click={() => getBonuses(bonusesLastPage)}>&gt;&vert;</span>
230
+ </div>
190
231
  {/if}
191
232
  </div>
192
- {#if bonusesList.length !== 0}
193
- <div class="BonusesPaginationWrapper {isMobile ? 'BonusesPaginationWrapperMobile' : ''}" part="BonusesPaginationWrapper {isMobile ? 'BonusesPaginationWrapperMobile' : ''}">
194
- <span class="BonusesFirst {currentPage === 0 ? 'Inactive' : ''}" part="BonusesFirst {currentPage === 0 ? 'Inactive' : ''}" on:click={() => getBonuses(0)}>&vert;&lt;</span>
195
- <span class="BonusesPrev {currentPage === 0 ? 'Inactive' : ''}" part="BonusesPrev {currentPage === 0 ? 'Inactive' : ''}" on:click={() => getBonuses(bonusesPrevPage)}>&lt;</span>
196
- {#each Array(numberOfPages) as _, i}
197
- <span class="BonusesPage {i === currentPage ? 'BonusPageActive' : ''}" part="BonusesPage {i === currentPage ? 'BonusPageActive' : ''}" on:click={() => getBonuses(i*bonusesPerPage)}>{i+1}</span>
198
- {/each}
199
- <span class="BonusesNext {currentPage === (numberOfPages - 1) ? 'Inactive' : ''}" part="BonusesNext {currentPage === (numberOfPages - 1) ? 'Inactive' : ''}" on:click={() => getBonuses(bonusesNextPage)}>&gt;</span>
200
- <span class="BonusesLast {currentPage === (numberOfPages - 1) ? 'Inactive' : ''}" part="BonusesLast {currentPage === (numberOfPages - 1) ? 'Inactive' : ''}" on:click={() => getBonuses(bonusesLastPage)}>&gt;&vert;</span>
201
- </div>
202
- {/if}
203
- </div>
204
- {/if}
233
+ {/if}
234
+ </div>
205
235
 
206
236
  <style lang="scss">
207
237