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
package/dist/images/done.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 20C15.5228 20 20 15.5228 20 10C20 4.47717 15.5228 0 10 0C4.47717 0 0 4.47717 0 10C0 15.5228 4.47717 20 10 20ZM8.14661 15.8678L16.8782 6.39722C16.9561 6.31335 17 6.19922 17 6.08008C17 5.96094 16.9561 5.8468 16.8782 5.76282L16.3016 5.12854C16.1386 4.95715 15.8796 4.95715 15.7167 5.12854L7.85004 13.661L4.28326 9.79236C4.20593 9.70776 4.10071 9.66016 3.99084 9.66016C3.9353 9.66016 3.88086 9.67236 3.83069 9.69531C3.78168 9.71777 3.73663 9.75061 3.69843 9.79236L3.12183 10.4177C3.07635 10.4667 3.04248 10.5259 3.02216 10.5905C3.00763 10.6365 3 10.6853 3 10.735C3 10.8541 3.04388 10.9683 3.12183 11.0521L7.56177 15.8678C7.6391 15.9524 7.74438 16 7.85419 16C7.96399 16 8.06927 15.9524 8.14661 15.8678Z" fill="#569F44"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 20C15.5228 20 20 15.5228 20 10C20 4.47717 15.5228 0 10 0C4.47717 0 0 4.47717 0 10C0 15.5228 4.47717 20 10 20ZM8.14661 15.8678L16.8782 6.39722C16.9561 6.31335 17 6.19922 17 6.08008C17 5.96094 16.9561 5.8468 16.8782 5.76282L16.3016 5.12854C16.1386 4.95715 15.8796 4.95715 15.7167 5.12854L7.85004 13.661L4.28326 9.79236C4.20593 9.70776 4.10071 9.66016 3.99084 9.66016C3.9353 9.66016 3.88086 9.67236 3.83069 9.69531C3.78168 9.71777 3.73663 9.75061 3.69843 9.79236L3.12183 10.4177C3.07635 10.4667 3.04248 10.5259 3.02216 10.5905C3.00763 10.6365 3 10.6853 3 10.735C3 10.8541 3.04388 10.9683 3.12183 11.0521L7.56177 15.8678C7.6391 15.9524 7.74438 16 7.85419 16C7.96399 16 8.06927 15.9524 8.14661 15.8678Z" fill="#569F44"/>
|
|
3
|
+
</svg>
|
package/dist/index.d.ts
CHANGED
|
@@ -8,3 +8,4 @@ export { MyTicketsContainer } from './components/myTicketsContainer';
|
|
|
8
8
|
export { OrderDetailsContainer } from './components/orderDetailsContainer';
|
|
9
9
|
export { setConfigs } from './utils/setConfigs';
|
|
10
10
|
export { TicketResaleContainer } from './components';
|
|
11
|
+
export { RedirectModal } from './components/common/RedirectModal';
|
|
@@ -1121,6 +1121,13 @@ var publicRequest = /*#__PURE__*/axios.create({
|
|
|
1121
1121
|
headers: ttfHeaders
|
|
1122
1122
|
});
|
|
1123
1123
|
publicRequest.interceptors.response.use(function (response) {
|
|
1124
|
+
var authGuestToken = _get(response, 'headers.authorization-guest');
|
|
1125
|
+
|
|
1126
|
+
if (isWindowDefined && authGuestToken) {
|
|
1127
|
+
window.localStorage.setItem('auth_guest_token', authGuestToken);
|
|
1128
|
+
publicRequest.setGuestToken(authGuestToken);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1124
1131
|
return response;
|
|
1125
1132
|
}, function (error) {
|
|
1126
1133
|
var _error$response;
|
|
@@ -1129,7 +1136,6 @@ publicRequest.interceptors.response.use(function (response) {
|
|
|
1129
1136
|
if (isWindowDefined) {
|
|
1130
1137
|
var _error$response2, _error$response2$data;
|
|
1131
1138
|
|
|
1132
|
-
window.localStorage.removeItem('auth_guest_token');
|
|
1133
1139
|
window.localStorage.removeItem('user_data');
|
|
1134
1140
|
window.localStorage.removeItem('access_token');
|
|
1135
1141
|
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;
|
|
@@ -1140,6 +1146,13 @@ publicRequest.interceptors.response.use(function (response) {
|
|
|
1140
1146
|
}
|
|
1141
1147
|
}
|
|
1142
1148
|
|
|
1149
|
+
var authGuestToken = _get(error, 'response.headers.authorization-guest');
|
|
1150
|
+
|
|
1151
|
+
if (isWindowDefined && authGuestToken) {
|
|
1152
|
+
window.localStorage.setItem('auth_guest_token', authGuestToken);
|
|
1153
|
+
publicRequest.setGuestToken(authGuestToken);
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1143
1156
|
return Promise.reject(error);
|
|
1144
1157
|
});
|
|
1145
1158
|
publicRequest.interceptors.request.use(function (config) {
|
|
@@ -3027,10 +3040,6 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3027
3040
|
el.required = flagRequirePhone;
|
|
3028
3041
|
}
|
|
3029
3042
|
|
|
3030
|
-
if (el.name === 'street_address') {
|
|
3031
|
-
el.required = true;
|
|
3032
|
-
}
|
|
3033
|
-
|
|
3034
3043
|
return true;
|
|
3035
3044
|
}), function (element) {
|
|
3036
3045
|
return ['password', 'confirmPassword', 'password-info'].includes(element.name) && isLoggedIn ? null : React__default.createElement(React__default.Fragment, {
|
|
@@ -4607,7 +4616,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4607
4616
|
showWaitingList = _useState6[0],
|
|
4608
4617
|
setShowWaitingList = _useState6[1];
|
|
4609
4618
|
|
|
4610
|
-
var _useState7 = React.useState(
|
|
4619
|
+
var _useState7 = React.useState(true),
|
|
4611
4620
|
isLoading = _useState7[0],
|
|
4612
4621
|
setIsLoading = _useState7[1];
|
|
4613
4622
|
|
|
@@ -4723,7 +4732,6 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4723
4732
|
eventResponse = _context2.sent;
|
|
4724
4733
|
|
|
4725
4734
|
if (response.data.success) {
|
|
4726
|
-
setCustomHeader(response);
|
|
4727
4735
|
attributes = _get(response, 'data.data.attributes');
|
|
4728
4736
|
setPromoCodeIsApplied(attributes.ValidPromoCode);
|
|
4729
4737
|
setTickets(_get(attributes, 'tickets'));
|
|
@@ -4819,11 +4827,10 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4819
4827
|
result = _context.sent;
|
|
4820
4828
|
|
|
4821
4829
|
if (!(result.status === 200)) {
|
|
4822
|
-
_context.next =
|
|
4830
|
+
_context.next = 26;
|
|
4823
4831
|
break;
|
|
4824
4832
|
}
|
|
4825
4833
|
|
|
4826
|
-
setCustomHeader(result);
|
|
4827
4834
|
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;
|
|
4828
4835
|
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;
|
|
4829
4836
|
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;
|
|
@@ -4831,7 +4838,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4831
4838
|
hash = '';
|
|
4832
4839
|
|
|
4833
4840
|
if (!skipBillingPage) {
|
|
4834
|
-
_context.next =
|
|
4841
|
+
_context.next = 25;
|
|
4835
4842
|
break;
|
|
4836
4843
|
}
|
|
4837
4844
|
|
|
@@ -4840,14 +4847,14 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4840
4847
|
userData = _isWindowDefined && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
4841
4848
|
access_token = _isWindowDefined && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
4842
4849
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
4843
|
-
_context.next =
|
|
4850
|
+
_context.next = 23;
|
|
4844
4851
|
return postOnCheckout(checkoutBody, access_token);
|
|
4845
4852
|
|
|
4846
|
-
case
|
|
4853
|
+
case 23:
|
|
4847
4854
|
checkoutResult = _context.sent;
|
|
4848
4855
|
hash = _get(checkoutResult, 'data.data.attributes.hash');
|
|
4849
4856
|
|
|
4850
|
-
case
|
|
4857
|
+
case 25:
|
|
4851
4858
|
onAddToCartSuccess({
|
|
4852
4859
|
skip_billing_page: skipBillingPage,
|
|
4853
4860
|
names_required: nameIsRequired,
|
|
@@ -4857,29 +4864,29 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4857
4864
|
hash: hash
|
|
4858
4865
|
});
|
|
4859
4866
|
|
|
4860
|
-
case
|
|
4861
|
-
_context.next =
|
|
4867
|
+
case 26:
|
|
4868
|
+
_context.next = 31;
|
|
4862
4869
|
break;
|
|
4863
4870
|
|
|
4864
|
-
case
|
|
4865
|
-
_context.prev =
|
|
4871
|
+
case 28:
|
|
4872
|
+
_context.prev = 28;
|
|
4866
4873
|
_context.t0 = _context["catch"](6);
|
|
4867
4874
|
|
|
4868
4875
|
if (axios.isAxiosError(_context.t0)) {
|
|
4869
4876
|
onAddToCartError(_context.t0);
|
|
4870
4877
|
}
|
|
4871
4878
|
|
|
4872
|
-
case
|
|
4873
|
-
_context.prev =
|
|
4879
|
+
case 31:
|
|
4880
|
+
_context.prev = 31;
|
|
4874
4881
|
setHandleBookIsLoading(false);
|
|
4875
|
-
return _context.finish(
|
|
4882
|
+
return _context.finish(31);
|
|
4876
4883
|
|
|
4877
|
-
case
|
|
4884
|
+
case 34:
|
|
4878
4885
|
case "end":
|
|
4879
4886
|
return _context.stop();
|
|
4880
4887
|
}
|
|
4881
4888
|
}
|
|
4882
|
-
}, _callee, null, [[6,
|
|
4889
|
+
}, _callee, null, [[6, 28, 31, 34]]);
|
|
4883
4890
|
}));
|
|
4884
4891
|
|
|
4885
4892
|
return function handleBook() {
|
|
@@ -4930,7 +4937,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4930
4937
|
var bookButtonIsDisabled = handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0;
|
|
4931
4938
|
return React__default.createElement(privateTheming.ThemeProvider, {
|
|
4932
4939
|
theme: themeMui
|
|
4933
|
-
}, React__default.createElement(ReferralLogic, {
|
|
4940
|
+
}, !isLoading && React__default.createElement(ReferralLogic, {
|
|
4934
4941
|
eventId: eventId
|
|
4935
4942
|
}), React__default.createElement("div", {
|
|
4936
4943
|
className: "get-tickets-page " + theme,
|
|
@@ -5833,12 +5840,45 @@ var TicketResaleContainer = function TicketResaleContainer(_ref) {
|
|
|
5833
5840
|
}, React__default.createElement("h3", null, error)));
|
|
5834
5841
|
};
|
|
5835
5842
|
|
|
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__default.createElement(Modal, {
|
|
5862
|
+
open: true,
|
|
5863
|
+
"aria-labelledby": "modal-modal-title",
|
|
5864
|
+
"aria-describedby": "modal-modal-description",
|
|
5865
|
+
className: "redirect-modal"
|
|
5866
|
+
}, React__default.createElement(Box, {
|
|
5867
|
+
style: style$3
|
|
5868
|
+
}, React__default.createElement("p", null, message), React__default.createElement("div", {
|
|
5869
|
+
className: "footer"
|
|
5870
|
+
}, React__default.createElement("button", {
|
|
5871
|
+
onClick: onClickOk
|
|
5872
|
+
}, "OK"))));
|
|
5873
|
+
};
|
|
5874
|
+
|
|
5836
5875
|
exports.BillingInfoContainer = BillingInfoContainer;
|
|
5837
5876
|
exports.ConfirmationContainer = ConfirmationContainer;
|
|
5838
5877
|
exports.LoginModal = LoginModal;
|
|
5839
5878
|
exports.MyTicketsContainer = MyTicketsContainer;
|
|
5840
5879
|
exports.OrderDetailsContainer = OrderDetailsContainer;
|
|
5841
5880
|
exports.PaymentContainer = PaymentContainer;
|
|
5881
|
+
exports.RedirectModal = RedirectModal;
|
|
5842
5882
|
exports.TicketResaleContainer = TicketResaleContainer;
|
|
5843
5883
|
exports.TicketsContainer = TicketsContainer;
|
|
5844
5884
|
exports.createFixedFloatNormalizer = createFixedFloatNormalizer;
|