tf-checkout-react 1.2.10 → 1.2.13

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.
@@ -21,8 +21,10 @@ import { useTheme } from '@mui/styles';
21
21
  import FormGroup from '@mui/material/FormGroup';
22
22
  import FormControlLabel from '@mui/material/FormControlLabel';
23
23
  import Checkbox from '@mui/material/Checkbox';
24
- import MuiPhoneNumber from 'material-ui-phone-number';
24
+ import 'material-ui-phone-number';
25
+ import 'react-phone-input-2/lib/material.css';
25
26
  import _debounce from 'lodash-es/debounce';
27
+ import PhoneInput from 'react-phone-input-2';
26
28
  import CircularProgress from '@mui/material/CircularProgress';
27
29
  import Select from '@mui/material/Select';
28
30
  import { object, string, ref, boolean } from 'yup';
@@ -1679,6 +1681,7 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
1679
1681
  values = _ref$form.values,
1680
1682
  initialValues = _ref$form.initialValues,
1681
1683
  setFieldValue = _ref$form.setFieldValue,
1684
+ setFieldTouched = _ref$form.setFieldTouched,
1682
1685
  _ref$disableDropdown = _ref.disableDropdown,
1683
1686
  disableDropdown = _ref$disableDropdown === void 0 ? true : _ref$disableDropdown,
1684
1687
  _ref$fill = _ref.fill,
@@ -1692,6 +1695,12 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
1692
1695
  return void cb();
1693
1696
  }, 1000), []);
1694
1697
  useEffect(function () {
1698
+ if (field.value === '+') {
1699
+ setFieldError(field.name, '');
1700
+ setFieldTouched(field.name, false);
1701
+ return;
1702
+ }
1703
+
1695
1704
  if (field.value) {
1696
1705
  var _setStatus;
1697
1706
 
@@ -1739,22 +1748,40 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
1739
1748
  }, _callee, null, [[0, 7, 11, 14]]);
1740
1749
  }))); // eslint-disable-next-line
1741
1750
  }, [field.value]);
1742
- return React.createElement(MuiPhoneNumber, {
1743
- name: field.name,
1751
+ return React.createElement(React.Fragment, null, React.createElement(PhoneInput, {
1752
+ key: field.name,
1744
1753
  value: fill ? values.phone : initialValues.phone,
1745
- onChange: function onChange(e) {
1746
- return setFieldValue(field.name, e);
1754
+ onChange: function onChange(value, data) {
1755
+ if (data.dialCode !== value) {
1756
+ setFieldTouched(field.name, true);
1757
+ setFieldValue(field.name, value);
1758
+ } else {
1759
+ setFieldValue(field.name, '');
1760
+ setFieldError(field.name, '');
1761
+ }
1747
1762
  },
1748
- variant: "outlined",
1749
- defaultCountry: "us",
1763
+ country: "us",
1750
1764
  disableDropdown: disableDropdown,
1751
- label: label,
1752
- error: !!error && isTouched,
1753
- helperText: isTouched && error,
1754
- fullWidth: true,
1765
+ specialLabel: label,
1755
1766
  autoFormat: false,
1756
- disableAreaCodes: true
1757
- });
1767
+ inputStyle: {
1768
+ width: '100%'
1769
+ }
1770
+ }), !!error && isTouched && React.createElement("p", {
1771
+ style: {
1772
+ fontFamily: '"Roboto","Helvetica","Arial",sans-serif',
1773
+ fontWeight: '400',
1774
+ fontSize: '0.75rem',
1775
+ lineHeight: '1.66',
1776
+ letterSpacing: '0.03333em',
1777
+ textAlign: 'left',
1778
+ marginTop: '3px',
1779
+ marginRight: '14px',
1780
+ marginBottom: '0',
1781
+ marginLeft: '14px',
1782
+ color: '#d32f2f'
1783
+ }
1784
+ }, error));
1758
1785
  };
1759
1786
 
1760
1787
  function Loader() {
@@ -2653,7 +2680,8 @@ var LogicRunner = function LogicRunner(_ref) {
2653
2680
  setUserValues = _ref.setUserValues,
2654
2681
  onGetStatesSuccess = _ref.onGetStatesSuccess,
2655
2682
  onGetStatesError = _ref.onGetStatesError,
2656
- shouldFetchCountries = _ref.shouldFetchCountries;
2683
+ shouldFetchCountries = _ref.shouldFetchCountries,
2684
+ brandOptIn = _ref.brandOptIn;
2657
2685
  var prevCountry = useRef(values.country);
2658
2686
  useEffect(function () {
2659
2687
  var fetchStates = /*#__PURE__*/function () {
@@ -2728,7 +2756,7 @@ var LogicRunner = function LogicRunner(_ref) {
2728
2756
  street_address: (parsedData == null ? void 0 : parsedData.street_address) || '',
2729
2757
  country: (parsedData == null ? void 0 : parsedData.country) || '1',
2730
2758
  zip: (parsedData == null ? void 0 : parsedData.zip) || '',
2731
- brand_opt_in: (parsedData == null ? void 0 : parsedData.brand_opt_in) || false,
2759
+ brand_opt_in: brandOptIn ? brandOptIn : (parsedData == null ? void 0 : parsedData.brand_opt_in) || false,
2732
2760
  city: (parsedData == null ? void 0 : parsedData.city) || '',
2733
2761
  confirmPassword: '',
2734
2762
  password: '',
@@ -2823,7 +2851,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2823
2851
  _ref3$showForgotPassw = _ref3.showForgotPasswordButton,
2824
2852
  showForgotPasswordButton = _ref3$showForgotPassw === void 0 ? false : _ref3$showForgotPassw,
2825
2853
  _ref3$showSignUpButto = _ref3.showSignUpButton,
2826
- showSignUpButton = _ref3$showSignUpButto === void 0 ? false : _ref3$showSignUpButto;
2854
+ showSignUpButton = _ref3$showSignUpButto === void 0 ? false : _ref3$showSignUpButto,
2855
+ _ref3$brandOptIn = _ref3.brandOptIn,
2856
+ brandOptIn = _ref3$brandOptIn === void 0 ? false : _ref3$brandOptIn;
2827
2857
 
2828
2858
  var themeMui = createTheme(themeOptions);
2829
2859
  var isWindowDefined = typeof window !== 'undefined';
@@ -2911,9 +2941,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2911
2941
  var showDOB = getQueryVariable('age_required') === 'true';
2912
2942
  var showTicketHolders = getQueryVariable('names_required') === 'true';
2913
2943
  var eventId = getQueryVariable('event_id');
2914
-
2915
- var optedInFieldValue = _get(cartInfoData, 'optedIn', false);
2916
-
2944
+ var optedInFieldValue = brandOptIn ? brandOptIn : _get(cartInfoData, 'optedIn', false);
2917
2945
  var ttfOptIn = Boolean(_get(cartInfoData, 'ttfOptIn', false));
2918
2946
 
2919
2947
  var hideTtfOptIn = _get(cartInfoData, 'hide_ttf_opt_in', true);
@@ -3389,6 +3417,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
3389
3417
  return React.createElement(Form, {
3390
3418
  onSubmit: props.handleSubmit
3391
3419
  }, React.createElement(ErrorFocus, null), React.createElement(LogicRunner, {
3420
+ brandOptIn: brandOptIn,
3392
3421
  values: props.values,
3393
3422
  setStates: setStates,
3394
3423
  setFieldValue: props.setFieldValue,
@@ -3498,7 +3527,6 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
3498
3527
  name: element.name + "-" + index,
3499
3528
  label: element.label,
3500
3529
  type: element.type,
3501
- required: true,
3502
3530
  component: element.type === 'checkbox' ? CheckboxField : element.type === 'phone' ? PhoneNumberField : CustomField,
3503
3531
  validate: combineValidators(element.required ? requiredValidator : function () {
3504
3532
  return props.errors[element.name + "-" + index];
@@ -4128,7 +4156,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
4128
4156
  case 3:
4129
4157
  order_hash = reviewData.order_details.order_hash;
4130
4158
 
4131
- if (!(total === '0.00')) {
4159
+ if (!isFreeTickets) {
4132
4160
  _context3.next = 10;
4133
4161
  break;
4134
4162
  }
@@ -6469,8 +6497,9 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
6469
6497
 
6470
6498
  var orderSummery = "ID " + data.id + ", placed";
6471
6499
 
6472
- if (data.date) {
6473
- orderSummery += " " + data.date;
6500
+ if (data.date && data.timezone) {
6501
+ var date = moment.tz(data.date, data.timezone).format("dddd, DD MMMM YYYY");
6502
+ orderSummery += " " + date;
6474
6503
  }
6475
6504
 
6476
6505
  return React.createElement("div", {