tf-checkout-react 1.0.78 → 1.0.79

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.
@@ -7,7 +7,7 @@ import _get from 'lodash-es/get';
7
7
  import _includes from 'lodash-es/includes';
8
8
  import axios from 'axios';
9
9
  import _forEach from 'lodash-es/forEach';
10
- import { TextField, FormControl, InputLabel, FormHelperText, CircularProgress } from '@mui/material';
10
+ import { TextField, FormControl, FormHelperText, InputLabel, CircularProgress, createTheme as createTheme$1 } from '@mui/material';
11
11
  import Modal from '@mui/material/Modal';
12
12
  import Box from '@mui/material/Box';
13
13
  import _flatMapDeep from 'lodash-es/flatMapDeep';
@@ -38,6 +38,7 @@ import FormControl$1 from '@mui/material/FormControl';
38
38
  import MenuItem from '@mui/material/MenuItem';
39
39
  import SVG from 'react-inlinesvg';
40
40
  import moment from 'moment-timezone';
41
+ import { ThemeProvider as ThemeProvider$1 } from '@mui/private-theming';
41
42
  import Table from '@mui/material/Table';
42
43
  import TableBody from '@mui/material/TableBody';
43
44
  import TableCell from '@mui/material/TableCell';
@@ -1899,18 +1900,22 @@ var CustomField = function CustomField(_ref) {
1899
1900
 
1900
1901
  var _excluded$1 = ["label", "field", "selectOptions", "theme", "setFieldValue"];
1901
1902
  var CheckboxField = function CheckboxField(_ref) {
1903
+ var _rest$form, _field$name, _rest$form2, _field$name2;
1904
+
1902
1905
  var label = _ref.label,
1903
1906
  field = _ref.field,
1904
1907
  rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
1905
1908
 
1906
1909
  var customTheme = useTheme();
1907
- return React.createElement(FormGroup, null, React.createElement(FormControlLabel, {
1910
+ return React.createElement(FormControl, {
1911
+ error: !!(rest != null && (_rest$form = rest.form) != null && _rest$form.errors && rest.form.errors[(_field$name = field == null ? void 0 : field.name) != null ? _field$name : ""])
1912
+ }, React.createElement(FormGroup, null, React.createElement(FormControlLabel, {
1908
1913
  control: React.createElement(Checkbox, Object.assign({}, field, rest)),
1909
1914
  label: label,
1910
1915
  componentsProps: {
1911
1916
  typography: customTheme == null ? void 0 : customTheme.checkbox
1912
1917
  }
1913
- }));
1918
+ })), !!(rest != null && (_rest$form2 = rest.form) != null && _rest$form2.errors && rest.form.errors[(_field$name2 = field == null ? void 0 : field.name) != null ? _field$name2 : ""]) ? React.createElement(FormHelperText, null, "Required") : null);
1914
1919
  };
1915
1920
 
1916
1921
  var SelectField = function SelectField(_ref) {
@@ -3012,7 +3017,7 @@ var CheckoutForm = function CheckoutForm(_ref) {
3012
3017
  }, React.createElement("span", {
3013
3018
  className: "card_label_text"
3014
3019
  }, "Card number"), React.createElement(CardNumberElement, {
3015
- options: _extends({}, options.style, stripeCardOptions),
3020
+ options: _extends({}, options, stripeCardOptions),
3016
3021
  onReady: _identity,
3017
3022
  onChange: _identity,
3018
3023
  onBlur: _identity,
@@ -3022,13 +3027,13 @@ var CheckoutForm = function CheckoutForm(_ref) {
3022
3027
  }, React.createElement("span", {
3023
3028
  className: "card_label_text"
3024
3029
  }, "Expiration date"), React.createElement(CardExpiryElement, {
3025
- options: _extends({}, options.style, stripeCardOptions)
3030
+ options: _extends({}, options, stripeCardOptions)
3026
3031
  })), React.createElement("label", {
3027
3032
  className: "cvc_element"
3028
3033
  }, React.createElement("span", {
3029
3034
  className: "card_label_text"
3030
3035
  }, "CVC"), React.createElement(CardCvcElement, {
3031
- options: _extends({}, options.style, stripeCardOptions)
3036
+ options: _extends({}, options, stripeCardOptions)
3032
3037
  })), !disableZipSection && React.createElement("label", {
3033
3038
  className: "zip_element"
3034
3039
  }, React.createElement("p", {
@@ -3120,7 +3125,8 @@ var PaymentContainer = function PaymentContainer(_ref) {
3120
3125
  stripeCardOptions = _ref$stripeCardOption === void 0 ? {} : _ref$stripeCardOption,
3121
3126
  _ref$disableZipSectio = _ref.disableZipSection,
3122
3127
  disableZipSection = _ref$disableZipSectio === void 0 ? false : _ref$disableZipSectio,
3123
- themeOptions = _ref.themeOptions;
3128
+ themeOptions = _ref.themeOptions,
3129
+ elementsOptions = _ref.elementsOptions;
3124
3130
 
3125
3131
  var _useState = useState(initialReviewValues),
3126
3132
  reviewData = _useState[0],
@@ -3341,7 +3347,8 @@ var PaymentContainer = function PaymentContainer(_ref) {
3341
3347
  }, "Please provide your payment information"), showErrorText && React.createElement("p", {
3342
3348
  className: "payment_info__error"
3343
3349
  }, errorText), React.createElement("div", null, React.createElement(Elements, {
3344
- stripe: getStripePromise(reviewData)
3350
+ stripe: getStripePromise(reviewData),
3351
+ options: elementsOptions
3345
3352
  }, React.createElement(CheckoutForm, {
3346
3353
  stripe_client_secret: _get(reviewData, 'payment_method.stripe_client_secret'),
3347
3354
  total: orderData.total,
@@ -4165,7 +4172,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
4165
4172
  _ref$queryPromoCode = _ref.queryPromoCode,
4166
4173
  queryPromoCode = _ref$queryPromoCode === void 0 ? '' : _ref$queryPromoCode,
4167
4174
  _ref$isPromotionsEnab = _ref.isPromotionsEnabled,
4168
- isPromotionsEnabled = _ref$isPromotionsEnab === void 0 ? true : _ref$isPromotionsEnab;
4175
+ isPromotionsEnabled = _ref$isPromotionsEnab === void 0 ? true : _ref$isPromotionsEnab,
4176
+ themeOptions = _ref.themeOptions;
4169
4177
 
4170
4178
  var _useState = useState({}),
4171
4179
  selectedTickets = _useState[0],
@@ -4458,6 +4466,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
4458
4466
  var isAllTicketsSoldOut = !_some(tickets, function (item) {
4459
4467
  return !(item.sold_out || item.soldOut);
4460
4468
  });
4469
+ var themeMui = createTheme$1(themeOptions);
4461
4470
  useEffect(function () {
4462
4471
  isWindowDefined && window.document.addEventListener('custom-logout', handleLogout);
4463
4472
  return function () {
@@ -4470,7 +4479,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
4470
4479
  isWindowDefined && window.document.removeEventListener('custom-login', handleExternalLogin);
4471
4480
  };
4472
4481
  }, []);
4473
- return React.createElement("div", {
4482
+ return React.createElement(ThemeProvider$1, {
4483
+ theme: themeMui
4484
+ }, React.createElement("div", {
4474
4485
  className: "get-tickets-page " + theme,
4475
4486
  style: contentStyle
4476
4487
  }, isLoading ? React.createElement(Loader$1, null) : React.createElement("div", null, React.createElement(TicketsSection, {
@@ -4484,7 +4495,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
4484
4495
  title: "Sales start in:",
4485
4496
  message: "No tickets are currently available for this event.",
4486
4497
  callback: updateTickets
4487
- }) : null, showWaitingList && React.createElement(WaitingList, {
4498
+ }) : null, showWaitingList && event.salesStarted && React.createElement(WaitingList, {
4488
4499
  tickets: tickets,
4489
4500
  eventId: eventId
4490
4501
  }), React.createElement(PromoCodeSection, {
@@ -4517,7 +4528,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
4517
4528
  }, "Log out"))) : ''), showLoginModal ? React.createElement(LoginModal, {
4518
4529
  onClose: handleOnClose,
4519
4530
  onLogin: handleOnLogin
4520
- }) : null);
4531
+ }) : null));
4521
4532
  };
4522
4533
 
4523
4534
  var EventInfoItem = function EventInfoItem(_ref) {