@everymatrix/helper-tabs 1.52.6 → 1.53.10

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.
@@ -1,6 +1,25 @@
1
1
  import { h } from "@stencil/core";
2
+ import { translate } from "../../utils/locale.utils";
2
3
  export class HelperTab {
3
4
  constructor() {
5
+ /**
6
+ * Selected index
7
+ */
8
+ this.selectedIndex = 0;
9
+ /**
10
+ * Client custom styling via string
11
+ */
12
+ this.clientStyling = '';
13
+ /**
14
+ * Client custom styling via url content
15
+ */
16
+ this.clientStylingUrlContent = '';
17
+ /**
18
+ * Language of the widget
19
+ */
20
+ this.language = 'en';
21
+ this.tabContent = '';
22
+ this.limitStylingAppends = false;
4
23
  this.setClientStyling = () => {
5
24
  let sheet = document.createElement('style');
6
25
  sheet.innerHTML = this.clientStyling;
@@ -13,17 +32,6 @@ export class HelperTab {
13
32
  this.stylingContainer.prepend(cssFile);
14
33
  }, 1);
15
34
  };
16
- this.selectedIndex = 0;
17
- this.cmsEndpoint = undefined;
18
- this.clientStyling = '';
19
- this.clientStylingUrlContent = '';
20
- this.tabContent = '';
21
- this.limitStylingAppends = false;
22
- }
23
- connectedCallback() {
24
- /**
25
- * fetch(cmsEndpoint + / + / + selectedIndex)
26
- */
27
35
  }
28
36
  componentDidRender() {
29
37
  // start custom styling area
@@ -37,12 +45,12 @@ export class HelperTab {
37
45
  // end custom styling area
38
46
  }
39
47
  render() {
40
- this.tabContent = h("div", { key: 'd69c61827b4fb6d934c72b0b2d37d72fca307575', class: "TabContent", ref: el => this.stylingContainer = el }, "Each play includes one set of numbers from 1 to 21 with a selectable number of 8 and a second, 4-digit set of numbers, with a minimum selection of 1. Draws are held every 5 minutes and the winnings are automatically credited to your account.");
48
+ this.tabContent = h("div", { key: '8c2b3f0f34ccda482fd187218840f9a622698b1f', class: "TabContent", ref: el => this.stylingContainer = el }, translate('numbersFrom', this.language), " ", this.lowNumber, " ", translate('to', this.language), " ", this.highNumber, " ", translate('selectableNumber', this.language), " ", this.maxinumAllowed, " ", translate('minimumSelection', this.language), " ", this.minimumAllowed, ". ", translate('winnings', this.language));
41
49
  if (this.selectedIndex + 1 == 2) {
42
- this.tabContent = h("div", { key: 'ab912cbb3bc3e88ecf8fe5f8f0e7eb16460100bd', class: "TabContent", ref: el => this.stylingContainer = el }, h("ol", { key: '17bed41dffe7d5578452ee13a47b442d10366ce2' }, h("li", { key: 'cf0da42f07cf92f5cea9c9f504c8836e528a5708' }, "Register or Login"), h("li", { key: '4a0339df365c6b1a37b8a74c5022a56197e870db' }, "Buy tickets. Select 'Buy Tickets' to pick your numbers. Want us to automatically generate random numbers for you? Choose \u201CI feel lucky\u201D."), h("li", { key: '3f29a9b17c1059493648247868b83eb71241b8bd' }, "Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!")));
50
+ this.tabContent = h("div", { key: '2950bb6ccdd98761099d12239881ab29da4b2213', class: "TabContent", ref: el => this.stylingContainer = el }, h("ol", { key: '0da821f45e855155003809cb4c84eaa8d25f1f2a' }, h("li", { key: '15d4f064c62319c6611baa3693f4ef297309c786' }, translate('register', this.language)), h("li", { key: '4933c6970d4044aac746abb398f7c255b0484f6a' }, translate('butTickets', this.language)), h("li", { key: 'ffe7cef3e53bd281173384756476acd2e0e8f148' }, translate('reviewPurchase', this.language))));
43
51
  }
44
52
  else if (this.selectedIndex + 1 == 3) {
45
- this.tabContent = h("div", { key: 'ceac54698e0e5c55a049600f02e8f413a76a1c33', class: "TabContent", ref: el => this.stylingContainer = el }, h("ul", { key: '426d89c86a1d44f6d515bc1a7902e43317127939' }, h("li", { key: '457a225564399001dcab48097578174a27231ca7' }, "What are my odds of winning?"), h("li", { key: 'd35220f2aca215eff391cab54d719f18ef906c77' }, "How can I find out if I\u2019ve won a draw game?"), h("li", { key: 'fcd560ee4b6740c319cf0f98a0b98da8fd9e14a4' }, "How do I claim my prize?")));
53
+ this.tabContent = h("div", { key: '296c83d55150c67522cea9cb1fc10f3542c72452', class: "TabContent", ref: el => this.stylingContainer = el }, h("ul", { key: '3fc772a007d0f73e0692021a2f700bab5807bb85' }, h("li", { key: 'fd6e459a0536261d98e42e37a272f229d152dfb7' }, translate('odds', this.language)), h("li", { key: 'ae7e5bceb217c9ceb1303145ae83f05fddd7dde6' }, translate('winGame', this.language)), h("li", { key: 'a094c7ea0db72683fb134f010d22f02b61f25a4b' }, translate('claimPrize', this.language))));
46
54
  }
47
55
  return (this.tabContent);
48
56
  }
@@ -74,6 +82,8 @@ export class HelperTab {
74
82
  "tags": [],
75
83
  "text": "Selected index"
76
84
  },
85
+ "getter": false,
86
+ "setter": false,
77
87
  "attribute": "selected-index",
78
88
  "reflect": true,
79
89
  "defaultValue": "0"
@@ -92,6 +102,8 @@ export class HelperTab {
92
102
  "tags": [],
93
103
  "text": "Endpoing for CMS"
94
104
  },
105
+ "getter": false,
106
+ "setter": false,
95
107
  "attribute": "cms-endpoint",
96
108
  "reflect": true
97
109
  },
@@ -109,6 +121,8 @@ export class HelperTab {
109
121
  "tags": [],
110
122
  "text": "Client custom styling via string"
111
123
  },
124
+ "getter": false,
125
+ "setter": false,
112
126
  "attribute": "client-styling",
113
127
  "reflect": true,
114
128
  "defaultValue": "''"
@@ -127,9 +141,107 @@ export class HelperTab {
127
141
  "tags": [],
128
142
  "text": "Client custom styling via url content"
129
143
  },
144
+ "getter": false,
145
+ "setter": false,
130
146
  "attribute": "client-styling-url-content",
131
147
  "reflect": true,
132
148
  "defaultValue": "''"
149
+ },
150
+ "lowNumber": {
151
+ "type": "number",
152
+ "mutable": false,
153
+ "complexType": {
154
+ "original": "number",
155
+ "resolved": "number",
156
+ "references": {}
157
+ },
158
+ "required": false,
159
+ "optional": false,
160
+ "docs": {
161
+ "tags": [],
162
+ "text": "Minimum number displayed in the board"
163
+ },
164
+ "getter": false,
165
+ "setter": false,
166
+ "attribute": "low-number",
167
+ "reflect": true
168
+ },
169
+ "highNumber": {
170
+ "type": "number",
171
+ "mutable": false,
172
+ "complexType": {
173
+ "original": "number",
174
+ "resolved": "number",
175
+ "references": {}
176
+ },
177
+ "required": false,
178
+ "optional": false,
179
+ "docs": {
180
+ "tags": [],
181
+ "text": "Maximum number displayed in the board"
182
+ },
183
+ "getter": false,
184
+ "setter": false,
185
+ "attribute": "high-number",
186
+ "reflect": true
187
+ },
188
+ "minimumAllowed": {
189
+ "type": "number",
190
+ "mutable": false,
191
+ "complexType": {
192
+ "original": "number",
193
+ "resolved": "number",
194
+ "references": {}
195
+ },
196
+ "required": false,
197
+ "optional": false,
198
+ "docs": {
199
+ "tags": [],
200
+ "text": "Minimum number of numbers that can be selected"
201
+ },
202
+ "getter": false,
203
+ "setter": false,
204
+ "attribute": "minimum-allowed",
205
+ "reflect": true
206
+ },
207
+ "maxinumAllowed": {
208
+ "type": "number",
209
+ "mutable": false,
210
+ "complexType": {
211
+ "original": "number",
212
+ "resolved": "number",
213
+ "references": {}
214
+ },
215
+ "required": false,
216
+ "optional": false,
217
+ "docs": {
218
+ "tags": [],
219
+ "text": "Maximum number of numbers that can be selected"
220
+ },
221
+ "getter": false,
222
+ "setter": false,
223
+ "attribute": "maxinum-allowed",
224
+ "reflect": true
225
+ },
226
+ "language": {
227
+ "type": "string",
228
+ "mutable": false,
229
+ "complexType": {
230
+ "original": "string",
231
+ "resolved": "string",
232
+ "references": {}
233
+ },
234
+ "required": false,
235
+ "optional": false,
236
+ "docs": {
237
+ "tags": [],
238
+ "text": "Language of the widget"
239
+ },
240
+ "getter": false,
241
+ "setter": false,
242
+ "attribute": "language",
243
+ "reflect": true,
244
+ "defaultValue": "'en'"
133
245
  }
134
246
  };
135
247
  }
@@ -13,12 +13,12 @@
13
13
  .TabButton {
14
14
  cursor: pointer;
15
15
  width: auto;
16
- border-radius: 4px;
16
+ border-radius: var(--emw--button-border-radius, 4px);
17
17
  padding: 8px 15px;
18
18
  margin: 5px 0 10px;
19
- border: 1px solid #009993;
20
- background: #FFF;
21
- color: #000;
19
+ border: 1px solid var(--emw--color-typography, #009993);
20
+ background: var(--emw--color-gray-transparency-100, rgb(255, 255, 255));
21
+ color: var(--emw--button-text-color, #000);
22
22
  font-size: 12px;
23
23
  transition: all 0.2s linear;
24
24
  text-align: center;
@@ -26,9 +26,9 @@
26
26
  white-space: nowrap;
27
27
  }
28
28
  .TabButton:hover {
29
- background: #F1F1F1;
29
+ background: var(--emw--color-gray-50, #F1F1F1);
30
30
  }
31
31
  .TabButton.Active {
32
- background: #009993;
33
- color: #FFF;
32
+ background: var(--emw--color-background, #009993);
33
+ color: var(--emw--color-gray-transparency-100, rgb(255, 255, 255));
34
34
  }
@@ -1,6 +1,35 @@
1
1
  import { h } from "@stencil/core";
2
2
  export class HelperTabs {
3
3
  constructor() {
4
+ /**
5
+ * Tell me if it is disabled
6
+ */
7
+ this.disabled = false;
8
+ /**
9
+ * Tell me what tab is selected
10
+ */
11
+ this.selected = false;
12
+ /**
13
+ * Default selected index
14
+ */
15
+ this.selectedIndex = 0;
16
+ /**
17
+ * Tabs details
18
+ */
19
+ this.tabs = [{ label: 'How to Play' }, { label: 'About' }, { label: 'FAQs' }];
20
+ /**
21
+ * Client custom styling via string
22
+ */
23
+ this.clientStyling = '';
24
+ /**
25
+ * Client custom styling via url
26
+ */
27
+ this.clientStylingurl = '';
28
+ /**
29
+ * Client custom styling via url content
30
+ */
31
+ this.clientStylingUrlContent = '';
32
+ this.limitStylingAppends = false;
4
33
  this.setClientStyling = () => {
5
34
  let sheet = document.createElement('style');
6
35
  sheet.innerHTML = this.clientStyling;
@@ -13,16 +42,6 @@ export class HelperTabs {
13
42
  this.stylingContainer.prepend(cssFile);
14
43
  }, 1);
15
44
  };
16
- this.disabled = false;
17
- this.label = undefined;
18
- this.selected = false;
19
- this.cmsEndpoint = undefined;
20
- this.selectedIndex = 0;
21
- this.tabs = [{ label: 'How to Play' }, { label: 'About' }, { label: 'FAQs' }];
22
- this.clientStyling = '';
23
- this.clientStylingurl = '';
24
- this.clientStylingUrlContent = '';
25
- this.limitStylingAppends = false;
26
45
  }
27
46
  connectedCallback() {
28
47
  if (this.tabs.length == 0) {
@@ -41,7 +60,7 @@ export class HelperTabs {
41
60
  // end custom styling area
42
61
  }
43
62
  render() {
44
- return (h("div", { key: '841b2a4b84f2ecdaf692b9cab2eac4b3413186e7', ref: el => this.stylingContainer = el }, h("div", { key: '4c5d57e669f9f45d204bff8a85ca89a0574c4627', class: "Tabs" }, this.tabs.map((tab, index) => h("button", { class: 'TabButton' + (this.selectedIndex == index ? ' Active' : ''), onClick: () => this.selectedIndex = index }, tab.label))), h("div", { key: '7ba983dec3b0355f390b19191d0d823914f09037' }, h("helper-tab", { key: 'e6c7739d50948582d8d14d530828508b4cb90d6e', selectedIndex: this.selectedIndex, "client-styling": this.clientStyling, "client-stylingurl": this.clientStylingurl, "client-styling-url-content": this.clientStylingUrlContent }))));
63
+ return (h("div", { key: 'cb91a99a4d5eb99ce625c276894f8b682159c12c', ref: el => this.stylingContainer = el }, h("div", { key: 'c57ea36b3e25c605894b7ddf19e5e456f2fa252d', class: "Tabs" }, this.tabs.map((tab, index) => h("button", { class: 'TabButton' + (this.selectedIndex == index ? ' Active' : ''), onClick: () => this.selectedIndex = index }, tab.label))), h("div", { key: '41fa20ee2cc713af685f902fc496a702464398d1' }, h("helper-tab", { key: 'fded6e290107cbc06909aee2e2c97e1c1dd76db3', "low-number": this.lowNumber, "high-number": this.highNumber, "minimum-allowed": this.minimumAllowed, "maxinum-allowed": this.maxinumAllowed, selectedIndex: this.selectedIndex, "client-styling": this.clientStyling, "client-stylingurl": this.clientStylingurl, "client-styling-url-content": this.clientStylingUrlContent }))));
45
64
  }
46
65
  static get is() { return "helper-tabs"; }
47
66
  static get encapsulation() { return "shadow"; }
@@ -71,6 +90,8 @@ export class HelperTabs {
71
90
  "tags": [],
72
91
  "text": "Tell me if it is disabled"
73
92
  },
93
+ "getter": false,
94
+ "setter": false,
74
95
  "attribute": "disabled",
75
96
  "reflect": true,
76
97
  "defaultValue": "false"
@@ -89,6 +110,8 @@ export class HelperTabs {
89
110
  "tags": [],
90
111
  "text": "Gimme names or you die"
91
112
  },
113
+ "getter": false,
114
+ "setter": false,
92
115
  "attribute": "label",
93
116
  "reflect": true
94
117
  },
@@ -106,6 +129,8 @@ export class HelperTabs {
106
129
  "tags": [],
107
130
  "text": "Tell me what tab is selected"
108
131
  },
132
+ "getter": false,
133
+ "setter": false,
109
134
  "attribute": "selected",
110
135
  "reflect": true,
111
136
  "defaultValue": "false"
@@ -124,6 +149,8 @@ export class HelperTabs {
124
149
  "tags": [],
125
150
  "text": "Endpoing for CMS"
126
151
  },
152
+ "getter": false,
153
+ "setter": false,
127
154
  "attribute": "cms-endpoint",
128
155
  "reflect": true
129
156
  },
@@ -141,6 +168,8 @@ export class HelperTabs {
141
168
  "tags": [],
142
169
  "text": "Default selected index"
143
170
  },
171
+ "getter": false,
172
+ "setter": false,
144
173
  "attribute": "selected-index",
145
174
  "reflect": true,
146
175
  "defaultValue": "0"
@@ -168,6 +197,8 @@ export class HelperTabs {
168
197
  "tags": [],
169
198
  "text": "Tabs details"
170
199
  },
200
+ "getter": false,
201
+ "setter": false,
171
202
  "defaultValue": "[{label: 'How to Play'}, {label: 'About'}, {label: 'FAQs'}]"
172
203
  },
173
204
  "clientStyling": {
@@ -184,6 +215,8 @@ export class HelperTabs {
184
215
  "tags": [],
185
216
  "text": "Client custom styling via string"
186
217
  },
218
+ "getter": false,
219
+ "setter": false,
187
220
  "attribute": "client-styling",
188
221
  "reflect": true,
189
222
  "defaultValue": "''"
@@ -202,6 +235,8 @@ export class HelperTabs {
202
235
  "tags": [],
203
236
  "text": "Client custom styling via url"
204
237
  },
238
+ "getter": false,
239
+ "setter": false,
205
240
  "attribute": "client-stylingurl",
206
241
  "reflect": true,
207
242
  "defaultValue": "''"
@@ -220,9 +255,87 @@ export class HelperTabs {
220
255
  "tags": [],
221
256
  "text": "Client custom styling via url content"
222
257
  },
258
+ "getter": false,
259
+ "setter": false,
223
260
  "attribute": "client-styling-url-content",
224
261
  "reflect": true,
225
262
  "defaultValue": "''"
263
+ },
264
+ "lowNumber": {
265
+ "type": "number",
266
+ "mutable": false,
267
+ "complexType": {
268
+ "original": "number",
269
+ "resolved": "number",
270
+ "references": {}
271
+ },
272
+ "required": false,
273
+ "optional": false,
274
+ "docs": {
275
+ "tags": [],
276
+ "text": "Minimum number displayed in the board"
277
+ },
278
+ "getter": false,
279
+ "setter": false,
280
+ "attribute": "low-number",
281
+ "reflect": true
282
+ },
283
+ "highNumber": {
284
+ "type": "number",
285
+ "mutable": false,
286
+ "complexType": {
287
+ "original": "number",
288
+ "resolved": "number",
289
+ "references": {}
290
+ },
291
+ "required": false,
292
+ "optional": false,
293
+ "docs": {
294
+ "tags": [],
295
+ "text": "Maximum number displayed in the board"
296
+ },
297
+ "getter": false,
298
+ "setter": false,
299
+ "attribute": "high-number",
300
+ "reflect": true
301
+ },
302
+ "minimumAllowed": {
303
+ "type": "number",
304
+ "mutable": false,
305
+ "complexType": {
306
+ "original": "number",
307
+ "resolved": "number",
308
+ "references": {}
309
+ },
310
+ "required": false,
311
+ "optional": false,
312
+ "docs": {
313
+ "tags": [],
314
+ "text": "Minimum number of numbers that can be selected"
315
+ },
316
+ "getter": false,
317
+ "setter": false,
318
+ "attribute": "minimum-allowed",
319
+ "reflect": true
320
+ },
321
+ "maxinumAllowed": {
322
+ "type": "number",
323
+ "mutable": false,
324
+ "complexType": {
325
+ "original": "number",
326
+ "resolved": "number",
327
+ "references": {}
328
+ },
329
+ "required": false,
330
+ "optional": false,
331
+ "docs": {
332
+ "tags": [],
333
+ "text": "Maximum number of numbers that can be selected"
334
+ },
335
+ "getter": false,
336
+ "setter": false,
337
+ "attribute": "maxinum-allowed",
338
+ "reflect": true
226
339
  }
227
340
  };
228
341
  }
@@ -0,0 +1,49 @@
1
+ const DEFAULT_LANGUAGE = 'en';
2
+ const SUPPORTED_LANGUAGES = ['en'];
3
+ const TRANSLATIONS = {
4
+ en: {
5
+ numbersFrom: 'Each play includes one set of numbers from',
6
+ to: 'to',
7
+ selectableNumber: 'with a selectable number of',
8
+ minimumSelection: 'and a minimum selection of',
9
+ winnings: 'The winnings are automatically credited to your account.',
10
+ register: 'Register or Login',
11
+ butTickets: 'Buy tickets. Select "Buy Tickets" to pick your numbers. Want us to automatically generate random numbers for you? Choose “quick pick”.',
12
+ reviewPurchase: "Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!",
13
+ odds: 'What are my odds of winning?',
14
+ winGame: 'How can I find out if I’ve won a draw game?',
15
+ claimPrize: 'How do I claim my prize?'
16
+ },
17
+ ro: {
18
+ numbersFrom: 'Each play includes one set of numbers from',
19
+ to: 'to',
20
+ selectableNumber: 'with a selectable number of',
21
+ minimumSelection: 'and a minimum selection of',
22
+ winnings: 'The winnings are automatically credited to your account.'
23
+ },
24
+ fr: {
25
+ numbersFrom: 'Each play includes one set of numbers from',
26
+ to: 'to',
27
+ selectableNumber: 'with a selectable number of',
28
+ minimumSelection: 'and a minimum selection of',
29
+ winnings: 'The winnings are automatically credited to your account.'
30
+ },
31
+ ar: {
32
+ numbersFrom: 'Each play includes one set of numbers from',
33
+ to: 'to',
34
+ selectableNumber: 'with a selectable number of',
35
+ minimumSelection: 'and a minimum selection of',
36
+ winnings: 'The winnings are automatically credited to your account.'
37
+ },
38
+ hr: {
39
+ numbersFrom: 'Each play includes one set of numbers from',
40
+ to: 'to',
41
+ selectableNumber: 'with a selectable number of',
42
+ minimumSelection: 'and a minimum selection of',
43
+ winnings: 'The winnings are automatically credited to your account.'
44
+ }
45
+ };
46
+ export const translate = (key, customLang) => {
47
+ const lang = customLang;
48
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
49
+ };