@everymatrix/casino-tournament-list 1.20.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/casino-tournament-list/casino-tournament-list.esm.js +1 -0
  2. package/dist/casino-tournament-list/index.esm.js +0 -0
  3. package/dist/casino-tournament-list/p-1368789d.js +1 -0
  4. package/dist/casino-tournament-list/p-908908a6.entry.js +15 -0
  5. package/dist/cjs/casino-tournament-banner_6.cjs.entry.js +8911 -0
  6. package/dist/cjs/casino-tournament-list.cjs.js +19 -0
  7. package/dist/cjs/index-c1b4bd7d.js +1284 -0
  8. package/dist/cjs/index.cjs.js +2 -0
  9. package/dist/cjs/loader.cjs.js +21 -0
  10. package/dist/collection/collection-manifest.json +43 -0
  11. package/dist/collection/components/casino-tournament-list/casino-tournament-list.css +97 -0
  12. package/dist/collection/components/casino-tournament-list/casino-tournament-list.js +578 -0
  13. package/dist/collection/index.js +1 -0
  14. package/dist/collection/utils/locale.utils.js +104 -0
  15. package/dist/collection/utils/utils.js +20 -0
  16. package/dist/components/casino-tournament-banner.js +6 -0
  17. package/dist/components/casino-tournament-banner2.js +598 -0
  18. package/dist/components/casino-tournament-buttons.js +6 -0
  19. package/dist/components/casino-tournament-buttons2.js +534 -0
  20. package/dist/components/casino-tournament-duration.js +6 -0
  21. package/dist/components/casino-tournament-duration2.js +220 -0
  22. package/dist/components/casino-tournament-info.js +6 -0
  23. package/dist/components/casino-tournament-info2.js +502 -0
  24. package/dist/components/casino-tournament-list.d.ts +11 -0
  25. package/dist/components/casino-tournament-list.js +1493 -0
  26. package/dist/components/casino-tournament-prizes.js +6 -0
  27. package/dist/components/casino-tournament-prizes2.js +190 -0
  28. package/dist/components/index.d.ts +26 -0
  29. package/dist/components/index.js +1 -0
  30. package/dist/components/moment.js +5677 -0
  31. package/dist/esm/casino-tournament-banner_6.entry.js +8902 -0
  32. package/dist/esm/casino-tournament-list.js +17 -0
  33. package/dist/esm/index-b57e0a6b.js +1258 -0
  34. package/dist/esm/index.js +1 -0
  35. package/dist/esm/loader.js +17 -0
  36. package/dist/esm/polyfills/core-js.js +11 -0
  37. package/dist/esm/polyfills/css-shim.js +1 -0
  38. package/dist/esm/polyfills/dom.js +79 -0
  39. package/dist/esm/polyfills/es5-html-element.js +1 -0
  40. package/dist/esm/polyfills/index.js +34 -0
  41. package/dist/esm/polyfills/system.js +6 -0
  42. package/dist/index.cjs.js +1 -0
  43. package/dist/index.js +1 -0
  44. package/dist/stencil.config.js +22 -0
  45. package/dist/types/Users/sebastian.strulea/Documents/work/widgets-stencil/packages/casino-tournament-list/.stencil/packages/casino-tournament-list/stencil.config.d.ts +2 -0
  46. package/dist/types/components/casino-tournament-list/casino-tournament-list.d.ts +101 -0
  47. package/dist/types/components.d.ts +181 -0
  48. package/dist/types/index.d.ts +1 -0
  49. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  50. package/dist/types/utils/locale.utils.d.ts +2 -0
  51. package/dist/types/utils/utils.d.ts +2 -0
  52. package/loader/cdn.js +3 -0
  53. package/loader/index.cjs.js +3 -0
  54. package/loader/index.d.ts +12 -0
  55. package/loader/index.es2017.js +3 -0
  56. package/loader/index.js +4 -0
  57. package/loader/package.json +10 -0
  58. package/package.json +19 -0
@@ -0,0 +1,220 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+
3
+ const DEFAULT_LANGUAGE = 'en';
4
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt'];
5
+ const TRANSLATIONS = {
6
+ en: {
7
+ finished: 'Finished',
8
+ starting: 'Starting in ',
9
+ left: 'left',
10
+ minutes: 'minutes',
11
+ hours: 'hours',
12
+ days: 'days',
13
+ },
14
+ 'zh-hk': {
15
+ finished: '完成的',
16
+ starting: '開始於',
17
+ left: '剩下',
18
+ minutes: '分鐘',
19
+ hours: '小時',
20
+ days: '天',
21
+ },
22
+ fr: {
23
+ finished: 'Fini',
24
+ starting: 'Début dans ',
25
+ left: 'restant',
26
+ minutes: 'minutes',
27
+ hours: 'heures',
28
+ days: 'jours',
29
+ },
30
+ ro: {
31
+ finished: 'Finalizat',
32
+ starting: 'Începe în',
33
+ left: 'rămase',
34
+ minutes: 'minute',
35
+ hours: 'ore',
36
+ days: 'zile',
37
+ },
38
+ tr: {
39
+ finished: 'Sona ermiş',
40
+ starting: 'Başlamasına ',
41
+ left: 'kaldı',
42
+ minutes: 'dakika',
43
+ hours: 'saat',
44
+ days: 'gün',
45
+ },
46
+ el: {
47
+ finished: 'Ολοκληρωμένα',
48
+ starting: 'Αρχίζει σε ',
49
+ left: 'απομένουν',
50
+ minutes: 'λεπτά',
51
+ hours: 'ώρες',
52
+ days: 'ημέρες',
53
+ },
54
+ es: {
55
+ finished: 'Finalizado',
56
+ starting: 'Iniciando en ',
57
+ left: 'izquierda',
58
+ minutes: 'minutos',
59
+ hours: 'horas',
60
+ days: 'días',
61
+ },
62
+ hu: {
63
+ finished: 'Befejezve',
64
+ starting: 'Kezdésig',
65
+ left: 'bal',
66
+ minutes: 'perc',
67
+ hours: 'óra',
68
+ days: 'nap',
69
+ },
70
+ pt: {
71
+ finished: 'Finalizado',
72
+ starting: 'Começando em',
73
+ left: 'Abandonou',
74
+ minutes: 'Minutos',
75
+ hours: 'Horas',
76
+ days: 'Dias',
77
+ }
78
+ };
79
+ const translate = (key, customLang) => {
80
+ const lang = customLang;
81
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
82
+ };
83
+
84
+ const casinoTournamentDurationCss = ":host{display:block}.TournamentDates{display:flex;justify-content:space-between}.StartDate{font-size:10px;font-weight:700;color:var(--emfe-w-color-gray-300, #58586B)}.EndDate{font-size:10px;font-weight:700;align-content:flex-end;color:var(--emfe-w-color-gray-300, #58586B)}.ProgressBar{margin:5px 0;height:8px;background:var(--emfe-w-color-white, #FFFFFF)}.ProgressBarInactive{margin:5px 20px 10px 20px;height:8px;background:var(--emfe-w-color-gray-100, #E6E6E6)}.ProgressBarFill{background-color:var(--emfe-w-color-green, #48952a);height:8px}.ProgressBarFillEnd{background-color:var(--emfe-w-color-green, #48952a);height:8px}.ProgressBarFillStarting{background-color:var(--emfe-w-color-gray-300, #58586B);height:8px}.Remaining,.Finished{font-size:10px;font-weight:700;padding-top:6px;text-align:right;text-transform:uppercase}.Finished{color:var(--emfe-w-color-green, #48952a)}";
85
+
86
+ const CasinoTournamentDuration = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
87
+ constructor() {
88
+ super();
89
+ this.__registerHost();
90
+ this.__attachShadow();
91
+ /**
92
+ * Client custom styling via inline styles
93
+ */
94
+ this.clientStyling = '';
95
+ /**
96
+ * Client custom styling via url
97
+ */
98
+ this.clientStylingUrl = '';
99
+ this.limitStylingAppends = false;
100
+ }
101
+ getDateTimeDiff(dateString1, dateString2) {
102
+ return ((new Date(dateString2)).getTime() - (new Date(dateString1)).getTime()) / (1000 * 60);
103
+ }
104
+ getDuration() {
105
+ const dateNow = new Date();
106
+ this.tournamentLeftDays = this.getDateTimeDiff(dateNow, this.endTime);
107
+ this.tournamentUntilStartDays = this.getDateTimeDiff(dateNow, this.startTime);
108
+ this.showRemain = this.getTextByDiff(this.tournamentLeftDays);
109
+ }
110
+ formatDate(date) {
111
+ const dateOptions = { month: 'long' };
112
+ let currentDate = new Date(date);
113
+ let currentMonth = new Intl.DateTimeFormat(this.language, dateOptions).format(currentDate);
114
+ let currentDay = currentDate.getDate();
115
+ return `${currentDay} ${currentMonth}, ${currentDate.toLocaleString('en-GB', { hour: 'numeric', minute: 'numeric' })}, ${currentDate.getUTCFullYear()}`;
116
+ }
117
+ getTextByDiff(diff) {
118
+ const renderText = (amount, type) => amount + ' ' + translate(type);
119
+ const renderTimeColumn = (column) => {
120
+ const columnInt = Math.floor(column);
121
+ if (columnInt < 10) {
122
+ return `0${columnInt}`;
123
+ }
124
+ else {
125
+ return `${columnInt}`;
126
+ }
127
+ };
128
+ if (diff < 1440) {
129
+ const hours = diff / 60;
130
+ const minutes = diff % 60;
131
+ const seconds = (minutes - Math.floor(minutes)) * 60;
132
+ return [hours, minutes, seconds].map(c => renderTimeColumn(c)).join(':');
133
+ }
134
+ return renderText(Math.ceil(diff / (60 * 24)), 'days');
135
+ }
136
+ getProgress() {
137
+ if (this.tournamentLeftDays <= 0)
138
+ return 100;
139
+ const tournamentDuration = this.getDateTimeDiff(this.startTime, this.endTime);
140
+ const step = 100 / tournamentDuration;
141
+ const width = Math.floor((tournamentDuration - this.tournamentLeftDays) * step);
142
+ return width;
143
+ }
144
+ componentWillLoad() {
145
+ if (this.startTime && this.endTime) {
146
+ this.getDuration();
147
+ this.getTextByDiff(this.tournamentLeftDays);
148
+ }
149
+ if (this.tournamentLeftDays < 1440 && this.tournamentLeftDays > 0) {
150
+ this.durationInterval = window.setInterval(() => {
151
+ if (this.startTime && this.endTime) {
152
+ this.getDuration();
153
+ }
154
+ }, 1000);
155
+ }
156
+ else {
157
+ clearInterval(this.durationInterval);
158
+ }
159
+ }
160
+ componentDidRender() {
161
+ if (!this.limitStylingAppends && this.stylingContainer) {
162
+ if (this.clientStyling)
163
+ this.setClientStyling();
164
+ if (this.clientStylingUrl)
165
+ this.setClientStylingURL();
166
+ this.limitStylingAppends = true;
167
+ }
168
+ }
169
+ setClientStyling() {
170
+ let sheet = document.createElement('style');
171
+ sheet.innerHTML = this.clientStyling;
172
+ this.stylingContainer.prepend(sheet);
173
+ }
174
+ setClientStylingURL() {
175
+ let cssFile = document.createElement('style');
176
+ setTimeout(() => {
177
+ cssFile.innerHTML = this.clientStylingUrl;
178
+ this.stylingContainer.prepend(cssFile);
179
+ }, 1);
180
+ }
181
+ render() {
182
+ if (this.startTime && this.endTime) {
183
+ return h("div", { ref: el => this.stylingContainer = el }, h("div", { class: "TournamentDuration" }, h("div", { class: "TournamentDates" }, h("div", { class: "StartDate", part: "StartDate" }, this.formatDate(this.startTime)), h("div", { class: "EndDate", part: "EndDate" }, this.formatDate(this.endTime))), h("div", { class: "ProgressBarWrapper" }, h("div", { class: "ProgressBar", part: "ProgressBar" }, this.status == 'Finished' || this.status == 'Closing' || this.status == 'Closed' ?
184
+ h("div", null, h("div", { class: "ProgressBarFillEnd", part: "ProgressBarFillEnd" }), h("div", { class: "Finished", part: "Finished" }, translate('finished', this.language))) :
185
+ this.tournamentUntilStartDays > 0 ?
186
+ h("div", null, h("div", { class: "ProgressBarFillStarting", part: "ProgressBarFillStarting" }), h("div", { class: "Remaining", part: "Remaining" }, translate('starting', this.language), " ", this.getTextByDiff(this.tournamentUntilStartDays))) :
187
+ h("div", null, h("div", { class: "ProgressBarFill", part: "ProgressBarFill", style: { width: `${this.getProgress()}%` } }), this.tournamentLeftDays > 0 &&
188
+ h("div", { class: "Remaining", part: "Remaining" }, this.showRemain, " ", translate('left', this.language)))))));
189
+ }
190
+ }
191
+ static get style() { return casinoTournamentDurationCss; }
192
+ }, [1, "casino-tournament-duration", {
193
+ "startTime": [1, "start-time"],
194
+ "endTime": [1, "end-time"],
195
+ "status": [1],
196
+ "language": [1],
197
+ "clientStyling": [1, "client-styling"],
198
+ "clientStylingUrl": [1, "client-styling-url"],
199
+ "tournamentUntilStartDays": [32],
200
+ "tournamentLeftDays": [32],
201
+ "showRemain": [32],
202
+ "limitStylingAppends": [32],
203
+ "stylingContainer": [32],
204
+ "durationInterval": [32]
205
+ }]);
206
+ function defineCustomElement() {
207
+ if (typeof customElements === "undefined") {
208
+ return;
209
+ }
210
+ const components = ["casino-tournament-duration"];
211
+ components.forEach(tagName => { switch (tagName) {
212
+ case "casino-tournament-duration":
213
+ if (!customElements.get(tagName)) {
214
+ customElements.define(tagName, CasinoTournamentDuration);
215
+ }
216
+ break;
217
+ } });
218
+ }
219
+
220
+ export { CasinoTournamentDuration as C, defineCustomElement as d };
@@ -0,0 +1,6 @@
1
+ import { C as CasinoTournamentInfo$1, d as defineCustomElement$1 } from './casino-tournament-info2.js';
2
+
3
+ const CasinoTournamentInfo = CasinoTournamentInfo$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { CasinoTournamentInfo, defineCustomElement };