@everymatrix/player-rglimits 1.28.3
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/README.md +30 -0
- package/dist/player-rglimits.js +1220 -0
- package/dist/player-rglimits.js.map +1 -0
- package/index.html +42 -0
- package/index.js +1 -0
- package/package.json +39 -0
- package/public/favicon.png +0 -0
- package/public/reset.css +48 -0
- package/rollup.config.js +61 -0
- package/src/PlayerRglimits.svelte +510 -0
- package/src/i18n.js +27 -0
- package/src/images/caret-right-solid.svg +1 -0
- package/src/images/fa-caret-right.svg +1 -0
- package/src/images/gauge-body-background.svg +5 -0
- package/src/images/usd-circle.svg +2 -0
- package/src/index.ts +4 -0
- package/src/translations.js +242 -0
- package/stories/PlayerRglimits.stories.js +13 -0
- package/tsconfig.json +6 -0
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
<svelte:options tag={null} />
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
import moment from 'moment';
|
|
4
|
+
import { _, addNewMessages, setLocale } from './i18n';
|
|
5
|
+
import { TRANSLATIONS } from './translations.js';
|
|
6
|
+
import { onMount } from 'svelte';
|
|
7
|
+
|
|
8
|
+
import faCaretRightSvg from './images/fa-caret-right.svg';
|
|
9
|
+
import faDollarCircleSvg from './images/usd-circle.svg';
|
|
10
|
+
import '@everymatrix/general-animation-loading'
|
|
11
|
+
|
|
12
|
+
export let session: string = '';
|
|
13
|
+
export let sessiontype: string = '';
|
|
14
|
+
export let userid: string = '';
|
|
15
|
+
export let endpoint: string = '';
|
|
16
|
+
export let transdetailsurl:string = '';
|
|
17
|
+
export let transactionspageurl:string = '';
|
|
18
|
+
export let clientstyling:string = '';
|
|
19
|
+
export let clientstylingurl:string = '';
|
|
20
|
+
export let lang:string = 'en';
|
|
21
|
+
export let translationurl:string = '';
|
|
22
|
+
export let datetimeformat:string = '';
|
|
23
|
+
|
|
24
|
+
let displayNone:boolean = false;
|
|
25
|
+
let customStylingContainer: HTMLElement;
|
|
26
|
+
|
|
27
|
+
let isMounted:boolean = false;
|
|
28
|
+
let isLoggedIn:boolean = false;
|
|
29
|
+
let sessionID:string = '';
|
|
30
|
+
let playerID:string = '';
|
|
31
|
+
let isLoading: boolean = true;
|
|
32
|
+
let isGaugeLoading: boolean = true;
|
|
33
|
+
let noLimitToDisplay:boolean;
|
|
34
|
+
|
|
35
|
+
let multipleDepositLimits:boolean = false;
|
|
36
|
+
let displayedLimit:Object = {
|
|
37
|
+
spentAmount: '',
|
|
38
|
+
limitCurrency: 'EUR',
|
|
39
|
+
remainingAmount: '',
|
|
40
|
+
limitType: '',
|
|
41
|
+
limitProducts: []
|
|
42
|
+
};
|
|
43
|
+
let limitPeriodList:Array<any> = [];
|
|
44
|
+
let selectedLimitPeriod:string = '';
|
|
45
|
+
let limitDefinitionList:Array<any> = [];
|
|
46
|
+
|
|
47
|
+
let gaugeValue:number = 0;
|
|
48
|
+
let gaugeNeedleValue:number = 0.750;
|
|
49
|
+
let totalSpentPerc:number = 0.00;
|
|
50
|
+
|
|
51
|
+
let errorMessage:string = '';
|
|
52
|
+
|
|
53
|
+
Object.keys(TRANSLATIONS).forEach((item:any):void => {
|
|
54
|
+
addNewMessages(item, TRANSLATIONS[item]);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const setSession = ():void => {
|
|
58
|
+
isLoggedIn = true;
|
|
59
|
+
sessionID = session;
|
|
60
|
+
playerID = userid;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const handleError = (error):void => {
|
|
64
|
+
errorMessage = error;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const formatScheduleData = (limitDefinitionId:any, scheduleData:any):Object => {
|
|
68
|
+
const limitSchedule = scheduleData.find(x => x.playerLimitId === limitDefinitionId);
|
|
69
|
+
return limitSchedule
|
|
70
|
+
? {
|
|
71
|
+
updateAmount: limitSchedule.updateAmount,
|
|
72
|
+
expires: limitSchedule.applyAt,
|
|
73
|
+
expiresString: dateToReadableString(limitSchedule.applyAt),
|
|
74
|
+
id: limitSchedule.id,
|
|
75
|
+
isRemoved: limitSchedule.updateAmount < 1,
|
|
76
|
+
isUpdated: limitSchedule.updateAmount > 0
|
|
77
|
+
}
|
|
78
|
+
: {
|
|
79
|
+
updateAmount: '',
|
|
80
|
+
expires: '',
|
|
81
|
+
expiresString: '',
|
|
82
|
+
id: '',
|
|
83
|
+
isRemoved: false,
|
|
84
|
+
isUpdated: false
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const getLimitBalanceById = (limit:any):void => {
|
|
89
|
+
isLoading = true;
|
|
90
|
+
const queryParams:URLSearchParams = new URLSearchParams({limitDefinitionId: limit.id})
|
|
91
|
+
const url:URL = new URL(`${endpoint}/v1/player/${playerID}/limits/monetary/balance?${queryParams}`);
|
|
92
|
+
const options = {
|
|
93
|
+
method: 'GET',
|
|
94
|
+
headers: {
|
|
95
|
+
'X-SessionId': sessionID,
|
|
96
|
+
'X-Session-Type': sessiontype,
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
fetch(url, options)
|
|
100
|
+
.then((res:any) => res.json())
|
|
101
|
+
.then((res) => {
|
|
102
|
+
if (res && res.error) {
|
|
103
|
+
throw new Error(res.error);
|
|
104
|
+
}
|
|
105
|
+
setCurrentLimit(res.limitBalances[0], limit);
|
|
106
|
+
})
|
|
107
|
+
.catch((err) => {
|
|
108
|
+
handleError(err)
|
|
109
|
+
}).finally(() => {
|
|
110
|
+
isLoading = false;
|
|
111
|
+
})
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const getLimitDefinitions = ():Promise<void> => {
|
|
115
|
+
return new Promise((resolve, reject) => {
|
|
116
|
+
const url:URL = new URL(`${endpoint}/v1/player/${playerID}/limits/monetary/`);
|
|
117
|
+
const options = {
|
|
118
|
+
method: 'GET',
|
|
119
|
+
headers: {
|
|
120
|
+
'X-SessionId': sessionID,
|
|
121
|
+
'X-Session-Type': sessiontype,
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
fetch(url, options)
|
|
125
|
+
.then((res:any) => res.json())
|
|
126
|
+
.then((res:any) => {
|
|
127
|
+
if (res && res.error) {
|
|
128
|
+
return reject(res.error);
|
|
129
|
+
}
|
|
130
|
+
return resolve(res.limits.length > 0 ? res.limits.filter((item:any) => item.type === 'Deposit') : []);
|
|
131
|
+
})
|
|
132
|
+
.catch((err) => {
|
|
133
|
+
return reject(err);
|
|
134
|
+
})
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const handlePeriodChange = ():void => {
|
|
139
|
+
let selectedLimit = limitDefinitionList.find((limit) => `${limit.period} - ${limit.products[0]}` === selectedLimitPeriod)
|
|
140
|
+
getLimitBalanceById(selectedLimit);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const getLimitBalance = ():void => {
|
|
144
|
+
getLimitDefinitions().then((depositLimitsDefinitionsData) => {
|
|
145
|
+
limitDefinitionList = depositLimitsDefinitionsData;
|
|
146
|
+
if (limitDefinitionList.length === 0) {
|
|
147
|
+
isLoading = false;
|
|
148
|
+
noLimitToDisplay = true;
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (limitDefinitionList.length > 1) {
|
|
153
|
+
const timeMap = {
|
|
154
|
+
'Daily': 0,
|
|
155
|
+
'Weekly': 1,
|
|
156
|
+
'Monthly': 2
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
limitDefinitionList.forEach((limit) => {
|
|
160
|
+
if (limitPeriodList.indexOf(`${limit.period} - ${limit.products[0]}`) === -1) {
|
|
161
|
+
limitPeriodList.push(`${limit.period} - ${limit.products[0]}`)
|
|
162
|
+
}
|
|
163
|
+
})
|
|
164
|
+
|
|
165
|
+
multipleDepositLimits = true;
|
|
166
|
+
limitPeriodList = limitPeriodList.sort((a, b) => {
|
|
167
|
+
return timeMap[a.split(' ')[0]] - timeMap[b.split(' ')[0]];
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
getLimitBalanceById(limitDefinitionList[0]);
|
|
172
|
+
}, (err) => {
|
|
173
|
+
isLoading = false;
|
|
174
|
+
handleError(err)
|
|
175
|
+
})
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const dateToReadableString = (date:string):string => {
|
|
179
|
+
return moment(date).utc(true).format(datetimeformat || `DD/MM/YYYY HH:mm:ss`);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const setCurrentLimit = (limitBalance:any, limit:any):void => {
|
|
183
|
+
selectedLimitPeriod = `${limitBalance.limitPeriod} - ${limitBalance.limitProducts[0]}`;
|
|
184
|
+
const limitSchedule = formatScheduleData(limit.id, limit.schedules);
|
|
185
|
+
|
|
186
|
+
displayedLimit = Object.assign({
|
|
187
|
+
totalAmount: limitBalance.limitAmount,
|
|
188
|
+
spentAmount: parseFloat(limitBalance.spentBalance.amount).toFixed(2),
|
|
189
|
+
limitCurrency: limitBalance.limitCurrency,
|
|
190
|
+
remainingAmount: parseFloat(limitBalance.limitAmount - limitBalance.spentBalance.amount).toFixed(2),
|
|
191
|
+
limitPeriod: limitBalance.limitPeriod,
|
|
192
|
+
limitProducts: limitBalance.limitProducts[0],
|
|
193
|
+
product: limitBalance.limitWalletTypes
|
|
194
|
+
}, limitSchedule)
|
|
195
|
+
|
|
196
|
+
setGauge(displayedLimit);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const setGauge = (limit:any):void => {
|
|
200
|
+
let maxValueGauge = 0.50;
|
|
201
|
+
let maxValueNeedle = 1.250;
|
|
202
|
+
totalSpentPerc = 0.00;
|
|
203
|
+
totalSpentPerc = (limit.spentAmount * 100) / limit.totalAmount;
|
|
204
|
+
totalSpentPerc = parseFloat(totalSpentPerc).toFixed(2);
|
|
205
|
+
let spentAmountPerc = (limit.spentAmount * maxValueGauge) / limit.totalAmount;
|
|
206
|
+
gaugeValue = Number(parseFloat(spentAmountPerc).toFixed(3));
|
|
207
|
+
gaugeValue = gaugeValue > maxValueGauge ? maxValueGauge : gaugeValue;
|
|
208
|
+
gaugeNeedleValue = 0.750;
|
|
209
|
+
gaugeNeedleValue = Number(parseFloat(spentAmountPerc + gaugeNeedleValue).toFixed(3));
|
|
210
|
+
gaugeNeedleValue = gaugeNeedleValue > maxValueNeedle ? maxValueNeedle : gaugeNeedleValue;
|
|
211
|
+
isGaugeLoading = false;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
onMount(() => {
|
|
215
|
+
setTimeout(() => {
|
|
216
|
+
isMounted = true;
|
|
217
|
+
}, 50)
|
|
218
|
+
})
|
|
219
|
+
|
|
220
|
+
const setClientStyling = ():void => {
|
|
221
|
+
let sheet = document.createElement('style');
|
|
222
|
+
sheet.innerHTML = clientstyling;
|
|
223
|
+
customStylingContainer.appendChild(sheet);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const setClientStylingURL = ():void => {
|
|
227
|
+
displayNone = true;
|
|
228
|
+
|
|
229
|
+
let url:URL = new URL(clientstylingurl);
|
|
230
|
+
let cssFile:HTMLElement = document.createElement('style');
|
|
231
|
+
|
|
232
|
+
fetch(url.href)
|
|
233
|
+
.then((res:any) => res.text())
|
|
234
|
+
.then((data:any) => {
|
|
235
|
+
cssFile.innerHTML = data;
|
|
236
|
+
|
|
237
|
+
setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
|
|
238
|
+
setTimeout(() => { displayNone = false; }, 500);
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const setActiveLanguage = ():void => {
|
|
243
|
+
setLocale(lang);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const setTranslationUrl = ():void => {
|
|
247
|
+
let url:URL = new URL(translationurl);
|
|
248
|
+
|
|
249
|
+
fetch(url.href).then((res:any) => res.json())
|
|
250
|
+
.then((res) => {
|
|
251
|
+
Object.keys(res).forEach((item:any):void => {
|
|
252
|
+
addNewMessages(item, res[item]);
|
|
253
|
+
});
|
|
254
|
+
}).catch((err:any) => {
|
|
255
|
+
console.log(err);
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
$: isMounted && session && userid && setSession();
|
|
260
|
+
$: isMounted && isLoggedIn && getLimitBalance();
|
|
261
|
+
$: clientstyling && customStylingContainer && setClientStyling();
|
|
262
|
+
$: clientstylingurl && customStylingContainer && setClientStylingURL();
|
|
263
|
+
$: lang && setActiveLanguage();
|
|
264
|
+
$: translationurl && setTranslationUrl();
|
|
265
|
+
</script>
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
<div class="LimitsContainer" bind:this={customStylingContainer}>
|
|
269
|
+
{#if noLimitToDisplay}
|
|
270
|
+
<p>{$_('noLimitToDisplay')}</p>
|
|
271
|
+
{:else if errorMessage}
|
|
272
|
+
<strong class="ErrorMessage">{errorMessage}</strong>
|
|
273
|
+
{:else}
|
|
274
|
+
<div class="ContentLeft">
|
|
275
|
+
<h2 class="LimitTypeHeader"><img class="HeaderIcon" alt="user" src="{faDollarCircleSvg}" /> Deposit limit</h2>
|
|
276
|
+
{#if isLoading}
|
|
277
|
+
<general-animation-loading clientstyling={clientstyling} clientstylingurl={clientstylingurl} />
|
|
278
|
+
{:else}
|
|
279
|
+
<div class="DetailsContainer Entries">
|
|
280
|
+
<span>{$_('spentAmount')}: </span>
|
|
281
|
+
<span>{$_('remainingAmount')}: </span>
|
|
282
|
+
{#if displayedLimit.isUpdated === true}
|
|
283
|
+
<span>{$_('futureAmount')}: </span>
|
|
284
|
+
{/if}
|
|
285
|
+
<span>{$_('limitPeriod')}: </span>
|
|
286
|
+
<span>{$_('displayedProduct')}: </span>
|
|
287
|
+
</div>
|
|
288
|
+
<div class="TextContainer">
|
|
289
|
+
<p><img class="TextIcon" alt="user" src="{faCaretRightSvg}" /> {displayedLimit.spentAmount} {displayedLimit.limitCurrency}</p>
|
|
290
|
+
<p><img class="TextIcon" alt="user" src="{faCaretRightSvg}" /> {displayedLimit.remainingAmount} {displayedLimit.limitCurrency}</p>
|
|
291
|
+
{#if displayedLimit.isUpdated === true}
|
|
292
|
+
<p><img class="TextIcon" alt="user" src="{faCaretRightSvg}" /> {displayedLimit.updateAmount} {displayedLimit.limitCurrency} </p>
|
|
293
|
+
{/if}
|
|
294
|
+
<p><img class="TextIcon" alt="user" src="{faCaretRightSvg}" /> {displayedLimit.limitPeriod}</p>
|
|
295
|
+
<p><img class="TextIcon" alt="user" src="{faCaretRightSvg}" /> {displayedLimit.limitProducts}</p>
|
|
296
|
+
</div>
|
|
297
|
+
{#if displayedLimit.isRemoved === true || displayedLimit.isUpdated === true }
|
|
298
|
+
<div class="ExtraInfoContainer">
|
|
299
|
+
{#if displayedLimit.isRemoved === true}
|
|
300
|
+
<span>{$_('limitRemoved')}: {displayedLimit.expiresString}</span>
|
|
301
|
+
{/if}
|
|
302
|
+
{#if displayedLimit.isUpdated === true}
|
|
303
|
+
<span>{$_('limitUpdated')}: {displayedLimit.expiresString}</span>
|
|
304
|
+
{/if}
|
|
305
|
+
</div>
|
|
306
|
+
{/if}
|
|
307
|
+
{#if sessiontype === 'admin'}
|
|
308
|
+
<div class="UsefulLinksSection">
|
|
309
|
+
{#if transdetailsurl}
|
|
310
|
+
<a href="{transdetailsurl}" target="_blank">{$_('additionalLink1')}</a>
|
|
311
|
+
{:else if transactionspageurl}
|
|
312
|
+
<a href="{transactionspageurl}" target="_blank">{$_('additionalLink2')}</a>
|
|
313
|
+
{/if}
|
|
314
|
+
</div>
|
|
315
|
+
{/if}
|
|
316
|
+
{/if}
|
|
317
|
+
{#if multipleDepositLimits}
|
|
318
|
+
<div class="MultipleSelectContainer">
|
|
319
|
+
<label for="LimitPeriod">{$_('changeLimitLabel')}: </label>
|
|
320
|
+
<select bind:value={selectedLimitPeriod} id="LimitPeriod" on:change={handlePeriodChange}>
|
|
321
|
+
{#each limitPeriodList as value}
|
|
322
|
+
<option {value}>
|
|
323
|
+
{value}
|
|
324
|
+
</option>
|
|
325
|
+
{/each}
|
|
326
|
+
</select>
|
|
327
|
+
</div>
|
|
328
|
+
{/if}
|
|
329
|
+
</div>
|
|
330
|
+
<div class="ContentRight">
|
|
331
|
+
{#if isGaugeLoading}
|
|
332
|
+
<general-animation-loading clientstyling={clientstyling} clientstylingurl={clientstylingurl} />
|
|
333
|
+
{:else}
|
|
334
|
+
<div class="AmountContainer">{displayedLimit.totalAmount} {displayedLimit.limitCurrency}</div>
|
|
335
|
+
<div class="Gauge">
|
|
336
|
+
<div class="GaugeBody">
|
|
337
|
+
<div class="GaugeFill" style="--transform-value: rotate({gaugeValue}turn)"></div>
|
|
338
|
+
<div class="GaugeCover">{displayedLimit.spentAmount} {displayedLimit.limitCurrency}</div>
|
|
339
|
+
<div class="GaugeCoverMin"></div>
|
|
340
|
+
<div class="GaugeNeedleCover"></div>
|
|
341
|
+
<div class="GaugeNeedle" style="--transform-needle-value: rotate({gaugeNeedleValue}turn)"></div>
|
|
342
|
+
</div>
|
|
343
|
+
</div>
|
|
344
|
+
<div class="MinMaxContainer">
|
|
345
|
+
<div class="Min"> <strong class="MinContent">0</strong> <span class="MinContentCurrency">{displayedLimit.limitCurrency}</span></div>
|
|
346
|
+
<div class="Max"> <strong class="MaxContent">{displayedLimit.totalAmount}</strong> <span class="MaxContentCurrency">{displayedLimit.limitCurrency}</span></div>
|
|
347
|
+
</div>
|
|
348
|
+
{/if}
|
|
349
|
+
</div>
|
|
350
|
+
{/if}
|
|
351
|
+
</div>
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
<style lang="scss">
|
|
355
|
+
$primary-text-color: var(--emw--color-gray-150, #a9b6ce);
|
|
356
|
+
$primary-gauge-fill-color: var(--emw--color-primary, #D0046C);
|
|
357
|
+
$secondary-gauge-background-color: var(--emw--color-gray-100, #E6E6E6);
|
|
358
|
+
$primary-contrast-color: var(--emw--color-contrast, #07072A);
|
|
359
|
+
|
|
360
|
+
*,
|
|
361
|
+
*::before,
|
|
362
|
+
*::after {
|
|
363
|
+
margin: 0;
|
|
364
|
+
padding: 0;
|
|
365
|
+
list-style: none;
|
|
366
|
+
text-decoration: none;
|
|
367
|
+
outline: none;
|
|
368
|
+
box-sizing: border-box;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.ErrorMessage {
|
|
372
|
+
margin: 0 15px;
|
|
373
|
+
font-size: 12px;
|
|
374
|
+
color: var(--emw--color-error, var(--emw--color-red, #ed0909));
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.LimitsContainer {
|
|
378
|
+
display: flex;
|
|
379
|
+
width: 100%;
|
|
380
|
+
max-width: 620px;
|
|
381
|
+
min-height: 150px;
|
|
382
|
+
border: 1px solid $primary-contrast-color;
|
|
383
|
+
border-radius: 20px;
|
|
384
|
+
overflow: hidden;
|
|
385
|
+
box-shadow: 0.6em 0.6em 0.4em $primary-text-color;
|
|
386
|
+
|
|
387
|
+
@container (max-width: 720px) {
|
|
388
|
+
max-width: 355px;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
.ContentLeft { padding: 1rem; width: 318px; line-height: 20px; }
|
|
392
|
+
.LimitTypeHeader { color: $primary-text-color; margin-bottom: 20px; max-width: 225px; }
|
|
393
|
+
.HeaderIcon { height: 20px; width: 20px; color: $primary-text-color; }
|
|
394
|
+
.DetailsContainer { margin-bottom: 15px; display: inline;
|
|
395
|
+
span { float: left; clear: both; }
|
|
396
|
+
}
|
|
397
|
+
.ContentRight { min-width: 300px; padding: 1rem; display: flex; justify-content: center; flex-direction: column; }
|
|
398
|
+
.AmountContainer {
|
|
399
|
+
padding: 0.3rem;
|
|
400
|
+
font-size: xx-large;
|
|
401
|
+
text-align: center;
|
|
402
|
+
border: 1px solid $primary-contrast-color;
|
|
403
|
+
border-radius: 20px;
|
|
404
|
+
box-shadow: 0.16em 0.16em 0.1em var(--emw--color-gray-150, #a9b6ce);
|
|
405
|
+
background-color: #F5F5F5;
|
|
406
|
+
}
|
|
407
|
+
.TextContainer { display: inline-block; padding-left: 5px;
|
|
408
|
+
p { width: 100%; display: block; clear: both; font-weight: bold; }
|
|
409
|
+
}
|
|
410
|
+
.ExtraInfoContainer { padding: 1rem 0; color: var(--emfe-w-color-red, #ed0909); }
|
|
411
|
+
.UsefulLinksSection { padding-top: 5px;
|
|
412
|
+
a { float: left; clear: both; color: $primary-contrast-color; }
|
|
413
|
+
}
|
|
414
|
+
.MultipleSelectContainer { float: left; padding-top: 1rem; clear: both;
|
|
415
|
+
label { float: left; padding-right: 5px; }
|
|
416
|
+
select { float: right; background: $primary-text-color; border-radius: 5px; margin: 2px }
|
|
417
|
+
}
|
|
418
|
+
.TextIcon { color: $primary-gauge-fill-color; }
|
|
419
|
+
|
|
420
|
+
.Gauge {
|
|
421
|
+
width: 100%;
|
|
422
|
+
font-family: 'Roboto', sans-serif;
|
|
423
|
+
font-size: 32px;
|
|
424
|
+
color: black;
|
|
425
|
+
margin-top: 1rem;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.GaugeBody {
|
|
429
|
+
width: 100%;
|
|
430
|
+
height: 0;
|
|
431
|
+
padding-bottom: 50%;
|
|
432
|
+
background: $secondary-gauge-background-color;
|
|
433
|
+
position: relative;
|
|
434
|
+
border-top-left-radius: 100% 200%;
|
|
435
|
+
border-top-right-radius: 100% 200%;
|
|
436
|
+
overflow: hidden;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
.GaugeFill {
|
|
440
|
+
position: absolute;
|
|
441
|
+
top: 100%;
|
|
442
|
+
left: 0;
|
|
443
|
+
width: inherit;
|
|
444
|
+
height: 100%;
|
|
445
|
+
background: $primary-gauge-fill-color;
|
|
446
|
+
transform-origin: center top;
|
|
447
|
+
transform: var(--transform-value);
|
|
448
|
+
transition: transform 0.2s ease-out;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.GaugeCover {
|
|
452
|
+
width: 75%;
|
|
453
|
+
height: 150%;
|
|
454
|
+
background: var(--emw--color-white, #FFFFFF);
|
|
455
|
+
position: absolute;
|
|
456
|
+
border-radius: 50%;
|
|
457
|
+
top: 25%;
|
|
458
|
+
left: 50%;
|
|
459
|
+
transform: translateX(-50%);
|
|
460
|
+
|
|
461
|
+
//Text
|
|
462
|
+
display: flex;
|
|
463
|
+
align-items: center;
|
|
464
|
+
justify-content: center;
|
|
465
|
+
padding-bottom: 47%;
|
|
466
|
+
box-sizing: border-box;
|
|
467
|
+
font-size: 20px;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
.GaugeCoverMin {
|
|
471
|
+
width: 50px;
|
|
472
|
+
height: 50px;
|
|
473
|
+
background: $primary-gauge-fill-color;
|
|
474
|
+
position: relative;
|
|
475
|
+
top: 6.7rem;
|
|
476
|
+
left: 50%;
|
|
477
|
+
border-radius: 50%;
|
|
478
|
+
transform: translateX(-50%);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.GaugeNeedleCover {
|
|
482
|
+
width: 8%;
|
|
483
|
+
height: 16%;
|
|
484
|
+
background: var(--emw--color-black, #000000);
|
|
485
|
+
position: absolute;
|
|
486
|
+
top: 90%;
|
|
487
|
+
left: 50%;
|
|
488
|
+
border: 4px solid var(--emw--color-white, #FFFFFF);
|
|
489
|
+
border-radius: 50%;
|
|
490
|
+
transform: translateX(-50%);
|
|
491
|
+
transition: transform 0.2s ease-out;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.GaugeNeedle {
|
|
495
|
+
width: 0.2rem;
|
|
496
|
+
height: 3.5rem;
|
|
497
|
+
background: linear-gradient(0deg, #000000 0, #000000 55%, #c5c5c5 55%, #c5c5c5 90%, #000000 90%, #000000 100%);
|
|
498
|
+
display: inline-block;
|
|
499
|
+
left: 49.5%;
|
|
500
|
+
position: absolute;
|
|
501
|
+
bottom: 1%;
|
|
502
|
+
transform: var(--transform-needle-value);
|
|
503
|
+
transform-origin: bottom;
|
|
504
|
+
transition: transform 0.2s ease-out;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
.MinMaxContainer { }
|
|
508
|
+
.Min { width: 50%; float: left; }
|
|
509
|
+
.Max { width: 49%; float: right; text-align: right; }
|
|
510
|
+
</style>
|
package/src/i18n.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
dictionary,
|
|
3
|
+
locale,
|
|
4
|
+
addMessages,
|
|
5
|
+
_
|
|
6
|
+
} from 'svelte-i18n';
|
|
7
|
+
|
|
8
|
+
function setupI18n({ withLocale: _locale, translations }) {
|
|
9
|
+
locale.subscribe((data) => {
|
|
10
|
+
if (data == null) {
|
|
11
|
+
dictionary.set(translations);
|
|
12
|
+
locale.set(_locale);
|
|
13
|
+
}
|
|
14
|
+
}); // maybe we will need this to make sure that the i18n is set up only once
|
|
15
|
+
/*dictionary.set(translations);
|
|
16
|
+
locale.set(_locale);*/
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function addNewMessages(lang, dict) {
|
|
20
|
+
addMessages(lang, dict);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function setLocale(_locale) {
|
|
24
|
+
locale.set(_locale);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { _, setupI18n, addNewMessages, setLocale };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="12" width="6" viewBox="0 0 256 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="12" width="6" viewBox="0 0 256 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path fill="#18a0fb" d="M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z"/></svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="
|
|
2
|
+
http://www.w3.org/2000/svg"
|
|
3
|
+
width="500" height="250" viewBox="0 0 220 110" fill="none">
|
|
4
|
+
<path d="M15.5 110C15.5 84.937 25.4562 60.9006 43.1784 43.1784C60.9006 25.4562 84.9371 15.5 110 15.5C135.063 15.5 159.099 25.4562 176.822 43.1784C194.544 60.9006 204.5 84.937 204.5 110" stroke="black" stroke-width="15" stroke-dasharray="1 1"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
2
|
+
<svg fill="#a9b6ce" width="800px" height="800px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11,9h4a1,1,0,0,0,0-2H13V6a1,1,0,0,0-2,0V7a3,3,0,0,0,0,6h2a1,1,0,0,1,0,2H9a1,1,0,0,0,0,2h2v1a1,1,0,0,0,2,0V17a3,3,0,0,0,0-6H11a1,1,0,0,1,0-2Zm1-8A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,20a9,9,0,1,1,9-9A9,9,0,0,1,12,21Z"/></svg>
|
package/src/index.ts
ADDED