tf-checkout-react 1.6.6-beta.34 → 1.6.6-beta.35
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/confirmationContainer/index.d.ts +1 -0
- package/dist/tf-checkout-react.cjs.development.js +75 -46
- 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 +76 -47
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/package.json +3 -2
- package/src/components/billing-info-container/index.tsx +20 -4
- package/src/components/common/CustomField.tsx +38 -2
- package/src/components/confirmationContainer/config.ts +3 -3
- package/src/components/confirmationContainer/index.tsx +2 -1
- package/src/components/confirmationContainer/social-buttons.tsx +5 -3
- package/src/components/confirmationContainer/style.css +9 -5
- package/src/components/loginModal/index.tsx +17 -25
- package/src/components/registerModal/index.tsx +47 -72
- package/src/components/resetPasswordContainer/index.tsx +10 -3
- package/src/components/signupModal/index.tsx +13 -6
- package/src/components/ticketsContainer/index.tsx +12 -8
|
@@ -35,6 +35,10 @@ var Checkbox$1 = _interopDefault(require('@mui/material/Checkbox'));
|
|
|
35
35
|
var FormControlLabel = _interopDefault(require('@mui/material/FormControlLabel'));
|
|
36
36
|
var FormGroup = _interopDefault(require('@mui/material/FormGroup'));
|
|
37
37
|
var styles$1 = require('@mui/styles');
|
|
38
|
+
var Visibility = _interopDefault(require('@mui/icons-material/Visibility'));
|
|
39
|
+
var VisibilityOff = _interopDefault(require('@mui/icons-material/VisibilityOff'));
|
|
40
|
+
var IconButton = _interopDefault(require('@mui/material/IconButton'));
|
|
41
|
+
var InputAdornment = _interopDefault(require('@mui/material/InputAdornment'));
|
|
38
42
|
var TextField = _interopDefault(require('@mui/material/TextField'));
|
|
39
43
|
var _isFunction = _interopDefault(require('lodash/isFunction'));
|
|
40
44
|
var _isObject = _interopDefault(require('lodash/isObject'));
|
|
@@ -2785,7 +2789,7 @@ var Checkbox = function Checkbox(_ref) {
|
|
|
2785
2789
|
};
|
|
2786
2790
|
|
|
2787
2791
|
var CustomField = function CustomField(_ref2) {
|
|
2788
|
-
var _ref$current;
|
|
2792
|
+
var _ref$current, _customTheme$input;
|
|
2789
2793
|
var label = _ref2.label,
|
|
2790
2794
|
_ref2$type = _ref2.type,
|
|
2791
2795
|
type = _ref2$type === void 0 ? 'text' : _ref2$type,
|
|
@@ -2812,15 +2816,39 @@ var CustomField = function CustomField(_ref2) {
|
|
|
2812
2816
|
var _useState = React.useState(Boolean(field.value)),
|
|
2813
2817
|
isShrinked = _useState[0],
|
|
2814
2818
|
setIsShrinked = _useState[1];
|
|
2819
|
+
var _useState2 = React.useState(false),
|
|
2820
|
+
showPassword = _useState2[0],
|
|
2821
|
+
setShowPassword = _useState2[1];
|
|
2815
2822
|
var _ref = React.useRef(null);
|
|
2816
2823
|
var isAutoFilled = (_ref$current = _ref.current) == null ? void 0 : _ref$current.matches(':-webkit-autofill');
|
|
2817
2824
|
var isSelectField = type === 'select';
|
|
2825
|
+
var isPasswordField = type === 'password';
|
|
2818
2826
|
var error = _get(errors, field.name);
|
|
2819
2827
|
var isTouched = Boolean(_get(touched, field.name)) || _includes(field.name, 'holder') && !!error && !!submitCount;
|
|
2820
2828
|
var customTheme = styles$1.useTheme();
|
|
2821
2829
|
var inputProps = {
|
|
2822
2830
|
sx: customTheme == null ? void 0 : customTheme.input
|
|
2823
2831
|
};
|
|
2832
|
+
var handleClickShowPassword = function handleClickShowPassword() {
|
|
2833
|
+
setShowPassword(!showPassword);
|
|
2834
|
+
};
|
|
2835
|
+
var handleMouseDownPassword = function handleMouseDownPassword(event) {
|
|
2836
|
+
event.preventDefault();
|
|
2837
|
+
};
|
|
2838
|
+
var finalInputProps = isPasswordField ? _extends({}, InputProps, {
|
|
2839
|
+
endAdornment: React__default.createElement(InputAdornment, {
|
|
2840
|
+
position: "end"
|
|
2841
|
+
}, React__default.createElement(IconButton, {
|
|
2842
|
+
"aria-label": "toggle password visibility",
|
|
2843
|
+
onClick: handleClickShowPassword,
|
|
2844
|
+
onMouseDown: handleMouseDownPassword,
|
|
2845
|
+
edge: "end",
|
|
2846
|
+
size: "small",
|
|
2847
|
+
sx: {
|
|
2848
|
+
color: (customTheme == null ? void 0 : (_customTheme$input = customTheme.input) == null ? void 0 : _customTheme$input.color) || 'inherit'
|
|
2849
|
+
}
|
|
2850
|
+
}, showPassword ? React__default.createElement(VisibilityOff, null) : React__default.createElement(Visibility, null)))
|
|
2851
|
+
}) : InputProps;
|
|
2824
2852
|
React.useEffect(function () {
|
|
2825
2853
|
if (_isFunction(inputRef)) {
|
|
2826
2854
|
inputRef(_ref.current);
|
|
@@ -2833,7 +2861,7 @@ var CustomField = function CustomField(_ref2) {
|
|
|
2833
2861
|
placeholder: "",
|
|
2834
2862
|
id: field.name,
|
|
2835
2863
|
label: label,
|
|
2836
|
-
type: type,
|
|
2864
|
+
type: isPasswordField ? showPassword ? 'text' : 'password' : type,
|
|
2837
2865
|
select: isSelectField,
|
|
2838
2866
|
fullWidth: true,
|
|
2839
2867
|
error: !!error && isTouched,
|
|
@@ -2852,7 +2880,7 @@ var CustomField = function CustomField(_ref2) {
|
|
|
2852
2880
|
sx: customTheme == null ? void 0 : customTheme.input,
|
|
2853
2881
|
shrink: isShrinked || Boolean(field.value) || isAutoFilled
|
|
2854
2882
|
},
|
|
2855
|
-
InputProps:
|
|
2883
|
+
InputProps: finalInputProps,
|
|
2856
2884
|
inputProps: _extends({}, inputProps, pInputProps),
|
|
2857
2885
|
inputRef: _ref,
|
|
2858
2886
|
multiline: multiline,
|
|
@@ -4873,33 +4901,21 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
4873
4901
|
}, React__default.createElement("div", {
|
|
4874
4902
|
className: "login-modal-body__email"
|
|
4875
4903
|
}, React__default.createElement(formik.Field, {
|
|
4876
|
-
name:
|
|
4904
|
+
name: "email",
|
|
4905
|
+
label: "Email",
|
|
4906
|
+
type: "email",
|
|
4907
|
+
component: CustomField,
|
|
4908
|
+
theme: "light",
|
|
4877
4909
|
validate: requiredValidator
|
|
4878
|
-
}, function (_ref3) {
|
|
4879
|
-
var field = _ref3.field,
|
|
4880
|
-
meta = _ref3.meta;
|
|
4881
|
-
return React__default.createElement(material.TextField, Object.assign({
|
|
4882
|
-
label: 'Email',
|
|
4883
|
-
type: 'email',
|
|
4884
|
-
fullWidth: true,
|
|
4885
|
-
error: !!meta.error && meta.touched,
|
|
4886
|
-
helperText: meta.touched && meta.error
|
|
4887
|
-
}, field));
|
|
4888
4910
|
})), React__default.createElement("div", {
|
|
4889
4911
|
className: "login-modal-body__password"
|
|
4890
4912
|
}, React__default.createElement(formik.Field, {
|
|
4891
|
-
name:
|
|
4913
|
+
name: "password",
|
|
4914
|
+
label: "Password",
|
|
4915
|
+
type: "password",
|
|
4916
|
+
component: CustomField,
|
|
4917
|
+
theme: "light",
|
|
4892
4918
|
validate: requiredValidator
|
|
4893
|
-
}, function (_ref4) {
|
|
4894
|
-
var field = _ref4.field,
|
|
4895
|
-
meta = _ref4.meta;
|
|
4896
|
-
return React__default.createElement(material.TextField, Object.assign({
|
|
4897
|
-
label: "Password",
|
|
4898
|
-
type: "password",
|
|
4899
|
-
fullWidth: true,
|
|
4900
|
-
error: !!meta.error && meta.touched,
|
|
4901
|
-
helperText: meta.touched && meta.error
|
|
4902
|
-
}, field));
|
|
4903
4919
|
})), React__default.createElement("div", {
|
|
4904
4920
|
className: "login-action-button"
|
|
4905
4921
|
}, React__default.createElement("button", {
|
|
@@ -5988,18 +6004,18 @@ var SignupSchema = /*#__PURE__*/Yup.object().shape({
|
|
|
5988
6004
|
firstName: /*#__PURE__*/Yup.string().required('Required'),
|
|
5989
6005
|
lastName: /*#__PURE__*/Yup.string().required('Required'),
|
|
5990
6006
|
email: /*#__PURE__*/Yup.string().email('Invalid email').required('Required'),
|
|
5991
|
-
password: /*#__PURE__*/Yup.string().min(
|
|
6007
|
+
password: /*#__PURE__*/Yup.string().min(8, 'Password must have 8+ characters').required('Required').matches( /*#__PURE__*/new RegExp('^(?=.*[@$!%*#?&])'), 'Password must contain at least one special character'),
|
|
5992
6008
|
confirmPassword: /*#__PURE__*/Yup.string().required('Required').oneOf([/*#__PURE__*/Yup.ref('password'), null], 'Passwords must match')
|
|
5993
6009
|
});
|
|
5994
6010
|
var SignupModal = function SignupModal(_ref) {
|
|
5995
6011
|
var _ref$onClose = _ref.onClose,
|
|
5996
|
-
onClose = _ref$onClose === void 0 ?
|
|
6012
|
+
onClose = _ref$onClose === void 0 ? _identity : _ref$onClose,
|
|
5997
6013
|
_ref$onLogin = _ref.onLogin,
|
|
5998
|
-
onLogin = _ref$onLogin === void 0 ?
|
|
6014
|
+
onLogin = _ref$onLogin === void 0 ? _identity : _ref$onLogin,
|
|
5999
6015
|
_ref$onRegisterSucces = _ref.onRegisterSuccess,
|
|
6000
|
-
onRegisterSuccess = _ref$onRegisterSucces === void 0 ?
|
|
6016
|
+
onRegisterSuccess = _ref$onRegisterSucces === void 0 ? _identity : _ref$onRegisterSucces,
|
|
6001
6017
|
_ref$onRegisterError = _ref.onRegisterError,
|
|
6002
|
-
onRegisterError = _ref$onRegisterError === void 0 ?
|
|
6018
|
+
onRegisterError = _ref$onRegisterError === void 0 ? _identity : _ref$onRegisterError,
|
|
6003
6019
|
_ref$showPoweredByIma = _ref.showPoweredByImage,
|
|
6004
6020
|
showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma;
|
|
6005
6021
|
var _useState = React.useState(false),
|
|
@@ -6049,7 +6065,7 @@ var SignupModal = function SignupModal(_ref) {
|
|
|
6049
6065
|
return _ref2.apply(this, arguments);
|
|
6050
6066
|
};
|
|
6051
6067
|
}();
|
|
6052
|
-
var _onClose = loading ?
|
|
6068
|
+
var _onClose = loading ? _identity : onClose;
|
|
6053
6069
|
return React__default.createElement(material.Modal, {
|
|
6054
6070
|
open: true,
|
|
6055
6071
|
onClose: _onClose,
|
|
@@ -6652,7 +6668,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6652
6668
|
React.useEffect(function () {
|
|
6653
6669
|
var fetchCheckoutUpdate = /*#__PURE__*/function () {
|
|
6654
6670
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
6655
|
-
var checkoutUpdateResponse, checkoutAttributes;
|
|
6671
|
+
var checkoutUpdateResponse, checkoutAttributes, cartPriceBreakdown;
|
|
6656
6672
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
6657
6673
|
while (1) switch (_context5.prev = _context5.next) {
|
|
6658
6674
|
case 0:
|
|
@@ -6674,7 +6690,15 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6674
6690
|
checkoutUpdateResponse = _context5.sent;
|
|
6675
6691
|
if (checkoutUpdateResponse.success) {
|
|
6676
6692
|
checkoutAttributes = checkoutUpdateResponse.data.attributes;
|
|
6693
|
+
cartPriceBreakdown = _get(checkoutAttributes, 'cart_price_breakdown', {});
|
|
6694
|
+
localStorage.setItem('checkoutData', JSON.stringify({
|
|
6695
|
+
hash: '',
|
|
6696
|
+
total: _get(cartPriceBreakdown, 'total', 0)
|
|
6697
|
+
}));
|
|
6677
6698
|
setCheckoutUpdateData(checkoutAttributes);
|
|
6699
|
+
onCheckoutUpdateSuccess(_extends({
|
|
6700
|
+
expires_at: expirationTime
|
|
6701
|
+
}, cartPriceBreakdown));
|
|
6678
6702
|
}
|
|
6679
6703
|
_context5.next = 12;
|
|
6680
6704
|
break;
|
|
@@ -6693,7 +6717,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6693
6717
|
};
|
|
6694
6718
|
}();
|
|
6695
6719
|
fetchCheckoutUpdate();
|
|
6696
|
-
}, [eventId]);
|
|
6720
|
+
}, [eventId, additionalConfigs == null ? void 0 : additionalConfigs.resale]);
|
|
6697
6721
|
React.useEffect(function () {
|
|
6698
6722
|
var collectPaymentData = /*#__PURE__*/function () {
|
|
6699
6723
|
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
@@ -6941,7 +6965,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6941
6965
|
}), !isCountriesLoading && !isConfigLoading && React__default.createElement(formik.Formik, {
|
|
6942
6966
|
initialValues: getInitialValues(dataWithUniqueIds, _extends({
|
|
6943
6967
|
country: initialCountry,
|
|
6944
|
-
state: _get(userData, 'stateId', '') || '1',
|
|
6968
|
+
state: _get(userData, 'stateId', '') || _get(userData, 'state', '') || '1',
|
|
6945
6969
|
brand_opt_in: Boolean(optedInFieldValue),
|
|
6946
6970
|
ttf_opt_in: ttfOptIn,
|
|
6947
6971
|
data_capture: {
|
|
@@ -7564,7 +7588,7 @@ var config = {
|
|
|
7564
7588
|
},
|
|
7565
7589
|
twitter: {
|
|
7566
7590
|
component: reactShare.TwitterShareButton,
|
|
7567
|
-
icon: reactShare.
|
|
7591
|
+
icon: reactShare.XIcon
|
|
7568
7592
|
},
|
|
7569
7593
|
linkedin: {
|
|
7570
7594
|
component: reactShare.LinkedinShareButton,
|
|
@@ -7660,12 +7684,15 @@ var SocialComponent = function SocialComponent(_ref) {
|
|
|
7660
7684
|
points = _ref.points,
|
|
7661
7685
|
onAfterShare = _ref.onAfterShare,
|
|
7662
7686
|
alreadyApplied = _ref.alreadyApplied,
|
|
7663
|
-
oneTimeAction = _ref.oneTimeAction
|
|
7687
|
+
oneTimeAction = _ref.oneTimeAction,
|
|
7688
|
+
_ref$btnClassName = _ref.btnClassName,
|
|
7689
|
+
btnClassName = _ref$btnClassName === void 0 ? '' : _ref$btnClassName;
|
|
7664
7690
|
var Component = (_config = config$1(platform)) == null ? void 0 : _config.component;
|
|
7665
7691
|
var Icon = (_config2 = config$1(platform)) == null ? void 0 : _config2.icon;
|
|
7666
7692
|
var isActionDisabled = alreadyApplied && oneTimeAction;
|
|
7667
7693
|
return React__default.createElement(React__default.Fragment, null, Component && React__default.createElement(Component, Object.assign({}, shareData, {
|
|
7668
|
-
disabled: isActionDisabled
|
|
7694
|
+
disabled: isActionDisabled,
|
|
7695
|
+
className: btnClassName
|
|
7669
7696
|
}), React__default.createElement("div", {
|
|
7670
7697
|
onKeyDown: _identity,
|
|
7671
7698
|
onClick: !isActionDisabled ? onAfterShare : _identity,
|
|
@@ -7717,13 +7744,14 @@ var SocialButtons = function SocialButtons(_ref2) {
|
|
|
7717
7744
|
url: shareLink
|
|
7718
7745
|
}
|
|
7719
7746
|
}), React__default.createElement(SocialComponent, {
|
|
7720
|
-
mainLabel: "
|
|
7721
|
-
subLabel: "
|
|
7747
|
+
mainLabel: "Post on",
|
|
7748
|
+
subLabel: "X",
|
|
7722
7749
|
platform: "twitter",
|
|
7723
7750
|
shareData: {
|
|
7724
7751
|
title: name,
|
|
7725
7752
|
url: shareLink
|
|
7726
|
-
}
|
|
7753
|
+
},
|
|
7754
|
+
btnClassName: "twitter-btn"
|
|
7727
7755
|
}), React__default.createElement(SocialComponent, {
|
|
7728
7756
|
mainLabel: "Message friends on",
|
|
7729
7757
|
subLabel: "Facebook",
|
|
@@ -7943,7 +7971,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
7943
7971
|
"aria-hidden": true,
|
|
7944
7972
|
className: "share-by-link-copy-icon",
|
|
7945
7973
|
onClick: function onClick() {
|
|
7946
|
-
navigator.clipboard.writeText(_get(inputRef, 'current.value') ||
|
|
7974
|
+
navigator.clipboard.writeText(_get(inputRef, 'current.value') || '');
|
|
7947
7975
|
setShowCopyModal(true);
|
|
7948
7976
|
onLinkCopied();
|
|
7949
7977
|
}
|
|
@@ -9094,7 +9122,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
9094
9122
|
getTicketsApi();
|
|
9095
9123
|
fetchPreregisteredData();
|
|
9096
9124
|
}
|
|
9097
|
-
|
|
9125
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
9126
|
+
}, [eventId]);
|
|
9098
9127
|
React.useEffect(function () {
|
|
9099
9128
|
setIsPreregistered(checkUserPreregistration(preregisteredUsers));
|
|
9100
9129
|
}, [preregisteredUsers]);
|
|
@@ -9647,7 +9676,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
9647
9676
|
callback: updateTickets,
|
|
9648
9677
|
disableLeadingZero: disableCountdownLeadingZero,
|
|
9649
9678
|
isLoggedIn: isLoggedIn
|
|
9650
|
-
}) : null, showWaitingList && event.salesStarted && !hideWaitingList && React__default.createElement(WaitingList, {
|
|
9679
|
+
}) : null, (event == null ? void 0 : event.enableWaitingList) && showWaitingList && event.salesStarted && !hideWaitingList && React__default.createElement(WaitingList, {
|
|
9651
9680
|
tickets: ordinaryTickets,
|
|
9652
9681
|
eventId: eventId,
|
|
9653
9682
|
defaultMaxQuantity: event.waitingListMaxQuantity
|
|
@@ -11029,16 +11058,16 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
11029
11058
|
};
|
|
11030
11059
|
|
|
11031
11060
|
var Schema$1 = /*#__PURE__*/Yup.object().shape({
|
|
11032
|
-
password: /*#__PURE__*/Yup.string().min(
|
|
11061
|
+
password: /*#__PURE__*/Yup.string().min(8, 'Password must have 8+ characters').required('Required').matches( /*#__PURE__*/new RegExp('^(?=.*[@$!%*#?&])'), 'Password must contain at least one special character'),
|
|
11033
11062
|
password_confirmation: /*#__PURE__*/Yup.string().required('Required').oneOf([/*#__PURE__*/Yup.ref('password'), null], 'Passwords must match')
|
|
11034
11063
|
});
|
|
11035
11064
|
var ResetPasswordContainer = function ResetPasswordContainer(_ref) {
|
|
11036
11065
|
var _ref$token = _ref.token,
|
|
11037
11066
|
tokenProps = _ref$token === void 0 ? '' : _ref$token,
|
|
11038
11067
|
_ref$onResetPasswordS = _ref.onResetPasswordSuccess,
|
|
11039
|
-
onResetPasswordSuccess = _ref$onResetPasswordS === void 0 ?
|
|
11068
|
+
onResetPasswordSuccess = _ref$onResetPasswordS === void 0 ? _identity : _ref$onResetPasswordS,
|
|
11040
11069
|
_ref$onResetPasswordE = _ref.onResetPasswordError,
|
|
11041
|
-
onResetPasswordError = _ref$onResetPasswordE === void 0 ?
|
|
11070
|
+
onResetPasswordError = _ref$onResetPasswordE === void 0 ? _identity : _ref$onResetPasswordE;
|
|
11042
11071
|
var _useState = React.useState(false),
|
|
11043
11072
|
loading = _useState[0],
|
|
11044
11073
|
setLoading = _useState[1];
|