tf-checkout-react 1.3.25 → 1.3.27
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/billing-info-container/index.d.ts +2 -1
- package/dist/components/common/CustomField.d.ts +3 -0
- package/dist/components/common/PoweredBy.d.ts +2 -0
- package/dist/components/forgotPasswordModal/index.d.ts +3 -2
- package/dist/components/loginModal/index.d.ts +1 -0
- package/dist/components/registerModal/index.d.ts +3 -2
- package/dist/components/signupModal/index.d.ts +3 -2
- package/dist/index.d.ts +1 -0
- package/dist/tf-checkout-react.cjs.development.js +81 -32
- 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 +82 -34
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/billing-info-container/index.tsx +5 -0
- package/src/components/common/CustomField.tsx +25 -4
- package/src/components/common/DatePickerField.tsx +14 -18
- package/src/components/common/PoweredBy.tsx +15 -0
- package/src/components/forgotPasswordModal/index.tsx +11 -5
- package/src/components/loginModal/index.tsx +4 -0
- package/src/components/registerModal/index.tsx +11 -5
- package/src/components/signupModal/index.tsx +22 -16
- package/src/components/ticketsContainer/TicketsSection.tsx +35 -29
- package/src/index.ts +2 -1
|
@@ -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,
|
|
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';
|
|
@@ -1606,28 +1608,33 @@ var emailValidator = function emailValidator(email) {
|
|
|
1606
1608
|
return !emailRegex.test(email) ? 'Please enter a valid email address' : '';
|
|
1607
1609
|
};
|
|
1608
1610
|
|
|
1609
|
-
var CustomField = function CustomField(
|
|
1610
|
-
var
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1611
|
+
var CustomField = function CustomField(_ref2) {
|
|
1612
|
+
var _ref$current;
|
|
1613
|
+
|
|
1614
|
+
var label = _ref2.label,
|
|
1615
|
+
_ref2$type = _ref2.type,
|
|
1616
|
+
type = _ref2$type === void 0 ? 'text' : _ref2$type,
|
|
1617
|
+
field = _ref2.field,
|
|
1618
|
+
_ref2$selectOptions = _ref2.selectOptions,
|
|
1619
|
+
selectOptions = _ref2$selectOptions === void 0 ? [] : _ref2$selectOptions,
|
|
1620
|
+
_ref2$form = _ref2.form,
|
|
1621
|
+
touched = _ref2$form.touched,
|
|
1622
|
+
errors = _ref2$form.errors,
|
|
1623
|
+
submitCount = _ref2$form.submitCount,
|
|
1624
|
+
theme = _ref2.theme,
|
|
1625
|
+
_ref2$inputProps = _ref2.inputProps,
|
|
1626
|
+
pInputProps = _ref2$inputProps === void 0 ? {} : _ref2$inputProps,
|
|
1627
|
+
_ref2$InputProps = _ref2.InputProps,
|
|
1628
|
+
InputProps = _ref2$InputProps === void 0 ? {} : _ref2$InputProps,
|
|
1629
|
+
inputRef = _ref2.inputRef;
|
|
1626
1630
|
|
|
1627
1631
|
var _useState = useState(Boolean(field.value)),
|
|
1628
1632
|
isShrinked = _useState[0],
|
|
1629
1633
|
setIsShrinked = _useState[1];
|
|
1630
1634
|
|
|
1635
|
+
var _ref = useRef(null);
|
|
1636
|
+
|
|
1637
|
+
var isAutoFilled = (_ref$current = _ref.current) == null ? void 0 : _ref$current.matches(':-webkit-autofill');
|
|
1631
1638
|
var isSelectField = type === 'select';
|
|
1632
1639
|
|
|
1633
1640
|
var error = _get(errors, field.name);
|
|
@@ -1637,6 +1644,13 @@ var CustomField = function CustomField(_ref) {
|
|
|
1637
1644
|
var inputProps = {
|
|
1638
1645
|
sx: customTheme == null ? void 0 : customTheme.input
|
|
1639
1646
|
};
|
|
1647
|
+
useEffect(function () {
|
|
1648
|
+
if (_isFunction(inputRef)) {
|
|
1649
|
+
inputRef(_ref.current);
|
|
1650
|
+
} else if (_isObject(inputRef)) {
|
|
1651
|
+
inputRef.current = _ref.current;
|
|
1652
|
+
}
|
|
1653
|
+
});
|
|
1640
1654
|
return React.createElement(TextField, Object.assign({
|
|
1641
1655
|
placeholder: "",
|
|
1642
1656
|
id: field.name,
|
|
@@ -1658,11 +1672,11 @@ var CustomField = function CustomField(_ref) {
|
|
|
1658
1672
|
},
|
|
1659
1673
|
InputLabelProps: {
|
|
1660
1674
|
sx: customTheme == null ? void 0 : customTheme.input,
|
|
1661
|
-
shrink: isShrinked || Boolean(field.value)
|
|
1675
|
+
shrink: isShrinked || Boolean(field.value) || isAutoFilled
|
|
1662
1676
|
},
|
|
1663
1677
|
InputProps: InputProps,
|
|
1664
1678
|
inputProps: _extends({}, inputProps, pInputProps),
|
|
1665
|
-
inputRef:
|
|
1679
|
+
inputRef: _ref
|
|
1666
1680
|
}, field, {
|
|
1667
1681
|
onBlur: function onBlur(e) {
|
|
1668
1682
|
setIsShrinked(Boolean(field.value));
|
|
@@ -2001,6 +2015,20 @@ var SnackbarAlert = function SnackbarAlert(_ref) {
|
|
|
2001
2015
|
}, message)));
|
|
2002
2016
|
};
|
|
2003
2017
|
|
|
2018
|
+
var PoweredBy = function PoweredBy() {
|
|
2019
|
+
return React.createElement("div", {
|
|
2020
|
+
className: "powered-container"
|
|
2021
|
+
}, React.createElement("div", {
|
|
2022
|
+
className: 'powered-text'
|
|
2023
|
+
}, "Powered By"), React.createElement("img", {
|
|
2024
|
+
className: 'powered-img',
|
|
2025
|
+
alt: "The Ticket Fairy",
|
|
2026
|
+
src: "https://cdn-checkout.s3.us-east-2.amazonaws.com/IconTicketFairy.svg"
|
|
2027
|
+
}), React.createElement("div", {
|
|
2028
|
+
className: 'powered-ttf'
|
|
2029
|
+
}, "The", React.createElement("strong", null, "Ticket"), "Fairy"));
|
|
2030
|
+
};
|
|
2031
|
+
|
|
2004
2032
|
var style = {
|
|
2005
2033
|
position: 'absolute',
|
|
2006
2034
|
top: '50%',
|
|
@@ -2023,7 +2051,9 @@ var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
|
|
|
2023
2051
|
_ref$onForgotPassword = _ref.onForgotPasswordSuccess,
|
|
2024
2052
|
onForgotPasswordSuccess = _ref$onForgotPassword === void 0 ? function () {} : _ref$onForgotPassword,
|
|
2025
2053
|
_ref$onForgotPassword2 = _ref.onForgotPasswordError,
|
|
2026
|
-
onForgotPasswordError = _ref$onForgotPassword2 === void 0 ? function () {} : _ref$onForgotPassword2
|
|
2054
|
+
onForgotPasswordError = _ref$onForgotPassword2 === void 0 ? function () {} : _ref$onForgotPassword2,
|
|
2055
|
+
_ref$showPoweredByIma = _ref.showPoweredByImage,
|
|
2056
|
+
showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma;
|
|
2027
2057
|
|
|
2028
2058
|
var _useState = useState(false),
|
|
2029
2059
|
loading = _useState[0],
|
|
@@ -2120,7 +2150,7 @@ var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
|
|
|
2120
2150
|
className: "login"
|
|
2121
2151
|
}, React.createElement("span", {
|
|
2122
2152
|
onClick: onLogin
|
|
2123
|
-
}, "Back to Log In")));
|
|
2153
|
+
}, "Back to Log In")), showPoweredByImage ? React.createElement(PoweredBy, null) : null);
|
|
2124
2154
|
}))));
|
|
2125
2155
|
};
|
|
2126
2156
|
|
|
@@ -2170,7 +2200,9 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
2170
2200
|
_ref$showForgotPasswo = _ref.showForgotPasswordButton,
|
|
2171
2201
|
showForgotPasswordButton = _ref$showForgotPasswo === void 0 ? false : _ref$showForgotPasswo,
|
|
2172
2202
|
_ref$showSignUpButton = _ref.showSignUpButton,
|
|
2173
|
-
showSignUpButton = _ref$showSignUpButton === void 0 ? false : _ref$showSignUpButton
|
|
2203
|
+
showSignUpButton = _ref$showSignUpButton === void 0 ? false : _ref$showSignUpButton,
|
|
2204
|
+
_ref$showPoweredByIma = _ref.showPoweredByImage,
|
|
2205
|
+
showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma;
|
|
2174
2206
|
|
|
2175
2207
|
var _useState = useState(''),
|
|
2176
2208
|
error = _useState[0],
|
|
@@ -2330,7 +2362,7 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
2330
2362
|
}, React.createElement("span", {
|
|
2331
2363
|
"aria-hidden": "true",
|
|
2332
2364
|
onClick: onSignup
|
|
2333
|
-
}, "Sign up"))));
|
|
2365
|
+
}, "Sign up")), showPoweredByImage ? React.createElement(PoweredBy, null) : null));
|
|
2334
2366
|
}))));
|
|
2335
2367
|
};
|
|
2336
2368
|
|
|
@@ -2360,7 +2392,9 @@ var SignupModal = function SignupModal(_ref) {
|
|
|
2360
2392
|
_ref$onRegisterSucces = _ref.onRegisterSuccess,
|
|
2361
2393
|
onRegisterSuccess = _ref$onRegisterSucces === void 0 ? function () {} : _ref$onRegisterSucces,
|
|
2362
2394
|
_ref$onRegisterError = _ref.onRegisterError,
|
|
2363
|
-
onRegisterError = _ref$onRegisterError === void 0 ? function () {} : _ref$onRegisterError
|
|
2395
|
+
onRegisterError = _ref$onRegisterError === void 0 ? function () {} : _ref$onRegisterError,
|
|
2396
|
+
_ref$showPoweredByIma = _ref.showPoweredByImage,
|
|
2397
|
+
showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma;
|
|
2364
2398
|
|
|
2365
2399
|
var _useState = useState(false),
|
|
2366
2400
|
loading = _useState[0],
|
|
@@ -2505,7 +2539,7 @@ var SignupModal = function SignupModal(_ref) {
|
|
|
2505
2539
|
className: "login"
|
|
2506
2540
|
}, React.createElement("span", {
|
|
2507
2541
|
onClick: onLogin
|
|
2508
|
-
}, "Login")));
|
|
2542
|
+
}, "Login")), showPoweredByImage ? React.createElement(PoweredBy, null) : null);
|
|
2509
2543
|
}))));
|
|
2510
2544
|
};
|
|
2511
2545
|
|
|
@@ -2995,7 +3029,9 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
2995
3029
|
_ref4$showSignUpButto = _ref4.showSignUpButton,
|
|
2996
3030
|
showSignUpButton = _ref4$showSignUpButto === void 0 ? false : _ref4$showSignUpButto,
|
|
2997
3031
|
_ref4$brandOptIn = _ref4.brandOptIn,
|
|
2998
|
-
brandOptIn = _ref4$brandOptIn === void 0 ? false : _ref4$brandOptIn
|
|
3032
|
+
brandOptIn = _ref4$brandOptIn === void 0 ? false : _ref4$brandOptIn,
|
|
3033
|
+
_ref4$showPoweredByIm = _ref4.showPoweredByImage,
|
|
3034
|
+
showPoweredByImage = _ref4$showPoweredByIm === void 0 ? false : _ref4$showPoweredByIm;
|
|
2999
3035
|
|
|
3000
3036
|
var _useState = useState(false),
|
|
3001
3037
|
isNewUser = _useState[0],
|
|
@@ -3785,7 +3821,8 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
3785
3821
|
onSignup: function onSignup() {
|
|
3786
3822
|
setShowModalLogin(false);
|
|
3787
3823
|
setShowModalSignup(true);
|
|
3788
|
-
}
|
|
3824
|
+
},
|
|
3825
|
+
showPoweredByImage: showPoweredByImage
|
|
3789
3826
|
}), showModalSignup && React.createElement(SignupModal, {
|
|
3790
3827
|
onClose: function onClose() {
|
|
3791
3828
|
setShowModalSignup(false);
|
|
@@ -3795,7 +3832,8 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
3795
3832
|
setShowModalLogin(true);
|
|
3796
3833
|
},
|
|
3797
3834
|
onRegisterSuccess: onRegisterSuccess,
|
|
3798
|
-
onRegisterError: onRegisterError
|
|
3835
|
+
onRegisterError: onRegisterError,
|
|
3836
|
+
showPoweredByImage: showPoweredByImage
|
|
3799
3837
|
}), showModalForgotPassword && React.createElement(ForgotPasswordModal, {
|
|
3800
3838
|
onClose: function onClose() {
|
|
3801
3839
|
setShowModalForgotPassword(false);
|
|
@@ -3805,7 +3843,8 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
3805
3843
|
setShowModalLogin(true);
|
|
3806
3844
|
},
|
|
3807
3845
|
onForgotPasswordSuccess: onForgotPasswordSuccess,
|
|
3808
|
-
onForgotPasswordError: onForgotPasswordError
|
|
3846
|
+
onForgotPasswordError: onForgotPasswordError,
|
|
3847
|
+
showPoweredByImage: showPoweredByImage
|
|
3809
3848
|
}));
|
|
3810
3849
|
});
|
|
3811
3850
|
|
|
@@ -5427,7 +5466,12 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
5427
5466
|
ticketsHeaderComponent = _ref.ticketsHeaderComponent,
|
|
5428
5467
|
hideTicketsHeader = _ref.hideTicketsHeader;
|
|
5429
5468
|
var sortedTicketsList = sortBySoldOut ? _sortBy(_sortBy(ticketsList, 'sortOrder'), 'soldOut') : _sortBy(ticketsList, 'sortOrder');
|
|
5469
|
+
var showGroup = !!sortedTicketsList.find(function (ticket) {
|
|
5470
|
+
return ticket.groupName;
|
|
5471
|
+
});
|
|
5430
5472
|
return React.createElement(React.Fragment, null, !hideTicketsHeader && ticketsHeaderComponent, sortedTicketsList.map(function (ticket, i, arr) {
|
|
5473
|
+
var _arr;
|
|
5474
|
+
|
|
5431
5475
|
var isSoldOut = ticket.sold_out || !ticket.displayTicket || ticket.soldOut;
|
|
5432
5476
|
|
|
5433
5477
|
var ticketSelect = function ticketSelect(event) {
|
|
@@ -5443,8 +5487,12 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
5443
5487
|
|
|
5444
5488
|
var ticketIsFree = +ticket.price === 0;
|
|
5445
5489
|
var ticketPrice = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : "\xA3 " + (+ticket.price).toFixed(2);
|
|
5446
|
-
|
|
5447
|
-
|
|
5490
|
+
var isNewGroupTicket = (ticket == null ? void 0 : ticket.groupName) !== ((_arr = arr[i - 1]) == null ? void 0 : _arr.groupName);
|
|
5491
|
+
return React.createElement(React.Fragment, {
|
|
5492
|
+
key: ticket.id || ticket.name
|
|
5493
|
+
}, showGroup && isNewGroupTicket ? React.createElement("div", {
|
|
5494
|
+
className: 'event-detail__tier group-title'
|
|
5495
|
+
}, ticket.groupName || '') : null, React.createElement("div", {
|
|
5448
5496
|
className: "event-detail__tier " + (isSoldOut ? 'disabled' : '')
|
|
5449
5497
|
}, React.createElement("div", {
|
|
5450
5498
|
className: "event-detail__tier-name"
|
|
@@ -5468,7 +5516,7 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
5468
5516
|
prevTicketTier: arr[i - 1],
|
|
5469
5517
|
selectedTickets: selectedTickets,
|
|
5470
5518
|
handleTicketSelect: ticketSelect
|
|
5471
|
-
}))));
|
|
5519
|
+
})))));
|
|
5472
5520
|
}));
|
|
5473
5521
|
};
|
|
5474
5522
|
|
|
@@ -8208,5 +8256,5 @@ var RsvpContainer = function RsvpContainer(_ref) {
|
|
|
8208
8256
|
}, "RSVP"))))))));
|
|
8209
8257
|
};
|
|
8210
8258
|
|
|
8211
|
-
export { AddonsContainter, BillingInfoContainer, ConfirmationContainer, ForgotPasswordModal, LoginModal, MyTicketsContainer, OrderDetailsContainer, PaymentContainer, RedirectModal, ResetPasswordContainer, RsvpContainer, TicketResaleContainer, TicketsContainer, createFixedFloatNormalizer, currencyNormalizerCreator, setConfigs };
|
|
8259
|
+
export { AddonsContainter, BillingInfoContainer, ConfirmationContainer, ForgotPasswordModal, LoginModal, MyTicketsContainer, OrderDetailsContainer, PaymentContainer, PoweredBy, RedirectModal, ResetPasswordContainer, RsvpContainer, TicketResaleContainer, TicketsContainer, createFixedFloatNormalizer, currencyNormalizerCreator, setConfigs };
|
|
8212
8260
|
//# sourceMappingURL=tf-checkout-react.esm.js.map
|