tf-checkout-react 1.3.42 → 1.3.43
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/utils.d.ts +4 -0
- package/dist/components/common/CheckboxField.d.ts +1 -1
- package/dist/components/common/CustomField.d.ts +5 -3
- package/dist/components/common/DatePickerField.d.ts +1 -1
- package/dist/components/common/RadioGroupField/index.d.ts +5 -5
- package/dist/components/common/SelectField/index.d.ts +3 -2
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/ticketsContainer/PromoCodeSection.d.ts +2 -1
- package/dist/components/ticketsContainer/index.d.ts +2 -1
- package/dist/tf-checkout-react.cjs.development.js +979 -898
- 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 +1004 -923
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/{dist → src/components}/.DS_Store +0 -0
- package/src/components/billing-info-container/index.tsx +21 -68
- package/src/components/billing-info-container/utils.ts +81 -12
- package/src/components/common/CheckboxField.tsx +2 -0
- package/src/components/common/CustomField.tsx +10 -1
- package/src/components/common/DatePickerField.tsx +40 -37
- package/src/components/common/RadioGroupField/index.tsx +13 -8
- package/src/components/common/SelectField/index.tsx +33 -9
- package/src/components/common/dist/PhoneNumberField.js +96 -0
- package/src/components/common/index.tsx +1 -0
- package/src/components/ticketsContainer/PromoCodeSection.tsx +4 -2
- package/src/components/ticketsContainer/index.tsx +6 -1
- package/src/assets/.DS_Store +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.__esModule = true;
|
|
50
|
+
exports.PhoneNumberField = void 0;
|
|
51
|
+
var TextField_1 = require("@mui/material/TextField");
|
|
52
|
+
var debounce_1 = require("lodash/debounce");
|
|
53
|
+
var get_1 = require("lodash/get");
|
|
54
|
+
var react_1 = require("react");
|
|
55
|
+
var api_1 = require("../../api");
|
|
56
|
+
exports.PhoneNumberField = function (_a) {
|
|
57
|
+
var label = _a.label, _b = _a.type, type = _b === void 0 ? 'text' : _b, field = _a.field, _c = _a.form, errors = _c.errors, setFieldError = _c.setFieldError, setStatus = _c.setStatus;
|
|
58
|
+
var error = get_1["default"](errors, field.name);
|
|
59
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
60
|
+
var debounceCb = react_1.useCallback(debounce_1["default"](function (cb) { return void cb(); }, 1000), []);
|
|
61
|
+
react_1.useEffect(function () {
|
|
62
|
+
var _a;
|
|
63
|
+
if (field.value) {
|
|
64
|
+
setStatus((_a = {}, _a[field.name] = true, _a));
|
|
65
|
+
}
|
|
66
|
+
debounceCb(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
67
|
+
var error_1, message;
|
|
68
|
+
var _a;
|
|
69
|
+
return __generator(this, function (_b) {
|
|
70
|
+
switch (_b.label) {
|
|
71
|
+
case 0:
|
|
72
|
+
_b.trys.push([0, 3, 4, 5]);
|
|
73
|
+
if (!field.value) return [3 /*break*/, 2];
|
|
74
|
+
return [4 /*yield*/, api_1.validatePhoneNumber(field.value)];
|
|
75
|
+
case 1:
|
|
76
|
+
_b.sent();
|
|
77
|
+
_b.label = 2;
|
|
78
|
+
case 2:
|
|
79
|
+
setFieldError(field.name, '');
|
|
80
|
+
return [3 /*break*/, 5];
|
|
81
|
+
case 3:
|
|
82
|
+
error_1 = _b.sent();
|
|
83
|
+
message = get_1["default"](error_1, 'response.data.message', 'Invalid phone number');
|
|
84
|
+
setFieldError(field.name, message);
|
|
85
|
+
return [3 /*break*/, 5];
|
|
86
|
+
case 4:
|
|
87
|
+
setStatus((_a = {}, _a[field.name] = false, _a));
|
|
88
|
+
return [7 /*endfinally*/];
|
|
89
|
+
case 5: return [2 /*return*/];
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}); });
|
|
93
|
+
// eslint-disable-next-line
|
|
94
|
+
}, [field.value]);
|
|
95
|
+
return (react_1["default"].createElement(TextField_1["default"], __assign({}, field, { id: field.name, label: label, type: type, fullWidth: true, error: !!error, helperText: error, value: field.value || '', inputProps: { pattern: '[+0-9]/d+' } })));
|
|
96
|
+
};
|
|
@@ -14,6 +14,7 @@ export interface IPromoCodeSectionProps {
|
|
|
14
14
|
setCodeIsApplied: (value: boolean) => void;
|
|
15
15
|
codeIsInvalid: boolean;
|
|
16
16
|
setCodeIsInvalid: (value: boolean) => void;
|
|
17
|
+
promoText?: string;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export const PromoCodeSection = ({
|
|
@@ -25,7 +26,8 @@ export const PromoCodeSection = ({
|
|
|
25
26
|
updateTickets,
|
|
26
27
|
setCodeIsApplied,
|
|
27
28
|
codeIsInvalid,
|
|
28
|
-
setCodeIsInvalid
|
|
29
|
+
setCodeIsInvalid,
|
|
30
|
+
promoText,
|
|
29
31
|
}: IPromoCodeSectionProps) => {
|
|
30
32
|
const isPromoCodeHasValue = !!code.trim()
|
|
31
33
|
|
|
@@ -92,7 +94,7 @@ export const PromoCodeSection = ({
|
|
|
92
94
|
setCodeIsInvalid(false)
|
|
93
95
|
}}
|
|
94
96
|
>
|
|
95
|
-
Got a promo code? Click here
|
|
97
|
+
{promoText ?? 'Got a promo code? Click here'}
|
|
96
98
|
</Button>
|
|
97
99
|
)}
|
|
98
100
|
{showPromoInput && renderInputField()}
|
|
@@ -95,6 +95,7 @@ export interface IGetTickets {
|
|
|
95
95
|
enableInfluencersSection?: boolean;
|
|
96
96
|
enableAddOns?: boolean;
|
|
97
97
|
ordersPath?: string;
|
|
98
|
+
promoText?: string;
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
export interface ITicket {
|
|
@@ -142,6 +143,7 @@ export const TicketsContainer = ({
|
|
|
142
143
|
handleNotInvitedModalClose = _identity,
|
|
143
144
|
handleInvalidLinkModalClose = _identity,
|
|
144
145
|
ordersPath,
|
|
146
|
+
promoText,
|
|
145
147
|
}: IGetTickets) => {
|
|
146
148
|
const [selectedTickets, setSelectedTickets] = useState({} as ISelectedTickets)
|
|
147
149
|
const isWindowDefined = typeof window !== 'undefined'
|
|
@@ -529,6 +531,8 @@ export const TicketsContainer = ({
|
|
|
529
531
|
setIsInvalidLinkError('')
|
|
530
532
|
}
|
|
531
533
|
|
|
534
|
+
const hideTopInfluencers = event?.hideTopInfluencers
|
|
535
|
+
|
|
532
536
|
return (
|
|
533
537
|
<ThemeProvider theme={themeMui}>
|
|
534
538
|
{!isLoading && <ReferralLogic eventId={eventId} />}
|
|
@@ -621,6 +625,7 @@ export const TicketsContainer = ({
|
|
|
621
625
|
updateTickets={updateTickets}
|
|
622
626
|
codeIsInvalid={codeIsInvalid}
|
|
623
627
|
setCodeIsInvalid={setCodeIsInvalid}
|
|
628
|
+
promoText={promoText}
|
|
624
629
|
/>
|
|
625
630
|
) : null}
|
|
626
631
|
{wrappedActionsSectionComponent}
|
|
@@ -667,7 +672,7 @@ export const TicketsContainer = ({
|
|
|
667
672
|
<LoginModal onClose={handleOnClose} onLogin={handleOnLogin} />
|
|
668
673
|
) : null}
|
|
669
674
|
</div>
|
|
670
|
-
{enableInfluencersSection && influencers.length ? (
|
|
675
|
+
{enableInfluencersSection && !hideTopInfluencers && influencers.length ? (
|
|
671
676
|
<div className="event-influencers">
|
|
672
677
|
<h3>
|
|
673
678
|
<span>TOP</span> INFLUENCERS
|
package/src/assets/.DS_Store
DELETED
|
Binary file
|