tg-core-components 5.2.1-history-time-label.0 → 5.3.0-master.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 (93) hide show
  1. package/es/components/AcceptUpdatedTaC/index.js +8 -3
  2. package/es/components/Checkbox/index.js +93 -0
  3. package/es/components/Deposit/CardInput/index.js +1 -3
  4. package/es/components/Input/index.js +222 -22
  5. package/es/components/InputWrapper/index.js +69 -0
  6. package/es/components/Notification.js +4 -4
  7. package/es/components/Select/index.js +202 -64
  8. package/es/components/Select/test.js +111 -0
  9. package/es/index.js +2 -1
  10. package/es/lib/utils/translate.js +1 -8
  11. package/es/widgets/AccountDetail/index.js +53 -77
  12. package/es/widgets/ActivateWidget/index.js +59 -293
  13. package/es/widgets/BonusWidget/BonusCode.js +24 -17
  14. package/es/widgets/BonusWidget/index.js +83 -45
  15. package/es/widgets/Cashier/Deposit/PaymentForm/NewTab.js +28 -0
  16. package/es/widgets/Cashier/Deposit/PaymentForm/index.js +6 -2
  17. package/es/widgets/CashierAccordion/Deposit/BonusCodeInput/index.js +9 -6
  18. package/es/widgets/CashierAccordion/Deposit/DepositWidget/index.js +19 -29
  19. package/es/widgets/CashierAccordion/Payment/PaymentAccountForms/index.js +163 -347
  20. package/es/widgets/CashierAccordion/Payment/PaymentAccountParser.js +0 -6
  21. package/es/widgets/CashierAccordion/Withdraw/WithdrawWidget/index.js +8 -22
  22. package/es/widgets/ChangePassword/index.js +53 -40
  23. package/es/widgets/HistoryWidget/index.js +69 -51
  24. package/es/widgets/HistoryWidget/message.js +17 -20
  25. package/es/widgets/RequestResetPassword/index.js +15 -14
  26. package/es/widgets/ResetPassword/index.js +22 -18
  27. package/es/widgets/ResponsibleGamingAccordion/LimitStatus/index.js +5 -2
  28. package/es/widgets/ResponsibleGamingAccordion/PeriodItemContent/index.js +1 -2
  29. package/es/widgets/ResponsibleGamingSingleSignUp/AmountItem/index.js +1 -2
  30. package/es/widgets/ResponsibleGamingWidget/Timespan.js +14 -24
  31. package/es/widgets/ResponsibleGamingWidget/helpers.js +2 -2
  32. package/es/widgets/ResponsibleGamingWidget/validate.js +1 -1
  33. package/es/widgets/Settings/index.js +2 -2
  34. package/es/widgets/SignIn/SignInForm.js +4 -6
  35. package/es/widgets/SignIn/index.js +21 -21
  36. package/es/widgets/SignUp/ContactInfoStep.js +5 -6
  37. package/es/widgets/SportsbookSettings/index.js +10 -24
  38. package/es/widgets/Subscriptions/index.js +3 -5
  39. package/lib/components/AcceptUpdatedTaC/index.js +11 -3
  40. package/lib/components/Checkbox/index.js +106 -0
  41. package/lib/components/Deposit/CardInput/index.js +1 -3
  42. package/lib/components/Input/index.js +223 -26
  43. package/lib/components/InputWrapper/index.js +85 -0
  44. package/lib/components/Notification.js +3 -3
  45. package/lib/components/Select/index.js +209 -63
  46. package/lib/components/Select/test.js +121 -0
  47. package/lib/index.js +9 -4
  48. package/lib/lib/utils/translate.js +1 -8
  49. package/lib/widgets/AccountDetail/index.js +53 -86
  50. package/lib/widgets/ActivateWidget/index.js +58 -305
  51. package/lib/widgets/BonusWidget/BonusCode.js +24 -20
  52. package/lib/widgets/BonusWidget/index.js +85 -44
  53. package/lib/widgets/Cashier/Deposit/PaymentForm/NewTab.js +44 -0
  54. package/lib/widgets/Cashier/Deposit/PaymentForm/index.js +9 -2
  55. package/lib/widgets/CashierAccordion/Deposit/BonusCodeInput/index.js +13 -7
  56. package/lib/widgets/CashierAccordion/Deposit/DepositWidget/index.js +22 -32
  57. package/lib/widgets/CashierAccordion/Payment/PaymentAccountForms/index.js +195 -378
  58. package/lib/widgets/CashierAccordion/Payment/PaymentAccountParser.js +0 -6
  59. package/lib/widgets/CashierAccordion/Withdraw/WithdrawWidget/index.js +10 -24
  60. package/lib/widgets/ChangePassword/index.js +53 -43
  61. package/lib/widgets/HistoryWidget/index.js +69 -51
  62. package/lib/widgets/HistoryWidget/message.js +17 -20
  63. package/lib/widgets/RequestResetPassword/index.js +15 -17
  64. package/lib/widgets/ResetPassword/index.js +25 -21
  65. package/lib/widgets/ResponsibleGamingAccordion/LimitStatus/index.js +5 -2
  66. package/lib/widgets/ResponsibleGamingAccordion/PeriodItemContent/index.js +1 -2
  67. package/lib/widgets/ResponsibleGamingSingleSignUp/AmountItem/index.js +1 -2
  68. package/lib/widgets/ResponsibleGamingWidget/Timespan.js +14 -24
  69. package/lib/widgets/ResponsibleGamingWidget/helpers.js +2 -2
  70. package/lib/widgets/ResponsibleGamingWidget/validate.js +1 -1
  71. package/lib/widgets/Settings/index.js +6 -6
  72. package/lib/widgets/SignIn/SignInForm.js +7 -6
  73. package/lib/widgets/SignIn/index.js +25 -25
  74. package/lib/widgets/SignUp/ContactInfoStep.js +8 -6
  75. package/lib/widgets/SportsbookSettings/index.js +10 -24
  76. package/lib/widgets/Subscriptions/index.js +3 -11
  77. package/package.json +8 -3
  78. package/es/components/Input/BirthdateInput.js +0 -171
  79. package/es/components/Input/Checkbox.js +0 -51
  80. package/es/components/Input/Input.js +0 -73
  81. package/es/components/Input/PasswordInput.js +0 -84
  82. package/es/components/Input/PhoneNumberInput.js +0 -110
  83. package/es/components/Input/input.test.js +0 -80
  84. package/es/components/Input/old-input.test.js +0 -100
  85. package/es/components/common.js +0 -339
  86. package/lib/components/Input/BirthdateInput.js +0 -192
  87. package/lib/components/Input/Checkbox.js +0 -65
  88. package/lib/components/Input/Input.js +0 -87
  89. package/lib/components/Input/PasswordInput.js +0 -101
  90. package/lib/components/Input/PhoneNumberInput.js +0 -127
  91. package/lib/components/Input/input.test.js +0 -89
  92. package/lib/components/Input/old-input.test.js +0 -107
  93. package/lib/components/common.js +0 -359
@@ -1,192 +0,0 @@
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 _Translate = require('../Translate');
16
-
17
- var _Translate2 = _interopRequireDefault(_Translate);
18
-
19
- var _translate = require('../../lib/utils/translate');
20
-
21
- var _translate2 = _interopRequireDefault(_translate);
22
-
23
- var _classnames = require('classnames');
24
-
25
- var _classnames2 = _interopRequireDefault(_classnames);
26
-
27
- var _reactIntl = require('react-intl');
28
-
29
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30
-
31
- 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; }
32
-
33
- var pad = function pad(num) {
34
- return ('' + num).length === 1 ? '0' + num : num;
35
- };
36
- var yearRange = new Array(100).fill(null, 0, 100).map(function (y, i) {
37
- return new Date().getFullYear() - 18 - i;
38
- });
39
- var monthRange = new Array(12).fill(null, 0, 12).map(function (m, i) {
40
- return i + 1;
41
- });
42
- var dayRange = new Array(31).fill(null, 0, 31).map(function (d, i) {
43
- return i + 1;
44
- });
45
-
46
- var BirthdateInput = function BirthdateInput(props) {
47
- var intl = (0, _reactIntl.useIntl)();
48
-
49
- var yearInput = {
50
- id: (0, _common.useId)(),
51
- value: (0, _common.useValue)(props.value.split('/')[0]),
52
- focus: (0, _common.useFocus)()
53
- };
54
-
55
- var monthInput = {
56
- id: (0, _common.useId)(),
57
- value: (0, _common.useValue)(props.value.split('/')[1]),
58
- focus: (0, _common.useFocus)()
59
- };
60
-
61
- var dayInput = {
62
- id: (0, _common.useId)(),
63
- value: (0, _common.useValue)(props.value.split('/')[2]),
64
- focus: (0, _common.useFocus)()
65
- };
66
-
67
- var createValue = function createValue() {
68
- var _Object$values;
69
-
70
- var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
71
- var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
72
- return Object.values((_Object$values = {}, _defineProperty(_Object$values, yearInput.id, yearInput.value.value), _defineProperty(_Object$values, monthInput.id, monthInput.value.value), _defineProperty(_Object$values, dayInput.id, dayInput.value.value), _defineProperty(_Object$values, id, value), _Object$values)).join('/');
73
- };
74
-
75
- var _onChange = function _onChange(e) {
76
- return props.onChange && props.onChange(e, createValue(e.target.id, e.target.value));
77
- };
78
-
79
- var _onBlur = function _onBlur(e) {
80
- return props.onBlur && props.onBlur(e, createValue(e.target.id, e.target.value));
81
- };
82
-
83
- var inputs = [yearInput, monthInput, dayInput];
84
- var className = (0, _common.createClassName)('tg-birthdate-input', {
85
- hasValue: inputs.some(function (i) {
86
- return i.value.hasValue;
87
- }),
88
- hasFocus: inputs.some(function (i) {
89
- return i.focus.hasFocus;
90
- }),
91
- status: props.status
92
- });
93
-
94
- return _react2.default.createElement(
95
- 'div',
96
- { className: (0, _classnames2.default)(props.className, className) },
97
- _react2.default.createElement(
98
- 'label',
99
- { className: 'tg-birthdate-input__label' },
100
- props.label
101
- ),
102
- _react2.default.createElement(
103
- _common.Select,
104
- _extends({}, (0, _common.flatObj)(yearInput), {
105
- name: props.name + '_year',
106
- label: _react2.default.createElement(_Translate2.default, { id: 'label.year-of-birth', defaultMessage: 'Year' }),
107
- status: props.status,
108
- onChange: function onChange(e) {
109
- yearInput.value.onChange(e.target.value);
110
- _onChange(e);
111
- },
112
- onBlur: function onBlur(e) {
113
- yearInput.focus.onBlur();
114
- _onBlur(e);
115
- } }),
116
- !yearInput.value.hasValue && _react2.default.createElement(
117
- _common.Select.Option,
118
- { value: '', selected: true, disabled: true },
119
- (0, _translate2.default)({ id: 'label.year-of-birth', defaultMessage: 'Year' }, intl)
120
- ),
121
- yearRange.map(function (y) {
122
- return _react2.default.createElement(
123
- _common.Select.Option,
124
- { key: y, value: y },
125
- y
126
- );
127
- })
128
- ),
129
- _react2.default.createElement(
130
- _common.Select,
131
- _extends({}, (0, _common.flatObj)(monthInput), {
132
- name: props.name + '_month',
133
- label: _react2.default.createElement(_Translate2.default, { id: 'label.month-of-birth', defaultMessage: 'Month' }),
134
- status: props.status,
135
- onChange: function onChange(e) {
136
- monthInput.value.onChange(e.target.value);
137
- _onChange(e);
138
- },
139
- onBlur: function onBlur(e) {
140
- monthInput.focus.onBlur();
141
- _onBlur(e);
142
- } }),
143
- !monthInput.value.hasValue && _react2.default.createElement(
144
- _common.Select.Option,
145
- { value: '', selected: true, disabled: true },
146
- (0, _translate2.default)({ id: 'label.month-of-birth', defaultMessage: 'Month' }, intl)
147
- ),
148
- monthRange.map(function (m) {
149
- return _react2.default.createElement(
150
- _common.Select.Option,
151
- { key: m, value: pad(m) },
152
- m
153
- );
154
- })
155
- ),
156
- _react2.default.createElement(
157
- _common.Select,
158
- _extends({}, (0, _common.flatObj)(dayInput), {
159
- name: props.name + '_day',
160
- label: _react2.default.createElement(_Translate2.default, { id: 'label.day-of-birth', defaultMessage: 'Day' }),
161
- status: props.status,
162
- onChange: function onChange(e) {
163
- dayInput.value.onChange(e.target.value);
164
- _onChange(e);
165
- },
166
- onBlur: function onBlur(e) {
167
- dayInput.focus.onBlur();
168
- _onBlur(e);
169
- } }),
170
- !dayInput.value.hasValue && _react2.default.createElement(
171
- _common.Select.Option,
172
- { value: '', selected: true, disabled: true },
173
- (0, _translate2.default)({ id: 'label.day-of-birth', defaultMessage: 'Day' }, intl)
174
- ),
175
- dayRange.map(function (d) {
176
- return _react2.default.createElement(
177
- _common.Select.Option,
178
- { key: d, value: pad(d) },
179
- d
180
- );
181
- })
182
- ),
183
- _react2.default.createElement(_common.Input, { type: 'hidden', name: props.name, value: createValue() }),
184
- _react2.default.createElement(
185
- 'div',
186
- { className: 'tg-birthdate-input__status-text' },
187
- props.statusText
188
- )
189
- );
190
- };
191
-
192
- exports.default = BirthdateInput;
@@ -1,65 +0,0 @@
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
- var TGCheckbox = function TGCheckbox(props) {
22
- var checkbox = {
23
- id: (0, _common.useId)(),
24
- value: (0, _common.useValue)(props.value),
25
- focus: (0, _common.useFocus)(),
26
- touched: (0, _common.useTouched)(),
27
- autofill: (0, _common.useAutofill)()
28
- };
29
-
30
- var _onChange = function _onChange(e) {
31
- return props.onChange && props.onChange(e, e.target.checked ? 'true' : '');
32
- };
33
-
34
- var className = (0, _common.createClassName)('tg-checkbox', {
35
- hasValue: checkbox.value.hasValue,
36
- hasLabel: Boolean(props.label),
37
- hasFocus: checkbox.focus.hasFocus,
38
- hasTouched: checkbox.touched.hasTouched,
39
- hasAutofill: checkbox.autofill.hasAutofill,
40
- disabled: props.disabled,
41
- status: props.status
42
- });
43
-
44
- return _react2.default.createElement(
45
- 'div',
46
- { className: (0, _classnames2.default)(props.className, className) },
47
- _react2.default.createElement(_common.Checkbox, _extends({}, props, (0, _common.flatObj)(checkbox), {
48
- onChange: function onChange(e) {
49
- checkbox.value.onChange(e.target.checked ? 'true' : '');
50
- _onChange(e);
51
- },
52
- onFocus: function onFocus() {
53
- checkbox.focus.onFocus();
54
- checkbox.touched.onFocus();
55
- }
56
- })),
57
- _react2.default.createElement(
58
- 'div',
59
- { className: 'tg-checkbox__status-text' },
60
- props.statusText
61
- )
62
- );
63
- };
64
-
65
- exports.default = TGCheckbox;
@@ -1,87 +0,0 @@
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 TGInput = function TGInput(_ref) {
24
- var icon = _ref.icon,
25
- props = _objectWithoutProperties(_ref, ['icon']);
26
-
27
- var input = {
28
- id: (0, _common.useId)(),
29
- value: (0, _common.useValue)(props.value),
30
- focus: (0, _common.useFocus)(),
31
- touched: (0, _common.useTouched)(),
32
- autofill: (0, _common.useAutofill)()
33
- };
34
-
35
- var _onChange = function _onChange(e) {
36
- return props.onChange && props.onChange(e, e.target.value);
37
- };
38
-
39
- var _onBlur = function _onBlur(e) {
40
- return props.onBlur && props.onBlur(e, e.target.value);
41
- };
42
-
43
- var className = (0, _common.createClassName)('tg-input', {
44
- hasValue: input.value.hasValue,
45
- hasLabel: Boolean(props.label),
46
- hasFocus: input.focus.hasFocus,
47
- hasTouched: input.touched.hasTouched,
48
- hasAutofill: input.autofill.hasAutofill,
49
- disabled: props.disabled,
50
- status: props.status
51
- });
52
-
53
- return _react2.default.createElement(
54
- 'div',
55
- { className: (0, _classnames2.default)(props.className, className) },
56
- _react2.default.createElement(_common.Input, _extends({}, props, (0, _common.flatObj)(input), {
57
- onChange: function onChange(e) {
58
- if (typeof props.transform === 'function') {
59
- e.target.value = props.transform(e.target.value);
60
- }
61
- input.value.onChange(e.target.value);
62
- _onChange(e);
63
- },
64
- onFocus: function onFocus() {
65
- input.focus.onFocus();
66
- input.touched.onFocus();
67
- },
68
- onBlur: function onBlur(e) {
69
- input.focus.onBlur();
70
- _onBlur(e);
71
- },
72
- leadingLane: [icon].filter(function (i) {
73
- return i;
74
- }),
75
- trailingLane: [_common.statusIcons[props.status]].filter(function (i) {
76
- return i;
77
- })
78
- })),
79
- _react2.default.createElement(
80
- 'div',
81
- { className: 'tg-input__status-text' },
82
- props.statusText
83
- )
84
- );
85
- };
86
-
87
- exports.default = TGInput;
@@ -1,101 +0,0 @@
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 _Icon = require('../Icon');
14
-
15
- var _Icon2 = _interopRequireDefault(_Icon);
16
-
17
- var _common = require('../common');
18
-
19
- var _classnames = require('classnames');
20
-
21
- var _classnames2 = _interopRequireDefault(_classnames);
22
-
23
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
-
25
- var PasswordInput = function PasswordInput(props) {
26
- var input = {
27
- id: (0, _common.useId)(),
28
- value: (0, _common.useValue)(props.value),
29
- focus: (0, _common.useFocus)(),
30
- touched: (0, _common.useTouched)(),
31
- type: (0, _common.useType)(props.type),
32
- autofill: (0, _common.useAutofill)()
33
- };
34
-
35
- var _onChange = function _onChange(e) {
36
- return props.onChange && props.onChange(e, e.target.value);
37
- };
38
-
39
- var _onBlur = function _onBlur(e) {
40
- return props.onBlur && props.onBlur(e, e.target.value);
41
- };
42
-
43
- var togglePasswordVisibility = function togglePasswordVisibility() {
44
- return input.type.setType(input.type.type === 'password' ? 'text' : 'password');
45
- };
46
-
47
- var icons = {
48
- password: _react2.default.createElement(_Icon2.default, {
49
- icon: 'eye-slash',
50
- className: 'tg-password-input__toggle',
51
- onClick: togglePasswordVisibility
52
- }),
53
- text: _react2.default.createElement(_Icon2.default, {
54
- icon: 'eye',
55
- className: 'tg-password-input__toggle',
56
- onClick: togglePasswordVisibility
57
- })
58
- };
59
-
60
- var className = (0, _common.createClassName)('tg-password-input', {
61
- hasValue: input.value.hasValue,
62
- hasLabel: Boolean(props.label),
63
- hasFocus: input.focus.hasFocus,
64
- hasTouched: input.touched.hasTouched,
65
- hasAutofill: input.autofill.hasAutofill,
66
- disabled: props.disabled,
67
- status: props.status
68
- });
69
-
70
- return _react2.default.createElement(
71
- 'div',
72
- { className: (0, _classnames2.default)(props.className, className) },
73
- _react2.default.createElement(_common.Input, _extends({}, props, (0, _common.flatObj)(input), {
74
- onChange: function onChange(e) {
75
- input.value.onChange(e.target.value);
76
- _onChange(e);
77
- },
78
- onFocus: function onFocus() {
79
- input.focus.onFocus();
80
- input.touched.onFocus();
81
- },
82
- onBlur: function onBlur(e) {
83
- input.focus.onBlur();
84
- _onBlur(e);
85
- },
86
- leadingLane: [props.icon].filter(function (i) {
87
- return i;
88
- }),
89
- trailingLane: [icons[input.type.type], _common.statusIcons[props.status]].filter(function (i) {
90
- return i;
91
- })
92
- })),
93
- _react2.default.createElement(
94
- 'div',
95
- { className: 'tg-password-input__status-text' },
96
- props.statusText
97
- )
98
- );
99
- };
100
-
101
- exports.default = PasswordInput;