tg-core-components 6.3.4-3.9 → 6.3.4
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/auth +51 -0
- package/es/widgets/ResponsibleGamingWidget/Timespan.js +0 -7
- package/es/widgets/ResponsibleGamingWidget/index.js +27 -40
- package/es/widgets/ResponsibleGamingWidget/validate.js +1 -5
- package/lib/widgets/ResponsibleGamingWidget/Timespan.js +0 -7
- package/lib/widgets/ResponsibleGamingWidget/index.js +27 -41
- package/lib/widgets/ResponsibleGamingWidget/validate.js +1 -5
- package/package.json +1 -1
package/auth
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="sv">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<meta charset="utf-8">
|
|
7
|
+
<meta name="referrer" content="no-referrer">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
|
+
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
|
10
|
+
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
|
|
11
|
+
<title>Bethard</title>
|
|
12
|
+
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
|
|
13
|
+
<script src="https://cdn.ravenjs.com/3.26.4/raven.min.js" crossorigin="anonymous"></script>
|
|
14
|
+
<style type="text/css">
|
|
15
|
+
|
|
16
|
+
@font-face {
|
|
17
|
+
font-family: Futura;
|
|
18
|
+
font-style: normal;
|
|
19
|
+
font-weight: 400;
|
|
20
|
+
src: url("https://static.gii.cloud/futura_lt/Futura LT Medium.woff") format("woff"),url("https://static.gii.cloud/futura_lt/Futura LT Medium.ttf") format("truetype")
|
|
21
|
+
}
|
|
22
|
+
@font-face {
|
|
23
|
+
font-family: Futura;
|
|
24
|
+
src: local("Futura LT Bold"),local("Futura-LT-Bold"),url("https://static.gii.cloud/futura_lt/Futura LT Bold.woff") format("woff"),url("https://static.gii.cloud/futura_lt/Futura LT Bold.ttf") format("truetype");
|
|
25
|
+
font-weight: 600;
|
|
26
|
+
font-style: normal
|
|
27
|
+
}
|
|
28
|
+
@font-face {
|
|
29
|
+
font-family: Futura;
|
|
30
|
+
src: local("Futura LT Bold"),local("Futura-LT-Bold"),url("https://static.gii.cloud/futura_lt/Futura LT Bold.woff") format("woff"),url("https://static.gii.cloud/futura_lt/Futura LT Bold.ttf") format("truetype");
|
|
31
|
+
font-weight: 700;
|
|
32
|
+
font-style: normal
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
</style>
|
|
36
|
+
</head>
|
|
37
|
+
|
|
38
|
+
<body>
|
|
39
|
+
<main>
|
|
40
|
+
<div class="bankid-se-config" bankid-se-config="{"relyingPartyName":"Bethard","relyingPartyAvatar":"https://www.icelondon.uk.com/__media/libraries/exhibitor-press-releases/8FA2DD80-5056-B779-246F1902D15A57A0-image.png","relyingPartyURL":"https://www.bethard.com","theme":"dark","themeConfig":"\n\t\t{\n\t\t \"shadows\": [],\n\t\t \"props\": {\n\t\t \"MuiButtonBase\": {\n\t\t \"disableRipple\": true\n\t\t },\n\t\t \"MuiPaper\": {\n\t\t \"square\": true\n\t\t }\n\t\t },\n\t\t \"typography\": {\n\t\t\t\t\"fontFamily\": \"Futura, sans-serif\",\n\t\t\t\t\"fontSize\": 12\n\t\t\t},\n\t\t\t\"palette\": {\n\t\t\t\t\"type\": \"dark\",\n\t\t\t\t\"background\":{\n\t\t\t\t\t\"default\": \"#1a1a1a\"\n\t\t\t\t},\n\t\t\t\t\"primary\": {\n\t\t\t\t\t\"main\": \"#f7d146\"\n\t\t\t\t},\n\t\t\t\t\"secondary\": {\n\t\t\t\t\t\"main\": \"#C4A638\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"shape\": {\n\t\t\t\t\"borderRadius\": 0\n\t\t\t},\n\t\t \"overrides\": {\n\t\t \"MuiPaper\": {\n\t\t \"root\": {\n\t\t\t\t\t\t\"background\": \"#1a1a1a!important\",\n\t\t\t\t\t\t\"color\": \"#dedede\"\n\t\t }\n\t\t },\n\t\t \"MuiTypography\": {\n\t\t \"display1\": {\n\t\t \"color\": \"#f7d146!important\",\n\t\t \"fontWeight\": \"bold\",\n\t\t \"textTransform\": \"uppercase\"\n\t\t },\n\t\t \"title\": {\n\t\t \"fontWeight\": \"bold\",\n\t\t \"textTransform\": \"uppercase\"\n\t\t },\n\t\t \"headline\": {\n\t\t \"fontWeight\": \"bold\",\n\t\t \"textTransform\": \"uppercase\"\n\t\t }\n\t\t },\n\t\t \"MuiBottomNavigation\": {\n\t\t \"root\": {\n\t\t \"background\": \"#282828!important\"\n\t\t }\n\t\t },\n\t\t \"MuiBottomNavigationAction\": {\n\t\t \"selected\": {\n\t\t \"color\": \"#f7d146!important\"\n\t\t },\n\t\t \"label\": {\n\t\t \"color\": \"#dedede!important\"\n\t\t }\n\t\t },\n\t\t \"MuiButton\": {\n\t\t \"root\": {\n\t\t \"_fontWeight\": \"bold\",\n\t\t \"paddingLeft\": \"3em!important\",\n\t\t \"paddingRight\": \"3em!important\"\n\t\t },\n\t\t \"outlined\": {\n\t\t \"borderWidth\": 1.5,\n\t\t \"borderColor\": \"inherit\"\n\t\t\t\t\t},\n\t\t\t\t\t\"raised\": {\n\t\t\t\t\t\t\"fontWeight\": \"bold\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"MuiInputLabel\": {\n\t\t\t\t\t\"root\": {\n\t\t\t\t\t\t\"color\": \"#dedede!important\"\n\t\t\t\t\t},\n\t\t\t\t\t\"shrink\": {\n\t\t\t\t\t\t\"transform\": \"translate(0, 1.5px) scale(0.875)\",\n\t\t\t\t\t\t\"transformOrigin\": \"top left\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"MuiCircularProgress\": {\n\t\t\t\t\t\"_colorPrimary\": \"#f7d14666\",\n\t\t\t\t\t\"root\": {\n\t\t\t\t\t\t\"width\": \"70px!important\",\n \t\t \"height\": \"70px!important\",\n\t\t\t\t\t\t\"color\": \"#f7d146\"\n\t\t\t\t\t},\n\t\t\t\t\t\"circle\": {\n\t\t\t\t\t\t\"strokeWidth\": 2\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t }\n\t\t}","fontURL":"","faviconURL":"","isIframe":true,"isInline":false,"css":"","cssURL":"","isPartial":false,"hasFixedSSN":true,"csrfToken":"FQC/JSj+/5Knv6FcyGEwio+ILW161vDZsLzNhbt82EI=","collectURL":"https://demo-api.gii.cloud/api/ip/bankid-se/auth/collect?id=880035236545495042\u0026csrfToken=FQC%2FJSj%2B%2F5Knv6FcyGEwio%2BILW161vDZsLzNhbt82EI%3D\u0026sessionID=96872c4a0e5e982ead7066a63ae065b231f5b3b03e6e4e58ffb2ea33ea86fa1a\u0026authRequestID=880035236525965314%2C341305621978906625%2CVqAgTCpjgN2%2B%2FjlHfeU9qoEqZdHNwFhBS5lc5VmQBUQ%3D","initSameDeviceURL":"https://demo-api.gii.cloud/api/ip/bankid-se/auth/initSameDevice?id=880035236545495042\u0026csrfToken=FQC%2FJSj%2B%2F5Knv6FcyGEwio%2BILW161vDZsLzNhbt82EI%3D\u0026sessionID=96872c4a0e5e982ead7066a63ae065b231f5b3b03e6e4e58ffb2ea33ea86fa1a\u0026authRequestID=880035236525965314%2C341305621978906625%2CVqAgTCpjgN2%2B%2FjlHfeU9qoEqZdHNwFhBS5lc5VmQBUQ%3D","initOtherDeviceURL":"https://demo-api.gii.cloud/api/ip/bankid-se/auth/initOtherDevice?id=880035236545495042\u0026csrfToken=FQC%2FJSj%2B%2F5Knv6FcyGEwio%2BILW161vDZsLzNhbt82EI%3D\u0026sessionID=96872c4a0e5e982ead7066a63ae065b231f5b3b03e6e4e58ffb2ea33ea86fa1a\u0026authRequestID=880035236525965314%2C341305621978906625%2CVqAgTCpjgN2%2B%2FjlHfeU9qoEqZdHNwFhBS5lc5VmQBUQ%3D","isSign":false,"hasPersonalNumber":true,"device":"OTHER","other":"","QR":"FALSE","lang":"sv","ssn":"199202143112","isNativePlatform":false,"redirectURL":"","redirect":false,"referer":"","isPhone":false,"cancelURL":"https://demo-api.gii.cloud/api/ip/bankid-se/auth/cancel?id=880035236545495042\u0026csrfToken=FQC%2FJSj%2B%2F5Knv6FcyGEwio%2BILW161vDZsLzNhbt82EI%3D\u0026sessionID=96872c4a0e5e982ead7066a63ae065b231f5b3b03e6e4e58ffb2ea33ea86fa1a\u0026authRequestID=880035236525965314%2C341305621978906625%2CVqAgTCpjgN2%2B%2FjlHfeU9qoEqZdHNwFhBS5lc5VmQBUQ%3D"}"></div>
|
|
41
|
+
<div class="bankid-se-lang" bankid-se-lang="{}"></div>
|
|
42
|
+
|
|
43
|
+
<script src="https://demo-api.gii.cloud/static/ip/bankidse/iframeResizer.contentWindow.min.js?rev=e05483705b84562824d8cb5f2ee1ce4657f40e18"></script>
|
|
44
|
+
<script src="https://demo-api.gii.cloud/static/ip/bankidse/bankidse-iframe.js?rev=e05483705b84562824d8cb5f2ee1ce4657f40e18"></script>
|
|
45
|
+
|
|
46
|
+
</main>
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
</body>
|
|
50
|
+
|
|
51
|
+
</html>
|
|
@@ -242,7 +242,6 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
|
|
|
242
242
|
hideRemainingLimit = _ref10.hideRemainingLimit,
|
|
243
243
|
showCurrentValue = _ref10.showCurrentValue,
|
|
244
244
|
hideOther = _ref10.hideOther,
|
|
245
|
-
maxAmounts = _ref10.maxAmounts,
|
|
246
245
|
values = _ref10.values,
|
|
247
246
|
messages = _ref10.messages,
|
|
248
247
|
isTime = _ref10.isTime,
|
|
@@ -255,13 +254,7 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
|
|
|
255
254
|
|
|
256
255
|
useEffect(function () {
|
|
257
256
|
if (newLimit) {
|
|
258
|
-
var _console, _console2;
|
|
259
|
-
|
|
260
257
|
setValue(newLimit.Amount);
|
|
261
|
-
(_console = console).log.apply(_console, _toConsumableArray(getValues(maxAmounts, currency, timespan)));
|
|
262
|
-
(_console2 = console).log.apply(_console2, _toConsumableArray(getValues(newLimit.MaxAmount, currency, timespan)));
|
|
263
|
-
console.log(maxAmounts);
|
|
264
|
-
console.log(values);
|
|
265
258
|
}
|
|
266
259
|
}, [newLimit]);
|
|
267
260
|
|
|
@@ -16,7 +16,6 @@ import messages from './messages';
|
|
|
16
16
|
import Timespan from './Timespan';
|
|
17
17
|
import getByPath from 'lodash/get';
|
|
18
18
|
import marked from 'marked';
|
|
19
|
-
import { getValues } from './helpers';
|
|
20
19
|
|
|
21
20
|
var ResponsibleGaming = function ResponsibleGaming(_ref) {
|
|
22
21
|
var limits = _ref.limits,
|
|
@@ -104,7 +103,7 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
|
|
|
104
103
|
* Add a new limit with status "NewLimit"
|
|
105
104
|
* There can only be one limit with status "NewLimit" for each type/timespan
|
|
106
105
|
*/
|
|
107
|
-
var onChangeLimit = function onChangeLimit(type, product
|
|
106
|
+
var onChangeLimit = function onChangeLimit(type, product) {
|
|
108
107
|
return function (timespan) {
|
|
109
108
|
return function (amount) {
|
|
110
109
|
var newLimit = {
|
|
@@ -113,7 +112,6 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
|
|
|
113
112
|
Product: product,
|
|
114
113
|
Timespan: timespan,
|
|
115
114
|
Amount: amount,
|
|
116
|
-
MaxAmount: getValues(maxAmounts, currency, timespan),
|
|
117
115
|
Status: 'NewLimit'
|
|
118
116
|
};
|
|
119
117
|
var limits = localLimits.filter(function (l) {
|
|
@@ -124,8 +122,6 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
|
|
|
124
122
|
};
|
|
125
123
|
};
|
|
126
124
|
|
|
127
|
-
console.log(normalizedLimits);
|
|
128
|
-
|
|
129
125
|
return React.createElement(
|
|
130
126
|
'div',
|
|
131
127
|
{ className: cn('ResponsibleGamingWidget', className) },
|
|
@@ -143,8 +139,8 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
|
|
|
143
139
|
tooltipOpen: normalizedLimits.tooltipOpen
|
|
144
140
|
}),
|
|
145
141
|
React.createElement(LimitContent, _extends({
|
|
146
|
-
onSubmitLimits: onSubmitLimits(normalizedLimits.type, normalizedLimits.product
|
|
147
|
-
onChangeLimit: onChangeLimit(normalizedLimits.type, normalizedLimits.product
|
|
142
|
+
onSubmitLimits: onSubmitLimits(normalizedLimits.type, normalizedLimits.product),
|
|
143
|
+
onChangeLimit: onChangeLimit(normalizedLimits.type, normalizedLimits.product),
|
|
148
144
|
hideSubmit: hideSubmit,
|
|
149
145
|
onConfirmLimit: onConfirmLimit,
|
|
150
146
|
onDeclineLimit: onDeclineLimit,
|
|
@@ -182,7 +178,6 @@ var LimitContent = function LimitContent(_ref3) {
|
|
|
182
178
|
getAlerts = _ref3.getAlerts,
|
|
183
179
|
isLoading = _ref3.isLoading,
|
|
184
180
|
currency = _ref3.currency,
|
|
185
|
-
maxAmounts = _ref3.maxAmounts,
|
|
186
181
|
values = _ref3.values,
|
|
187
182
|
valueType = _ref3.valueType,
|
|
188
183
|
hideRemainingLimit = _ref3.hideRemainingLimit,
|
|
@@ -196,8 +191,6 @@ var LimitContent = function LimitContent(_ref3) {
|
|
|
196
191
|
|
|
197
192
|
var alerts = getAlerts(Object.keys(timespans));
|
|
198
193
|
|
|
199
|
-
console.log(Object.values);
|
|
200
|
-
|
|
201
194
|
var onSubmit = function onSubmit(e) {
|
|
202
195
|
e.preventDefault();
|
|
203
196
|
var limits = Object.values(timespans).filter(function (t) {
|
|
@@ -230,36 +223,30 @@ var LimitContent = function LimitContent(_ref3) {
|
|
|
230
223
|
currency: currency
|
|
231
224
|
}),
|
|
232
225
|
Object.values(timespans).map(function (t) {
|
|
233
|
-
return React.createElement(
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
valueType: valueType,
|
|
258
|
-
hideRemainingLimit: hideRemainingLimit,
|
|
259
|
-
showCurrentValue: showCurrentValue,
|
|
260
|
-
hideOther: hideOther
|
|
261
|
-
}, t))
|
|
262
|
-
);
|
|
226
|
+
return React.createElement(Timespan, _extends({
|
|
227
|
+
key: t.timespan,
|
|
228
|
+
title: Object.values(timespans).length > 1 && messages.get('header.responsible-gaming.timespan.' + t.timespan),
|
|
229
|
+
onChangeLimit: onChangeLimit(t.timespan),
|
|
230
|
+
onResetLimit: function onResetLimit() {
|
|
231
|
+
return onSubmitLimits([t.currentLimit]);
|
|
232
|
+
},
|
|
233
|
+
onConfirmLimit: onConfirmLimit,
|
|
234
|
+
onDeclineLimit: onDeclineLimit,
|
|
235
|
+
onPickLimit: function onPickLimit(id) {
|
|
236
|
+
return onSubmitLimits(t.pickLimits.filter(function (l) {
|
|
237
|
+
return l.Id !== id;
|
|
238
|
+
}).map(function (l) {
|
|
239
|
+
return _extends({}, l, { Amount: 0 });
|
|
240
|
+
}));
|
|
241
|
+
},
|
|
242
|
+
validationState: getValidationState(t.timespan),
|
|
243
|
+
currency: currency,
|
|
244
|
+
values: values,
|
|
245
|
+
valueType: valueType,
|
|
246
|
+
hideRemainingLimit: hideRemainingLimit,
|
|
247
|
+
showCurrentValue: showCurrentValue,
|
|
248
|
+
hideOther: hideOther
|
|
249
|
+
}, t));
|
|
263
250
|
}),
|
|
264
251
|
!hideSubmit && React.createElement(
|
|
265
252
|
Button,
|
|
@@ -42,14 +42,10 @@ var validate = function validate(_ref) {
|
|
|
42
42
|
return getByPath(t, 'newLimit.Type') === 'Deposit' && t.timespan === 30;
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
var exceedingMaxLimitAmount = timespans.find(function (t) {
|
|
46
|
-
return getByPath(t, 'newLimit.Amount') > getByPath(t, 'newLimit.MaxAmount');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
45
|
/**
|
|
50
46
|
* Compose jurisdictions with rules
|
|
51
47
|
*/
|
|
52
|
-
var common = (_common = {}, _defineProperty(_common, 'show-confirm-on-submit', type === 'Block' || type === 'SelfExclude'), _defineProperty(_common, 'insufficient-limit-count', false), _defineProperty(_common, 'limits-are-pristine', limitsArePristine), _defineProperty(_common, 'limit-increase-blocked', false), _defineProperty(_common, 'limit-remove-blocked', false), _defineProperty(_common, '
|
|
48
|
+
var common = (_common = {}, _defineProperty(_common, 'show-confirm-on-submit', type === 'Block' || type === 'SelfExclude'), _defineProperty(_common, 'insufficient-limit-count', false), _defineProperty(_common, 'limits-are-pristine', limitsArePristine), _defineProperty(_common, 'limit-increase-blocked', false), _defineProperty(_common, 'limit-remove-blocked', false), _defineProperty(_common, 'isValid', function isValid() {
|
|
53
49
|
return !this['insufficient-limit-count'] && !(this['limit-increase-blocked'] && isIncreasingLimit) && !(this['limit-remove-blocked'] && isRemovingLimit);
|
|
54
50
|
}), _common);
|
|
55
51
|
var mga = {};
|
|
@@ -273,7 +273,6 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
|
|
|
273
273
|
hideRemainingLimit = _ref10.hideRemainingLimit,
|
|
274
274
|
showCurrentValue = _ref10.showCurrentValue,
|
|
275
275
|
hideOther = _ref10.hideOther,
|
|
276
|
-
maxAmounts = _ref10.maxAmounts,
|
|
277
276
|
values = _ref10.values,
|
|
278
277
|
messages = _ref10.messages,
|
|
279
278
|
isTime = _ref10.isTime,
|
|
@@ -286,13 +285,7 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
|
|
|
286
285
|
|
|
287
286
|
(0, _react.useEffect)(function () {
|
|
288
287
|
if (newLimit) {
|
|
289
|
-
var _console, _console2;
|
|
290
|
-
|
|
291
288
|
setValue(newLimit.Amount);
|
|
292
|
-
(_console = console).log.apply(_console, _toConsumableArray((0, _helpers.getValues)(maxAmounts, currency, timespan)));
|
|
293
|
-
(_console2 = console).log.apply(_console2, _toConsumableArray((0, _helpers.getValues)(newLimit.MaxAmount, currency, timespan)));
|
|
294
|
-
console.log(maxAmounts);
|
|
295
|
-
console.log(values);
|
|
296
289
|
}
|
|
297
290
|
}, [newLimit]);
|
|
298
291
|
|
|
@@ -55,8 +55,6 @@ var _marked = require('marked');
|
|
|
55
55
|
|
|
56
56
|
var _marked2 = _interopRequireDefault(_marked);
|
|
57
57
|
|
|
58
|
-
var _helpers = require('./helpers');
|
|
59
|
-
|
|
60
58
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
61
59
|
|
|
62
60
|
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
@@ -147,7 +145,7 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
|
|
|
147
145
|
* Add a new limit with status "NewLimit"
|
|
148
146
|
* There can only be one limit with status "NewLimit" for each type/timespan
|
|
149
147
|
*/
|
|
150
|
-
var onChangeLimit = function onChangeLimit(type, product
|
|
148
|
+
var onChangeLimit = function onChangeLimit(type, product) {
|
|
151
149
|
return function (timespan) {
|
|
152
150
|
return function (amount) {
|
|
153
151
|
var newLimit = {
|
|
@@ -156,7 +154,6 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
|
|
|
156
154
|
Product: product,
|
|
157
155
|
Timespan: timespan,
|
|
158
156
|
Amount: amount,
|
|
159
|
-
MaxAmount: (0, _helpers.getValues)(maxAmounts, currency, timespan),
|
|
160
157
|
Status: 'NewLimit'
|
|
161
158
|
};
|
|
162
159
|
var limits = localLimits.filter(function (l) {
|
|
@@ -167,8 +164,6 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
|
|
|
167
164
|
};
|
|
168
165
|
};
|
|
169
166
|
|
|
170
|
-
console.log(normalizedLimits);
|
|
171
|
-
|
|
172
167
|
return _react2.default.createElement(
|
|
173
168
|
'div',
|
|
174
169
|
{ className: (0, _classnames2.default)('ResponsibleGamingWidget', className) },
|
|
@@ -186,8 +181,8 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
|
|
|
186
181
|
tooltipOpen: normalizedLimits.tooltipOpen
|
|
187
182
|
}),
|
|
188
183
|
_react2.default.createElement(LimitContent, _extends({
|
|
189
|
-
onSubmitLimits: onSubmitLimits(normalizedLimits.type, normalizedLimits.product
|
|
190
|
-
onChangeLimit: onChangeLimit(normalizedLimits.type, normalizedLimits.product
|
|
184
|
+
onSubmitLimits: onSubmitLimits(normalizedLimits.type, normalizedLimits.product),
|
|
185
|
+
onChangeLimit: onChangeLimit(normalizedLimits.type, normalizedLimits.product),
|
|
191
186
|
hideSubmit: hideSubmit,
|
|
192
187
|
onConfirmLimit: onConfirmLimit,
|
|
193
188
|
onDeclineLimit: onDeclineLimit,
|
|
@@ -225,7 +220,6 @@ var LimitContent = function LimitContent(_ref3) {
|
|
|
225
220
|
getAlerts = _ref3.getAlerts,
|
|
226
221
|
isLoading = _ref3.isLoading,
|
|
227
222
|
currency = _ref3.currency,
|
|
228
|
-
maxAmounts = _ref3.maxAmounts,
|
|
229
223
|
values = _ref3.values,
|
|
230
224
|
valueType = _ref3.valueType,
|
|
231
225
|
hideRemainingLimit = _ref3.hideRemainingLimit,
|
|
@@ -239,8 +233,6 @@ var LimitContent = function LimitContent(_ref3) {
|
|
|
239
233
|
|
|
240
234
|
var alerts = getAlerts(Object.keys(timespans));
|
|
241
235
|
|
|
242
|
-
console.log(Object.values);
|
|
243
|
-
|
|
244
236
|
var onSubmit = function onSubmit(e) {
|
|
245
237
|
e.preventDefault();
|
|
246
238
|
var limits = Object.values(timespans).filter(function (t) {
|
|
@@ -273,36 +265,30 @@ var LimitContent = function LimitContent(_ref3) {
|
|
|
273
265
|
currency: currency
|
|
274
266
|
}),
|
|
275
267
|
Object.values(timespans).map(function (t) {
|
|
276
|
-
return _react2.default.createElement(
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
valueType: valueType,
|
|
301
|
-
hideRemainingLimit: hideRemainingLimit,
|
|
302
|
-
showCurrentValue: showCurrentValue,
|
|
303
|
-
hideOther: hideOther
|
|
304
|
-
}, t))
|
|
305
|
-
);
|
|
268
|
+
return _react2.default.createElement(_Timespan2.default, _extends({
|
|
269
|
+
key: t.timespan,
|
|
270
|
+
title: Object.values(timespans).length > 1 && _messages2.default.get('header.responsible-gaming.timespan.' + t.timespan),
|
|
271
|
+
onChangeLimit: onChangeLimit(t.timespan),
|
|
272
|
+
onResetLimit: function onResetLimit() {
|
|
273
|
+
return onSubmitLimits([t.currentLimit]);
|
|
274
|
+
},
|
|
275
|
+
onConfirmLimit: onConfirmLimit,
|
|
276
|
+
onDeclineLimit: onDeclineLimit,
|
|
277
|
+
onPickLimit: function onPickLimit(id) {
|
|
278
|
+
return onSubmitLimits(t.pickLimits.filter(function (l) {
|
|
279
|
+
return l.Id !== id;
|
|
280
|
+
}).map(function (l) {
|
|
281
|
+
return _extends({}, l, { Amount: 0 });
|
|
282
|
+
}));
|
|
283
|
+
},
|
|
284
|
+
validationState: getValidationState(t.timespan),
|
|
285
|
+
currency: currency,
|
|
286
|
+
values: values,
|
|
287
|
+
valueType: valueType,
|
|
288
|
+
hideRemainingLimit: hideRemainingLimit,
|
|
289
|
+
showCurrentValue: showCurrentValue,
|
|
290
|
+
hideOther: hideOther
|
|
291
|
+
}, t));
|
|
306
292
|
}),
|
|
307
293
|
!hideSubmit && _react2.default.createElement(
|
|
308
294
|
_Button2.default,
|
|
@@ -52,14 +52,10 @@ var validate = function validate(_ref) {
|
|
|
52
52
|
return (0, _get2.default)(t, 'newLimit.Type') === 'Deposit' && t.timespan === 30;
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
var exceedingMaxLimitAmount = timespans.find(function (t) {
|
|
56
|
-
return (0, _get2.default)(t, 'newLimit.Amount') > (0, _get2.default)(t, 'newLimit.MaxAmount');
|
|
57
|
-
});
|
|
58
|
-
|
|
59
55
|
/**
|
|
60
56
|
* Compose jurisdictions with rules
|
|
61
57
|
*/
|
|
62
|
-
var common = (_common = {}, _defineProperty(_common, 'show-confirm-on-submit', type === 'Block' || type === 'SelfExclude'), _defineProperty(_common, 'insufficient-limit-count', false), _defineProperty(_common, 'limits-are-pristine', limitsArePristine), _defineProperty(_common, 'limit-increase-blocked', false), _defineProperty(_common, 'limit-remove-blocked', false), _defineProperty(_common, '
|
|
58
|
+
var common = (_common = {}, _defineProperty(_common, 'show-confirm-on-submit', type === 'Block' || type === 'SelfExclude'), _defineProperty(_common, 'insufficient-limit-count', false), _defineProperty(_common, 'limits-are-pristine', limitsArePristine), _defineProperty(_common, 'limit-increase-blocked', false), _defineProperty(_common, 'limit-remove-blocked', false), _defineProperty(_common, 'isValid', function isValid() {
|
|
63
59
|
return !this['insufficient-limit-count'] && !(this['limit-increase-blocked'] && isIncreasingLimit) && !(this['limit-remove-blocked'] && isRemovingLimit);
|
|
64
60
|
}), _common);
|
|
65
61
|
var mga = {};
|