@everymatrix/lottery-subscription 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.
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-a7f3c31f.js +1204 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/lottery-subscription-99a4efee.js +8156 -0
- package/dist/cjs/lottery-subscription.cjs.entry.js +10 -0
- package/dist/cjs/lottery-subscription.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/lottery-subscription/index.js +1 -0
- package/dist/collection/components/lottery-subscription/lottery-subscription.css +17 -0
- package/dist/collection/components/lottery-subscription/lottery-subscription.js +457 -0
- package/dist/collection/components/lottery-subscription/lottery-subscription.type.js +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +35 -0
- package/dist/collection/utils/utils.js +28 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-0cefb8d0.js +1177 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/lottery-subscription-8ae08dc1.js +8154 -0
- package/dist/esm/lottery-subscription.entry.js +2 -0
- package/dist/esm/lottery-subscription.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/lottery-subscription/index.esm.js +1 -0
- package/dist/lottery-subscription/lottery-subscription.esm.js +1 -0
- package/dist/lottery-subscription/p-0117a469.js +2 -0
- package/dist/lottery-subscription/p-0de4713f.js +5614 -0
- package/dist/lottery-subscription/p-a28fd10e.entry.js +1 -0
- package/dist/lottery-subscription/p-e1255160.js +1 -0
- package/dist/stencil.config.dev.js +16 -0
- package/dist/stencil.config.js +17 -0
- package/dist/storybook/main.js +21 -0
- package/dist/storybook/preview.js +9 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-subscription/.stencil/packages/stencil/lottery-subscription/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-subscription/.stencil/packages/stencil/lottery-subscription/stencil.config.dev.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-subscription/.stencil/packages/stencil/lottery-subscription/storybook/main.d.ts +3 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-subscription/.stencil/packages/stencil/lottery-subscription/storybook/preview.d.ts +70 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-subscription/.stencil/packages/stencil/lottery-subscription/utils/utils.d.ts +1 -0
- package/dist/types/components/lottery-subscription/index.d.ts +1 -0
- package/dist/types/components/lottery-subscription/lottery-subscription.d.ts +73 -0
- package/dist/types/components/lottery-subscription/lottery-subscription.type.d.ts +20 -0
- package/dist/types/components.d.ts +119 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/locale.utils.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +2 -0
- package/dist/utils/utils.js +3 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +29 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const lotterySubscription = require('./lottery-subscription-99a4efee.js');
|
|
6
|
+
require('./index-a7f3c31f.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.lottery_subscription = lotterySubscription.LotterySubscription;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-a7f3c31f.js');
|
|
6
|
+
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
10
|
+
*/
|
|
11
|
+
var patchBrowser = () => {
|
|
12
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('lottery-subscription.cjs.js', document.baseURI).href));
|
|
13
|
+
const opts = {};
|
|
14
|
+
if (importMeta !== "") {
|
|
15
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
16
|
+
}
|
|
17
|
+
return index.promiseResolve(opts);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
patchBrowser().then(async (options) => {
|
|
21
|
+
await appGlobals.globalScripts();
|
|
22
|
+
return index.bootstrapLazy([["lottery-subscription.cjs",[[1,"lottery-subscription",{"translationUrl":[520,"translation-url"],"clientStyling":[513,"client-styling"],"clientStylingUrlContent":[513,"client-styling-url-content"],"endpoint":[513],"endpointTicket":[513,"endpoint-ticket"],"endpointSubscription":[513,"endpoint-subscription"],"language":[513],"gameName":[513,"game-name"],"isSubscribed":[32],"frequenceList":[32],"frequenceState":[32],"filterData":[32],"subscriptionCode":[32],"conditionId":[32],"paramId":[32],"conditionRule":[32],"paramRule":[32],"peroidRule":[32],"startDateRule":[32],"endDateRule":[32],"gameNameRule":[32],"ruleType":[32],"limitStylingAppends":[32]}]]]], options);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LotterySubscription } from './lottery-subscription';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.subscripitonContainer {
|
|
2
|
+
margin-bottom: 40px;
|
|
3
|
+
}
|
|
4
|
+
.subscripitonContainer vaadin-checkbox[checked]::part(checkbox) {
|
|
5
|
+
background-color: var(--emw--color-background, #009993);
|
|
6
|
+
}
|
|
7
|
+
.subscripitonContainer .secondCondition {
|
|
8
|
+
padding-left: 24px;
|
|
9
|
+
}
|
|
10
|
+
.subscripitonContainer .thirdCondition {
|
|
11
|
+
display: flex;
|
|
12
|
+
gap: 24px;
|
|
13
|
+
align-items: center;
|
|
14
|
+
}
|
|
15
|
+
.subscripitonContainer .thirdCondition, .subscripitonContainer .secondConditon {
|
|
16
|
+
margin: 16px 0;
|
|
17
|
+
}
|
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { translate, getTranslations } from "../../utils/locale.utils";
|
|
3
|
+
import { fetchRequest } from "../../utils/utils";
|
|
4
|
+
import "../../../../../../../libs/vaadin-facade/index";
|
|
5
|
+
import { format } from "date-fns";
|
|
6
|
+
export class LotterySubscription {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.setClientStyling = () => {
|
|
9
|
+
let sheet = document.createElement('style');
|
|
10
|
+
sheet.innerHTML = this.clientStyling;
|
|
11
|
+
this.stylingContainer.prepend(sheet);
|
|
12
|
+
};
|
|
13
|
+
this.setClientStylingURL = () => {
|
|
14
|
+
let cssFile = document.createElement('style');
|
|
15
|
+
setTimeout(() => {
|
|
16
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
17
|
+
this.stylingContainer.prepend(cssFile);
|
|
18
|
+
}, 1);
|
|
19
|
+
};
|
|
20
|
+
this.changeDateParam = () => {
|
|
21
|
+
if (this.filterData.from && !this.filterData.to) {
|
|
22
|
+
let from = this.filterData.from;
|
|
23
|
+
let dateArray = from.split('/');
|
|
24
|
+
from = new Date(Date.UTC(Number(dateArray[2]), Number(dateArray[1]) - 1, Number(dateArray[0]), 0, 0, 0)).toISOString();
|
|
25
|
+
const ruleDefinitionParams = {
|
|
26
|
+
conditionMetadata: this.conditionRule,
|
|
27
|
+
paramMetadata: this.paramRule,
|
|
28
|
+
conditions: [
|
|
29
|
+
{
|
|
30
|
+
value: from,
|
|
31
|
+
fieldId: this.startDateRule.id
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
value: '',
|
|
35
|
+
fieldId: this.endDateRule.id
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
value: this.frequenceState,
|
|
39
|
+
fieldId: this.peroidRule.id
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
fieldId: this.gameNameRule.id,
|
|
43
|
+
value: this.gameName
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
params: [],
|
|
47
|
+
ruleType: this.ruleType
|
|
48
|
+
};
|
|
49
|
+
ruleDefinitionParams.params = this.paramRule.fields.map((field) => {
|
|
50
|
+
return {
|
|
51
|
+
value: '',
|
|
52
|
+
field,
|
|
53
|
+
fieldId: field.id
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
this.subscriptionCompleted.emit(ruleDefinitionParams);
|
|
57
|
+
}
|
|
58
|
+
if (this.filterData.from && this.filterData.to) {
|
|
59
|
+
const { from, to } = this.transDate(this.filterData.from, this.filterData.to);
|
|
60
|
+
const ruleDefinitionParams = {
|
|
61
|
+
conditionMetadata: this.conditionRule,
|
|
62
|
+
paramMetadata: this.paramRule,
|
|
63
|
+
conditions: [
|
|
64
|
+
{
|
|
65
|
+
value: from,
|
|
66
|
+
fieldId: this.startDateRule.id
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
value: to,
|
|
70
|
+
fieldId: this.endDateRule.id
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
value: this.frequenceState,
|
|
74
|
+
fieldId: this.peroidRule.id
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
fieldId: this.gameNameRule.id,
|
|
78
|
+
value: this.gameName
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
params: [],
|
|
82
|
+
ruleType: this.ruleType
|
|
83
|
+
};
|
|
84
|
+
ruleDefinitionParams.params = this.paramRule.fields.map((field) => {
|
|
85
|
+
return {
|
|
86
|
+
value: '',
|
|
87
|
+
field,
|
|
88
|
+
fieldId: field.id
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
this.subscriptionCompleted.emit(ruleDefinitionParams);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
this.handleFilterFrom = (event) => {
|
|
95
|
+
const inputElement = event.target;
|
|
96
|
+
let dateArray = inputElement.value.split('-');
|
|
97
|
+
if (dateArray.length === 3) {
|
|
98
|
+
this.filterData = Object.assign(Object.assign({}, this.filterData), { from: `${dateArray[2]}/${dateArray[1]}/${dateArray[0]}` });
|
|
99
|
+
}
|
|
100
|
+
this.changeDateParam();
|
|
101
|
+
};
|
|
102
|
+
this.handleFilterTo = (event) => {
|
|
103
|
+
const inputElement = event.target;
|
|
104
|
+
let dateArray = inputElement.value.split('-');
|
|
105
|
+
if (dateArray.length === 3) {
|
|
106
|
+
this.filterData = Object.assign(Object.assign({}, this.filterData), { to: `${dateArray[2]}/${dateArray[1]}/${dateArray[0]}` });
|
|
107
|
+
}
|
|
108
|
+
this.changeDateParam();
|
|
109
|
+
};
|
|
110
|
+
this.translationUrl = undefined;
|
|
111
|
+
this.clientStyling = '';
|
|
112
|
+
this.clientStylingUrlContent = '';
|
|
113
|
+
this.endpoint = undefined;
|
|
114
|
+
this.endpointTicket = undefined;
|
|
115
|
+
this.endpointSubscription = undefined;
|
|
116
|
+
this.language = 'en';
|
|
117
|
+
this.gameName = undefined;
|
|
118
|
+
this.isSubscribed = false;
|
|
119
|
+
this.frequenceList = [];
|
|
120
|
+
this.frequenceState = '';
|
|
121
|
+
this.filterData = { from: '', to: '' };
|
|
122
|
+
this.subscriptionCode = 'lottery-subscription-widget001';
|
|
123
|
+
this.conditionId = '';
|
|
124
|
+
this.paramId = '';
|
|
125
|
+
this.conditionRule = undefined;
|
|
126
|
+
this.paramRule = undefined;
|
|
127
|
+
this.peroidRule = undefined;
|
|
128
|
+
this.startDateRule = undefined;
|
|
129
|
+
this.endDateRule = undefined;
|
|
130
|
+
this.gameNameRule = undefined;
|
|
131
|
+
this.ruleType = '';
|
|
132
|
+
this.limitStylingAppends = false;
|
|
133
|
+
}
|
|
134
|
+
componentWillLoad() {
|
|
135
|
+
if (this.translationUrl) {
|
|
136
|
+
getTranslations(JSON.parse(this.translationUrl));
|
|
137
|
+
}
|
|
138
|
+
this.getSubscriptionData();
|
|
139
|
+
}
|
|
140
|
+
componentDidRender() {
|
|
141
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
142
|
+
if (this.clientStyling)
|
|
143
|
+
this.setClientStyling();
|
|
144
|
+
if (this.clientStylingUrlContent)
|
|
145
|
+
this.setClientStylingURL();
|
|
146
|
+
this.limitStylingAppends = true;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
transDate(from, to) {
|
|
150
|
+
let dateArray = from.split('/');
|
|
151
|
+
let dateArrayTo = to.split('/');
|
|
152
|
+
const transferData = {
|
|
153
|
+
from: new Date(Date.UTC(Number(dateArray[2]), Number(dateArray[1]) - 1, Number(dateArray[0]), 0, 0, 0)).toISOString(),
|
|
154
|
+
to: new Date(Date.UTC(Number(dateArrayTo[2]), Number(dateArrayTo[1]) - 1, Number(dateArrayTo[0]), 23, 59, 59)).toISOString(),
|
|
155
|
+
};
|
|
156
|
+
return transferData;
|
|
157
|
+
}
|
|
158
|
+
async getSubscriptionData() {
|
|
159
|
+
try {
|
|
160
|
+
const url = `${this.endpointSubscription}/feWidgetConfig/${this.subscriptionCode}`;
|
|
161
|
+
const { conditionMetadataId, paramMetadataId, ruleType } = await fetchRequest(url);
|
|
162
|
+
this.conditionId = conditionMetadataId;
|
|
163
|
+
this.paramId = paramMetadataId;
|
|
164
|
+
this.ruleType = ruleType;
|
|
165
|
+
const metaConditionUrl = `${this.endpointSubscription}/metadata/${this.conditionId}`;
|
|
166
|
+
const metaParamUrl = `${this.endpointSubscription}/metadata/${this.paramId}`;
|
|
167
|
+
const [conditionConfig, paramConfig] = await Promise.allSettled([fetchRequest(metaConditionUrl), fetchRequest(metaParamUrl)]);
|
|
168
|
+
if (conditionConfig.status === 'fulfilled' && paramConfig.status === 'fulfilled') {
|
|
169
|
+
this.conditionRule = conditionConfig.value;
|
|
170
|
+
this.paramRule = paramConfig.value;
|
|
171
|
+
if (this.conditionRule.fields) {
|
|
172
|
+
this.peroidRule = this.conditionRule.fields.find((field) => field.code === 'Period');
|
|
173
|
+
this.startDateRule = this.conditionRule.fields.find((field) => field.code === 'StartDate');
|
|
174
|
+
this.endDateRule = this.conditionRule.fields.find((field) => field.code === 'EndDate');
|
|
175
|
+
this.gameNameRule = this.conditionRule.fields.find((field) => field.code === 'GameName');
|
|
176
|
+
this.frequenceList = this.peroidRule.enums.map((item) => {
|
|
177
|
+
return {
|
|
178
|
+
label: item.text,
|
|
179
|
+
value: item.key
|
|
180
|
+
};
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
throw new Error('Failed to get subscription data');
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
catch (err) {
|
|
189
|
+
console.error(err);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
handleCheckboxchange(e) {
|
|
193
|
+
this.isSubscribed = e.target.checked;
|
|
194
|
+
this.subscriptionCheckChange.emit(this.isSubscribed);
|
|
195
|
+
}
|
|
196
|
+
handleSelectionChange(event) {
|
|
197
|
+
this.frequenceState = event.detail.value;
|
|
198
|
+
if (this.frequenceState === 'NeverMissADraw' && this.isSubscribed) {
|
|
199
|
+
const ruleDefinitionParams = {
|
|
200
|
+
conditionMetadata: this.conditionRule,
|
|
201
|
+
paramMetadata: this.paramRule,
|
|
202
|
+
conditions: [
|
|
203
|
+
{
|
|
204
|
+
value: this.frequenceState,
|
|
205
|
+
fieldId: this.peroidRule.id
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
fieldId: this.gameNameRule.id,
|
|
209
|
+
value: this.gameName
|
|
210
|
+
}
|
|
211
|
+
],
|
|
212
|
+
params: [],
|
|
213
|
+
ruleType: this.ruleType
|
|
214
|
+
};
|
|
215
|
+
ruleDefinitionParams.params = this.paramRule.fields.map((field) => {
|
|
216
|
+
return {
|
|
217
|
+
value: '',
|
|
218
|
+
fieldId: field.id
|
|
219
|
+
};
|
|
220
|
+
});
|
|
221
|
+
this.subscriptionCompleted.emit(ruleDefinitionParams);
|
|
222
|
+
}
|
|
223
|
+
else if (this.frequenceState === 'Custom' && this.isSubscribed) {
|
|
224
|
+
this.subscriptionCompleted.emit('Subscription start date is required.');
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
formateDate(dateParts) {
|
|
228
|
+
const { year, month, day } = dateParts;
|
|
229
|
+
const date = new Date(year, month, day);
|
|
230
|
+
return format(date, 'dd/MM/yyyy');
|
|
231
|
+
}
|
|
232
|
+
parseDate(inputValue) {
|
|
233
|
+
const [day, month, year] = inputValue.split('/');
|
|
234
|
+
return { year, month: parseInt(month) - 1, day };
|
|
235
|
+
}
|
|
236
|
+
changeFormate(str) {
|
|
237
|
+
const [day, month, year] = str.split('/');
|
|
238
|
+
return `${year}-${month}-${day}`;
|
|
239
|
+
}
|
|
240
|
+
setDateFormate(dom) {
|
|
241
|
+
if (dom) {
|
|
242
|
+
dom.i18n = Object.assign(Object.assign({}, dom.i18n), { formatDate: this.formateDate, parseDate: this.parseDate });
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
render() {
|
|
246
|
+
return (h("div", { key: '1bf289722935c5d2b574ba18f322830c81335585', class: "subscripitonContainer", ref: el => this.stylingContainer = el }, h("vaadin-checkbox", { key: '5f62fb61bccecd3632525ab0b28a41e45487c7ec', label: "Subscription", checked: this.isSubscribed, onChange: this.handleCheckboxchange.bind(this) }), this.isSubscribed &&
|
|
247
|
+
h("div", { key: 'd8e56e346ca8f275866738ab9c6d8eb14437d84a', class: "secondConditon" }, h("span", { key: '13c61d7582b1e0716395bd06c410a621b8af97d8', style: { 'margin-right': '8px' } }, "Occurrence: "), h("vaadin-select", { key: 'cf8d9c4176f66d2095798cae79b82b748e7ffb0b', items: this.frequenceList, value: this.frequenceState, "on-value-changed": this.handleSelectionChange.bind(this) }), this.frequenceState === 'Custom' &&
|
|
248
|
+
h("div", { key: 'c1496adac7e295830074da0b096bf4bbc0af8247', class: "thirdCondition" }, h("div", { key: '2aa4f92c84ab37edee56640ae0657f59e92c3719', class: "filterCalenderWrap" }, h("div", { key: '6665e3f2bd28650794eb174db6081ab4a9f514f0', class: "filterText" }, "Subscription Start Date*"), h("div", { key: '50a05e684bf068ab00d6d4298e65a6b94c44b79a', class: "filter" }, h("vaadin-date-picker", { value: this.filterData.from, key: "filterFromCalendar", max: this.filterData.to === undefined ? undefined : this.changeFormate(this.filterData.to), onChange: this.handleFilterFrom, placeholder: translate('filterFromCalendar', this.language), ref: el => this.setDateFormate(el), class: "VaadinDatePicker" }))), h("div", { key: '85c4bf037ad7bc9797f809aa7e71fcbfbc80c298', class: "filterCalenderWrap" }, h("div", { key: '87b446788202ae55ad698c8455c9a6d09a9d22d6', class: "filterText" }, "Subscription End Date"), h("div", { key: '5700c92b2f0c57959f84b5f7ac7a3488d1d0d096', class: "filter" }, h("vaadin-date-picker", { value: this.filterData.to, key: "filterToCalendar", min: this.filterData.from === undefined ? undefined : this.changeFormate(this.filterData.from), onChange: this.handleFilterTo, placeholder: translate('filterToCalendar', this.language), ref: el => this.setDateFormate(el), class: "VaadinDatePicker" })))))));
|
|
249
|
+
}
|
|
250
|
+
static get is() { return "lottery-subscription"; }
|
|
251
|
+
static get encapsulation() { return "shadow"; }
|
|
252
|
+
static get originalStyleUrls() {
|
|
253
|
+
return {
|
|
254
|
+
"$": ["lottery-subscription.scss"]
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
static get styleUrls() {
|
|
258
|
+
return {
|
|
259
|
+
"$": ["lottery-subscription.css"]
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
static get properties() {
|
|
263
|
+
return {
|
|
264
|
+
"translationUrl": {
|
|
265
|
+
"type": "any",
|
|
266
|
+
"mutable": false,
|
|
267
|
+
"complexType": {
|
|
268
|
+
"original": "any",
|
|
269
|
+
"resolved": "any",
|
|
270
|
+
"references": {}
|
|
271
|
+
},
|
|
272
|
+
"required": false,
|
|
273
|
+
"optional": true,
|
|
274
|
+
"docs": {
|
|
275
|
+
"tags": [],
|
|
276
|
+
"text": "Translation via url"
|
|
277
|
+
},
|
|
278
|
+
"attribute": "translation-url",
|
|
279
|
+
"reflect": true
|
|
280
|
+
},
|
|
281
|
+
"clientStyling": {
|
|
282
|
+
"type": "string",
|
|
283
|
+
"mutable": false,
|
|
284
|
+
"complexType": {
|
|
285
|
+
"original": "string",
|
|
286
|
+
"resolved": "string",
|
|
287
|
+
"references": {}
|
|
288
|
+
},
|
|
289
|
+
"required": false,
|
|
290
|
+
"optional": false,
|
|
291
|
+
"docs": {
|
|
292
|
+
"tags": [],
|
|
293
|
+
"text": "Client custom styling via string"
|
|
294
|
+
},
|
|
295
|
+
"attribute": "client-styling",
|
|
296
|
+
"reflect": true,
|
|
297
|
+
"defaultValue": "''"
|
|
298
|
+
},
|
|
299
|
+
"clientStylingUrlContent": {
|
|
300
|
+
"type": "string",
|
|
301
|
+
"mutable": false,
|
|
302
|
+
"complexType": {
|
|
303
|
+
"original": "string",
|
|
304
|
+
"resolved": "string",
|
|
305
|
+
"references": {}
|
|
306
|
+
},
|
|
307
|
+
"required": false,
|
|
308
|
+
"optional": false,
|
|
309
|
+
"docs": {
|
|
310
|
+
"tags": [],
|
|
311
|
+
"text": "Client custom styling via url"
|
|
312
|
+
},
|
|
313
|
+
"attribute": "client-styling-url-content",
|
|
314
|
+
"reflect": true,
|
|
315
|
+
"defaultValue": "''"
|
|
316
|
+
},
|
|
317
|
+
"endpoint": {
|
|
318
|
+
"type": "string",
|
|
319
|
+
"mutable": false,
|
|
320
|
+
"complexType": {
|
|
321
|
+
"original": "string",
|
|
322
|
+
"resolved": "string",
|
|
323
|
+
"references": {}
|
|
324
|
+
},
|
|
325
|
+
"required": false,
|
|
326
|
+
"optional": false,
|
|
327
|
+
"docs": {
|
|
328
|
+
"tags": [],
|
|
329
|
+
"text": "Endpoint URL for the source of data"
|
|
330
|
+
},
|
|
331
|
+
"attribute": "endpoint",
|
|
332
|
+
"reflect": true
|
|
333
|
+
},
|
|
334
|
+
"endpointTicket": {
|
|
335
|
+
"type": "string",
|
|
336
|
+
"mutable": false,
|
|
337
|
+
"complexType": {
|
|
338
|
+
"original": "string",
|
|
339
|
+
"resolved": "string",
|
|
340
|
+
"references": {}
|
|
341
|
+
},
|
|
342
|
+
"required": false,
|
|
343
|
+
"optional": false,
|
|
344
|
+
"docs": {
|
|
345
|
+
"tags": [],
|
|
346
|
+
"text": "EndpointTicket URL for the source of ticket data"
|
|
347
|
+
},
|
|
348
|
+
"attribute": "endpoint-ticket",
|
|
349
|
+
"reflect": true
|
|
350
|
+
},
|
|
351
|
+
"endpointSubscription": {
|
|
352
|
+
"type": "string",
|
|
353
|
+
"mutable": false,
|
|
354
|
+
"complexType": {
|
|
355
|
+
"original": "string",
|
|
356
|
+
"resolved": "string",
|
|
357
|
+
"references": {}
|
|
358
|
+
},
|
|
359
|
+
"required": false,
|
|
360
|
+
"optional": false,
|
|
361
|
+
"docs": {
|
|
362
|
+
"tags": [],
|
|
363
|
+
"text": "Endpoint URL for the source of subscription data"
|
|
364
|
+
},
|
|
365
|
+
"attribute": "endpoint-subscription",
|
|
366
|
+
"reflect": true
|
|
367
|
+
},
|
|
368
|
+
"language": {
|
|
369
|
+
"type": "string",
|
|
370
|
+
"mutable": false,
|
|
371
|
+
"complexType": {
|
|
372
|
+
"original": "string",
|
|
373
|
+
"resolved": "string",
|
|
374
|
+
"references": {}
|
|
375
|
+
},
|
|
376
|
+
"required": false,
|
|
377
|
+
"optional": false,
|
|
378
|
+
"docs": {
|
|
379
|
+
"tags": [],
|
|
380
|
+
"text": "Language of the widget"
|
|
381
|
+
},
|
|
382
|
+
"attribute": "language",
|
|
383
|
+
"reflect": true,
|
|
384
|
+
"defaultValue": "'en'"
|
|
385
|
+
},
|
|
386
|
+
"gameName": {
|
|
387
|
+
"type": "string",
|
|
388
|
+
"mutable": false,
|
|
389
|
+
"complexType": {
|
|
390
|
+
"original": "string",
|
|
391
|
+
"resolved": "string",
|
|
392
|
+
"references": {}
|
|
393
|
+
},
|
|
394
|
+
"required": false,
|
|
395
|
+
"optional": false,
|
|
396
|
+
"docs": {
|
|
397
|
+
"tags": [],
|
|
398
|
+
"text": "the name of the game"
|
|
399
|
+
},
|
|
400
|
+
"attribute": "game-name",
|
|
401
|
+
"reflect": true
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
static get states() {
|
|
406
|
+
return {
|
|
407
|
+
"isSubscribed": {},
|
|
408
|
+
"frequenceList": {},
|
|
409
|
+
"frequenceState": {},
|
|
410
|
+
"filterData": {},
|
|
411
|
+
"subscriptionCode": {},
|
|
412
|
+
"conditionId": {},
|
|
413
|
+
"paramId": {},
|
|
414
|
+
"conditionRule": {},
|
|
415
|
+
"paramRule": {},
|
|
416
|
+
"peroidRule": {},
|
|
417
|
+
"startDateRule": {},
|
|
418
|
+
"endDateRule": {},
|
|
419
|
+
"gameNameRule": {},
|
|
420
|
+
"ruleType": {},
|
|
421
|
+
"limitStylingAppends": {}
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
static get events() {
|
|
425
|
+
return [{
|
|
426
|
+
"method": "subscriptionCompleted",
|
|
427
|
+
"name": "subscriptionCompleted",
|
|
428
|
+
"bubbles": true,
|
|
429
|
+
"cancelable": true,
|
|
430
|
+
"composed": true,
|
|
431
|
+
"docs": {
|
|
432
|
+
"tags": [],
|
|
433
|
+
"text": ""
|
|
434
|
+
},
|
|
435
|
+
"complexType": {
|
|
436
|
+
"original": "any",
|
|
437
|
+
"resolved": "any",
|
|
438
|
+
"references": {}
|
|
439
|
+
}
|
|
440
|
+
}, {
|
|
441
|
+
"method": "subscriptionCheckChange",
|
|
442
|
+
"name": "subscriptionCheckChange",
|
|
443
|
+
"bubbles": true,
|
|
444
|
+
"cancelable": true,
|
|
445
|
+
"composed": true,
|
|
446
|
+
"docs": {
|
|
447
|
+
"tags": [],
|
|
448
|
+
"text": ""
|
|
449
|
+
},
|
|
450
|
+
"complexType": {
|
|
451
|
+
"original": "any",
|
|
452
|
+
"resolved": "any",
|
|
453
|
+
"references": {}
|
|
454
|
+
}
|
|
455
|
+
}];
|
|
456
|
+
}
|
|
457
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/lottery-subscription';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
2
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'hr'];
|
|
3
|
+
const TRANSLATIONS = {
|
|
4
|
+
en: {
|
|
5
|
+
filterFromCalendar: 'Start Date',
|
|
6
|
+
filterToCalendar: 'End Date'
|
|
7
|
+
},
|
|
8
|
+
ro: {
|
|
9
|
+
filterFromCalendar: 'Start Date',
|
|
10
|
+
filterToCalendar: 'End Date'
|
|
11
|
+
},
|
|
12
|
+
fr: {
|
|
13
|
+
filterFromCalendar: 'Start Date',
|
|
14
|
+
filterToCalendar: 'End Date'
|
|
15
|
+
},
|
|
16
|
+
ar: {
|
|
17
|
+
filterFromCalendar: 'Start Date',
|
|
18
|
+
filterToCalendar: 'End Date'
|
|
19
|
+
},
|
|
20
|
+
hr: {
|
|
21
|
+
filterFromCalendar: 'Start Date',
|
|
22
|
+
filterToCalendar: 'End Date'
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
export const translate = (key, customLang) => {
|
|
26
|
+
const lang = customLang;
|
|
27
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
28
|
+
};
|
|
29
|
+
export const getTranslations = (data) => {
|
|
30
|
+
Object.keys(data).forEach((item) => {
|
|
31
|
+
for (let key in data[item]) {
|
|
32
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const generateUUID = () => {
|
|
2
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
3
|
+
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
|
|
4
|
+
return v.toString(16);
|
|
5
|
+
});
|
|
6
|
+
};
|
|
7
|
+
export function fetchRequest(url, method = 'GET', body = null, headers = {}) {
|
|
8
|
+
return new Promise((resolve, reject) => {
|
|
9
|
+
const uuid = generateUUID();
|
|
10
|
+
const options = {
|
|
11
|
+
method,
|
|
12
|
+
headers: Object.assign({ 'Content-Type': 'application/json', 'X-Idempotency-Key': uuid }, headers),
|
|
13
|
+
body: null
|
|
14
|
+
};
|
|
15
|
+
if (body) {
|
|
16
|
+
options.body = JSON.stringify(body);
|
|
17
|
+
}
|
|
18
|
+
fetch(url, options)
|
|
19
|
+
.then(response => {
|
|
20
|
+
if (!response.ok) {
|
|
21
|
+
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
22
|
+
}
|
|
23
|
+
return response.json();
|
|
24
|
+
})
|
|
25
|
+
.then(data => resolve(data))
|
|
26
|
+
.catch(error => reject(error));
|
|
27
|
+
});
|
|
28
|
+
}
|