@everymatrix/bonus-elevate-powerups-history 0.0.1

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 (60) hide show
  1. package/dist/bonus-elevate-powerups-history/app-globals-0f993ce5.js +1 -0
  2. package/dist/bonus-elevate-powerups-history/bonus-elevate-powerups-history-f4ca3b40.js +9 -0
  3. package/dist/bonus-elevate-powerups-history/bonus-elevate-powerups-history.esm.js +1 -0
  4. package/dist/bonus-elevate-powerups-history/bonus-elevate-powerups-history_2.entry.js +1 -0
  5. package/dist/bonus-elevate-powerups-history/index-ee6f3831.js +2 -0
  6. package/dist/bonus-elevate-powerups-history/index.esm.js +1 -0
  7. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  8. package/dist/cjs/bonus-elevate-powerups-history-efe8778d.js +6036 -0
  9. package/dist/cjs/bonus-elevate-powerups-history.cjs.js +25 -0
  10. package/dist/cjs/bonus-elevate-powerups-history_2.cjs.entry.js +210 -0
  11. package/dist/cjs/index-c9c2e922.js +1290 -0
  12. package/dist/cjs/index.cjs.js +10 -0
  13. package/dist/cjs/loader.cjs.js +15 -0
  14. package/dist/collection/assets/clear-search.svg +9 -0
  15. package/dist/collection/assets/left-arrow.svg +3 -0
  16. package/dist/collection/collection-manifest.json +19 -0
  17. package/dist/collection/components/bonus-elevate-powerups-history/bonus-elevate-powerups-history.css +101 -0
  18. package/dist/collection/components/bonus-elevate-powerups-history/bonus-elevate-powerups-history.js +330 -0
  19. package/dist/collection/components/bonus-elevate-powerups-history/index.js +1 -0
  20. package/dist/collection/index.js +1 -0
  21. package/dist/collection/utils/locale.utils.js +48 -0
  22. package/dist/collection/utils/utils.js +24 -0
  23. package/dist/esm/app-globals-0f993ce5.js +3 -0
  24. package/dist/esm/bonus-elevate-powerups-history-f4ca3b40.js +6034 -0
  25. package/dist/esm/bonus-elevate-powerups-history.js +20 -0
  26. package/dist/esm/bonus-elevate-powerups-history_2.entry.js +205 -0
  27. package/dist/esm/index-ee6f3831.js +1263 -0
  28. package/dist/esm/index.js +2 -0
  29. package/dist/esm/loader.js +11 -0
  30. package/dist/index.cjs.js +1 -0
  31. package/dist/index.js +1 -0
  32. package/dist/stencil.config.dev.js +20 -0
  33. package/dist/stencil.config.js +20 -0
  34. package/dist/storybook/main.js +43 -0
  35. package/dist/storybook/preview.js +9 -0
  36. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-history/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  37. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-history/.stencil/libs/common/src/types/casino/powerups.d.ts +64 -0
  38. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-history/.stencil/packages/stencil/bonus-elevate-powerups-history/stencil.config.d.ts +2 -0
  39. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-history/.stencil/packages/stencil/bonus-elevate-powerups-history/stencil.config.dev.d.ts +2 -0
  40. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-history/.stencil/packages/stencil/bonus-elevate-powerups-history/storybook/main.d.ts +3 -0
  41. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-history/.stencil/packages/stencil/bonus-elevate-powerups-history/storybook/preview.d.ts +70 -0
  42. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-history/.stencil/tools/plugins/index.d.ts +4 -0
  43. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-history/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
  44. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-history/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  45. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-history/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  46. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-elevate-powerups-history/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  47. package/dist/types/components/bonus-elevate-powerups-history/bonus-elevate-powerups-history.d.ts +31 -0
  48. package/dist/types/components/bonus-elevate-powerups-history/index.d.ts +1 -0
  49. package/dist/types/components.d.ts +53 -0
  50. package/dist/types/index.d.ts +1 -0
  51. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  52. package/dist/types/utils/locale.utils.d.ts +2 -0
  53. package/dist/types/utils/utils.d.ts +21 -0
  54. package/loader/cdn.js +1 -0
  55. package/loader/index.cjs.js +1 -0
  56. package/loader/index.d.ts +24 -0
  57. package/loader/index.es2017.js +1 -0
  58. package/loader/index.js +2 -0
  59. package/loader/package.json +11 -0
  60. package/package.json +27 -0
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-c9c2e922.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
7
+
8
+ /*
9
+ Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
10
+ */
11
+ var patchBrowser = () => {
12
+ const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('bonus-elevate-powerups-history.cjs.js', document.baseURI).href));
13
+ const opts = {};
14
+ if (importMeta !== "") {
15
+ opts.resourcesUrl = new URL(".", importMeta).href;
16
+ }
17
+ return index.promiseResolve(opts);
18
+ };
19
+
20
+ patchBrowser().then(async (options) => {
21
+ await appGlobals.globalScripts();
22
+ return index.bootstrapLazy([["bonus-elevate-powerups-history_2.cjs",[[1,"bonus-elevate-powerups-history",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"endpoint":[513],"session":[513],"pageSize":[514,"page-size"],"translationUrl":[513,"translation-url"],"isLoading":[32],"powerups":[32],"offset":[32],"limit":[32],"total":[32]},[[8,"reloadPageByType","onReloadPageByType"]],{"offset":["loadData"],"limit":["loadData"],"language":["loadData"],"session":["loadData"],"endpoint":["loadData"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"translationUrl":["handleNewTranslations"]}],[0,"bonus-pagination-nav",{"total":[1538],"limit":[1538],"offset":[1538],"tableId":[1537,"table-id"],"language":[1537],"translationUrl":[513,"translation-url"],"arrowsActive":[1540,"arrows-active"],"secondaryArrowsActive":[1540,"secondary-arrows-active"],"displayPageNumbers":[1540,"display-page-numbers"],"displayRangeOfTotal":[1540,"display-range-of-total"],"navItemAccount":[1538,"nav-item-account"],"endPageIndex":[32],"pagesArray":[32],"currentPage":[32],"showAsEllipsisMid":[32]},[[8,"paginationReset","pageLimitChangedHandler"],[8,"pageLimitChanged","pageLimitChangedHandler"]]]]]], options);
23
+ });
24
+
25
+ exports.setNonce = index.setNonce;
@@ -0,0 +1,210 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const bonusElevatePowerupsHistory = require('./bonus-elevate-powerups-history-efe8778d.js');
6
+ const index = require('./index-c9c2e922.js');
7
+
8
+ const DEFAULT_LANGUAGE = 'en';
9
+ const SUPPORTED_LANGUAGES = ['pt-br', 'en', 'es-mx', 'hu', 'hr'];
10
+ const TRANSLATIONS = {
11
+ "en": {
12
+ "firstPage": '|<',
13
+ "lastPage": '>|',
14
+ "prePage": '<',
15
+ "nextPage": '>',
16
+ "pageOfTotal": '{start}-{end} of {total}',
17
+ },
18
+ "hu": {
19
+ "firstPage": 'First',
20
+ "lastPage": 'Last',
21
+ "prePage": '<',
22
+ "nextPage": '>',
23
+ "pageOfTotal": '{start}-{end} of {total}',
24
+ },
25
+ "hr": {
26
+ "firstPage": 'First',
27
+ "lastPage": 'Last',
28
+ "prePage": '<',
29
+ "nextPage": '>',
30
+ "pageOfTotal": '{start}-{end} of {total}',
31
+ },
32
+ "pt-br": {
33
+ "firstPage": 'First',
34
+ "lastPage": 'Last',
35
+ "prePage": '<',
36
+ "nextPage": '>',
37
+ "pageOfTotal": '{start}-{end} of {total}',
38
+ },
39
+ "es-mx": {
40
+ "firstPage": 'First',
41
+ "lastPage": 'Last',
42
+ "prePage": '<',
43
+ "nextPage": '>',
44
+ "pageOfTotal": '{start}-{end} of {total}',
45
+ }
46
+ };
47
+ const translate = (key, customLang, values) => {
48
+ const lang = customLang;
49
+ let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
50
+ if (values !== undefined) {
51
+ for (const [key, value] of Object.entries(values.values)) {
52
+ const regex = new RegExp(`{${key}}`, 'g');
53
+ translation = translation.replace(regex, value);
54
+ }
55
+ }
56
+ return translation;
57
+ };
58
+
59
+ const bonusPaginationNavCss = ":host{display:block}.PageNavigationWrapper{display:flex;flex-direction:row;height:100%;align-content:center}.PageNavigationWrapper .PageOfMessage{margin:5px;padding:5px 6px;margin:2px}.PageNavigation{display:flex;flex-direction:row;align-items:center}.PageNavigation .PageArrow{color:var(--emw--color-primary, #777676);padding:6px 5px;cursor:pointer;font-weight:bold;width:1.2rem;text-align:center}.PageNavigation .PageArrow.Disabled{color:var(--emw--color-gray-100, #e0e0e0)}ul.PaginationArea{list-style:none;padding:0px;margin:0px;display:flex}ul.PaginationArea li.PageItem{cursor:pointer;padding:5px 6px;margin:2px;width:0.9rem;text-align:center}ul.PaginationArea li.PageItem.Active,ul.PaginationArea li.PageItem:hover{font-weight:bold;color:var(--emw--color-primary, #f5f1f1);background-color:var(--emw--color-secondary, #8c8989);border-radius:0.3rem}";
60
+ const BonusPaginationNavStyle0 = bonusPaginationNavCss;
61
+
62
+ const BonusPaginationNav = class {
63
+ constructor(hostRef) {
64
+ index.registerInstance(this, hostRef);
65
+ this.reloadPageEmitter = index.createEvent(this, "reloadPageByType", 7);
66
+ this.total = 1;
67
+ this.limit = 10;
68
+ this.offset = 0;
69
+ this.tableId = 'default';
70
+ this.language = 'en';
71
+ this.translationUrl = '';
72
+ this.arrowsActive = true;
73
+ this.secondaryArrowsActive = true;
74
+ this.displayPageNumbers = true;
75
+ this.displayRangeOfTotal = undefined;
76
+ this.navItemAccount = 5;
77
+ this.endPageIndex = 0;
78
+ this.pagesArray = undefined;
79
+ this.currentPage = 1;
80
+ this.showAsEllipsisMid = !this.arrowsActive;
81
+ }
82
+ pageLimitChangedHandler(event) {
83
+ this.limit = event.detail.limit ? event.detail.limit : this.limit;
84
+ //reset offset = 0, this.currentPage = 1 when page limit changed
85
+ this.currentPage = 1;
86
+ this.offset = 0;
87
+ this.updatePageStatus();
88
+ if (event.type == 'pageLimitChanged') {
89
+ this.reloadPageEmitter.emit({ offset: 0, limit: this.limit, tableId: this.tableId });
90
+ }
91
+ }
92
+ goTo(step) {
93
+ if (step == '...' || step == 0 || parseInt(step.toString(), 10) > (this.endPageIndex + 1)) {
94
+ return;
95
+ }
96
+ this.currentPage = step;
97
+ let offset = (this.currentPage - 1) * this.limit;
98
+ this.reloadPageEmitter.emit({ offset, limit: this.limit, tableId: this.tableId });
99
+ }
100
+ renderPageList() {
101
+ return index.h("ul", { class: 'PaginationArea' }, this.pagesArray.map((page) => {
102
+ return (index.h("li", { class: `PageItem ${this.currentPage == page ? 'Active' : ''}`, onClick: () => {
103
+ this.goTo(page);
104
+ } }, page));
105
+ }));
106
+ }
107
+ renderStylingWrapper() {
108
+ return index.h("general-styling-wrapper", { targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl });
109
+ }
110
+ /**
111
+ *
112
+ * @param maxNavItemsCount
113
+ * @param ellipsisMid
114
+ * @private
115
+ */
116
+ generateNavItemsByType(maxNavItemsCount, ellipsisMid) {
117
+ if (this.endPageIndex < maxNavItemsCount) {
118
+ return Array.from({ length: this.endPageIndex + 1 }, (_, i) => i + 1);
119
+ }
120
+ let pageArray = [];
121
+ /**
122
+ * Construct numbered navigation area based on current page position
123
+ * if ellipsisMid => 1, 2, 3 ... 8,9,10 / 1 ... 5,6,7,...10
124
+ * else => 1, 2, ... / ... 2, 3,4... / ... 9, 10
125
+ */
126
+ let halfOfMaxPageCount = Math.floor(maxNavItemsCount / 2);
127
+ const firstPageNo = 1, lastPageNo = this.endPageIndex + 1;
128
+ if (ellipsisMid) {
129
+ //Assume navItemAccount = 7, and totalPage = 10, in this case, we got halfOfMaxPageCount = 3,
130
+ if (this.currentPage < halfOfMaxPageCount || this.currentPage > (lastPageNo - halfOfMaxPageCount + 1)) {
131
+ //current page: (1, 2, 9, 10)
132
+ //Nav show as ( 1, 2, 3, ..., 8, 9, 10)
133
+ pageArray = Array.from({ length: halfOfMaxPageCount }, (_, i) => i + 1);
134
+ pageArray.push('...');
135
+ pageArray = pageArray.concat(Array.from({ length: halfOfMaxPageCount }, (_, i) => (this.endPageIndex - 1) + i));
136
+ }
137
+ else if (this.currentPage == halfOfMaxPageCount) {
138
+ //current page: 3 (=halfOfMaxPageCount)
139
+ //Nav show as ( 1, 2, 3, 4, ..., 9,10)
140
+ pageArray = Array.from({ length: halfOfMaxPageCount + 1 }, (_, i) => i + 1);
141
+ pageArray.push('...');
142
+ pageArray = pageArray.concat(Array.from({ length: halfOfMaxPageCount - 1 }, (_, i) => (this.endPageIndex) + i));
143
+ }
144
+ else if (this.currentPage == (lastPageNo - halfOfMaxPageCount + 1)) {
145
+ //current page: 8, (the page index after this.total - halfOfMaxPageCount ) Nav show as ( 1, 2, ... ,7, 8,9,10)
146
+ pageArray = Array.from({ length: halfOfMaxPageCount - 1 }, (_, i) => i + 1);
147
+ pageArray.push('...');
148
+ pageArray = pageArray.concat(Array.from({ length: halfOfMaxPageCount + 1 }, (_, i) => (this.endPageIndex - 2) + i));
149
+ }
150
+ else {
151
+ //current page: > 3 and < 7, let's say is 5 Nav show as ( 1, ..., 4, 5, 6, ... ,10)
152
+ pageArray = [firstPageNo, '...'];
153
+ pageArray = pageArray.concat([this.currentPage - 1], [this.currentPage], [this.currentPage + 1]);
154
+ pageArray = pageArray.concat(['...', lastPageNo]);
155
+ }
156
+ }
157
+ else {
158
+ if (this.currentPage <= (maxNavItemsCount - halfOfMaxPageCount)) { // when current page is in first half of nav
159
+ pageArray = Array.from({ length: (maxNavItemsCount - 1) }, (_, i) => i + 1);
160
+ pageArray.push('...');
161
+ }
162
+ else if (this.currentPage > (lastPageNo - (maxNavItemsCount - halfOfMaxPageCount))) { // when current page is in last half of nav
163
+ pageArray = Array.from({ length: (maxNavItemsCount - 1) }, (_, i) => lastPageNo - (maxNavItemsCount - 2) + i);
164
+ pageArray.unshift('...');
165
+ }
166
+ else {
167
+ pageArray = Array.from({ length: (maxNavItemsCount - 2) }, (_, i) => this.currentPage + i - halfOfMaxPageCount + 1);
168
+ pageArray.push('...');
169
+ pageArray.unshift('...');
170
+ }
171
+ }
172
+ return pageArray;
173
+ }
174
+ updatePageStatus() {
175
+ this.endPageIndex = (Math.ceil(this.total / this.limit) - 1);
176
+ this.endPageIndex = this.endPageIndex < 0 ? this.endPageIndex = 0 : this.endPageIndex;
177
+ this.pagesArray = this.generateNavItemsByType(this.navItemAccount, this.showAsEllipsisMid);
178
+ }
179
+ componentWillRender() {
180
+ this.currentPage = Math.floor(this.offset / this.limit) + 1;
181
+ this.updatePageStatus();
182
+ }
183
+ render() {
184
+ const startOffset = (this.currentPage - 1) * this.limit + 1;
185
+ const endOffset = this.currentPage * this.limit > this.total ? this.total : this.currentPage * this.limit;
186
+ return index.h("div", { key: '77610598f3ce40796b8d486fd27725fc68b61878', class: 'PageNavigationWrapper' }, this.displayRangeOfTotal && this.total > 0 && index.h("span", { key: '879bd2f268a18ea3c9cb2bb706d23c8db0634592', class: 'PageOfMessage' }, translate('pageOfTotal', this.language, {
187
+ values: {
188
+ start: startOffset,
189
+ end: endOffset,
190
+ total: this.total
191
+ }
192
+ })), index.h("div", { key: '590af1c2fcb70d782b318c505deb507a8376e13b', class: 'PageNavigation' }, this.arrowsActive &&
193
+ index.h("div", { key: '2d4746e889a43d6199ad7f305676d79bdbaa4f04', class: `PageArrow FirstPage ${this.currentPage == 1 ? 'Disabled' : ''}`, onClick: () => {
194
+ this.goTo(1);
195
+ } }, translate('firstPage', this.language)), this.secondaryArrowsActive &&
196
+ index.h("span", { key: '89b588abdf7b77e3cdc00f44bbad27c432146f97', class: `PageArrow PrePage ${this.currentPage == 1 ? 'Disabled' : ''}`, onClick: () => {
197
+ this.goTo(this.currentPage - 1);
198
+ } }, translate('prePage', this.language)), this.displayPageNumbers && this.renderPageList(), this.secondaryArrowsActive &&
199
+ index.h("span", { key: '097710df72de15cd1b0c03dfb2ac7870c99e12c0', class: `PageArrow NextPage ${this.currentPage == (this.endPageIndex + 1) ? 'Disabled' : ''}`, onClick: () => {
200
+ this.goTo(this.currentPage + 1);
201
+ } }, translate('nextPage', this.language)), this.arrowsActive &&
202
+ index.h("div", { key: 'a61296f3e627bc012545618c0fda239a1356da1f', class: `PageArrow LastPage ${this.currentPage == this.endPageIndex + 1 ? 'Disabled' : ''}`, onClick: () => {
203
+ this.goTo(this.endPageIndex + 1);
204
+ } }, " ", translate('lastPage', this.language), " "), this.renderStylingWrapper()));
205
+ }
206
+ };
207
+ BonusPaginationNav.style = BonusPaginationNavStyle0;
208
+
209
+ exports.bonus_elevate_powerups_history = bonusElevatePowerupsHistory.BonusElevatePowerupsHistory;
210
+ exports.bonus_pagination_nav = BonusPaginationNav;