tg-core-components 6.3.11-1 → 6.3.11-2
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/package.json +1 -1
- package/es/widgets/ResponsibleGamingWidget/Timespan.js +0 -387
- package/es/widgets/ResponsibleGamingWidget/helpers.js +0 -39
- package/es/widgets/ResponsibleGamingWidget/index.js +0 -319
- package/es/widgets/ResponsibleGamingWidget/messages.js +0 -342
- package/es/widgets/ResponsibleGamingWidget/normalize.js +0 -238
- package/es/widgets/ResponsibleGamingWidget/validate.js +0 -75
- package/es/widgets/Settings/index.js +0 -54
- package/es/widgets/SignIn/SignInForm.js +0 -80
- package/es/widgets/SignIn/index.js +0 -80
- package/es/widgets/SignUp/ActivationStep.js +0 -166
- package/es/widgets/SignUp/ConfirmContactInfoStep.js +0 -250
- package/es/widgets/SignUp/ContactInfoStep.js +0 -368
- package/es/widgets/SignUp/SetLimitsStep.js +0 -255
- package/es/widgets/SignUp/UserInfoStep.js +0 -258
- package/es/widgets/SignUp/index.js +0 -324
- package/es/widgets/SportsbookHistoryTable/index.js +0 -300
- package/es/widgets/SportsbookSettings/index.js +0 -56
- package/es/widgets/Subscriptions/index.js +0 -193
- package/es/widgets/TableWidget/Tables/bonusCode.js +0 -92
- package/es/widgets/TableWidget/Tables/bonusTable.js +0 -249
- package/es/widgets/TableWidget/Tables/index.js +0 -71
- package/es/widgets/TableWidget/index.js +0 -125
- package/es/widgets/Verify/Address.js +0 -28
- package/es/widgets/Verify/Passport.js +0 -28
- package/es/widgets/Verify/Payment.js +0 -28
- package/es/widgets/Verify/index.js +0 -154
- package/es/widgets/Verify/reasons.js +0 -92
- package/es/widgets/Verify/status.js +0 -16
- package/es/widgets/Verify/types.js +0 -25
- package/es/widgets/VerifyAccordionWidget/index.js +0 -177
- package/lib/components/AcceptUpdatedTaC/index.js +0 -89
- package/lib/components/Alert/index.js +0 -145
- package/lib/components/AutocompleteInput/index.js +0 -118
- package/lib/components/Button/index.js +0 -86
- package/lib/components/ButtonLoader.js +0 -78
- package/lib/components/Checklist/index.js +0 -73
- package/lib/components/Deposit/BonusCodeInput/index.js +0 -110
- package/lib/components/Deposit/CardInput/index.js +0 -249
- package/lib/components/Deposit/DelayVisibility/index.js +0 -63
- package/lib/components/Deposit/InputAdapter/index.js +0 -54
- package/lib/components/Deposit/Select/index.js +0 -183
- package/lib/components/Deposit/Single/index.js +0 -126
- package/lib/components/Deposit/TextInput/index.js +0 -194
- package/lib/components/Icon/index.js +0 -34
- package/lib/components/Image/index.js +0 -172
- package/lib/components/Input/BirthdateInput.js +0 -195
- package/lib/components/Input/Checkbox.js +0 -65
- package/lib/components/Input/Input.js +0 -87
- package/lib/components/Input/PasswordInput.js +0 -101
- package/lib/components/Input/PhoneNumberInput.js +0 -136
- package/lib/components/Input/index.js +0 -50
- package/lib/components/Input/input.test.js +0 -89
- package/lib/components/Input/old-input.test.js +0 -107
- package/lib/components/InternalMessagesInbox.js +0 -315
- package/lib/components/List/ListItem.js +0 -64
- package/lib/components/List/index.js +0 -98
- package/lib/components/Loader/index.js +0 -51
- package/lib/components/Money/index.js +0 -74
- package/lib/components/Notification.js +0 -189
- package/lib/components/Picture/index.js +0 -88
- package/lib/components/Radio/index.js +0 -103
- package/lib/components/Select/index.js +0 -83
- package/lib/components/Single/index.js +0 -142
- package/lib/components/Skeleton/index.js +0 -31
- package/lib/components/Textarea/index.js +0 -184
- package/lib/components/Translate/index.js +0 -39
- package/lib/components/Uploader/index.js +0 -157
- package/lib/components/common.js +0 -363
- package/lib/index.js +0 -270
- package/lib/lib/WithFetch.js +0 -65
- package/lib/lib/WithMultipleStep.js +0 -61
- package/lib/lib/WithValidation/index.js +0 -132
- package/lib/lib/WithValidation/rules/blacklistedCharacters.js +0 -9
- package/lib/lib/WithValidation/rules/date.js +0 -22
- package/lib/lib/WithValidation/rules/email.js +0 -9
- package/lib/lib/WithValidation/rules/hasMin.js +0 -11
- package/lib/lib/WithValidation/rules/hasMinLength.js +0 -17
- package/lib/lib/WithValidation/rules/match.js +0 -12
- package/lib/lib/WithValidation/rules/noSpecialCharacters.js +0 -9
- package/lib/lib/WithValidation/rules/number.js +0 -9
- package/lib/lib/WithValidation/rules/password.js +0 -9
- package/lib/lib/WithValidation/rules/phone.js +0 -9
- package/lib/lib/WithValidation/rules/required.js +0 -11
- package/lib/lib/WithValidation/rules/stringWithoutJapaneseCharacters.js +0 -9
- package/lib/lib/WithValidation/rules/stringWithoutNumbers.js +0 -9
- package/lib/lib/utils/historyMaps.js +0 -40
- package/lib/lib/utils/muchBetterParser.js +0 -11
- package/lib/lib/utils/selectUnit.js +0 -69
- package/lib/lib/utils/swishParser.js +0 -10
- package/lib/lib/utils/swishParser.test.js +0 -29
- package/lib/lib/utils/translate.js +0 -32
- package/lib/lib/withSwipeListeners.js +0 -104
- package/lib/misc/countryEmojiFlags.js +0 -207
- package/lib/styleguide/Wrapper.js +0 -46
- package/lib/styleguide/logo/index.js +0 -21
- package/lib/widgets/AccordionWidget/index.js +0 -228
- package/lib/widgets/AccountDetail/index.js +0 -344
- package/lib/widgets/ActivateWidget/index.js +0 -393
- package/lib/widgets/Balance/index.js +0 -64
- package/lib/widgets/Bonus/bonusCode.js +0 -111
- package/lib/widgets/Bonus/index.js +0 -115
- package/lib/widgets/Bonus/table.js +0 -166
- package/lib/widgets/BonusWidget/BonusCode.js +0 -113
- package/lib/widgets/BonusWidget/index.js +0 -336
- package/lib/widgets/BonusWidget/states.js +0 -48
- package/lib/widgets/BonusWidget/types.js +0 -38
- package/lib/widgets/Cashier/Deposit/BonusSelectorList/index.js +0 -79
- package/lib/widgets/Cashier/Deposit/DepositWidget/index.js +0 -416
- package/lib/widgets/Cashier/Deposit/PaymentForm/DynamicForm.js +0 -75
- package/lib/widgets/Cashier/Deposit/PaymentForm/InjectedIframeHTML.js +0 -74
- package/lib/widgets/Cashier/Deposit/PaymentForm/NewTab.js +0 -44
- package/lib/widgets/Cashier/Deposit/PaymentForm/PaymentResult.js +0 -53
- package/lib/widgets/Cashier/Deposit/PaymentForm/index.js +0 -224
- package/lib/widgets/Cashier/Payment/PaymentAccountForms/index.js +0 -350
- package/lib/widgets/Cashier/Payment/PaymentAccountParser.js +0 -55
- package/lib/widgets/Cashier/Payment/PaymentAmountSelector/index.js +0 -89
- package/lib/widgets/Cashier/Payment/PaymentMethodItem/index.js +0 -247
- package/lib/widgets/Cashier/Payment/PaymentMethodSelector/index.js +0 -79
- package/lib/widgets/Cashier/Payment/SelectedPaymentMethod/index.js +0 -104
- package/lib/widgets/Cashier/Payment/index.js +0 -35
- package/lib/widgets/Cashier/Withdraw/WithdrawWidget/index.js +0 -314
- package/lib/widgets/Cashier/hoc/FramedComponent/index.js +0 -90
- package/lib/widgets/CashierAccordion/Deposit/BonusCodeInput/index.js +0 -96
- package/lib/widgets/CashierAccordion/Deposit/DepositWidget/index.js +0 -818
- package/lib/widgets/CashierAccordion/Deposit/PaymentForm/DynamicForm.js +0 -75
- package/lib/widgets/CashierAccordion/Deposit/PaymentForm/InjectedIframeHTML.js +0 -70
- package/lib/widgets/CashierAccordion/Deposit/PaymentForm/NewTab.js +0 -44
- package/lib/widgets/CashierAccordion/Deposit/PaymentForm/PaymentResult.js +0 -50
- package/lib/widgets/CashierAccordion/Deposit/PaymentForm/index.js +0 -167
- package/lib/widgets/CashierAccordion/Payment/AccountSelection/index.js +0 -115
- package/lib/widgets/CashierAccordion/Payment/Button/index.js +0 -35
- package/lib/widgets/CashierAccordion/Payment/CashierResult/index.js +0 -173
- package/lib/widgets/CashierAccordion/Payment/MethodMinMax/index.js +0 -69
- package/lib/widgets/CashierAccordion/Payment/Notice/index.js +0 -44
- package/lib/widgets/CashierAccordion/Payment/PaymentAccountForms/astroPayBankTransaltions.js +0 -1113
- package/lib/widgets/CashierAccordion/Payment/PaymentAccountForms/index.js +0 -1084
- package/lib/widgets/CashierAccordion/Payment/PaymentAccountParser.js +0 -63
- package/lib/widgets/CashierAccordion/Payment/PaymentAmountSelector/index.js +0 -57
- package/lib/widgets/CashierAccordion/Payment/PaymentMethodItem/index.js +0 -236
- package/lib/widgets/CashierAccordion/Payment/PaymentMethodSelector/index.js +0 -117
- package/lib/widgets/CashierAccordion/Payment/SelectedPaymentMethod/index.js +0 -73
- package/lib/widgets/CashierAccordion/Payment/index.js +0 -87
- package/lib/widgets/CashierAccordion/Withdraw/WithdrawWidget/index.js +0 -536
- package/lib/widgets/CashierAccordion/hoc/FramedComponent/index.js +0 -90
- package/lib/widgets/CasinoHistoryTable/index.js +0 -317
- package/lib/widgets/ChangePassword/index.js +0 -139
- package/lib/widgets/ChangeUsername/index.js +0 -95
- package/lib/widgets/HistoryWidget/index.js +0 -410
- package/lib/widgets/HistoryWidget/message.js +0 -160
- package/lib/widgets/HistoryWidget/utils.js +0 -40
- package/lib/widgets/Pagination/index.js +0 -217
- package/lib/widgets/PaymentHistoryTable/index.js +0 -310
- package/lib/widgets/RequestResetPassword/index.js +0 -132
- package/lib/widgets/ResetPassword/index.js +0 -143
- package/lib/widgets/ResponsibleGaming/Amount.js +0 -72
- package/lib/widgets/ResponsibleGaming/LimitList/index.js +0 -229
- package/lib/widgets/ResponsibleGaming/Period.js +0 -67
- package/lib/widgets/ResponsibleGaming/index.js +0 -167
- package/lib/widgets/ResponsibleGamingAccordion/AmountItemContent/index.js +0 -416
- package/lib/widgets/ResponsibleGamingAccordion/AmountItemHeader/index.js +0 -57
- package/lib/widgets/ResponsibleGamingAccordion/LimitStatus/index.js +0 -400
- package/lib/widgets/ResponsibleGamingAccordion/PeriodItemContent/index.js +0 -217
- package/lib/widgets/ResponsibleGamingAccordion/PeriodItemHeader/index.js +0 -53
- package/lib/widgets/ResponsibleGamingAccordion/index.js +0 -688
- package/lib/widgets/ResponsibleGamingAccordionSignUp/AmountItemContent/index.js +0 -139
- package/lib/widgets/ResponsibleGamingAccordionSignUp/AmountItemHeader/index.js +0 -57
- package/lib/widgets/ResponsibleGamingAccordionSignUp/LimitStatus/index.js +0 -61
- package/lib/widgets/ResponsibleGamingAccordionSignUp/index.js +0 -258
- package/lib/widgets/ResponsibleGamingSingleSignUp/AmountItem/index.js +0 -112
- package/lib/widgets/ResponsibleGamingSingleSignUp/LimitStatus/index.js +0 -42
- package/lib/widgets/ResponsibleGamingSingleSignUp/index.js +0 -286
- package/lib/widgets/ResponsibleGamingWidget/Timespan.js +0 -418
- package/lib/widgets/ResponsibleGamingWidget/helpers.js +0 -50
- package/lib/widgets/ResponsibleGamingWidget/index.js +0 -362
- package/lib/widgets/ResponsibleGamingWidget/messages.js +0 -363
- package/lib/widgets/ResponsibleGamingWidget/normalize.js +0 -244
- package/lib/widgets/ResponsibleGamingWidget/validate.js +0 -85
- package/lib/widgets/Settings/index.js +0 -79
- package/lib/widgets/SignIn/SignInForm.js +0 -109
- package/lib/widgets/SignIn/index.js +0 -112
- package/lib/widgets/SignUp/ActivationStep.js +0 -199
- package/lib/widgets/SignUp/ConfirmContactInfoStep.js +0 -279
- package/lib/widgets/SignUp/ContactInfoStep.js +0 -407
- package/lib/widgets/SignUp/SetLimitsStep.js +0 -293
- package/lib/widgets/SignUp/UserInfoStep.js +0 -308
- package/lib/widgets/SignUp/index.js +0 -352
- package/lib/widgets/SportsbookHistoryTable/index.js +0 -315
- package/lib/widgets/SportsbookSettings/index.js +0 -78
- package/lib/widgets/Subscriptions/index.js +0 -215
- package/lib/widgets/TableWidget/Tables/bonusCode.js +0 -124
- package/lib/widgets/TableWidget/Tables/bonusTable.js +0 -264
- package/lib/widgets/TableWidget/Tables/index.js +0 -86
- package/lib/widgets/TableWidget/index.js +0 -139
- package/lib/widgets/Verify/Address.js +0 -38
- package/lib/widgets/Verify/Passport.js +0 -38
- package/lib/widgets/Verify/Payment.js +0 -38
- package/lib/widgets/Verify/index.js +0 -189
- package/lib/widgets/Verify/reasons.js +0 -106
- package/lib/widgets/Verify/status.js +0 -30
- package/lib/widgets/Verify/types.js +0 -39
- package/lib/widgets/VerifyAccordionWidget/index.js +0 -213
package/package.json
CHANGED
|
@@ -1,387 +0,0 @@
|
|
|
1
|
-
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
|
|
2
|
-
|
|
3
|
-
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
4
|
-
|
|
5
|
-
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); } }
|
|
6
|
-
|
|
7
|
-
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
|
8
|
-
|
|
9
|
-
import React, { useState, useEffect, Fragment } from 'react';
|
|
10
|
-
import Input from '../../components/Input';
|
|
11
|
-
import Select from '../../components/Select';
|
|
12
|
-
import Button from '../../components/Button';
|
|
13
|
-
import Icon from '../../components/Icon';
|
|
14
|
-
import messages from './messages';
|
|
15
|
-
import getByPath from 'lodash/get';
|
|
16
|
-
import { injectIntl } from 'react-intl';
|
|
17
|
-
import { getValues, convertTimeValues } from './helpers';
|
|
18
|
-
|
|
19
|
-
var Timespan = function Timespan(_ref) {
|
|
20
|
-
var title = _ref.title,
|
|
21
|
-
rest = _objectWithoutProperties(_ref, ['title']);
|
|
22
|
-
|
|
23
|
-
var Component = getTimespanComponent(rest);
|
|
24
|
-
|
|
25
|
-
var get = function get(intl) {
|
|
26
|
-
return function (id) {
|
|
27
|
-
var values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
28
|
-
return messages.get(id, _extends({ intl: intl }, values || {}));
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
var getValue = function getValue(valueType, currency, intl) {
|
|
32
|
-
return function (value) {
|
|
33
|
-
if (valueType !== 'currency') {
|
|
34
|
-
if (value === 99999 && valueType === 'days') return get(intl)('label.responsible-gaming.unlimited');
|
|
35
|
-
|
|
36
|
-
var values = convertTimeValues(value, valueType);
|
|
37
|
-
return Object.entries(values).filter(function (_ref2) {
|
|
38
|
-
var _ref3 = _slicedToArray(_ref2, 2),
|
|
39
|
-
valueType = _ref3[0],
|
|
40
|
-
value = _ref3[1];
|
|
41
|
-
|
|
42
|
-
return value > 0;
|
|
43
|
-
}).map(function (_ref4) {
|
|
44
|
-
var _ref5 = _slicedToArray(_ref4, 2),
|
|
45
|
-
valueType = _ref5[0],
|
|
46
|
-
value = _ref5[1];
|
|
47
|
-
|
|
48
|
-
return messages.getValue(value, valueType, null, intl);
|
|
49
|
-
}).slice(0, 2).join(' ');
|
|
50
|
-
} else {
|
|
51
|
-
return messages.getValue(value, valueType, currency, intl);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
return React.createElement(
|
|
57
|
-
'div',
|
|
58
|
-
{ className: 'ResponsibleGamingWidget__timespan' },
|
|
59
|
-
title && React.createElement(
|
|
60
|
-
'div',
|
|
61
|
-
{ className: 'ResponsibleGamingWidget__timespan-title' },
|
|
62
|
-
title
|
|
63
|
-
),
|
|
64
|
-
React.createElement(Component, _extends({}, rest, {
|
|
65
|
-
isTime: ['hours', 'minutes', 'days'].includes(rest.valueType),
|
|
66
|
-
messages: {
|
|
67
|
-
get: get(rest.intl),
|
|
68
|
-
getValue: getValue(rest.valueType, rest.currency, rest.intl)
|
|
69
|
-
}
|
|
70
|
-
}))
|
|
71
|
-
);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export default injectIntl(Timespan);
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Map normalized limits to a timespan component.
|
|
78
|
-
*/
|
|
79
|
-
var getTimespanComponent = function getTimespanComponent(_ref6) {
|
|
80
|
-
var confirmLimit = _ref6.confirmLimit,
|
|
81
|
-
pendingActivateLimit = _ref6.pendingActivateLimit,
|
|
82
|
-
pendingDeleteLimit = _ref6.pendingDeleteLimit,
|
|
83
|
-
pickLimits = _ref6.pickLimits;
|
|
84
|
-
|
|
85
|
-
if (confirmLimit) return ConfirmTimespan;
|
|
86
|
-
if (pendingActivateLimit || pendingDeleteLimit) return PendingTimespan;
|
|
87
|
-
if (Array.isArray(pickLimits) && pickLimits.length > 1) return PickTimespan;
|
|
88
|
-
return DefaultTimespan;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
var PickTimespan = function PickTimespan(_ref7) {
|
|
92
|
-
var pickLimits = _ref7.pickLimits,
|
|
93
|
-
onPickLimit = _ref7.onPickLimit,
|
|
94
|
-
messages = _ref7.messages;
|
|
95
|
-
return React.createElement(
|
|
96
|
-
Fragment,
|
|
97
|
-
null,
|
|
98
|
-
messages.get('label.responsible-gaming.pick-limit'),
|
|
99
|
-
pickLimits.map(function (l, k) {
|
|
100
|
-
return React.createElement(
|
|
101
|
-
'div',
|
|
102
|
-
{ className: 'ResponsibleGamingWidget__timespan-row', key: k },
|
|
103
|
-
messages.getValue(getByPath(l, 'Amount')),
|
|
104
|
-
React.createElement(
|
|
105
|
-
Button,
|
|
106
|
-
{
|
|
107
|
-
type: 'button',
|
|
108
|
-
className: 'button tertiary tiny',
|
|
109
|
-
onClick: function onClick() {
|
|
110
|
-
return onPickLimit(l.Id);
|
|
111
|
-
} },
|
|
112
|
-
messages.get('action.responsible-gaming.pick')
|
|
113
|
-
)
|
|
114
|
-
);
|
|
115
|
-
})
|
|
116
|
-
);
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
var ConfirmTimespan = function ConfirmTimespan(_ref8) {
|
|
120
|
-
var confirmLimit = _ref8.confirmLimit,
|
|
121
|
-
currentLimit = _ref8.currentLimit,
|
|
122
|
-
pendingActivateLimit = _ref8.pendingActivateLimit,
|
|
123
|
-
pendingDeleteLimit = _ref8.pendingDeleteLimit,
|
|
124
|
-
onConfirmLimit = _ref8.onConfirmLimit,
|
|
125
|
-
onDeclineLimit = _ref8.onDeclineLimit,
|
|
126
|
-
hideRemainingLimit = _ref8.hideRemainingLimit,
|
|
127
|
-
isTime = _ref8.isTime,
|
|
128
|
-
messages = _ref8.messages;
|
|
129
|
-
return React.createElement(
|
|
130
|
-
Fragment,
|
|
131
|
-
null,
|
|
132
|
-
React.createElement(
|
|
133
|
-
'div',
|
|
134
|
-
{ className: 'ResponsibleGamingWidget__timespan-row' },
|
|
135
|
-
messages.get('message.responsiblegaming.current-limit'),
|
|
136
|
-
messages.getValue(getByPath(currentLimit, 'Amount'))
|
|
137
|
-
),
|
|
138
|
-
!hideRemainingLimit && React.createElement(
|
|
139
|
-
'div',
|
|
140
|
-
{ className: 'ResponsibleGamingWidget__timespan-row' },
|
|
141
|
-
isTime ? messages.get('message.responsiblegaming.remaining-time') : messages.get('message.responsiblegaming.remaining-limit'),
|
|
142
|
-
messages.getValue(getByPath(currentLimit, 'RemainingAmount'))
|
|
143
|
-
),
|
|
144
|
-
React.createElement(
|
|
145
|
-
'div',
|
|
146
|
-
{ className: 'ResponsibleGamingWidget__timespan-box' },
|
|
147
|
-
pendingActivateLimit && messages.get('label.responsible-gaming.confirm-increase', {
|
|
148
|
-
PendingActivateLimitAmount: messages.getValue(getByPath(pendingActivateLimit, 'Amount'))
|
|
149
|
-
}),
|
|
150
|
-
pendingDeleteLimit && messages.get('label.responsible-gaming.confirm-delete'),
|
|
151
|
-
React.createElement(
|
|
152
|
-
'div',
|
|
153
|
-
{ className: 'ResponsibleGamingWidget__timespan-box-actions' },
|
|
154
|
-
React.createElement(
|
|
155
|
-
Button,
|
|
156
|
-
{
|
|
157
|
-
type: 'button',
|
|
158
|
-
className: 'button tertiary',
|
|
159
|
-
onClick: function onClick() {
|
|
160
|
-
return onDeclineLimit(confirmLimit.Id);
|
|
161
|
-
} },
|
|
162
|
-
messages.get('action.responsible-gaming.reset-limit')
|
|
163
|
-
),
|
|
164
|
-
React.createElement(
|
|
165
|
-
Button,
|
|
166
|
-
{
|
|
167
|
-
type: 'button',
|
|
168
|
-
className: 'button primary',
|
|
169
|
-
onClick: function onClick() {
|
|
170
|
-
return onConfirmLimit(confirmLimit.Id);
|
|
171
|
-
} },
|
|
172
|
-
messages.get('action.responsible-gaming.accept')
|
|
173
|
-
)
|
|
174
|
-
)
|
|
175
|
-
)
|
|
176
|
-
);
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
var PendingTimespan = function PendingTimespan(_ref9) {
|
|
180
|
-
var currentLimit = _ref9.currentLimit,
|
|
181
|
-
pendingActivateLimit = _ref9.pendingActivateLimit,
|
|
182
|
-
pendingDeleteLimit = _ref9.pendingDeleteLimit,
|
|
183
|
-
onResetLimit = _ref9.onResetLimit,
|
|
184
|
-
hideRemainingLimit = _ref9.hideRemainingLimit,
|
|
185
|
-
messages = _ref9.messages,
|
|
186
|
-
isTime = _ref9.isTime;
|
|
187
|
-
|
|
188
|
-
var isPendingDelete = Boolean(pendingDeleteLimit && !pendingActivateLimit);
|
|
189
|
-
var isPendingActivate = Boolean(pendingActivateLimit && pendingActivateLimit.Activates);
|
|
190
|
-
var isPendingReview = Boolean(pendingActivateLimit && !pendingActivateLimit.Activates);
|
|
191
|
-
return React.createElement(
|
|
192
|
-
Fragment,
|
|
193
|
-
null,
|
|
194
|
-
React.createElement(
|
|
195
|
-
'div',
|
|
196
|
-
{ className: 'ResponsibleGamingWidget__timespan-row' },
|
|
197
|
-
messages.get('message.responsiblegaming.current-limit'),
|
|
198
|
-
messages.getValue(getByPath(currentLimit, 'Amount'))
|
|
199
|
-
),
|
|
200
|
-
!hideRemainingLimit && React.createElement(
|
|
201
|
-
'div',
|
|
202
|
-
{ className: 'ResponsibleGamingWidget__timespan-row' },
|
|
203
|
-
isTime ? messages.get('message.responsiblegaming.remaining-time') : messages.get('message.responsiblegaming.remaining-limit'),
|
|
204
|
-
messages.getValue(getByPath(currentLimit, 'RemainingAmount'))
|
|
205
|
-
),
|
|
206
|
-
React.createElement(
|
|
207
|
-
'div',
|
|
208
|
-
{ className: 'ResponsibleGamingWidget__timespan-box' },
|
|
209
|
-
isPendingDelete && messages.get('label.responsible-gaming.pending-delete', {
|
|
210
|
-
PendingDeleteLimitExpires: pendingDeleteLimit.Expires
|
|
211
|
-
}),
|
|
212
|
-
isPendingActivate && messages.get('label.responsible-gaming.pending-activate', {
|
|
213
|
-
PendingActivateLimitAmount: messages.getValue(pendingActivateLimit.Amount),
|
|
214
|
-
PendingActivateLimitActivates: pendingActivateLimit.Activates
|
|
215
|
-
}),
|
|
216
|
-
isPendingReview && messages.get('label.responsible-gaming.pending-review', {
|
|
217
|
-
PendingReviewLimitAmount: messages.getValue(pendingActivateLimit.Amount)
|
|
218
|
-
}),
|
|
219
|
-
React.createElement(
|
|
220
|
-
'div',
|
|
221
|
-
{ className: 'ResponsibleGamingWidget__timespan-box-actions' },
|
|
222
|
-
React.createElement(
|
|
223
|
-
Button,
|
|
224
|
-
{
|
|
225
|
-
type: 'button',
|
|
226
|
-
className: 'button tertiary wide',
|
|
227
|
-
onClick: onResetLimit },
|
|
228
|
-
messages.get('action.responsible-gaming.reset-limit')
|
|
229
|
-
)
|
|
230
|
-
)
|
|
231
|
-
)
|
|
232
|
-
);
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
var DefaultTimespan = function DefaultTimespan(_ref10) {
|
|
236
|
-
var currentLimit = _ref10.currentLimit,
|
|
237
|
-
newLimit = _ref10.newLimit,
|
|
238
|
-
onChangeLimit = _ref10.onChangeLimit,
|
|
239
|
-
validationState = _ref10.validationState,
|
|
240
|
-
currency = _ref10.currency,
|
|
241
|
-
timespan = _ref10.timespan,
|
|
242
|
-
hideRemainingLimit = _ref10.hideRemainingLimit,
|
|
243
|
-
showCurrentValue = _ref10.showCurrentValue,
|
|
244
|
-
hideOther = _ref10.hideOther,
|
|
245
|
-
values = _ref10.values,
|
|
246
|
-
messages = _ref10.messages,
|
|
247
|
-
isTime = _ref10.isTime,
|
|
248
|
-
valueType = _ref10.valueType,
|
|
249
|
-
setValueType = _ref10.setValueType;
|
|
250
|
-
|
|
251
|
-
var _useState = useState(newLimit ? newLimit.Amount : currentLimit ? currentLimit.Amount : 0),
|
|
252
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
253
|
-
value = _useState2[0],
|
|
254
|
-
setValue = _useState2[1];
|
|
255
|
-
|
|
256
|
-
useEffect(function () {
|
|
257
|
-
if (newLimit) {
|
|
258
|
-
setValue(newLimit.Amount);
|
|
259
|
-
}
|
|
260
|
-
}, [newLimit]);
|
|
261
|
-
|
|
262
|
-
var _useState3 = useState('select'),
|
|
263
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
264
|
-
inputMode = _useState4[0],
|
|
265
|
-
setInputMode = _useState4[1];
|
|
266
|
-
|
|
267
|
-
var options = [getByPath(currentLimit, 'Amount'), getByPath(newLimit, 'Amount')].concat(_toConsumableArray(getValues(values, currency, timespan))).filter(function (v) {
|
|
268
|
-
return v;
|
|
269
|
-
});
|
|
270
|
-
options.sort(function (a, b) {
|
|
271
|
-
return a - b;
|
|
272
|
-
});
|
|
273
|
-
options = [].concat(_toConsumableArray(new Set(options))).map(function (v) {
|
|
274
|
-
return {
|
|
275
|
-
value: v,
|
|
276
|
-
label: value !== v && v === getByPath(currentLimit, 'Amount') ? messages.get('label.responsible-gaming.option.current-limit', {
|
|
277
|
-
currentLimit: messages.getValue(v)
|
|
278
|
-
}) : messages.getValue(v)
|
|
279
|
-
};
|
|
280
|
-
});
|
|
281
|
-
// If not allowed to increase limit -> remove options greater than current limit
|
|
282
|
-
if (validationState['limit-increase-blocked']) {
|
|
283
|
-
options = options.filter(function (o) {
|
|
284
|
-
return o.value <= getByPath(currentLimit, 'Amount');
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
// If not blocked from removing limit or 'No limit' option is selected -> add 'No limit' option
|
|
288
|
-
if (!validationState['limit-remove-blocked'] || value === 0 || value === '') {
|
|
289
|
-
options.unshift({
|
|
290
|
-
value: 0,
|
|
291
|
-
label: messages.get('label.responsible-gaming.option.no-limit')
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
// Add 'Other' option
|
|
295
|
-
if (!hideOther) {
|
|
296
|
-
options.push({
|
|
297
|
-
value: 'other',
|
|
298
|
-
label: valueType !== 'currency' ? messages.get('label.responsible-gaming.option.other-' + (setValueType || valueType)) : messages.get('label.responsible-gaming.option.other')
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
// Per transaction (0) limits are depricated, remove all other options but no limit.
|
|
302
|
-
if (timespan === 0) {
|
|
303
|
-
options = [getByPath(currentLimit, 'Amount'), getByPath(newLimit, 'Amount'), {
|
|
304
|
-
value: 0,
|
|
305
|
-
label: messages.get('label.responsible-gaming.option.no-limit')
|
|
306
|
-
}].filter(function (v) {
|
|
307
|
-
return v;
|
|
308
|
-
}).sort();
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
var closeCustomAmount = function closeCustomAmount() {
|
|
312
|
-
_onChange(currentLimit ? currentLimit.Amount : 0);
|
|
313
|
-
setInputMode('select');
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
var _onChange = function _onChange(value) {
|
|
317
|
-
if (value === 'other') {
|
|
318
|
-
setInputMode('input');
|
|
319
|
-
setValue('');
|
|
320
|
-
} else {
|
|
321
|
-
onChangeLimit(isNaN(parseInt(value)) ? getByPath(currentLimit, 'Amount') : parseInt(value));
|
|
322
|
-
}
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
var isIphone = typeof window !== 'undefined' && navigator.platform === 'iPhone';
|
|
326
|
-
|
|
327
|
-
return React.createElement(
|
|
328
|
-
Fragment,
|
|
329
|
-
null,
|
|
330
|
-
React.createElement(
|
|
331
|
-
'div',
|
|
332
|
-
{ className: 'ResponsibleGamingWidget__timespan-limit-selector' },
|
|
333
|
-
inputMode === 'select' && React.createElement(
|
|
334
|
-
Select,
|
|
335
|
-
{
|
|
336
|
-
options: options,
|
|
337
|
-
value: value,
|
|
338
|
-
onChange: function onChange(e, value) {
|
|
339
|
-
return _onChange(value);
|
|
340
|
-
} },
|
|
341
|
-
options.map(function (o) {
|
|
342
|
-
return React.createElement(
|
|
343
|
-
Select.Option,
|
|
344
|
-
{ value: o.value },
|
|
345
|
-
o.label
|
|
346
|
-
);
|
|
347
|
-
})
|
|
348
|
-
),
|
|
349
|
-
inputMode === 'input' && React.createElement(
|
|
350
|
-
Fragment,
|
|
351
|
-
null,
|
|
352
|
-
React.createElement(Input, {
|
|
353
|
-
type: 'number',
|
|
354
|
-
pattern: '\\d*',
|
|
355
|
-
value: value,
|
|
356
|
-
onChange: function onChange(e, value) {
|
|
357
|
-
setValue(parseInt(value));
|
|
358
|
-
if (value > 0) _onChange(value);
|
|
359
|
-
},
|
|
360
|
-
autoFocus: !isIphone,
|
|
361
|
-
min: validationState['limit-remove-blocked'] ? '1' : '0',
|
|
362
|
-
max: validationState['limit-increase-blocked'] ? getByPath(currentLimit, 'Amount') : Infinity
|
|
363
|
-
}),
|
|
364
|
-
React.createElement(
|
|
365
|
-
Button,
|
|
366
|
-
{
|
|
367
|
-
type: 'button',
|
|
368
|
-
onClick: closeCustomAmount,
|
|
369
|
-
className: 'button mini tertiary' },
|
|
370
|
-
React.createElement(Icon, { icon: 'times' })
|
|
371
|
-
)
|
|
372
|
-
)
|
|
373
|
-
),
|
|
374
|
-
!hideRemainingLimit && typeof getByPath(currentLimit, 'RemainingAmount') === 'number' && React.createElement(
|
|
375
|
-
'div',
|
|
376
|
-
{ className: 'ResponsibleGamingWidget__timespan-row' },
|
|
377
|
-
isTime ? messages.get('message.responsiblegaming.remaining-time') : messages.get('message.responsiblegaming.remaining-limit'),
|
|
378
|
-
messages.getValue(currentLimit.RemainingAmount)
|
|
379
|
-
),
|
|
380
|
-
showCurrentValue && typeof getByPath(currentLimit, 'Amount') === 'number' && React.createElement(
|
|
381
|
-
'div',
|
|
382
|
-
{ className: 'ResponsibleGamingWidget__timespan-row' },
|
|
383
|
-
messages.get('message.responsiblegaming.current-limit'),
|
|
384
|
-
messages.getValue(currentLimit.Amount)
|
|
385
|
-
)
|
|
386
|
-
);
|
|
387
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
2
|
-
|
|
3
|
-
import getByPath from 'lodash/get';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Helper function to get values using currency and timespan
|
|
7
|
-
*/
|
|
8
|
-
export var getValues = function getValues(values, currency, timespan) {
|
|
9
|
-
values = getByPath(values, '[' + (currency || '').toUpperCase() + ']') || values;
|
|
10
|
-
return (Array.isArray(values) ? values : []).filter(function (v) {
|
|
11
|
-
return (typeof v === 'undefined' ? 'undefined' : _typeof(v)) === 'object' && v.timespan === timespan || typeof v === 'number';
|
|
12
|
-
}).map(function (v) {
|
|
13
|
-
return (typeof v === 'undefined' ? 'undefined' : _typeof(v)) === 'object' ? v.amount : v;
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export var convertTimeValues = function convertTimeValues(value, valueType) {
|
|
18
|
-
var convertedAmounts = {};
|
|
19
|
-
|
|
20
|
-
var minutes = valueType === 'hours' ? value * 60 : valueType === 'days' ? value * 24 * 60 : valueType === 'weeks' ? value * 24 * 7 * 60 : valueType === 'months' ? value * 24 * 30 * 60 : valueType === 'years' ? value * 24 * 365 * 60 : value;
|
|
21
|
-
|
|
22
|
-
var years = Math.floor(minutes / 525600);
|
|
23
|
-
var months = Math.floor(minutes % 525600 / 43200);
|
|
24
|
-
var weeks = Math.floor(minutes % 525600 % 43200 / 10080);
|
|
25
|
-
var days = Math.floor(minutes % 525600 % 43200 % 10080 / 1440);
|
|
26
|
-
var hours = Math.floor(minutes % 525600 % 43200 % 10080 % 1440 / 60);
|
|
27
|
-
minutes = Math.floor(minutes % 525600 % 43200 % 10080 % 1440 % 60);
|
|
28
|
-
|
|
29
|
-
convertedAmounts = {
|
|
30
|
-
years: years,
|
|
31
|
-
months: months,
|
|
32
|
-
weeks: weeks,
|
|
33
|
-
days: days,
|
|
34
|
-
hours: hours,
|
|
35
|
-
minutes: minutes
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
return convertedAmounts;
|
|
39
|
-
};
|