@everymatrix/casino-tournament-banner 1.20.1 → 1.20.7

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.
@@ -39,7 +39,11 @@ const TRANSLATIONS$1 = {
39
39
  details: 'Details',
40
40
  joinerror: 'An error occurred while registering in the tournament, please try again.',
41
41
  tournament: 'Tournament',
42
- terms: 'Terms and conditions'
42
+ terms: 'Terms and conditions',
43
+ left: 'left',
44
+ minutes: 'minutes',
45
+ hours: 'hours',
46
+ days: 'days',
43
47
  },
44
48
  'zh-hk': {
45
49
  enrolled: '已註冊',
@@ -72,7 +76,11 @@ const TRANSLATIONS$1 = {
72
76
  register: '登記',
73
77
  details: '細節',
74
78
  join: '加入',
75
- joinerror: '加入錦標賽時出錯,請重試'
79
+ joinerror: '加入錦標賽時出錯,請重試',
80
+ left: '剩下',
81
+ minutes: '分鐘',
82
+ hours: '小時',
83
+ days: '天',
76
84
  },
77
85
  fr: {
78
86
  enrolled: 'Inscrits',
@@ -105,7 +113,11 @@ const TRANSLATIONS$1 = {
105
113
  register: 'Enregistre',
106
114
  details: 'Détails',
107
115
  join: 'Rejoignez',
108
- joinerror: 'Une erreur s\'est produite lors de l\'inscription au tournoi - '
116
+ joinerror: 'Une erreur s\'est produite lors de l\'inscription au tournoi - ',
117
+ left: 'restant',
118
+ minutes: 'minutes',
119
+ hours: 'heures',
120
+ days: 'jours',
109
121
  },
110
122
  ro: {
111
123
  enrolled: 'Înscris',
@@ -140,7 +152,11 @@ const TRANSLATIONS$1 = {
140
152
  register: 'Înregistrare',
141
153
  details: 'Detalii',
142
154
  join: 'Participă',
143
- joinerror: 'A apărut o eroare la înregistrarea în turneu, te rugăm să încerci din nou.'
155
+ joinerror: 'A apărut o eroare la înregistrarea în turneu, te rugăm să încerci din nou.',
156
+ left: 'rămase',
157
+ minutes: 'minute',
158
+ hours: 'ore',
159
+ days: 'zile',
144
160
  },
145
161
  tr: {
146
162
  enrolled: 'Katıldın',
@@ -173,7 +189,11 @@ const TRANSLATIONS$1 = {
173
189
  register: 'Kayıt Ol',
174
190
  details: 'Detaylar',
175
191
  join: 'Katıl',
176
- joinerror: 'Turnuvaya katılım ile ilgili bir hata oluştu - '
192
+ joinerror: 'Turnuvaya katılım ile ilgili bir hata oluştu - ',
193
+ left: 'kaldı',
194
+ minutes: 'dakika',
195
+ hours: 'saat',
196
+ days: 'gün',
177
197
  },
178
198
  el: {
179
199
  enrolled: 'Εγγεγραμμένος',
@@ -209,7 +229,11 @@ const TRANSLATIONS$1 = {
209
229
  register: 'Εγγραφή',
210
230
  details: 'Λεπτομέρειες',
211
231
  join: 'Συμμετοχή',
212
- joinerror: 'Παρουσιάστηκε σφάλμα κατά τη διαδικασία εγγραφής στο τουρνουά, παρακαλούμε δοκιμάστε ξανά.'
232
+ joinerror: 'Παρουσιάστηκε σφάλμα κατά τη διαδικασία εγγραφής στο τουρνουά, παρακαλούμε δοκιμάστε ξανά.',
233
+ left: 'απομένουν',
234
+ minutes: 'λεπτά',
235
+ hours: 'ώρες',
236
+ days: 'ημέρες',
213
237
  },
214
238
  es: {
215
239
  enrolled: 'Inscrito',
@@ -243,6 +267,10 @@ const TRANSLATIONS$1 = {
243
267
  details: 'Detalles',
244
268
  join: 'Unirse',
245
269
  joinerror: 'Ha ocurrido un error mientras se registra en el Torneo',
270
+ left: 'izquierda',
271
+ minutes: 'minutos',
272
+ hours: 'horas',
273
+ days: 'días',
246
274
  },
247
275
  pt: {
248
276
  enrolled: 'Inscrito',
@@ -275,7 +303,11 @@ const TRANSLATIONS$1 = {
275
303
  register: 'Registro',
276
304
  details: 'Detalhes',
277
305
  join: 'Junte-se',
278
- joinerror: 'Ocorreu um erro ao entrar no torneio -'
306
+ joinerror: 'Ocorreu um erro ao entrar no torneio -',
307
+ left: 'Abandonou',
308
+ minutes: 'Minutos',
309
+ hours: 'Horas',
310
+ days: 'Dias',
279
311
  },
280
312
  hu: {
281
313
  enrolled: 'Feliratkozott',
@@ -309,6 +341,10 @@ const TRANSLATIONS$1 = {
309
341
  details: 'Adatok',
310
342
  join: 'Csatlakozás',
311
343
  joinerror: 'Hiba történt a versenyre való regisztráció során, kérjük próbálja újra.',
344
+ left: 'bal',
345
+ minutes: 'perc',
346
+ hours: 'óra',
347
+ days: 'nap',
312
348
  }
313
349
  };
314
350
  const translate$1 = (key, customLang) => {
@@ -5992,56 +6028,71 @@ hooks.HTML5_FMT = {
5992
6028
  MONTH: 'YYYY-MM', // <input type="month" />
5993
6029
  };
5994
6030
 
5995
- const casinoTournamentBannerCss = ":host{display:block}.TournamentBannerWrap{height:100%}.TournamentBanner{position:relative;width:100%;height:100%;overflow:hidden}.TournamentBannerBg{width:100%;height:100%;object-fit:cover;transition:all 150ms ease-in-out}.TournamentBannerBg.Closed{filter:grayscale(1)}.TournamentBannerInfo{position:absolute;top:0;left:0;width:100%;height:100%;color:#fff;display:flex;justify-content:space-between}.BannerInfo{margin:10px}.Tag{box-shadow:0px 1px 2px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15);border-radius:8px;padding:6px;font-size:10px;display:flex}.Tag.Closed{filter:grayscale(1)}.Date{gap:4px;background:#FF7500;color:#1A2C38}.State{background:#D0046C}.Enroll{color:#fff;background:#24834B}.EnrollCheck{margin-right:4px}.Join{background:#6C757D}.Running{background:#1A2C38}.CalendarIcon path{fill:#1A2C38}.TournamentBannerThumb{position:absolute;top:0;left:0;width:100%;height:100%;padding:12px;color:#fff;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;box-sizing:border-box}.ThumbTitle{font-size:14px}.ThumbState{display:flex;gap:4px}.ThumbName{font-size:22px}.ThumbTC{font-size:8px;color:#fff;cursor:pointer}.ThumbButtons{display:flex;gap:4px}";
6031
+ const casinoTournamentBannerCss = ":host{display:block}.TournamentBannerWrap{height:100%}.TournamentBanner{position:relative;width:100%;height:100%;overflow:hidden}.TournamentBannerBg{width:100%;height:100%;object-fit:cover;transition:all 150ms ease-in-out}.TournamentBannerBg.Closed{filter:grayscale(1)}.TournamentBannerInfo{position:absolute;top:0;left:0;width:100%;height:100%;color:#fff;display:flex;justify-content:space-between}.BannerInfo{margin:10px}.Tag{box-shadow:0px 1px 2px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15);border-radius:8px;padding:6px;font-size:10px;display:flex;align-items:center;height:13px}.Tag.Closed{filter:grayscale(1)}.TagRemain{text-indent:5px}.Date{gap:4px;background:#FF7500;color:#1A2C38}.State{background:#D0046C}.Enroll{color:#fff;background:#24834B}.EnrollCheck{margin-right:4px}.Join{background:#6C757D}.Running{background:#1A2C38}.CalendarIcon path{fill:#1A2C38}.TournamentBannerThumb{position:absolute;top:0;left:0;width:100%;height:100%;padding:12px;color:#fff;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;box-sizing:border-box}.ThumbTitle{font-size:14px}.ThumbState{display:flex;gap:4px}.ThumbName{font-size:22px}.ThumbTC{font-size:8px;color:#fff;cursor:pointer}.ThumbButtons{display:flex;gap:4px}";
5996
6032
 
5997
6033
  const CasinoTournamentBanner = class {
5998
6034
  constructor(hostRef) {
5999
6035
  registerInstance(this, hostRef);
6036
+ /**
6037
+ * Short start time format
6038
+ */
6000
6039
  this.shortstartformat = 'DD MMM YYYY';
6040
+ /**
6041
+ * Show date on widget
6042
+ */
6001
6043
  this.showDate = true;
6044
+ /**
6045
+ * Show date on running state tournament tag
6046
+ */
6047
+ this.showRunningDate = false;
6048
+ /**
6049
+ * Show check icon on enrolled tag
6050
+ */
6002
6051
  this.showCheck = false;
6052
+ /**
6053
+ * Widget display as a card
6054
+ */
6003
6055
  this.cardMode = false;
6056
+ /**
6057
+ * Show read more button
6058
+ */
6004
6059
  this.showReadMore = false;
6060
+ /**
6061
+ * Client custom styling via inline styles
6062
+ */
6005
6063
  this.clientStyling = '';
6064
+ /**
6065
+ * Client custom styling via url
6066
+ */
6006
6067
  this.clientStylingUrl = '';
6007
6068
  this.limitStylingAppends = false;
6008
- this.setClientStyling = () => {
6009
- let sheet = document.createElement('style');
6010
- sheet.innerHTML = this.clientStyling;
6011
- this.stylingContainer.prepend(sheet);
6012
- };
6013
- this.setClientStylingURL = () => {
6014
- let cssFile = document.createElement('style');
6015
- setTimeout(() => {
6016
- cssFile.innerHTML = this.clientStylingUrl;
6017
- this.stylingContainer.prepend(cssFile);
6018
- }, 1);
6019
- };
6020
- this.formatDate = () => {
6021
- const dateOptions = { month: 'long' };
6022
- let currentDate = new Date(this.startTime);
6023
- const setTranslation = () => {
6024
- return (this.state === 'Running' || this.state == 'Closing' || this.state == 'Closed') ?
6025
- translate$1('startedAt', this.language) :
6026
- translate$1('startingAt', this.language);
6027
- };
6028
- if (this.shortStart) {
6029
- let startTimeAsString = hooks(currentDate).format(this.shortstartformat);
6030
- this.startdate = (this.state === 'Running' || this.state == 'Closing' || this.state == 'Closed') ?
6031
- translate$1('startedAtWithTime', this.language) + startTimeAsString :
6032
- translate$1('startingAtWithTime', this.language) + startTimeAsString;
6069
+ }
6070
+ getDateTimeDiff(dateString1, dateString2) {
6071
+ return ((new Date(dateString2)).getTime() - (new Date(dateString1)).getTime()) / (1000 * 60);
6072
+ }
6073
+ getTextByDiff(diff) {
6074
+ const renderText = (amount, type) => ' - ' + amount + ' ' + translate$1(type);
6075
+ const renderTimeColumn = (column) => {
6076
+ const columnInt = Math.floor(column);
6077
+ if (columnInt < 10) {
6078
+ return `0${columnInt}`;
6033
6079
  }
6034
6080
  else {
6035
- let currentMonthKey = new Intl.DateTimeFormat('en', dateOptions).format(currentDate);
6036
- let currentDay = currentDate.getDate();
6037
- let currentHour = currentDate.toLocaleString('en-GB', { hour: 'numeric', minute: 'numeric', hour12: false });
6038
- this.startdate =
6039
- `${currentDay}` + ' ' +
6040
- translate$1(`${currentMonthKey}`, this.language) + ', ' +
6041
- setTranslation() +
6042
- ` ${currentHour}`;
6081
+ return `${columnInt}`;
6043
6082
  }
6044
6083
  };
6084
+ if (diff < 1440) {
6085
+ const hours = diff / 60;
6086
+ const minutes = diff % 60;
6087
+ const seconds = (minutes - Math.floor(minutes)) * 60;
6088
+ return [hours, minutes, seconds].map(c => renderTimeColumn(c)).join(':');
6089
+ }
6090
+ return renderText(Math.ceil(diff / (60 * 24)), 'days');
6091
+ }
6092
+ getDuration() {
6093
+ const dateNow = new Date();
6094
+ this.tournamentLeftDays = this.getDateTimeDiff(dateNow, this.endTime);
6095
+ this.showRemain = this.getTextByDiff(this.tournamentLeftDays);
6045
6096
  }
6046
6097
  infoCompletedHandler(event) {
6047
6098
  if (event.detail && this.useEvent) {
@@ -6083,6 +6134,43 @@ const CasinoTournamentBanner = class {
6083
6134
  this.limitStylingAppends = true;
6084
6135
  }
6085
6136
  }
6137
+ setClientStyling() {
6138
+ let sheet = document.createElement('style');
6139
+ sheet.innerHTML = this.clientStyling;
6140
+ this.stylingContainer.prepend(sheet);
6141
+ }
6142
+ setClientStylingURL() {
6143
+ let cssFile = document.createElement('style');
6144
+ setTimeout(() => {
6145
+ cssFile.innerHTML = this.clientStylingUrl;
6146
+ this.stylingContainer.prepend(cssFile);
6147
+ }, 1);
6148
+ }
6149
+ formatDate() {
6150
+ const dateOptions = { month: 'long' };
6151
+ let currentDate = new Date(this.startTime);
6152
+ const setTranslation = () => {
6153
+ return (this.state === 'Running' || this.state == 'Closing' || this.state == 'Closed') ?
6154
+ translate$1('startedAt', this.language) :
6155
+ translate$1('startingAt', this.language);
6156
+ };
6157
+ if (this.shortStart) {
6158
+ let startTimeAsString = hooks(currentDate).format(this.shortstartformat);
6159
+ this.startdate = (this.state === 'Running' || this.state == 'Closing' || this.state == 'Closed') ?
6160
+ translate$1('startedAtWithTime', this.language) + startTimeAsString :
6161
+ translate$1('startingAtWithTime', this.language) + startTimeAsString;
6162
+ }
6163
+ else {
6164
+ let currentMonthKey = new Intl.DateTimeFormat('en', dateOptions).format(currentDate);
6165
+ let currentDay = currentDate.getDate();
6166
+ let currentHour = currentDate.toLocaleString('en-GB', { hour: 'numeric', minute: 'numeric', hour12: false });
6167
+ this.startdate =
6168
+ `${currentDay}` + ' ' +
6169
+ translate$1(`${currentMonthKey}`, this.language) + ', ' +
6170
+ setTranslation() +
6171
+ ` ${currentHour}`;
6172
+ }
6173
+ }
6086
6174
  componentWillLoad() {
6087
6175
  if (!this.useEvent && this.startTime) {
6088
6176
  this.formatDate();
@@ -6090,9 +6178,23 @@ const CasinoTournamentBanner = class {
6090
6178
  if (this.state) {
6091
6179
  this.stateText = this.getStateText(this.state);
6092
6180
  }
6181
+ if (this.startTime && this.endTime) {
6182
+ this.getDuration();
6183
+ this.getTextByDiff(this.tournamentLeftDays);
6184
+ }
6185
+ if (this.tournamentLeftDays < 1440 && this.tournamentLeftDays > 0) {
6186
+ this.durationInterval = window.setInterval(() => {
6187
+ if (this.startTime && this.endTime) {
6188
+ this.getDuration();
6189
+ }
6190
+ }, 1000);
6191
+ }
6192
+ else {
6193
+ clearInterval(this.durationInterval);
6194
+ }
6093
6195
  }
6094
6196
  termsClick(tournamentId) {
6095
- window.postMessage({ type: 'termsAndConditionsClicked', tournamentId: tournamentId }, window.location.href);
6197
+ window.postMessage({ type: 'TournamentTermsConditions', tournamentId: tournamentId }, window.location.href);
6096
6198
  }
6097
6199
  render() {
6098
6200
  return h("div", { ref: el => this.stylingContainer = el, class: "TournamentBannerWrap" }, this.thumbnail && h("div", { class: "TournamentBanner", part: "TournamentBanner" }, h("img", { src: this.thumbnail, alt: "", class: `TournamentBannerBg ${this.cardMode && this.state ? this.state : ''}` }), !this.cardMode &&
@@ -6100,11 +6202,12 @@ const CasinoTournamentBanner = class {
6100
6202
  h("span", { class: "Tag Date" }, this.showCalendar &&
6101
6203
  h("svg", { class: "CalendarIcon", width: "9", height: "11", viewBox: "0 0 9 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M8.1 1.4H7.65V0.5H6.75V1.4H2.25V0.5H1.35V1.4H0.9C0.405 1.4 0 1.805 0 2.3V9.5C0 9.995 0.405 10.4 0.9 10.4H8.1C8.595 10.4 9 9.995 9 9.5V2.3C9 1.805 8.595 1.4 8.1 1.4ZM8.10003 9.5H0.900027V4.55H8.10003V9.5ZM0.900027 3.65005H8.10003V2.30005H0.900027V3.65005Z", fill: "#1E1616" })), this.startdate)), h("div", { class: "BannerInfo", part: "BannerInfo" }, this.enrolled &&
6102
6204
  h("span", { class: "Tag Enroll" }, this.showCheck &&
6103
- h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, h("path", { d: "M4.50008 8.08492L2.41508 5.99992L1.70508 6.70492L4.50008 9.49992L10.5001 3.49992L9.79508 2.79492L4.50008 8.08492Z", fill: "white" })), translate$1('enrolled', this.language)))), this.cardMode && h("div", { class: "TournamentBannerThumb", part: "TournamentBannerThumb" }, h("div", { class: "ThumbTitle", part: "ThumbTitle" }, translate$1('tournament', this.language)), h("div", { class: "ThumbName", part: "ThumbName" }, this.nameOrTitle), h("div", { class: "ThumbState" }, this.enrolled ?
6205
+ h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, h("path", { d: "M4.50008 8.08492L2.41508 5.99992L1.70508 6.70492L4.50008 9.49992L10.5001 3.49992L9.79508 2.79492L4.50008 8.08492Z", fill: "white" })), translate$1('enrolled', this.language)))), this.cardMode && h("div", { class: "TournamentBannerThumb", part: "TournamentBannerThumb" }, h("div", { class: "ThumbTitle", part: "ThumbTitle" }, translate$1('tournament', this.language)), h("div", { class: "ThumbName", part: "ThumbName" }, this.nameOrTitle), h("div", { class: "ThumbState" }, this.session && this.enrolled ?
6104
6206
  h("span", { class: "Tag Join" }, h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, h("path", { d: "M4.50008 8.08492L2.41508 5.99992L1.70508 6.70492L4.50008 9.49992L10.5001 3.49992L9.79508 2.79492L4.50008 8.08492Z", fill: "white" })), translate$1('joined', this.language))
6105
6207
  :
6106
- this.state != 'Closed' &&
6107
- h("span", { class: "Tag Join" }, h("svg", { class: "JoinPlus", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "13", viewBox: "0 0 12 13", fill: "none" }, h("path", { d: "M9.5 6.8335H6.5V9.8335H5.5V6.8335H2.5V5.8335H5.5V2.8335H6.5V5.8335H9.5V6.8335Z", fill: "white" })), translate$1('join', this.language)), this.state == 'Running' && h("span", { class: `Tag State ${this.state}` }, this.stateText), (this.state == 'Unstarted' || this.state == 'Upcoming' || this.state == 'Closed') &&
6208
+ this.session && this.state != 'Closed' &&
6209
+ h("span", { class: "Tag Join" }, h("svg", { class: "JoinPlus", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "13", viewBox: "0 0 12 13", fill: "none" }, h("path", { d: "M9.5 6.8335H6.5V9.8335H5.5V6.8335H2.5V5.8335H5.5V2.8335H6.5V5.8335H9.5V6.8335Z", fill: "white" })), translate$1('join', this.language)), this.state == 'Running' && h("span", { class: `Tag State ${this.state}` }, this.stateText, this.showRunningDate &&
6210
+ h("span", { class: "TagRemain" }, this.showRemain, " ", translate$1('left', this.language))), (this.state == 'Unstarted' || this.state == 'Upcoming' || this.state == 'Closed') &&
6108
6211
  h("span", { class: `Tag Date ${this.state}` }, this.showCalendar &&
6109
6212
  h("svg", { class: "CalendarIcon", width: "9", height: "11", viewBox: "0 0 9 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M8.1 1.4H7.65V0.5H6.75V1.4H2.25V0.5H1.35V1.4H0.9C0.405 1.4 0 1.805 0 2.3V9.5C0 9.995 0.405 10.4 0.9 10.4H8.1C8.595 10.4 9 9.995 9 9.5V2.3C9 1.805 8.595 1.4 8.1 1.4ZM8.10003 9.5H0.900027V4.55H8.10003V9.5ZM0.900027 3.65005H8.10003V2.30005H0.900027V3.65005Z", fill: "#1E1616" })), this.startdate)), h("div", { class: "ThumbButtons" }, h("casino-tournament-buttons", { enrolled: this.enrolled, session: this.session, endpoint: this.endpoint, language: this.language, "tournament-id": this.tournamentId, "login-event": this.loginEvent, "login-url": this.loginUrl, "register-event": this.registerEvent, "register-url": this.registerUrl, currency: this.currency, "bonus-code": this.bonusCode, "show-read-more": this.showReadMore })), h("div", { class: "ThumbTC" }, h("span", { onClick: this.termsClick.bind(this, this.tournamentId) }, translate$1('terms', this.language))))));
6110
6213
  }
@@ -6444,26 +6547,26 @@ const casinoTournamentButtonsCss = ":host{display:block}.ButtonGroup{display:fle
6444
6547
  const CasinoTournamentButtons = class {
6445
6548
  constructor(hostRef) {
6446
6549
  registerInstance(this, hostRef);
6550
+ /**
6551
+ * Player enrolled
6552
+ */
6447
6553
  this.enrolled = false;
6554
+ /**
6555
+ * Show read more button
6556
+ */
6448
6557
  this.showReadMore = false;
6558
+ /**
6559
+ * Client custom styling via inline styles
6560
+ */
6449
6561
  this.clientStyling = '';
6562
+ /**
6563
+ * Client custom styling via url
6564
+ */
6450
6565
  this.clientStylingUrl = '';
6451
6566
  this.limitStylingAppends = false;
6452
6567
  this.joinButtonLoading = false;
6453
6568
  this.errorJoin = false;
6454
6569
  this.errorJoinConcurrently = false;
6455
- this.setClientStyling = () => {
6456
- let sheet = document.createElement('style');
6457
- sheet.innerHTML = this.clientStyling;
6458
- this.stylingContainer.prepend(sheet);
6459
- };
6460
- this.setClientStylingURL = () => {
6461
- let cssFile = document.createElement('style');
6462
- setTimeout(() => {
6463
- cssFile.innerHTML = this.clientStylingUrl;
6464
- this.stylingContainer.prepend(cssFile);
6465
- }, 1);
6466
- };
6467
6570
  }
6468
6571
  componentDidRender() {
6469
6572
  if (!this.limitStylingAppends && this.stylingContainer) {
@@ -6474,6 +6577,18 @@ const CasinoTournamentButtons = class {
6474
6577
  this.limitStylingAppends = true;
6475
6578
  }
6476
6579
  }
6580
+ setClientStyling() {
6581
+ let sheet = document.createElement('style');
6582
+ sheet.innerHTML = this.clientStyling;
6583
+ this.stylingContainer.prepend(sheet);
6584
+ }
6585
+ setClientStylingURL() {
6586
+ let cssFile = document.createElement('style');
6587
+ setTimeout(() => {
6588
+ cssFile.innerHTML = this.clientStylingUrl;
6589
+ this.stylingContainer.prepend(cssFile);
6590
+ }, 1);
6591
+ }
6477
6592
  loginAction() {
6478
6593
  if (this.loginEvent) {
6479
6594
  window.postMessage({ type: this.loginEvent, transition: 'Login' }, window.location.href);
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["casino-tournament-banner_2",[[1,"casino-tournament-banner",{"useEvent":[1,"use-event"],"state":[1],"enrolled":[4],"startTime":[1,"start-time"],"thumbnail":[1],"language":[1],"showCalendar":[4,"show-calendar"],"shortStart":[4,"short-start"],"shortstartformat":[1],"showDate":[4,"show-date"],"showCheck":[4,"show-check"],"cardMode":[4,"card-mode"],"nameOrTitle":[1,"name-or-title"],"tournamentId":[1,"tournament-id"],"session":[1],"loginEvent":[1,"login-event"],"loginUrl":[1,"login-url"],"registerEvent":[1,"register-event"],"registerUrl":[1,"register-url"],"endpoint":[1],"currency":[1],"bonusCode":[1,"bonus-code"],"showReadMore":[4,"show-read-more"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"stateText":[32],"limitStylingAppends":[32],"stylingContainer":[32],"startdate":[32]},[[8,"getTournamentInfoCompleted","infoCompletedHandler"]]],[1,"casino-tournament-buttons",{"language":[1],"tournamentId":[1,"tournament-id"],"session":[1],"loginEvent":[1,"login-event"],"loginUrl":[1,"login-url"],"registerEvent":[1,"register-event"],"registerUrl":[1,"register-url"],"endpoint":[1],"currency":[1],"bonusCode":[1,"bonus-code"],"enrolled":[4],"showReadMore":[4,"show-read-more"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"limitStylingAppends":[32],"stylingContainer":[32],"joinButtonLoading":[32],"errorJoin":[32],"errorJoinConcurrently":[32]}]]]], options);
13
+ return bootstrapLazy([["casino-tournament-banner_2",[[1,"casino-tournament-banner",{"useEvent":[1,"use-event"],"endpoint":[1],"state":[1],"enrolled":[4],"startTime":[1,"start-time"],"endTime":[1,"end-time"],"thumbnail":[1],"language":[1],"showCalendar":[4,"show-calendar"],"shortStart":[4,"short-start"],"shortstartformat":[1],"showDate":[4,"show-date"],"showRunningDate":[4,"show-running-date"],"showCheck":[4,"show-check"],"cardMode":[4,"card-mode"],"nameOrTitle":[1,"name-or-title"],"tournamentId":[1,"tournament-id"],"session":[1],"loginEvent":[1,"login-event"],"loginUrl":[1,"login-url"],"registerEvent":[1,"register-event"],"registerUrl":[1,"register-url"],"currency":[1],"bonusCode":[1,"bonus-code"],"showReadMore":[4,"show-read-more"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"stateText":[32],"limitStylingAppends":[32],"stylingContainer":[32],"startdate":[32],"tournamentLeftDays":[32],"showRemain":[32],"durationInterval":[32]},[[8,"getTournamentInfoCompleted","infoCompletedHandler"]]],[1,"casino-tournament-buttons",{"language":[1],"tournamentId":[1,"tournament-id"],"session":[1],"loginEvent":[1,"login-event"],"loginUrl":[1,"login-url"],"registerEvent":[1,"register-event"],"registerUrl":[1,"register-url"],"endpoint":[1],"currency":[1],"bonusCode":[1,"bonus-code"],"enrolled":[4],"showReadMore":[4,"show-read-more"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"limitStylingAppends":[32],"stylingContainer":[32],"joinButtonLoading":[32],"errorJoin":[32],"errorJoinConcurrently":[32]}]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -1,41 +1,130 @@
1
1
  import '@everymatrix/casino-tournament-buttons';
2
2
  export declare class CasinoTournamentBanner {
3
- useEvent: string;
4
- state: string;
5
- enrolled: boolean;
6
- startTime: string;
7
- thumbnail: string;
3
+ /**
4
+ * Use event to load data
5
+ */
6
+ useEvent?: string;
7
+ /**
8
+ * The NWA endpoint
9
+ */
10
+ endpoint?: string;
11
+ /**
12
+ * The tournament state
13
+ */
14
+ state?: string;
15
+ /**
16
+ * Player enrolled
17
+ */
18
+ enrolled?: boolean;
19
+ /**
20
+ * Tournament start time
21
+ */
22
+ startTime?: string;
23
+ /**
24
+ * Tournament end time
25
+ */
26
+ endTime?: string;
27
+ /**
28
+ * Tournament thumbnail
29
+ */
30
+ thumbnail?: string;
31
+ /**
32
+ * Widget Language to show
33
+ */
8
34
  language: string;
9
- showCalendar: boolean;
10
- shortStart: boolean;
11
- shortstartformat: string;
12
- showDate: boolean;
13
- showCheck: boolean;
14
- cardMode: boolean;
15
- nameOrTitle: string;
16
- tournamentId: string;
17
- session: string;
18
- loginEvent: string;
19
- loginUrl: string;
20
- registerEvent: string;
21
- registerUrl: string;
22
- endpoint: string;
23
- currency: string;
24
- bonusCode: string;
25
- showReadMore: boolean;
26
- clientStyling: string;
27
- clientStylingUrl: string;
35
+ /**
36
+ * Show calendar icon
37
+ */
38
+ showCalendar?: boolean;
39
+ /**
40
+ * Show short start time on tag
41
+ */
42
+ shortStart?: boolean;
43
+ /**
44
+ * Short start time format
45
+ */
46
+ shortstartformat?: string;
47
+ /**
48
+ * Show date on widget
49
+ */
50
+ showDate?: boolean;
51
+ /**
52
+ * Show date on running state tournament tag
53
+ */
54
+ showRunningDate?: boolean;
55
+ /**
56
+ * Show check icon on enrolled tag
57
+ */
58
+ showCheck?: boolean;
59
+ /**
60
+ * Widget display as a card
61
+ */
62
+ cardMode?: boolean;
63
+ /**
64
+ * Widget name or title
65
+ */
66
+ nameOrTitle?: string;
67
+ /**
68
+ * Tournament ID
69
+ */
70
+ tournamentId?: string;
71
+ /**
72
+ * The NWA Session
73
+ */
74
+ session?: string;
75
+ /**
76
+ * Login event
77
+ */
78
+ loginEvent?: string;
79
+ /**
80
+ * Login url
81
+ */
82
+ loginUrl?: string;
83
+ /**
84
+ * Register Event
85
+ */
86
+ registerEvent?: string;
87
+ /**
88
+ * Register url
89
+ */
90
+ registerUrl?: string;
91
+ /**
92
+ * Player currency
93
+ */
94
+ currency?: string;
95
+ /**
96
+ * Bonus Code
97
+ */
98
+ bonusCode?: string;
99
+ /**
100
+ * Show read more button
101
+ */
102
+ showReadMore?: boolean;
103
+ /**
104
+ * Client custom styling via inline styles
105
+ */
106
+ clientStyling?: string;
107
+ /**
108
+ * Client custom styling via url
109
+ */
110
+ clientStylingUrl?: string;
28
111
  stateText: string;
29
112
  limitStylingAppends: boolean;
30
113
  stylingContainer: HTMLElement;
31
114
  startdate: string;
115
+ tournamentLeftDays: number;
116
+ showRemain: string;
117
+ durationInterval: number;
118
+ getDateTimeDiff(dateString1: Date, dateString2: string): number;
119
+ getTextByDiff(diff: number): any;
120
+ getDuration(): void;
32
121
  infoCompletedHandler(event: CustomEvent<any>): void;
33
- getStateText(state: any): string;
122
+ getStateText(state: string): string;
34
123
  componentDidRender(): void;
35
- setClientStyling: () => void;
36
- setClientStylingURL: () => void;
37
- formatDate: () => void;
124
+ setClientStyling(): void;
125
+ setClientStylingURL(): void;
126
+ formatDate(): void;
38
127
  componentWillLoad(): void;
39
- termsClick(tournamentId: any): void;
128
+ termsClick(tournamentId: string): void;
40
129
  render(): any;
41
130
  }