tf-checkout-react 1.6.6-beta.23 → 1.6.6-beta.25
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.
- package/dist/components/orderDetailsContainer/index.d.ts +2 -2
- package/dist/components/resetPasswordContainer/index.d.ts +2 -2
- package/dist/tf-checkout-react.cjs.development.js +61 -31
- package/dist/tf-checkout-react.cjs.development.js.map +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
- package/dist/tf-checkout-react.esm.js +61 -31
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/addonsContainer/AddonComponent.tsx +5 -2
- package/src/components/addonsContainer/index.tsx +33 -5
- package/src/components/billing-info-container/index.tsx +1 -0
- package/src/components/forgotPasswordModal/index.tsx +21 -8
- package/src/components/orderDetailsContainer/index.tsx +16 -14
- package/src/components/preRegistration/index.tsx +8 -5
- package/src/components/resetPasswordContainer/index.tsx +12 -13
- package/src/types/api/orders.d.ts +19 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './style.css';
|
|
3
|
-
import { ThemeOptions } from
|
|
4
|
-
import { CSSProperties } from
|
|
3
|
+
import { ThemeOptions } from '@mui/material';
|
|
4
|
+
import { CSSProperties } from '@mui/styles';
|
|
5
5
|
import { IActionColumns, ITicketTypes } from './ticketsTable';
|
|
6
6
|
interface OrderDetailsTypes {
|
|
7
7
|
columns: Array<{
|
|
@@ -3460,10 +3460,10 @@ var AddonComponent = function AddonComponent(_ref) {
|
|
|
3460
3460
|
}, _map(groupItems, function (element) {
|
|
3461
3461
|
return React__default.createElement("div", {
|
|
3462
3462
|
className: element.className,
|
|
3463
|
-
key: element.name
|
|
3463
|
+
key: data.id + "-" + id + "-" + element.name
|
|
3464
3464
|
}, React__default.createElement(formik.Field, Object.assign({}, element, {
|
|
3465
3465
|
type: element.type === 'radio' || element.type === 'checkbox' ? undefined : element.type,
|
|
3466
|
-
name: "" + element.name,
|
|
3466
|
+
name: data.id + "-" + id + "-" + element.name,
|
|
3467
3467
|
label: getFieldLabel(element, configs),
|
|
3468
3468
|
component: getFieldComponent(element),
|
|
3469
3469
|
validate: getValidateFunctions(element, [], values, errors)
|
|
@@ -3905,6 +3905,22 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
3905
3905
|
var handleClearAddons = function handleClearAddons() {
|
|
3906
3906
|
window.localStorage.removeItem('add_ons');
|
|
3907
3907
|
};
|
|
3908
|
+
var initialValues = React.useMemo(function () {
|
|
3909
|
+
var _addOnDataWithCustomF;
|
|
3910
|
+
var addOnsData = {};
|
|
3911
|
+
if ((addons == null ? void 0 : addons.length) > 0 && (addOnDataWithCustomFields == null ? void 0 : (_addOnDataWithCustomF = addOnDataWithCustomFields.fields) == null ? void 0 : _addOnDataWithCustomF.length) > 0) {
|
|
3912
|
+
_map(addons, function (addon) {
|
|
3913
|
+
_map(addOnDataWithCustomFields.fields, function (field) {
|
|
3914
|
+
var id = field.id,
|
|
3915
|
+
groupItems = field.groupItems;
|
|
3916
|
+
_map(groupItems, function (item) {
|
|
3917
|
+
addOnsData[addon.id + "-" + id + "-" + item.name] = item.value;
|
|
3918
|
+
});
|
|
3919
|
+
});
|
|
3920
|
+
});
|
|
3921
|
+
}
|
|
3922
|
+
return addOnsData;
|
|
3923
|
+
}, [addons, addOnDataWithCustomFields]);
|
|
3908
3924
|
if (loading) {
|
|
3909
3925
|
return React__default.createElement("div", {
|
|
3910
3926
|
className: classNamePrefix + "_loader"
|
|
@@ -3941,7 +3957,7 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
3941
3957
|
}, "Skip")), (!(addons != null && addons.length) || isResale && addOnIsIncluded) && samePage ? null : React__default.createElement("div", {
|
|
3942
3958
|
className: classNamePrefix + "_subtitle"
|
|
3943
3959
|
}, "PLEASE SELECT FROM THE OPTIONAL ADD-ONS BELOW"), React__default.createElement(formik.Formik, {
|
|
3944
|
-
initialValues:
|
|
3960
|
+
initialValues: initialValues,
|
|
3945
3961
|
onSubmit: function onSubmit(values) {
|
|
3946
3962
|
handleConfirm(values);
|
|
3947
3963
|
},
|
|
@@ -3952,7 +3968,8 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
3952
3968
|
} : undefined
|
|
3953
3969
|
}, function (_ref4) {
|
|
3954
3970
|
var values = _ref4.values,
|
|
3955
|
-
errors = _ref4.errors
|
|
3971
|
+
errors = _ref4.errors,
|
|
3972
|
+
setFieldTouched = _ref4.setFieldTouched;
|
|
3956
3973
|
var isConfirmDisabled = !isAtLeastOneAddonSelected(values);
|
|
3957
3974
|
return React__default.createElement(formik.Form, {
|
|
3958
3975
|
autoComplete: "off",
|
|
@@ -4037,7 +4054,14 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
4037
4054
|
selectOptions: addonsOptions[addon.id],
|
|
4038
4055
|
classNamePrefix: classNamePrefix,
|
|
4039
4056
|
handleAddonChange: function handleAddonChange(id, value) {
|
|
4040
|
-
|
|
4057
|
+
onFieldChange(id, value, addon);
|
|
4058
|
+
_map(addOnDataWithCustomFields.fields, function (fieldGroup) {
|
|
4059
|
+
var id = fieldGroup.id,
|
|
4060
|
+
groupItems = fieldGroup.groupItems;
|
|
4061
|
+
_map(groupItems, function (field) {
|
|
4062
|
+
setFieldTouched(addon.id + "-" + id + "-" + field.name, true, true);
|
|
4063
|
+
});
|
|
4064
|
+
});
|
|
4041
4065
|
},
|
|
4042
4066
|
addOnDataWithCustomFields: addOnDataWithCustomFields,
|
|
4043
4067
|
configs: configs,
|
|
@@ -4149,41 +4173,44 @@ var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
|
|
|
4149
4173
|
case 0:
|
|
4150
4174
|
email = _ref2.email;
|
|
4151
4175
|
if (!showSuccess) {
|
|
4152
|
-
_context.next =
|
|
4176
|
+
_context.next = 5;
|
|
4153
4177
|
break;
|
|
4154
4178
|
}
|
|
4179
|
+
setSuccessMessage(null);
|
|
4155
4180
|
onClose();
|
|
4156
4181
|
return _context.abrupt("return");
|
|
4157
|
-
case
|
|
4158
|
-
_context.prev =
|
|
4182
|
+
case 5:
|
|
4183
|
+
_context.prev = 5;
|
|
4159
4184
|
setLoading(true);
|
|
4160
|
-
_context.next =
|
|
4185
|
+
_context.next = 9;
|
|
4161
4186
|
return forgotPassword(email);
|
|
4162
|
-
case
|
|
4187
|
+
case 9:
|
|
4163
4188
|
_yield$forgotPassword = _context.sent;
|
|
4164
4189
|
data = _yield$forgotPassword.data;
|
|
4165
4190
|
onForgotPasswordSuccess(data);
|
|
4166
|
-
|
|
4167
|
-
if (data != null && data.success) {
|
|
4191
|
+
if (displaySuccessMessage && data != null && data.success) {
|
|
4168
4192
|
setSuccessMessage(data == null ? void 0 : data.message);
|
|
4169
4193
|
}
|
|
4170
|
-
|
|
4194
|
+
if (!displaySuccessMessage) {
|
|
4195
|
+
onClose();
|
|
4196
|
+
}
|
|
4197
|
+
_context.next = 19;
|
|
4171
4198
|
break;
|
|
4172
|
-
case
|
|
4173
|
-
_context.prev =
|
|
4174
|
-
_context.t0 = _context["catch"](
|
|
4199
|
+
case 16:
|
|
4200
|
+
_context.prev = 16;
|
|
4201
|
+
_context.t0 = _context["catch"](5);
|
|
4175
4202
|
if (axios.isAxiosError(_context.t0)) {
|
|
4176
4203
|
onForgotPasswordError(_context.t0);
|
|
4177
4204
|
}
|
|
4178
|
-
case
|
|
4179
|
-
_context.prev =
|
|
4205
|
+
case 19:
|
|
4206
|
+
_context.prev = 19;
|
|
4180
4207
|
setLoading(false);
|
|
4181
|
-
return _context.finish(
|
|
4182
|
-
case
|
|
4208
|
+
return _context.finish(19);
|
|
4209
|
+
case 22:
|
|
4183
4210
|
case "end":
|
|
4184
4211
|
return _context.stop();
|
|
4185
4212
|
}
|
|
4186
|
-
}, _callee, null, [[
|
|
4213
|
+
}, _callee, null, [[5, 16, 19, 22]]);
|
|
4187
4214
|
}));
|
|
4188
4215
|
return function onForgotPassword(_x) {
|
|
4189
4216
|
return _ref3.apply(this, arguments);
|
|
@@ -5614,7 +5641,8 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
5614
5641
|
},
|
|
5615
5642
|
onForgotPasswordSuccess: onForgotPasswordSuccess,
|
|
5616
5643
|
onForgotPasswordError: onForgotPasswordError,
|
|
5617
|
-
showPoweredByImage: showPoweredByImage
|
|
5644
|
+
showPoweredByImage: showPoweredByImage,
|
|
5645
|
+
displaySuccessMessage: true
|
|
5618
5646
|
}), React__default.createElement(VerificationPendingModal, {
|
|
5619
5647
|
message: pendingVerificationMessage,
|
|
5620
5648
|
onClose: function onClose() {
|
|
@@ -13313,13 +13341,14 @@ var PreRegistration = function PreRegistration(_ref) {
|
|
|
13313
13341
|
setShowModalLogin(true);
|
|
13314
13342
|
},
|
|
13315
13343
|
onForgotPasswordSuccess: onForgotPasswordSuccess,
|
|
13316
|
-
onForgotPasswordError: onForgotPasswordError
|
|
13344
|
+
onForgotPasswordError: onForgotPasswordError,
|
|
13345
|
+
displaySuccessMessage: true
|
|
13317
13346
|
}), React__default.createElement("h2", null, "Pre-Registration"), React__default.createElement(formik.Formik, {
|
|
13318
13347
|
initialValues: getFormInitialValues$1(formFields),
|
|
13319
13348
|
enableReinitialize: true,
|
|
13320
13349
|
onSubmit: function () {
|
|
13321
13350
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(values) {
|
|
13322
|
-
var updatedValues, holderAgeDate, confirmationData, bodyFormData, res, profileRes,
|
|
13351
|
+
var updatedValues, holderAgeDate, confirmationData, bodyFormData, res, profileRes, _error2$response, _error2$response$data, _error2$response$data2, _error2$response2, _error2$response2$dat, _error2, errorMessage, emailErrors, _error2$response3, _error2$response3$dat;
|
|
13323
13352
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
13324
13353
|
while (1) switch (_context2.prev = _context2.next) {
|
|
13325
13354
|
case 0:
|
|
@@ -13386,15 +13415,16 @@ var PreRegistration = function PreRegistration(_ref) {
|
|
|
13386
13415
|
setUserData(_get(profileRes, 'data'));
|
|
13387
13416
|
}
|
|
13388
13417
|
case 41:
|
|
13389
|
-
_context2.next =
|
|
13418
|
+
_context2.next = 51;
|
|
13390
13419
|
break;
|
|
13391
13420
|
case 43:
|
|
13392
13421
|
_context2.prev = 43;
|
|
13393
13422
|
_context2.t0 = _context2["catch"](0);
|
|
13394
|
-
|
|
13395
|
-
|
|
13396
|
-
|
|
13397
|
-
|
|
13423
|
+
_error2 = _context2.t0;
|
|
13424
|
+
errorMessage = (_error2 == null ? void 0 : _error2.message) || 'Error';
|
|
13425
|
+
emailErrors = _error2 == null ? void 0 : (_error2$response = _error2.response) == null ? void 0 : (_error2$response$data = _error2$response.data) == null ? void 0 : (_error2$response$data2 = _error2$response$data.message) == null ? void 0 : _error2$response$data2.email;
|
|
13426
|
+
if (typeof (_error2 == null ? void 0 : (_error2$response2 = _error2.response) == null ? void 0 : (_error2$response2$dat = _error2$response2.data) == null ? void 0 : _error2$response2$dat.message) === 'string') {
|
|
13427
|
+
errorMessage = _error2 == null ? void 0 : (_error2$response3 = _error2.response) == null ? void 0 : (_error2$response3$dat = _error2$response3.data) == null ? void 0 : _error2$response3$dat.message;
|
|
13398
13428
|
}
|
|
13399
13429
|
if ((emailErrors == null ? void 0 : emailErrors.length) > 0) {
|
|
13400
13430
|
if (emailErrors[0] === 'The email is already used') {
|
|
@@ -13404,8 +13434,8 @@ var PreRegistration = function PreRegistration(_ref) {
|
|
|
13404
13434
|
} else {
|
|
13405
13435
|
setError(errorMessage);
|
|
13406
13436
|
}
|
|
13407
|
-
onConfirmationError(
|
|
13408
|
-
case
|
|
13437
|
+
onConfirmationError(_error2);
|
|
13438
|
+
case 51:
|
|
13409
13439
|
case "end":
|
|
13410
13440
|
return _context2.stop();
|
|
13411
13441
|
}
|