tf-checkout-react 1.0.78 → 1.0.79
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 +1 -1
- package/dist/components/paymentContainer/index.d.ts +5 -2
- package/dist/components/ticketsContainer/index.d.ts +7 -1
- package/dist/tf-checkout-react.cjs.development.js +22 -11
- 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 +23 -12
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/billing-info-container/index.tsx +1 -1
- package/src/components/common/CheckboxField.tsx +13 -9
- package/src/components/paymentContainer/index.tsx +6 -3
- package/src/components/stripePayment/index.tsx +3 -3
- package/src/components/ticketsContainer/index.tsx +94 -85
|
@@ -4,7 +4,7 @@ import { FormikHelpers, FormikValues } from 'formik';
|
|
|
4
4
|
import './style.css';
|
|
5
5
|
import { IBillingInfoData } from '../../types';
|
|
6
6
|
import { ThemeOptions } from '@mui/material';
|
|
7
|
-
import { CSSProperties } from '@mui/
|
|
7
|
+
import { CSSProperties } from '@mui/styles';
|
|
8
8
|
export interface IBillingInfoPage {
|
|
9
9
|
data?: IBillingInfoData[];
|
|
10
10
|
ticketHoldersFields?: IBillingInfoData;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { AxiosError } from 'axios';
|
|
3
|
+
import { StripeElementsOptions } from '@stripe/stripe-js';
|
|
3
4
|
import './style.css';
|
|
4
5
|
import { IPaymentField } from '../../types';
|
|
5
6
|
import { StripeCardNumberElementOptions } from '@stripe/stripe-js';
|
|
6
7
|
import { ThemeOptions } from '@mui/material';
|
|
8
|
+
import { CSSProperties } from "@mui/styles";
|
|
7
9
|
export interface IPaymentPage {
|
|
8
10
|
paymentFields: IPaymentField[];
|
|
9
11
|
handlePayment: any;
|
|
@@ -20,5 +22,6 @@ export interface IPaymentPage {
|
|
|
20
22
|
input?: CSSProperties;
|
|
21
23
|
checkbox?: CSSProperties;
|
|
22
24
|
};
|
|
25
|
+
elementsOptions?: StripeElementsOptions;
|
|
23
26
|
}
|
|
24
|
-
export declare const PaymentContainer: ({ paymentFields, handlePayment, formTitle, errorText, checkoutData, onErrorClose, onGetPaymentDataSuccess, onGetPaymentDataError, onPaymentError, stripeCardOptions, disableZipSection, themeOptions, }: IPaymentPage) => JSX.Element;
|
|
27
|
+
export declare const PaymentContainer: ({ paymentFields, handlePayment, formTitle, errorText, checkoutData, onErrorClose, onGetPaymentDataSuccess, onGetPaymentDataError, onPaymentError, stripeCardOptions, disableZipSection, themeOptions, elementsOptions }: IPaymentPage) => JSX.Element;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AxiosError } from 'axios';
|
|
3
3
|
import './style.css';
|
|
4
|
+
import { ThemeOptions } from '@mui/material';
|
|
5
|
+
import { CSSProperties } from '@mui/styles';
|
|
4
6
|
interface CartSuccess {
|
|
5
7
|
skip_billing_page: boolean;
|
|
6
8
|
names_required: boolean;
|
|
@@ -20,6 +22,10 @@ export interface IGetTickets {
|
|
|
20
22
|
theme?: 'light' | 'dark';
|
|
21
23
|
queryPromoCode?: string;
|
|
22
24
|
isPromotionsEnabled?: boolean;
|
|
25
|
+
themeOptions?: ThemeOptions & {
|
|
26
|
+
input?: CSSProperties;
|
|
27
|
+
checkbox?: CSSProperties;
|
|
28
|
+
};
|
|
23
29
|
}
|
|
24
30
|
export interface ITicket {
|
|
25
31
|
id: string | number;
|
|
@@ -28,5 +34,5 @@ export interface ITicket {
|
|
|
28
34
|
export interface ISelectedTickets {
|
|
29
35
|
[key: string]: string | number;
|
|
30
36
|
}
|
|
31
|
-
export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, theme, queryPromoCode, isPromotionsEnabled, }: IGetTickets) => JSX.Element;
|
|
37
|
+
export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, theme, queryPromoCode, isPromotionsEnabled, themeOptions, }: IGetTickets) => JSX.Element;
|
|
32
38
|
export {};
|
|
@@ -45,6 +45,7 @@ var FormControl = _interopDefault(require('@mui/material/FormControl'));
|
|
|
45
45
|
var MenuItem = _interopDefault(require('@mui/material/MenuItem'));
|
|
46
46
|
var SVG = _interopDefault(require('react-inlinesvg'));
|
|
47
47
|
var moment = _interopDefault(require('moment-timezone'));
|
|
48
|
+
var privateTheming = require('@mui/private-theming');
|
|
48
49
|
var Table = _interopDefault(require('@mui/material/Table'));
|
|
49
50
|
var TableBody = _interopDefault(require('@mui/material/TableBody'));
|
|
50
51
|
var TableCell = _interopDefault(require('@mui/material/TableCell'));
|
|
@@ -1906,18 +1907,22 @@ var CustomField = function CustomField(_ref) {
|
|
|
1906
1907
|
|
|
1907
1908
|
var _excluded$1 = ["label", "field", "selectOptions", "theme", "setFieldValue"];
|
|
1908
1909
|
var CheckboxField = function CheckboxField(_ref) {
|
|
1910
|
+
var _rest$form, _field$name, _rest$form2, _field$name2;
|
|
1911
|
+
|
|
1909
1912
|
var label = _ref.label,
|
|
1910
1913
|
field = _ref.field,
|
|
1911
1914
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
1912
1915
|
|
|
1913
1916
|
var customTheme = styles.useTheme();
|
|
1914
|
-
return React__default.createElement(
|
|
1917
|
+
return React__default.createElement(material.FormControl, {
|
|
1918
|
+
error: !!(rest != null && (_rest$form = rest.form) != null && _rest$form.errors && rest.form.errors[(_field$name = field == null ? void 0 : field.name) != null ? _field$name : ""])
|
|
1919
|
+
}, React__default.createElement(FormGroup, null, React__default.createElement(FormControlLabel, {
|
|
1915
1920
|
control: React__default.createElement(Checkbox, Object.assign({}, field, rest)),
|
|
1916
1921
|
label: label,
|
|
1917
1922
|
componentsProps: {
|
|
1918
1923
|
typography: customTheme == null ? void 0 : customTheme.checkbox
|
|
1919
1924
|
}
|
|
1920
|
-
}));
|
|
1925
|
+
})), !!(rest != null && (_rest$form2 = rest.form) != null && _rest$form2.errors && rest.form.errors[(_field$name2 = field == null ? void 0 : field.name) != null ? _field$name2 : ""]) ? React__default.createElement(material.FormHelperText, null, "Required") : null);
|
|
1921
1926
|
};
|
|
1922
1927
|
|
|
1923
1928
|
var SelectField = function SelectField(_ref) {
|
|
@@ -3019,7 +3024,7 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3019
3024
|
}, React__default.createElement("span", {
|
|
3020
3025
|
className: "card_label_text"
|
|
3021
3026
|
}, "Card number"), React__default.createElement(reactStripeJs.CardNumberElement, {
|
|
3022
|
-
options: _extends({}, options
|
|
3027
|
+
options: _extends({}, options, stripeCardOptions),
|
|
3023
3028
|
onReady: _identity,
|
|
3024
3029
|
onChange: _identity,
|
|
3025
3030
|
onBlur: _identity,
|
|
@@ -3029,13 +3034,13 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3029
3034
|
}, React__default.createElement("span", {
|
|
3030
3035
|
className: "card_label_text"
|
|
3031
3036
|
}, "Expiration date"), React__default.createElement(reactStripeJs.CardExpiryElement, {
|
|
3032
|
-
options: _extends({}, options
|
|
3037
|
+
options: _extends({}, options, stripeCardOptions)
|
|
3033
3038
|
})), React__default.createElement("label", {
|
|
3034
3039
|
className: "cvc_element"
|
|
3035
3040
|
}, React__default.createElement("span", {
|
|
3036
3041
|
className: "card_label_text"
|
|
3037
3042
|
}, "CVC"), React__default.createElement(reactStripeJs.CardCvcElement, {
|
|
3038
|
-
options: _extends({}, options
|
|
3043
|
+
options: _extends({}, options, stripeCardOptions)
|
|
3039
3044
|
})), !disableZipSection && React__default.createElement("label", {
|
|
3040
3045
|
className: "zip_element"
|
|
3041
3046
|
}, React__default.createElement("p", {
|
|
@@ -3127,7 +3132,8 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3127
3132
|
stripeCardOptions = _ref$stripeCardOption === void 0 ? {} : _ref$stripeCardOption,
|
|
3128
3133
|
_ref$disableZipSectio = _ref.disableZipSection,
|
|
3129
3134
|
disableZipSection = _ref$disableZipSectio === void 0 ? false : _ref$disableZipSectio,
|
|
3130
|
-
themeOptions = _ref.themeOptions
|
|
3135
|
+
themeOptions = _ref.themeOptions,
|
|
3136
|
+
elementsOptions = _ref.elementsOptions;
|
|
3131
3137
|
|
|
3132
3138
|
var _useState = React.useState(initialReviewValues),
|
|
3133
3139
|
reviewData = _useState[0],
|
|
@@ -3348,7 +3354,8 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3348
3354
|
}, "Please provide your payment information"), showErrorText && React__default.createElement("p", {
|
|
3349
3355
|
className: "payment_info__error"
|
|
3350
3356
|
}, errorText), React__default.createElement("div", null, React__default.createElement(reactStripeJs.Elements, {
|
|
3351
|
-
stripe: getStripePromise(reviewData)
|
|
3357
|
+
stripe: getStripePromise(reviewData),
|
|
3358
|
+
options: elementsOptions
|
|
3352
3359
|
}, React__default.createElement(CheckoutForm, {
|
|
3353
3360
|
stripe_client_secret: _get(reviewData, 'payment_method.stripe_client_secret'),
|
|
3354
3361
|
total: orderData.total,
|
|
@@ -4167,7 +4174,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4167
4174
|
_ref$queryPromoCode = _ref.queryPromoCode,
|
|
4168
4175
|
queryPromoCode = _ref$queryPromoCode === void 0 ? '' : _ref$queryPromoCode,
|
|
4169
4176
|
_ref$isPromotionsEnab = _ref.isPromotionsEnabled,
|
|
4170
|
-
isPromotionsEnabled = _ref$isPromotionsEnab === void 0 ? true : _ref$isPromotionsEnab
|
|
4177
|
+
isPromotionsEnabled = _ref$isPromotionsEnab === void 0 ? true : _ref$isPromotionsEnab,
|
|
4178
|
+
themeOptions = _ref.themeOptions;
|
|
4171
4179
|
|
|
4172
4180
|
var _useState = React.useState({}),
|
|
4173
4181
|
selectedTickets = _useState[0],
|
|
@@ -4460,6 +4468,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4460
4468
|
var isAllTicketsSoldOut = !_some(tickets, function (item) {
|
|
4461
4469
|
return !(item.sold_out || item.soldOut);
|
|
4462
4470
|
});
|
|
4471
|
+
var themeMui = material.createTheme(themeOptions);
|
|
4463
4472
|
React.useEffect(function () {
|
|
4464
4473
|
isWindowDefined && window.document.addEventListener('custom-logout', handleLogout);
|
|
4465
4474
|
return function () {
|
|
@@ -4472,7 +4481,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4472
4481
|
isWindowDefined && window.document.removeEventListener('custom-login', handleExternalLogin);
|
|
4473
4482
|
};
|
|
4474
4483
|
}, []);
|
|
4475
|
-
return React__default.createElement(
|
|
4484
|
+
return React__default.createElement(privateTheming.ThemeProvider, {
|
|
4485
|
+
theme: themeMui
|
|
4486
|
+
}, React__default.createElement("div", {
|
|
4476
4487
|
className: "get-tickets-page " + theme,
|
|
4477
4488
|
style: contentStyle
|
|
4478
4489
|
}, isLoading ? React__default.createElement(Loader$1, null) : React__default.createElement("div", null, React__default.createElement(TicketsSection, {
|
|
@@ -4486,7 +4497,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4486
4497
|
title: "Sales start in:",
|
|
4487
4498
|
message: "No tickets are currently available for this event.",
|
|
4488
4499
|
callback: updateTickets
|
|
4489
|
-
}) : null, showWaitingList && React__default.createElement(WaitingList, {
|
|
4500
|
+
}) : null, showWaitingList && event.salesStarted && React__default.createElement(WaitingList, {
|
|
4490
4501
|
tickets: tickets,
|
|
4491
4502
|
eventId: eventId
|
|
4492
4503
|
}), React__default.createElement(PromoCodeSection, {
|
|
@@ -4519,7 +4530,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4519
4530
|
}, "Log out"))) : ''), showLoginModal ? React__default.createElement(LoginModal, {
|
|
4520
4531
|
onClose: handleOnClose,
|
|
4521
4532
|
onLogin: handleOnLogin
|
|
4522
|
-
}) : null);
|
|
4533
|
+
}) : null));
|
|
4523
4534
|
};
|
|
4524
4535
|
|
|
4525
4536
|
var EventInfoItem = function EventInfoItem(_ref) {
|