tf-checkout-react 1.0.102 → 1.0.105
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/components/ticketsContainer/TicketsSection.d.ts +2 -1
- package/dist/components/ticketsContainer/index.d.ts +2 -1
- package/dist/images/done.svg +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/tf-checkout-react.cjs.development.js +71 -25
- 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 +71 -26
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +89 -89
- package/src/.d.ts +2 -2
- package/src/api/index.ts +293 -278
- package/src/assets/images/done.svg +3 -3
- package/src/components/billing-info-container/index.tsx +796 -796
- 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 +85 -81
- package/src/components/ticketsContainer/index.tsx +430 -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
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
|
@@ -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) {
|
|
@@ -4137,10 +4150,9 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
4137
4150
|
var ticketsList = _ref.ticketsList,
|
|
4138
4151
|
selectedTickets = _ref.selectedTickets,
|
|
4139
4152
|
handleTicketSelect = _ref.handleTicketSelect,
|
|
4140
|
-
promoCodeIsApplied = _ref.promoCodeIsApplied
|
|
4141
|
-
|
|
4142
|
-
var sortedTicketsList = _sortBy(ticketsList, 'sortOrder');
|
|
4143
|
-
|
|
4153
|
+
promoCodeIsApplied = _ref.promoCodeIsApplied,
|
|
4154
|
+
sortBySoldOut = _ref.sortBySoldOut;
|
|
4155
|
+
var sortedTicketsList = sortBySoldOut ? _sortBy(_sortBy(ticketsList, 'sortOrder'), 'soldOut') : _sortBy(ticketsList, 'sortOrder');
|
|
4144
4156
|
return React.createElement(React.Fragment, null, sortedTicketsList.map(function (ticket, i, arr) {
|
|
4145
4157
|
var isSoldOut = ticket.sold_out || !ticket.displayTicket || ticket.soldOut;
|
|
4146
4158
|
|
|
@@ -4573,7 +4585,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4573
4585
|
_ref$hideWaitingList = _ref.hideWaitingList,
|
|
4574
4586
|
hideWaitingList = _ref$hideWaitingList === void 0 ? false : _ref$hideWaitingList,
|
|
4575
4587
|
_ref$isButtonScrollab = _ref.isButtonScrollable,
|
|
4576
|
-
isButtonScrollable = _ref$isButtonScrollab === void 0 ? false : _ref$isButtonScrollab
|
|
4588
|
+
isButtonScrollable = _ref$isButtonScrollab === void 0 ? false : _ref$isButtonScrollab,
|
|
4589
|
+
_ref$sortBySoldOut = _ref.sortBySoldOut,
|
|
4590
|
+
sortBySoldOut = _ref$sortBySoldOut === void 0 ? false : _ref$sortBySoldOut;
|
|
4577
4591
|
|
|
4578
4592
|
var _useState = useState({}),
|
|
4579
4593
|
selectedTickets = _useState[0],
|
|
@@ -4601,7 +4615,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4601
4615
|
showWaitingList = _useState6[0],
|
|
4602
4616
|
setShowWaitingList = _useState6[1];
|
|
4603
4617
|
|
|
4604
|
-
var _useState7 = useState(
|
|
4618
|
+
var _useState7 = useState(true),
|
|
4605
4619
|
isLoading = _useState7[0],
|
|
4606
4620
|
setIsLoading = _useState7[1];
|
|
4607
4621
|
|
|
@@ -4717,7 +4731,6 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4717
4731
|
eventResponse = _context2.sent;
|
|
4718
4732
|
|
|
4719
4733
|
if (response.data.success) {
|
|
4720
|
-
setCustomHeader(response);
|
|
4721
4734
|
attributes = _get(response, 'data.data.attributes');
|
|
4722
4735
|
setPromoCodeIsApplied(attributes.ValidPromoCode);
|
|
4723
4736
|
setTickets(_get(attributes, 'tickets'));
|
|
@@ -4813,11 +4826,10 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4813
4826
|
result = _context.sent;
|
|
4814
4827
|
|
|
4815
4828
|
if (!(result.status === 200)) {
|
|
4816
|
-
_context.next =
|
|
4829
|
+
_context.next = 26;
|
|
4817
4830
|
break;
|
|
4818
4831
|
}
|
|
4819
4832
|
|
|
4820
|
-
setCustomHeader(result);
|
|
4821
4833
|
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;
|
|
4822
4834
|
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;
|
|
4823
4835
|
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;
|
|
@@ -4825,7 +4837,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4825
4837
|
hash = '';
|
|
4826
4838
|
|
|
4827
4839
|
if (!skipBillingPage) {
|
|
4828
|
-
_context.next =
|
|
4840
|
+
_context.next = 25;
|
|
4829
4841
|
break;
|
|
4830
4842
|
}
|
|
4831
4843
|
|
|
@@ -4834,14 +4846,14 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4834
4846
|
userData = _isWindowDefined && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
4835
4847
|
access_token = _isWindowDefined && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
4836
4848
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
4837
|
-
_context.next =
|
|
4849
|
+
_context.next = 23;
|
|
4838
4850
|
return postOnCheckout(checkoutBody, access_token);
|
|
4839
4851
|
|
|
4840
|
-
case
|
|
4852
|
+
case 23:
|
|
4841
4853
|
checkoutResult = _context.sent;
|
|
4842
4854
|
hash = _get(checkoutResult, 'data.data.attributes.hash');
|
|
4843
4855
|
|
|
4844
|
-
case
|
|
4856
|
+
case 25:
|
|
4845
4857
|
onAddToCartSuccess({
|
|
4846
4858
|
skip_billing_page: skipBillingPage,
|
|
4847
4859
|
names_required: nameIsRequired,
|
|
@@ -4851,29 +4863,29 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4851
4863
|
hash: hash
|
|
4852
4864
|
});
|
|
4853
4865
|
|
|
4854
|
-
case
|
|
4855
|
-
_context.next =
|
|
4866
|
+
case 26:
|
|
4867
|
+
_context.next = 31;
|
|
4856
4868
|
break;
|
|
4857
4869
|
|
|
4858
|
-
case
|
|
4859
|
-
_context.prev =
|
|
4870
|
+
case 28:
|
|
4871
|
+
_context.prev = 28;
|
|
4860
4872
|
_context.t0 = _context["catch"](6);
|
|
4861
4873
|
|
|
4862
4874
|
if (axios.isAxiosError(_context.t0)) {
|
|
4863
4875
|
onAddToCartError(_context.t0);
|
|
4864
4876
|
}
|
|
4865
4877
|
|
|
4866
|
-
case
|
|
4867
|
-
_context.prev =
|
|
4878
|
+
case 31:
|
|
4879
|
+
_context.prev = 31;
|
|
4868
4880
|
setHandleBookIsLoading(false);
|
|
4869
|
-
return _context.finish(
|
|
4881
|
+
return _context.finish(31);
|
|
4870
4882
|
|
|
4871
|
-
case
|
|
4883
|
+
case 34:
|
|
4872
4884
|
case "end":
|
|
4873
4885
|
return _context.stop();
|
|
4874
4886
|
}
|
|
4875
4887
|
}
|
|
4876
|
-
}, _callee, null, [[6,
|
|
4888
|
+
}, _callee, null, [[6, 28, 31, 34]]);
|
|
4877
4889
|
}));
|
|
4878
4890
|
|
|
4879
4891
|
return function handleBook() {
|
|
@@ -4924,7 +4936,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4924
4936
|
var bookButtonIsDisabled = handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0;
|
|
4925
4937
|
return React.createElement(ThemeProvider$1, {
|
|
4926
4938
|
theme: themeMui
|
|
4927
|
-
}, React.createElement(ReferralLogic, {
|
|
4939
|
+
}, !isLoading && React.createElement(ReferralLogic, {
|
|
4928
4940
|
eventId: eventId
|
|
4929
4941
|
}), React.createElement("div", {
|
|
4930
4942
|
className: "get-tickets-page " + theme,
|
|
@@ -4935,7 +4947,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4935
4947
|
ticketsList: tickets,
|
|
4936
4948
|
selectedTickets: selectedTickets,
|
|
4937
4949
|
handleTicketSelect: handleTicketSelect,
|
|
4938
|
-
promoCodeIsApplied: promoCodeIsApplied
|
|
4950
|
+
promoCodeIsApplied: promoCodeIsApplied,
|
|
4951
|
+
sortBySoldOut: sortBySoldOut
|
|
4939
4952
|
}), event != null && event.salesEnded ? React.createElement("p", {
|
|
4940
4953
|
className: 'event-closed-message'
|
|
4941
4954
|
}, "Sales for this event are closed.") : !(event != null && event.salesStarted) && event != null && event.salesStart ? React.createElement(Countdown, {
|
|
@@ -5827,5 +5840,37 @@ var TicketResaleContainer = function TicketResaleContainer(_ref) {
|
|
|
5827
5840
|
}, React.createElement("h3", null, error)));
|
|
5828
5841
|
};
|
|
5829
5842
|
|
|
5830
|
-
|
|
5843
|
+
var style$3 = {
|
|
5844
|
+
position: 'absolute',
|
|
5845
|
+
top: '10%',
|
|
5846
|
+
left: '50%',
|
|
5847
|
+
transform: 'translate(-50%, -50%)',
|
|
5848
|
+
minWidth: 480,
|
|
5849
|
+
backgroundColor: '#e3e3e3',
|
|
5850
|
+
border: '1px solid white',
|
|
5851
|
+
outline: 'none',
|
|
5852
|
+
padding: '14px',
|
|
5853
|
+
maxHeight: '85vh',
|
|
5854
|
+
overflow: 'auto'
|
|
5855
|
+
};
|
|
5856
|
+
var RedirectModal = function RedirectModal(_ref) {
|
|
5857
|
+
var _ref$message = _ref.message,
|
|
5858
|
+
message = _ref$message === void 0 ? 'Your cart has expired. Please click on "OK" to return to the ticket selection page.' : _ref$message,
|
|
5859
|
+
_ref$onClickOk = _ref.onClickOk,
|
|
5860
|
+
onClickOk = _ref$onClickOk === void 0 ? function () {} : _ref$onClickOk;
|
|
5861
|
+
return React.createElement(Modal, {
|
|
5862
|
+
open: true,
|
|
5863
|
+
"aria-labelledby": "modal-modal-title",
|
|
5864
|
+
"aria-describedby": "modal-modal-description",
|
|
5865
|
+
className: "redirect-modal"
|
|
5866
|
+
}, React.createElement(Box, {
|
|
5867
|
+
style: style$3
|
|
5868
|
+
}, React.createElement("p", null, message), React.createElement("div", {
|
|
5869
|
+
className: "footer"
|
|
5870
|
+
}, React.createElement("button", {
|
|
5871
|
+
onClick: onClickOk
|
|
5872
|
+
}, "OK"))));
|
|
5873
|
+
};
|
|
5874
|
+
|
|
5875
|
+
export { BillingInfoContainer, ConfirmationContainer, LoginModal, MyTicketsContainer, OrderDetailsContainer, PaymentContainer, RedirectModal, TicketResaleContainer, TicketsContainer, createFixedFloatNormalizer, currencyNormalizerCreator, setConfigs };
|
|
5831
5876
|
//# sourceMappingURL=tf-checkout-react.esm.js.map
|