@everymatrix/casino-tournament-slider 1.44.0 → 1.45.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 (50) hide show
  1. package/dist/casino-tournament-slider/casino-tournament-slider.esm.js +1 -1
  2. package/dist/casino-tournament-slider/p-01da553f.entry.js +1 -0
  3. package/dist/casino-tournament-slider/p-c541e3cd.js +2 -0
  4. package/dist/casino-tournament-slider/p-e1255160.js +1 -0
  5. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  6. package/dist/cjs/casino-tournament-slider.cjs.js +16 -10
  7. package/dist/cjs/casino-tournament-slider_2.cjs.entry.js +313 -330
  8. package/dist/cjs/index-e4a7f235.js +1279 -0
  9. package/dist/cjs/loader.cjs.js +6 -12
  10. package/dist/collection/collection-manifest.json +3 -3
  11. package/dist/collection/components/casino-tournament-slider/casino-tournament-slider.js +338 -328
  12. package/dist/collection/components/casino-tournament-slider/index.js +1 -0
  13. package/dist/collection/utils/locale.utils.js +34 -34
  14. package/dist/collection/utils/utils.js +1 -1
  15. package/dist/esm/app-globals-0f993ce5.js +3 -0
  16. package/dist/esm/casino-tournament-slider.js +13 -10
  17. package/dist/esm/casino-tournament-slider_2.entry.js +313 -330
  18. package/dist/esm/index-e38437e9.js +1252 -0
  19. package/dist/esm/loader.js +6 -12
  20. package/dist/stencil.config.dev.js +17 -0
  21. package/dist/stencil.config.js +14 -19
  22. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-tournament-slider/.stencil/packages/stencil/casino-tournament-slider/stencil.config.d.ts +2 -0
  23. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-tournament-slider/.stencil/packages/stencil/casino-tournament-slider/stencil.config.dev.d.ts +2 -0
  24. package/dist/types/components/casino-tournament-slider/casino-tournament-slider.d.ts +28 -28
  25. package/dist/types/components/casino-tournament-slider/index.d.ts +1 -0
  26. package/dist/types/stencil-public-runtime.d.ts +142 -33
  27. package/loader/cdn.js +1 -3
  28. package/loader/index.cjs.js +1 -3
  29. package/loader/index.d.ts +13 -1
  30. package/loader/index.es2017.js +1 -3
  31. package/loader/index.js +1 -3
  32. package/loader/package.json +1 -0
  33. package/package.json +11 -1
  34. package/dist/casino-tournament-slider/p-039bfb6a.entry.js +0 -1
  35. package/dist/casino-tournament-slider/p-7bade785.js +0 -1
  36. package/dist/cjs/index-f60eba31.js +0 -1263
  37. package/dist/components/casino-tournament-slider.d.ts +0 -11
  38. package/dist/components/casino-tournament-slider.js +0 -179
  39. package/dist/components/general-slider.js +0 -6
  40. package/dist/components/general-slider2.js +0 -257
  41. package/dist/components/index.d.ts +0 -26
  42. package/dist/components/index.js +0 -1
  43. package/dist/esm/index-c48feefa.js +0 -1237
  44. package/dist/esm/polyfills/core-js.js +0 -11
  45. package/dist/esm/polyfills/css-shim.js +0 -1
  46. package/dist/esm/polyfills/dom.js +0 -79
  47. package/dist/esm/polyfills/es5-html-element.js +0 -1
  48. package/dist/esm/polyfills/index.js +0 -34
  49. package/dist/esm/polyfills/system.js +0 -6
  50. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-tournament-slider/.stencil/packages/casino-tournament-slider/stencil.config.d.ts +0 -2
@@ -1,364 +1,347 @@
1
- import { r as registerInstance, h, g as getElement } from './index-c48feefa.js';
1
+ import { r as registerInstance, h, g as getElement } from './index-e38437e9.js';
2
2
 
3
3
  const DEFAULT_LANGUAGE = 'en';
4
4
  const TRANSLATIONS = {
5
- en: {
6
- playNow: 'Play now',
7
- sliderTitle: 'Participanting games'
8
- },
9
- 'zh-hk': {
10
- playNow: '现在播放',
11
- },
12
- fr: {
13
- playNow: 'Joue maintenant',
14
- },
15
- ro: {
16
- playNow: 'Joaca acum',
17
- },
18
- hu: {
19
- playNow: 'Játsszon most',
20
- },
21
- tr: {
22
- playNow: 'Şimdi oyna',
23
- },
24
- el: {
25
- playNow: 'Παίξε τώρα',
26
- },
27
- es: {
28
- playNow: 'Jugar Ya',
29
- },
30
- pt: {
31
- playNow: 'Jogue agora',
32
- },
33
- hr: {
34
- playNow: 'IGRAJ SADA',
35
- }
5
+ en: {
6
+ playNow: 'Play now',
7
+ sliderTitle: 'Participanting games'
8
+ },
9
+ 'zh-hk': {
10
+ playNow: '现在播放',
11
+ },
12
+ fr: {
13
+ playNow: 'Joue maintenant',
14
+ },
15
+ ro: {
16
+ playNow: 'Joaca acum',
17
+ },
18
+ hu: {
19
+ playNow: 'Játsszon most',
20
+ },
21
+ tr: {
22
+ playNow: 'Şimdi oyna',
23
+ },
24
+ el: {
25
+ playNow: 'Παίξε τώρα',
26
+ },
27
+ es: {
28
+ playNow: 'Jugar Ya',
29
+ },
30
+ pt: {
31
+ playNow: 'Jogue agora',
32
+ },
33
+ hr: {
34
+ playNow: 'IGRAJ SADA',
35
+ }
36
36
  };
37
37
  const translate = (key, customLang) => {
38
- var _a, _b;
39
- const lang = customLang;
40
- return ((_a = TRANSLATIONS[lang]) === null || _a === void 0 ? void 0 : _a[key]) || ((_b = TRANSLATIONS[DEFAULT_LANGUAGE]) === null || _b === void 0 ? void 0 : _b[key]);
38
+ var _a, _b;
39
+ const lang = customLang;
40
+ return ((_a = TRANSLATIONS[lang]) === null || _a === void 0 ? void 0 : _a[key]) || ((_b = TRANSLATIONS[DEFAULT_LANGUAGE]) === null || _b === void 0 ? void 0 : _b[key]);
41
41
  };
42
42
 
43
43
  const casinoTournamentSliderCss = ":host{display:block}.Item{color:white;display:flex;justify-content:center;align-items:center;font-weight:bold;font-size:10rem;user-select:none;overflow:hidden}.Item .Img{width:100%;height:100%}.PlayNowButton{position:absolute;background:var(--emfe-w-color-green, #48952a);display:block;box-sizing:border-box;padding:0.8rem 0.5rem;color:var(--emfe-w-color-white, #FFFFFF);text-transform:uppercase;text-align:center;font-weight:600;font-size:0.7rem;cursor:pointer;transition:opacity 0.4s linear;opacity:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ItemHover{opacity:1}.Items .Item:first-child{margin-left:0}.Items .Item:last-child{margin-right:0}.SliderTitle{display:flex;align-items:center;padding:6px 0;gap:11px}.Title{color:#fff;font-size:14px;font-weight:600}";
44
+ const CasinoTournamentSliderStyle0 = casinoTournamentSliderCss;
44
45
 
45
46
  const CasinoTournamentSlider = class {
46
- constructor(hostRef) {
47
- registerInstance(this, hostRef);
48
- this.gamesLimit = 30;
49
- this.offset = 0;
50
- this.slideNumber = 3;
51
- this.slideShow = 3;
52
- this.clientStyling = '';
53
- this.clientStylingUrl = '';
54
- this.showTitle = false;
55
- this.limitStylingAppends = false;
56
- this.enter = (index) => {
57
- this.hover = true;
58
- this.hoverIndex = index;
59
- };
60
- this.leave = () => {
61
- this.hover = false;
62
- this.hoverIndex = -1;
63
- };
64
- this.gameClicked = (item) => {
65
- window.postMessage({ type: 'TournamentGameAction', gameId: item.id, name: item.name }, window.location.href);
66
- };
67
- }
68
- todoCompletedHandler(event) {
69
- if (event.detail && this.useEvent) {
70
- if (!event.detail.games)
71
- return;
72
- this.games = event.detail.games.items;
47
+ constructor(hostRef) {
48
+ registerInstance(this, hostRef);
49
+ this.enter = (index) => {
50
+ this.hover = true;
51
+ this.hoverIndex = index;
52
+ };
53
+ this.leave = () => {
54
+ this.hover = false;
55
+ this.hoverIndex = -1;
56
+ };
57
+ this.gameClicked = (item) => {
58
+ window.postMessage({ type: 'TournamentGameAction', gameId: item.id, name: item.name }, window.location.href);
59
+ };
60
+ this.useEvent = undefined;
61
+ this.endpoint = undefined;
62
+ this.tournamentId = undefined;
63
+ this.session = undefined;
64
+ this.language = undefined;
65
+ this.gamesLimit = 30;
66
+ this.offset = 0;
67
+ this.slideNumber = 3;
68
+ this.slideShow = 3;
69
+ this.clientStyling = '';
70
+ this.clientStylingUrl = '';
71
+ this.showTitle = false;
72
+ this.limitStylingAppends = false;
73
+ this.games = undefined;
74
+ this.hover = undefined;
75
+ this.hoverIndex = undefined;
76
+ }
77
+ todoCompletedHandler(event) {
78
+ if (event.detail && this.useEvent) {
79
+ if (!event.detail.games)
80
+ return;
81
+ this.games = event.detail.games.items;
82
+ }
83
+ }
84
+ getTournamentInfo() {
85
+ let url = new URL(this.endpoint + `/v1/tournaments/${this.tournamentId}`);
86
+ let reqHeaders = new Headers();
87
+ url.searchParams.append('expand', 'games');
88
+ url.searchParams.append('language', this.language);
89
+ url.searchParams.append('pagination', `games(limit=${this.gamesLimit},offset=${this.offset})`);
90
+ url.searchParams.append('fields', 'games(id,name,thumbnail)');
91
+ if (this.session) {
92
+ reqHeaders.append('X-SessionId', this.session);
93
+ }
94
+ let requestOptions = {
95
+ method: 'GET',
96
+ headers: reqHeaders,
97
+ };
98
+ fetch(url.href, requestOptions).then((res) => res.json())
99
+ .then((res) => {
100
+ this.games = res.item.games.items;
101
+ });
102
+ }
103
+ componentWillLoad() {
104
+ if (!this.useEvent && this.endpoint && this.tournamentId) {
105
+ this.getTournamentInfo();
106
+ }
73
107
  }
74
- }
75
- getTournamentInfo() {
76
- let url = new URL(this.endpoint + `/v1/tournaments/${this.tournamentId}`);
77
- let reqHeaders = new Headers();
78
- url.searchParams.append('expand', 'games');
79
- url.searchParams.append('language', this.language);
80
- url.searchParams.append('pagination', `games(limit=${this.gamesLimit},offset=${this.offset})`);
81
- url.searchParams.append('fields', 'games(id,name,thumbnail)');
82
- if (this.session) {
83
- reqHeaders.append('X-SessionId', this.session);
108
+ componentDidRender() {
109
+ if (!this.limitStylingAppends && this.host) {
110
+ if (this.clientStyling)
111
+ this.setClientStyling();
112
+ if (this.clientStylingUrl)
113
+ this.setClientStylingURL();
114
+ this.limitStylingAppends = true;
115
+ }
84
116
  }
85
- let requestOptions = {
86
- method: 'GET',
87
- headers: reqHeaders,
88
- };
89
- fetch(url.href, requestOptions).then((res) => res.json())
90
- .then((res) => {
91
- this.games = res.item.games.items;
92
- });
93
- }
94
- componentWillLoad() {
95
- if (!this.useEvent && this.endpoint && this.tournamentId) {
96
- this.getTournamentInfo();
117
+ setClientStyling() {
118
+ const sheet = new CSSStyleSheet();
119
+ // @ts-ignore
120
+ sheet.replace(this.clientStyling);
121
+ // @ts-ignore
122
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
97
123
  }
98
- }
99
- componentDidRender() {
100
- if (!this.limitStylingAppends && this.host) {
101
- if (this.clientStyling)
102
- this.setClientStyling();
103
- if (this.clientStylingUrl)
104
- this.setClientStylingURL();
105
- this.limitStylingAppends = true;
124
+ setClientStylingURL() {
125
+ let url = new URL(this.clientStylingUrl);
126
+ fetch(url.href)
127
+ .then((res) => res.text())
128
+ .then((data) => {
129
+ const sheet = new CSSStyleSheet();
130
+ // @ts-ignore
131
+ sheet.replace(data);
132
+ // @ts-ignore
133
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
134
+ });
106
135
  }
107
- }
108
- setClientStyling() {
109
- const sheet = new CSSStyleSheet();
110
- // @ts-ignore
111
- sheet.replace(this.clientStyling);
112
- // @ts-ignore
113
- this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
114
- }
115
- setClientStylingURL() {
116
- let url = new URL(this.clientStylingUrl);
117
- fetch(url.href)
118
- .then((res) => res.text())
119
- .then((data) => {
120
- const sheet = new CSSStyleSheet();
121
- // @ts-ignore
122
- sheet.replace(data);
123
- // @ts-ignore
124
- this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
125
- });
126
- }
127
- render() {
128
- return h("div", { class: "TournamentSliderWrap" }, h("div", { class: "TournamentSlider" }, this.showTitle && this.games &&
129
- h("div", { class: "SliderTitle" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "21", height: "25", viewBox: "0 0 21 25", fill: "none" }, h("path", { d: "M6.1774 22.1728C6.36493 22.2725 6.56274 22.0566 6.44793 21.8779C5.82475 20.908 5.23463 19.2759 6.17483 17.174C7.74273 13.6689 8.6968 11.8535 8.6968 11.8535C8.6968 11.8535 9.20426 13.9721 10.5799 15.8558C11.9038 17.6687 12.6285 19.9488 11.4602 21.8482C11.3506 22.0265 11.5439 22.2368 11.7302 22.1415C13.1763 21.4017 14.7983 19.9179 14.9813 16.965C15.0488 16.0627 14.9476 14.7995 14.4416 13.2054C13.791 11.185 12.9911 10.2423 12.5283 9.83741C12.3899 9.71629 12.1746 9.82363 12.1859 10.0072C12.3208 12.1872 11.5007 12.7404 11.0339 11.4937C10.8474 10.9957 10.7387 10.1344 10.7387 9.08558C10.7387 7.3394 10.2321 5.54188 9.1152 4.0812C8.82475 3.70134 8.4849 3.3464 8.09498 3.04372C7.95382 2.93411 7.74919 3.04428 7.76212 3.22252C7.84788 4.40628 7.77018 7.79884 4.79383 11.8519C2.09515 15.6115 3.14088 18.4989 3.51195 19.281C4.2214 20.7791 5.21098 21.6589 6.1774 22.1728Z", fill: "white" })), h("span", { class: "Title" }, translate('sliderTitle', this.language))), h("div", { class: "Items" }, this.games &&
130
- h("general-slider", { "slide-number": this.slideNumber, "slide-show": this.slideShow }, this.games && this.games.map((game, i) => {
131
- return h("li", { class: "Item", onMouseEnter: () => this.enter(i), onMouseLeave: () => this.leave() }, h("span", { class: `PlayNowButton ${this.hoverIndex == i ? 'ItemHover' : ''}`, onClick: () => { this.gameClicked(game); } }, translate('playNow', this.language)), h("img", { class: "Img", src: game.thumbnail, alt: game.name, title: game.name }));
132
- })))));
133
- }
134
- get host() { return getElement(this); }
136
+ render() {
137
+ return h("div", { key: 'f16db0fd04952457c6e637e34e3295de9f2ab00e', class: "TournamentSliderWrap" }, h("div", { key: '246d6bae2b600ebc97e8cfbdf707ae284f0cef20', class: "TournamentSlider" }, this.showTitle && this.games &&
138
+ h("div", { key: 'd9760b0b053aa103a8bb1d24e860d83225aba17b', class: "SliderTitle" }, h("svg", { key: '47e2a1441fa2eb68510eb9a775ff14e6b5221afd', xmlns: "http://www.w3.org/2000/svg", width: "21", height: "25", viewBox: "0 0 21 25", fill: "none" }, h("path", { key: '566c04c19cbd24b79fba1c87f9872e28689178e3', d: "M6.1774 22.1728C6.36493 22.2725 6.56274 22.0566 6.44793 21.8779C5.82475 20.908 5.23463 19.2759 6.17483 17.174C7.74273 13.6689 8.6968 11.8535 8.6968 11.8535C8.6968 11.8535 9.20426 13.9721 10.5799 15.8558C11.9038 17.6687 12.6285 19.9488 11.4602 21.8482C11.3506 22.0265 11.5439 22.2368 11.7302 22.1415C13.1763 21.4017 14.7983 19.9179 14.9813 16.965C15.0488 16.0627 14.9476 14.7995 14.4416 13.2054C13.791 11.185 12.9911 10.2423 12.5283 9.83741C12.3899 9.71629 12.1746 9.82363 12.1859 10.0072C12.3208 12.1872 11.5007 12.7404 11.0339 11.4937C10.8474 10.9957 10.7387 10.1344 10.7387 9.08558C10.7387 7.3394 10.2321 5.54188 9.1152 4.0812C8.82475 3.70134 8.4849 3.3464 8.09498 3.04372C7.95382 2.93411 7.74919 3.04428 7.76212 3.22252C7.84788 4.40628 7.77018 7.79884 4.79383 11.8519C2.09515 15.6115 3.14088 18.4989 3.51195 19.281C4.2214 20.7791 5.21098 21.6589 6.1774 22.1728Z", fill: "white" })), h("span", { key: '6a6e5fc1e888de1ace0b0c577cc96b98c55a65bd', class: "Title" }, translate('sliderTitle', this.language))), h("div", { key: '0d18223f0d9603ba8e94a87725bfc52592f5a120', class: "Items" }, this.games &&
139
+ h("general-slider", { key: 'd56409e9730aeae803bb2a54951d9ba0912dbf51', "slide-number": this.slideNumber, "slide-show": this.slideShow }, this.games && this.games.map((game, i) => {
140
+ return h("li", { class: "Item", onMouseEnter: () => this.enter(i), onMouseLeave: () => this.leave() }, h("span", { class: `PlayNowButton ${this.hoverIndex == i ? 'ItemHover' : ''}`, onClick: () => { this.gameClicked(game); } }, translate('playNow', this.language)), h("img", { class: "Img", src: game.thumbnail, alt: game.name, title: game.name }));
141
+ })))));
142
+ }
143
+ get host() { return getElement(this); }
135
144
  };
136
- CasinoTournamentSlider.style = casinoTournamentSliderCss;
145
+ CasinoTournamentSlider.style = CasinoTournamentSliderStyle0;
137
146
 
138
147
  const generalSliderCss = ":host{display:block}.GeneralSlider{position:relative}.Slider{position:relative;width:100%;margin:0 auto;overflow:hidden}.SliderList{display:flex;margin:0;padding:0;list-style:none;transition:transform 0.5s ease-in-out}::slotted(li){flex:1 0 auto;width:100%;margin:auto}::slotted(li.hide){visibility:hidden;height:0;transition-delay:500ms}.Col-2 ::slotted(li){flex:2 0 auto;width:50%}.Col-3 ::slotted(li){flex:3 0 auto;width:33.3333333333%}.Col-4 ::slotted(li){flex:4 0 auto;width:25%}.Col-5 ::slotted(li){flex:5 0 auto;width:20%}.Col-6 ::slotted(li){flex:6 0 auto;width:16.6666666667%}.Col-7 ::slotted(li){flex:7 0 auto;width:14.2857142857%}.Col-8 ::slotted(li){flex:8 0 auto;width:12.5%}.Col-9 ::slotted(li){flex:9 0 auto;width:11.1111111111%}.Col-10 ::slotted(li){flex:10 0 auto;width:10%}.Col-11 ::slotted(li){flex:11 0 auto;width:9.0909090909%}.Col-12 ::slotted(li){flex:12 0 auto;width:8.3333333333%}.Button{position:absolute;z-index:1;top:calc(50% - 32px);padding:20px;font-size:20px;line-height:20px;opacity:0.5;border:none;background:var(--emfe-w-color-contrast, #07072A);color:var(--emfe-w-color-white, #FFFFFF);cursor:pointer}.Button:hover{opacity:1;transition:opacity 0.5s ease-in-out}.Button[disabled],.Button[disabled]:hover{color:var(--emfe-w-color-gray-150, #828282);opacity:0.25}.Button.ButtonNext{right:0}.PageButtons{display:flex;gap:4px;margin-top:8px}.PageButton{width:15px;height:4px;border-radius:4px;background-color:var(--emfe-w-tournament-color-primary, #0072ed);opacity:0.2;cursor:pointer;float:right}.PageButton.active{width:45px;opacity:1}";
148
+ const GeneralSliderStyle0 = generalSliderCss;
139
149
 
140
150
  const GeneralSlider = class {
141
- constructor(hostRef) {
142
- registerInstance(this, hostRef);
143
- /**
144
- * Slide Count
145
- */
146
- this.slideNumber = 3;
147
- /**
148
- * Slides to show
149
- */
150
- this.slideShow = 3;
151
- /**
152
- * Display the arrow icon
153
- */
154
- this.showArrow = true;
155
- /**
156
- * Display the button
157
- */
158
- this.showButton = false;
159
- /**
160
- * Auto Slide
161
- */
162
- this.autoSlide = false;
163
- /**
164
- * Auto Slide loop time
165
- */
166
- this.loopTime = 1;
167
- /**
168
- * Auto fill the Item height
169
- */
170
- this.autoItemHeight = false;
171
- /**
172
- * Client custom styling via inline styles
173
- */
174
- this.clientStyling = '';
175
- /**
176
- * Client custom styling via url
177
- */
178
- this.clientStylingUrl = '';
179
- this.currentSlideNumber = 0;
180
- this.slidesCount = 0;
181
- this.limitStylingAppends = false;
182
- this.slides = null;
183
- this.slideWidth = 0;
184
- this.currentPage = 0;
185
- this.controls = {
186
- Prev: null,
187
- Next: null
188
- };
189
- this.xDown = null;
190
- this.yDown = null;
191
- }
192
- slide(next) {
193
- let slideTo = 0;
194
- if (next) {
195
- slideTo = this.currentSlideNumber + this.slideNumber;
151
+ constructor(hostRef) {
152
+ registerInstance(this, hostRef);
153
+ this.slides = null;
154
+ this.slideWidth = 0;
155
+ this.currentPage = 0;
156
+ this.controls = {
157
+ Prev: null,
158
+ Next: null
159
+ };
160
+ this.xDown = null;
161
+ this.yDown = null;
162
+ this.slideNumber = 3;
163
+ this.slideShow = 3;
164
+ this.showArrow = true;
165
+ this.showButton = false;
166
+ this.autoSlide = false;
167
+ this.loopTime = 1;
168
+ this.autoItemHeight = false;
169
+ this.clientStyling = '';
170
+ this.clientStylingUrl = '';
171
+ this.currentSlideNumber = 0;
172
+ this.slidesCount = 0;
173
+ this.limitStylingAppends = false;
174
+ }
175
+ slide(next) {
176
+ let slideTo = 0;
177
+ if (next) {
178
+ slideTo = this.currentSlideNumber + this.slideNumber;
179
+ }
180
+ else {
181
+ slideTo = this.currentSlideNumber - this.slideNumber;
182
+ }
183
+ if (slideTo < 0 || slideTo >= this.slidesCount)
184
+ return;
185
+ this.currentSlideNumber = slideTo;
186
+ this.currentPage = this.currentSlideNumber / this.slideNumber;
187
+ this.updateListStyle();
188
+ }
189
+ slideTo(page) {
190
+ this.currentSlideNumber = page * this.slideNumber;
191
+ this.currentPage = page;
192
+ this.updateListStyle();
196
193
  }
197
- else {
198
- slideTo = this.currentSlideNumber - this.slideNumber;
194
+ updateControls() {
195
+ this.switchControl('Prev', (this.currentSlideNumber === 0) ? false : true);
196
+ this.switchControl('Next', (this.currentSlideNumber === this.slidesCount - this.slideShow) ? false : true);
199
197
  }
200
- if (slideTo < 0 || slideTo >= this.slidesCount)
201
- return;
202
- this.currentSlideNumber = slideTo;
203
- this.currentPage = this.currentSlideNumber / this.slideNumber;
204
- this.updateListStyle();
205
- }
206
- slideTo(page) {
207
- this.currentSlideNumber = page * this.slideNumber;
208
- this.currentPage = page;
209
- this.updateListStyle();
210
- }
211
- updateControls() {
212
- this.switchControl('Prev', (this.currentSlideNumber === 0) ? false : true);
213
- this.switchControl('Next', (this.currentSlideNumber === this.slidesCount - this.slideShow) ? false : true);
214
- }
215
- switchControl(type, enabled) {
216
- if (this.controls[type]) {
217
- this.controls[type].disabled = !enabled;
198
+ switchControl(type, enabled) {
199
+ if (this.controls[type]) {
200
+ this.controls[type].disabled = !enabled;
201
+ }
218
202
  }
219
- }
220
- componentWillLoad() {
221
- if (!this.slideNumber)
222
- this.slideNumber = 1;
223
- if (!this.slideShow)
224
- this.slideShow = 1;
225
- }
226
- componentDidLoad() {
227
- this.slides = this.slotEl.assignedElements();
228
- this.slidesCount = this.slides.length;
229
- for (let type in this.controls) {
230
- this.controls[type] = this.el.shadowRoot.querySelector('.Button' + type);
203
+ componentWillLoad() {
204
+ if (!this.slideNumber)
205
+ this.slideNumber = 1;
206
+ if (!this.slideShow)
207
+ this.slideShow = 1;
231
208
  }
232
- if (this.autoSlide) {
233
- this.setSlideAutoInterval();
209
+ componentDidLoad() {
210
+ this.slides = this.slotEl.assignedElements();
211
+ this.slidesCount = this.slides.length;
212
+ for (let type in this.controls) {
213
+ this.controls[type] = this.el.shadowRoot.querySelector('.Button' + type);
214
+ }
215
+ if (this.autoSlide) {
216
+ this.setSlideAutoInterval();
217
+ }
218
+ if (!this.limitStylingAppends && this.el.shadowRoot) {
219
+ if (this.clientStyling)
220
+ this.setClientStyling();
221
+ if (this.clientStylingUrl)
222
+ this.setClientStylingURL();
223
+ this.limitStylingAppends = true;
224
+ }
234
225
  }
235
- if (!this.limitStylingAppends && this.el.shadowRoot) {
236
- if (this.clientStyling)
237
- this.setClientStyling();
238
- if (this.clientStylingUrl)
239
- this.setClientStylingURL();
240
- this.limitStylingAppends = true;
226
+ componentDidRender() {
227
+ if (this.slides)
228
+ this.slideWidth = this.slides[0].offsetWidth;
229
+ this.el.addEventListener('touchstart', this.handleTouchStart.bind(this), { passive: true });
230
+ this.el.addEventListener('touchmove', this.handleTouchMove.bind(this), { passive: true });
231
+ this.updateListStyle();
232
+ if (!this.limitStylingAppends && this.el.shadowRoot) {
233
+ if (this.clientStyling)
234
+ this.setClientStyling();
235
+ if (this.clientStylingUrl)
236
+ this.setClientStylingURL();
237
+ this.limitStylingAppends = true;
238
+ }
241
239
  }
242
- }
243
- componentDidRender() {
244
- if (this.slides)
245
- this.slideWidth = this.slides[0].offsetWidth;
246
- this.el.addEventListener('touchstart', this.handleTouchStart.bind(this), { passive: true });
247
- this.el.addEventListener('touchmove', this.handleTouchMove.bind(this), { passive: true });
248
- this.updateListStyle();
249
- if (!this.limitStylingAppends && this.el.shadowRoot) {
250
- if (this.clientStyling)
251
- this.setClientStyling();
252
- if (this.clientStylingUrl)
253
- this.setClientStylingURL();
254
- this.limitStylingAppends = true;
240
+ updateListStyle() {
241
+ if (!this.autoItemHeight)
242
+ return;
243
+ if (this.slides === null)
244
+ return;
245
+ this.slides.forEach((li, index) => {
246
+ if (index >= this.currentPage * this.slideNumber && index < (this.currentPage + 1) * this.slideNumber) {
247
+ li.classList.remove('hide');
248
+ }
249
+ else {
250
+ li.classList.add('hide');
251
+ }
252
+ });
255
253
  }
256
- }
257
- updateListStyle() {
258
- if (!this.autoItemHeight)
259
- return;
260
- if (this.slides === null)
261
- return;
262
- this.slides.forEach((li, index) => {
263
- if (index >= this.currentPage * this.slideNumber && index < (this.currentPage + 1) * this.slideNumber) {
264
- li.classList.remove('hide');
265
- }
266
- else {
267
- li.classList.add('hide');
268
- }
269
- });
270
- }
271
- disconnectedCallback() {
272
- this.el.removeEventListener('touchstart', this.handleTouchStart);
273
- this.el.removeEventListener('touchmove', this.handleTouchMove);
274
- }
275
- handleTouchStart(evt) {
276
- const firstTouch = this.getTouches(evt)[0];
277
- this.xDown = firstTouch.clientX;
278
- this.yDown = firstTouch.clientY;
279
- clearInterval(this.sliderInterval);
280
- }
281
- getTouches(evt) {
282
- return evt.touches || evt.originalEvent.touches;
283
- }
284
- handleTouchMove(evt) {
285
- if (!this.xDown || !this.yDown)
286
- return;
287
- let xUp = evt.touches[0].clientX;
288
- let yUp = evt.touches[0].clientY;
289
- let xDiff = this.xDown - xUp;
290
- let yDiff = this.yDown - yUp;
291
- if (Math.abs(xDiff) > Math.abs(yDiff)) {
292
- if (xDiff > 0) {
293
- this.slide(true);
294
- }
295
- else {
296
- this.slide(false);
297
- }
254
+ disconnectedCallback() {
255
+ this.el.removeEventListener('touchstart', this.handleTouchStart);
256
+ this.el.removeEventListener('touchmove', this.handleTouchMove);
298
257
  }
299
- this.xDown = null;
300
- this.yDown = null;
301
- if (this.autoSlide) {
302
- this.setSlideAutoInterval();
258
+ handleTouchStart(evt) {
259
+ const firstTouch = this.getTouches(evt)[0];
260
+ this.xDown = firstTouch.clientX;
261
+ this.yDown = firstTouch.clientY;
262
+ clearInterval(this.sliderInterval);
263
+ }
264
+ getTouches(evt) {
265
+ return evt.touches || evt.originalEvent.touches;
303
266
  }
304
- }
305
- ;
306
- setSlideAutoInterval() {
307
- if (this.loopTime == 0) {
308
- return;
267
+ handleTouchMove(evt) {
268
+ if (!this.xDown || !this.yDown)
269
+ return;
270
+ let xUp = evt.touches[0].clientX;
271
+ let yUp = evt.touches[0].clientY;
272
+ let xDiff = this.xDown - xUp;
273
+ let yDiff = this.yDown - yUp;
274
+ if (Math.abs(xDiff) > Math.abs(yDiff)) {
275
+ if (xDiff > 0) {
276
+ this.slide(true);
277
+ }
278
+ else {
279
+ this.slide(false);
280
+ }
281
+ }
282
+ this.xDown = null;
283
+ this.yDown = null;
284
+ if (this.autoSlide) {
285
+ this.setSlideAutoInterval();
286
+ }
309
287
  }
310
- clearInterval(this.sliderInterval);
311
- this.sliderInterval = setInterval(() => {
312
- if (this.currentPage + 1 < this.slidesCount / this.slideNumber) {
313
- this.slideTo(this.currentPage + 1);
314
- }
315
- else {
316
- this.slideTo(0);
317
- }
318
- }, Number(this.loopTime) * 1000);
319
- }
320
- componentDidUpdate() {
321
- this.sliderEl.style.transform = `translateX(${this.currentSlideNumber * this.slideWidth * -1}px)`;
322
- this.updateControls();
323
- }
324
- switchLoopStatus(isMouseMoveEnter) {
325
- if (!this.autoSlide)
326
- return;
327
- if (this.loopTime > 0) {
328
- if (isMouseMoveEnter) {
288
+ ;
289
+ setSlideAutoInterval() {
290
+ if (this.loopTime == 0) {
291
+ return;
292
+ }
329
293
  clearInterval(this.sliderInterval);
330
- }
331
- else {
332
- this.setSlideAutoInterval();
333
- }
294
+ this.sliderInterval = setInterval(() => {
295
+ if (this.currentPage + 1 < this.slidesCount / this.slideNumber) {
296
+ this.slideTo(this.currentPage + 1);
297
+ }
298
+ else {
299
+ this.slideTo(0);
300
+ }
301
+ }, Number(this.loopTime) * 1000);
302
+ }
303
+ componentDidUpdate() {
304
+ this.sliderEl.style.transform = `translateX(${this.currentSlideNumber * this.slideWidth * -1}px)`;
305
+ this.updateControls();
306
+ }
307
+ switchLoopStatus(isMouseMoveEnter) {
308
+ if (!this.autoSlide)
309
+ return;
310
+ if (this.loopTime > 0) {
311
+ if (isMouseMoveEnter) {
312
+ clearInterval(this.sliderInterval);
313
+ }
314
+ else {
315
+ this.setSlideAutoInterval();
316
+ }
317
+ }
318
+ }
319
+ setClientStyling() {
320
+ const sheet = new CSSStyleSheet();
321
+ // @ts-ignore
322
+ sheet.replace(this.clientStyling);
323
+ // @ts-ignore
324
+ this.el.shadowRoot.adoptedStyleSheets = [...this.el.shadowRoot.adoptedStyleSheets, sheet];
325
+ }
326
+ setClientStylingURL() {
327
+ let url = new URL(this.clientStylingUrl);
328
+ fetch(url.href)
329
+ .then((res) => res.text())
330
+ .then((data) => {
331
+ const sheet = new CSSStyleSheet();
332
+ // @ts-ignore
333
+ sheet.replace(data);
334
+ // @ts-ignore
335
+ this.el.shadowRoot.adoptedStyleSheets = [...this.el.shadowRoot.adoptedStyleSheets, sheet];
336
+ });
337
+ }
338
+ render() {
339
+ return (h("div", { key: 'b8c30bef4c9ca004256c94cb642e8acb350afea4', class: "GeneralSlider" }, h("div", { key: '27d6869ae4f675f5e14d17fae20718ec24391e1b', class: "Slider" }, this.showArrow &&
340
+ h("div", { key: '61acebc8e1a0ecf02ae6dad1ecc6f618424d05d5' }, h("button", { key: 'c593883f94b693d6dfe741b2b4ed08185db36ef2', type: "button", class: "Button ButtonNext", onClick: this.slide.bind(this, true), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, ">"), h("button", { key: '2bea5e3e9f36443e78bc25f0556dce2adb7111a0', type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<")), h("ul", { key: '6643c865256f26b5d06ec78044a2b595832ecb5e', class: `SliderList Col-${this.slideShow}`, part: "SliderList", onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false), ref: (el) => this.sliderEl = el }, h("slot", { key: '48f1ad37b771f32ecc27f3065d58bc7ef1a8a021', ref: (el) => this.slotEl = el }))), this.showButton && this.slidesCount > 0 &&
341
+ h("div", { key: 'd125efa8c68a6e913664d01fb395ed6cada71f5b', class: "PageButtons", part: "PageButtons" }, [...Array(this.slidesCount / this.slideNumber)].map((_x, i) => h("div", { class: `PageButton ${this.currentPage == i ? 'active' : ''}`, title: `page${i}`, onClick: this.slideTo.bind(this, i), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "\u00A0")))));
334
342
  }
335
- }
336
- setClientStyling() {
337
- const sheet = new CSSStyleSheet();
338
- // @ts-ignore
339
- sheet.replace(this.clientStyling);
340
- // @ts-ignore
341
- this.el.shadowRoot.adoptedStyleSheets = [...this.el.shadowRoot.adoptedStyleSheets, sheet];
342
- }
343
- setClientStylingURL() {
344
- let url = new URL(this.clientStylingUrl);
345
- fetch(url.href)
346
- .then((res) => res.text())
347
- .then((data) => {
348
- const sheet = new CSSStyleSheet();
349
- // @ts-ignore
350
- sheet.replace(data);
351
- // @ts-ignore
352
- this.el.shadowRoot.adoptedStyleSheets = [...this.el.shadowRoot.adoptedStyleSheets, sheet];
353
- });
354
- }
355
- render() {
356
- return (h("div", { class: "GeneralSlider" }, h("div", { class: "Slider" }, this.showArrow &&
357
- h("div", null, h("button", { type: "button", class: "Button ButtonNext", onClick: this.slide.bind(this, true), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, ">"), h("button", { type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<")), h("ul", { class: `SliderList Col-${this.slideShow}`, part: "SliderList", onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false), ref: (el) => this.sliderEl = el }, h("slot", { ref: (el) => this.slotEl = el }))), this.showButton && this.slidesCount > 0 &&
358
- h("div", { class: "PageButtons", part: "PageButtons" }, [...Array(this.slidesCount / this.slideNumber)].map((_x, i) => h("div", { class: `PageButton ${this.currentPage == i ? 'active' : ''}`, title: `page${i}`, onClick: this.slideTo.bind(this, i), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "\u00A0")))));
359
- }
360
- get el() { return getElement(this); }
343
+ get el() { return getElement(this); }
361
344
  };
362
- GeneralSlider.style = generalSliderCss;
345
+ GeneralSlider.style = GeneralSliderStyle0;
363
346
 
364
347
  export { CasinoTournamentSlider as casino_tournament_slider, GeneralSlider as general_slider };