tf-checkout-react 1.5.1 → 1.5.2
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/common/CustomField.d.ts +3 -2
- package/dist/tf-checkout-react.cjs.development.js +74 -61
- 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 +74 -61
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/common/CustomField.tsx +3 -0
- package/src/components/waitingList/index.tsx +86 -63
- package/src/env.ts +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FieldInputProps, FormikProps } from 'formik';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
export interface ISelectOption {
|
|
4
4
|
label: string | number;
|
|
5
5
|
value?: string | number;
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
}
|
|
8
8
|
export interface ICustomField {
|
|
9
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
9
10
|
label: string;
|
|
10
11
|
field: FieldInputProps<any>;
|
|
11
12
|
form: FormikProps<any>;
|
|
@@ -22,4 +23,4 @@ export interface ICustomField {
|
|
|
22
23
|
export interface IOtherProps {
|
|
23
24
|
[key: string]: any;
|
|
24
25
|
}
|
|
25
|
-
export declare const CustomField: ({ label, type, field, selectOptions, form: { touched, errors, submitCount }, theme, inputProps: pInputProps, InputProps, inputRef, multiline, minRows, maxRows, disabled, }: ICustomField & IOtherProps) => JSX.Element;
|
|
26
|
+
export declare const CustomField: ({ label, type, field, selectOptions, form: { touched, errors, submitCount }, theme, inputProps: pInputProps, InputProps, inputRef, onChange, multiline, minRows, maxRows, disabled, }: ICustomField & IOtherProps) => JSX.Element;
|
|
@@ -2054,6 +2054,7 @@ var CustomField = function CustomField(_ref2) {
|
|
|
2054
2054
|
_ref2$InputProps = _ref2.InputProps,
|
|
2055
2055
|
InputProps = _ref2$InputProps === void 0 ? {} : _ref2$InputProps,
|
|
2056
2056
|
inputRef = _ref2.inputRef,
|
|
2057
|
+
onChange = _ref2.onChange,
|
|
2057
2058
|
_ref2$multiline = _ref2.multiline,
|
|
2058
2059
|
multiline = _ref2$multiline === void 0 ? false : _ref2$multiline,
|
|
2059
2060
|
minRows = _ref2.minRows,
|
|
@@ -2114,7 +2115,8 @@ var CustomField = function CustomField(_ref2) {
|
|
|
2114
2115
|
if (field.onBlur) {
|
|
2115
2116
|
field.onBlur(e);
|
|
2116
2117
|
}
|
|
2117
|
-
}
|
|
2118
|
+
},
|
|
2119
|
+
onChange: onChange != null ? onChange : field.onChange
|
|
2118
2120
|
}), isSelectField ? _map(selectOptions, function (option) {
|
|
2119
2121
|
return React__default.createElement("option", {
|
|
2120
2122
|
key: option.value,
|
|
@@ -6037,66 +6039,77 @@ var WaitingList = function WaitingList(_ref) {
|
|
|
6037
6039
|
email: userData.email || ''
|
|
6038
6040
|
},
|
|
6039
6041
|
onSubmit: handleSubmit
|
|
6040
|
-
},
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6042
|
+
}, function (_ref3) {
|
|
6043
|
+
var values = _ref3.values,
|
|
6044
|
+
setFieldValue = _ref3.setFieldValue;
|
|
6045
|
+
var selectedTicket = _find(tickets, function (n) {
|
|
6046
|
+
return n.id === values.ticketTypeId;
|
|
6047
|
+
});
|
|
6048
|
+
return React__default.createElement(formik.Form, null, React__default.createElement(ErrorFocus, null), showTicketsField && React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
6049
|
+
className: "field-item"
|
|
6050
|
+
}, React__default.createElement(formik.Field, {
|
|
6051
|
+
name: "ticketTypeId",
|
|
6052
|
+
label: "Type of Ticket",
|
|
6053
|
+
type: "select",
|
|
6054
|
+
component: CustomField,
|
|
6055
|
+
onChange: function onChange(e) {
|
|
6056
|
+
setFieldValue('ticketTypeId', e.target.value);
|
|
6057
|
+
setFieldValue('quantity', '');
|
|
6058
|
+
},
|
|
6059
|
+
selectOptions: [{
|
|
6060
|
+
label: 'Type of Ticket',
|
|
6061
|
+
value: '',
|
|
6062
|
+
disabled: true
|
|
6063
|
+
}].concat(ticketTypesList)
|
|
6064
|
+
})), React__default.createElement("div", {
|
|
6065
|
+
className: "field-item"
|
|
6066
|
+
}, React__default.createElement(formik.Field, {
|
|
6067
|
+
name: "quantity",
|
|
6068
|
+
label: "Quantity Requested",
|
|
6069
|
+
type: "select",
|
|
6070
|
+
component: CustomField,
|
|
6071
|
+
selectOptions: [{
|
|
6072
|
+
label: 'Quantity Requested',
|
|
6073
|
+
value: '',
|
|
6074
|
+
disabled: true
|
|
6075
|
+
}].concat(generateQuantity((selectedTicket == null ? void 0 : selectedTicket.waitingListMaxQuantity) || (defaultMaxQuantity != null ? defaultMaxQuantity : 10)))
|
|
6076
|
+
}))), React__default.createElement("div", {
|
|
6077
|
+
className: "field-item"
|
|
6078
|
+
}, React__default.createElement(formik.Field, {
|
|
6079
|
+
name: "firstName",
|
|
6080
|
+
label: "First name",
|
|
6081
|
+
validate: function validate(value) {
|
|
6082
|
+
return requiredValidator(value, 'Please enter your First name');
|
|
6083
|
+
},
|
|
6084
|
+
component: CustomField
|
|
6085
|
+
})), React__default.createElement("div", {
|
|
6086
|
+
className: "field-item"
|
|
6087
|
+
}, React__default.createElement(formik.Field, {
|
|
6088
|
+
name: "lastName",
|
|
6089
|
+
label: "Last name",
|
|
6090
|
+
validate: function validate(value) {
|
|
6091
|
+
return requiredValidator(value, 'Please enter your Last name');
|
|
6092
|
+
},
|
|
6093
|
+
component: CustomField
|
|
6094
|
+
})), React__default.createElement("div", {
|
|
6095
|
+
className: "field-item"
|
|
6096
|
+
}, React__default.createElement(formik.Field, {
|
|
6097
|
+
name: "email",
|
|
6098
|
+
label: "Email",
|
|
6099
|
+
validate: combineValidators(function (value) {
|
|
6100
|
+
return requiredValidator(value, 'Please enter your Email');
|
|
6101
|
+
}, function (value) {
|
|
6102
|
+
return emailValidator(value);
|
|
6103
|
+
}),
|
|
6104
|
+
component: CustomField
|
|
6105
|
+
})), React__default.createElement(Button, {
|
|
6106
|
+
type: "submit",
|
|
6107
|
+
variant: "contained",
|
|
6108
|
+
className: "waiting-list-button"
|
|
6109
|
+
}, loading ? React__default.createElement(CircularProgress, {
|
|
6110
|
+
size: "22px"
|
|
6111
|
+
}) : 'ADD TO WAITING LIST'));
|
|
6112
|
+
})));
|
|
6100
6113
|
};
|
|
6101
6114
|
|
|
6102
6115
|
// This section is seperate because additional changes layter may be applied to Access Code
|