tf-checkout-react 1.0.99-beta.20 → 1.0.99-beta.21
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/api/index.d.ts +1 -0
- package/dist/components/common/CustomField.d.ts +1 -1
- package/dist/components/common/DatePickerField.d.ts +14 -0
- package/dist/components/ticketResale/index.d.ts +3 -1
- package/dist/tf-checkout-react.cjs.development.js +150 -35
- 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 +151 -36
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/api/index.ts +4 -0
- package/src/components/billing-info-container/index.tsx +3 -0
- package/src/components/billing-info-container/utils.ts +1 -0
- package/src/components/common/CustomField.tsx +6 -6
- package/src/components/common/DatePickerField.tsx +96 -0
- package/src/components/ticketResale/index.tsx +23 -4
- package/src/components/ticketsContainer/index.tsx +2 -1
|
@@ -20,15 +20,17 @@ import FormControlLabel from '@mui/material/FormControlLabel';
|
|
|
20
20
|
import Checkbox from '@mui/material/Checkbox';
|
|
21
21
|
import { useTheme } from '@mui/styles';
|
|
22
22
|
import TextField$1 from '@mui/material/TextField';
|
|
23
|
-
import moment from 'moment-timezone';
|
|
24
23
|
import MuiPhoneNumber from 'material-ui-phone-number';
|
|
25
24
|
import CircularProgress from '@mui/material/CircularProgress';
|
|
26
25
|
import Select from '@mui/material/Select';
|
|
27
|
-
import {
|
|
26
|
+
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
|
28
27
|
import Backdrop from '@mui/material/Backdrop';
|
|
29
28
|
import Countdown$1 from 'react-countdown';
|
|
30
29
|
import _isNumber from 'lodash-es/isNumber';
|
|
31
30
|
import SVG from 'react-inlinesvg';
|
|
31
|
+
import DatePicker from '@mui/lab/DatePicker';
|
|
32
|
+
import AdapterMoment from '@mui/lab/AdapterMoment';
|
|
33
|
+
import LocalizationProvider from '@mui/lab/LocalizationProvider';
|
|
32
34
|
import Container from '@mui/material/Container';
|
|
33
35
|
import Alert$1 from '@mui/material/Alert';
|
|
34
36
|
import { useStripe, useElements, CardNumberElement, CardExpiryElement, CardCvcElement, Elements } from '@stripe/react-stripe-js';
|
|
@@ -41,6 +43,7 @@ import jwt_decode from 'jwt-decode';
|
|
|
41
43
|
import _sortBy from 'lodash-es/sortBy';
|
|
42
44
|
import FormControl$1 from '@mui/material/FormControl';
|
|
43
45
|
import MenuItem from '@mui/material/MenuItem';
|
|
46
|
+
import moment from 'moment-timezone';
|
|
44
47
|
import { ThemeProvider as ThemeProvider$1 } from '@mui/private-theming';
|
|
45
48
|
import Table from '@mui/material/Table';
|
|
46
49
|
import TableBody from '@mui/material/TableBody';
|
|
@@ -1429,6 +1432,9 @@ var logout = function logout() {
|
|
|
1429
1432
|
var processTicket = function processTicket(hash) {
|
|
1430
1433
|
return publicRequest.post("v1/ticket/" + hash + "/process/");
|
|
1431
1434
|
};
|
|
1435
|
+
var declineInvitation = function declineInvitation(hash) {
|
|
1436
|
+
return publicRequest.post("v1/ticket/" + hash + "/decline");
|
|
1437
|
+
};
|
|
1432
1438
|
var sendRSVPInfo = function sendRSVPInfo(eventId, data) {
|
|
1433
1439
|
return publicRequest.post("v1/event/" + eventId + "/send-rsvp-info", data);
|
|
1434
1440
|
};
|
|
@@ -1860,6 +1866,7 @@ var createRegisterFormData = function createRegisterFormData(values, checkoutBod
|
|
|
1860
1866
|
bodyFormData.append('password_confirmation', values.confirmPassword);
|
|
1861
1867
|
bodyFormData.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
1862
1868
|
bodyFormData.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
1869
|
+
bodyFormData.append('check_cart_expiration', 'true');
|
|
1863
1870
|
|
|
1864
1871
|
_forEach(checkoutBody.attributes, function (item, key) {
|
|
1865
1872
|
bodyFormData.append(key, item);
|
|
@@ -2034,7 +2041,12 @@ var CustomField = function CustomField(_ref) {
|
|
|
2034
2041
|
touched = _ref$form.touched,
|
|
2035
2042
|
errors = _ref$form.errors,
|
|
2036
2043
|
submitCount = _ref$form.submitCount,
|
|
2037
|
-
theme = _ref.theme
|
|
2044
|
+
theme = _ref.theme,
|
|
2045
|
+
_ref$inputProps = _ref.inputProps,
|
|
2046
|
+
pInputProps = _ref$inputProps === void 0 ? {} : _ref$inputProps,
|
|
2047
|
+
_ref$InputProps = _ref.InputProps,
|
|
2048
|
+
InputProps = _ref$InputProps === void 0 ? {} : _ref$InputProps,
|
|
2049
|
+
inputRef = _ref.inputRef;
|
|
2038
2050
|
var isSelectField = type === 'select';
|
|
2039
2051
|
|
|
2040
2052
|
var error = _get(errors, field.name);
|
|
@@ -2044,11 +2056,6 @@ var CustomField = function CustomField(_ref) {
|
|
|
2044
2056
|
var inputProps = {
|
|
2045
2057
|
sx: customTheme == null ? void 0 : customTheme.input
|
|
2046
2058
|
};
|
|
2047
|
-
|
|
2048
|
-
if (type === 'date') {
|
|
2049
|
-
inputProps.max = moment().format('YYYY-MM-DD');
|
|
2050
|
-
}
|
|
2051
|
-
|
|
2052
2059
|
return React.createElement(TextField$1, Object.assign({
|
|
2053
2060
|
id: field.name,
|
|
2054
2061
|
label: label,
|
|
@@ -2065,10 +2072,11 @@ var CustomField = function CustomField(_ref) {
|
|
|
2065
2072
|
}
|
|
2066
2073
|
},
|
|
2067
2074
|
InputLabelProps: {
|
|
2068
|
-
sx: customTheme == null ? void 0 : customTheme.input
|
|
2069
|
-
shrink: field.name === 'holderAge' ? true : undefined
|
|
2075
|
+
sx: customTheme == null ? void 0 : customTheme.input
|
|
2070
2076
|
},
|
|
2071
|
-
|
|
2077
|
+
InputProps: InputProps,
|
|
2078
|
+
inputProps: _extends({}, inputProps, pInputProps),
|
|
2079
|
+
inputRef: inputRef
|
|
2072
2080
|
}, field), isSelectField ? _map(selectOptions, function (option) {
|
|
2073
2081
|
return React.createElement("option", {
|
|
2074
2082
|
key: option.value,
|
|
@@ -2376,6 +2384,77 @@ var SnackbarAlert = function SnackbarAlert(_ref) {
|
|
|
2376
2384
|
}, message)));
|
|
2377
2385
|
};
|
|
2378
2386
|
|
|
2387
|
+
var DATE_SIZE = 32;
|
|
2388
|
+
var compactStyles = {
|
|
2389
|
+
'& > div': {
|
|
2390
|
+
minWidth: 256
|
|
2391
|
+
},
|
|
2392
|
+
'& > div > div, & > div > div > div, & .MuiCalendarPicker-root': {
|
|
2393
|
+
width: 256
|
|
2394
|
+
},
|
|
2395
|
+
'& .MuiTypography-caption': {
|
|
2396
|
+
width: DATE_SIZE,
|
|
2397
|
+
margin: 0
|
|
2398
|
+
},
|
|
2399
|
+
'& .PrivatePickersSlideTransition-root': {
|
|
2400
|
+
minHeight: DATE_SIZE * 6
|
|
2401
|
+
},
|
|
2402
|
+
'& .PrivatePickersSlideTransition-root [role="row"]': {
|
|
2403
|
+
margin: 0
|
|
2404
|
+
},
|
|
2405
|
+
'& .MuiPickersDay-dayWithMargin': {
|
|
2406
|
+
margin: 0
|
|
2407
|
+
},
|
|
2408
|
+
'& .MuiPickersDay-root': {
|
|
2409
|
+
width: DATE_SIZE,
|
|
2410
|
+
height: DATE_SIZE
|
|
2411
|
+
}
|
|
2412
|
+
};
|
|
2413
|
+
var compactStyleTheme = /*#__PURE__*/createTheme({
|
|
2414
|
+
components: {
|
|
2415
|
+
MuiPaper: {
|
|
2416
|
+
defaultProps: {
|
|
2417
|
+
sx: compactStyles
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
});
|
|
2422
|
+
var DatePickerField = function DatePickerField(_ref) {
|
|
2423
|
+
var label = _ref.label,
|
|
2424
|
+
field = _ref.field,
|
|
2425
|
+
form = _ref.form,
|
|
2426
|
+
theme = _ref.theme,
|
|
2427
|
+
_ref$useCompact = _ref.useCompact,
|
|
2428
|
+
useCompact = _ref$useCompact === void 0 ? true : _ref$useCompact;
|
|
2429
|
+
return React.createElement(ThemeProvider, {
|
|
2430
|
+
theme: useCompact ? compactStyleTheme : {}
|
|
2431
|
+
}, React.createElement(LocalizationProvider, {
|
|
2432
|
+
dateAdapter: AdapterMoment
|
|
2433
|
+
}, React.createElement(DatePicker, {
|
|
2434
|
+
value: field.value || '',
|
|
2435
|
+
onChange: function onChange(value) {
|
|
2436
|
+
return form.setFieldValue(field.name, value);
|
|
2437
|
+
},
|
|
2438
|
+
PopperProps: {
|
|
2439
|
+
placement: 'bottom-start'
|
|
2440
|
+
},
|
|
2441
|
+
showDaysOutsideCurrentMonth: true,
|
|
2442
|
+
disableFuture: true,
|
|
2443
|
+
renderInput: function renderInput(params) {
|
|
2444
|
+
return React.createElement(CustomField, Object.assign({}, params, {
|
|
2445
|
+
inputProps: _extends({}, params.inputProps, {
|
|
2446
|
+
placeholder: 'dd/mm/yyyy'
|
|
2447
|
+
}),
|
|
2448
|
+
theme: theme,
|
|
2449
|
+
field: field,
|
|
2450
|
+
form: form,
|
|
2451
|
+
label: label,
|
|
2452
|
+
type: "tel"
|
|
2453
|
+
}));
|
|
2454
|
+
}
|
|
2455
|
+
})));
|
|
2456
|
+
};
|
|
2457
|
+
|
|
2379
2458
|
var LogicRunner = function LogicRunner(_ref) {
|
|
2380
2459
|
var values = _ref.values,
|
|
2381
2460
|
setStates = _ref.setStates,
|
|
@@ -3179,7 +3258,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3179
3258
|
validate: getValidateFunctions(element, states, props.values),
|
|
3180
3259
|
setFieldValue: props.setFieldValue,
|
|
3181
3260
|
onBlur: props.handleBlur,
|
|
3182
|
-
component: element.type === 'checkbox' ? CheckboxField : element.type === 'select' ? SelectField : element.type === 'phone' ? FormikPhoneNumberField : CustomField,
|
|
3261
|
+
component: element.type === 'checkbox' ? CheckboxField : element.type === 'select' ? SelectField : element.type === 'phone' ? FormikPhoneNumberField : element.type === 'date' ? DatePickerField : CustomField,
|
|
3183
3262
|
selectOptions: element.name === 'country' ? countries : element.name === 'state' ? states : [],
|
|
3184
3263
|
theme: theme
|
|
3185
3264
|
})));
|
|
@@ -5157,7 +5236,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5157
5236
|
|
|
5158
5237
|
var bookButtonIsDisabled = handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0;
|
|
5159
5238
|
var wrappedActionsSectionComponent = React.isValidElement(ActionsSectionComponent) ? React.cloneElement(ActionsSectionComponent, {
|
|
5160
|
-
handleGetTicketClick: handleGetTicketClick
|
|
5239
|
+
handleGetTicketClick: handleGetTicketClick,
|
|
5240
|
+
isTicketOnSale: isTicketOnSale
|
|
5161
5241
|
}) : null;
|
|
5162
5242
|
var externalUrl = event == null ? void 0 : event.redirectUrl;
|
|
5163
5243
|
var eventSaleIsNotStarted = !(event != null && event.salesStarted) && (event == null ? void 0 : event.salesStart);
|
|
@@ -6050,75 +6130,110 @@ var TicketResaleContainer = function TicketResaleContainer(_ref) {
|
|
|
6050
6130
|
onProcessTicketSuccess = _ref$onProcessTicketS === void 0 ? function () {} : _ref$onProcessTicketS,
|
|
6051
6131
|
_ref$onProcessTicketE = _ref.onProcessTicketError,
|
|
6052
6132
|
onProcessTicketError = _ref$onProcessTicketE === void 0 ? function () {} : _ref$onProcessTicketE,
|
|
6133
|
+
_ref$onDeclineTicketP = _ref.onDeclineTicketPurchaseSuccess,
|
|
6134
|
+
onDeclineTicketPurchaseSuccess = _ref$onDeclineTicketP === void 0 ? function () {} : _ref$onDeclineTicketP,
|
|
6135
|
+
_ref$onDeclineTicketP2 = _ref.onDeclineTicketPurchaseError,
|
|
6136
|
+
onDeclineTicketPurchaseError = _ref$onDeclineTicketP2 === void 0 ? function () {} : _ref$onDeclineTicketP2,
|
|
6053
6137
|
orderHash = _ref.orderHash;
|
|
6054
6138
|
var isWindowDefined = typeof window !== 'undefined';
|
|
6055
6139
|
|
|
6056
|
-
var _useState = useState(
|
|
6140
|
+
var _useState = useState(''),
|
|
6057
6141
|
error = _useState[0],
|
|
6058
6142
|
setError = _useState[1];
|
|
6059
6143
|
|
|
6144
|
+
var _useState2 = useState(''),
|
|
6145
|
+
successMessage = _useState2[0],
|
|
6146
|
+
setSuccessMessage = _useState2[1];
|
|
6147
|
+
|
|
6060
6148
|
useEffect(function () {
|
|
6061
6149
|
_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
6062
|
-
var params, hash, response, data, age_required, names_required, event_id, _error$
|
|
6150
|
+
var params, hash, isDeclined, response, _error$response, _error$response$data, _response, data, age_required, names_required, event_id, _error$response2, _error$response2$data;
|
|
6063
6151
|
|
|
6064
6152
|
return runtime_1.wrap(function _callee$(_context) {
|
|
6065
6153
|
while (1) {
|
|
6066
6154
|
switch (_context.prev = _context.next) {
|
|
6067
6155
|
case 0:
|
|
6068
6156
|
if (!isWindowDefined) {
|
|
6069
|
-
_context.next =
|
|
6157
|
+
_context.next = 38;
|
|
6070
6158
|
break;
|
|
6071
6159
|
}
|
|
6072
6160
|
|
|
6073
6161
|
params = new URL("" + window.location).searchParams;
|
|
6074
6162
|
hash = params.get('invitation_hash') || orderHash || null;
|
|
6163
|
+
isDeclined = params.get('decline') || false;
|
|
6075
6164
|
|
|
6076
6165
|
if (!hash) {
|
|
6077
|
-
_context.next =
|
|
6166
|
+
_context.next = 37;
|
|
6078
6167
|
break;
|
|
6079
6168
|
}
|
|
6080
6169
|
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6170
|
+
if (!isDeclined) {
|
|
6171
|
+
_context.next = 19;
|
|
6172
|
+
break;
|
|
6173
|
+
}
|
|
6084
6174
|
|
|
6085
|
-
|
|
6175
|
+
_context.prev = 6;
|
|
6176
|
+
_context.next = 9;
|
|
6177
|
+
return declineInvitation(hash);
|
|
6178
|
+
|
|
6179
|
+
case 9:
|
|
6086
6180
|
response = _context.sent;
|
|
6087
|
-
|
|
6181
|
+
onDeclineTicketPurchaseSuccess(response);
|
|
6182
|
+
setSuccessMessage("Thanks for letting us know! We'll offer this ticket to someone else!");
|
|
6183
|
+
_context.next = 18;
|
|
6184
|
+
break;
|
|
6185
|
+
|
|
6186
|
+
case 14:
|
|
6187
|
+
_context.prev = 14;
|
|
6188
|
+
_context.t0 = _context["catch"](6);
|
|
6189
|
+
setError(_context.t0 == null ? void 0 : (_error$response = _context.t0.response) == null ? void 0 : (_error$response$data = _error$response.data) == null ? void 0 : _error$response$data.message);
|
|
6190
|
+
onDeclineTicketPurchaseError(_context.t0.response);
|
|
6191
|
+
|
|
6192
|
+
case 18:
|
|
6193
|
+
return _context.abrupt("return");
|
|
6194
|
+
|
|
6195
|
+
case 19:
|
|
6196
|
+
_context.prev = 19;
|
|
6197
|
+
_context.next = 22;
|
|
6198
|
+
return processTicket(hash);
|
|
6199
|
+
|
|
6200
|
+
case 22:
|
|
6201
|
+
_response = _context.sent;
|
|
6202
|
+
data = _get(_response, 'data.data.attributes');
|
|
6088
6203
|
age_required = _get(data, 'age_required', false);
|
|
6089
6204
|
names_required = _get(data, 'names_required', false);
|
|
6090
6205
|
event_id = _get(data, 'event_id');
|
|
6091
|
-
onProcessTicketSuccess(
|
|
6206
|
+
onProcessTicketSuccess(_response.data);
|
|
6092
6207
|
window.location.href = "/billing/billing-info/?age_required=" + age_required + "&names_required=" + names_required + "&event_id=" + event_id;
|
|
6093
|
-
_context.next =
|
|
6208
|
+
_context.next = 35;
|
|
6094
6209
|
break;
|
|
6095
6210
|
|
|
6096
|
-
case
|
|
6097
|
-
_context.prev =
|
|
6098
|
-
_context.
|
|
6099
|
-
setError(_context.
|
|
6100
|
-
onProcessTicketError(_context.
|
|
6211
|
+
case 31:
|
|
6212
|
+
_context.prev = 31;
|
|
6213
|
+
_context.t1 = _context["catch"](19);
|
|
6214
|
+
setError(_context.t1 == null ? void 0 : (_error$response2 = _context.t1.response) == null ? void 0 : (_error$response2$data = _error$response2.data) == null ? void 0 : _error$response2$data.message);
|
|
6215
|
+
onProcessTicketError(_context.t1.response);
|
|
6101
6216
|
|
|
6102
|
-
case
|
|
6103
|
-
_context.next =
|
|
6217
|
+
case 35:
|
|
6218
|
+
_context.next = 38;
|
|
6104
6219
|
break;
|
|
6105
6220
|
|
|
6106
|
-
case
|
|
6221
|
+
case 37:
|
|
6107
6222
|
window.location.href = '/';
|
|
6108
6223
|
|
|
6109
|
-
case
|
|
6224
|
+
case 38:
|
|
6110
6225
|
case "end":
|
|
6111
6226
|
return _context.stop();
|
|
6112
6227
|
}
|
|
6113
6228
|
}
|
|
6114
|
-
}, _callee, null, [[
|
|
6229
|
+
}, _callee, null, [[6, 14], [19, 31]]);
|
|
6115
6230
|
}))();
|
|
6116
6231
|
}, []);
|
|
6117
6232
|
return React.createElement("div", {
|
|
6118
6233
|
className: "ticket-resale-page"
|
|
6119
6234
|
}, React.createElement("div", {
|
|
6120
|
-
className: "error-block
|
|
6121
|
-
}, React.createElement("h3", null, error)));
|
|
6235
|
+
className: "" + (successMessage ? 'success-block' : 'error-block')
|
|
6236
|
+
}, React.createElement("h3", null, successMessage ? successMessage : error)));
|
|
6122
6237
|
};
|
|
6123
6238
|
|
|
6124
6239
|
var style$3 = {
|