tf-checkout-react 1.3.9 → 1.3.10

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.
@@ -8,6 +8,7 @@ interface CartSuccess {
8
8
  names_required: boolean;
9
9
  age_required: boolean;
10
10
  phone_required: boolean;
11
+ hide_phone_field: boolean;
11
12
  event_id: string;
12
13
  hash?: string;
13
14
  total?: string;
@@ -3050,7 +3050,8 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
3050
3050
 
3051
3051
  var expirationTime = _get(cartInfoData, 'expiresAt');
3052
3052
 
3053
- var flagRequirePhone = getQueryVariable('phone_required') === 'true'; // Get prevProps
3053
+ var flagRequirePhone = getQueryVariable('phone_required') === 'true';
3054
+ var hidePhoneField = getQueryVariable('hide_phone_field') === 'true'; // Get prevProps
3054
3055
 
3055
3056
  var prevData = React.useRef(data);
3056
3057
 
@@ -3605,7 +3606,11 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
3605
3606
  }
3606
3607
 
3607
3608
  if (el.name === 'phone') {
3608
- el.required = flagRequirePhone;
3609
+ if (!hidePhoneField) {
3610
+ el.required = flagRequirePhone;
3611
+ } else {
3612
+ return false;
3613
+ }
3609
3614
  }
3610
3615
 
3611
3616
  return true;
@@ -5640,7 +5645,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
5640
5645
  var _ref4 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
5641
5646
  var _product_options, _product_options2, _ticket_types;
5642
5647
 
5643
- var ticket, optionName, ticketId, ticketQuantity, data, result, pageConfigsDataResponse, _pageConfigsData$skip, _pageConfigsData$name, _pageConfigsData$age_, _pageConfigsData$phon, _pageConfigsData$has_, pageConfigsData, skipBillingPage, nameIsRequired, ageIsRequired, phoneIsRequired, hasAddOn, hash, total, _isWindowDefined, userData, access_token, checkoutBody, checkoutResult;
5648
+ var ticket, optionName, ticketId, ticketQuantity, data, result, pageConfigsDataResponse, _pageConfigsData$skip, _pageConfigsData$name, _pageConfigsData$age_, _pageConfigsData$phon, _pageConfigsData$hide, _pageConfigsData$has_, pageConfigsData, skipBillingPage, nameIsRequired, ageIsRequired, phoneIsRequired, hidePhoneField, hasAddOn, hash, total, _isWindowDefined, userData, access_token, checkoutBody, checkoutResult;
5644
5649
 
5645
5650
  return runtime_1.wrap(function _callee2$(_context2) {
5646
5651
  while (1) {
@@ -5697,7 +5702,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
5697
5702
  pageConfigsDataResponse = _context2.t0;
5698
5703
 
5699
5704
  if (!(result.status === 200 && pageConfigsDataResponse.status === 200)) {
5700
- _context2.next = 44;
5705
+ _context2.next = 45;
5701
5706
  break;
5702
5707
  }
5703
5708
 
@@ -5706,6 +5711,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
5706
5711
  nameIsRequired = (_pageConfigsData$name = pageConfigsData.names_required) != null ? _pageConfigsData$name : false;
5707
5712
  ageIsRequired = (_pageConfigsData$age_ = pageConfigsData.age_required) != null ? _pageConfigsData$age_ : false;
5708
5713
  phoneIsRequired = (_pageConfigsData$phon = pageConfigsData.phone_required) != null ? _pageConfigsData$phon : false;
5714
+ hidePhoneField = (_pageConfigsData$hide = pageConfigsData.hide_phone_field) != null ? _pageConfigsData$hide : false;
5709
5715
  hasAddOn = (_pageConfigsData$has_ = pageConfigsData.has_add_on) != null ? _pageConfigsData$has_ : false;
5710
5716
  hash = '';
5711
5717
  total = '';
@@ -5713,7 +5719,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
5713
5719
  _isWindowDefined && window.localStorage.removeItem('add_ons');
5714
5720
 
5715
5721
  if (!(skipBillingPage && !hasAddOn)) {
5716
- _context2.next = 43;
5722
+ _context2.next = 44;
5717
5723
  break;
5718
5724
  }
5719
5725
 
@@ -5723,44 +5729,45 @@ var TicketsContainer = function TicketsContainer(_ref) {
5723
5729
  checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
5724
5730
 
5725
5731
  if (!enableBillingInfoAutoCreate) {
5726
- _context2.next = 39;
5732
+ _context2.next = 40;
5727
5733
  break;
5728
5734
  }
5729
5735
 
5730
- _context2.next = 36;
5736
+ _context2.next = 37;
5731
5737
  return postOnCheckout(checkoutBody, access_token);
5732
5738
 
5733
- case 36:
5739
+ case 37:
5734
5740
  _context2.t1 = _context2.sent;
5735
- _context2.next = 40;
5741
+ _context2.next = 41;
5736
5742
  break;
5737
5743
 
5738
- case 39:
5744
+ case 40:
5739
5745
  _context2.t1 = null;
5740
5746
 
5741
- case 40:
5747
+ case 41:
5742
5748
  checkoutResult = _context2.t1;
5743
5749
  hash = _get(checkoutResult, 'data.data.attributes.hash');
5744
5750
  total = _get(checkoutResult, 'data.data.attributes.total');
5745
5751
 
5746
- case 43:
5752
+ case 44:
5747
5753
  onAddToCartSuccess({
5748
5754
  skip_billing_page: skipBillingPage,
5749
5755
  names_required: nameIsRequired,
5750
5756
  phone_required: phoneIsRequired,
5751
5757
  age_required: ageIsRequired,
5758
+ hide_phone_field: hidePhoneField,
5752
5759
  event_id: String(eventId),
5753
5760
  hash: hash,
5754
5761
  total: total,
5755
5762
  hasAddOn: hasAddOn
5756
5763
  });
5757
5764
 
5758
- case 44:
5759
- _context2.next = 49;
5765
+ case 45:
5766
+ _context2.next = 50;
5760
5767
  break;
5761
5768
 
5762
- case 46:
5763
- _context2.prev = 46;
5769
+ case 47:
5770
+ _context2.prev = 47;
5764
5771
  _context2.t2 = _context2["catch"](6);
5765
5772
 
5766
5773
  if (axios.isAxiosError(_context2.t2)) {
@@ -5768,17 +5775,17 @@ var TicketsContainer = function TicketsContainer(_ref) {
5768
5775
  setError(_get(_context2.t2, 'response.data.message'));
5769
5776
  }
5770
5777
 
5771
- case 49:
5772
- _context2.prev = 49;
5778
+ case 50:
5779
+ _context2.prev = 50;
5773
5780
  setHandleBookIsLoading(false);
5774
- return _context2.finish(49);
5781
+ return _context2.finish(50);
5775
5782
 
5776
- case 52:
5783
+ case 53:
5777
5784
  case "end":
5778
5785
  return _context2.stop();
5779
5786
  }
5780
5787
  }
5781
- }, _callee2, null, [[6, 46, 49, 52]]);
5788
+ }, _callee2, null, [[6, 47, 50, 53]]);
5782
5789
  }));
5783
5790
 
5784
5791
  return function handleBook() {