tf-checkout-react 1.0.103 → 1.0.104
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/common/RedirectModal.d.ts +7 -0
- package/dist/images/done.svg +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/tf-checkout-react.cjs.development.js +63 -23
- 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 +63 -24
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +89 -89
- package/src/.DS_Store +0 -0
- package/src/.d.ts +2 -2
- package/src/api/index.ts +293 -278
- package/src/assets/images/done.svg +3 -3
- package/src/components/.DS_Store +0 -0
- package/src/components/billing-info-container/index.tsx +796 -799
- package/src/components/billing-info-container/style.css +105 -105
- package/src/components/billing-info-container/utils.ts +224 -224
- package/src/components/common/CheckboxField.tsx +41 -41
- package/src/components/common/CustomField.tsx +84 -84
- package/src/components/common/FormikPhoneNumberField.tsx +51 -51
- package/src/components/common/Loader.tsx +9 -9
- package/src/components/common/RadioField.tsx +35 -35
- package/src/components/common/RedirectModal.tsx +43 -0
- package/src/components/common/SelectField.tsx +80 -80
- package/src/components/common/SnackbarAlert.tsx +53 -53
- package/src/components/common/index.tsx +4 -4
- package/src/components/confirmModal/index.tsx +51 -51
- package/src/components/confirmModal/style.css +21 -21
- package/src/components/confirmationContainer/config.ts +72 -72
- package/src/components/confirmationContainer/index.tsx +197 -197
- package/src/components/confirmationContainer/social-buttons.tsx +94 -94
- package/src/components/confirmationContainer/style.css +202 -202
- package/src/components/countdown/index.tsx +89 -89
- package/src/components/countdown/style.css +9 -9
- package/src/components/index.ts +7 -7
- package/src/components/loginModal/index.tsx +209 -209
- package/src/components/loginModal/style.css +71 -71
- package/src/components/myTicketsContainer/index.tsx +196 -196
- package/src/components/myTicketsContainer/row.tsx +41 -41
- package/src/components/myTicketsContainer/style.css +39 -39
- package/src/components/myTicketsContainer/tableConfig.tsx +34 -34
- package/src/components/orderDetailsContainer/index.tsx +249 -249
- package/src/components/orderDetailsContainer/style.css +72 -72
- package/src/components/orderDetailsContainer/ticketsTable.tsx +124 -124
- package/src/components/paymentContainer/index.tsx +284 -284
- package/src/components/registerModal/index.tsx +190 -190
- package/src/components/stripePayment/index.tsx +253 -253
- package/src/components/stripePayment/style.css +59 -59
- package/src/components/ticketResale/index.tsx +56 -56
- package/src/components/ticketResaleModal/index.tsx +210 -210
- package/src/components/ticketResaleModal/style.css +28 -28
- package/src/components/ticketsContainer/PromoCodeSection.tsx +99 -99
- package/src/components/ticketsContainer/ReferralLogic.tsx +33 -33
- package/src/components/ticketsContainer/TicketRow.tsx +83 -83
- package/src/components/ticketsContainer/TicketsSection.tsx +81 -81
- package/src/components/ticketsContainer/index.tsx +427 -430
- package/src/components/ticketsContainer/style.css +181 -181
- package/src/components/ticketsContainer/utils.ts +11 -11
- package/src/components/timerWidget/index.tsx +70 -70
- package/src/components/timerWidget/style.css +26 -26
- package/src/components/waitingList/index.tsx +178 -178
- package/src/components/waitingList/style.css +26 -26
- package/src/env.ts +20 -20
- package/src/index.ts +14 -13
- package/src/normalizers/index.ts +45 -45
- package/src/types/billing-info-data.ts +37 -37
- package/src/types/payment-field.ts +7 -7
- package/src/types/referral-promotion.ts +7 -7
- package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +59 -59
- package/src/utils/downloadPDF.tsx +30 -30
- package/src/utils/formikErrorFocus.ts +24 -24
- package/src/utils/getImage.ts +14 -14
- package/src/utils/getQueryVariable.ts +13 -13
- package/src/utils/index.ts +5 -5
- package/src/utils/setConfigs.ts +26 -26
- package/src/utils/showZero.tsx +10 -10
- package/src/validators/index.ts +20 -20
|
@@ -1114,6 +1114,13 @@ var publicRequest = /*#__PURE__*/axios.create({
|
|
|
1114
1114
|
headers: ttfHeaders
|
|
1115
1115
|
});
|
|
1116
1116
|
publicRequest.interceptors.response.use(function (response) {
|
|
1117
|
+
var authGuestToken = _get(response, 'headers.authorization-guest');
|
|
1118
|
+
|
|
1119
|
+
if (isWindowDefined && authGuestToken) {
|
|
1120
|
+
window.localStorage.setItem('auth_guest_token', authGuestToken);
|
|
1121
|
+
publicRequest.setGuestToken(authGuestToken);
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1117
1124
|
return response;
|
|
1118
1125
|
}, function (error) {
|
|
1119
1126
|
var _error$response;
|
|
@@ -1122,7 +1129,6 @@ publicRequest.interceptors.response.use(function (response) {
|
|
|
1122
1129
|
if (isWindowDefined) {
|
|
1123
1130
|
var _error$response2, _error$response2$data;
|
|
1124
1131
|
|
|
1125
|
-
window.localStorage.removeItem('auth_guest_token');
|
|
1126
1132
|
window.localStorage.removeItem('user_data');
|
|
1127
1133
|
window.localStorage.removeItem('access_token');
|
|
1128
1134
|
var errorType = error == null ? void 0 : (_error$response2 = error.response) == null ? void 0 : (_error$response2$data = _error$response2.data) == null ? void 0 : _error$response2$data.error;
|
|
@@ -1133,6 +1139,13 @@ publicRequest.interceptors.response.use(function (response) {
|
|
|
1133
1139
|
}
|
|
1134
1140
|
}
|
|
1135
1141
|
|
|
1142
|
+
var authGuestToken = _get(error, 'response.headers.authorization-guest');
|
|
1143
|
+
|
|
1144
|
+
if (isWindowDefined && authGuestToken) {
|
|
1145
|
+
window.localStorage.setItem('auth_guest_token', authGuestToken);
|
|
1146
|
+
publicRequest.setGuestToken(authGuestToken);
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1136
1149
|
return Promise.reject(error);
|
|
1137
1150
|
});
|
|
1138
1151
|
publicRequest.interceptors.request.use(function (config) {
|
|
@@ -3020,10 +3033,6 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3020
3033
|
el.required = flagRequirePhone;
|
|
3021
3034
|
}
|
|
3022
3035
|
|
|
3023
|
-
if (el.name === 'street_address') {
|
|
3024
|
-
el.required = true;
|
|
3025
|
-
}
|
|
3026
|
-
|
|
3027
3036
|
return true;
|
|
3028
3037
|
}), function (element) {
|
|
3029
3038
|
return ['password', 'confirmPassword', 'password-info'].includes(element.name) && isLoggedIn ? null : React.createElement(React.Fragment, {
|
|
@@ -4605,7 +4614,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4605
4614
|
showWaitingList = _useState6[0],
|
|
4606
4615
|
setShowWaitingList = _useState6[1];
|
|
4607
4616
|
|
|
4608
|
-
var _useState7 = useState(
|
|
4617
|
+
var _useState7 = useState(true),
|
|
4609
4618
|
isLoading = _useState7[0],
|
|
4610
4619
|
setIsLoading = _useState7[1];
|
|
4611
4620
|
|
|
@@ -4721,7 +4730,6 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4721
4730
|
eventResponse = _context2.sent;
|
|
4722
4731
|
|
|
4723
4732
|
if (response.data.success) {
|
|
4724
|
-
setCustomHeader(response);
|
|
4725
4733
|
attributes = _get(response, 'data.data.attributes');
|
|
4726
4734
|
setPromoCodeIsApplied(attributes.ValidPromoCode);
|
|
4727
4735
|
setTickets(_get(attributes, 'tickets'));
|
|
@@ -4817,11 +4825,10 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4817
4825
|
result = _context.sent;
|
|
4818
4826
|
|
|
4819
4827
|
if (!(result.status === 200)) {
|
|
4820
|
-
_context.next =
|
|
4828
|
+
_context.next = 26;
|
|
4821
4829
|
break;
|
|
4822
4830
|
}
|
|
4823
4831
|
|
|
4824
|
-
setCustomHeader(result);
|
|
4825
4832
|
skipBillingPage = (_result$data$data$att = result == null ? void 0 : (_result$data = result.data) == null ? void 0 : (_result$data$data = _result$data.data) == null ? void 0 : (_result$data$data$att2 = _result$data$data.attributes) == null ? void 0 : _result$data$data$att2.skip_billing_page) != null ? _result$data$data$att : false;
|
|
4826
4833
|
nameIsRequired = (_result$data$data$att3 = result == null ? void 0 : (_result$data2 = result.data) == null ? void 0 : (_result$data2$data = _result$data2.data) == null ? void 0 : (_result$data2$data$at = _result$data2$data.attributes) == null ? void 0 : _result$data2$data$at.names_required) != null ? _result$data$data$att3 : false;
|
|
4827
4834
|
ageIsRequired = (_result$data$data$att4 = result == null ? void 0 : (_result$data3 = result.data) == null ? void 0 : (_result$data3$data = _result$data3.data) == null ? void 0 : (_result$data3$data$at = _result$data3$data.attributes) == null ? void 0 : _result$data3$data$at.age_required) != null ? _result$data$data$att4 : false;
|
|
@@ -4829,7 +4836,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4829
4836
|
hash = '';
|
|
4830
4837
|
|
|
4831
4838
|
if (!skipBillingPage) {
|
|
4832
|
-
_context.next =
|
|
4839
|
+
_context.next = 25;
|
|
4833
4840
|
break;
|
|
4834
4841
|
}
|
|
4835
4842
|
|
|
@@ -4838,14 +4845,14 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4838
4845
|
userData = _isWindowDefined && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
4839
4846
|
access_token = _isWindowDefined && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
4840
4847
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
4841
|
-
_context.next =
|
|
4848
|
+
_context.next = 23;
|
|
4842
4849
|
return postOnCheckout(checkoutBody, access_token);
|
|
4843
4850
|
|
|
4844
|
-
case
|
|
4851
|
+
case 23:
|
|
4845
4852
|
checkoutResult = _context.sent;
|
|
4846
4853
|
hash = _get(checkoutResult, 'data.data.attributes.hash');
|
|
4847
4854
|
|
|
4848
|
-
case
|
|
4855
|
+
case 25:
|
|
4849
4856
|
onAddToCartSuccess({
|
|
4850
4857
|
skip_billing_page: skipBillingPage,
|
|
4851
4858
|
names_required: nameIsRequired,
|
|
@@ -4855,29 +4862,29 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4855
4862
|
hash: hash
|
|
4856
4863
|
});
|
|
4857
4864
|
|
|
4858
|
-
case
|
|
4859
|
-
_context.next =
|
|
4865
|
+
case 26:
|
|
4866
|
+
_context.next = 31;
|
|
4860
4867
|
break;
|
|
4861
4868
|
|
|
4862
|
-
case
|
|
4863
|
-
_context.prev =
|
|
4869
|
+
case 28:
|
|
4870
|
+
_context.prev = 28;
|
|
4864
4871
|
_context.t0 = _context["catch"](6);
|
|
4865
4872
|
|
|
4866
4873
|
if (axios.isAxiosError(_context.t0)) {
|
|
4867
4874
|
onAddToCartError(_context.t0);
|
|
4868
4875
|
}
|
|
4869
4876
|
|
|
4870
|
-
case
|
|
4871
|
-
_context.prev =
|
|
4877
|
+
case 31:
|
|
4878
|
+
_context.prev = 31;
|
|
4872
4879
|
setHandleBookIsLoading(false);
|
|
4873
|
-
return _context.finish(
|
|
4880
|
+
return _context.finish(31);
|
|
4874
4881
|
|
|
4875
|
-
case
|
|
4882
|
+
case 34:
|
|
4876
4883
|
case "end":
|
|
4877
4884
|
return _context.stop();
|
|
4878
4885
|
}
|
|
4879
4886
|
}
|
|
4880
|
-
}, _callee, null, [[6,
|
|
4887
|
+
}, _callee, null, [[6, 28, 31, 34]]);
|
|
4881
4888
|
}));
|
|
4882
4889
|
|
|
4883
4890
|
return function handleBook() {
|
|
@@ -4928,7 +4935,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4928
4935
|
var bookButtonIsDisabled = handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0;
|
|
4929
4936
|
return React.createElement(ThemeProvider$1, {
|
|
4930
4937
|
theme: themeMui
|
|
4931
|
-
}, React.createElement(ReferralLogic, {
|
|
4938
|
+
}, !isLoading && React.createElement(ReferralLogic, {
|
|
4932
4939
|
eventId: eventId
|
|
4933
4940
|
}), React.createElement("div", {
|
|
4934
4941
|
className: "get-tickets-page " + theme,
|
|
@@ -5831,5 +5838,37 @@ var TicketResaleContainer = function TicketResaleContainer(_ref) {
|
|
|
5831
5838
|
}, React.createElement("h3", null, error)));
|
|
5832
5839
|
};
|
|
5833
5840
|
|
|
5834
|
-
|
|
5841
|
+
var style$3 = {
|
|
5842
|
+
position: 'absolute',
|
|
5843
|
+
top: '10%',
|
|
5844
|
+
left: '50%',
|
|
5845
|
+
transform: 'translate(-50%, -50%)',
|
|
5846
|
+
minWidth: 480,
|
|
5847
|
+
backgroundColor: '#e3e3e3',
|
|
5848
|
+
border: '1px solid white',
|
|
5849
|
+
outline: 'none',
|
|
5850
|
+
padding: '14px',
|
|
5851
|
+
maxHeight: '85vh',
|
|
5852
|
+
overflow: 'auto'
|
|
5853
|
+
};
|
|
5854
|
+
var RedirectModal = function RedirectModal(_ref) {
|
|
5855
|
+
var _ref$message = _ref.message,
|
|
5856
|
+
message = _ref$message === void 0 ? 'Your cart has expired. Please click on "OK" to return to the ticket selection page.' : _ref$message,
|
|
5857
|
+
_ref$onClickOk = _ref.onClickOk,
|
|
5858
|
+
onClickOk = _ref$onClickOk === void 0 ? function () {} : _ref$onClickOk;
|
|
5859
|
+
return React.createElement(Modal, {
|
|
5860
|
+
open: true,
|
|
5861
|
+
"aria-labelledby": "modal-modal-title",
|
|
5862
|
+
"aria-describedby": "modal-modal-description",
|
|
5863
|
+
className: "redirect-modal"
|
|
5864
|
+
}, React.createElement(Box, {
|
|
5865
|
+
style: style$3
|
|
5866
|
+
}, React.createElement("p", null, message), React.createElement("div", {
|
|
5867
|
+
className: "footer"
|
|
5868
|
+
}, React.createElement("button", {
|
|
5869
|
+
onClick: onClickOk
|
|
5870
|
+
}, "OK"))));
|
|
5871
|
+
};
|
|
5872
|
+
|
|
5873
|
+
export { BillingInfoContainer, ConfirmationContainer, LoginModal, MyTicketsContainer, OrderDetailsContainer, PaymentContainer, RedirectModal, TicketResaleContainer, TicketsContainer, createFixedFloatNormalizer, currencyNormalizerCreator, setConfigs };
|
|
5835
5874
|
//# sourceMappingURL=tf-checkout-react.esm.js.map
|