@everymatrix/player-elevate-points-history 1.31.2

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.
Files changed (100) hide show
  1. package/dist/assets/back.svg +3 -0
  2. package/dist/assets/menu.svg +5 -0
  3. package/dist/cjs/bonus-pagination-limits_6.cjs.entry.js +1115 -0
  4. package/dist/cjs/index-974f5239.js +1686 -0
  5. package/dist/cjs/index.cjs.js +2 -0
  6. package/dist/cjs/loader.cjs.js +21 -0
  7. package/dist/cjs/player-elevate-card-items-67656c5f.js +2477 -0
  8. package/dist/cjs/player-elevate-card.cjs.entry.js +77 -0
  9. package/dist/cjs/player-elevate-loyaltycard.cjs.entry.js +84 -0
  10. package/dist/cjs/player-elevate-points-history.cjs.js +19 -0
  11. package/dist/collection/collection-manifest.json +40 -0
  12. package/dist/collection/components/player-elevate-points-history/player-elevate-points-history.css +174 -0
  13. package/dist/collection/components/player-elevate-points-history/player-elevate-points-history.js +395 -0
  14. package/dist/collection/index.js +1 -0
  15. package/dist/collection/renders/renderTabs.js +11 -0
  16. package/dist/collection/renders/renderTopBar.js +12 -0
  17. package/dist/collection/renders/renderWallets.js +44 -0
  18. package/dist/collection/static/back.svg +3 -0
  19. package/dist/collection/static/menu.svg +5 -0
  20. package/dist/collection/utils/business.js +17 -0
  21. package/dist/collection/utils/fetch.js +17 -0
  22. package/dist/collection/utils/translation.js +35 -0
  23. package/dist/collection/utils/types.js +6 -0
  24. package/dist/collection/utils/util.js +16 -0
  25. package/dist/components/bonus-pagination-limits.js +6 -0
  26. package/dist/components/bonus-pagination-limits2.js +111 -0
  27. package/dist/components/bonus-pagination-nav.js +6 -0
  28. package/dist/components/bonus-pagination-nav2.js +219 -0
  29. package/dist/components/general-styling-wrapper.js +6 -0
  30. package/dist/components/general-styling-wrapper2.js +104 -0
  31. package/dist/components/index.d.ts +26 -0
  32. package/dist/components/index.js +1 -0
  33. package/dist/components/player-elevate-card-data.js +6 -0
  34. package/dist/components/player-elevate-card-data2.js +625 -0
  35. package/dist/components/player-elevate-card-items.js +2250 -0
  36. package/dist/components/player-elevate-card.js +119 -0
  37. package/dist/components/player-elevate-loyaltycard.js +125 -0
  38. package/dist/components/player-elevate-pointcard.js +6 -0
  39. package/dist/components/player-elevate-pointcard2.js +125 -0
  40. package/dist/components/player-elevate-points-history.d.ts +11 -0
  41. package/dist/components/player-elevate-points-history.js +363 -0
  42. package/dist/esm/bonus-pagination-limits_6.entry.js +1106 -0
  43. package/dist/esm/index-18159ab2.js +1657 -0
  44. package/dist/esm/index.js +1 -0
  45. package/dist/esm/loader.js +17 -0
  46. package/dist/esm/player-elevate-card-items-96ed621b.js +2464 -0
  47. package/dist/esm/player-elevate-card.entry.js +73 -0
  48. package/dist/esm/player-elevate-loyaltycard.entry.js +80 -0
  49. package/dist/esm/player-elevate-points-history.js +17 -0
  50. package/dist/esm/polyfills/core-js.js +11 -0
  51. package/dist/esm/polyfills/css-shim.js +1 -0
  52. package/dist/esm/polyfills/dom.js +79 -0
  53. package/dist/esm/polyfills/es5-html-element.js +1 -0
  54. package/dist/esm/polyfills/index.js +34 -0
  55. package/dist/esm/polyfills/system.js +6 -0
  56. package/dist/index.cjs.js +1 -0
  57. package/dist/index.js +1 -0
  58. package/dist/player-elevate-points-history/index.esm.js +0 -0
  59. package/dist/player-elevate-points-history/p-3073cebd.js +1 -0
  60. package/dist/player-elevate-points-history/p-50a08f34.entry.js +1 -0
  61. package/dist/player-elevate-points-history/p-a937ac54.js +1 -0
  62. package/dist/player-elevate-points-history/p-b0fd409d.entry.js +1 -0
  63. package/dist/player-elevate-points-history/p-e44be562.entry.js +1 -0
  64. package/dist/player-elevate-points-history/player-elevate-points-history.esm.js +1 -0
  65. package/dist/static/button-default.svg +42 -0
  66. package/dist/static/button-disabled.svg +4 -0
  67. package/dist/static/button-hover.svg +4 -0
  68. package/dist/static/button-level.svg +27 -0
  69. package/dist/static/button-pressed.svg +18 -0
  70. package/dist/static/button-redeem.svg +36 -0
  71. package/dist/static/card-ground-over.png +0 -0
  72. package/dist/static/card-ground-over.svg +903 -0
  73. package/dist/static/card-ground.png +0 -0
  74. package/dist/static/card-ground.svg +34 -0
  75. package/dist/static/info.svg +4 -0
  76. package/dist/static/level-badge.png +0 -0
  77. package/dist/static/level-percent.svg +80 -0
  78. package/dist/static/tips-info.svg +21 -0
  79. package/dist/static/user.svg +3 -0
  80. package/dist/stencil.config.js +31 -0
  81. package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/emfe-widgets/widgets-stencil/packages/player-elevate-points-history/.stencil/packages/player-elevate-points-history/stencil.config.d.ts +2 -0
  82. package/dist/types/components/player-elevate-points-history/player-elevate-points-history.d.ts +66 -0
  83. package/dist/types/components.d.ts +126 -0
  84. package/dist/types/index.d.ts +1 -0
  85. package/dist/types/renders/renderTabs.d.ts +3 -0
  86. package/dist/types/renders/renderTopBar.d.ts +3 -0
  87. package/dist/types/renders/renderWallets.d.ts +3 -0
  88. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  89. package/dist/types/utils/business.d.ts +2 -0
  90. package/dist/types/utils/fetch.d.ts +2 -0
  91. package/dist/types/utils/translation.d.ts +35 -0
  92. package/dist/types/utils/types.d.ts +41 -0
  93. package/dist/types/utils/util.d.ts +1 -0
  94. package/loader/cdn.js +3 -0
  95. package/loader/index.cjs.js +3 -0
  96. package/loader/index.d.ts +12 -0
  97. package/loader/index.es2017.js +3 -0
  98. package/loader/index.js +4 -0
  99. package/loader/package.json +10 -0
  100. package/package.json +31 -0
@@ -0,0 +1,395 @@
1
+ import { Component, h, Listen, Prop, State, Watch, Event } from '@stencil/core';
2
+ import { WalletType } from '../../utils/types';
3
+ import { translation } from '../../utils/translation';
4
+ import { getWallets } from '../../utils/business';
5
+ import { renderWallets } from '../../renders/renderWallets';
6
+ import { renderTopBar } from '../../renders/renderTopBar';
7
+ import { renderTabs } from '../../renders/renderTabs';
8
+ import '@everymatrix/general-styling-wrapper';
9
+ import '@everymatrix/player-elevate-card';
10
+ import '@everymatrix/bonus-pagination-limits';
11
+ import '@everymatrix/bonus-pagination-nav';
12
+ export class PlayerElevatePointsHistory {
13
+ constructor() {
14
+ /**
15
+ * Customize pagination: Activate pagination secondary arrows
16
+ */
17
+ this.secondaryArrowsActive = true;
18
+ /**
19
+ * Customize pagination: Activate pagination numbered navigation
20
+ */
21
+ this.displayPageNumbers = false;
22
+ /**
23
+ * Customize page list options, default: 10,25,50
24
+ */
25
+ this.pageLimitOptions = '10,25,50';
26
+ /**
27
+ * Language of the widget
28
+ */
29
+ this.language = 'en';
30
+ /**
31
+ * Client custom styling via string
32
+ */
33
+ this.clientStyling = '';
34
+ /**
35
+ * Client custom styling via url
36
+ */
37
+ this.clientStylingUrl = '';
38
+ /**
39
+ * translation via url
40
+ */
41
+ this.translationUrl = '';
42
+ this.locale = translation['en'];
43
+ this.type = WalletType.spendable;
44
+ this.pointsWallets = {};
45
+ }
46
+ switchTab(type) {
47
+ var _a, _b;
48
+ this.type = type;
49
+ if (this.pointsWallets[type] || !((_a = this.pointsWallets[type]) === null || _a === void 0 ? void 0 : _a.isLoadFailed)) {
50
+ return;
51
+ }
52
+ this.paginationReset.emit({ limit: ((_b = this.pointsWallets[type]) === null || _b === void 0 ? void 0 : _b.pageSetting.limit) || this.limit, tableId: this.type });
53
+ }
54
+ getPageSettingByType(type) {
55
+ return this.pointsWallets[type] ? this.pointsWallets[type].pageSetting : {
56
+ limit: this.limit, total: 0, offset: 0, tableId: type,
57
+ secondaryArrowsActive: this.secondaryArrowsActive,
58
+ displayPageNumbers: this.displayPageNumbers,
59
+ pageLimitOptions: this.pageLimitOptions || undefined
60
+ };
61
+ }
62
+ render() {
63
+ var _a, _b;
64
+ const pageSetting = this.getPageSettingByType(this.type);
65
+ return (h("main", null,
66
+ h("general-styling-wrapper", { clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl,
67
+ // @ts-ignore
68
+ targetTranslations: translation, translationUrl: this.translationUrl }),
69
+ h("player-elevate-pointcard", { playerAvatarUrl: this.playerAvatarUrl, endpoint: this.endpoint, session: this.session, language: this.language, clientStylingUrl: this.clientStylingUrl, clientStyling: this.clientStyling, translationUrl: this.translationUrl }),
70
+ h("div", { class: "PlayerElevatePointsDetaisContainer" }, [
71
+ renderTopBar(this.locale, this.type, pageSetting),
72
+ renderTabs(this.locale, this.type, (type) => this.switchTab(type)),
73
+ ((_a = this.pointsWallets[this.type]) === null || _a === void 0 ? void 0 : _a.isLoadFailed)
74
+ ? h("div", { class: 'ReloadMsg' },
75
+ this.locale['reloadMsgWhenError'],
76
+ h("a", { class: 'Reload', onClick: () => { this.updateWallets(); } }, this.locale['reload']))
77
+ : renderWallets(this.locale, ((_b = this.pointsWallets[this.type]) === null || _b === void 0 ? void 0 : _b.wallets) || [], pageSetting)
78
+ ])));
79
+ }
80
+ walletTypeChangedHandler() {
81
+ //do not reload when loaded tab switched back
82
+ if (this.pointsWallets[this.type]) {
83
+ return;
84
+ }
85
+ this.updateWallets();
86
+ }
87
+ async updateWallets() {
88
+ let pageSetting = this.pointsWallets[this.type]
89
+ ? this.pointsWallets[this.type].pageSetting
90
+ : this.getPageSettingByType(this.type);
91
+ try {
92
+ const walletsDetail = await getWallets(this.endpoint, this.language, this.type, this.session, pageSetting);
93
+ const wallets = walletsDetail.data || [];
94
+ if (walletsDetail.success) {
95
+ pageSetting.total = walletsDetail.total;
96
+ this.pointsWallets[this.type] = { wallets, pageSetting };
97
+ this.pointsWallets = Object.assign({}, this.pointsWallets);
98
+ }
99
+ else {
100
+ console.error(walletsDetail);
101
+ this.pointsWallets[this.type].isLoadFailed = true;
102
+ //pageSetting.total = 0;
103
+ }
104
+ }
105
+ catch (e) {
106
+ console.error(e);
107
+ this.pointsWallets[this.type].isLoadFailed = true;
108
+ }
109
+ }
110
+ reloadPageByTypeHandler(event) {
111
+ if (event.detail.tableId != this.type) {
112
+ return;
113
+ }
114
+ //reset all wallets when limit changed
115
+ //otherwise fetch new data with new offset when offset changed
116
+ if (this.limit != event.detail.limit) {
117
+ this.pointsWallets = {};
118
+ this.limit = event.detail.limit;
119
+ }
120
+ else {
121
+ let pageSetting = this.pointsWallets[this.type].pageSetting || this.getPageSettingByType(this.type);
122
+ pageSetting.offset = event.detail.offset;
123
+ this.pointsWallets[this.type].pageSetting = pageSetting;
124
+ }
125
+ this.updateWallets();
126
+ }
127
+ setLimit() {
128
+ try {
129
+ const pageLimits = this.pageLimitOptions.split(',').map((item) => {
130
+ return parseInt(item);
131
+ });
132
+ if (pageLimits.includes(this.limit)) {
133
+ //do nothing
134
+ }
135
+ else {
136
+ this.limit = pageLimits[0];
137
+ }
138
+ }
139
+ catch (e) {
140
+ console.error('Error when parse PageLimitOptions', e);
141
+ this.limit = 10;
142
+ }
143
+ }
144
+ async componentWillLoad() {
145
+ this.setLimit();
146
+ this.updateWallets();
147
+ }
148
+ static get is() { return "player-elevate-points-history"; }
149
+ static get encapsulation() { return "shadow"; }
150
+ static get originalStyleUrls() { return {
151
+ "$": ["player-elevate-points-history.scss"]
152
+ }; }
153
+ static get styleUrls() { return {
154
+ "$": ["player-elevate-points-history.css"]
155
+ }; }
156
+ static get assetsDirs() { return ["static"]; }
157
+ static get properties() { return {
158
+ "playerAvatarUrl": {
159
+ "type": "string",
160
+ "mutable": false,
161
+ "complexType": {
162
+ "original": "string",
163
+ "resolved": "string",
164
+ "references": {}
165
+ },
166
+ "required": false,
167
+ "optional": false,
168
+ "docs": {
169
+ "tags": [],
170
+ "text": "player avatar url"
171
+ },
172
+ "attribute": "player-avatar-url",
173
+ "reflect": true
174
+ },
175
+ "session": {
176
+ "type": "string",
177
+ "mutable": false,
178
+ "complexType": {
179
+ "original": "string",
180
+ "resolved": "string",
181
+ "references": {}
182
+ },
183
+ "required": false,
184
+ "optional": false,
185
+ "docs": {
186
+ "tags": [],
187
+ "text": "User Session"
188
+ },
189
+ "attribute": "session",
190
+ "reflect": true
191
+ },
192
+ "endpoint": {
193
+ "type": "string",
194
+ "mutable": false,
195
+ "complexType": {
196
+ "original": "string",
197
+ "resolved": "string",
198
+ "references": {}
199
+ },
200
+ "required": false,
201
+ "optional": false,
202
+ "docs": {
203
+ "tags": [],
204
+ "text": "Endpoint URL for the source of data"
205
+ },
206
+ "attribute": "endpoint",
207
+ "reflect": true
208
+ },
209
+ "limit": {
210
+ "type": "number",
211
+ "mutable": true,
212
+ "complexType": {
213
+ "original": "number",
214
+ "resolved": "number",
215
+ "references": {}
216
+ },
217
+ "required": false,
218
+ "optional": false,
219
+ "docs": {
220
+ "tags": [],
221
+ "text": "User Session"
222
+ },
223
+ "attribute": "limit",
224
+ "reflect": true
225
+ },
226
+ "secondaryArrowsActive": {
227
+ "type": "boolean",
228
+ "mutable": true,
229
+ "complexType": {
230
+ "original": "boolean",
231
+ "resolved": "boolean",
232
+ "references": {}
233
+ },
234
+ "required": false,
235
+ "optional": false,
236
+ "docs": {
237
+ "tags": [],
238
+ "text": "Customize pagination: Activate pagination secondary arrows"
239
+ },
240
+ "attribute": "secondary-arrows-active",
241
+ "reflect": true,
242
+ "defaultValue": "true"
243
+ },
244
+ "displayPageNumbers": {
245
+ "type": "boolean",
246
+ "mutable": true,
247
+ "complexType": {
248
+ "original": "boolean",
249
+ "resolved": "boolean",
250
+ "references": {}
251
+ },
252
+ "required": false,
253
+ "optional": false,
254
+ "docs": {
255
+ "tags": [],
256
+ "text": "Customize pagination: Activate pagination numbered navigation"
257
+ },
258
+ "attribute": "display-page-numbers",
259
+ "reflect": true,
260
+ "defaultValue": "false"
261
+ },
262
+ "pageLimitOptions": {
263
+ "type": "string",
264
+ "mutable": true,
265
+ "complexType": {
266
+ "original": "string",
267
+ "resolved": "string",
268
+ "references": {}
269
+ },
270
+ "required": false,
271
+ "optional": false,
272
+ "docs": {
273
+ "tags": [],
274
+ "text": "Customize page list options, default: 10,25,50"
275
+ },
276
+ "attribute": "page-limit-options",
277
+ "reflect": true,
278
+ "defaultValue": "'10,25,50'"
279
+ },
280
+ "language": {
281
+ "type": "string",
282
+ "mutable": false,
283
+ "complexType": {
284
+ "original": "string",
285
+ "resolved": "string",
286
+ "references": {}
287
+ },
288
+ "required": false,
289
+ "optional": false,
290
+ "docs": {
291
+ "tags": [],
292
+ "text": "Language of the widget"
293
+ },
294
+ "attribute": "language",
295
+ "reflect": true,
296
+ "defaultValue": "'en'"
297
+ },
298
+ "clientStyling": {
299
+ "type": "string",
300
+ "mutable": false,
301
+ "complexType": {
302
+ "original": "string",
303
+ "resolved": "string",
304
+ "references": {}
305
+ },
306
+ "required": false,
307
+ "optional": false,
308
+ "docs": {
309
+ "tags": [],
310
+ "text": "Client custom styling via string"
311
+ },
312
+ "attribute": "client-styling",
313
+ "reflect": true,
314
+ "defaultValue": "''"
315
+ },
316
+ "clientStylingUrl": {
317
+ "type": "string",
318
+ "mutable": false,
319
+ "complexType": {
320
+ "original": "string",
321
+ "resolved": "string",
322
+ "references": {}
323
+ },
324
+ "required": false,
325
+ "optional": false,
326
+ "docs": {
327
+ "tags": [],
328
+ "text": "Client custom styling via url"
329
+ },
330
+ "attribute": "client-styling-url",
331
+ "reflect": true,
332
+ "defaultValue": "''"
333
+ },
334
+ "translationUrl": {
335
+ "type": "string",
336
+ "mutable": false,
337
+ "complexType": {
338
+ "original": "string",
339
+ "resolved": "string",
340
+ "references": {}
341
+ },
342
+ "required": false,
343
+ "optional": false,
344
+ "docs": {
345
+ "tags": [],
346
+ "text": "translation via url"
347
+ },
348
+ "attribute": "translation-url",
349
+ "reflect": true,
350
+ "defaultValue": "''"
351
+ }
352
+ }; }
353
+ static get states() { return {
354
+ "locale": {},
355
+ "type": {},
356
+ "pageSetting": {},
357
+ "pointsWallets": {}
358
+ }; }
359
+ static get events() { return [{
360
+ "method": "paginationReset",
361
+ "name": "paginationReset",
362
+ "bubbles": true,
363
+ "cancelable": true,
364
+ "composed": true,
365
+ "docs": {
366
+ "tags": [],
367
+ "text": ""
368
+ },
369
+ "complexType": {
370
+ "original": "any",
371
+ "resolved": "any",
372
+ "references": {}
373
+ }
374
+ }]; }
375
+ static get watchers() { return [{
376
+ "propName": "type",
377
+ "methodName": "walletTypeChangedHandler"
378
+ }, {
379
+ "propName": "endpoint",
380
+ "methodName": "updateWallets"
381
+ }, {
382
+ "propName": "language",
383
+ "methodName": "updateWallets"
384
+ }, {
385
+ "propName": "session",
386
+ "methodName": "updateWallets"
387
+ }]; }
388
+ static get listeners() { return [{
389
+ "name": "reloadPageByType",
390
+ "method": "reloadPageByTypeHandler",
391
+ "target": undefined,
392
+ "capture": false,
393
+ "passive": false
394
+ }]; }
395
+ }
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,11 @@
1
+ import { h } from '@stencil/core';
2
+ import { WalletType } from '../utils/types';
3
+ export const renderTabs = (locale, type, onChangeTab) => h("div", { class: "Tabs Row" }, Object.keys(WalletType).map(key => {
4
+ const isActive = key === type;
5
+ const cssActive = isActive ? 'active' : '';
6
+ return (h("div", null,
7
+ h("div", { class: `TabText ${cssActive}`, onClick: () => {
8
+ onChangeTab(key);
9
+ } }, locale.tabTitle[key]),
10
+ h("div", { class: `TabBorderBottom ${cssActive}` })));
11
+ }));
@@ -0,0 +1,12 @@
1
+ import { h } from '@stencil/core';
2
+ import backSvg from '../static/back.svg';
3
+ import menuSvg from '../static/menu.svg';
4
+ export const renderTopBar = (locale, type, pageSetting) => h("div", { class: "TopBarContainer" },
5
+ h("div", { class: "BackImageContainer" },
6
+ h("span", { class: "BackImage", innerHTML: backSvg })),
7
+ h("div", { class: "TitleContainer" },
8
+ h("div", { class: "Title", title: locale.barTitle[type] }, locale.barTitle[type]),
9
+ h("div", { class: 'Limits' },
10
+ h("bonus-pagination-limits", { pageLimitOptions: pageSetting.pageLimitOptions, limit: pageSetting.limit }))),
11
+ h("div", null,
12
+ h("span", { class: "MenuImage", innerHTML: menuSvg })));
@@ -0,0 +1,44 @@
1
+ import { Fragment, h } from '@stencil/core';
2
+ export const renderWallets = (locale, wallets, pageSetting) => wallets && (h(Fragment, null,
3
+ h("div", { class: "Records" }, wallets.map(wallet => (h("div", { class: "RecordContainer" },
4
+ h("div", { class: "Row" },
5
+ h("div", { class: "Title" }, locale.pointType[wallet.pointType] || wallet.pointType),
6
+ h("div", { class: `Amount ${getAmountConfig(wallet.points).class}` },
7
+ getAmountConfig(wallet.points).symbol,
8
+ wallet.points)),
9
+ wallet.payload && wallet.payload.displayName &&
10
+ h("div", { class: "Row Desc", innerHTML: wallet.payload.displayName['*'] }),
11
+ h("div", { class: "Row" },
12
+ h("div", { class: "DateTime" }, formatDate(new Date(wallet.modified)))))))),
13
+ h("div", { class: "PaginationContainer" },
14
+ h("bonus-pagination-nav", { offset: pageSetting.offset, limit: pageSetting.limit, displayPageNumbers: pageSetting.displayPageNumbers, tableId: pageSetting.tableId, secondaryArrowsActive: pageSetting.secondaryArrowsActive, total: pageSetting.total }))));
15
+ const getAmountConfig = (amount) => {
16
+ if (amount > 0) {
17
+ return {
18
+ class: 'Positive',
19
+ symbol: '+'
20
+ };
21
+ }
22
+ else {
23
+ return {
24
+ class: 'Negative',
25
+ symbol: ''
26
+ };
27
+ }
28
+ };
29
+ const padTo2Digits = (num) => {
30
+ return num.toString().padStart(2, '0');
31
+ };
32
+ const formatDate = (date) => {
33
+ return ([
34
+ date.getFullYear(),
35
+ padTo2Digits(date.getMonth() + 1),
36
+ padTo2Digits(date.getDate()),
37
+ ].join('-') +
38
+ ' ' +
39
+ [
40
+ padTo2Digits(date.getHours()),
41
+ padTo2Digits(date.getMinutes()),
42
+ padTo2Digits(date.getSeconds()),
43
+ ].join(':'));
44
+ };
@@ -0,0 +1,3 @@
1
+ <svg width="9" height="15" viewBox="0 0 9 15" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M7.75 1L1.25 7.5L7.75 14" stroke="#242424" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="30" height="8" viewBox="0 0 30 8" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="4" cy="4" r="4" fill="black"/>
3
+ <circle cx="15" cy="4" r="4" fill="black"/>
4
+ <circle cx="26" cy="4" r="4" fill="black"/>
5
+ </svg>
@@ -0,0 +1,17 @@
1
+ import { fetcher, getUrl } from "./fetch";
2
+ import { WalletType } from "./types";
3
+ export const getWallets = async (endpoint, language, type, session, pageSetting) => {
4
+ const params = {
5
+ type,
6
+ language,
7
+ pagination: `offset=${pageSetting.offset},limit=${pageSetting.limit}`
8
+ };
9
+ const url = getUrl(endpoint + getUriByWalletType(params.type), params);
10
+ const res = await fetcher(url, {
11
+ headers: {
12
+ 'x-SessionId': session
13
+ }
14
+ });
15
+ return res;
16
+ };
17
+ const getUriByWalletType = (type) => `/v1/elevate/${type == WalletType.history ? 'redeemHistory' : 'pointsHistory'}`;
@@ -0,0 +1,17 @@
1
+ export const getUrl = (path, params = {}) => {
2
+ return path + '?' + Object.keys(params).map(key => `${key}=${params[key]}`).join('&');
3
+ };
4
+ export const fetcher = async (input, init = {}) => {
5
+ let res;
6
+ // @ts-ignore
7
+ res = await fetch(input, init);
8
+ res = await res.text();
9
+ try {
10
+ res = JSON.parse(res);
11
+ }
12
+ catch (e) {
13
+ console.error(e);
14
+ throw e;
15
+ }
16
+ return res;
17
+ };
@@ -0,0 +1,35 @@
1
+ import { WalletType } from "./types";
2
+ export const translation = {
3
+ en: {
4
+ tabTitle: {
5
+ [WalletType.spendable]: 'Coins',
6
+ [WalletType.loyalty]: 'XP',
7
+ [WalletType.history]: 'Conversion History'
8
+ },
9
+ barTitle: {
10
+ [WalletType.spendable]: 'Coins History',
11
+ [WalletType.loyalty]: 'Experience Points History',
12
+ [WalletType.history]: 'Conversion History'
13
+ },
14
+ bonus: 'Bonus',
15
+ redeem: 'Redeem',
16
+ reload: 'Reload',
17
+ reloadMsgWhenError: 'Network Problem, please ',
18
+ pointType: {
19
+ registration: 'Registration',
20
+ cancelledRegistration: 'Cancelled Registration',
21
+ expiredRegistration: 'Expired Registration',
22
+ manual: 'Manual',
23
+ cancelledManual: 'Cancelled Manual',
24
+ expiredManual: 'Expired Manual',
25
+ wageringByRealMoney: 'Real Money Wager',
26
+ wageringByBonusMoney: 'Bonus Money Wager',
27
+ cancelledWageringByRealMoney: 'Cancelled Real Money Wager',
28
+ cancelledWageringByBonusMoney: 'Cancelled Bonus Money Wager',
29
+ expiredWageringByRealMoney: 'Expired Real Money Wager',
30
+ expiredWageringByBonusMoney: 'Expired Bonus Money Wager',
31
+ levelExpired: 'Level Expiration',
32
+ bonus: 'Bonus Redeem',
33
+ }
34
+ }
35
+ };
@@ -0,0 +1,6 @@
1
+ export var WalletType;
2
+ (function (WalletType) {
3
+ WalletType["spendable"] = "spendable";
4
+ WalletType["loyalty"] = "loyalty";
5
+ WalletType["history"] = "history";
6
+ })(WalletType || (WalletType = {}));
@@ -0,0 +1,16 @@
1
+ function padTo2Digits(num) {
2
+ return num.toString().padStart(2, '0');
3
+ }
4
+ export function formatDate(date) {
5
+ return ([
6
+ date.getFullYear(),
7
+ padTo2Digits(date.getMonth() + 1),
8
+ padTo2Digits(date.getDate()),
9
+ ].join('-') +
10
+ ' ' +
11
+ [
12
+ padTo2Digits(date.getHours()),
13
+ padTo2Digits(date.getMinutes()),
14
+ padTo2Digits(date.getSeconds()),
15
+ ].join(':'));
16
+ }
@@ -0,0 +1,6 @@
1
+ import { B as BonusPaginationLimits$1, d as defineCustomElement$1 } from './bonus-pagination-limits2.js';
2
+
3
+ const BonusPaginationLimits = BonusPaginationLimits$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { BonusPaginationLimits, defineCustomElement };