@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,20 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-ee6f3831.js';
2
+ export { s as setNonce } from './index-ee6f3831.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
4
+
5
+ /*
6
+ Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
7
+ */
8
+ var patchBrowser = () => {
9
+ const importMeta = import.meta.url;
10
+ const opts = {};
11
+ if (importMeta !== "") {
12
+ opts.resourcesUrl = new URL(".", importMeta).href;
13
+ }
14
+ return promiseResolve(opts);
15
+ };
16
+
17
+ patchBrowser().then(async (options) => {
18
+ await globalScripts();
19
+ return bootstrapLazy([["bonus-elevate-powerups-history_2",[[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);
20
+ });
@@ -0,0 +1,205 @@
1
+ export { B as bonus_elevate_powerups_history } from './bonus-elevate-powerups-history-f4ca3b40.js';
2
+ import { r as registerInstance, c as createEvent, h } from './index-ee6f3831.js';
3
+
4
+ const DEFAULT_LANGUAGE = 'en';
5
+ const SUPPORTED_LANGUAGES = ['pt-br', 'en', 'es-mx', 'hu', 'hr'];
6
+ const TRANSLATIONS = {
7
+ "en": {
8
+ "firstPage": '|<',
9
+ "lastPage": '>|',
10
+ "prePage": '<',
11
+ "nextPage": '>',
12
+ "pageOfTotal": '{start}-{end} of {total}',
13
+ },
14
+ "hu": {
15
+ "firstPage": 'First',
16
+ "lastPage": 'Last',
17
+ "prePage": '<',
18
+ "nextPage": '>',
19
+ "pageOfTotal": '{start}-{end} of {total}',
20
+ },
21
+ "hr": {
22
+ "firstPage": 'First',
23
+ "lastPage": 'Last',
24
+ "prePage": '<',
25
+ "nextPage": '>',
26
+ "pageOfTotal": '{start}-{end} of {total}',
27
+ },
28
+ "pt-br": {
29
+ "firstPage": 'First',
30
+ "lastPage": 'Last',
31
+ "prePage": '<',
32
+ "nextPage": '>',
33
+ "pageOfTotal": '{start}-{end} of {total}',
34
+ },
35
+ "es-mx": {
36
+ "firstPage": 'First',
37
+ "lastPage": 'Last',
38
+ "prePage": '<',
39
+ "nextPage": '>',
40
+ "pageOfTotal": '{start}-{end} of {total}',
41
+ }
42
+ };
43
+ const translate = (key, customLang, values) => {
44
+ const lang = customLang;
45
+ let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
46
+ if (values !== undefined) {
47
+ for (const [key, value] of Object.entries(values.values)) {
48
+ const regex = new RegExp(`{${key}}`, 'g');
49
+ translation = translation.replace(regex, value);
50
+ }
51
+ }
52
+ return translation;
53
+ };
54
+
55
+ 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}";
56
+ const BonusPaginationNavStyle0 = bonusPaginationNavCss;
57
+
58
+ const BonusPaginationNav = class {
59
+ constructor(hostRef) {
60
+ registerInstance(this, hostRef);
61
+ this.reloadPageEmitter = createEvent(this, "reloadPageByType", 7);
62
+ this.total = 1;
63
+ this.limit = 10;
64
+ this.offset = 0;
65
+ this.tableId = 'default';
66
+ this.language = 'en';
67
+ this.translationUrl = '';
68
+ this.arrowsActive = true;
69
+ this.secondaryArrowsActive = true;
70
+ this.displayPageNumbers = true;
71
+ this.displayRangeOfTotal = undefined;
72
+ this.navItemAccount = 5;
73
+ this.endPageIndex = 0;
74
+ this.pagesArray = undefined;
75
+ this.currentPage = 1;
76
+ this.showAsEllipsisMid = !this.arrowsActive;
77
+ }
78
+ pageLimitChangedHandler(event) {
79
+ this.limit = event.detail.limit ? event.detail.limit : this.limit;
80
+ //reset offset = 0, this.currentPage = 1 when page limit changed
81
+ this.currentPage = 1;
82
+ this.offset = 0;
83
+ this.updatePageStatus();
84
+ if (event.type == 'pageLimitChanged') {
85
+ this.reloadPageEmitter.emit({ offset: 0, limit: this.limit, tableId: this.tableId });
86
+ }
87
+ }
88
+ goTo(step) {
89
+ if (step == '...' || step == 0 || parseInt(step.toString(), 10) > (this.endPageIndex + 1)) {
90
+ return;
91
+ }
92
+ this.currentPage = step;
93
+ let offset = (this.currentPage - 1) * this.limit;
94
+ this.reloadPageEmitter.emit({ offset, limit: this.limit, tableId: this.tableId });
95
+ }
96
+ renderPageList() {
97
+ return h("ul", { class: 'PaginationArea' }, this.pagesArray.map((page) => {
98
+ return (h("li", { class: `PageItem ${this.currentPage == page ? 'Active' : ''}`, onClick: () => {
99
+ this.goTo(page);
100
+ } }, page));
101
+ }));
102
+ }
103
+ renderStylingWrapper() {
104
+ return h("general-styling-wrapper", { targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl });
105
+ }
106
+ /**
107
+ *
108
+ * @param maxNavItemsCount
109
+ * @param ellipsisMid
110
+ * @private
111
+ */
112
+ generateNavItemsByType(maxNavItemsCount, ellipsisMid) {
113
+ if (this.endPageIndex < maxNavItemsCount) {
114
+ return Array.from({ length: this.endPageIndex + 1 }, (_, i) => i + 1);
115
+ }
116
+ let pageArray = [];
117
+ /**
118
+ * Construct numbered navigation area based on current page position
119
+ * if ellipsisMid => 1, 2, 3 ... 8,9,10 / 1 ... 5,6,7,...10
120
+ * else => 1, 2, ... / ... 2, 3,4... / ... 9, 10
121
+ */
122
+ let halfOfMaxPageCount = Math.floor(maxNavItemsCount / 2);
123
+ const firstPageNo = 1, lastPageNo = this.endPageIndex + 1;
124
+ if (ellipsisMid) {
125
+ //Assume navItemAccount = 7, and totalPage = 10, in this case, we got halfOfMaxPageCount = 3,
126
+ if (this.currentPage < halfOfMaxPageCount || this.currentPage > (lastPageNo - halfOfMaxPageCount + 1)) {
127
+ //current page: (1, 2, 9, 10)
128
+ //Nav show as ( 1, 2, 3, ..., 8, 9, 10)
129
+ pageArray = Array.from({ length: halfOfMaxPageCount }, (_, i) => i + 1);
130
+ pageArray.push('...');
131
+ pageArray = pageArray.concat(Array.from({ length: halfOfMaxPageCount }, (_, i) => (this.endPageIndex - 1) + i));
132
+ }
133
+ else if (this.currentPage == halfOfMaxPageCount) {
134
+ //current page: 3 (=halfOfMaxPageCount)
135
+ //Nav show as ( 1, 2, 3, 4, ..., 9,10)
136
+ pageArray = Array.from({ length: halfOfMaxPageCount + 1 }, (_, i) => i + 1);
137
+ pageArray.push('...');
138
+ pageArray = pageArray.concat(Array.from({ length: halfOfMaxPageCount - 1 }, (_, i) => (this.endPageIndex) + i));
139
+ }
140
+ else if (this.currentPage == (lastPageNo - halfOfMaxPageCount + 1)) {
141
+ //current page: 8, (the page index after this.total - halfOfMaxPageCount ) Nav show as ( 1, 2, ... ,7, 8,9,10)
142
+ pageArray = Array.from({ length: halfOfMaxPageCount - 1 }, (_, i) => i + 1);
143
+ pageArray.push('...');
144
+ pageArray = pageArray.concat(Array.from({ length: halfOfMaxPageCount + 1 }, (_, i) => (this.endPageIndex - 2) + i));
145
+ }
146
+ else {
147
+ //current page: > 3 and < 7, let's say is 5 Nav show as ( 1, ..., 4, 5, 6, ... ,10)
148
+ pageArray = [firstPageNo, '...'];
149
+ pageArray = pageArray.concat([this.currentPage - 1], [this.currentPage], [this.currentPage + 1]);
150
+ pageArray = pageArray.concat(['...', lastPageNo]);
151
+ }
152
+ }
153
+ else {
154
+ if (this.currentPage <= (maxNavItemsCount - halfOfMaxPageCount)) { // when current page is in first half of nav
155
+ pageArray = Array.from({ length: (maxNavItemsCount - 1) }, (_, i) => i + 1);
156
+ pageArray.push('...');
157
+ }
158
+ else if (this.currentPage > (lastPageNo - (maxNavItemsCount - halfOfMaxPageCount))) { // when current page is in last half of nav
159
+ pageArray = Array.from({ length: (maxNavItemsCount - 1) }, (_, i) => lastPageNo - (maxNavItemsCount - 2) + i);
160
+ pageArray.unshift('...');
161
+ }
162
+ else {
163
+ pageArray = Array.from({ length: (maxNavItemsCount - 2) }, (_, i) => this.currentPage + i - halfOfMaxPageCount + 1);
164
+ pageArray.push('...');
165
+ pageArray.unshift('...');
166
+ }
167
+ }
168
+ return pageArray;
169
+ }
170
+ updatePageStatus() {
171
+ this.endPageIndex = (Math.ceil(this.total / this.limit) - 1);
172
+ this.endPageIndex = this.endPageIndex < 0 ? this.endPageIndex = 0 : this.endPageIndex;
173
+ this.pagesArray = this.generateNavItemsByType(this.navItemAccount, this.showAsEllipsisMid);
174
+ }
175
+ componentWillRender() {
176
+ this.currentPage = Math.floor(this.offset / this.limit) + 1;
177
+ this.updatePageStatus();
178
+ }
179
+ render() {
180
+ const startOffset = (this.currentPage - 1) * this.limit + 1;
181
+ const endOffset = this.currentPage * this.limit > this.total ? this.total : this.currentPage * this.limit;
182
+ return h("div", { key: '77610598f3ce40796b8d486fd27725fc68b61878', class: 'PageNavigationWrapper' }, this.displayRangeOfTotal && this.total > 0 && h("span", { key: '879bd2f268a18ea3c9cb2bb706d23c8db0634592', class: 'PageOfMessage' }, translate('pageOfTotal', this.language, {
183
+ values: {
184
+ start: startOffset,
185
+ end: endOffset,
186
+ total: this.total
187
+ }
188
+ })), h("div", { key: '590af1c2fcb70d782b318c505deb507a8376e13b', class: 'PageNavigation' }, this.arrowsActive &&
189
+ h("div", { key: '2d4746e889a43d6199ad7f305676d79bdbaa4f04', class: `PageArrow FirstPage ${this.currentPage == 1 ? 'Disabled' : ''}`, onClick: () => {
190
+ this.goTo(1);
191
+ } }, translate('firstPage', this.language)), this.secondaryArrowsActive &&
192
+ h("span", { key: '89b588abdf7b77e3cdc00f44bbad27c432146f97', class: `PageArrow PrePage ${this.currentPage == 1 ? 'Disabled' : ''}`, onClick: () => {
193
+ this.goTo(this.currentPage - 1);
194
+ } }, translate('prePage', this.language)), this.displayPageNumbers && this.renderPageList(), this.secondaryArrowsActive &&
195
+ h("span", { key: '097710df72de15cd1b0c03dfb2ac7870c99e12c0', class: `PageArrow NextPage ${this.currentPage == (this.endPageIndex + 1) ? 'Disabled' : ''}`, onClick: () => {
196
+ this.goTo(this.currentPage + 1);
197
+ } }, translate('nextPage', this.language)), this.arrowsActive &&
198
+ h("div", { key: 'a61296f3e627bc012545618c0fda239a1356da1f', class: `PageArrow LastPage ${this.currentPage == this.endPageIndex + 1 ? 'Disabled' : ''}`, onClick: () => {
199
+ this.goTo(this.endPageIndex + 1);
200
+ } }, " ", translate('lastPage', this.language), " "), this.renderStylingWrapper()));
201
+ }
202
+ };
203
+ BonusPaginationNav.style = BonusPaginationNavStyle0;
204
+
205
+ export { BonusPaginationNav as bonus_pagination_nav };