tg-core-components 6.3.4-3.17 → 6.3.4-3.19

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.
@@ -113,7 +113,7 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
113
113
  Product: product,
114
114
  Timespan: timespan,
115
115
  Amount: amount,
116
- MaxAmount: getValues(maxAmounts, currency, timespan)[0],
116
+ MaxAmount: maxAmounts ? getValues(maxAmounts[type], currency, timespan)[0] : Infinity,
117
117
  Status: 'NewLimit'
118
118
  };
119
119
  var limits = localLimits.filter(function (l) {
@@ -124,7 +124,6 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
124
124
  };
125
125
  };
126
126
 
127
- console.log(normalizedLimits);
128
127
  return React.createElement(
129
128
  'div',
130
129
  { className: cn('ResponsibleGamingWidget', className) },
@@ -181,7 +180,6 @@ var LimitContent = function LimitContent(_ref3) {
181
180
  getAlerts = _ref3.getAlerts,
182
181
  isLoading = _ref3.isLoading,
183
182
  currency = _ref3.currency,
184
- maxAmounts = _ref3.maxAmounts,
185
183
  values = _ref3.values,
186
184
  valueType = _ref3.valueType,
187
185
  hideRemainingLimit = _ref3.hideRemainingLimit,
@@ -227,36 +225,30 @@ var LimitContent = function LimitContent(_ref3) {
227
225
  currency: currency
228
226
  }),
229
227
  Object.values(timespans).map(function (t) {
230
- return React.createElement(
231
- 'div',
232
- null,
233
- console.log(t),
234
- React.createElement(Timespan, _extends({
235
- key: t.timespan,
236
- title: Object.values(timespans).length > 1 && messages.get('header.responsible-gaming.timespan.' + t.timespan),
237
- onChangeLimit: onChangeLimit(t.timespan),
238
- onResetLimit: function onResetLimit() {
239
- return onSubmitLimits([t.currentLimit]);
240
- },
241
- onConfirmLimit: onConfirmLimit,
242
- onDeclineLimit: onDeclineLimit,
243
- onPickLimit: function onPickLimit(id) {
244
- return onSubmitLimits(t.pickLimits.filter(function (l) {
245
- return l.Id !== id;
246
- }).map(function (l) {
247
- return _extends({}, l, { Amount: 0 });
248
- }));
249
- },
250
- validationState: getValidationState(t.timespan),
251
- currency: currency,
252
- maxAmounts: maxAmounts,
253
- values: values,
254
- valueType: valueType,
255
- hideRemainingLimit: hideRemainingLimit,
256
- showCurrentValue: showCurrentValue,
257
- hideOther: hideOther
258
- }, t))
259
- );
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));
260
252
  }),
261
253
  !hideSubmit && React.createElement(
262
254
  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);
53
+ return !this['insufficient-limit-count'] && !(this['limit-increase-blocked'] && isIncreasingLimit) && !(this['limit-remove-blocked'] && isRemovingLimit) && !this['limit-above-maxlimit'];
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);
@@ -156,7 +156,7 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
156
156
  Product: product,
157
157
  Timespan: timespan,
158
158
  Amount: amount,
159
- MaxAmount: (0, _helpers.getValues)(maxAmounts, currency, timespan)[0],
159
+ MaxAmount: maxAmounts ? (0, _helpers.getValues)(maxAmounts[type], currency, timespan)[0] : Infinity,
160
160
  Status: 'NewLimit'
161
161
  };
162
162
  var limits = localLimits.filter(function (l) {
@@ -167,7 +167,6 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
167
167
  };
168
168
  };
169
169
 
170
- console.log(normalizedLimits);
171
170
  return _react2.default.createElement(
172
171
  'div',
173
172
  { className: (0, _classnames2.default)('ResponsibleGamingWidget', className) },
@@ -224,7 +223,6 @@ var LimitContent = function LimitContent(_ref3) {
224
223
  getAlerts = _ref3.getAlerts,
225
224
  isLoading = _ref3.isLoading,
226
225
  currency = _ref3.currency,
227
- maxAmounts = _ref3.maxAmounts,
228
226
  values = _ref3.values,
229
227
  valueType = _ref3.valueType,
230
228
  hideRemainingLimit = _ref3.hideRemainingLimit,
@@ -270,36 +268,30 @@ var LimitContent = function LimitContent(_ref3) {
270
268
  currency: currency
271
269
  }),
272
270
  Object.values(timespans).map(function (t) {
273
- return _react2.default.createElement(
274
- 'div',
275
- null,
276
- console.log(t),
277
- _react2.default.createElement(_Timespan2.default, _extends({
278
- key: t.timespan,
279
- title: Object.values(timespans).length > 1 && _messages2.default.get('header.responsible-gaming.timespan.' + t.timespan),
280
- onChangeLimit: onChangeLimit(t.timespan),
281
- onResetLimit: function onResetLimit() {
282
- return onSubmitLimits([t.currentLimit]);
283
- },
284
- onConfirmLimit: onConfirmLimit,
285
- onDeclineLimit: onDeclineLimit,
286
- onPickLimit: function onPickLimit(id) {
287
- return onSubmitLimits(t.pickLimits.filter(function (l) {
288
- return l.Id !== id;
289
- }).map(function (l) {
290
- return _extends({}, l, { Amount: 0 });
291
- }));
292
- },
293
- validationState: getValidationState(t.timespan),
294
- currency: currency,
295
- maxAmounts: maxAmounts,
296
- values: values,
297
- valueType: valueType,
298
- hideRemainingLimit: hideRemainingLimit,
299
- showCurrentValue: showCurrentValue,
300
- hideOther: hideOther
301
- }, t))
302
- );
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));
303
295
  }),
304
296
  !hideSubmit && _react2.default.createElement(
305
297
  _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);
63
+ return !this['insufficient-limit-count'] && !(this['limit-increase-blocked'] && isIncreasingLimit) && !(this['limit-remove-blocked'] && isRemovingLimit) && !this['limit-above-maxlimit'];
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.17",
3
+ "version": "6.3.4-3.19",
4
4
  "description": "tg-core-components",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",