tf-checkout-react 1.4.5 → 1.4.7

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.
@@ -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;
@@ -61,6 +61,7 @@ export interface IGetTickets {
61
61
  currencySybmol?: string;
62
62
  onReserveButtonClick?: () => void;
63
63
  onPendingVerification?: () => void;
64
+ showAlertIcons?: boolean;
64
65
  }
65
66
  export interface ITicket {
66
67
  id: string | number;
@@ -70,5 +71,5 @@ export interface ISelectedTickets {
70
71
  isTable: boolean;
71
72
  [key: string]: string | number | boolean;
72
73
  }
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;
74
+ 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, showAlertIcons, }: IGetTickets) => JSX.Element;
74
75
  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"
@@ -5530,7 +5531,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
5530
5531
  _ref$onReserveButtonC = _ref.onReserveButtonClick,
5531
5532
  onReserveButtonClick = _ref$onReserveButtonC === void 0 ? _identity : _ref$onReserveButtonC,
5532
5533
  _ref$onPendingVerific = _ref.onPendingVerification,
5533
- onPendingVerification = _ref$onPendingVerific === void 0 ? _identity : _ref$onPendingVerific;
5534
+ onPendingVerification = _ref$onPendingVerific === void 0 ? _identity : _ref$onPendingVerific,
5535
+ _ref$showAlertIcons = _ref.showAlertIcons,
5536
+ showAlertIcons = _ref$showAlertIcons === void 0 ? true : _ref$showAlertIcons;
5534
5537
  var _useState = React.useState({}),
5535
5538
  selectedTickets = _useState[0],
5536
5539
  setSelectedTickets = _useState[1];
@@ -6070,7 +6073,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
6070
6073
  updateTickets: updateTickets,
6071
6074
  codeIsInvalid: codeIsInvalid,
6072
6075
  setCodeIsInvalid: setCodeIsInvalid,
6073
- promoText: promoText
6076
+ promoText: promoText,
6077
+ showAlertIcons: showAlertIcons
6074
6078
  }) : null, wrappedActionsSectionComponent, canShowGetTicketBtn() && React__default.createElement(Button$1, {
6075
6079
  "aria-hidden": true,
6076
6080
  className: "book-button \n " + (bookButtonIsDisabled ? 'disabled' : '') + " \n " + (isButtonScrollable ? 'is-scrollable' : '') + "\n " + (!isLoggedIn ? 'on-bottom' : '') + "\n ",
@@ -8385,13 +8389,14 @@ var SeatMapContainer = function SeatMapContainer(props) {
8385
8389
  var _useState11 = React.useState({}),
8386
8390
  guestCounts = _useState11[0],
8387
8391
  setGuestCounts = _useState11[1];
8392
+ var isGuestCountsSet = React.useRef(false);
8388
8393
  var updateGuestCounts = function updateGuestCounts(data) {
8389
8394
  _forEach(data, function (item) {
8390
8395
  var tierTickets = ticketTypeTierRelationsRef.current[item.tierId];
8391
8396
  var seatTicketsArray = _values(tierTickets);
8392
8397
  setGuestCounts(function (prevState) {
8393
8398
  var _extends2;
8394
- return _extends({}, prevState, (_extends2 = {}, _extends2[item.seatId] = Number(seatTicketsArray[0].ticket_type_min_number_of_guests), _extends2));
8399
+ return _extends((_extends2 = {}, _extends2[item.seatId] = Number(seatTicketsArray[0].ticket_type_min_number_of_guests), _extends2), prevState);
8395
8400
  });
8396
8401
  });
8397
8402
  };
@@ -8457,7 +8462,10 @@ var SeatMapContainer = function SeatMapContainer(props) {
8457
8462
  setReservedSeats(reservationData);
8458
8463
  // automatically set ticket/table type if it's the only one
8459
8464
  if (ticketTypeTierRelationsRef.current) {
8460
- updateGuestCounts(reservationData);
8465
+ if (!isGuestCountsSet.current) {
8466
+ updateGuestCounts(reservationData);
8467
+ isGuestCountsSet.current = true;
8468
+ }
8461
8469
  _forEach(reservationData, function (item) {
8462
8470
  var tierTickets = ticketTypeTierRelationsRef.current[item.tierId];
8463
8471
  var seatTicketsArray = _values(tierTickets);