tg-core-components 6.2.1-alpha.0 → 6.2.1-crypto.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 +7 -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 +7 -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
@@ -4,13 +4,25 @@ import React from 'react';
4
4
  import { FormattedNumber } from 'react-intl';
5
5
  import PropTypes from 'prop-types';
6
6
 
7
+ /**
8
+ * For crypto we want more decimals.
9
+ */
10
+ var fractionDigits = {
11
+ BTC: { min: 5, max: 5 },
12
+ LTC: { min: 5, max: 5 },
13
+ XBC: { min: 5, max: 5 },
14
+ ETH: { min: 5, max: 5 },
15
+ BCH: { min: 5, max: 5 },
16
+ XRP: { min: 3, max: 3 }
17
+ };
18
+
7
19
  /**
8
20
  * FormattedNumber component to display currency
9
21
  */
10
22
  var Money = function Money(props) {
11
23
  return React.createElement(FormattedNumber, _extends({
12
- minimumFractionDigits: props.decimals ? 2 : 0,
13
- maximumFractionDigits: props.decimals ? 2 : 0
24
+ minimumFractionDigits: props.decimals ? fractionDigits[props.currency] && fractionDigits[props.currency].min || 2 : 0,
25
+ maximumFractionDigits: props.decimals ? fractionDigits[props.currency] && fractionDigits[props.currency].max || 2 : 0
14
26
  }, props, {
15
27
  style: 'currency'
16
28
  }));
@@ -34,4 +46,14 @@ Money.defaultProps = {
34
46
  decimals: true
35
47
  };
36
48
 
49
+ export var format = function format(currency) {
50
+ var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en-US';
51
+ return new Intl.NumberFormat(locale, {
52
+ style: 'currency',
53
+ currency: currency,
54
+ minimumFractionDigits: fractionDigits[currency] ? fractionDigits[currency].min : null,
55
+ maximumFractionDigits: fractionDigits[currency] ? fractionDigits[currency].max : null
56
+ });
57
+ };
58
+
37
59
  export default Money;
@@ -35,7 +35,7 @@ var Picture = function Picture(_ref) {
35
35
  });
36
36
  }),
37
37
  React.createElement('img', _extends({
38
- src: typeof src === 'string' && src,
38
+ src: typeof src === 'string' ? src : undefined,
39
39
  width: width,
40
40
  height: height,
41
41
  loading: loading
package/es/index.js CHANGED
@@ -51,9 +51,8 @@ import ResponsibleGamingAccordionSignUp from './widgets/ResponsibleGamingAccordi
51
51
  import ResponsibleGamingSingleSignUp from './widgets/ResponsibleGamingSingleSignUp';
52
52
  import ResponsibleGamingWidget from './widgets/ResponsibleGamingWidget';
53
53
  import VerifyAccordionWidget from './widgets/VerifyAccordionWidget';
54
- import BonusOffers from './widgets/BonusOffers';
55
54
 
56
55
  // misc
57
56
  import countryEmojiFlags from './misc/countryEmojiFlags';
58
57
 
59
- export { BonusOffers, 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 };
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 };
@@ -0,0 +1,3 @@
1
+ export default (function (value) {
2
+ return !value.match(/[\+\=?!@%&<>\[\]{}()<>|$€£#\/\\]/);
3
+ });
@@ -0,0 +1,3 @@
1
+ export default (function (value) {
2
+ return !value.match(/[\s!"#\$%&'\(\)\*\+,\-\.\/:;<>\?@\[\\\]\^_`{|}~]/);
3
+ });
@@ -1,3 +1,3 @@
1
- export default (function (phone) {
2
- return phone ? /^[\+]?[0-9]{0,4}[0-9]{8,12}$/.test(phone) : true;
1
+ export default (function (value) {
2
+ return value.match(/^\+?\d{9,17}$/);
3
3
  });
@@ -8,55 +8,51 @@ var MILISECONDS = {
8
8
  IN_A_YEAR: 31536000000
9
9
  };
10
10
 
11
- export var selectUnit = function selectUnit(value) {
12
- var isFuture = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
13
-
11
+ export var selectUnit = function selectUnit(from) {
14
12
  var now = Date.now();
15
- var ms = isFuture ? value - now : now - value;
16
-
17
- var operatorCalc = isFuture ? 1 : -1;
13
+ var ms = now - from;
18
14
 
19
15
  switch (true) {
20
16
  case MILISECONDS.IN_A_SECOND < ms && ms < MILISECONDS.IN_A_MINUTE:
21
17
  return {
22
- value: operatorCalc * Math.floor(ms / MILISECONDS.IN_A_SECOND),
18
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_SECOND),
23
19
  unit: 'second',
24
20
  updateIntervalInSeconds: 1
25
21
  };
26
22
 
27
23
  case MILISECONDS.IN_A_MINUTE < ms && ms < MILISECONDS.IN_AN_HOUR:
28
24
  return {
29
- value: operatorCalc * Math.floor(ms / MILISECONDS.IN_A_MINUTE),
25
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_MINUTE),
30
26
  unit: 'minute'
31
27
  };
32
28
 
33
29
  case MILISECONDS.IN_AN_HOUR < ms && ms < MILISECONDS.IN_A_DAY:
34
30
  return {
35
- value: operatorCalc * Math.floor(ms / MILISECONDS.IN_AN_HOUR),
31
+ value: -1 * Math.floor(ms / MILISECONDS.IN_AN_HOUR),
36
32
  unit: 'hour'
37
33
  };
38
34
 
39
35
  case MILISECONDS.IN_A_DAY < ms && ms < MILISECONDS.IN_A_WEEK:
40
36
  return {
41
- value: operatorCalc * Math.floor(ms / MILISECONDS.IN_A_DAY),
37
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_DAY),
42
38
  unit: 'day'
43
39
  };
44
40
 
45
41
  case MILISECONDS.IN_A_WEEK < ms && ms < MILISECONDS.IN_A_MONTH:
46
42
  return {
47
- value: operatorCalc * Math.floor(ms / MILISECONDS.IN_A_WEEK),
43
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_WEEK),
48
44
  unit: 'week'
49
45
  };
50
46
 
51
47
  case MILISECONDS.IN_A_MONTH < ms && ms < MILISECONDS.IN_A_YEAR:
52
48
  return {
53
- value: operatorCalc * Math.floor(ms / MILISECONDS.IN_A_MONTH),
49
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_MONTH),
54
50
  unit: 'month'
55
51
  };
56
52
 
57
53
  case MILISECONDS.IN_A_YEAR < ms:
58
54
  return {
59
- value: operatorCalc * Math.floor(ms / MILISECONDS.IN_A_YEAR),
55
+ value: -1 * Math.floor(ms / MILISECONDS.IN_A_YEAR),
60
56
  unit: 'year'
61
57
  };
62
58
 
@@ -9,7 +9,7 @@ var translate = function translate(_ref, intl) {
9
9
  values = _ref.values,
10
10
  rest = _objectWithoutProperties(_ref, ['id', 'values']);
11
11
 
12
- var cacheId = id + (JSON.stringify(values) || '');
12
+ var cacheId = id + (typeof intl !== 'undefined' ? intl.locale : '') + (JSON.stringify(values) || '');
13
13
  if (cache[cacheId]) return cache[cacheId];
14
14
 
15
15
  var g = typeof window !== 'undefined' && window || typeof global !== 'undefined' && global || {};
@@ -9,6 +9,7 @@ export default {
9
9
  AG: '🇦🇬',
10
10
  AU: '🇦🇺',
11
11
  AT: '🇦🇹',
12
+ AW: '🇦🇼',
12
13
  AZ: '🇦🇿',
13
14
  BI: '🇧🇮',
14
15
  BE: '🇧🇪',
@@ -24,6 +25,7 @@ export default {
24
25
  BO: '🇧🇴',
25
26
  BR: '🇧🇷',
26
27
  BB: '🇧🇧',
28
+ BM: '🇧🇲',
27
29
  BN: '🇧🇳',
28
30
  BT: '🇧🇹',
29
31
  BW: '🇧🇼',
@@ -33,6 +35,7 @@ export default {
33
35
  CL: '🇨🇱',
34
36
  CN: '🇨🇳',
35
37
  CI: '🇨🇮',
38
+ CK: '🇨🇰',
36
39
  CM: '🇨🇲',
37
40
  CD: '🇨🇩',
38
41
  CG: '🇨🇬',
@@ -167,6 +170,7 @@ export default {
167
170
  SZ: '🇸🇿',
168
171
  SC: '🇸🇨',
169
172
  SY: '🇸🇾',
173
+ TC: '🇹🇨',
170
174
  TD: '🇹🇩',
171
175
  TG: '🇹🇬',
172
176
  TH: '🇹🇭',
@@ -178,6 +182,7 @@ export default {
178
182
  TN: '🇹🇳',
179
183
  TR: '🇹🇷',
180
184
  TV: '🇹🇻',
185
+ TW: '🇹🇼',
181
186
  TZ: '🇹🇿',
182
187
  UG: '🇺🇬',
183
188
  UA: '🇺🇦',
@@ -12,13 +12,10 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
12
12
 
13
13
  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; }
14
14
 
15
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
16
-
17
15
  import React, { Component, useState } from 'react';
18
16
  import PropTypes from 'prop-types';
19
17
  import AnimateHeight from 'react-animate-height';
20
18
  import Icon from '../../components/Icon';
21
- import cn from 'classnames';
22
19
 
23
20
  var AccordionHeader = function AccordionHeader(_ref) {
24
21
  var expanded = _ref.expanded,
@@ -86,14 +83,10 @@ var AccordionContent = function AccordionContent(_ref2) {
86
83
  var AccordionItem = function AccordionItem(_ref3) {
87
84
  var header = _ref3.header,
88
85
  content = _ref3.content,
89
- expanded = _ref3.expanded,
90
- customClass = _ref3.customClass;
86
+ expanded = _ref3.expanded;
91
87
  return React.createElement(
92
88
  'div',
93
- {
94
- className: cn('AccordionItem', _defineProperty({
95
- 'AccordionItem--expanded': expanded
96
- }, 'AccordionItem--' + customClass, customClass)) },
89
+ { className: 'AccordionItem' + (expanded ? ' AccordionItem--expanded' : '') },
97
90
  header,
98
91
  content
99
92
  );
@@ -182,8 +175,7 @@ var Accordion = function (_Component) {
182
175
  animationDuration: animationDuration,
183
176
  contentCollapsedHeight: contentCollapsedHeight
184
177
  }),
185
- key: index,
186
- customClass: item.customClass
178
+ key: index
187
179
  };
188
180
  });
189
181
 
@@ -3,6 +3,10 @@ import compose from 'recompose/compose';
3
3
  import PropTypes from 'prop-types';
4
4
  import { injectIntl } from 'react-intl';
5
5
  import require from '../../lib/WithValidation/rules/required';
6
+ import phone from '../../lib/WithValidation/rules/phone';
7
+ import blacklistedCharacters from '../../lib/WithValidation/rules/blacklistedCharacters';
8
+ import noSpecialCharacters from '../../lib/WithValidation/rules/noSpecialCharacters';
9
+ import stringWithoutNumbers from '../../lib/WithValidation/rules/stringWithoutNumbers';
6
10
  import WithValidation from '../../lib/WithValidation';
7
11
  import Input from '../../components/Input';
8
12
  import Select from '../../components/Select';
@@ -11,6 +15,32 @@ import Button from '../../components/Button';
11
15
  import countryEmojiFlags from '../../misc/countryEmojiFlags';
12
16
  import Icon from '../../components/Icon';
13
17
 
18
+ var genders = [{
19
+ label: function label(intl) {
20
+ return translate({
21
+ id: 'noun.male',
22
+ defaultMessage: 'Male'
23
+ }, intl);
24
+ },
25
+ value: 'Male'
26
+ }, {
27
+ label: function label(intl) {
28
+ return translate({
29
+ id: 'noun.female',
30
+ defaultMessage: 'Female'
31
+ }, intl);
32
+ },
33
+ value: 'Female'
34
+ }, {
35
+ label: function label(intl) {
36
+ return translate({
37
+ id: 'noun.other',
38
+ defaultMessage: 'Other'
39
+ }, intl);
40
+ },
41
+ value: 'Other'
42
+ }];
43
+
14
44
  var AccountDetail = function AccountDetail(_ref) {
15
45
  var data = _ref.data,
16
46
  intl = _ref.intl,
@@ -18,7 +48,9 @@ var AccountDetail = function AccountDetail(_ref) {
18
48
  onSubmit = _ref.onSubmit,
19
49
  jurisdiction = _ref.jurisdiction,
20
50
  countries = _ref.countries,
21
- isLoading = _ref.isLoading;
51
+ isLoading = _ref.isLoading,
52
+ isComplete = _ref.isComplete,
53
+ showCallingCode = _ref.showCallingCode;
22
54
 
23
55
  return React.createElement(
24
56
  'form',
@@ -93,33 +125,24 @@ var AccountDetail = function AccountDetail(_ref) {
93
125
  React.createElement(
94
126
  Select,
95
127
  {
96
- disabled: true,
128
+ disabled: isComplete,
97
129
  className: 'layout-item-6',
98
- value: countries && countries.value.find(function (c) {
99
- return c.value === data.Country;
100
- }) && countries.value.find(function (c) {
101
- return c.value === data.Country;
102
- }).value,
130
+ value: data.Country,
103
131
  label: translate({
104
132
  id: 'title.country',
105
133
  defaultMessage: 'Country'
106
134
  }, intl),
107
135
  name: 'Country',
108
136
  icon: React.createElement(Icon, { icon: 'flag' }) },
109
- React.createElement(
110
- Select.Option,
111
- {
112
- value: countries && countries.value.find(function (c) {
113
- return c.value === data.Country;
114
- }) && countries.value.find(function (c) {
115
- return c.value === data.Country;
116
- }).value },
117
- countries && countries.value.find(function (c) {
118
- return c.value === data.Country;
119
- }) && countries.value.find(function (c) {
120
- return c.value === data.Country;
121
- }).label
122
- )
137
+ countries.sort(function (a, b) {
138
+ return a.label.localeCompare(b.label);
139
+ }).map(function (c) {
140
+ return React.createElement(
141
+ Select.Option,
142
+ { key: c.value, value: c.value },
143
+ c.label
144
+ );
145
+ })
123
146
  ),
124
147
  React.createElement(Input, {
125
148
  disabled: true,
@@ -132,15 +155,6 @@ var AccountDetail = function AccountDetail(_ref) {
132
155
  name: 'BirthDate'
133
156
  })
134
157
  ),
135
- React.createElement(Input, {
136
- disabled: true,
137
- value: data.Email,
138
- label: translate({
139
- id: 'title.email',
140
- defaultMessage: 'Email'
141
- }, intl),
142
- name: 'Email'
143
- }),
144
158
  React.createElement(Input, {
145
159
  value: data.MobilePhoneNumber,
146
160
  type: 'tel',
@@ -148,7 +162,7 @@ var AccountDetail = function AccountDetail(_ref) {
148
162
  id: 'title.mobile_number',
149
163
  defaultMessage: 'Mobile number'
150
164
  }, intl),
151
- callingCodes: countries ? countries.value.sort(function (a, b) {
165
+ callingCodes: showCallingCode && countries ? countries.sort(function (a, b) {
152
166
  return Number(a.callingCode) - Number(b.callingCode);
153
167
  }).map(function (i) {
154
168
  return {
@@ -161,6 +175,48 @@ var AccountDetail = function AccountDetail(_ref) {
161
175
  status: errors.MobilePhoneNumber && 'failure' || 'idle',
162
176
  statusText: errors.MobilePhoneNumber && translate({ id: errors.MobilePhoneNumber }, intl)
163
177
  }),
178
+ React.createElement(
179
+ 'div',
180
+ { className: 'layout-item' },
181
+ React.createElement(Input, {
182
+ className: 'layout-item-6',
183
+ disabled: true,
184
+ value: data.Email,
185
+ label: translate({
186
+ id: 'title.email',
187
+ defaultMessage: 'Email'
188
+ }, intl),
189
+ name: 'Email'
190
+ }),
191
+ React.createElement(
192
+ Select,
193
+ {
194
+ className: 'layout-item-6',
195
+ value: data.Gender,
196
+ label: translate({
197
+ id: 'title.gender',
198
+ defaultMessage: 'Gender'
199
+ }, intl),
200
+ name: 'Gender',
201
+ status: errors.Gender && 'failure' || 'idle',
202
+ statusText: errors.Gender && translate({ id: errors.Gender }, intl) },
203
+ React.createElement(
204
+ Select.Option,
205
+ { value: '', disabled: true },
206
+ translate({
207
+ id: 'label.select-gender',
208
+ defaultMessage: 'Select gender'
209
+ }, intl)
210
+ ),
211
+ genders.map(function (gender) {
212
+ return React.createElement(
213
+ Select.Option,
214
+ { value: gender.value },
215
+ gender.label(intl)
216
+ );
217
+ })
218
+ )
219
+ ),
164
220
  !['sga', 'dga'].includes(jurisdiction) && React.createElement(
165
221
  Fragment,
166
222
  null,
@@ -175,7 +231,7 @@ var AccountDetail = function AccountDetail(_ref) {
175
231
  name: 'Password',
176
232
  status: errors.Password && 'failure' || 'idle',
177
233
  statusText: errors.Password && translate({ id: errors.Password }, intl),
178
- autoComplete: 'off'
234
+ autocomplete: 'new-password'
179
235
  })
180
236
  ),
181
237
  React.createElement(
@@ -206,7 +262,9 @@ AccountDetail.propTypes = {
206
262
  /** Array of validation errors where the error display depends on which invalid rule it breaks */
207
263
  error: PropTypes.array,
208
264
  /** The submission function firing when submitting the form */
209
- onSubmit: PropTypes.func
265
+ onSubmit: PropTypes.func,
266
+ /** If the user profile is complete or not */
267
+ isComplete: PropTypes.bool
210
268
  };
211
269
 
212
270
  AccountDetail.defaultProps = {
@@ -216,15 +274,18 @@ AccountDetail.defaultProps = {
216
274
  value: '',
217
275
  name: '',
218
276
  error: [],
219
- onSubmit: Function
277
+ onSubmit: Function,
278
+ isComplete: false
220
279
  };
221
280
 
222
281
  var rules = {
223
- MobilePhoneNumber: [[require, 'error.empty.mobilePhoneNumber']],
224
- Address1: [[require, 'error.empty.address']],
225
- Zip: [[require, 'error.empty.zip_code']],
226
- City: [[require, 'error.empty.city']],
227
- Password: [[require, 'error.empty.password']]
282
+ MobilePhoneNumber: [[require, 'error.empty.mobilePhoneNumber'], [phone, 'error.condition.phone']],
283
+ Address1: [[require, 'error.empty.address'], [blacklistedCharacters, 'error.format.address']],
284
+ Zip: [[require, 'error.empty.zip_code'], [noSpecialCharacters, 'error.format.zip']],
285
+ City: [[require, 'error.empty.city'], [stringWithoutNumbers, 'error.invalid.city'], [blacklistedCharacters, 'error.invalid.city']],
286
+ Password: [[require, 'error.empty.password']],
287
+ Country: [[require, 'error.empty.country']],
288
+ Gender: [[require, 'error.empty.gender']]
228
289
  };
229
290
 
230
291
  export default compose(WithValidation(rules), injectIntl)(AccountDetail);
@@ -54,7 +54,7 @@ var ActivationCode = function ActivationCode(_ref) {
54
54
  }, [autoFocus, code]);
55
55
 
56
56
  useEffect(function () {
57
- return inputRef.current.value = code;
57
+ inputRef.current.value = code;
58
58
  }, [code]);
59
59
 
60
60
  var setCaretPosition = function setCaretPosition(from, to) {
@@ -1,7 +1,5 @@
1
1
  var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
2
2
 
3
- function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
4
-
5
3
  import React, { useState } from 'react';
6
4
  import { FormattedNumber, FormattedDate } from 'react-intl';
7
5
  import AccordionWidget from '../AccordionWidget';
@@ -9,7 +7,9 @@ import Button from '../../components/Button';
9
7
  import BonusCode from './BonusCode';
10
8
  import { List } from 'tg-core-components';
11
9
  import Translate from '../../components/Translate';
10
+ import Money from '../../components/Money';
12
11
  import { getBonusState } from './states';
12
+ import { getBonusType } from './types';
13
13
  import marked from 'marked';
14
14
 
15
15
  var ALEACC_BONUS_CLAIM_STATE = ['Initiated', 'PreClaimed'];
@@ -129,10 +129,7 @@ var BonusWidget = function BonusWidget(_ref3) {
129
129
  var bonuses = _ref3.bonuses,
130
130
  handleBonusCodeSubmit = _ref3.handleBonusCodeSubmit,
131
131
  onClaimBonus = _ref3.onClaimBonus,
132
- onRejectBonus = _ref3.onRejectBonus,
133
- _ref3$exclude = _ref3.exclude,
134
- exclude = _ref3$exclude === undefined ? [] : _ref3$exclude,
135
- disableBonusCodeForm = _ref3.disableBonusCodeForm;
132
+ onRejectBonus = _ref3.onRejectBonus;
136
133
 
137
134
  var bonusList = { active: null, available: null, finished: null };
138
135
 
@@ -162,10 +159,11 @@ var BonusWidget = function BonusWidget(_ref3) {
162
159
  var info = [[React.createElement(
163
160
  'div',
164
161
  null,
165
- React.createElement(Translate, {
166
- id: 'label.description.bonus.' + item.Identifier.toLowerCase(),
167
- defaultMessage: item.Name || item.Description
168
- })
162
+ React.createElement(
163
+ 'span',
164
+ null,
165
+ item.Name || item.Description
166
+ )
169
167
  ), React.createElement(
170
168
  'div',
171
169
  null,
@@ -173,15 +171,8 @@ var BonusWidget = function BonusWidget(_ref3) {
173
171
  )], [React.createElement(
174
172
  'div',
175
173
  { className: 'amount' },
176
- React.createElement(FormattedNumber, {
177
- value: item.Amount,
178
- style: item.Type.toLowerCase() == 'freespins' ? 'decimal' : 'currency',
179
- currency: item.Currency
180
- })
181
- ), React.createElement(Translate, {
182
- id: 'label.type.bonus.' + item.Type.toLowerCase(),
183
- defaultMessage: item.Type.toLowerCase()
184
- })]];
174
+ item.Type.toLowerCase() == 'freespins' ? React.createElement(FormattedNumber, { value: item.Amount, style: 'decimal' }) : React.createElement(Money, { value: item.Amount, currency: item.Currency })
175
+ ), getBonusType(item.Type)]];
185
176
 
186
177
  // Add bonus actions to not expired Fasttrack bonuses
187
178
  if (item.Provider === 'fasttrack' && item.State !== 'Expired') info.push(React.createElement(BonusActionFT, { bonus: item, onClaimBonus: onClaimBonus }));
@@ -267,25 +258,19 @@ var BonusWidget = function BonusWidget(_ref3) {
267
258
 
268
259
  var menu = {
269
260
  identifier: 'account-history',
270
- items: [].concat(_toConsumableArray(!exclude.includes('active') ? [{
261
+ items: [{
271
262
  name: React.createElement(Translate, { id: 'label.active', defaultMessage: 'Activate' }),
272
263
  content: React.createElement(List, { data: bonusList['active'], noData: 'list.no_data.active' })
273
- }] : []), _toConsumableArray(!exclude.includes('available') ? [{
264
+ }, {
274
265
  name: React.createElement(Translate, { id: 'label.available', defaultMessage: 'Available' }),
275
- content: React.createElement(List, {
276
- data: bonusList['available'],
277
- noData: 'list.no_data.available'
278
- })
279
- }] : []), _toConsumableArray(!exclude.includes('finished') ? [{
266
+ content: React.createElement(List, { data: bonusList['available'], noData: 'list.no_data.available' })
267
+ }, {
280
268
  name: React.createElement(Translate, { id: 'label.finished', defaultMessage: 'Finished' }),
281
- content: React.createElement(List, {
282
- data: bonusList['finished'],
283
- noData: 'list.no_data.finished'
284
- })
285
- }] : []), _toConsumableArray(disableBonusCodeForm && {
269
+ content: React.createElement(List, { data: bonusList['finished'], noData: 'list.no_data.finished' })
270
+ }, {
286
271
  name: React.createElement(Translate, { id: 'label.bonus_code', defaultMessage: 'Bonus code' }),
287
272
  content: React.createElement(BonusCode, { handleSubmit: handleBonusCodeSubmit })
288
- }))
273
+ }]
289
274
  };
290
275
 
291
276
  var items = menu.items.map(function (item, i) {
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import Translate from '../../components/Translate';
3
+
4
+ export var getBonusType = function getBonusType(type) {
5
+ var translations = {
6
+ Monetary: React.createElement(Translate, { id: 'label.type.bonus.monetary', defaultMessage: 'Monetary' }),
7
+ Freespins: React.createElement(Translate, { id: 'label.type.bonus.freespins', defaultMessage: 'Freespins' }),
8
+ FreespinsMonetary: React.createElement(Translate, {
9
+ id: 'label.type.bonus.freespinsMonetary',
10
+ defaultMessage: 'Freespins Monetary'
11
+ }),
12
+ FreeBetsMonetary: React.createElement(Translate, {
13
+ id: 'label.type.bonus.freeBetsMonetary',
14
+ defaultMessage: 'Free Bets Monetary'
15
+ })
16
+ };
17
+
18
+ return translations[type] || React.createElement(
19
+ 'span',
20
+ null,
21
+ type
22
+ );
23
+ };
@@ -1,3 +1,5 @@
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
+
1
3
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2
4
 
3
5
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -40,9 +42,11 @@ var InjectedIframeHTML = function (_Component) {
40
42
  value: function render() {
41
43
  var _this2 = this;
42
44
 
43
- var data = this.props.data;
45
+ var _props = this.props,
46
+ data = _props.data,
47
+ iframeProps = _props.iframeProps;
44
48
 
45
- return React.createElement('iframe', {
49
+ return React.createElement('iframe', _extends({
46
50
  ref: function ref(node) {
47
51
  return _this2._iframe = node;
48
52
  },
@@ -50,7 +54,7 @@ var InjectedIframeHTML = function (_Component) {
50
54
  width: '100%',
51
55
  height: data.redirectOutput.height,
52
56
  onLoad: this.handleLoad
53
- });
57
+ }, iframeProps));
54
58
  }
55
59
  }]);
56
60
 
@@ -94,6 +94,7 @@ var PaymentForm = function (_Component) {
94
94
  return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref3 = PaymentForm.__proto__ || Object.getPrototypeOf(PaymentForm)).call.apply(_ref3, [this].concat(args))), _this), _this.onMessage = function (message) {
95
95
  var operatingSystem = _this.props.operatingSystem;
96
96
 
97
+ console.log({ message: message });
97
98
  var data = JSON.parse(message.data);
98
99
 
99
100
  if (data.method === 'OPEN_APP') {
@@ -124,7 +125,8 @@ var PaymentForm = function (_Component) {
124
125
  onClose = _props.onClose,
125
126
  onSuccess = _props.onSuccess,
126
127
  redirect = _props.redirect,
127
- details = _props.details;
128
+ details = _props.details,
129
+ iframeProps = _props.iframeProps;
128
130
 
129
131
 
130
132
  if (!data.success) {
@@ -161,19 +163,19 @@ var PaymentForm = function (_Component) {
161
163
  target: redirect ? '_top' : frameId
162
164
  }, data.redirectOutput));
163
165
  } else if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'POST' && data.redirectOutput.html != null) {
164
- return React.createElement(InjectedIframeHTML, { data: data });
166
+ return React.createElement(InjectedIframeHTML, { data: data, iframeProps: iframeProps });
165
167
  } else if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'GET' && data.redirectOutput.html != null) {
166
- return React.createElement(InjectedIframeHTML, { data: data });
168
+ return React.createElement(InjectedIframeHTML, { data: data, iframeProps: iframeProps });
167
169
  } else if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'GET' && redirect) {
168
170
  window.location.href = data.redirectOutput.url;
169
171
  return null;
170
172
  } else if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'GET') {
171
- return React.createElement('iframe', {
173
+ return React.createElement('iframe', _extends({
172
174
  src: data.redirectOutput.url,
173
175
  width: data.redirectOutput.width,
174
176
  height: data.redirectOutput.height,
175
177
  frameBorder: '0'
176
- });
178
+ }, iframeProps));
177
179
  } else if (data.redirectOutput.container == 'window' && data.redirectOutput.method == 'POST') {
178
180
  return React.createElement(DynamicForm, data.redirectOutput);
179
181
  } else if (data.redirectOutput.container == 'window' && data.redirectOutput.method == 'GET') {