tf-checkout-react 1.4.6 → 1.4.8-beta.1
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/ticketsContainer/PromoCodeSection.d.ts +2 -1
- package/dist/components/ticketsContainer/index.d.ts +3 -1
- package/dist/tf-checkout-react.cjs.development.js +40 -33
- 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 +40 -33
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/orderDetailsContainer/index.tsx +1 -1
- package/src/components/orderDetailsContainer/ticketsTable.tsx +1 -1
- package/src/components/ticketsContainer/PromoCodeSection.tsx +15 -9
- package/src/components/ticketsContainer/index.tsx +6 -0
- package/src/components/common/dist/PhoneNumberField.js +0 -96
|
@@ -10,5 +10,6 @@ export interface IPromoCodeSectionProps {
|
|
|
10
10
|
codeIsInvalid: boolean;
|
|
11
11
|
setCodeIsInvalid: (value: boolean) => void;
|
|
12
12
|
promoText?: string;
|
|
13
|
+
showAlertIcons?: boolean;
|
|
13
14
|
}
|
|
14
|
-
export declare const PromoCodeSection: ({ code, codeIsApplied, showPromoInput, setCode, setShowPromoInput, updateTickets, setCodeIsApplied, codeIsInvalid, setCodeIsInvalid, promoText, }: IPromoCodeSectionProps) => JSX.Element;
|
|
15
|
+
export declare const PromoCodeSection: ({ code, codeIsApplied, showPromoInput, setCode, setShowPromoInput, updateTickets, setCodeIsApplied, codeIsInvalid, setCodeIsInvalid, promoText, showAlertIcons }: IPromoCodeSectionProps) => JSX.Element;
|
|
@@ -24,6 +24,7 @@ export interface IGetTickets {
|
|
|
24
24
|
contentStyle?: React.CSSProperties;
|
|
25
25
|
onAddToCartError: (e: AxiosError) => void;
|
|
26
26
|
onGetTicketsSuccess: (response: any) => void;
|
|
27
|
+
onGetTicketsPress: () => void;
|
|
27
28
|
onGetTicketsError: (e: AxiosError) => void;
|
|
28
29
|
onLogoutSuccess: () => void;
|
|
29
30
|
onLogoutError: (e: AxiosError) => void;
|
|
@@ -61,6 +62,7 @@ export interface IGetTickets {
|
|
|
61
62
|
currencySybmol?: string;
|
|
62
63
|
onReserveButtonClick?: () => void;
|
|
63
64
|
onPendingVerification?: () => void;
|
|
65
|
+
showAlertIcons?: boolean;
|
|
64
66
|
}
|
|
65
67
|
export interface ITicket {
|
|
66
68
|
id: string | number;
|
|
@@ -70,5 +72,5 @@ export interface ISelectedTickets {
|
|
|
70
72
|
isTable: boolean;
|
|
71
73
|
[key: string]: string | number | boolean;
|
|
72
74
|
}
|
|
73
|
-
export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, onLogoutSuccess, onLogoutError, onGetProfileDataSuccess, onGetProfileDataError, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons, hideWaitingList, enableBillingInfoAutoCreate, isButtonScrollable, sortBySoldOut, disableCountdownLeadingZero, isLoggedIn, actionsSectionComponent: ActionsSectionComponent, ticketsHeaderComponent, hideTicketsHeader, tableTicketsHeaderComponent, hideTableTicketsHeader, enableInfluencersSection, enableAddOns, handleNotInvitedModalClose, handleInvalidLinkModalClose, ordersPath, showPoweredByImage, promoText, showGroupNameBlock, currencySybmol, onReserveButtonClick, onPendingVerification, }: IGetTickets) => JSX.Element;
|
|
75
|
+
export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, onLogoutSuccess, onLogoutError, onGetProfileDataSuccess, onGetProfileDataError, onGetTicketsPress, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons, hideWaitingList, enableBillingInfoAutoCreate, isButtonScrollable, sortBySoldOut, disableCountdownLeadingZero, isLoggedIn, actionsSectionComponent: ActionsSectionComponent, ticketsHeaderComponent, hideTicketsHeader, tableTicketsHeaderComponent, hideTableTicketsHeader, enableInfluencersSection, enableAddOns, handleNotInvitedModalClose, handleInvalidLinkModalClose, ordersPath, showPoweredByImage, promoText, showGroupNameBlock, currencySybmol, onReserveButtonClick, onPendingVerification, showAlertIcons, }: IGetTickets) => JSX.Element;
|
|
74
76
|
export {};
|
|
@@ -5160,7 +5160,8 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
5160
5160
|
setCodeIsApplied = _ref.setCodeIsApplied,
|
|
5161
5161
|
codeIsInvalid = _ref.codeIsInvalid,
|
|
5162
5162
|
setCodeIsInvalid = _ref.setCodeIsInvalid,
|
|
5163
|
-
promoText = _ref.promoText
|
|
5163
|
+
promoText = _ref.promoText,
|
|
5164
|
+
showAlertIcons = _ref.showAlertIcons;
|
|
5164
5165
|
var isPromoCodeHasValue = !!code.trim();
|
|
5165
5166
|
var renderInputField = function renderInputField() {
|
|
5166
5167
|
return React__default.createElement("div", {
|
|
@@ -5193,7 +5194,7 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
5193
5194
|
};
|
|
5194
5195
|
return React__default.createElement("div", null, codeIsApplied ? React__default.createElement("div", {
|
|
5195
5196
|
className: "alert-info"
|
|
5196
|
-
}, React__default.createElement(SVG, {
|
|
5197
|
+
}, showAlertIcons && React__default.createElement(SVG, {
|
|
5197
5198
|
src: DoneSvg,
|
|
5198
5199
|
preProcessor: function preProcessor(code) {
|
|
5199
5200
|
return code.replace(/fill=".*?"/g, 'fill="currentColor"');
|
|
@@ -5202,7 +5203,7 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
5202
5203
|
className: "promo-code-success"
|
|
5203
5204
|
}, "PROMO CODE APPLIED SUCCESSFULLY")) : null, codeIsInvalid ? React__default.createElement("div", {
|
|
5204
5205
|
className: "alert-info fail"
|
|
5205
|
-
}, React__default.createElement(SVG, {
|
|
5206
|
+
}, showAlertIcons && React__default.createElement(SVG, {
|
|
5206
5207
|
src: XmarkSvg
|
|
5207
5208
|
}), React__default.createElement("p", {
|
|
5208
5209
|
className: "promo-code-fail"
|
|
@@ -5481,6 +5482,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5481
5482
|
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? _identity : _ref$onGetProfileData,
|
|
5482
5483
|
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
5483
5484
|
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? _identity : _ref$onGetProfileData2,
|
|
5485
|
+
_ref$onGetTicketsPres = _ref.onGetTicketsPress,
|
|
5486
|
+
onGetTicketsPress = _ref$onGetTicketsPres === void 0 ? _identity : _ref$onGetTicketsPres,
|
|
5484
5487
|
_ref$theme = _ref.theme,
|
|
5485
5488
|
theme = _ref$theme === void 0 ? 'light' : _ref$theme,
|
|
5486
5489
|
_ref$queryPromoCode = _ref.queryPromoCode,
|
|
@@ -5530,7 +5533,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5530
5533
|
_ref$onReserveButtonC = _ref.onReserveButtonClick,
|
|
5531
5534
|
onReserveButtonClick = _ref$onReserveButtonC === void 0 ? _identity : _ref$onReserveButtonC,
|
|
5532
5535
|
_ref$onPendingVerific = _ref.onPendingVerification,
|
|
5533
|
-
onPendingVerification = _ref$onPendingVerific === void 0 ? _identity : _ref$onPendingVerific
|
|
5536
|
+
onPendingVerification = _ref$onPendingVerific === void 0 ? _identity : _ref$onPendingVerific,
|
|
5537
|
+
_ref$showAlertIcons = _ref.showAlertIcons,
|
|
5538
|
+
showAlertIcons = _ref$showAlertIcons === void 0 ? true : _ref$showAlertIcons;
|
|
5534
5539
|
var _useState = React.useState({}),
|
|
5535
5540
|
selectedTickets = _useState[0],
|
|
5536
5541
|
setSelectedTickets = _useState[1];
|
|
@@ -5781,31 +5786,32 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5781
5786
|
}
|
|
5782
5787
|
};
|
|
5783
5788
|
_context2.prev = 8;
|
|
5784
|
-
|
|
5789
|
+
onGetTicketsPress();
|
|
5790
|
+
_context2.next = 12;
|
|
5785
5791
|
return addToCart(eventId, data);
|
|
5786
|
-
case
|
|
5792
|
+
case 12:
|
|
5787
5793
|
result = _context2.sent;
|
|
5788
5794
|
if (!enableAddOns) {
|
|
5789
|
-
_context2.next =
|
|
5795
|
+
_context2.next = 19;
|
|
5790
5796
|
break;
|
|
5791
5797
|
}
|
|
5792
|
-
_context2.next =
|
|
5798
|
+
_context2.next = 16;
|
|
5793
5799
|
return getCheckoutPageConfigs();
|
|
5794
|
-
case
|
|
5800
|
+
case 16:
|
|
5795
5801
|
_context2.t0 = _context2.sent;
|
|
5796
|
-
_context2.next =
|
|
5802
|
+
_context2.next = 20;
|
|
5797
5803
|
break;
|
|
5798
|
-
case
|
|
5804
|
+
case 19:
|
|
5799
5805
|
_context2.t0 = {
|
|
5800
5806
|
status: 200,
|
|
5801
5807
|
data: {
|
|
5802
5808
|
attributes: _get(result, 'data.data.attributes')
|
|
5803
5809
|
}
|
|
5804
5810
|
};
|
|
5805
|
-
case
|
|
5811
|
+
case 20:
|
|
5806
5812
|
pageConfigsDataResponse = _context2.t0;
|
|
5807
5813
|
if (!(result.status === 200 && pageConfigsDataResponse.status === 200)) {
|
|
5808
|
-
_context2.next =
|
|
5814
|
+
_context2.next = 51;
|
|
5809
5815
|
break;
|
|
5810
5816
|
}
|
|
5811
5817
|
pageConfigsData = _get(pageConfigsDataResponse, 'data.attributes') || {};
|
|
@@ -5823,7 +5829,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5823
5829
|
_isWindowDefined = typeof window !== 'undefined';
|
|
5824
5830
|
_isWindowDefined && window.localStorage.removeItem('add_ons');
|
|
5825
5831
|
if (!(skipBillingPage && !hasAddOn)) {
|
|
5826
|
-
_context2.next =
|
|
5832
|
+
_context2.next = 50;
|
|
5827
5833
|
break;
|
|
5828
5834
|
}
|
|
5829
5835
|
// Get user data for checkout data
|
|
@@ -5831,22 +5837,22 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5831
5837
|
access_token = _isWindowDefined && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
5832
5838
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
5833
5839
|
if (!enableBillingInfoAutoCreate) {
|
|
5834
|
-
_context2.next =
|
|
5840
|
+
_context2.next = 46;
|
|
5835
5841
|
break;
|
|
5836
5842
|
}
|
|
5837
|
-
_context2.next =
|
|
5843
|
+
_context2.next = 43;
|
|
5838
5844
|
return postOnCheckout(checkoutBody, access_token, freeTicket);
|
|
5839
|
-
case
|
|
5845
|
+
case 43:
|
|
5840
5846
|
_context2.t1 = _context2.sent;
|
|
5841
|
-
_context2.next =
|
|
5847
|
+
_context2.next = 47;
|
|
5842
5848
|
break;
|
|
5843
|
-
case 45:
|
|
5844
|
-
_context2.t1 = null;
|
|
5845
5849
|
case 46:
|
|
5850
|
+
_context2.t1 = null;
|
|
5851
|
+
case 47:
|
|
5846
5852
|
checkoutResult = _context2.t1;
|
|
5847
5853
|
hash = _get(checkoutResult, 'data.data.attributes.hash');
|
|
5848
5854
|
total = _get(checkoutResult, 'data.data.attributes.total');
|
|
5849
|
-
case
|
|
5855
|
+
case 50:
|
|
5850
5856
|
onAddToCartSuccess({
|
|
5851
5857
|
skip_billing_page: skipBillingPage,
|
|
5852
5858
|
names_required: nameIsRequired,
|
|
@@ -5861,11 +5867,11 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5861
5867
|
total: total,
|
|
5862
5868
|
hasAddOn: hasAddOn
|
|
5863
5869
|
});
|
|
5864
|
-
case
|
|
5865
|
-
_context2.next =
|
|
5870
|
+
case 51:
|
|
5871
|
+
_context2.next = 56;
|
|
5866
5872
|
break;
|
|
5867
|
-
case
|
|
5868
|
-
_context2.prev =
|
|
5873
|
+
case 53:
|
|
5874
|
+
_context2.prev = 53;
|
|
5869
5875
|
_context2.t2 = _context2["catch"](8);
|
|
5870
5876
|
if ((_e$response = _context2.t2.response) != null && (_e$response$data = _e$response.data) != null && (_e$response$data$data = _e$response$data.data) != null && _e$response$data$data.hasUnverifiedOrder) {
|
|
5871
5877
|
setPendingVerificationMessage((_e$response2 = _context2.t2.response) == null ? void 0 : (_e$response2$data = _e$response2.data) == null ? void 0 : _e$response2$data.message);
|
|
@@ -5882,15 +5888,15 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5882
5888
|
setError(message);
|
|
5883
5889
|
}
|
|
5884
5890
|
}
|
|
5885
|
-
case
|
|
5886
|
-
_context2.prev =
|
|
5891
|
+
case 56:
|
|
5892
|
+
_context2.prev = 56;
|
|
5887
5893
|
setHandleBookIsLoading(false);
|
|
5888
|
-
return _context2.finish(
|
|
5889
|
-
case
|
|
5894
|
+
return _context2.finish(56);
|
|
5895
|
+
case 59:
|
|
5890
5896
|
case "end":
|
|
5891
5897
|
return _context2.stop();
|
|
5892
5898
|
}
|
|
5893
|
-
}, _callee2, null, [[8,
|
|
5899
|
+
}, _callee2, null, [[8, 53, 56, 59]]);
|
|
5894
5900
|
}));
|
|
5895
5901
|
return function handleBook() {
|
|
5896
5902
|
return _ref4.apply(this, arguments);
|
|
@@ -6070,7 +6076,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
6070
6076
|
updateTickets: updateTickets,
|
|
6071
6077
|
codeIsInvalid: codeIsInvalid,
|
|
6072
6078
|
setCodeIsInvalid: setCodeIsInvalid,
|
|
6073
|
-
promoText: promoText
|
|
6079
|
+
promoText: promoText,
|
|
6080
|
+
showAlertIcons: showAlertIcons
|
|
6074
6081
|
}) : null, wrappedActionsSectionComponent, canShowGetTicketBtn() && React__default.createElement(Button$1, {
|
|
6075
6082
|
"aria-hidden": true,
|
|
6076
6083
|
className: "book-button \n " + (bookButtonIsDisabled ? 'disabled' : '') + " \n " + (isButtonScrollable ? 'is-scrollable' : '') + "\n " + (!isLoggedIn ? 'on-bottom' : '') + "\n ",
|
|
@@ -6746,7 +6753,7 @@ var TicketsTable = function TicketsTable(_ref) {
|
|
|
6746
6753
|
}, React__default.createElement(TableHead, null, React__default.createElement(TableRow, null, React__default.createElement(TableCell, null, "Add-On"), React__default.createElement(TableCell, null, "Status"))), React__default.createElement(TableBody, null, ticket.add_ons.map(function (add_on, index) {
|
|
6747
6754
|
return React__default.createElement(TableRow, {
|
|
6748
6755
|
key: index
|
|
6749
|
-
}, React__default.createElement(TableCell, null, add_on.groupName
|
|
6756
|
+
}, React__default.createElement(TableCell, null, add_on.groupName && add_on.groupName + ": ", " ", add_on.name), React__default.createElement(TableCell, null, add_on.status));
|
|
6750
6757
|
}))))));
|
|
6751
6758
|
})))));
|
|
6752
6759
|
};
|
|
@@ -7050,7 +7057,7 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
7050
7057
|
}), data == null ? void 0 : (_data$items2 = data.items) == null ? void 0 : (_data$items2$add_ons = _data$items2.add_ons) == null ? void 0 : _data$items2$add_ons.map(function (ticket, index) {
|
|
7051
7058
|
return React__default.createElement(TableRow, {
|
|
7052
7059
|
key: index
|
|
7053
|
-
}, React__default.createElement(TableCell, null, React__default.createElement("div", null, React__default.createElement("b", null, "Add-On"), React__default.createElement("div", null, ticket.groupName
|
|
7060
|
+
}, React__default.createElement(TableCell, null, React__default.createElement("div", null, React__default.createElement("b", null, "Add-On"), React__default.createElement("div", null, ticket.groupName && ticket.groupName + ": ", " ", ticket.name))), React__default.createElement(TableCell, null, ticket.currency + ticket.price), React__default.createElement(TableCell, null, ticket.quantity), React__default.createElement(TableCell, null, ticket.currency + ticket.total));
|
|
7054
7061
|
}), React__default.createElement(TableRow, {
|
|
7055
7062
|
className: "total-row"
|
|
7056
7063
|
}, React__default.createElement(TableCell, null), React__default.createElement(TableCell, null), React__default.createElement(TableCell, null, "Total"), React__default.createElement(TableCell, null, getTotal(data))))))), React__default.createElement(TicketsTable, {
|