tf-checkout-react 1.7.4 → 1.7.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.
@@ -31,6 +31,7 @@ import Visibility from '@mui/icons-material/Visibility';
31
31
  import VisibilityOff from '@mui/icons-material/VisibilityOff';
32
32
  import IconButton from '@mui/material/IconButton';
33
33
  import InputAdornment from '@mui/material/InputAdornment';
34
+ import MenuItem from '@mui/material/MenuItem';
34
35
  import TextField from '@mui/material/TextField';
35
36
  import _includes from 'lodash-es/includes';
36
37
  import _isFunction from 'lodash-es/isFunction';
@@ -39,7 +40,6 @@ import MuiPhoneNumber from 'material-ui-phone-number';
39
40
  import _debounce from 'lodash-es/debounce';
40
41
  import FormHelperText$1 from '@mui/material/FormHelperText';
41
42
  import ListItemText from '@mui/material/ListItemText';
42
- import MenuItem from '@mui/material/MenuItem';
43
43
  import OutlinedInput from '@mui/material/OutlinedInput';
44
44
  import Select from '@mui/material/Select';
45
45
  import Modal$2 from '@mui/material/Modal';
@@ -2835,7 +2835,7 @@ var Checkbox = function Checkbox(_ref) {
2835
2835
  };
2836
2836
 
2837
2837
  var CustomField = function CustomField(_ref2) {
2838
- var _ref$current, _customTheme$input;
2838
+ var _ref$current, _ref$current2, _customTheme$input;
2839
2839
  var label = _ref2.label,
2840
2840
  _ref2$type = _ref2.type,
2841
2841
  type = _ref2$type === void 0 ? 'text' : _ref2$type,
@@ -2866,7 +2866,7 @@ var CustomField = function CustomField(_ref2) {
2866
2866
  showPassword = _useState2[0],
2867
2867
  setShowPassword = _useState2[1];
2868
2868
  var _ref = useRef(null);
2869
- var isAutoFilled = (_ref$current = _ref.current) == null ? void 0 : _ref$current.matches(':-webkit-autofill');
2869
+ var isAutoFilled = (_ref$current = _ref.current) != null && _ref$current.matches ? (_ref$current2 = _ref.current) == null ? void 0 : _ref$current2.matches(':-webkit-autofill') : false;
2870
2870
  var isSelectField = type === 'select';
2871
2871
  var isPasswordField = type === 'password';
2872
2872
  var error = _get(errors, field.name);
@@ -2916,10 +2916,18 @@ var CustomField = function CustomField(_ref2) {
2916
2916
  setIsShrinked(true);
2917
2917
  },
2918
2918
  SelectProps: {
2919
- "native": true,
2919
+ "native": false,
2920
2920
  className: theme,
2921
2921
  MenuProps: {
2922
- className: theme
2922
+ className: theme,
2923
+ PaperProps: {
2924
+ sx: {
2925
+ '& .MuiMenuItem-root': {
2926
+ paddingLeft: '16px',
2927
+ paddingRight: '16px'
2928
+ }
2929
+ }
2930
+ }
2923
2931
  }
2924
2932
  },
2925
2933
  InputLabelProps: {
@@ -2941,7 +2949,7 @@ var CustomField = function CustomField(_ref2) {
2941
2949
  },
2942
2950
  onChange: onChange != null ? onChange : field.onChange
2943
2951
  }), isSelectField ? _map(selectOptions, function (option) {
2944
- return React.createElement("option", {
2952
+ return React.createElement(MenuItem, {
2945
2953
  key: option.value,
2946
2954
  value: option.value,
2947
2955
  disabled: option.disabled
@@ -5061,7 +5069,10 @@ var SignUpForm = function SignUpForm(_ref) {
5061
5069
  spacing: 2,
5062
5070
  sx: {
5063
5071
  padding: '15px 25px',
5064
- maxHeight: '60vh',
5072
+ maxHeight: {
5073
+ xs: '40vh',
5074
+ sm: '60vh'
5075
+ },
5065
5076
  overflowY: 'auto'
5066
5077
  }
5067
5078
  }, React.createElement(Grid, {
@@ -5312,7 +5323,13 @@ var LoginModal = function LoginModal(_ref) {
5312
5323
  "aria-describedby": "modal-modal-description",
5313
5324
  className: "login-modal " + modalClassname
5314
5325
  }, React.createElement(Box, {
5315
- style: isMobile ? mobileStyle : style$2
5326
+ style: isMobile ? mobileStyle : style$2,
5327
+ sx: {
5328
+ '@media screen and (orientation:landscape)': {
5329
+ maxHeight: '80vh',
5330
+ overflowY: 'auto'
5331
+ }
5332
+ }
5316
5333
  }, React.createElement("div", null, showSignUpButton && !useCustomSignup && React.createElement(Tabs, {
5317
5334
  value: activeTab,
5318
5335
  onChange: handleTabChange,
@@ -6805,7 +6822,7 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref6) {
6805
6822
  enableTimer = _ref6$enableTimer === void 0 ? false : _ref6$enableTimer,
6806
6823
  logo = _ref6.logo,
6807
6824
  _ref6$showForgotPassw = _ref6.showForgotPasswordButton,
6808
- showForgotPasswordButton = _ref6$showForgotPassw === void 0 ? false : _ref6$showForgotPassw,
6825
+ showForgotPasswordButton = _ref6$showForgotPassw === void 0 ? true : _ref6$showForgotPassw,
6809
6826
  _ref6$showSignUpButto = _ref6.showSignUpButton,
6810
6827
  showSignUpButton = _ref6$showSignUpButto === void 0 ? false : _ref6$showSignUpButto,
6811
6828
  _ref6$brandOptIn = _ref6.brandOptIn,
@@ -8339,12 +8356,12 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
8339
8356
  var eventId = (data == null ? void 0 : data.product_id) || '';
8340
8357
  useEffect(function () {
8341
8358
  _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
8342
- var _data$product_price, confirmationDataResponse, _data;
8359
+ var _data$product_price, confirmationDataResponse, _data, isLoggedIn;
8343
8360
  return _regeneratorRuntime().wrap(function _callee$(_context) {
8344
8361
  while (1) switch (_context.prev = _context.next) {
8345
8362
  case 0:
8346
8363
  if (!hash) {
8347
- _context.next = 16;
8364
+ _context.next = 17;
8348
8365
  break;
8349
8366
  }
8350
8367
  _context.prev = 1;
@@ -8377,17 +8394,24 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
8377
8394
  }
8378
8395
  setData(_data);
8379
8396
  onGetConfirmationDataSuccess(confirmationDataResponse.data.attributes);
8380
- _context.next = 16;
8397
+ // Clear user_data for non-logged-in users after successful purchase
8398
+ if (isBrowser) {
8399
+ isLoggedIn = Boolean(getCookieByName('X-TF-ECOMMERCE'));
8400
+ if (!isLoggedIn) {
8401
+ window.localStorage.removeItem('user_data');
8402
+ }
8403
+ }
8404
+ _context.next = 17;
8381
8405
  break;
8382
- case 13:
8383
- _context.prev = 13;
8406
+ case 14:
8407
+ _context.prev = 14;
8384
8408
  _context.t0 = _context["catch"](1);
8385
8409
  if (axios.isAxiosError(_context.t0)) onGetConfirmationDataError(_context.t0);
8386
- case 16:
8410
+ case 17:
8387
8411
  case "end":
8388
8412
  return _context.stop();
8389
8413
  }
8390
- }, _callee, null, [[1, 13]]);
8414
+ }, _callee, null, [[1, 14]]);
8391
8415
  }))();
8392
8416
  }, [hash]);
8393
8417
  var _useState2 = useState(false),
@@ -9466,7 +9490,8 @@ var PreRegistrationComplete = function PreRegistrationComplete(_ref) {
9466
9490
  onLogin: function onLogin(res) {
9467
9491
  setShowModalLogin(false);
9468
9492
  onLoginSuccess(res);
9469
- }
9493
+ },
9494
+ showForgotPasswordButton: true
9470
9495
  }), !_isEmpty(error) && React.createElement(ConfirmModal, {
9471
9496
  hideCancelBtn: true,
9472
9497
  message: error.message,
@@ -10527,7 +10552,7 @@ var TimeSlotTicketRow = function TimeSlotTicketRow(_ref) {
10527
10552
  return React.createElement(MenuItem, {
10528
10553
  key: index,
10529
10554
  value: slot.timeKey
10530
- }, moment(slot.timeKey).format('hh:mm A'));
10555
+ }, moment(slot.ticketInstance.slotStartDate).format('hh:mm A'));
10531
10556
  }))), React.createElement(FormControl$1, null, React.createElement(Select, {
10532
10557
  sx: {
10533
10558
  borderRadius: 0,
@@ -11605,7 +11630,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
11605
11630
  onClick: handleLogout
11606
11631
  }, "Log out"))) : ''), showLoginModal ? React.createElement(LoginModal, {
11607
11632
  onClose: handleOnClose,
11608
- onLogin: handleOnLogin
11633
+ onLogin: handleOnLogin,
11634
+ showForgotPasswordButton: true
11609
11635
  }) : null), showPoweredByImage ? React.createElement(PoweredBy, null) : null, enableInfluencersSection && !hideTopInfluencers && influencers.length ? React.createElement("div", {
11610
11636
  className: "event-influencers"
11611
11637
  }, React.createElement("h3", null, React.createElement("span", null, "TOP"), " INFLUENCERS"), React.createElement("ol", {
@@ -11873,7 +11899,8 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
11873
11899
  setIsLogged(true);
11874
11900
  },
11875
11901
  userExpired: userExpired,
11876
- logo: logo
11902
+ logo: logo,
11903
+ showForgotPasswordButton: true
11877
11904
  }) : null), data != null && (_data$orders = data.orders) != null && _data$orders.length ? React.createElement(React.Fragment, null, React.createElement("h2", null, "My Ticket Orders"), React.createElement(Autocomplete, {
11878
11905
  disablePortal: true,
11879
11906
  id: "combo-box-demo",
@@ -11926,7 +11953,8 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
11926
11953
  setUserExpired(false);
11927
11954
  setIsLogged(true);
11928
11955
  },
11929
- userExpired: userExpired
11956
+ userExpired: userExpired,
11957
+ showForgotPasswordButton: true
11930
11958
  })));
11931
11959
  };
11932
11960
 
@@ -12486,7 +12514,9 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
12486
12514
  ticketsTitle = _ref$ticketsTitle === void 0 ? 'Your Tickets' : _ref$ticketsTitle,
12487
12515
  themeOptions = _ref.themeOptions,
12488
12516
  _ref$displayLoading = _ref.displayLoading,
12489
- displayLoading = _ref$displayLoading === void 0 ? false : _ref$displayLoading;
12517
+ displayLoading = _ref$displayLoading === void 0 ? true : _ref$displayLoading,
12518
+ _ref$onDataLoaded = _ref.onDataLoaded,
12519
+ onDataLoaded = _ref$onDataLoaded === void 0 ? _identity : _ref$onDataLoaded;
12490
12520
  var _useState = useState({}),
12491
12521
  data = _useState[0],
12492
12522
  setData = _useState[1];
@@ -12576,20 +12606,21 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
12576
12606
  _data = _get(response, 'data.attributes');
12577
12607
  setData(_data);
12578
12608
  setIsLoading(false);
12579
- _context.next = 17;
12609
+ onDataLoaded(_data);
12610
+ _context.next = 18;
12580
12611
  break;
12581
- case 13:
12582
- _context.prev = 13;
12612
+ case 14:
12613
+ _context.prev = 14;
12583
12614
  _context.t0 = _context["catch"](0);
12584
12615
  onGetOrdersError(_context.t0);
12585
12616
  setIsLoading(false);
12586
- case 17:
12617
+ case 18:
12587
12618
  case "end":
12588
12619
  return _context.stop();
12589
12620
  }
12590
- }, _callee, null, [[0, 13]]);
12621
+ }, _callee, null, [[0, 14]]);
12591
12622
  }))();
12592
- }, [onGetOrdersError, onGetOrdersSuccess, pOrderId]);
12623
+ }, [onGetOrdersError, onGetOrdersSuccess, onDataLoaded, pOrderId]);
12593
12624
  var handleSellTicket = function handleSellTicket(ticket) {
12594
12625
  var ticketTypesArr = data.items.ticket_types;
12595
12626
  var sellTicketType = _find(ticketTypesArr, function (ticketType) {
@@ -12806,17 +12837,22 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
12806
12837
  };
12807
12838
  }();
12808
12839
  var theme = createTheme(themeOptions != null ? themeOptions : {});
12809
- if (isLoading && displayLoading) {
12810
- return React.createElement(Backdrop$1, {
12811
- sx: {
12812
- color: '#fff',
12813
- backgroundColor: '#000000bd',
12814
- zIndex: 1205
12815
- },
12816
- open: true
12817
- }, React.createElement(CircularProgress, {
12818
- color: "inherit"
12819
- }));
12840
+ if (isLoading || _isEmpty(data)) {
12841
+ if (displayLoading) {
12842
+ return React.createElement(ThemeProvider, {
12843
+ theme: theme
12844
+ }, React.createElement(Backdrop$1, {
12845
+ sx: {
12846
+ color: '#fff',
12847
+ backgroundColor: '#000000bd',
12848
+ zIndex: 1205
12849
+ },
12850
+ open: true
12851
+ }, React.createElement(CircularProgress, {
12852
+ color: "inherit"
12853
+ })));
12854
+ }
12855
+ return null;
12820
12856
  }
12821
12857
  return React.createElement(ThemeProvider, {
12822
12858
  theme: theme