tf-checkout-react 1.3.23 → 1.3.24

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.
@@ -11,13 +11,15 @@ import _isEmpty from 'lodash-es/isEmpty';
11
11
  import _isEqual from 'lodash-es/isEqual';
12
12
  import _map from 'lodash-es/map';
13
13
  import { nanoid } from 'nanoid';
14
- import React, { Component, useState, useCallback, useEffect, memo, useRef, Fragment } from 'react';
14
+ import React, { Component, useState, useRef, useEffect, useCallback, memo, Fragment } from 'react';
15
15
  import _forEach from 'lodash-es/forEach';
16
16
  import { DatePicker } from '@mui/x-date-pickers';
17
17
  import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
18
18
  import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
19
19
  import TextField from '@mui/material/TextField';
20
20
  import { useTheme } from '@mui/styles';
21
+ import _isFunction from 'lodash-es/isFunction';
22
+ import _isObject from 'lodash-es/isObject';
21
23
  import FormGroup from '@mui/material/FormGroup';
22
24
  import FormControlLabel from '@mui/material/FormControlLabel';
23
25
  import Checkbox from '@mui/material/Checkbox';
@@ -1605,28 +1607,33 @@ var emailValidator = function emailValidator(email) {
1605
1607
  return !emailRegex.test(email) ? 'Please enter a valid email address' : '';
1606
1608
  };
1607
1609
 
1608
- var CustomField = function CustomField(_ref) {
1609
- var label = _ref.label,
1610
- _ref$type = _ref.type,
1611
- type = _ref$type === void 0 ? 'text' : _ref$type,
1612
- field = _ref.field,
1613
- _ref$selectOptions = _ref.selectOptions,
1614
- selectOptions = _ref$selectOptions === void 0 ? [] : _ref$selectOptions,
1615
- _ref$form = _ref.form,
1616
- touched = _ref$form.touched,
1617
- errors = _ref$form.errors,
1618
- submitCount = _ref$form.submitCount,
1619
- theme = _ref.theme,
1620
- _ref$inputProps = _ref.inputProps,
1621
- pInputProps = _ref$inputProps === void 0 ? {} : _ref$inputProps,
1622
- _ref$InputProps = _ref.InputProps,
1623
- InputProps = _ref$InputProps === void 0 ? {} : _ref$InputProps,
1624
- inputRef = _ref.inputRef;
1610
+ var CustomField = function CustomField(_ref2) {
1611
+ var _ref$current;
1612
+
1613
+ var label = _ref2.label,
1614
+ _ref2$type = _ref2.type,
1615
+ type = _ref2$type === void 0 ? 'text' : _ref2$type,
1616
+ field = _ref2.field,
1617
+ _ref2$selectOptions = _ref2.selectOptions,
1618
+ selectOptions = _ref2$selectOptions === void 0 ? [] : _ref2$selectOptions,
1619
+ _ref2$form = _ref2.form,
1620
+ touched = _ref2$form.touched,
1621
+ errors = _ref2$form.errors,
1622
+ submitCount = _ref2$form.submitCount,
1623
+ theme = _ref2.theme,
1624
+ _ref2$inputProps = _ref2.inputProps,
1625
+ pInputProps = _ref2$inputProps === void 0 ? {} : _ref2$inputProps,
1626
+ _ref2$InputProps = _ref2.InputProps,
1627
+ InputProps = _ref2$InputProps === void 0 ? {} : _ref2$InputProps,
1628
+ inputRef = _ref2.inputRef;
1625
1629
 
1626
1630
  var _useState = useState(Boolean(field.value)),
1627
1631
  isShrinked = _useState[0],
1628
1632
  setIsShrinked = _useState[1];
1629
1633
 
1634
+ var _ref = useRef(null);
1635
+
1636
+ var isAutoFilled = (_ref$current = _ref.current) == null ? void 0 : _ref$current.matches(':-webkit-autofill');
1630
1637
  var isSelectField = type === 'select';
1631
1638
 
1632
1639
  var error = _get(errors, field.name);
@@ -1636,6 +1643,13 @@ var CustomField = function CustomField(_ref) {
1636
1643
  var inputProps = {
1637
1644
  sx: customTheme == null ? void 0 : customTheme.input
1638
1645
  };
1646
+ useEffect(function () {
1647
+ if (_isFunction(inputRef)) {
1648
+ inputRef(_ref.current);
1649
+ } else if (_isObject(inputRef)) {
1650
+ inputRef.current = _ref.current;
1651
+ }
1652
+ });
1639
1653
  return React.createElement(TextField, Object.assign({
1640
1654
  placeholder: "",
1641
1655
  id: field.name,
@@ -1657,11 +1671,11 @@ var CustomField = function CustomField(_ref) {
1657
1671
  },
1658
1672
  InputLabelProps: {
1659
1673
  sx: customTheme == null ? void 0 : customTheme.input,
1660
- shrink: isShrinked || Boolean(field.value)
1674
+ shrink: isShrinked || Boolean(field.value) || isAutoFilled
1661
1675
  },
1662
1676
  InputProps: InputProps,
1663
1677
  inputProps: _extends({}, inputProps, pInputProps),
1664
- inputRef: inputRef
1678
+ inputRef: _ref
1665
1679
  }, field, {
1666
1680
  onBlur: function onBlur(e) {
1667
1681
  setIsShrinked(Boolean(field.value));
@@ -5441,7 +5455,7 @@ var TicketsSection = function TicketsSection(_ref) {
5441
5455
  }
5442
5456
 
5443
5457
  var ticketIsFree = +ticket.price === 0;
5444
- var ticketPrice = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : "\xA3 " + (+ticket.price).toFixed(2);
5458
+ var ticketPrice = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : "$ " + (+ticket.price).toFixed(2);
5445
5459
  return React.createElement("div", {
5446
5460
  key: ticket.id || ticket.name,
5447
5461
  className: "event-detail__tier " + (isSoldOut ? 'disabled' : '')
@@ -5453,7 +5467,7 @@ var TicketsSection = function TicketsSection(_ref) {
5453
5467
  className: "event-detail__tier-price"
5454
5468
  }, ticketIsDiscounted && React.createElement("p", {
5455
5469
  className: "old-price"
5456
- }, "\xA3 ", (+ticket.oldPrice).toFixed(2)), React.createElement("p", {
5470
+ }, "$ ", (+ticket.oldPrice).toFixed(2)), React.createElement("p", {
5457
5471
  className: isSoldOut ? 'sold-out' : ''
5458
5472
  }, ticketPrice), !isSoldOut && !ticketIsFree && React.createElement("p", {
5459
5473
  className: "fees"