@everymatrix/casino-bonuses-controller 1.22.5
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/README.md +30 -0
- package/dist/casino-bonuses-controller.js +1452 -0
- package/dist/casino-bonuses-controller.js.map +1 -0
- package/index.html +42 -0
- package/index.js +1 -0
- package/package.json +39 -0
- package/public/favicon.png +0 -0
- package/public/reset.css +48 -0
- package/rollup.config.js +59 -0
- package/src/CasinoBonusesController.svelte +882 -0
- package/src/base.ts +175 -0
- package/src/component/CasinoBonusCard.svelte +1154 -0
- package/src/component/CasinoBonusPagination.svelte +192 -0
- package/src/component/CasinoBonusProgress.svelte +97 -0
- package/src/i18n.js +28 -0
- package/src/index.ts +11 -0
- package/src/pagination.js +121 -0
- package/src/translation.js +65 -0
- package/stories/CasinoBonusesController.stories.js +13 -0
- package/tsconfig.json +6 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
<svelte:options tag={null} />
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
import { isMobile } from 'rvhelper';
|
|
4
|
+
import { generateNavigationOptions } from '../pagination';
|
|
5
|
+
|
|
6
|
+
export let totalitems = '';
|
|
7
|
+
export let pagesize = 10;
|
|
8
|
+
export let currentpage = '1';
|
|
9
|
+
export let limit = 2;
|
|
10
|
+
export let showinput = '';
|
|
11
|
+
export let clientstyling: string= '';
|
|
12
|
+
export let clientstylingurl: string = '';
|
|
13
|
+
let userAgent:String = window.navigator.userAgent;
|
|
14
|
+
let mobileView = false;
|
|
15
|
+
let customStylingContainer: HTMLElement;
|
|
16
|
+
if (isMobile(userAgent)) {
|
|
17
|
+
mobileView = true;
|
|
18
|
+
}
|
|
19
|
+
let pageForInput: number;
|
|
20
|
+
let pageToGo: number;
|
|
21
|
+
let options;
|
|
22
|
+
|
|
23
|
+
const setClientStyling = (): void => {
|
|
24
|
+
let sheet = document.createElement('style');
|
|
25
|
+
sheet.innerHTML = clientstyling;
|
|
26
|
+
customStylingContainer.appendChild(sheet);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const setClientStylingURL = (): void => {
|
|
30
|
+
let url:URL = new URL(clientstylingurl);
|
|
31
|
+
let cssFile:HTMLElement = document.createElement('style');
|
|
32
|
+
|
|
33
|
+
fetch(url.href)
|
|
34
|
+
.then((res:any) => res.text())
|
|
35
|
+
.then((data:any) => {
|
|
36
|
+
cssFile.innerHTML = data
|
|
37
|
+
|
|
38
|
+
setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
$: clientstyling && customStylingContainer && setClientStyling();
|
|
42
|
+
$: clientstylingurl && customStylingContainer && setClientStylingURL();
|
|
43
|
+
$: totalItems = Number(totalitems);
|
|
44
|
+
$: showInput = showinput;
|
|
45
|
+
$: currentPage = Number(currentpage);
|
|
46
|
+
$: pageSize = pagesize;
|
|
47
|
+
$:{
|
|
48
|
+
options = generateNavigationOptions({
|
|
49
|
+
totalItems,
|
|
50
|
+
pageSize,
|
|
51
|
+
currentPage,
|
|
52
|
+
limit
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const handleOptionClick = (option)=>{
|
|
57
|
+
window.postMessage({type:'PaginationChange', page:option.value});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const handleInput = (page)=>{
|
|
61
|
+
pageToGo = page > totalPages ? totalPages : page;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
$: totalPages = Math.ceil(totalItems / pageSize);
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<div class="GeneralPagination" part="GeneralPagination" bind:this={customStylingContainer}>
|
|
68
|
+
<div class="PaginationWrapper {mobileView ? 'PaginationWrapperMobile' : ''}" part="PaginationWrapper {mobileView ? 'PaginationWrapperMobile' : ''}" >
|
|
69
|
+
{#each options as option}
|
|
70
|
+
<button disabled="{
|
|
71
|
+
(option.type === 'symbol' && option.symbol === '>' && currentPage >= totalPages) ||
|
|
72
|
+
(option.type === 'symbol' && option.symbol === '<' && currentPage <= 1)
|
|
73
|
+
}"
|
|
74
|
+
class="option"
|
|
75
|
+
class:number="{option.type === 'number'}"
|
|
76
|
+
class:prev="{option.type === 'symbol' && option.symbol === '<'}"
|
|
77
|
+
class:next="{option.type === 'symbol' && option.symbol === '>'}"
|
|
78
|
+
class:disabled="{
|
|
79
|
+
(option.type === 'symbol' && option.symbol === '>' && currentPage >= totalPages) ||
|
|
80
|
+
(option.type === 'symbol' && option.symbol === '<' && currentPage <= 1)
|
|
81
|
+
}"
|
|
82
|
+
class:ellipsis="{option.type === 'symbol' && option.symbol === '.'}"
|
|
83
|
+
class:active="{option.type === 'number' && option.value === currentPage}"
|
|
84
|
+
role="presentation"
|
|
85
|
+
on:click="{() => handleOptionClick(option)}"
|
|
86
|
+
>
|
|
87
|
+
{#if option.type === 'number'}
|
|
88
|
+
<slot name="number" value="{option.value}">
|
|
89
|
+
<span>{option.value}</span>
|
|
90
|
+
</slot>
|
|
91
|
+
{:else if option.type === 'symbol' && option.symbol === '.'}
|
|
92
|
+
<slot name="ellipsis">
|
|
93
|
+
<span>...</span>
|
|
94
|
+
</slot>
|
|
95
|
+
{:else if option.type === 'symbol' && option.symbol === '<'}
|
|
96
|
+
<slot name="prev" >
|
|
97
|
+
<
|
|
98
|
+
</slot>
|
|
99
|
+
{:else if option.type === 'symbol' && option.symbol === '>'}
|
|
100
|
+
<slot name="next" >
|
|
101
|
+
>
|
|
102
|
+
</slot>
|
|
103
|
+
{/if}
|
|
104
|
+
</button>
|
|
105
|
+
{/each}
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
{#if showInput}
|
|
109
|
+
<div class="PaginationInputWrapper">
|
|
110
|
+
<span>Go To Page</span>
|
|
111
|
+
<input type="number" class="PaginationInput" part="PaginationInput" bind:value={pageForInput} on:change={()=>handleInput(pageForInput)}>
|
|
112
|
+
<button type="button" class="PaginationGoButton" on:click="{() => handleOptionClick({ value:pageToGo}) }">Go</button>
|
|
113
|
+
</div>
|
|
114
|
+
{/if}
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
<style lang="scss">
|
|
119
|
+
:host {
|
|
120
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.GeneralPagination {
|
|
124
|
+
margin: 40px 0;
|
|
125
|
+
display: flex;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.PaginationWrapper {
|
|
129
|
+
flex:1;
|
|
130
|
+
display: flex;
|
|
131
|
+
justify-content: center;
|
|
132
|
+
&.PaginationWrapperMobile {
|
|
133
|
+
flex-wrap: wrap;
|
|
134
|
+
text-align: center;
|
|
135
|
+
}
|
|
136
|
+
.prev, .next,.number {
|
|
137
|
+
color: var(--emfe-w-bonus-pagination-text,var(--emfe-w-color-contrast-600, #0D0D4D));
|
|
138
|
+
font-size: 16px;
|
|
139
|
+
cursor: pointer;
|
|
140
|
+
font-weight: 700;
|
|
141
|
+
border: 1px solid var(--emfe-w-bonus-pagination-border,var(--emfe-w-color-gray-150, #828282));
|
|
142
|
+
width: 32px;
|
|
143
|
+
height: 32px;
|
|
144
|
+
line-height: 28px;
|
|
145
|
+
text-align: center;
|
|
146
|
+
margin-right: 2px;
|
|
147
|
+
border-radius: 2px;
|
|
148
|
+
&.disabled {
|
|
149
|
+
color: var(--emfe-w-bonus-pagination-disabled,var(--emfe-w-color-gray-100, #E6E6E6));
|
|
150
|
+
border-color: var(--emfe-w-bonus-pagination-disabled,var(--emfe-w-color-gray-100, #E6E6E6));
|
|
151
|
+
cursor: default;
|
|
152
|
+
}
|
|
153
|
+
&.active {
|
|
154
|
+
background-color: var(--emfe-w-bonus-pagination-bg, var(--emfe-w-color-contrast, #00AEEF)) ;
|
|
155
|
+
color: var(--emfe-w-bonus-pagination-active,var(--emfe-w-color-white, #FFFFFF));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
.ellipsis {
|
|
159
|
+
width: 32px;
|
|
160
|
+
margin-right: 2px;
|
|
161
|
+
text-align: center;
|
|
162
|
+
line-height: 20px;
|
|
163
|
+
}
|
|
164
|
+
.Page {
|
|
165
|
+
margin: 0 5px;
|
|
166
|
+
color: var(--emfe-w-bonus-pagination-text,var(--emfe-w-color-gray-300, #58586B));
|
|
167
|
+
font-size: 16px;
|
|
168
|
+
cursor: pointer;
|
|
169
|
+
padding: 5px 10px;
|
|
170
|
+
&.active {
|
|
171
|
+
background-color: var(--emfe-w-bonus-pagination-active,var(--emfe-w-color-white, #FFFFFF));
|
|
172
|
+
font-weight: 700;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.PaginationInputWrapper {
|
|
178
|
+
flex: 1;
|
|
179
|
+
.PaginationInput {
|
|
180
|
+
padding: 7px 0 6px 0;
|
|
181
|
+
width: 32px;
|
|
182
|
+
text-align: center;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.PaginationGoButton {
|
|
186
|
+
background: none;
|
|
187
|
+
border: none;
|
|
188
|
+
cursor: pointer;
|
|
189
|
+
font-size: 18px;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
</style>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<svelte:options tag={null} />
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
export let value = 0;
|
|
4
|
+
export let status = '';
|
|
5
|
+
export let clientstyling: string= '';
|
|
6
|
+
export let clientstylingurl: string = '';
|
|
7
|
+
let circle;
|
|
8
|
+
let r = 64.5;
|
|
9
|
+
let dasharray = Math.PI*(r*2);
|
|
10
|
+
let customStylingContainer: HTMLElement;
|
|
11
|
+
|
|
12
|
+
const setClientStyling = (): void => {
|
|
13
|
+
let sheet = document.createElement('style');
|
|
14
|
+
sheet.innerHTML = clientstyling;
|
|
15
|
+
customStylingContainer.appendChild(sheet);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const setClientStylingURL = (): void => {
|
|
19
|
+
let url:URL = new URL(clientstylingurl);
|
|
20
|
+
let cssFile:HTMLElement = document.createElement('style');
|
|
21
|
+
|
|
22
|
+
fetch(url.href)
|
|
23
|
+
.then((res:any) => res.text())
|
|
24
|
+
.then((data:any) => {
|
|
25
|
+
cssFile.innerHTML = data
|
|
26
|
+
|
|
27
|
+
setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
$: clientstyling && customStylingContainer && setClientStyling();
|
|
31
|
+
$: clientstylingurl && customStylingContainer && setClientStylingURL();
|
|
32
|
+
$: calculateProgress = () => {
|
|
33
|
+
if(!r) return;
|
|
34
|
+
var c = Math.PI*(r*2);
|
|
35
|
+
|
|
36
|
+
if (value < 0) { value = 0;}
|
|
37
|
+
if (value > 100) { value = 100;}
|
|
38
|
+
|
|
39
|
+
return ((100-value)/100)*c;
|
|
40
|
+
};
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<div class="CircularProgress" part="CircularProgress" bind:this={customStylingContainer}>
|
|
44
|
+
<svg viewBox="0 0 147 147">
|
|
45
|
+
|
|
46
|
+
<circle class="CircularProgressLineBg" cx="73.5" cy="73.5" r="64.5" fill="transparent" stroke-width="18" ></circle>
|
|
47
|
+
<circle class="CircularProgressLine" bind:this={circle} class:Completed="{status === 'completed'}"
|
|
48
|
+
cx="73.5" cy="73.5" r="64.5" stroke-width="18"
|
|
49
|
+
stroke-dasharray={dasharray} stroke-dashoffset={calculateProgress()}>
|
|
50
|
+
</circle>
|
|
51
|
+
<circle class="CircularProgressCenter" class:Completed="{status === 'completed'}" cx="73" cy="73.5" r="50.5"></circle>
|
|
52
|
+
</svg>
|
|
53
|
+
|
|
54
|
+
<div>
|
|
55
|
+
<slot>
|
|
56
|
+
<span class="CircularProgressText" part="CircularProgressText">{value} %</span>
|
|
57
|
+
</slot>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<style lang="scss">
|
|
62
|
+
:host {
|
|
63
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.CircularProgress {
|
|
67
|
+
height: 100%;
|
|
68
|
+
position: relative;
|
|
69
|
+
width: 100%;
|
|
70
|
+
}
|
|
71
|
+
.CircularProgressLineBg {
|
|
72
|
+
stroke: var(--emfe-w-bonus-progress-primary,var(--emfe-w-color-gray-100, #D9D9D9));
|
|
73
|
+
}
|
|
74
|
+
.CircularProgressLine {
|
|
75
|
+
stroke: var(--emfe-w-bonus-progress-primary,var(--emfe-w-color-primary, #00AEEF));
|
|
76
|
+
transition: 0.35s stroke-dashoffset;
|
|
77
|
+
transform: rotate(-90deg);
|
|
78
|
+
transform-origin: 50% 50%;
|
|
79
|
+
fill: transparent;
|
|
80
|
+
&.Completed {
|
|
81
|
+
stroke: var(--emfe-w-bonus-progress-bg,var(--emfe-w-color-gray-300, #A9A9A9));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
.CircularProgressCenter {
|
|
85
|
+
fill: var(--emfe-w-bonus-progress-primary,var(--emfe-w-color-primary, #00AEEF));
|
|
86
|
+
&.Completed {
|
|
87
|
+
fill: var(--emfe-w-bonus-progress-bg,var(--emfe-w-color-gray-100, #D9D9D9));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
.CircularProgressText {
|
|
91
|
+
left: 50%;
|
|
92
|
+
position: absolute;
|
|
93
|
+
top: 50%;
|
|
94
|
+
transform: translate(-50%, -50%);
|
|
95
|
+
color: var(--emfe-w-bonus-progress-text,var(--emfe-w-color-white, #FFFFFF));
|
|
96
|
+
}
|
|
97
|
+
</style>
|
package/src/i18n.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
dictionary,
|
|
3
|
+
locale,
|
|
4
|
+
addMessages,
|
|
5
|
+
_
|
|
6
|
+
} from 'svelte-i18n';
|
|
7
|
+
|
|
8
|
+
function setupI18n({ withLocale: _locale, translations }) {
|
|
9
|
+
locale.subscribe((data) => {
|
|
10
|
+
if (data == null) {
|
|
11
|
+
dictionary.set(translations);
|
|
12
|
+
locale.set(_locale);
|
|
13
|
+
}
|
|
14
|
+
}); // maybe we will need this to make sure that the i18n is set up only once
|
|
15
|
+
/*dictionary.set(translations);
|
|
16
|
+
locale.set(_locale);*/
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function addNewMessages(lang, dict) {
|
|
20
|
+
addMessages(lang, dict);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function setLocale(_locale) {
|
|
24
|
+
locale.set(_locale);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { _, setupI18n, addNewMessages, setLocale };
|
|
28
|
+
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import CasinoBonusesController from './CasinoBonusesController.svelte';
|
|
2
|
+
import CasinoBonusCard from './component/CasinoBonusCard.svelte';
|
|
3
|
+
import CasinoBonusPagination from './component/CasinoBonusPagination.svelte';
|
|
4
|
+
import CasinoBonusProgress from './component/CasinoBonusProgress.svelte';
|
|
5
|
+
|
|
6
|
+
!customElements.get('casino-bonuses-controller') && customElements.define('casino-bonuses-controller', CasinoBonusesController);
|
|
7
|
+
!customElements.get('casino-bonus-pagination') && customElements.define('casino-bonus-pagination', CasinoBonusPagination);
|
|
8
|
+
!customElements.get('casino-bonus-card') && customElements.define('casino-bonus-card', CasinoBonusCard);
|
|
9
|
+
!customElements.get('casino-bonus-progress') && customElements.define('casino-bonus-progress', CasinoBonusProgress);
|
|
10
|
+
|
|
11
|
+
export default CasinoBonusesController;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
export function generateNavigationOptions({ totalItems, pageSize, currentPage, limit }) {
|
|
2
|
+
const totalPages = Math.ceil(totalItems / pageSize);
|
|
3
|
+
const limited = limit && totalPages > getLimitThreshold(limit);
|
|
4
|
+
const options = limited
|
|
5
|
+
? generateLimitedOptions({ totalPages, limit, currentPage })
|
|
6
|
+
: generateUnlimitedOptions({ totalPages });
|
|
7
|
+
return [{
|
|
8
|
+
type: 'symbol',
|
|
9
|
+
symbol: '<',
|
|
10
|
+
value: currentPage <= 1 ? 1 : currentPage - 1
|
|
11
|
+
},
|
|
12
|
+
...(options || []),
|
|
13
|
+
{
|
|
14
|
+
type: 'symbol',
|
|
15
|
+
symbol: '>',
|
|
16
|
+
value: currentPage >= totalPages ? totalPages : currentPage + 1
|
|
17
|
+
}];
|
|
18
|
+
}
|
|
19
|
+
function generateUnlimitedOptions({ totalPages }) {
|
|
20
|
+
return new Array(totalPages).fill(null).map((_, index) => ({
|
|
21
|
+
type: 'number',
|
|
22
|
+
value: index + 1
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
function generateLimitedOptions({ totalPages, limit, currentPage }) {
|
|
26
|
+
const boundarySize = limit * 2 + 2;
|
|
27
|
+
const firstBoundary = 1 + boundarySize;
|
|
28
|
+
const lastBoundary = totalPages - boundarySize;
|
|
29
|
+
const totalShownPages = firstBoundary + 2;
|
|
30
|
+
if (currentPage <= firstBoundary - limit) {
|
|
31
|
+
return Array(totalShownPages)
|
|
32
|
+
.fill(null)
|
|
33
|
+
.map((_, index) => {
|
|
34
|
+
if (index === totalShownPages - 1) {
|
|
35
|
+
return {
|
|
36
|
+
type: 'number',
|
|
37
|
+
value: totalPages
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
else if (index === totalShownPages - 2) {
|
|
41
|
+
return {
|
|
42
|
+
type: 'symbol',
|
|
43
|
+
symbol: '.',
|
|
44
|
+
value: firstBoundary + 1
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
type: 'number',
|
|
49
|
+
value: index + 1
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
else if (currentPage >= lastBoundary + limit) {
|
|
54
|
+
return Array(totalShownPages)
|
|
55
|
+
.fill(null)
|
|
56
|
+
.map((_, index) => {
|
|
57
|
+
if (index === 0) {
|
|
58
|
+
return {
|
|
59
|
+
type: 'number',
|
|
60
|
+
value: 1
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
else if (index === 1) {
|
|
64
|
+
return {
|
|
65
|
+
type: 'symbol',
|
|
66
|
+
symbol: '.',
|
|
67
|
+
value: lastBoundary - 1
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
type: 'number',
|
|
72
|
+
value: lastBoundary + index - 2
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
else if (currentPage >= firstBoundary - limit && currentPage <= lastBoundary + limit) {
|
|
77
|
+
return Array(totalShownPages)
|
|
78
|
+
.fill(null)
|
|
79
|
+
.map((_, index) => {
|
|
80
|
+
if (index === 0) {
|
|
81
|
+
return {
|
|
82
|
+
type: 'number',
|
|
83
|
+
value: 1
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
else if (index === 1) {
|
|
87
|
+
return {
|
|
88
|
+
type: 'symbol',
|
|
89
|
+
symbol: '.',
|
|
90
|
+
value: currentPage - limit + (index - 2)
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
else if (index === totalShownPages - 1) {
|
|
94
|
+
return {
|
|
95
|
+
type: 'number',
|
|
96
|
+
value: totalPages
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
else if (index === totalShownPages - 2) {
|
|
100
|
+
return {
|
|
101
|
+
type: 'symbol',
|
|
102
|
+
symbol: '.',
|
|
103
|
+
value: currentPage + limit + 1
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
type: 'number',
|
|
108
|
+
value: currentPage - limit + (index - 2)
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
return [
|
|
113
|
+
|
|
114
|
+
];
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function getLimitThreshold(limit) {
|
|
118
|
+
const maximumUnlimitedPages = 3;
|
|
119
|
+
const numberOfBoundaryPages = 2;
|
|
120
|
+
return limit * 2 + maximumUnlimitedPages + numberOfBoundaryPages;
|
|
121
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export const BonusControllerTranslations = {
|
|
2
|
+
en: {
|
|
3
|
+
bonus: {
|
|
4
|
+
bonusCode: 'Do you have a bonus code',
|
|
5
|
+
placeholder: 'Enter your bonus code here',
|
|
6
|
+
invalidBonusCode: 'Invalid bonus code',
|
|
7
|
+
claim: 'Claim Bonus',
|
|
8
|
+
from: 'From',
|
|
9
|
+
to: 'to',
|
|
10
|
+
noBonus: 'No bonuses found',
|
|
11
|
+
filter: 'Filter',
|
|
12
|
+
error: 'Error',
|
|
13
|
+
forfeit: 'Forfeit',
|
|
14
|
+
invalidBonusCode: `The bonus code provided is invalid.`,
|
|
15
|
+
noActiveBonuses: `You have no active bonuses at the moment.`,
|
|
16
|
+
forfeitMessage: `Are you sure want to forfeit bonus?`,
|
|
17
|
+
forfeitConfirm: `Confirm`,
|
|
18
|
+
forfeitCancel: `Cancel`,
|
|
19
|
+
claimSuccessMessage: `Bonus claimed!`,
|
|
20
|
+
canlendarTitle: `Select the period`,
|
|
21
|
+
show: 'Show'
|
|
22
|
+
},
|
|
23
|
+
bonusType: {
|
|
24
|
+
standard: 'Bonus Money',
|
|
25
|
+
freeBet: 'Free Bet',
|
|
26
|
+
freeRound: 'Free Spins',
|
|
27
|
+
wagering: 'Wagering Challenge',
|
|
28
|
+
cashBack: 'Cash Back',
|
|
29
|
+
oddsBoost: 'Odds Boost',
|
|
30
|
+
stakeBack: 'Stake Back',
|
|
31
|
+
tournamentTicket: 'Ticket'
|
|
32
|
+
},
|
|
33
|
+
bonusCard: {
|
|
34
|
+
level: 'Level',
|
|
35
|
+
current: 'Current',
|
|
36
|
+
next: 'Next',
|
|
37
|
+
first: 'First',
|
|
38
|
+
last: 'Last',
|
|
39
|
+
previous: 'Previous',
|
|
40
|
+
startChallenge: 'START CHALLENGE',
|
|
41
|
+
rewards: 'Rewards',
|
|
42
|
+
join: 'Join',
|
|
43
|
+
forfeit: 'Forfeit',
|
|
44
|
+
terms: 'Terms and Conditions',
|
|
45
|
+
bonusType: 'Bonus Type',
|
|
46
|
+
levels: 'Levels',
|
|
47
|
+
validity: 'Validity',
|
|
48
|
+
bonusStatus: 'Bonus Status',
|
|
49
|
+
bonusAmount: 'Bonus Amount',
|
|
50
|
+
wagered:'Wagered',
|
|
51
|
+
wageredAmount: 'Wagered Amount',
|
|
52
|
+
roundNumber: 'Number of freespins',
|
|
53
|
+
game: 'Game',
|
|
54
|
+
validUntil: 'Valid Until',
|
|
55
|
+
wageringType: 'Wagering Type',
|
|
56
|
+
remaining: 'Remaining',
|
|
57
|
+
money: 'Money Wagering',
|
|
58
|
+
betCount: 'Bet Count',
|
|
59
|
+
allRewards: 'All Rewards',
|
|
60
|
+
error: 'Join failed, please try again.',
|
|
61
|
+
playNow: 'Play Now'
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { html } from 'lit-element';
|
|
2
|
+
|
|
3
|
+
import CasinoBonusesController from '../src/CasinoBonusesController';
|
|
4
|
+
|
|
5
|
+
// This default export determines where your story goes in the story list
|
|
6
|
+
export default {
|
|
7
|
+
title: 'CasinoBonusesController',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// 👇 We create a “template” of how args map to rendering
|
|
11
|
+
const CasinoBonusesController = ({ aProperty }) => html`<casino-bonuses-controller></casino-bonuses-controller>`;
|
|
12
|
+
|
|
13
|
+
export const FirstStory = CasinoBonusesController.bind({});
|