tg-core-components 6.1.16 → 6.1.19-BT-47-tabindex-on-phonenumber.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/es/components/Input/PhoneNumberInput.js +7 -3
  2. package/es/components/Money/index.js +2 -21
  3. package/es/lib/utils/selectUnit.js +64 -0
  4. package/es/misc/countryEmojiFlags.js +5 -0
  5. package/es/widgets/AccountDetail/index.js +0 -8
  6. package/es/widgets/ActivateWidget/index.js +1 -1
  7. package/es/widgets/BonusWidget/index.js +7 -8
  8. package/es/widgets/BonusWidget/types.js +23 -0
  9. package/es/widgets/Cashier/Deposit/PaymentForm/index.js +5 -2
  10. package/es/widgets/Cashier/Payment/PaymentAccountForms/index.js +41 -10
  11. package/es/widgets/Cashier/Payment/PaymentAccountParser.js +6 -0
  12. package/es/widgets/CashierAccordion/Payment/PaymentAccountForms/index.js +168 -62
  13. package/es/widgets/CashierAccordion/Payment/PaymentAccountParser.js +12 -0
  14. package/es/widgets/CashierAccordion/Withdraw/WithdrawWidget/index.js +1 -2
  15. package/es/widgets/HistoryWidget/index.js +20 -84
  16. package/es/widgets/ResponsibleGamingWidget/Timespan.js +5 -3
  17. package/es/widgets/VerifyAccordionWidget/index.js +1 -1
  18. package/lib/components/Input/PhoneNumberInput.js +7 -3
  19. package/lib/components/Money/index.js +2 -22
  20. package/lib/lib/utils/selectUnit.js +69 -0
  21. package/lib/misc/countryEmojiFlags.js +5 -0
  22. package/lib/widgets/AccountDetail/index.js +0 -8
  23. package/lib/widgets/ActivateWidget/index.js +1 -1
  24. package/lib/widgets/BonusWidget/index.js +8 -8
  25. package/lib/widgets/BonusWidget/types.js +37 -0
  26. package/lib/widgets/Cashier/Deposit/PaymentForm/index.js +5 -2
  27. package/lib/widgets/Cashier/Payment/PaymentAccountForms/index.js +42 -11
  28. package/lib/widgets/Cashier/Payment/PaymentAccountParser.js +6 -0
  29. package/lib/widgets/CashierAccordion/Payment/PaymentAccountForms/index.js +169 -63
  30. package/lib/widgets/CashierAccordion/Payment/PaymentAccountParser.js +12 -0
  31. package/lib/widgets/CashierAccordion/Withdraw/WithdrawWidget/index.js +1 -2
  32. package/lib/widgets/HistoryWidget/index.js +24 -87
  33. package/lib/widgets/ResponsibleGamingWidget/Timespan.js +5 -3
  34. package/lib/widgets/VerifyAccordionWidget/index.js +3 -3
  35. package/package.json +1 -1
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.format = undefined;
7
6
 
8
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; };
9
8
 
@@ -19,25 +18,13 @@ var _propTypes2 = _interopRequireDefault(_propTypes);
19
18
 
20
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
20
 
22
- /**
23
- * For crypto we want more decimals.
24
- */
25
- var fractionDigits = {
26
- BTC: { min: 5, max: 5 },
27
- LTC: { min: 5, max: 5 },
28
- XBC: { min: 5, max: 5 },
29
- XRP: { min: 5, max: 5 },
30
- ETC: { min: 5, max: 5 },
31
- BCH: { min: 5, max: 5 }
32
- };
33
-
34
21
  /**
35
22
  * FormattedNumber component to display currency
36
23
  */
37
24
  var Money = function Money(props) {
38
25
  return _react2.default.createElement(_reactIntl.FormattedNumber, _extends({
39
- minimumFractionDigits: props.decimals ? fractionDigits[props.currency] || 2 : 0,
40
- maximumFractionDigits: props.decimals ? fractionDigits[props.currency] || 2 : 0
26
+ minimumFractionDigits: props.decimals ? 2 : 0,
27
+ maximumFractionDigits: props.decimals ? 2 : 0
41
28
  }, props, {
42
29
  style: 'currency'
43
30
  }));
@@ -61,11 +48,4 @@ Money.defaultProps = {
61
48
  decimals: true
62
49
  };
63
50
 
64
- var format = exports.format = function format(currency) {
65
- return new Intl.NumberFormat('en-US', {
66
- minimumFractionDigits: fractionDigits[currency] ? fractionDigits[currency].min : null,
67
- maximumFractionDigits: fractionDigits[currency] ? fractionDigits[currency].max : null
68
- });
69
- };
70
-
71
51
  exports.default = Money;
@@ -0,0 +1,69 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var MILISECONDS = {
7
+ IN_A_SECOND: 1000,
8
+ IN_A_MINUTE: 60000,
9
+ IN_AN_HOUR: 3600000,
10
+ IN_A_DAY: 86400000,
11
+ IN_A_WEEK: 604800000,
12
+ IN_A_MONTH: 2628000000,
13
+ IN_A_YEAR: 31536000000
14
+ };
15
+
16
+ var selectUnit = exports.selectUnit = function selectUnit(from) {
17
+ var now = Date.now();
18
+ var ms = now - from;
19
+
20
+ switch (true) {
21
+ case MILISECONDS.IN_A_SECOND < ms && ms < MILISECONDS.IN_A_MINUTE:
22
+ return {
23
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_SECOND),
24
+ unit: 'second',
25
+ updateIntervalInSeconds: 1
26
+ };
27
+
28
+ case MILISECONDS.IN_A_MINUTE < ms && ms < MILISECONDS.IN_AN_HOUR:
29
+ return {
30
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_MINUTE),
31
+ unit: 'minute'
32
+ };
33
+
34
+ case MILISECONDS.IN_AN_HOUR < ms && ms < MILISECONDS.IN_A_DAY:
35
+ return {
36
+ value: -1 * Math.floor(ms / MILISECONDS.IN_AN_HOUR),
37
+ unit: 'hour'
38
+ };
39
+
40
+ case MILISECONDS.IN_A_DAY < ms && ms < MILISECONDS.IN_A_WEEK:
41
+ return {
42
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_DAY),
43
+ unit: 'day'
44
+ };
45
+
46
+ case MILISECONDS.IN_A_WEEK < ms && ms < MILISECONDS.IN_A_MONTH:
47
+ return {
48
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_WEEK),
49
+ unit: 'week'
50
+ };
51
+
52
+ case MILISECONDS.IN_A_MONTH < ms && ms < MILISECONDS.IN_A_YEAR:
53
+ return {
54
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_MONTH),
55
+ unit: 'month'
56
+ };
57
+
58
+ case MILISECONDS.IN_A_YEAR < ms:
59
+ return {
60
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_YEAR),
61
+ unit: 'year'
62
+ };
63
+
64
+ default:
65
+ return {
66
+ value: 0
67
+ };
68
+ }
69
+ };
@@ -14,6 +14,7 @@ exports.default = {
14
14
  AG: '🇦🇬',
15
15
  AU: '🇦🇺',
16
16
  AT: '🇦🇹',
17
+ AW: '🇦🇼',
17
18
  AZ: '🇦🇿',
18
19
  BI: '🇧🇮',
19
20
  BE: '🇧🇪',
@@ -29,6 +30,7 @@ exports.default = {
29
30
  BO: '🇧🇴',
30
31
  BR: '🇧🇷',
31
32
  BB: '🇧🇧',
33
+ BM: '🇧🇲',
32
34
  BN: '🇧🇳',
33
35
  BT: '🇧🇹',
34
36
  BW: '🇧🇼',
@@ -38,6 +40,7 @@ exports.default = {
38
40
  CL: '🇨🇱',
39
41
  CN: '🇨🇳',
40
42
  CI: '🇨🇮',
43
+ CK: '🇨🇰',
41
44
  CM: '🇨🇲',
42
45
  CD: '🇨🇩',
43
46
  CG: '🇨🇬',
@@ -172,6 +175,7 @@ exports.default = {
172
175
  SZ: '🇸🇿',
173
176
  SC: '🇸🇨',
174
177
  SY: '🇸🇾',
178
+ TC: '🇹🇨',
175
179
  TD: '🇹🇩',
176
180
  TG: '🇹🇬',
177
181
  TH: '🇹🇭',
@@ -183,6 +187,7 @@ exports.default = {
183
187
  TN: '🇹🇳',
184
188
  TR: '🇹🇷',
185
189
  TV: '🇹🇻',
190
+ TW: '🇹🇼',
186
191
  TZ: '🇹🇿',
187
192
  UG: '🇺🇬',
188
193
  UA: '🇺🇦',
@@ -189,14 +189,6 @@ var AccountDetail = function AccountDetail(_ref) {
189
189
  id: 'title.mobile_number',
190
190
  defaultMessage: 'Mobile number'
191
191
  }, intl),
192
- callingCodes: countries ? countries.value.sort(function (a, b) {
193
- return Number(a.callingCode) - Number(b.callingCode);
194
- }).map(function (i) {
195
- return {
196
- value: '00' + i.callingCode,
197
- label: '+' + i.callingCode + ' ' + (_countryEmojiFlags2.default[i.value] || '')
198
- };
199
- }) : [],
200
192
  name: 'MobilePhoneNumber',
201
193
  autoComplete: 'off',
202
194
  status: errors.MobilePhoneNumber && 'failure' || 'idle',
@@ -93,7 +93,7 @@ var ActivationCode = function ActivationCode(_ref) {
93
93
  }, [autoFocus, code]);
94
94
 
95
95
  (0, _react.useEffect)(function () {
96
- return inputRef.current.value = code;
96
+ inputRef.current.value = code;
97
97
  }, [code]);
98
98
 
99
99
  var setCaretPosition = function setCaretPosition(from, to) {
@@ -32,6 +32,8 @@ var _Translate2 = _interopRequireDefault(_Translate);
32
32
 
33
33
  var _states = require('./states');
34
34
 
35
+ var _types = require('./types');
36
+
35
37
  var _marked = require('marked');
36
38
 
37
39
  var _marked2 = _interopRequireDefault(_marked);
@@ -185,10 +187,11 @@ var BonusWidget = function BonusWidget(_ref3) {
185
187
  var info = [[_react2.default.createElement(
186
188
  'div',
187
189
  null,
188
- _react2.default.createElement(_Translate2.default, {
189
- id: 'label.description.bonus.' + item.Identifier.toLowerCase(),
190
- defaultMessage: item.Name || item.Description
191
- })
190
+ _react2.default.createElement(
191
+ 'span',
192
+ null,
193
+ item.Name || item.Description
194
+ )
192
195
  ), _react2.default.createElement(
193
196
  'div',
194
197
  null,
@@ -201,10 +204,7 @@ var BonusWidget = function BonusWidget(_ref3) {
201
204
  style: item.Type.toLowerCase() == 'freespins' ? 'decimal' : 'currency',
202
205
  currency: item.Currency
203
206
  })
204
- ), _react2.default.createElement(_Translate2.default, {
205
- id: 'label.type.bonus.' + item.Type.toLowerCase(),
206
- defaultMessage: item.Type.toLowerCase()
207
- })]];
207
+ ), (0, _types.getBonusType)(item.Type)]];
208
208
 
209
209
  // Add bonus actions to not expired Fasttrack bonuses
210
210
  if (item.Provider === 'fasttrack' && item.State !== 'Expired') info.push(_react2.default.createElement(BonusActionFT, { bonus: item, onClaimBonus: onClaimBonus }));
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getBonusType = undefined;
7
+
8
+ var _react = require('react');
9
+
10
+ var _react2 = _interopRequireDefault(_react);
11
+
12
+ var _Translate = require('../../components/Translate');
13
+
14
+ var _Translate2 = _interopRequireDefault(_Translate);
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ var getBonusType = exports.getBonusType = function getBonusType(type) {
19
+ var translations = {
20
+ Monetary: _react2.default.createElement(_Translate2.default, { id: 'label.type.bonus.monetary', defaultMessage: 'Monetary' }),
21
+ Freespins: _react2.default.createElement(_Translate2.default, { id: 'label.type.bonus.freespins', defaultMessage: 'Freespins' }),
22
+ FreespinsMonetary: _react2.default.createElement(_Translate2.default, {
23
+ id: 'label.type.bonus.freespinsMonetary',
24
+ defaultMessage: 'Freespins Monetary'
25
+ }),
26
+ FreeBetsMonetary: _react2.default.createElement(_Translate2.default, {
27
+ id: 'label.type.bonus.freeBetsMonetary',
28
+ defaultMessage: 'Free Bets Monetary'
29
+ })
30
+ };
31
+
32
+ return translations[type] || _react2.default.createElement(
33
+ 'span',
34
+ null,
35
+ type
36
+ );
37
+ };
@@ -126,7 +126,6 @@ var PaymentForm = function (_Component) {
126
126
  return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref3 = PaymentForm.__proto__ || Object.getPrototypeOf(PaymentForm)).call.apply(_ref3, [this].concat(args))), _this), _this.onMessage = function (message) {
127
127
  var operatingSystem = _this.props.operatingSystem;
128
128
 
129
- console.log({ message: message });
130
129
  var data = JSON.parse(message.data);
131
130
 
132
131
  if (data.method === 'OPEN_APP') {
@@ -166,7 +165,11 @@ var PaymentForm = function (_Component) {
166
165
 
167
166
  if (data.redirectOutput == null) {
168
167
  if (onSuccess) {
169
- onSuccess();
168
+ onSuccess({
169
+ amount: data.amount,
170
+ currency: data.currency,
171
+ tx: Number(data.transactionId)
172
+ });
170
173
  return null;
171
174
  }
172
175
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.InteracWithdrawal = exports.PaysafecardWithdrawal = exports.InstadebitWithdrawal = exports.IDebitWithdrawal = exports.IdealWithdrawal = exports.EProPaymentWallWithdrawal = exports.EcoPayzWithdrawal = exports.TrustlyWithdrawal = exports.BankWithdrawal = exports.ZimplerWithdrawal = exports.MuchBetterWithdrawal = exports.NetellerWithdrawal = exports.VenusPointWithdrawal = exports.CreditcardWithdrawal = exports.SkrillWithdrawal = exports.BankLocalWithdrawal = exports.PaysafecardDeposit = exports.InstadebitDeposit = exports.IDebitDeposit = exports.IdealDeposit = exports.EProPaymentWallDeposit = exports.EcoPayzDeposit = exports.TrustlyDeposit = exports.BankDeposit = exports.ZimplerDeposit = exports.SwishDeposit = exports.MobilePayDeposit = exports.PProDeposit = exports.MuchBetterDeposit = exports.SiruDeposit = exports.VenusPointDeposit = exports.NetellerDeposit = exports.CreditcardDeposit = exports.SkrillDeposit = undefined;
6
+ exports.InteracWithdrawal = exports.PaysafecardWithdrawal = exports.InstadebitWithdrawal = exports.IDebitWithdrawal = exports.IdealWithdrawal = exports.EProPaymentWallWithdrawal = exports.EcoPayzWithdrawal = exports.TrustlyWithdrawal = exports.BankWithdrawal = exports.ZimplerWithdrawal = exports.MuchBetterWithdrawal = exports.NetellerWithdrawal = exports.VegaWithdrawal = exports.VenusPointWithdrawal = exports.CreditcardWithdrawal = exports.SkrillWithdrawal = exports.BankLocalWithdrawal = exports.PaysafecardDeposit = exports.InstadebitDeposit = exports.IDebitDeposit = exports.IdealDeposit = exports.EProPaymentWallDeposit = exports.EcoPayzDeposit = exports.TrustlyDeposit = exports.BankDeposit = exports.ZimplerDeposit = exports.SwishDeposit = exports.MobilePayDeposit = exports.PProDeposit = exports.MuchBetterDeposit = exports.SiruDeposit = exports.VegaDeposit = exports.VenusPointDeposit = exports.NetellerDeposit = exports.CreditcardDeposit = exports.SkrillDeposit = undefined;
7
7
 
8
8
  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; };
9
9
 
@@ -165,6 +165,27 @@ var VenusPoint = function VenusPoint(_ref3) {
165
165
  );
166
166
  };
167
167
 
168
+ var Vega = function Vega(_ref4) {
169
+ var account = _ref4.account,
170
+ intl = _ref4.intl;
171
+
172
+ return _react2.default.createElement(
173
+ 'div',
174
+ { className: 'payment-account-info' },
175
+ _react2.default.createElement(_TextInput2.default, {
176
+ disabled: account.accountId,
177
+ name: 'username',
178
+ value: account.maskedAccount,
179
+ label: (0, _translate2.default)({ id: 'cashier.details.username' }, intl)
180
+ }),
181
+ _react2.default.createElement(_TextInput2.default, {
182
+ type: 'password',
183
+ name: 'password',
184
+ label: (0, _translate2.default)({ id: 'cashier.details.password' }, intl)
185
+ })
186
+ );
187
+ };
188
+
168
189
  var PPro = function PPro() {
169
190
  return _react2.default.createElement(
170
191
  'div',
@@ -173,9 +194,9 @@ var PPro = function PPro() {
173
194
  );
174
195
  };
175
196
 
176
- var PhoneNumber = function PhoneNumber(_ref4) {
177
- var account = _ref4.account,
178
- intl = _ref4.intl;
197
+ var PhoneNumber = function PhoneNumber(_ref5) {
198
+ var account = _ref5.account,
199
+ intl = _ref5.intl;
179
200
 
180
201
  return _react2.default.createElement(
181
202
  'div',
@@ -188,9 +209,9 @@ var PhoneNumber = function PhoneNumber(_ref4) {
188
209
  );
189
210
  };
190
211
 
191
- var Email = function Email(_ref5) {
192
- var account = _ref5.account,
193
- intl = _ref5.intl;
212
+ var Email = function Email(_ref6) {
213
+ var account = _ref6.account,
214
+ intl = _ref6.intl;
194
215
 
195
216
  return _react2.default.createElement(
196
217
  'div',
@@ -204,9 +225,9 @@ var Email = function Email(_ref5) {
204
225
  );
205
226
  };
206
227
 
207
- var Banklocal = function Banklocal(_ref6) {
208
- var account = _ref6.account,
209
- intl = _ref6.intl;
228
+ var Banklocal = function Banklocal(_ref7) {
229
+ var account = _ref7.account,
230
+ intl = _ref7.intl;
210
231
 
211
232
  return _react2.default.createElement(
212
233
  'div',
@@ -220,7 +241,7 @@ var Banklocal = function Banklocal(_ref6) {
220
241
  _react2.default.createElement(_TextInput2.default, {
221
242
  value: account.accountId ? account.maskedAccount.replace(/\d*-/g, '') : undefined,
222
243
  name: 'accountNumber',
223
- title: (0, _translate2.default)({ id: 'cashier.details.accountNumber' }, intl),
244
+ title: (0, _translate2.default)({ id: 'cashier.details.iban' }, intl),
224
245
  disabled: account.accountId
225
246
  })
226
247
  );
@@ -246,6 +267,11 @@ var VenusPointDeposit = exports.VenusPointDeposit = {
246
267
  parser: Parser.parseVenusPoint
247
268
  };
248
269
 
270
+ var VegaDeposit = exports.VegaDeposit = {
271
+ component: injectMethod('deposit', (0, _reactIntl.injectIntl)(Vega)),
272
+ parser: Parser.parseVega
273
+ };
274
+
249
275
  var SiruDeposit = exports.SiruDeposit = {
250
276
  component: (0, _reactIntl.injectIntl)(PhoneNumber),
251
277
  parser: Parser.parsePhoneNumber
@@ -297,6 +323,11 @@ var VenusPointWithdrawal = exports.VenusPointWithdrawal = {
297
323
  parser: Parser.parseVenusPoint
298
324
  };
299
325
 
326
+ var VegaWithdrawal = exports.VegaWithdrawal = {
327
+ component: injectMethod('withdraw', (0, _reactIntl.injectIntl)(Vega)),
328
+ parser: Parser.parseVega
329
+ };
330
+
300
331
  var NetellerWithdrawal = exports.NetellerWithdrawal = {
301
332
  component: injectMethod('withdraw', (0, _reactIntl.injectIntl)(Neteller)),
302
333
  parser: Parser.parseNeteller
@@ -42,6 +42,12 @@ var parseVenusPoint = exports.parseVenusPoint = function parseVenusPoint(account
42
42
  };
43
43
  };
44
44
 
45
+ var parseVega = exports.parseVega = function parseVega(account) {
46
+ return {
47
+ account: account.maskedAccount || account.account
48
+ };
49
+ };
50
+
45
51
  var parsePhoneNumber = exports.parsePhoneNumber = function parsePhoneNumber(account) {
46
52
  return {
47
53
  phoneNumber: account.phoneNumber || account.maskedAccount