tg-core-components 5.2.1-cashier-result-balance-fix.0 → 5.2.2-links-in-checkbox.0

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.
Files changed (33) hide show
  1. package/es/components/AutocompleteInput/index.js +104 -0
  2. package/es/components/Input/BirthdateInput.js +3 -0
  3. package/es/components/Input/PhoneNumberInput.js +4 -1
  4. package/es/components/List/ListItem.js +7 -1
  5. package/es/components/common.js +5 -1
  6. package/es/index.js +2 -1
  7. package/es/misc/countryEmojiFlags.js +1 -0
  8. package/es/widgets/Cashier/Deposit/PaymentForm/NewTab.js +28 -0
  9. package/es/widgets/Cashier/Deposit/PaymentForm/index.js +6 -2
  10. package/es/widgets/CashierAccordion/Deposit/DepositWidget/index.js +4 -3
  11. package/es/widgets/CashierAccordion/Deposit/PaymentForm/NewTab.js +28 -0
  12. package/es/widgets/CashierAccordion/Deposit/PaymentForm/index.js +6 -2
  13. package/es/widgets/CashierAccordion/Payment/AccountSelection/index.js +6 -15
  14. package/es/widgets/CashierAccordion/Payment/CashierResult/index.js +4 -4
  15. package/es/widgets/HistoryWidget/index.js +15 -0
  16. package/es/widgets/ResponsibleGamingWidget/validate.js +5 -1
  17. package/lib/components/AutocompleteInput/index.js +118 -0
  18. package/lib/components/Input/BirthdateInput.js +3 -0
  19. package/lib/components/Input/PhoneNumberInput.js +4 -1
  20. package/lib/components/List/ListItem.js +10 -1
  21. package/lib/components/common.js +5 -1
  22. package/lib/index.js +8 -3
  23. package/lib/misc/countryEmojiFlags.js +1 -0
  24. package/lib/widgets/Cashier/Deposit/PaymentForm/NewTab.js +44 -0
  25. package/lib/widgets/Cashier/Deposit/PaymentForm/index.js +9 -2
  26. package/lib/widgets/CashierAccordion/Deposit/DepositWidget/index.js +4 -3
  27. package/lib/widgets/CashierAccordion/Deposit/PaymentForm/NewTab.js +44 -0
  28. package/lib/widgets/CashierAccordion/Deposit/PaymentForm/index.js +9 -2
  29. package/lib/widgets/CashierAccordion/Payment/AccountSelection/index.js +9 -15
  30. package/lib/widgets/CashierAccordion/Payment/CashierResult/index.js +4 -4
  31. package/lib/widgets/HistoryWidget/index.js +15 -0
  32. package/lib/widgets/ResponsibleGamingWidget/validate.js +5 -1
  33. package/package.json +2 -2
@@ -0,0 +1,104 @@
1
+ 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; };
2
+
3
+ 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; }
4
+
5
+ import React from 'react';
6
+ import { Input, useId, useValue, useFocus, useTouched, useAutofill, createClassName, statusIcons, flatObj } from '../common';
7
+ import cn from 'classnames';
8
+
9
+ var AutocompleteSuggestion = function AutocompleteSuggestion(_ref) {
10
+ var children = _ref.children,
11
+ value = _ref.value,
12
+ _onClick = _ref.onClick,
13
+ selected = _ref.selected,
14
+ classNames = _ref.classNames,
15
+ rest = _objectWithoutProperties(_ref, ['children', 'value', 'onClick', 'selected', 'classNames']);
16
+
17
+ return React.createElement(
18
+ 'div',
19
+ _extends({}, rest, {
20
+ className: cn(classNames, 'tg-autocomplete-input__suggestions__suggestion', {
21
+ 'tg-autocomplete-input__suggestions__suggestion--selected': selected
22
+ }),
23
+ onClick: function onClick() {
24
+ _onClick(value);
25
+ } }),
26
+ children
27
+ );
28
+ };
29
+
30
+ var AutocompleteInput = function AutocompleteInput(_ref2) {
31
+ var icon = _ref2.icon,
32
+ props = _objectWithoutProperties(_ref2, ['icon']);
33
+
34
+ var input = {
35
+ id: useId(),
36
+ value: useValue(props.value),
37
+ focus: useFocus(),
38
+ touched: useTouched(),
39
+ autofill: useAutofill()
40
+ };
41
+
42
+ var _onChange = function _onChange(e) {
43
+ return props.onChange && props.onChange(e, e.target.value);
44
+ };
45
+ var _onBlur = function _onBlur(e) {
46
+ return props.onBlur && props.onBlur(e, e.target.value);
47
+ };
48
+
49
+ var className = createClassName('tg-autocomplete-input', {
50
+ hasValue: input.value.hasValue,
51
+ hasLabel: Boolean(props.label),
52
+ hasFocus: input.focus.hasFocus,
53
+ hasTouched: input.touched.hasTouched,
54
+ hasAutofill: input.autofill.hasAutofill,
55
+ disabled: props.disabled,
56
+ status: props.status
57
+ });
58
+
59
+ return React.createElement(
60
+ 'div',
61
+ { className: cn(props.className, className) },
62
+ React.createElement(Input, _extends({}, props, flatObj(input), {
63
+ children: null,
64
+ autoComplete: 'off',
65
+ onChange: function onChange(e) {
66
+ if (typeof props.transform === 'function') {
67
+ e.target.value = props.transform(e.target.value);
68
+ }
69
+ input.value.onChange(e.target.value);
70
+ _onChange(e);
71
+ },
72
+ onFocus: function onFocus() {
73
+ input.focus.onFocus();
74
+ input.touched.onFocus();
75
+ },
76
+ onBlur: function onBlur(e) {
77
+ setTimeout(function () {
78
+ input.focus.onBlur();
79
+ _onBlur(e);
80
+ }, 500);
81
+ },
82
+ leadingLane: [icon].filter(function (i) {
83
+ return i;
84
+ }),
85
+ trailingLane: [statusIcons[props.status]].filter(function (i) {
86
+ return i;
87
+ })
88
+ })),
89
+ props.children.length > 0 && input.focus.hasFocus && React.createElement(
90
+ 'div',
91
+ { className: 'tg-autocomplete-input__suggestions' },
92
+ props.children
93
+ ),
94
+ React.createElement(
95
+ 'div',
96
+ { className: 'tg-autocomplete-input__status-text' },
97
+ props.statusText
98
+ )
99
+ );
100
+ };
101
+
102
+ AutocompleteInput.Suggestion = AutocompleteSuggestion;
103
+
104
+ export default AutocompleteInput;
@@ -81,6 +81,7 @@ var BirthdateInput = function BirthdateInput(props) {
81
81
  React.createElement(
82
82
  Select,
83
83
  _extends({}, flatObj(yearInput), {
84
+ autoFocus: props.autoFocus && !yearInput.value.hasValue,
84
85
  name: props.name + '_year',
85
86
  label: React.createElement(Translate, { id: 'label.year-of-birth', defaultMessage: 'Year' }),
86
87
  status: props.status,
@@ -108,6 +109,7 @@ var BirthdateInput = function BirthdateInput(props) {
108
109
  React.createElement(
109
110
  Select,
110
111
  _extends({}, flatObj(monthInput), {
112
+ autoFocus: props.autoFocus && yearInput.value.hasValue && !monthInput.value.hasValue,
111
113
  name: props.name + '_month',
112
114
  label: React.createElement(Translate, { id: 'label.month-of-birth', defaultMessage: 'Month' }),
113
115
  status: props.status,
@@ -135,6 +137,7 @@ var BirthdateInput = function BirthdateInput(props) {
135
137
  React.createElement(
136
138
  Select,
137
139
  _extends({}, flatObj(dayInput), {
140
+ autoFocus: props.autoFocus && yearInput.value.hasValue && monthInput.value.hasValue,
138
141
  name: props.name + '_day',
139
142
  label: React.createElement(Translate, { id: 'label.day-of-birth', defaultMessage: 'Day' }),
140
143
  status: props.status,
@@ -10,7 +10,9 @@ import cn from 'classnames';
10
10
  var PhoneNumberInput = function PhoneNumberInput(props) {
11
11
  var val = props.value || '';
12
12
 
13
- var callingCodeValue = ((props.callingCodes || []).find(function (c) {
13
+ var callingCodeValue = ((props.callingCodes || []).slice().sort(function (a, b) {
14
+ return b.value - a.value;
15
+ }).find(function (c) {
14
16
  return val.startsWith(c.value);
15
17
  }) || (props.callingCodes || [])[0] || {}).value || '';
16
18
  var phoneNumberValue = callingCodeValue ? val.replace(new RegExp('^' + callingCodeValue), '').replace(/^0*/, '') : val;
@@ -79,6 +81,7 @@ var PhoneNumberInput = function PhoneNumberInput(props) {
79
81
  })
80
82
  ),
81
83
  React.createElement(Input, _extends({}, flatObj(phoneNumberInput), {
84
+ autoFocus: props.autoFocus,
82
85
  type: 'tel',
83
86
  name: props.name + '_number',
84
87
  label: React.createElement(Translate, {
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import cn from 'classnames';
3
+ import Icon from '../../components/Icon';
3
4
 
4
5
  var ListItem = function ListItem(_ref) {
5
6
  var id = _ref.id,
@@ -23,7 +24,12 @@ var ListItem = function ListItem(_ref) {
23
24
  { className: 'info-item' },
24
25
  i
25
26
  );
26
- })
27
+ }),
28
+ React.createElement(
29
+ 'div',
30
+ { className: 'info-expand-icon' },
31
+ React.createElement(Icon, { icon: 'angle-down' })
32
+ )
27
33
  ),
28
34
  detail && React.createElement(
29
35
  'div',
@@ -204,7 +204,11 @@ var Checkbox = function Checkbox(_ref5) {
204
204
  })),
205
205
  React.createElement('div', { className: 'Checkbox__background' })
206
206
  ),
207
- React.createElement(
207
+ !React.isValidElement(label) ? React.createElement('label', {
208
+ className: 'Checkbox__label',
209
+ htmlFor: rest.id,
210
+ dangerouslySetInnerHTML: { __html: label }
211
+ }) : React.createElement(
208
212
  'label',
209
213
  { className: 'Checkbox__label', htmlFor: rest.id },
210
214
  label
package/es/index.js CHANGED
@@ -20,6 +20,7 @@ import List from './components/List';
20
20
  import Translate from './components/Translate';
21
21
  import Picture from './components/Picture';
22
22
  import Skeleton from './components/Skeleton';
23
+ import AutocompleteInput from './components/AutocompleteInput';
23
24
 
24
25
  // widgets
25
26
  import AccordionWidget from './widgets/AccordionWidget';
@@ -54,4 +55,4 @@ import VerifyAccordionWidget from './widgets/VerifyAccordionWidget';
54
55
  // misc
55
56
  import countryEmojiFlags from './misc/countryEmojiFlags';
56
57
 
57
- export { AcceptUpdatedTaC, Alert, Button, ButtonLoader, Checklist, Icon, Image, Input, InternalMessagesInbox, Loader, Money, Notification, Radio, Select, Single, Textarea, Uploader, AccordionWidget, AccountDetail, ActivateWidget, Balance, Bonus, Deposit, Withdraw, SignUp, ChangeUsername, ChangePassword, ResetPassword, RequestResetPassword, SignIn, Pagination, Settings, TableWidget, Verify, Subscriptions, CasinoHistoryTable, PaymentHistoryTable, SportsbookHistoryTable, DepositWidgetAccordion, WithdrawWidgetAccordion, ResponsibleGamingAccordion, ResponsibleGamingAccordionSignUp, ResponsibleGamingSingleSignUp, ResponsibleGamingWidget, List, VerifyAccordionWidget, Translate, Picture, countryEmojiFlags, Skeleton };
58
+ export { AcceptUpdatedTaC, Alert, Button, ButtonLoader, Checklist, Icon, Image, Input, InternalMessagesInbox, Loader, Money, Notification, Radio, Select, Single, Textarea, Uploader, AccordionWidget, AccountDetail, ActivateWidget, Balance, Bonus, Deposit, Withdraw, SignUp, ChangeUsername, ChangePassword, ResetPassword, RequestResetPassword, SignIn, Pagination, Settings, TableWidget, Verify, Subscriptions, CasinoHistoryTable, PaymentHistoryTable, SportsbookHistoryTable, DepositWidgetAccordion, WithdrawWidgetAccordion, ResponsibleGamingAccordion, ResponsibleGamingAccordionSignUp, ResponsibleGamingSingleSignUp, ResponsibleGamingWidget, List, VerifyAccordionWidget, Translate, Picture, countryEmojiFlags, Skeleton, AutocompleteInput };
@@ -93,6 +93,7 @@ export default {
93
93
  KI: '🇰🇮',
94
94
  KN: '🇰🇳',
95
95
  KR: '🇰🇷',
96
+ KY: '🇰🇾',
96
97
  KW: '🇰🇼',
97
98
  LA: '🇱🇦',
98
99
  LB: '🇱🇧',
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import Button from '../../../../components/Button';
3
+ import Translate from '../../../../components/Translate';
4
+
5
+ var NewTab = function NewTab(_ref) {
6
+ var url = _ref.url;
7
+
8
+ return React.createElement(
9
+ 'div',
10
+ { className: 'NewTab' },
11
+ React.createElement(Translate, {
12
+ tagName: 'p',
13
+ id: 'label.new-tab',
14
+ defaultMessage: 'A new tab is required in order to proceed, please press the button to continue...'
15
+ }),
16
+ React.createElement(
17
+ Button,
18
+ {
19
+ className: 'primary',
20
+ onClick: function onClick() {
21
+ window.open(url, '_blank');
22
+ } },
23
+ React.createElement(Translate, { id: 'action.open-tab', defaultMessage: 'Open new tab' })
24
+ )
25
+ );
26
+ };
27
+
28
+ export default NewTab;
@@ -13,6 +13,7 @@ import FramedComponent from '../../hoc/FramedComponent';
13
13
  import InjectedIframeHTML from './InjectedIframeHTML';
14
14
  import DynamicForm from './DynamicForm';
15
15
  import PaymentResult from './PaymentResult';
16
+ import NewTab from './NewTab';
16
17
  import flatten from 'lodash/flatten';
17
18
  import Translate from '../../../../components/Translate';
18
19
 
@@ -122,7 +123,8 @@ var PaymentForm = function (_Component) {
122
123
  data = _props.data,
123
124
  onClose = _props.onClose,
124
125
  onSuccess = _props.onSuccess,
125
- redirect = _props.redirect;
126
+ redirect = _props.redirect,
127
+ details = _props.details;
126
128
 
127
129
 
128
130
  if (!data.success) {
@@ -147,7 +149,9 @@ var PaymentForm = function (_Component) {
147
149
  frameBorder: 0
148
150
  };
149
151
 
150
- if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'POST' && data.redirectOutput.html == null) {
152
+ if (details && details.newTab) {
153
+ return React.createElement(NewTab, { url: data.redirectOutput.url });
154
+ } else if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'POST' && data.redirectOutput.html == null) {
151
155
  return React.createElement(FormWithIframe, _extends({
152
156
  frameProps: frameProps,
153
157
  target: redirect ? '_top' : frameId
@@ -168,7 +168,8 @@ var DepositWidget = function (_Component) {
168
168
  renderAllowBonusWarning = _props.renderAllowBonusWarning,
169
169
  paymentStats = _props.paymentStats,
170
170
  _props$shouldAutoFocu = _props.shouldAutoFocus,
171
- shouldAutoFocus = _props$shouldAutoFocu === undefined ? false : _props$shouldAutoFocu;
171
+ shouldAutoFocus = _props$shouldAutoFocu === undefined ? false : _props$shouldAutoFocu,
172
+ hideSelectedBonus = _props.hideSelectedBonus;
172
173
 
173
174
 
174
175
  var accountExclusions = payments.filter(function (provider) {
@@ -220,13 +221,13 @@ var DepositWidget = function (_Component) {
220
221
  bonuses: bonuses,
221
222
  onSelect: this.onSelectBonus,
222
223
  selectedBonus: selectedBonus
223
- }) : React.createElement(SelectedBonus, {
224
+ }) : !hideSelectedBonus ? React.createElement(SelectedBonus, {
224
225
  selectedBonus: selectedBonus,
225
226
  onClick: function onClick() {
226
227
  _this2.onSelectBonus('');
227
228
  _this2.setState({ showBonusSlider: true });
228
229
  }
229
- })),
230
+ }) : null),
230
231
  React.createElement(Form, {
231
232
  onSubmit: this.handleNextStep,
232
233
  initialValues: {
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import Button from '../../../../components/Button';
3
+ import Translate from '../../../../components/Translate';
4
+
5
+ var NewTab = function NewTab(_ref) {
6
+ var url = _ref.url;
7
+
8
+ return React.createElement(
9
+ 'div',
10
+ { className: 'NewTab' },
11
+ React.createElement(Translate, {
12
+ tagName: 'p',
13
+ id: 'label.new-tab',
14
+ defaultMessage: 'A new tab is required in order to proceed, please press the button to continue...'
15
+ }),
16
+ React.createElement(
17
+ Button,
18
+ {
19
+ className: 'primary',
20
+ onClick: function onClick() {
21
+ window.open(url, '_blank');
22
+ } },
23
+ React.createElement(Translate, { id: 'action.open-tab', defaultMessage: 'Open new tab' })
24
+ )
25
+ );
26
+ };
27
+
28
+ export default NewTab;
@@ -13,6 +13,7 @@ import FramedComponent from '../../hoc/FramedComponent';
13
13
  import InjectedIframeHTML from './InjectedIframeHTML';
14
14
  import DynamicForm from './DynamicForm';
15
15
  import PaymentResult from './PaymentResult';
16
+ import NewTab from './NewTab';
16
17
  import flatten from 'lodash/flatten';
17
18
  import Translate from '../../../../components/Translate';
18
19
 
@@ -81,7 +82,8 @@ var PaymentForm = function (_Component) {
81
82
  value: function render() {
82
83
  var _props = this.props,
83
84
  data = _props.data,
84
- onClose = _props.onClose;
85
+ onClose = _props.onClose,
86
+ details = _props.details;
85
87
 
86
88
  if (!data.success) {
87
89
  return React.createElement(PaymentError, { data: data, onClose: onClose });
@@ -100,7 +102,9 @@ var PaymentForm = function (_Component) {
100
102
  frameBorder: 0
101
103
  };
102
104
 
103
- if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'POST' && data.redirectOutput.html == null) {
105
+ if (details && details.newTab) {
106
+ return React.createElement(NewTab, { url: data.redirectOutput.url });
107
+ } else if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'POST' && data.redirectOutput.html == null) {
104
108
  return React.createElement(FormWithIframe, _extends({
105
109
  frameProps: frameProps,
106
110
  target: frameId
@@ -10,6 +10,7 @@ import React, { Component } from 'react';
10
10
  import { injectIntl } from 'react-intl';
11
11
  import Icon from '../../../../components/Icon';
12
12
  import translate from '../../../../lib/utils/translate';
13
+ import Select from '../../../../components/Select';
13
14
 
14
15
  var AccountSelection = function (_Component) {
15
16
  _inherits(AccountSelection, _Component);
@@ -49,14 +50,14 @@ var AccountSelection = function (_Component) {
49
50
 
50
51
  var accountOptions = accounts.map(function (account) {
51
52
  return React.createElement(
52
- 'option',
53
+ Select.Option,
53
54
  { value: account.accountId, key: account.accountId },
54
55
  account.type === 'creditcard' ? _this2.maskCreditCardNumber(account.maskedAccount) : account.maskedAccount
55
56
  );
56
57
  });
57
58
  if (Boolean(canAddAccount)) {
58
59
  accountOptions.push(React.createElement(
59
- 'option',
60
+ Select.Option,
60
61
  { value: 'new-account' },
61
62
  translate({
62
63
  id: 'action.cashier.add-new-account',
@@ -76,23 +77,13 @@ var AccountSelection = function (_Component) {
76
77
  return React.createElement(
77
78
  'div',
78
79
  { className: 'account-selection' },
79
- icon && React.createElement(
80
- 'div',
81
- { className: 'account-icon' },
82
- React.createElement(Icon, { icon: icon })
83
- ),
84
80
  React.createElement(
85
- 'select',
81
+ Select,
86
82
  {
87
- className: icon && 'with-icon',
88
83
  value: selectedAccount.accountId || 'new-account',
89
- onChange: this.handleChange },
84
+ onChange: this.handleChange,
85
+ icon: icon ? React.createElement(Icon, { icon: icon }) : null },
90
86
  accountOptions
91
- ),
92
- React.createElement(
93
- 'div',
94
- { className: 'caret-down' },
95
- React.createElement(Icon, { icon: 'caret-down' })
96
87
  )
97
88
  );
98
89
  }
@@ -53,21 +53,21 @@ var CashierResult = function CashierResult(_ref) {
53
53
  defaultMessage: 'Your new balance is:'
54
54
  })
55
55
  ),
56
- wallet && React.createElement(
56
+ wallet.data && React.createElement(
57
57
  Fragment,
58
58
  null,
59
59
  React.createElement(
60
60
  'div',
61
61
  { className: 'payment-result-balance' },
62
62
  React.createElement(FormattedNumber, {
63
- value: wallet.Total.Balance,
63
+ value: wallet.data.Total.Balance,
64
64
  style: 'currency',
65
65
  currency: currency,
66
66
  minimumFractionDigits: 2,
67
67
  maximumFractionDigits: 2
68
68
  })
69
69
  ),
70
- wallet.Bonus.Balance > 0 && React.createElement(
70
+ wallet.data.Bonus.Balance > 0 && React.createElement(
71
71
  'div',
72
72
  { className: 'payment-result-bonus' },
73
73
  React.createElement(Translate, {
@@ -75,7 +75,7 @@ var CashierResult = function CashierResult(_ref) {
75
75
  defaultMessage: '(Of which {amount} is bonus money)',
76
76
  values: {
77
77
  amount: React.createElement(FormattedNumber, {
78
- value: wallet.Bonus.Balance,
78
+ value: wallet.data.Bonus.Balance,
79
79
  style: 'currency',
80
80
  currency: currency,
81
81
  minimumFractionDigits: 2,
@@ -19,6 +19,8 @@ import Translate from '../../components/Translate';
19
19
  import { getMessage } from './message';
20
20
 
21
21
  var MILISECONDS = {
22
+ IN_A_SECOND: 1000,
23
+ IN_A_MINUTE: 60000,
22
24
  IN_AN_HOUR: 3600000,
23
25
  IN_A_DAY: 86400000,
24
26
  IN_A_WEEK: 604800000,
@@ -31,6 +33,19 @@ var selectUnit = function selectUnit(from) {
31
33
  var ms = now - from;
32
34
 
33
35
  switch (true) {
36
+ case MILISECONDS.IN_A_SECOND < ms && ms < MILISECONDS.IN_A_MINUTE:
37
+ return {
38
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_SECOND),
39
+ unit: 'second',
40
+ updateIntervalInSeconds: 1
41
+ };
42
+
43
+ case MILISECONDS.IN_A_MINUTE < ms && ms < MILISECONDS.IN_AN_HOUR:
44
+ return {
45
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_MINUTE),
46
+ unit: 'minute'
47
+ };
48
+
34
49
  case MILISECONDS.IN_AN_HOUR < ms && ms < MILISECONDS.IN_A_DAY:
35
50
  return {
36
51
  value: -1 * Math.floor(ms / MILISECONDS.IN_AN_HOUR),
@@ -38,6 +38,10 @@ var validate = function validate(_ref) {
38
38
  return !t.newLimit || getByPath(t, 'newLimit.Amount') === getByPath(t, 'currentLimit.Amount');
39
39
  });
40
40
 
41
+ var newMonthlyDepositLimit = timespans.find(function (t) {
42
+ return getByPath(t, 'newLimit.Type') === 'Deposit' && t.timespan === 30;
43
+ });
44
+
41
45
  /**
42
46
  * Compose jurisdictions with rules
43
47
  */
@@ -45,7 +49,7 @@ var validate = function validate(_ref) {
45
49
  return !this['insufficient-limit-count'] && !(this['limit-increase-blocked'] && isIncreasingLimit) && !(this['limit-remove-blocked'] && isRemovingLimit);
46
50
  }), _common);
47
51
  var mga = {};
48
- var sga = (_sga = {}, _defineProperty(_sga, 'insufficient-limit-count', type === 'Deposit' && limitCount < 3), _defineProperty(_sga, 'limit-remove-blocked', type === 'Deposit'), _sga);
52
+ var sga = (_sga = {}, _defineProperty(_sga, 'insufficient-limit-count', type === 'Deposit' && limitCount < 3), _defineProperty(_sga, 'limit-remove-blocked', type === 'Deposit'), _defineProperty(_sga, 'monthly-deposit-above-10k', getByPath(newMonthlyDepositLimit, 'newLimit.Amount') >= 10000), _sga);
49
53
  var uk = {};
50
54
  var dga = (_dga = {}, _defineProperty(_dga, 'insufficient-limit-count', type === 'Deposit' && limitCount < 1), _defineProperty(_dga, 'limit-remove-blocked', type === 'Deposit' && limitCount <= 1), _dga);
51
55
  var es = (_es = {}, _defineProperty(_es, 'insufficient-limit-count', type === 'Deposit' && limitCount < 3), _defineProperty(_es, 'limit-remove-blocked', type === 'Deposit'), _defineProperty(_es, 'limit-increase-blocked', type === 'Deposit' && limitIncreaseInfo.HasDepositLimitIncreaseBlock), _defineProperty(_es, 'support-pending', type === 'Deposit' && limitIncreaseInfo.HasValidPgsiScore && limitIncreaseInfo.RequiresSupportApproval), _defineProperty(_es, 'requires-self-test', isIncreasingLimit && type === 'Deposit' && !limitIncreaseInfo.HasDepositLimitIncreaseBlock), _defineProperty(_es, 'self-test-fail-cooldown', type === 'Deposit' && !limitIncreaseInfo.HasValidPgsiScore && limitIncreaseInfo.HasDepositLimitIncreaseBlock), _es);
@@ -0,0 +1,118 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ 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; };
8
+
9
+ var _react = require('react');
10
+
11
+ var _react2 = _interopRequireDefault(_react);
12
+
13
+ var _common = require('../common');
14
+
15
+ var _classnames = require('classnames');
16
+
17
+ var _classnames2 = _interopRequireDefault(_classnames);
18
+
19
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
+
21
+ 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; }
22
+
23
+ var AutocompleteSuggestion = function AutocompleteSuggestion(_ref) {
24
+ var children = _ref.children,
25
+ value = _ref.value,
26
+ _onClick = _ref.onClick,
27
+ selected = _ref.selected,
28
+ classNames = _ref.classNames,
29
+ rest = _objectWithoutProperties(_ref, ['children', 'value', 'onClick', 'selected', 'classNames']);
30
+
31
+ return _react2.default.createElement(
32
+ 'div',
33
+ _extends({}, rest, {
34
+ className: (0, _classnames2.default)(classNames, 'tg-autocomplete-input__suggestions__suggestion', {
35
+ 'tg-autocomplete-input__suggestions__suggestion--selected': selected
36
+ }),
37
+ onClick: function onClick() {
38
+ _onClick(value);
39
+ } }),
40
+ children
41
+ );
42
+ };
43
+
44
+ var AutocompleteInput = function AutocompleteInput(_ref2) {
45
+ var icon = _ref2.icon,
46
+ props = _objectWithoutProperties(_ref2, ['icon']);
47
+
48
+ var input = {
49
+ id: (0, _common.useId)(),
50
+ value: (0, _common.useValue)(props.value),
51
+ focus: (0, _common.useFocus)(),
52
+ touched: (0, _common.useTouched)(),
53
+ autofill: (0, _common.useAutofill)()
54
+ };
55
+
56
+ var _onChange = function _onChange(e) {
57
+ return props.onChange && props.onChange(e, e.target.value);
58
+ };
59
+ var _onBlur = function _onBlur(e) {
60
+ return props.onBlur && props.onBlur(e, e.target.value);
61
+ };
62
+
63
+ var className = (0, _common.createClassName)('tg-autocomplete-input', {
64
+ hasValue: input.value.hasValue,
65
+ hasLabel: Boolean(props.label),
66
+ hasFocus: input.focus.hasFocus,
67
+ hasTouched: input.touched.hasTouched,
68
+ hasAutofill: input.autofill.hasAutofill,
69
+ disabled: props.disabled,
70
+ status: props.status
71
+ });
72
+
73
+ return _react2.default.createElement(
74
+ 'div',
75
+ { className: (0, _classnames2.default)(props.className, className) },
76
+ _react2.default.createElement(_common.Input, _extends({}, props, (0, _common.flatObj)(input), {
77
+ children: null,
78
+ autoComplete: 'off',
79
+ onChange: function onChange(e) {
80
+ if (typeof props.transform === 'function') {
81
+ e.target.value = props.transform(e.target.value);
82
+ }
83
+ input.value.onChange(e.target.value);
84
+ _onChange(e);
85
+ },
86
+ onFocus: function onFocus() {
87
+ input.focus.onFocus();
88
+ input.touched.onFocus();
89
+ },
90
+ onBlur: function onBlur(e) {
91
+ setTimeout(function () {
92
+ input.focus.onBlur();
93
+ _onBlur(e);
94
+ }, 500);
95
+ },
96
+ leadingLane: [icon].filter(function (i) {
97
+ return i;
98
+ }),
99
+ trailingLane: [_common.statusIcons[props.status]].filter(function (i) {
100
+ return i;
101
+ })
102
+ })),
103
+ props.children.length > 0 && input.focus.hasFocus && _react2.default.createElement(
104
+ 'div',
105
+ { className: 'tg-autocomplete-input__suggestions' },
106
+ props.children
107
+ ),
108
+ _react2.default.createElement(
109
+ 'div',
110
+ { className: 'tg-autocomplete-input__status-text' },
111
+ props.statusText
112
+ )
113
+ );
114
+ };
115
+
116
+ AutocompleteInput.Suggestion = AutocompleteSuggestion;
117
+
118
+ exports.default = AutocompleteInput;
@@ -102,6 +102,7 @@ var BirthdateInput = function BirthdateInput(props) {
102
102
  _react2.default.createElement(
103
103
  _common.Select,
104
104
  _extends({}, (0, _common.flatObj)(yearInput), {
105
+ autoFocus: props.autoFocus && !yearInput.value.hasValue,
105
106
  name: props.name + '_year',
106
107
  label: _react2.default.createElement(_Translate2.default, { id: 'label.year-of-birth', defaultMessage: 'Year' }),
107
108
  status: props.status,
@@ -129,6 +130,7 @@ var BirthdateInput = function BirthdateInput(props) {
129
130
  _react2.default.createElement(
130
131
  _common.Select,
131
132
  _extends({}, (0, _common.flatObj)(monthInput), {
133
+ autoFocus: props.autoFocus && yearInput.value.hasValue && !monthInput.value.hasValue,
132
134
  name: props.name + '_month',
133
135
  label: _react2.default.createElement(_Translate2.default, { id: 'label.month-of-birth', defaultMessage: 'Month' }),
134
136
  status: props.status,
@@ -156,6 +158,7 @@ var BirthdateInput = function BirthdateInput(props) {
156
158
  _react2.default.createElement(
157
159
  _common.Select,
158
160
  _extends({}, (0, _common.flatObj)(dayInput), {
161
+ autoFocus: props.autoFocus && yearInput.value.hasValue && monthInput.value.hasValue,
159
162
  name: props.name + '_day',
160
163
  label: _react2.default.createElement(_Translate2.default, { id: 'label.day-of-birth', defaultMessage: 'Day' }),
161
164
  status: props.status,
@@ -27,7 +27,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
27
27
  var PhoneNumberInput = function PhoneNumberInput(props) {
28
28
  var val = props.value || '';
29
29
 
30
- var callingCodeValue = ((props.callingCodes || []).find(function (c) {
30
+ var callingCodeValue = ((props.callingCodes || []).slice().sort(function (a, b) {
31
+ return b.value - a.value;
32
+ }).find(function (c) {
31
33
  return val.startsWith(c.value);
32
34
  }) || (props.callingCodes || [])[0] || {}).value || '';
33
35
  var phoneNumberValue = callingCodeValue ? val.replace(new RegExp('^' + callingCodeValue), '').replace(/^0*/, '') : val;
@@ -96,6 +98,7 @@ var PhoneNumberInput = function PhoneNumberInput(props) {
96
98
  })
97
99
  ),
98
100
  _react2.default.createElement(_common.Input, _extends({}, (0, _common.flatObj)(phoneNumberInput), {
101
+ autoFocus: props.autoFocus,
99
102
  type: 'tel',
100
103
  name: props.name + '_number',
101
104
  label: _react2.default.createElement(_Translate2.default, {
@@ -12,6 +12,10 @@ var _classnames = require('classnames');
12
12
 
13
13
  var _classnames2 = _interopRequireDefault(_classnames);
14
14
 
15
+ var _Icon = require('../../components/Icon');
16
+
17
+ var _Icon2 = _interopRequireDefault(_Icon);
18
+
15
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
20
 
17
21
  var ListItem = function ListItem(_ref) {
@@ -36,7 +40,12 @@ var ListItem = function ListItem(_ref) {
36
40
  { className: 'info-item' },
37
41
  i
38
42
  );
39
- })
43
+ }),
44
+ _react2.default.createElement(
45
+ 'div',
46
+ { className: 'info-expand-icon' },
47
+ _react2.default.createElement(_Icon2.default, { icon: 'angle-down' })
48
+ )
40
49
  ),
41
50
  detail && _react2.default.createElement(
42
51
  'div',
@@ -224,7 +224,11 @@ var Checkbox = function Checkbox(_ref5) {
224
224
  })),
225
225
  _react2.default.createElement('div', { className: 'Checkbox__background' })
226
226
  ),
227
- _react2.default.createElement(
227
+ !_react2.default.isValidElement(label) ? _react2.default.createElement('label', {
228
+ className: 'Checkbox__label',
229
+ htmlFor: rest.id,
230
+ dangerouslySetInnerHTML: { __html: label }
231
+ }) : _react2.default.createElement(
228
232
  'label',
229
233
  { className: 'Checkbox__label', htmlFor: rest.id },
230
234
  label
package/lib/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Skeleton = exports.countryEmojiFlags = exports.Picture = exports.Translate = exports.VerifyAccordionWidget = exports.List = exports.ResponsibleGamingWidget = exports.ResponsibleGamingSingleSignUp = exports.ResponsibleGamingAccordionSignUp = exports.ResponsibleGamingAccordion = exports.WithdrawWidgetAccordion = exports.DepositWidgetAccordion = exports.SportsbookHistoryTable = exports.PaymentHistoryTable = exports.CasinoHistoryTable = exports.Subscriptions = exports.Verify = exports.TableWidget = exports.Settings = exports.Pagination = exports.SignIn = exports.RequestResetPassword = exports.ResetPassword = exports.ChangePassword = exports.ChangeUsername = exports.SignUp = exports.Withdraw = exports.Deposit = exports.Bonus = exports.Balance = exports.ActivateWidget = exports.AccountDetail = exports.AccordionWidget = exports.Uploader = exports.Textarea = exports.Single = exports.Select = exports.Radio = exports.Notification = exports.Money = exports.Loader = exports.InternalMessagesInbox = exports.Input = exports.Image = exports.Icon = exports.Checklist = exports.ButtonLoader = exports.Button = exports.Alert = exports.AcceptUpdatedTaC = undefined;
6
+ exports.AutocompleteInput = exports.Skeleton = exports.countryEmojiFlags = exports.Picture = exports.Translate = exports.VerifyAccordionWidget = exports.List = exports.ResponsibleGamingWidget = exports.ResponsibleGamingSingleSignUp = exports.ResponsibleGamingAccordionSignUp = exports.ResponsibleGamingAccordion = exports.WithdrawWidgetAccordion = exports.DepositWidgetAccordion = exports.SportsbookHistoryTable = exports.PaymentHistoryTable = exports.CasinoHistoryTable = exports.Subscriptions = exports.Verify = exports.TableWidget = exports.Settings = exports.Pagination = exports.SignIn = exports.RequestResetPassword = exports.ResetPassword = exports.ChangePassword = exports.ChangeUsername = exports.SignUp = exports.Withdraw = exports.Deposit = exports.Bonus = exports.Balance = exports.ActivateWidget = exports.AccountDetail = exports.AccordionWidget = exports.Uploader = exports.Textarea = exports.Single = exports.Select = exports.Radio = exports.Notification = exports.Money = exports.Loader = exports.InternalMessagesInbox = exports.Input = exports.Image = exports.Icon = exports.Checklist = exports.ButtonLoader = exports.Button = exports.Alert = exports.AcceptUpdatedTaC = undefined;
7
7
 
8
8
  var _AcceptUpdatedTaC = require('./components/AcceptUpdatedTaC');
9
9
 
@@ -89,6 +89,10 @@ var _Skeleton = require('./components/Skeleton');
89
89
 
90
90
  var _Skeleton2 = _interopRequireDefault(_Skeleton);
91
91
 
92
+ var _AutocompleteInput = require('./components/AutocompleteInput');
93
+
94
+ var _AutocompleteInput2 = _interopRequireDefault(_AutocompleteInput);
95
+
92
96
  var _AccordionWidget = require('./widgets/AccordionWidget');
93
97
 
94
98
  var _AccordionWidget2 = _interopRequireDefault(_AccordionWidget);
@@ -207,7 +211,6 @@ var _countryEmojiFlags2 = _interopRequireDefault(_countryEmojiFlags);
207
211
 
208
212
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
209
213
 
210
- // components
211
214
  exports.AcceptUpdatedTaC = _AcceptUpdatedTaC2.default;
212
215
  exports.Alert = _Alert2.default;
213
216
  exports.Button = _Button2.default;
@@ -258,8 +261,10 @@ exports.Translate = _Translate2.default;
258
261
  exports.Picture = _Picture2.default;
259
262
  exports.countryEmojiFlags = _countryEmojiFlags2.default;
260
263
  exports.Skeleton = _Skeleton2.default;
264
+ exports.AutocompleteInput = _AutocompleteInput2.default;
261
265
 
262
266
  // misc
263
267
 
264
268
 
265
- // widgets
269
+ // widgets
270
+ // components
@@ -98,6 +98,7 @@ exports.default = {
98
98
  KI: '🇰🇮',
99
99
  KN: '🇰🇳',
100
100
  KR: '🇰🇷',
101
+ KY: '🇰🇾',
101
102
  KW: '🇰🇼',
102
103
  LA: '🇱🇦',
103
104
  LB: '🇱🇧',
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _react = require('react');
8
+
9
+ var _react2 = _interopRequireDefault(_react);
10
+
11
+ var _Button = require('../../../../components/Button');
12
+
13
+ var _Button2 = _interopRequireDefault(_Button);
14
+
15
+ var _Translate = require('../../../../components/Translate');
16
+
17
+ var _Translate2 = _interopRequireDefault(_Translate);
18
+
19
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
+
21
+ var NewTab = function NewTab(_ref) {
22
+ var url = _ref.url;
23
+
24
+ return _react2.default.createElement(
25
+ 'div',
26
+ { className: 'NewTab' },
27
+ _react2.default.createElement(_Translate2.default, {
28
+ tagName: 'p',
29
+ id: 'label.new-tab',
30
+ defaultMessage: 'A new tab is required in order to proceed, please press the button to continue...'
31
+ }),
32
+ _react2.default.createElement(
33
+ _Button2.default,
34
+ {
35
+ className: 'primary',
36
+ onClick: function onClick() {
37
+ window.open(url, '_blank');
38
+ } },
39
+ _react2.default.createElement(_Translate2.default, { id: 'action.open-tab', defaultMessage: 'Open new tab' })
40
+ )
41
+ );
42
+ };
43
+
44
+ exports.default = NewTab;
@@ -29,6 +29,10 @@ var _PaymentResult = require('./PaymentResult');
29
29
 
30
30
  var _PaymentResult2 = _interopRequireDefault(_PaymentResult);
31
31
 
32
+ var _NewTab = require('./NewTab');
33
+
34
+ var _NewTab2 = _interopRequireDefault(_NewTab);
35
+
32
36
  var _flatten = require('lodash/flatten');
33
37
 
34
38
  var _flatten2 = _interopRequireDefault(_flatten);
@@ -151,7 +155,8 @@ var PaymentForm = function (_Component) {
151
155
  data = _props.data,
152
156
  onClose = _props.onClose,
153
157
  onSuccess = _props.onSuccess,
154
- redirect = _props.redirect;
158
+ redirect = _props.redirect,
159
+ details = _props.details;
155
160
 
156
161
 
157
162
  if (!data.success) {
@@ -176,7 +181,9 @@ var PaymentForm = function (_Component) {
176
181
  frameBorder: 0
177
182
  };
178
183
 
179
- if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'POST' && data.redirectOutput.html == null) {
184
+ if (details && details.newTab) {
185
+ return _react2.default.createElement(_NewTab2.default, { url: data.redirectOutput.url });
186
+ } else if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'POST' && data.redirectOutput.html == null) {
180
187
  return _react2.default.createElement(FormWithIframe, _extends({
181
188
  frameProps: frameProps,
182
189
  target: redirect ? '_top' : frameId
@@ -233,7 +233,8 @@ var DepositWidget = function (_Component) {
233
233
  renderAllowBonusWarning = _props.renderAllowBonusWarning,
234
234
  paymentStats = _props.paymentStats,
235
235
  _props$shouldAutoFocu = _props.shouldAutoFocus,
236
- shouldAutoFocus = _props$shouldAutoFocu === undefined ? false : _props$shouldAutoFocu;
236
+ shouldAutoFocus = _props$shouldAutoFocu === undefined ? false : _props$shouldAutoFocu,
237
+ hideSelectedBonus = _props.hideSelectedBonus;
237
238
 
238
239
 
239
240
  var accountExclusions = payments.filter(function (provider) {
@@ -285,13 +286,13 @@ var DepositWidget = function (_Component) {
285
286
  bonuses: bonuses,
286
287
  onSelect: this.onSelectBonus,
287
288
  selectedBonus: selectedBonus
288
- }) : _react2.default.createElement(SelectedBonus, {
289
+ }) : !hideSelectedBonus ? _react2.default.createElement(SelectedBonus, {
289
290
  selectedBonus: selectedBonus,
290
291
  onClick: function onClick() {
291
292
  _this2.onSelectBonus('');
292
293
  _this2.setState({ showBonusSlider: true });
293
294
  }
294
- })),
295
+ }) : null),
295
296
  _react2.default.createElement(_reactFinalForm.Form, {
296
297
  onSubmit: this.handleNextStep,
297
298
  initialValues: {
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _react = require('react');
8
+
9
+ var _react2 = _interopRequireDefault(_react);
10
+
11
+ var _Button = require('../../../../components/Button');
12
+
13
+ var _Button2 = _interopRequireDefault(_Button);
14
+
15
+ var _Translate = require('../../../../components/Translate');
16
+
17
+ var _Translate2 = _interopRequireDefault(_Translate);
18
+
19
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
+
21
+ var NewTab = function NewTab(_ref) {
22
+ var url = _ref.url;
23
+
24
+ return _react2.default.createElement(
25
+ 'div',
26
+ { className: 'NewTab' },
27
+ _react2.default.createElement(_Translate2.default, {
28
+ tagName: 'p',
29
+ id: 'label.new-tab',
30
+ defaultMessage: 'A new tab is required in order to proceed, please press the button to continue...'
31
+ }),
32
+ _react2.default.createElement(
33
+ _Button2.default,
34
+ {
35
+ className: 'primary',
36
+ onClick: function onClick() {
37
+ window.open(url, '_blank');
38
+ } },
39
+ _react2.default.createElement(_Translate2.default, { id: 'action.open-tab', defaultMessage: 'Open new tab' })
40
+ )
41
+ );
42
+ };
43
+
44
+ exports.default = NewTab;
@@ -29,6 +29,10 @@ var _PaymentResult = require('./PaymentResult');
29
29
 
30
30
  var _PaymentResult2 = _interopRequireDefault(_PaymentResult);
31
31
 
32
+ var _NewTab = require('./NewTab');
33
+
34
+ var _NewTab2 = _interopRequireDefault(_NewTab);
35
+
32
36
  var _flatten = require('lodash/flatten');
33
37
 
34
38
  var _flatten2 = _interopRequireDefault(_flatten);
@@ -110,7 +114,8 @@ var PaymentForm = function (_Component) {
110
114
  value: function render() {
111
115
  var _props = this.props,
112
116
  data = _props.data,
113
- onClose = _props.onClose;
117
+ onClose = _props.onClose,
118
+ details = _props.details;
114
119
 
115
120
  if (!data.success) {
116
121
  return _react2.default.createElement(PaymentError, { data: data, onClose: onClose });
@@ -129,7 +134,9 @@ var PaymentForm = function (_Component) {
129
134
  frameBorder: 0
130
135
  };
131
136
 
132
- if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'POST' && data.redirectOutput.html == null) {
137
+ if (details && details.newTab) {
138
+ return _react2.default.createElement(_NewTab2.default, { url: data.redirectOutput.url });
139
+ } else if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'POST' && data.redirectOutput.html == null) {
133
140
  return _react2.default.createElement(FormWithIframe, _extends({
134
141
  frameProps: frameProps,
135
142
  target: frameId
@@ -20,6 +20,10 @@ var _translate = require('../../../../lib/utils/translate');
20
20
 
21
21
  var _translate2 = _interopRequireDefault(_translate);
22
22
 
23
+ var _Select = require('../../../../components/Select');
24
+
25
+ var _Select2 = _interopRequireDefault(_Select);
26
+
23
27
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
28
 
25
29
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -66,14 +70,14 @@ var AccountSelection = function (_Component) {
66
70
 
67
71
  var accountOptions = accounts.map(function (account) {
68
72
  return _react2.default.createElement(
69
- 'option',
73
+ _Select2.default.Option,
70
74
  { value: account.accountId, key: account.accountId },
71
75
  account.type === 'creditcard' ? _this2.maskCreditCardNumber(account.maskedAccount) : account.maskedAccount
72
76
  );
73
77
  });
74
78
  if (Boolean(canAddAccount)) {
75
79
  accountOptions.push(_react2.default.createElement(
76
- 'option',
80
+ _Select2.default.Option,
77
81
  { value: 'new-account' },
78
82
  (0, _translate2.default)({
79
83
  id: 'action.cashier.add-new-account',
@@ -93,23 +97,13 @@ var AccountSelection = function (_Component) {
93
97
  return _react2.default.createElement(
94
98
  'div',
95
99
  { className: 'account-selection' },
96
- icon && _react2.default.createElement(
97
- 'div',
98
- { className: 'account-icon' },
99
- _react2.default.createElement(_Icon2.default, { icon: icon })
100
- ),
101
100
  _react2.default.createElement(
102
- 'select',
101
+ _Select2.default,
103
102
  {
104
- className: icon && 'with-icon',
105
103
  value: selectedAccount.accountId || 'new-account',
106
- onChange: this.handleChange },
104
+ onChange: this.handleChange,
105
+ icon: icon ? _react2.default.createElement(_Icon2.default, { icon: icon }) : null },
107
106
  accountOptions
108
- ),
109
- _react2.default.createElement(
110
- 'div',
111
- { className: 'caret-down' },
112
- _react2.default.createElement(_Icon2.default, { icon: 'caret-down' })
113
107
  )
114
108
  );
115
109
  }
@@ -76,21 +76,21 @@ var CashierResult = function CashierResult(_ref) {
76
76
  defaultMessage: 'Your new balance is:'
77
77
  })
78
78
  ),
79
- wallet && _react2.default.createElement(
79
+ wallet.data && _react2.default.createElement(
80
80
  _react.Fragment,
81
81
  null,
82
82
  _react2.default.createElement(
83
83
  'div',
84
84
  { className: 'payment-result-balance' },
85
85
  _react2.default.createElement(_reactIntl.FormattedNumber, {
86
- value: wallet.Total.Balance,
86
+ value: wallet.data.Total.Balance,
87
87
  style: 'currency',
88
88
  currency: currency,
89
89
  minimumFractionDigits: 2,
90
90
  maximumFractionDigits: 2
91
91
  })
92
92
  ),
93
- wallet.Bonus.Balance > 0 && _react2.default.createElement(
93
+ wallet.data.Bonus.Balance > 0 && _react2.default.createElement(
94
94
  'div',
95
95
  { className: 'payment-result-bonus' },
96
96
  _react2.default.createElement(_Translate2.default, {
@@ -98,7 +98,7 @@ var CashierResult = function CashierResult(_ref) {
98
98
  defaultMessage: '(Of which {amount} is bonus money)',
99
99
  values: {
100
100
  amount: _react2.default.createElement(_reactIntl.FormattedNumber, {
101
- value: wallet.Bonus.Balance,
101
+ value: wallet.data.Bonus.Balance,
102
102
  style: 'currency',
103
103
  currency: currency,
104
104
  minimumFractionDigits: 2,
@@ -53,6 +53,8 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
53
53
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
54
54
 
55
55
  var MILISECONDS = {
56
+ IN_A_SECOND: 1000,
57
+ IN_A_MINUTE: 60000,
56
58
  IN_AN_HOUR: 3600000,
57
59
  IN_A_DAY: 86400000,
58
60
  IN_A_WEEK: 604800000,
@@ -65,6 +67,19 @@ var selectUnit = function selectUnit(from) {
65
67
  var ms = now - from;
66
68
 
67
69
  switch (true) {
70
+ case MILISECONDS.IN_A_SECOND < ms && ms < MILISECONDS.IN_A_MINUTE:
71
+ return {
72
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_SECOND),
73
+ unit: 'second',
74
+ updateIntervalInSeconds: 1
75
+ };
76
+
77
+ case MILISECONDS.IN_A_MINUTE < ms && ms < MILISECONDS.IN_AN_HOUR:
78
+ return {
79
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_MINUTE),
80
+ unit: 'minute'
81
+ };
82
+
68
83
  case MILISECONDS.IN_AN_HOUR < ms && ms < MILISECONDS.IN_A_DAY:
69
84
  return {
70
85
  value: -1 * Math.floor(ms / MILISECONDS.IN_AN_HOUR),
@@ -48,6 +48,10 @@ var validate = function validate(_ref) {
48
48
  return !t.newLimit || (0, _get2.default)(t, 'newLimit.Amount') === (0, _get2.default)(t, 'currentLimit.Amount');
49
49
  });
50
50
 
51
+ var newMonthlyDepositLimit = timespans.find(function (t) {
52
+ return (0, _get2.default)(t, 'newLimit.Type') === 'Deposit' && t.timespan === 30;
53
+ });
54
+
51
55
  /**
52
56
  * Compose jurisdictions with rules
53
57
  */
@@ -55,7 +59,7 @@ var validate = function validate(_ref) {
55
59
  return !this['insufficient-limit-count'] && !(this['limit-increase-blocked'] && isIncreasingLimit) && !(this['limit-remove-blocked'] && isRemovingLimit);
56
60
  }), _common);
57
61
  var mga = {};
58
- var sga = (_sga = {}, _defineProperty(_sga, 'insufficient-limit-count', type === 'Deposit' && limitCount < 3), _defineProperty(_sga, 'limit-remove-blocked', type === 'Deposit'), _sga);
62
+ var sga = (_sga = {}, _defineProperty(_sga, 'insufficient-limit-count', type === 'Deposit' && limitCount < 3), _defineProperty(_sga, 'limit-remove-blocked', type === 'Deposit'), _defineProperty(_sga, 'monthly-deposit-above-10k', (0, _get2.default)(newMonthlyDepositLimit, 'newLimit.Amount') >= 10000), _sga);
59
63
  var uk = {};
60
64
  var dga = (_dga = {}, _defineProperty(_dga, 'insufficient-limit-count', type === 'Deposit' && limitCount < 1), _defineProperty(_dga, 'limit-remove-blocked', type === 'Deposit' && limitCount <= 1), _dga);
61
65
  var es = (_es = {}, _defineProperty(_es, 'insufficient-limit-count', type === 'Deposit' && limitCount < 3), _defineProperty(_es, 'limit-remove-blocked', type === 'Deposit'), _defineProperty(_es, 'limit-increase-blocked', type === 'Deposit' && limitIncreaseInfo.HasDepositLimitIncreaseBlock), _defineProperty(_es, 'support-pending', type === 'Deposit' && limitIncreaseInfo.HasValidPgsiScore && limitIncreaseInfo.RequiresSupportApproval), _defineProperty(_es, 'requires-self-test', isIncreasingLimit && type === 'Deposit' && !limitIncreaseInfo.HasDepositLimitIncreaseBlock), _defineProperty(_es, 'self-test-fail-cooldown', type === 'Deposit' && !limitIncreaseInfo.HasValidPgsiScore && limitIncreaseInfo.HasDepositLimitIncreaseBlock), _es);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tg-core-components",
3
- "version": "5.2.1-cashier-result-balance-fix.0",
3
+ "version": "5.2.2-links-in-checkbox.0",
4
4
  "description": "tg-core-components",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -76,5 +76,5 @@
76
76
  "webpack": "^3.0.0",
77
77
  "webpack-blocks": "^1.0.0"
78
78
  },
79
- "gitHead": "f746cf44a2e2bc2041693c6433534f6f597e47bd"
79
+ "gitHead": "f2fa837022d2882fb887954f5d5f10a889b9c1d6"
80
80
  }