tg-core-components 6.3.11-3 → 6.3.11-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.
|
@@ -246,8 +246,7 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
|
|
|
246
246
|
messages = _ref10.messages,
|
|
247
247
|
isTime = _ref10.isTime,
|
|
248
248
|
valueType = _ref10.valueType,
|
|
249
|
-
setValueType = _ref10.setValueType
|
|
250
|
-
setValueTransform = _ref10.setValueTransform;
|
|
249
|
+
setValueType = _ref10.setValueType;
|
|
251
250
|
|
|
252
251
|
var _useState = useState(newLimit ? newLimit.Amount : currentLimit ? currentLimit.Amount : 0),
|
|
253
252
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -355,9 +354,8 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
|
|
|
355
354
|
pattern: '\\d*',
|
|
356
355
|
value: value,
|
|
357
356
|
onChange: function onChange(e, value) {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
if (transformedValue > 0) _onChange(transformedValue);
|
|
357
|
+
setValue(parseInt(value));
|
|
358
|
+
if (value > 0) _onChange(value);
|
|
361
359
|
},
|
|
362
360
|
autoFocus: !isIphone,
|
|
363
361
|
min: validationState['limit-remove-blocked'] ? '1' : '0',
|
|
@@ -88,8 +88,9 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
|
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
-
var onSubmitLimits = function onSubmitLimits(type, product) {
|
|
91
|
+
var onSubmitLimits = function onSubmitLimits(type, product, transform) {
|
|
92
92
|
return function (limits) {
|
|
93
|
+
console.log('Submitting limits', limits, type, product, transform);
|
|
93
94
|
return typeof onSubmit === 'function' && onSubmit({
|
|
94
95
|
type: type,
|
|
95
96
|
product: product,
|
|
@@ -139,7 +140,7 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
|
|
|
139
140
|
tooltipOpen: normalizedLimits.tooltipOpen
|
|
140
141
|
}),
|
|
141
142
|
React.createElement(LimitContent, _extends({
|
|
142
|
-
onSubmitLimits: onSubmitLimits(normalizedLimits.type, normalizedLimits.product),
|
|
143
|
+
onSubmitLimits: onSubmitLimits(normalizedLimits.type, normalizedLimits.product, normalizedLimits.setValueTransform),
|
|
143
144
|
onChangeLimit: onChangeLimit(normalizedLimits.type, normalizedLimits.product),
|
|
144
145
|
hideSubmit: hideSubmit,
|
|
145
146
|
onConfirmLimit: onConfirmLimit,
|
|
@@ -181,7 +182,6 @@ var LimitContent = function LimitContent(_ref3) {
|
|
|
181
182
|
values = _ref3.values,
|
|
182
183
|
valueType = _ref3.valueType,
|
|
183
184
|
setValueType = _ref3.setValueType,
|
|
184
|
-
setValueTransform = _ref3.setValueTransform,
|
|
185
185
|
hideRemainingLimit = _ref3.hideRemainingLimit,
|
|
186
186
|
showCurrentValue = _ref3.showCurrentValue,
|
|
187
187
|
hideOther = _ref3.hideOther,
|
|
@@ -194,6 +194,7 @@ var LimitContent = function LimitContent(_ref3) {
|
|
|
194
194
|
var alerts = getAlerts(Object.keys(timespans));
|
|
195
195
|
|
|
196
196
|
var onSubmit = function onSubmit(e) {
|
|
197
|
+
console.log('Submitting form', timespans);
|
|
197
198
|
e.preventDefault();
|
|
198
199
|
var limits = Object.values(timespans).filter(function (t) {
|
|
199
200
|
return !t.pendingDeleteLimit && !t.pendingActivateLimit;
|
|
@@ -246,7 +247,6 @@ var LimitContent = function LimitContent(_ref3) {
|
|
|
246
247
|
values: values,
|
|
247
248
|
valueType: valueType,
|
|
248
249
|
setValueType: setValueType,
|
|
249
|
-
setValueTransform: setValueTransform,
|
|
250
250
|
hideRemainingLimit: hideRemainingLimit,
|
|
251
251
|
showCurrentValue: showCurrentValue,
|
|
252
252
|
hideOther: hideOther
|
|
@@ -277,8 +277,7 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
|
|
|
277
277
|
messages = _ref10.messages,
|
|
278
278
|
isTime = _ref10.isTime,
|
|
279
279
|
valueType = _ref10.valueType,
|
|
280
|
-
setValueType = _ref10.setValueType
|
|
281
|
-
setValueTransform = _ref10.setValueTransform;
|
|
280
|
+
setValueType = _ref10.setValueType;
|
|
282
281
|
|
|
283
282
|
var _useState = (0, _react.useState)(newLimit ? newLimit.Amount : currentLimit ? currentLimit.Amount : 0),
|
|
284
283
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -386,9 +385,8 @@ var DefaultTimespan = function DefaultTimespan(_ref10) {
|
|
|
386
385
|
pattern: '\\d*',
|
|
387
386
|
value: value,
|
|
388
387
|
onChange: function onChange(e, value) {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
if (transformedValue > 0) _onChange(transformedValue);
|
|
388
|
+
setValue(parseInt(value));
|
|
389
|
+
if (value > 0) _onChange(value);
|
|
392
390
|
},
|
|
393
391
|
autoFocus: !isIphone,
|
|
394
392
|
min: validationState['limit-remove-blocked'] ? '1' : '0',
|
|
@@ -130,8 +130,9 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
|
|
|
130
130
|
};
|
|
131
131
|
};
|
|
132
132
|
|
|
133
|
-
var onSubmitLimits = function onSubmitLimits(type, product) {
|
|
133
|
+
var onSubmitLimits = function onSubmitLimits(type, product, transform) {
|
|
134
134
|
return function (limits) {
|
|
135
|
+
console.log('Submitting limits', limits, type, product, transform);
|
|
135
136
|
return typeof onSubmit === 'function' && onSubmit({
|
|
136
137
|
type: type,
|
|
137
138
|
product: product,
|
|
@@ -181,7 +182,7 @@ var ResponsibleGaming = function ResponsibleGaming(_ref) {
|
|
|
181
182
|
tooltipOpen: normalizedLimits.tooltipOpen
|
|
182
183
|
}),
|
|
183
184
|
_react2.default.createElement(LimitContent, _extends({
|
|
184
|
-
onSubmitLimits: onSubmitLimits(normalizedLimits.type, normalizedLimits.product),
|
|
185
|
+
onSubmitLimits: onSubmitLimits(normalizedLimits.type, normalizedLimits.product, normalizedLimits.setValueTransform),
|
|
185
186
|
onChangeLimit: onChangeLimit(normalizedLimits.type, normalizedLimits.product),
|
|
186
187
|
hideSubmit: hideSubmit,
|
|
187
188
|
onConfirmLimit: onConfirmLimit,
|
|
@@ -223,7 +224,6 @@ var LimitContent = function LimitContent(_ref3) {
|
|
|
223
224
|
values = _ref3.values,
|
|
224
225
|
valueType = _ref3.valueType,
|
|
225
226
|
setValueType = _ref3.setValueType,
|
|
226
|
-
setValueTransform = _ref3.setValueTransform,
|
|
227
227
|
hideRemainingLimit = _ref3.hideRemainingLimit,
|
|
228
228
|
showCurrentValue = _ref3.showCurrentValue,
|
|
229
229
|
hideOther = _ref3.hideOther,
|
|
@@ -236,6 +236,7 @@ var LimitContent = function LimitContent(_ref3) {
|
|
|
236
236
|
var alerts = getAlerts(Object.keys(timespans));
|
|
237
237
|
|
|
238
238
|
var onSubmit = function onSubmit(e) {
|
|
239
|
+
console.log('Submitting form', timespans);
|
|
239
240
|
e.preventDefault();
|
|
240
241
|
var limits = Object.values(timespans).filter(function (t) {
|
|
241
242
|
return !t.pendingDeleteLimit && !t.pendingActivateLimit;
|
|
@@ -288,7 +289,6 @@ var LimitContent = function LimitContent(_ref3) {
|
|
|
288
289
|
values: values,
|
|
289
290
|
valueType: valueType,
|
|
290
291
|
setValueType: setValueType,
|
|
291
|
-
setValueTransform: setValueTransform,
|
|
292
292
|
hideRemainingLimit: hideRemainingLimit,
|
|
293
293
|
showCurrentValue: showCurrentValue,
|
|
294
294
|
hideOther: hideOther
|