tf-checkout-react 1.3.22 → 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.
- package/dist/components/common/CustomField.d.ts +3 -0
- package/dist/tf-checkout-react.cjs.development.js +36 -20
- package/dist/tf-checkout-react.cjs.development.js.map +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
- package/dist/tf-checkout-react.esm.js +37 -21
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/common/CustomField.tsx +25 -4
- package/src/components/orderDetailsContainer/ticketsTable.tsx +1 -1
|
@@ -12,6 +12,9 @@ export interface ICustomField {
|
|
|
12
12
|
theme: 'dark' | 'light';
|
|
13
13
|
type?: string;
|
|
14
14
|
selectOptions?: ISelectOption[];
|
|
15
|
+
inputRef?: {
|
|
16
|
+
current: HTMLInputElement | null;
|
|
17
|
+
} | ((node: HTMLInputElement | null) => void);
|
|
15
18
|
}
|
|
16
19
|
interface IOtherProps {
|
|
17
20
|
[key: string]: any;
|
|
@@ -25,6 +25,8 @@ var AdapterMoment = require('@mui/x-date-pickers/AdapterMoment');
|
|
|
25
25
|
var LocalizationProvider = require('@mui/x-date-pickers/LocalizationProvider');
|
|
26
26
|
var TextField = _interopDefault(require('@mui/material/TextField'));
|
|
27
27
|
var styles$1 = require('@mui/styles');
|
|
28
|
+
var _isFunction = _interopDefault(require('lodash/isFunction'));
|
|
29
|
+
var _isObject = _interopDefault(require('lodash/isObject'));
|
|
28
30
|
var FormGroup = _interopDefault(require('@mui/material/FormGroup'));
|
|
29
31
|
var FormControlLabel = _interopDefault(require('@mui/material/FormControlLabel'));
|
|
30
32
|
var Checkbox = _interopDefault(require('@mui/material/Checkbox'));
|
|
@@ -1612,28 +1614,33 @@ var emailValidator = function emailValidator(email) {
|
|
|
1612
1614
|
return !emailRegex.test(email) ? 'Please enter a valid email address' : '';
|
|
1613
1615
|
};
|
|
1614
1616
|
|
|
1615
|
-
var CustomField = function CustomField(
|
|
1616
|
-
var
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1617
|
+
var CustomField = function CustomField(_ref2) {
|
|
1618
|
+
var _ref$current;
|
|
1619
|
+
|
|
1620
|
+
var label = _ref2.label,
|
|
1621
|
+
_ref2$type = _ref2.type,
|
|
1622
|
+
type = _ref2$type === void 0 ? 'text' : _ref2$type,
|
|
1623
|
+
field = _ref2.field,
|
|
1624
|
+
_ref2$selectOptions = _ref2.selectOptions,
|
|
1625
|
+
selectOptions = _ref2$selectOptions === void 0 ? [] : _ref2$selectOptions,
|
|
1626
|
+
_ref2$form = _ref2.form,
|
|
1627
|
+
touched = _ref2$form.touched,
|
|
1628
|
+
errors = _ref2$form.errors,
|
|
1629
|
+
submitCount = _ref2$form.submitCount,
|
|
1630
|
+
theme = _ref2.theme,
|
|
1631
|
+
_ref2$inputProps = _ref2.inputProps,
|
|
1632
|
+
pInputProps = _ref2$inputProps === void 0 ? {} : _ref2$inputProps,
|
|
1633
|
+
_ref2$InputProps = _ref2.InputProps,
|
|
1634
|
+
InputProps = _ref2$InputProps === void 0 ? {} : _ref2$InputProps,
|
|
1635
|
+
inputRef = _ref2.inputRef;
|
|
1632
1636
|
|
|
1633
1637
|
var _useState = React.useState(Boolean(field.value)),
|
|
1634
1638
|
isShrinked = _useState[0],
|
|
1635
1639
|
setIsShrinked = _useState[1];
|
|
1636
1640
|
|
|
1641
|
+
var _ref = React.useRef(null);
|
|
1642
|
+
|
|
1643
|
+
var isAutoFilled = (_ref$current = _ref.current) == null ? void 0 : _ref$current.matches(':-webkit-autofill');
|
|
1637
1644
|
var isSelectField = type === 'select';
|
|
1638
1645
|
|
|
1639
1646
|
var error = _get(errors, field.name);
|
|
@@ -1643,6 +1650,13 @@ var CustomField = function CustomField(_ref) {
|
|
|
1643
1650
|
var inputProps = {
|
|
1644
1651
|
sx: customTheme == null ? void 0 : customTheme.input
|
|
1645
1652
|
};
|
|
1653
|
+
React.useEffect(function () {
|
|
1654
|
+
if (_isFunction(inputRef)) {
|
|
1655
|
+
inputRef(_ref.current);
|
|
1656
|
+
} else if (_isObject(inputRef)) {
|
|
1657
|
+
inputRef.current = _ref.current;
|
|
1658
|
+
}
|
|
1659
|
+
});
|
|
1646
1660
|
return React__default.createElement(TextField, Object.assign({
|
|
1647
1661
|
placeholder: "",
|
|
1648
1662
|
id: field.name,
|
|
@@ -1664,11 +1678,11 @@ var CustomField = function CustomField(_ref) {
|
|
|
1664
1678
|
},
|
|
1665
1679
|
InputLabelProps: {
|
|
1666
1680
|
sx: customTheme == null ? void 0 : customTheme.input,
|
|
1667
|
-
shrink: isShrinked || Boolean(field.value)
|
|
1681
|
+
shrink: isShrinked || Boolean(field.value) || isAutoFilled
|
|
1668
1682
|
},
|
|
1669
1683
|
InputProps: InputProps,
|
|
1670
1684
|
inputProps: _extends({}, inputProps, pInputProps),
|
|
1671
|
-
inputRef:
|
|
1685
|
+
inputRef: _ref
|
|
1672
1686
|
}, field, {
|
|
1673
1687
|
onBlur: function onBlur(e) {
|
|
1674
1688
|
setIsShrinked(Boolean(field.value));
|
|
@@ -6569,7 +6583,9 @@ var TicketsTable = function TicketsTable(_ref) {
|
|
|
6569
6583
|
return _map(columns, function (column, columnIndex) {
|
|
6570
6584
|
if (column.key === 'download') {
|
|
6571
6585
|
var ticketIsDownloading = pdfDownload.loading && pdfDownload.hash === ticket.hash;
|
|
6572
|
-
if (!ticket.pdf_link || ticket.status === 'Sold' || ticket.is_on_sale) return
|
|
6586
|
+
if (!ticket.pdf_link || ticket.status === 'Sold' || ticket.is_on_sale) return React__default.createElement(TableCell, {
|
|
6587
|
+
key: columnIndex
|
|
6588
|
+
}, null);
|
|
6573
6589
|
return React__default.createElement(TableCell, {
|
|
6574
6590
|
key: columnIndex
|
|
6575
6591
|
}, Boolean(icon) && React__default.createElement("img", {
|