tg-core-components 6.2.1-alpha.0 → 6.3.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 (67) hide show
  1. package/es/components/Money/index.js +24 -2
  2. package/es/components/Picture/index.js +1 -1
  3. package/es/index.js +1 -2
  4. package/es/lib/WithValidation/rules/blacklistedCharacters.js +3 -0
  5. package/es/lib/WithValidation/rules/noSpecialCharacters.js +3 -0
  6. package/es/lib/WithValidation/rules/phone.js +2 -2
  7. package/es/lib/utils/selectUnit.js +9 -13
  8. package/es/lib/utils/translate.js +1 -1
  9. package/es/misc/countryEmojiFlags.js +5 -0
  10. package/es/widgets/AccordionWidget/index.js +3 -11
  11. package/es/widgets/AccountDetail/index.js +100 -39
  12. package/es/widgets/ActivateWidget/index.js +1 -1
  13. package/es/widgets/BonusWidget/index.js +17 -32
  14. package/es/widgets/BonusWidget/types.js +23 -0
  15. package/es/widgets/Cashier/Deposit/PaymentForm/InjectedIframeHTML.js +7 -3
  16. package/es/widgets/Cashier/Deposit/PaymentForm/index.js +6 -5
  17. package/es/widgets/Cashier/Payment/PaymentAccountForms/index.js +41 -10
  18. package/es/widgets/Cashier/Payment/PaymentAccountParser.js +6 -0
  19. package/es/widgets/CashierAccordion/Deposit/DepositWidget/index.js +4 -1
  20. package/es/widgets/CashierAccordion/Payment/PaymentAccountForms/index.js +109 -71
  21. package/es/widgets/CashierAccordion/Payment/PaymentAccountParser.js +6 -0
  22. package/es/widgets/CashierAccordion/Withdraw/WithdrawWidget/index.js +5 -3
  23. package/es/widgets/HistoryWidget/index.js +19 -19
  24. package/es/widgets/ResponsibleGamingWidget/Timespan.js +5 -3
  25. package/lib/components/Money/index.js +25 -2
  26. package/lib/components/Picture/index.js +1 -1
  27. package/lib/index.js +6 -9
  28. package/lib/lib/WithValidation/rules/blacklistedCharacters.js +9 -0
  29. package/lib/lib/WithValidation/rules/noSpecialCharacters.js +9 -0
  30. package/lib/lib/WithValidation/rules/phone.js +2 -2
  31. package/lib/lib/utils/selectUnit.js +9 -13
  32. package/lib/lib/utils/translate.js +1 -1
  33. package/lib/misc/countryEmojiFlags.js +5 -0
  34. package/lib/widgets/AccordionWidget/index.js +3 -14
  35. package/lib/widgets/AccountDetail/index.js +112 -39
  36. package/lib/widgets/ActivateWidget/index.js +1 -1
  37. package/lib/widgets/BonusWidget/index.js +21 -32
  38. package/lib/widgets/BonusWidget/types.js +37 -0
  39. package/lib/widgets/Cashier/Deposit/PaymentForm/InjectedIframeHTML.js +7 -3
  40. package/lib/widgets/Cashier/Deposit/PaymentForm/index.js +6 -5
  41. package/lib/widgets/Cashier/Payment/PaymentAccountForms/index.js +42 -11
  42. package/lib/widgets/Cashier/Payment/PaymentAccountParser.js +6 -0
  43. package/lib/widgets/CashierAccordion/Deposit/DepositWidget/index.js +4 -1
  44. package/lib/widgets/CashierAccordion/Payment/PaymentAccountForms/index.js +110 -72
  45. package/lib/widgets/CashierAccordion/Payment/PaymentAccountParser.js +6 -0
  46. package/lib/widgets/CashierAccordion/Withdraw/WithdrawWidget/index.js +5 -3
  47. package/lib/widgets/HistoryWidget/index.js +19 -19
  48. package/lib/widgets/ResponsibleGamingWidget/Timespan.js +5 -3
  49. package/package.json +2 -2
  50. package/es/components/Message/index.js +0 -41
  51. package/es/lib/utils/bonus.js +0 -47
  52. package/es/widgets/BonusOffers/Actions.js +0 -167
  53. package/es/widgets/BonusOffers/BonusCode.js +0 -62
  54. package/es/widgets/BonusOffers/Details.js +0 -114
  55. package/es/widgets/BonusOffers/Finished.js +0 -18
  56. package/es/widgets/BonusOffers/List.js +0 -83
  57. package/es/widgets/BonusOffers/Overview.js +0 -51
  58. package/es/widgets/BonusOffers/index.js +0 -78
  59. package/lib/components/Message/index.js +0 -57
  60. package/lib/lib/utils/bonus.js +0 -52
  61. package/lib/widgets/BonusOffers/Actions.js +0 -182
  62. package/lib/widgets/BonusOffers/BonusCode.js +0 -85
  63. package/lib/widgets/BonusOffers/Details.js +0 -144
  64. package/lib/widgets/BonusOffers/Finished.js +0 -31
  65. package/lib/widgets/BonusOffers/List.js +0 -104
  66. package/lib/widgets/BonusOffers/Overview.js +0 -77
  67. package/lib/widgets/BonusOffers/index.js +0 -95
@@ -130,6 +130,27 @@ var VenusPoint = function VenusPoint(_ref3) {
130
130
  );
131
131
  };
132
132
 
133
+ var Vega = function Vega(_ref4) {
134
+ var account = _ref4.account,
135
+ intl = _ref4.intl;
136
+
137
+ return React.createElement(
138
+ 'div',
139
+ { className: 'payment-account-info' },
140
+ React.createElement(Input, {
141
+ disabled: account.accountId,
142
+ name: 'username',
143
+ value: account.maskedAccount,
144
+ label: translate({ id: 'cashier.details.username' }, intl)
145
+ }),
146
+ React.createElement(Input, {
147
+ type: 'password',
148
+ name: 'password',
149
+ label: translate({ id: 'cashier.details.password' }, intl)
150
+ })
151
+ );
152
+ };
153
+
133
154
  var PPro = function PPro() {
134
155
  return React.createElement(
135
156
  'div',
@@ -138,9 +159,9 @@ var PPro = function PPro() {
138
159
  );
139
160
  };
140
161
 
141
- var PhoneNumber = function PhoneNumber(_ref4) {
142
- var account = _ref4.account,
143
- intl = _ref4.intl;
162
+ var PhoneNumber = function PhoneNumber(_ref5) {
163
+ var account = _ref5.account,
164
+ intl = _ref5.intl;
144
165
 
145
166
  return React.createElement(
146
167
  'div',
@@ -153,9 +174,9 @@ var PhoneNumber = function PhoneNumber(_ref4) {
153
174
  );
154
175
  };
155
176
 
156
- var Email = function Email(_ref5) {
157
- var account = _ref5.account,
158
- intl = _ref5.intl;
177
+ var Email = function Email(_ref6) {
178
+ var account = _ref6.account,
179
+ intl = _ref6.intl;
159
180
 
160
181
  return React.createElement(
161
182
  'div',
@@ -169,9 +190,9 @@ var Email = function Email(_ref5) {
169
190
  );
170
191
  };
171
192
 
172
- var Banklocal = function Banklocal(_ref6) {
173
- var account = _ref6.account,
174
- intl = _ref6.intl;
193
+ var Banklocal = function Banklocal(_ref7) {
194
+ var account = _ref7.account,
195
+ intl = _ref7.intl;
175
196
 
176
197
  return React.createElement(
177
198
  'div',
@@ -185,7 +206,7 @@ var Banklocal = function Banklocal(_ref6) {
185
206
  React.createElement(Input, {
186
207
  value: account.accountId ? account.maskedAccount.replace(/\d*-/g, '') : undefined,
187
208
  name: 'accountNumber',
188
- title: translate({ id: 'cashier.details.accountNumber' }, intl),
209
+ title: translate({ id: 'cashier.details.iban' }, intl),
189
210
  disabled: account.accountId
190
211
  })
191
212
  );
@@ -211,6 +232,11 @@ export var VenusPointDeposit = {
211
232
  parser: Parser.parseVenusPoint
212
233
  };
213
234
 
235
+ export var VegaDeposit = {
236
+ component: injectMethod('deposit', injectIntl(Vega)),
237
+ parser: Parser.parseVega
238
+ };
239
+
214
240
  export var SiruDeposit = {
215
241
  component: injectIntl(PhoneNumber),
216
242
  parser: Parser.parsePhoneNumber
@@ -262,6 +288,11 @@ export var VenusPointWithdrawal = {
262
288
  parser: Parser.parseVenusPoint
263
289
  };
264
290
 
291
+ export var VegaWithdrawal = {
292
+ component: injectMethod('withdraw', injectIntl(Vega)),
293
+ parser: Parser.parseVega
294
+ };
295
+
265
296
  export var NetellerWithdrawal = {
266
297
  component: injectMethod('withdraw', injectIntl(Neteller)),
267
298
  parser: Parser.parseNeteller
@@ -37,6 +37,12 @@ export var parseVenusPoint = function parseVenusPoint(account) {
37
37
  };
38
38
  };
39
39
 
40
+ export var parseVega = function parseVega(account) {
41
+ return {
42
+ account: account.maskedAccount || account.account
43
+ };
44
+ };
45
+
40
46
  export var parsePhoneNumber = function parsePhoneNumber(account) {
41
47
  return {
42
48
  phoneNumber: account.phoneNumber || account.maskedAccount
@@ -265,7 +265,10 @@ var DepositWidget = function (_Component) {
265
265
  if (amount < parseFloat(selectedMethod.limit.min) || amount < parseFloat(_this2.getMinDepositBonusAmount())) {
266
266
  errors.amount.push(React.createElement(Translate, {
267
267
  id: 'error.cashier.amount-below-method-limit',
268
- defaultMessage: 'Amount is too low.'
268
+ defaultMessage: 'Amount is too low. Min amount: {min}',
269
+ values: {
270
+ min: Math.min(parseFloat(selectedMethod.limit.min), parseFloat(_this2.getMinDepositBonusAmount()))
271
+ }
269
272
  }));
270
273
  return errors;
271
274
  }
@@ -186,6 +186,34 @@ var VenusPoint = function VenusPoint(_ref3) {
186
186
  );
187
187
  };
188
188
 
189
+ var Vega = function Vega(_ref4) {
190
+ var account = _ref4.account,
191
+ intl = _ref4.intl,
192
+ change = _ref4.change;
193
+
194
+ return React.createElement(
195
+ 'div',
196
+ null,
197
+ React.createElement(Input, {
198
+ disabled: account.accountId,
199
+ name: 'username',
200
+ onChange: function onChange(e, username) {
201
+ return change('username', username);
202
+ },
203
+ value: account.maskedAccount,
204
+ label: translate({ id: 'cashier.details.username' }, intl)
205
+ }),
206
+ React.createElement(Input, {
207
+ type: 'password',
208
+ name: 'password',
209
+ onChange: function onChange(e, password) {
210
+ return change('password', password);
211
+ },
212
+ label: translate({ id: 'cashier.details.password' }, intl)
213
+ })
214
+ );
215
+ };
216
+
189
217
  var PPro = function PPro() {
190
218
  return React.createElement(
191
219
  'div',
@@ -194,11 +222,11 @@ var PPro = function PPro() {
194
222
  );
195
223
  };
196
224
 
197
- var PhoneNumber = function PhoneNumber(_ref4) {
198
- var account = _ref4.account,
199
- intl = _ref4.intl,
200
- change = _ref4.change,
201
- values = _ref4.values;
225
+ var PhoneNumber = function PhoneNumber(_ref5) {
226
+ var account = _ref5.account,
227
+ intl = _ref5.intl,
228
+ change = _ref5.change,
229
+ values = _ref5.values;
202
230
 
203
231
  return React.createElement(
204
232
  'div',
@@ -216,11 +244,11 @@ var PhoneNumber = function PhoneNumber(_ref4) {
216
244
  );
217
245
  };
218
246
 
219
- var Email = function Email(_ref5) {
220
- var account = _ref5.account,
221
- intl = _ref5.intl,
222
- change = _ref5.change,
223
- values = _ref5.values;
247
+ var Email = function Email(_ref6) {
248
+ var account = _ref6.account,
249
+ intl = _ref6.intl,
250
+ change = _ref6.change,
251
+ values = _ref6.values;
224
252
 
225
253
  return React.createElement(
226
254
  'div',
@@ -238,10 +266,10 @@ var Email = function Email(_ref5) {
238
266
  );
239
267
  };
240
268
 
241
- var Banklocal = function Banklocal(_ref6) {
242
- var account = _ref6.account,
243
- intl = _ref6.intl,
244
- change = _ref6.change;
269
+ var Banklocal = function Banklocal(_ref7) {
270
+ var account = _ref7.account,
271
+ intl = _ref7.intl,
272
+ change = _ref7.change;
245
273
 
246
274
  return React.createElement(
247
275
  'div',
@@ -261,17 +289,17 @@ var Banklocal = function Banklocal(_ref6) {
261
289
  return change('accountNumber', accountNumber);
262
290
  },
263
291
  name: 'accountNumber',
264
- label: translate({ id: 'cashier.details.accountNumber' }, intl),
292
+ label: translate({ id: 'cashier.details.iban' }, intl),
265
293
  disabled: account.accountId
266
294
  })
267
295
  );
268
296
  };
269
297
 
270
- var BankIBAN = function BankIBAN(_ref7) {
271
- var account = _ref7.account,
272
- intl = _ref7.intl,
273
- change = _ref7.change,
274
- values = _ref7.values;
298
+ var BankIBAN = function BankIBAN(_ref8) {
299
+ var account = _ref8.account,
300
+ intl = _ref8.intl,
301
+ change = _ref8.change,
302
+ values = _ref8.values;
275
303
 
276
304
  return React.createElement(
277
305
  'div',
@@ -317,15 +345,15 @@ var BankIBAN = function BankIBAN(_ref7) {
317
345
  );
318
346
  };
319
347
 
320
- var AstroPayBank = function AstroPayBank(_ref8) {
321
- var account = _ref8.account,
322
- intl = _ref8.intl,
323
- country = _ref8.country,
324
- method = _ref8.method,
325
- detail = _ref8.detail,
326
- change = _ref8.change,
327
- values = _ref8.values,
328
- config = _ref8.config;
348
+ var AstroPayBank = function AstroPayBank(_ref9) {
349
+ var account = _ref9.account,
350
+ intl = _ref9.intl,
351
+ country = _ref9.country,
352
+ method = _ref9.method,
353
+ detail = _ref9.detail,
354
+ change = _ref9.change,
355
+ values = _ref9.values,
356
+ config = _ref9.config;
329
357
 
330
358
  var _useState = useState([]),
331
359
  _useState2 = _slicedToArray(_useState, 2),
@@ -530,22 +558,22 @@ var AstroPayBank = function AstroPayBank(_ref8) {
530
558
  );
531
559
  };
532
560
 
533
- var BankIntl = function BankIntl(_ref9) {
534
- var account = _ref9.account,
535
- intl = _ref9.intl,
536
- values = _ref9.values,
537
- change = _ref9.change,
538
- country = _ref9.country;
561
+ var BankIntl = function BankIntl(_ref10) {
562
+ var account = _ref10.account,
563
+ intl = _ref10.intl,
564
+ values = _ref10.values,
565
+ change = _ref10.change,
566
+ country = _ref10.country;
539
567
 
540
568
  return React.createElement(
541
569
  'div',
542
570
  { className: 'payment-account-info' },
543
571
  React.createElement(Input, {
544
572
  required: true,
545
- name: 'iban',
546
- value: account.accountId ? account.maskedAccount.replace(/\d*-/g, '') : values['iban'],
547
- onChange: function onChange(e, iban) {
548
- return change('iban', iban);
573
+ name: 'accountNumber',
574
+ value: account.accountId ? account.maskedAccount.replace(/\d*-/g, '') : values['accountNumber'],
575
+ onChange: function onChange(e, accountNumber) {
576
+ return change('accountNumber', accountNumber);
549
577
  },
550
578
  label: translate({ id: 'cashier.details.iban' }, intl),
551
579
  disabled: account.accountId
@@ -587,12 +615,12 @@ var BankIntl = function BankIntl(_ref9) {
587
615
  );
588
616
  };
589
617
 
590
- var CryptoCurrency = function CryptoCurrency(_ref10) {
591
- var intl = _ref10.intl,
592
- detail = _ref10.detail,
593
- method = _ref10.method,
594
- values = _ref10.values,
595
- change = _ref10.change;
618
+ var CryptoCurrency = function CryptoCurrency(_ref11) {
619
+ var intl = _ref11.intl,
620
+ detail = _ref11.detail,
621
+ method = _ref11.method,
622
+ values = _ref11.values,
623
+ change = _ref11.change;
596
624
 
597
625
  var methodDetails = {
598
626
  cryptoCurrencies: getByPath(detail, 'config.cryptoCurrencies', [])
@@ -645,11 +673,11 @@ var CryptoCurrency = function CryptoCurrency(_ref10) {
645
673
  );
646
674
  };
647
675
 
648
- var Jeton = function Jeton(_ref11) {
649
- var account = _ref11.account,
650
- intl = _ref11.intl,
651
- values = _ref11.values,
652
- change = _ref11.change;
676
+ var Jeton = function Jeton(_ref12) {
677
+ var account = _ref12.account,
678
+ intl = _ref12.intl,
679
+ values = _ref12.values,
680
+ change = _ref12.change;
653
681
 
654
682
  return React.createElement(
655
683
  'div',
@@ -667,11 +695,11 @@ var Jeton = function Jeton(_ref11) {
667
695
  );
668
696
  };
669
697
 
670
- var BestPay = function BestPay(_ref12) {
671
- var account = _ref12.account,
672
- intl = _ref12.intl,
673
- values = _ref12.values,
674
- change = _ref12.change;
698
+ var BestPay = function BestPay(_ref13) {
699
+ var account = _ref13.account,
700
+ intl = _ref13.intl,
701
+ values = _ref13.values,
702
+ change = _ref13.change;
675
703
 
676
704
  return React.createElement(
677
705
  'div',
@@ -698,11 +726,11 @@ var BestPay = function BestPay(_ref12) {
698
726
  );
699
727
  };
700
728
 
701
- var Mifinity = function Mifinity(_ref13) {
702
- var account = _ref13.account,
703
- intl = _ref13.intl,
704
- change = _ref13.change,
705
- values = _ref13.values;
729
+ var Mifinity = function Mifinity(_ref14) {
730
+ var account = _ref14.account,
731
+ intl = _ref14.intl,
732
+ change = _ref14.change,
733
+ values = _ref14.values;
706
734
 
707
735
  return React.createElement(
708
736
  'div',
@@ -720,11 +748,11 @@ var Mifinity = function Mifinity(_ref13) {
720
748
  );
721
749
  };
722
750
 
723
- var EzeeWallet = function EzeeWallet(_ref14) {
724
- var account = _ref14.account,
725
- intl = _ref14.intl,
726
- method = _ref14.method,
727
- change = _ref14.change;
751
+ var EzeeWallet = function EzeeWallet(_ref15) {
752
+ var account = _ref15.account,
753
+ intl = _ref15.intl,
754
+ method = _ref15.method,
755
+ change = _ref15.change;
728
756
 
729
757
  return React.createElement(
730
758
  'div',
@@ -757,12 +785,12 @@ var EzeeWallet = function EzeeWallet(_ref14) {
757
785
  );
758
786
  };
759
787
 
760
- var Paramount = function Paramount(_ref15) {
761
- var account = _ref15.account,
762
- intl = _ref15.intl,
763
- values = _ref15.values,
764
- change = _ref15.change,
765
- detail = _ref15.detail;
788
+ var Paramount = function Paramount(_ref16) {
789
+ var account = _ref16.account,
790
+ intl = _ref16.intl,
791
+ values = _ref16.values,
792
+ change = _ref16.change,
793
+ detail = _ref16.detail;
766
794
 
767
795
  var methodDetails = {
768
796
  securityQuestions: getByPath(detail, 'config.securityQuestions', [])
@@ -840,6 +868,11 @@ export var VenusPointDeposit = {
840
868
  parser: Parser.parseVenusPoint
841
869
  };
842
870
 
871
+ export var VegaDeposit = {
872
+ component: injectMethod('deposit', injectIntl(Vega)),
873
+ parser: Parser.parseVega
874
+ };
875
+
843
876
  export var SiruDeposit = {
844
877
  component: injectIntl(PhoneNumber),
845
878
  parser: Parser.parsePhoneNumber
@@ -947,6 +980,11 @@ export var VenusPointWithdrawal = {
947
980
  parser: Parser.parseVenusPoint
948
981
  };
949
982
 
983
+ export var VegaWithdrawal = {
984
+ component: injectMethod('withdraw', injectIntl(Vega)),
985
+ parser: Parser.parseVega
986
+ };
987
+
950
988
  export var NetellerWithdrawal = {
951
989
  component: injectMethod({ method: 'withdraw' }, injectIntl(Neteller)),
952
990
  parser: Parser.parseNeteller
@@ -39,6 +39,12 @@ export var parseVenusPoint = function parseVenusPoint(account) {
39
39
  };
40
40
  };
41
41
 
42
+ export var parseVega = function parseVega(account) {
43
+ return {
44
+ account: account.maskedAccount || account.account
45
+ };
46
+ };
47
+
42
48
  export var parseMifinity = function parseMifinity(account) {
43
49
  return {
44
50
  account: account.maskedAccount || account.account
@@ -141,11 +141,13 @@ var WithdrawWidget = function (_PureComponent) {
141
141
  if (amount === undefined) {
142
142
  return errors;
143
143
  }
144
-
145
- if (Number(amount) < parseFloat(selectedMethod.limit.min)) {
144
+ if (amount && Number(amount) < parseFloat(selectedMethod.limit.min)) {
146
145
  errors.amount.push(React.createElement(Translate, {
147
146
  id: 'error.cashier.amount-below-method-limit',
148
- defaultMessage: 'Amount is too low.'
147
+ defaultMessage: 'Amount is too low. Min amount: {min}',
148
+ values: {
149
+ min: parseFloat(selectedMethod.limit.min)
150
+ }
149
151
  }));
150
152
  return errors;
151
153
  }
@@ -45,7 +45,7 @@ var HistoryWidgetList = function (_React$Component) {
45
45
  minute: '2-digit',
46
46
  second: '2-digit'
47
47
  });
48
- }, _this.createListInfo = function (item, product, currency, isLoading) {
48
+ }, _this.createListInfo = function (item, product, isLoading) {
49
49
  if (isLoading) return [[React.createElement(SkeletonLine, { bold: true }), React.createElement(SkeletonLine, null)], [React.createElement(SkeletonLine, { bold: true }), React.createElement(SkeletonLine, null)]];
50
50
 
51
51
  if (product === 'casino') {
@@ -57,7 +57,7 @@ var HistoryWidgetList = function (_React$Component) {
57
57
  'div',
58
58
  null,
59
59
  getMessage(getByPath(item, 'Transactions[0].Status'))
60
- )], [React.createElement(Money, { value: item.Win - item.Bet, currency: currency }), React.createElement(FormattedRelativeTime, selectUnit(new Date(item.StartTime + '+00:00')))]];
60
+ )], [React.createElement(Money, { value: item.Win - item.Bet, currency: item.Currency }), React.createElement(FormattedRelativeTime, selectUnit(new Date(item.StartTime + '+00:00')))]];
61
61
  } else if (product === 'sportsbook') {
62
62
  var selection = item.Transactions[0].Description;
63
63
  var odds = item.Transactions[0].Odds;
@@ -73,7 +73,10 @@ var HistoryWidgetList = function (_React$Component) {
73
73
  'div',
74
74
  null,
75
75
  getMessage(item.Settled ? 'settled' : 'pendling')
76
- )], [React.createElement(Money, { value: item.TotalWin - item.TotalWager, currency: currency }), React.createElement(FormattedRelativeTime, selectUnit(new Date(item.Created + '+00:00')))]];
76
+ )], [React.createElement(Money, {
77
+ value: item.TotalWin - item.TotalWager,
78
+ currency: item.Currency
79
+ }), React.createElement(FormattedRelativeTime, selectUnit(new Date(item.Created + '+00:00')))]];
77
80
  } else if (product === 'bingo') {
78
81
  return [[React.createElement(Translate, {
79
82
  tag: 'div'
@@ -85,7 +88,7 @@ var HistoryWidgetList = function (_React$Component) {
85
88
  getMessage(getByPath(item, 'Transactions[0].TransactionType'))
86
89
  )], [React.createElement(Money, {
87
90
  value: getByPath(item, 'Transactions[0].Amount'),
88
- currency: currency
91
+ currency: item.Currency
89
92
  }), React.createElement(FormattedRelativeTime, selectUnit(new Date(item.Created + '+00:00')))]];
90
93
  } else if (product === 'fantasy') {
91
94
  return [[React.createElement(
@@ -100,7 +103,7 @@ var HistoryWidgetList = function (_React$Component) {
100
103
  getMessage(item.Status === 'Default' ? 'initiated' : item.Status === 'Canceled' ? 'canceled' : 'completed')
101
104
  )], [React.createElement(Money, {
102
105
  value: item.Win - (item.Bet + item.Rake),
103
- currency: currency
106
+ currency: item.Currency
104
107
  }), React.createElement(FormattedRelativeTime, selectUnit(new Date(item.Created + '+00:00')))]];
105
108
  }
106
109
 
@@ -114,9 +117,9 @@ var HistoryWidgetList = function (_React$Component) {
114
117
  getMessage(item.Status)
115
118
  )], [React.createElement(Money, {
116
119
  value: item.TransactionType === 'Withdraw' ? -item.Amount : item.Amount,
117
- currency: currency
120
+ currency: item.Currency
118
121
  }), React.createElement(FormattedRelativeTime, selectUnit(new Date(item.Started + '+00:00')))]];
119
- }, _this.createListDetail = function (item, product, currency) {
122
+ }, _this.createListDetail = function (item, product) {
120
123
  if (product === 'casino') {
121
124
  return [[React.createElement(
122
125
  'div',
@@ -128,14 +131,14 @@ var HistoryWidgetList = function (_React$Component) {
128
131
  id: 'label.history.bet',
129
132
  defaultMessage: 'Bet: {value}',
130
133
  values: {
131
- value: React.createElement(Money, { value: item.Bet, currency: currency })
134
+ value: React.createElement(Money, { value: item.Bet, currency: item.Currency })
132
135
  }
133
136
  }), React.createElement(Translate, {
134
137
  tag: 'div',
135
138
  id: 'label.history.win',
136
139
  defaultMessage: 'Win: {value}',
137
140
  values: {
138
- value: React.createElement(Money, { value: item.Win, currency: currency })
141
+ value: React.createElement(Money, { value: item.Win, currency: item.Currency })
139
142
  }
140
143
  })]];
141
144
  } else if (product === 'sportsbook') {
@@ -164,14 +167,14 @@ var HistoryWidgetList = function (_React$Component) {
164
167
  id: 'label.history.bet',
165
168
  defaultMessage: 'Bet: {value}',
166
169
  values: {
167
- value: React.createElement(Money, { value: item.TotalWager, currency: currency })
170
+ value: React.createElement(Money, { value: item.TotalWager, currency: item.Currency })
168
171
  }
169
172
  }), React.createElement(Translate, {
170
173
  tag: 'div',
171
174
  id: 'label.history.win',
172
175
  defaultMessage: 'Win: {value}',
173
176
  values: {
174
- value: React.createElement(Money, { value: item.TotalWin, currency: currency })
177
+ value: React.createElement(Money, { value: item.TotalWin, currency: item.Currency })
175
178
  }
176
179
  })]];
177
180
  } else if (product === 'bingo') {
@@ -204,14 +207,14 @@ var HistoryWidgetList = function (_React$Component) {
204
207
  id: 'label.history.bet',
205
208
  defaultMessage: 'Bet: {value}',
206
209
  values: {
207
- value: React.createElement(Money, { value: item.Bet + item.Rake, currency: currency })
210
+ value: React.createElement(Money, { value: item.Bet + item.Rake, currency: item.Currency })
208
211
  }
209
212
  }), React.createElement(Translate, {
210
213
  tag: 'div',
211
214
  id: 'label.history.win',
212
215
  defaultMessage: 'Win: {value}',
213
216
  values: {
214
- value: React.createElement(Money, { value: item.Win, currency: currency })
217
+ value: React.createElement(Money, { value: item.Win, currency: item.Currency })
215
218
  }
216
219
  })]];
217
220
  }
@@ -273,8 +276,7 @@ var HistoryWidgetList = function (_React$Component) {
273
276
  var _props = this.props,
274
277
  items = _props.items,
275
278
  product = _props.product,
276
- limit = _props.limit,
277
- currency = _props.currency;
279
+ limit = _props.limit;
278
280
  var page = this.state.page;
279
281
 
280
282
 
@@ -283,8 +285,8 @@ var HistoryWidgetList = function (_React$Component) {
283
285
  var listItems = pageItems.map(function (item) {
284
286
  return {
285
287
  id: item,
286
- info: _this2.createListInfo(item, product, currency, items.isLoading),
287
- detail: _this2.createListDetail(item, product, currency, items.isLoading)
288
+ info: _this2.createListInfo(item, product, items.isLoading),
289
+ detail: _this2.createListDetail(item, product, items.isLoading)
288
290
  };
289
291
  });
290
292
 
@@ -331,7 +333,6 @@ var HistoryWidget = function HistoryWidget(_ref2) {
331
333
  var getTransactions = _ref2.getTransactions,
332
334
  items = _ref2.items,
333
335
  products = _ref2.products,
334
- currency = _ref2.currency,
335
336
  limit = _ref2.limit;
336
337
 
337
338
  var accordionItems = products.map(function (product) {
@@ -339,7 +340,6 @@ var HistoryWidget = function HistoryWidget(_ref2) {
339
340
  header: getMessage(product),
340
341
  content: React.createElement(HistoryWidgetList, {
341
342
  product: product,
342
- currency: currency,
343
343
  limit: limit,
344
344
  getTransactions: getTransactions[product],
345
345
  items: items[product]
@@ -251,7 +251,7 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
251
251
  setValue = _useState2[1];
252
252
 
253
253
  useEffect(function () {
254
- if (newLimit && newLimit.Amount) {
254
+ if (newLimit) {
255
255
  setValue(newLimit.Amount);
256
256
  }
257
257
  }, [newLimit]);
@@ -282,7 +282,7 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
282
282
  });
283
283
  }
284
284
  // If not blocked from removing limit or 'No limit' option is selected -> add 'No limit' option
285
- if (!validationState['limit-remove-blocked'] || value === 0) {
285
+ if (!validationState['limit-remove-blocked'] || value === 0 || value === '') {
286
286
  options.unshift({
287
287
  value: 0,
288
288
  label: messages.get('label.responsible-gaming.option.no-limit')
@@ -319,6 +319,8 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
319
319
  }
320
320
  };
321
321
 
322
+ var isIphone = typeof window !== 'undefined' && navigator.platform === 'iPhone';
323
+
322
324
  return React.createElement(
323
325
  Fragment,
324
326
  null,
@@ -352,7 +354,7 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
352
354
  setValue(parseInt(value));
353
355
  if (value > 0) _onChange(value);
354
356
  },
355
- autoFocus: true,
357
+ autoFocus: !isIphone,
356
358
  min: validationState['limit-remove-blocked'] ? '1' : '0',
357
359
  max: validationState['limit-increase-blocked'] ? getByPath(currentLimit, 'Amount') : Infinity
358
360
  }),
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.format = undefined;
6
7
 
7
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; };
8
9
 
@@ -18,13 +19,25 @@ var _propTypes2 = _interopRequireDefault(_propTypes);
18
19
 
19
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
21
 
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
+ ETH: { min: 5, max: 5 },
30
+ BCH: { min: 5, max: 5 },
31
+ XRP: { min: 3, max: 3 }
32
+ };
33
+
21
34
  /**
22
35
  * FormattedNumber component to display currency
23
36
  */
24
37
  var Money = function Money(props) {
25
38
  return _react2.default.createElement(_reactIntl.FormattedNumber, _extends({
26
- minimumFractionDigits: props.decimals ? 2 : 0,
27
- maximumFractionDigits: props.decimals ? 2 : 0
39
+ minimumFractionDigits: props.decimals ? fractionDigits[props.currency] && fractionDigits[props.currency].min || 2 : 0,
40
+ maximumFractionDigits: props.decimals ? fractionDigits[props.currency] && fractionDigits[props.currency].max || 2 : 0
28
41
  }, props, {
29
42
  style: 'currency'
30
43
  }));
@@ -48,4 +61,14 @@ Money.defaultProps = {
48
61
  decimals: true
49
62
  };
50
63
 
64
+ var format = exports.format = function format(currency) {
65
+ var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en-US';
66
+ return new Intl.NumberFormat(locale, {
67
+ style: 'currency',
68
+ currency: currency,
69
+ minimumFractionDigits: fractionDigits[currency] ? fractionDigits[currency].min : null,
70
+ maximumFractionDigits: fractionDigits[currency] ? fractionDigits[currency].max : null
71
+ });
72
+ };
73
+
51
74
  exports.default = Money;