tg-core-components 6.3.4-3.25 → 6.3.4-3.4

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.
@@ -242,6 +242,7 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
242
242
  hideRemainingLimit = _ref10.hideRemainingLimit,
243
243
  showCurrentValue = _ref10.showCurrentValue,
244
244
  hideOther = _ref10.hideOther,
245
+ maxAmounts = _ref10.maxAmounts,
245
246
  values = _ref10.values,
246
247
  messages = _ref10.messages,
247
248
  isTime = _ref10.isTime,
@@ -348,6 +349,7 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
348
349
  inputMode === 'input' && React.createElement(
349
350
  Fragment,
350
351
  null,
352
+ console.log(newLimit),
351
353
  React.createElement(Input, {
352
354
  type: 'number',
353
355
  pattern: '\\d*',
@@ -10,7 +10,7 @@ export var getValues = function getValues(values, currency, timespan) {
10
10
  return (Array.isArray(values) ? values : []).filter(function (v) {
11
11
  return (typeof v === 'undefined' ? 'undefined' : _typeof(v)) === 'object' && v.timespan === timespan || typeof v === 'number';
12
12
  }).map(function (v) {
13
- return (typeof v === 'undefined' ? 'undefined' : _typeof(v)) === 'object' ? v.amount ? v.amount : v.maxAmount : v;
13
+ return (typeof v === 'undefined' ? 'undefined' : _typeof(v)) === 'object' ? v.amount : v;
14
14
  });
15
15
  };
16
16
 
@@ -16,7 +16,6 @@ import messages from './messages';
16
16
  import Timespan from './Timespan';
17
17
  import getByPath from 'lodash/get';
18
18
  import marked from 'marked';
19
- import { getValues } from './helpers';
20
19
 
21
20
  var ResponsibleGaming = function ResponsibleGaming(_ref) {
22
21
  var limits = _ref.limits,
@@ -113,7 +112,7 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
113
112
  Product: product,
114
113
  Timespan: timespan,
115
114
  Amount: amount,
116
- MaxAmount: maxAmounts && maxAmounts[currency] ? getValues(maxAmounts, currency, timespan)[0] : Infinity,
115
+ MaxAmount: maxAmounts,
117
116
  Status: 'NewLimit'
118
117
  };
119
118
  var limits = localLimits.filter(function (l) {
@@ -124,6 +123,8 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
124
123
  };
125
124
  };
126
125
 
126
+ console.log(normalizedLimits);
127
+
127
128
  return React.createElement(
128
129
  'div',
129
130
  { className: cn('ResponsibleGamingWidget', className) },
@@ -141,7 +142,7 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
141
142
  tooltipOpen: normalizedLimits.tooltipOpen
142
143
  }),
143
144
  React.createElement(LimitContent, _extends({
144
- onSubmitLimits: onSubmitLimits(normalizedLimits.type, normalizedLimits.product),
145
+ onSubmitLimits: onSubmitLimits(normalizedLimits.type, normalizedLimits.product, normalizedLimits.maxAmounts),
145
146
  onChangeLimit: onChangeLimit(normalizedLimits.type, normalizedLimits.product, normalizedLimits.maxAmounts),
146
147
  hideSubmit: hideSubmit,
147
148
  onConfirmLimit: onConfirmLimit,
@@ -180,6 +181,7 @@ var LimitContent = function LimitContent(_ref3) {
180
181
  getAlerts = _ref3.getAlerts,
181
182
  isLoading = _ref3.isLoading,
182
183
  currency = _ref3.currency,
184
+ maxAmounts = _ref3.maxAmounts,
183
185
  values = _ref3.values,
184
186
  valueType = _ref3.valueType,
185
187
  hideRemainingLimit = _ref3.hideRemainingLimit,
@@ -193,6 +195,8 @@ var LimitContent = function LimitContent(_ref3) {
193
195
 
194
196
  var alerts = getAlerts(Object.keys(timespans));
195
197
 
198
+ console.log(Object.values);
199
+
196
200
  var onSubmit = function onSubmit(e) {
197
201
  e.preventDefault();
198
202
  var limits = Object.values(timespans).filter(function (t) {
@@ -225,30 +229,36 @@ var LimitContent = function LimitContent(_ref3) {
225
229
  currency: currency
226
230
  }),
227
231
  Object.values(timespans).map(function (t) {
228
- return React.createElement(Timespan, _extends({
229
- key: t.timespan,
230
- title: Object.values(timespans).length > 1 && messages.get('header.responsible-gaming.timespan.' + t.timespan),
231
- onChangeLimit: onChangeLimit(t.timespan),
232
- onResetLimit: function onResetLimit() {
233
- return onSubmitLimits([t.currentLimit]);
234
- },
235
- onConfirmLimit: onConfirmLimit,
236
- onDeclineLimit: onDeclineLimit,
237
- onPickLimit: function onPickLimit(id) {
238
- return onSubmitLimits(t.pickLimits.filter(function (l) {
239
- return l.Id !== id;
240
- }).map(function (l) {
241
- return _extends({}, l, { Amount: 0 });
242
- }));
243
- },
244
- validationState: getValidationState(t.timespan),
245
- currency: currency,
246
- values: values,
247
- valueType: valueType,
248
- hideRemainingLimit: hideRemainingLimit,
249
- showCurrentValue: showCurrentValue,
250
- hideOther: hideOther
251
- }, t));
232
+ return React.createElement(
233
+ 'div',
234
+ null,
235
+ console.log(t),
236
+ React.createElement(Timespan, _extends({
237
+ key: t.timespan,
238
+ title: Object.values(timespans).length > 1 && messages.get('header.responsible-gaming.timespan.' + t.timespan),
239
+ onChangeLimit: onChangeLimit(t.timespan),
240
+ onResetLimit: function onResetLimit() {
241
+ return onSubmitLimits([t.currentLimit]);
242
+ },
243
+ onConfirmLimit: onConfirmLimit,
244
+ onDeclineLimit: onDeclineLimit,
245
+ onPickLimit: function onPickLimit(id) {
246
+ return onSubmitLimits(t.pickLimits.filter(function (l) {
247
+ return l.Id !== id;
248
+ }).map(function (l) {
249
+ return _extends({}, l, { Amount: 0 });
250
+ }));
251
+ },
252
+ validationState: getValidationState(t.timespan),
253
+ currency: currency,
254
+ maxAmounts: maxAmounts,
255
+ values: values,
256
+ valueType: valueType,
257
+ hideRemainingLimit: hideRemainingLimit,
258
+ showCurrentValue: showCurrentValue,
259
+ hideOther: hideOther
260
+ }, t))
261
+ );
252
262
  }),
253
263
  !hideSubmit && React.createElement(
254
264
  Button,
@@ -50,7 +50,7 @@ var validate = function validate(_ref) {
50
50
  * Compose jurisdictions with rules
51
51
  */
52
52
  var common = (_common = {}, _defineProperty(_common, 'show-confirm-on-submit', type === 'Block' || type === 'SelfExclude'), _defineProperty(_common, 'insufficient-limit-count', false), _defineProperty(_common, 'limits-are-pristine', limitsArePristine), _defineProperty(_common, 'limit-increase-blocked', false), _defineProperty(_common, 'limit-remove-blocked', false), _defineProperty(_common, 'limit-above-maxlimit', exceedingMaxLimitAmount), _defineProperty(_common, 'isValid', function isValid() {
53
- return !this['insufficient-limit-count'] && !(this['limit-increase-blocked'] && isIncreasingLimit) && !(this['limit-remove-blocked'] && isRemovingLimit) && !this['limit-above-maxlimit'];
53
+ return !this['insufficient-limit-count'] && !(this['limit-increase-blocked'] && isIncreasingLimit) && !(this['limit-remove-blocked'] && isRemovingLimit);
54
54
  }), _common);
55
55
  var mga = {};
56
56
  var sga = (_sga = {}, _defineProperty(_sga, 'insufficient-limit-count', type === 'Deposit' && limitCount < 3), _defineProperty(_sga, 'limit-remove-blocked', type === 'Deposit'), _defineProperty(_sga, 'monthly-deposit-above-10k', getByPath(newMonthlyDepositLimit, 'newLimit.Amount') >= 10000), _sga);
@@ -273,6 +273,7 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
273
273
  hideRemainingLimit = _ref10.hideRemainingLimit,
274
274
  showCurrentValue = _ref10.showCurrentValue,
275
275
  hideOther = _ref10.hideOther,
276
+ maxAmounts = _ref10.maxAmounts,
276
277
  values = _ref10.values,
277
278
  messages = _ref10.messages,
278
279
  isTime = _ref10.isTime,
@@ -379,6 +380,7 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
379
380
  inputMode === 'input' && _react2.default.createElement(
380
381
  _react.Fragment,
381
382
  null,
383
+ console.log(newLimit),
382
384
  _react2.default.createElement(_Input2.default, {
383
385
  type: 'number',
384
386
  pattern: '\\d*',
@@ -21,7 +21,7 @@ var getValues = exports.getValues = function getValues(values, currency, timespa
21
21
  return (Array.isArray(values) ? values : []).filter(function (v) {
22
22
  return (typeof v === 'undefined' ? 'undefined' : _typeof(v)) === 'object' && v.timespan === timespan || typeof v === 'number';
23
23
  }).map(function (v) {
24
- return (typeof v === 'undefined' ? 'undefined' : _typeof(v)) === 'object' ? v.amount ? v.amount : v.maxAmount : v;
24
+ return (typeof v === 'undefined' ? 'undefined' : _typeof(v)) === 'object' ? v.amount : v;
25
25
  });
26
26
  };
27
27
 
@@ -55,8 +55,6 @@ var _marked = require('marked');
55
55
 
56
56
  var _marked2 = _interopRequireDefault(_marked);
57
57
 
58
- var _helpers = require('./helpers');
59
-
60
58
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
61
59
 
62
60
  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); } }
@@ -156,7 +154,7 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
156
154
  Product: product,
157
155
  Timespan: timespan,
158
156
  Amount: amount,
159
- MaxAmount: maxAmounts && maxAmounts[currency] ? (0, _helpers.getValues)(maxAmounts, currency, timespan)[0] : Infinity,
157
+ MaxAmount: maxAmounts,
160
158
  Status: 'NewLimit'
161
159
  };
162
160
  var limits = localLimits.filter(function (l) {
@@ -167,6 +165,8 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
167
165
  };
168
166
  };
169
167
 
168
+ console.log(normalizedLimits);
169
+
170
170
  return _react2.default.createElement(
171
171
  'div',
172
172
  { className: (0, _classnames2.default)('ResponsibleGamingWidget', className) },
@@ -184,7 +184,7 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
184
184
  tooltipOpen: normalizedLimits.tooltipOpen
185
185
  }),
186
186
  _react2.default.createElement(LimitContent, _extends({
187
- onSubmitLimits: onSubmitLimits(normalizedLimits.type, normalizedLimits.product),
187
+ onSubmitLimits: onSubmitLimits(normalizedLimits.type, normalizedLimits.product, normalizedLimits.maxAmounts),
188
188
  onChangeLimit: onChangeLimit(normalizedLimits.type, normalizedLimits.product, normalizedLimits.maxAmounts),
189
189
  hideSubmit: hideSubmit,
190
190
  onConfirmLimit: onConfirmLimit,
@@ -223,6 +223,7 @@ var LimitContent = function LimitContent(_ref3) {
223
223
  getAlerts = _ref3.getAlerts,
224
224
  isLoading = _ref3.isLoading,
225
225
  currency = _ref3.currency,
226
+ maxAmounts = _ref3.maxAmounts,
226
227
  values = _ref3.values,
227
228
  valueType = _ref3.valueType,
228
229
  hideRemainingLimit = _ref3.hideRemainingLimit,
@@ -236,6 +237,8 @@ var LimitContent = function LimitContent(_ref3) {
236
237
 
237
238
  var alerts = getAlerts(Object.keys(timespans));
238
239
 
240
+ console.log(Object.values);
241
+
239
242
  var onSubmit = function onSubmit(e) {
240
243
  e.preventDefault();
241
244
  var limits = Object.values(timespans).filter(function (t) {
@@ -268,30 +271,36 @@ var LimitContent = function LimitContent(_ref3) {
268
271
  currency: currency
269
272
  }),
270
273
  Object.values(timespans).map(function (t) {
271
- return _react2.default.createElement(_Timespan2.default, _extends({
272
- key: t.timespan,
273
- title: Object.values(timespans).length > 1 && _messages2.default.get('header.responsible-gaming.timespan.' + t.timespan),
274
- onChangeLimit: onChangeLimit(t.timespan),
275
- onResetLimit: function onResetLimit() {
276
- return onSubmitLimits([t.currentLimit]);
277
- },
278
- onConfirmLimit: onConfirmLimit,
279
- onDeclineLimit: onDeclineLimit,
280
- onPickLimit: function onPickLimit(id) {
281
- return onSubmitLimits(t.pickLimits.filter(function (l) {
282
- return l.Id !== id;
283
- }).map(function (l) {
284
- return _extends({}, l, { Amount: 0 });
285
- }));
286
- },
287
- validationState: getValidationState(t.timespan),
288
- currency: currency,
289
- values: values,
290
- valueType: valueType,
291
- hideRemainingLimit: hideRemainingLimit,
292
- showCurrentValue: showCurrentValue,
293
- hideOther: hideOther
294
- }, t));
274
+ return _react2.default.createElement(
275
+ 'div',
276
+ null,
277
+ console.log(t),
278
+ _react2.default.createElement(_Timespan2.default, _extends({
279
+ key: t.timespan,
280
+ title: Object.values(timespans).length > 1 && _messages2.default.get('header.responsible-gaming.timespan.' + t.timespan),
281
+ onChangeLimit: onChangeLimit(t.timespan),
282
+ onResetLimit: function onResetLimit() {
283
+ return onSubmitLimits([t.currentLimit]);
284
+ },
285
+ onConfirmLimit: onConfirmLimit,
286
+ onDeclineLimit: onDeclineLimit,
287
+ onPickLimit: function onPickLimit(id) {
288
+ return onSubmitLimits(t.pickLimits.filter(function (l) {
289
+ return l.Id !== id;
290
+ }).map(function (l) {
291
+ return _extends({}, l, { Amount: 0 });
292
+ }));
293
+ },
294
+ validationState: getValidationState(t.timespan),
295
+ currency: currency,
296
+ maxAmounts: maxAmounts,
297
+ values: values,
298
+ valueType: valueType,
299
+ hideRemainingLimit: hideRemainingLimit,
300
+ showCurrentValue: showCurrentValue,
301
+ hideOther: hideOther
302
+ }, t))
303
+ );
295
304
  }),
296
305
  !hideSubmit && _react2.default.createElement(
297
306
  _Button2.default,
@@ -60,7 +60,7 @@ var validate = function validate(_ref) {
60
60
  * Compose jurisdictions with rules
61
61
  */
62
62
  var common = (_common = {}, _defineProperty(_common, 'show-confirm-on-submit', type === 'Block' || type === 'SelfExclude'), _defineProperty(_common, 'insufficient-limit-count', false), _defineProperty(_common, 'limits-are-pristine', limitsArePristine), _defineProperty(_common, 'limit-increase-blocked', false), _defineProperty(_common, 'limit-remove-blocked', false), _defineProperty(_common, 'limit-above-maxlimit', exceedingMaxLimitAmount), _defineProperty(_common, 'isValid', function isValid() {
63
- return !this['insufficient-limit-count'] && !(this['limit-increase-blocked'] && isIncreasingLimit) && !(this['limit-remove-blocked'] && isRemovingLimit) && !this['limit-above-maxlimit'];
63
+ return !this['insufficient-limit-count'] && !(this['limit-increase-blocked'] && isIncreasingLimit) && !(this['limit-remove-blocked'] && isRemovingLimit);
64
64
  }), _common);
65
65
  var mga = {};
66
66
  var sga = (_sga = {}, _defineProperty(_sga, 'insufficient-limit-count', type === 'Deposit' && limitCount < 3), _defineProperty(_sga, 'limit-remove-blocked', type === 'Deposit'), _defineProperty(_sga, 'monthly-deposit-above-10k', (0, _get2.default)(newMonthlyDepositLimit, 'newLimit.Amount') >= 10000), _sga);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tg-core-components",
3
- "version": "6.3.4-3.25",
3
+ "version": "6.3.4-3.4",
4
4
  "description": "tg-core-components",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",