tf-checkout-react 1.4.20 → 1.4.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.
Files changed (59) hide show
  1. package/README.md +462 -229
  2. package/dist/api/guestTicketDelegation.d.ts +47 -0
  3. package/dist/api/index.d.ts +2 -2
  4. package/dist/components/common/CustomField.d.ts +1 -1
  5. package/dist/components/common/FieldSection/index.d.ts +19 -0
  6. package/dist/components/common/FieldSection/utils/index.d.ts +8 -0
  7. package/dist/components/common/index.d.ts +2 -2
  8. package/dist/components/confirmModal/index.d.ts +2 -2
  9. package/dist/components/delegationsContainer/IssueComponent.d.ts +10 -0
  10. package/dist/components/delegationsContainer/IssueTicketForm.d.ts +9 -0
  11. package/dist/components/delegationsContainer/TicketsAssignedTable.d.ts +11 -0
  12. package/dist/components/delegationsContainer/TicketsAvailableTable.d.ts +11 -0
  13. package/dist/components/delegationsContainer/index.d.ts +10 -0
  14. package/dist/components/idVerificationContainer/constants.d.ts +1 -0
  15. package/dist/components/index.d.ts +1 -0
  16. package/dist/components/loginForm/index.d.ts +45 -0
  17. package/dist/components/registerForm/adapters/index.d.ts +4 -0
  18. package/dist/components/registerForm/constants.d.ts +1 -0
  19. package/dist/components/registerForm/index.d.ts +16 -0
  20. package/dist/index.d.ts +3 -1
  21. package/dist/tf-checkout-react.cjs.development.js +1413 -283
  22. package/dist/tf-checkout-react.cjs.development.js.map +1 -1
  23. package/dist/tf-checkout-react.cjs.production.min.js +1 -1
  24. package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
  25. package/dist/tf-checkout-react.esm.js +1416 -288
  26. package/dist/tf-checkout-react.esm.js.map +1 -1
  27. package/dist/utils/form.d.ts +3 -0
  28. package/dist/utils/index.d.ts +3 -1
  29. package/dist/utils/replaceVarInString.d.ts +1 -0
  30. package/package.json +1 -1
  31. package/src/api/guestTicketDelegation.ts +79 -0
  32. package/src/api/index.ts +3 -2
  33. package/src/components/billing-info-container/utils.ts +1 -1
  34. package/src/components/common/CustomField.tsx +2 -0
  35. package/src/components/common/FieldSection/index.tsx +141 -0
  36. package/src/components/common/FieldSection/utils/index.tsx +92 -0
  37. package/src/components/common/SelectField/index.tsx +1 -1
  38. package/src/components/common/index.tsx +2 -2
  39. package/src/components/confirmModal/index.tsx +2 -2
  40. package/src/components/delegationsContainer/IssueComponent.tsx +155 -0
  41. package/src/components/delegationsContainer/IssueTicketForm.tsx +109 -0
  42. package/src/components/delegationsContainer/TicketsAssignedTable.tsx +55 -0
  43. package/src/components/delegationsContainer/TicketsAvailableTable.tsx +54 -0
  44. package/src/components/delegationsContainer/index.tsx +83 -0
  45. package/src/components/forgotPasswordModal/index.tsx +3 -9
  46. package/src/components/idVerificationContainer/constants.ts +5 -2
  47. package/src/components/index.ts +1 -0
  48. package/src/components/loginForm/index.tsx +195 -0
  49. package/src/components/registerForm/adapters/index.tsx +10 -0
  50. package/src/components/registerForm/constants.tsx +96 -0
  51. package/src/components/registerForm/index.tsx +192 -0
  52. package/src/index.ts +3 -4
  53. package/src/types/api/auth.d.ts +55 -0
  54. package/src/types/api/guestTicketDelegation.d.ts +18 -0
  55. package/src/types/formFields.d.ts +29 -0
  56. package/src/utils/form.ts +34 -0
  57. package/src/utils/index.ts +3 -1
  58. package/src/utils/replaceVarInString.ts +9 -0
  59. package/src/validators/index.ts +2 -2
@@ -0,0 +1,47 @@
1
+ export declare const getCustomerExistsData: (accessHash: string) => Promise<ICheckCustomerExistsData>;
2
+ interface IDelegationTicketType {
3
+ delegationMaxQuantity: number | string;
4
+ }
5
+ interface IIssueTicketResponseData {
6
+ delegationName: string;
7
+ eventImage: string;
8
+ eventName: string;
9
+ ticketTypes: {
10
+ [key: number]: IDelegationTicketType;
11
+ };
12
+ }
13
+ interface IIssueTicketResponse {
14
+ data: {
15
+ attributes: IIssueTicketResponseData;
16
+ relationships: Array<any>;
17
+ type: string;
18
+ message: string;
19
+ };
20
+ }
21
+ export interface IDelegationsTicketType {
22
+ [key: number]: {
23
+ delegationMaxQuantity: string | number;
24
+ delegationQuantityIssued: string | number;
25
+ matrixRecordId: string | number;
26
+ optionValue: string | number;
27
+ };
28
+ }
29
+ export interface IDelegationsData {
30
+ delegationName: string;
31
+ eventImage: string;
32
+ eventName: string;
33
+ ticketTypes: IDelegationsTicketType;
34
+ tickets: Array<any>;
35
+ }
36
+ interface IDelegationsResponse {
37
+ data: {
38
+ data: {
39
+ attributes: IDelegationsData;
40
+ relationships: Array<any>;
41
+ type: string;
42
+ };
43
+ };
44
+ }
45
+ export declare const getDelegationTickets: (accessHash: string) => Promise<IDelegationsResponse>;
46
+ export declare const issueTicket: (accessHash: string, data: ITicketIssueData) => Promise<IIssueTicketResponse>;
47
+ export {};
@@ -1,6 +1,7 @@
1
1
  import { AxiosResponse } from 'axios';
2
2
  import { pageOptions } from '../hooks/usePixel';
3
3
  import { GetNetverifyUrlResponseData, UpdateVerificationStatusResponseData, VerificationStatusResponseData } from '../types/verification';
4
+ export { issueTicket, getDelegationTickets } from './guestTicketDelegation';
4
5
  export declare const setCustomHeader: (response: any) => void;
5
6
  export declare const handleSetAccessToken: (token: string) => void;
6
7
  export declare function getEvent(id: string | number, pk?: string): Promise<AxiosResponse<any, any>>;
@@ -22,7 +23,7 @@ export declare const handleFreeSuccess: (orderHash: string) => Promise<AxiosResp
22
23
  export declare const getProfileData: (accessToken?: string | undefined) => Promise<any>;
23
24
  export declare const getCountries: () => Promise<AxiosResponse<any, any>>;
24
25
  export declare const getConfirmationData: (orderHash: string) => Promise<AxiosResponse<any, any>>;
25
- export declare const getStates: (countryId: string) => Promise<AxiosResponse<any, any>>;
26
+ export declare const getStates: (countryId: string | number) => Promise<AxiosResponse<any, any>>;
26
27
  export declare const getOrders: (page: number, limit: number, eventSlug: string) => Promise<AxiosResponse<any, any>>;
27
28
  export declare const getOrderDetails: (orderId: string) => Promise<AxiosResponse<any, any>>;
28
29
  export declare const addToWaitingList: (id: number, data: any) => Promise<AxiosResponse<any, any>>;
@@ -91,4 +92,3 @@ export declare const updateVerificationStatus: () => Promise<{
91
92
  data: UpdateVerificationStatusResponseData;
92
93
  }>;
93
94
  export declare const checkCustomerOrder: (orderHash: string) => Promise<any>;
94
- export {};
@@ -22,4 +22,4 @@ export interface ICustomField {
22
22
  export interface IOtherProps {
23
23
  [key: string]: any;
24
24
  }
25
- export declare const CustomField: ({ label, type, field, selectOptions, form: { touched, errors, submitCount }, theme, inputProps: pInputProps, InputProps, inputRef, multiline, minRows, maxRows, }: ICustomField & IOtherProps) => JSX.Element;
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;
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import { FormikValues } from 'formik';
3
+ export interface IFieldsSectionProps {
4
+ formFields?: IFormFieldsSection[];
5
+ values: FormikValues;
6
+ setFieldValue: (field: string, value: FormikValues | string | number, shouldValidate?: boolean | undefined) => void;
7
+ disableField?: string;
8
+ countries?: {
9
+ [key: string]: string | number;
10
+ }[];
11
+ states?: {
12
+ [key: string]: string | number;
13
+ }[];
14
+ theme?: 'dark' | 'light';
15
+ containerClass?: string;
16
+ setPhoneValidationIsLoading?: (isLoading: boolean) => void;
17
+ onFieldChange?: (name: string, value: string | number) => void;
18
+ }
19
+ export declare const FieldsSection: ({ formFields, countries, states, values, setFieldValue, theme, containerClass, setPhoneValidationIsLoading, onFieldChange, disableField, }: IFieldsSectionProps) => JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { FormikValues } from 'formik';
2
+ export declare const getValidateFunctions: ({ element, values, }: {
3
+ element: IFormField;
4
+ values: FormikValues;
5
+ }) => (...value: any) => any;
6
+ export declare const updateFormFieldsAttributes: (formFields: IFormFieldsSection[], attributes?: IFieldAttribute | undefined) => IFormFieldsSection[];
7
+ export declare const getFieldClassNames: (id: string, existingClassNames: string) => string;
8
+ export declare const insertHTML: (elementId: string, text?: string) => null;
@@ -3,7 +3,7 @@ export { CustomField } from './CustomField';
3
3
  export { FormikPhoneNumberField } from './FormikPhoneNumberField';
4
4
  export { PhoneNumberField } from './PhoneNumberField';
5
5
  export { Loader } from './Loader';
6
- export { NativeSelectField } from './NativeSelectFeild';
7
- export { RadioGroupField } from './RadioGroupField';
8
6
  export { SelectField } from './SelectField';
9
7
  export { DatePickerField } from './DatePickerField';
8
+ export { NativeSelectField } from './NativeSelectFeild';
9
+ export { RadioGroupField } from './RadioGroupField';
@@ -3,8 +3,8 @@ interface Props {
3
3
  message: string;
4
4
  loading?: boolean;
5
5
  hideCancelBtn?: boolean;
6
- onClose: () => void;
7
- onConfirm: () => void;
6
+ onClose?: () => void;
7
+ onConfirm?: () => void;
8
8
  }
9
9
  declare const ConfirmModal: FC<Props>;
10
10
  export default ConfirmModal;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { AxiosError } from 'axios';
3
+ export interface IssueTicketData {
4
+ headTitle?: string;
5
+ classNamePrefix?: string;
6
+ onGetIssuePageDataSuccess?: () => void;
7
+ onGetIssuePageDataError?: (e: AxiosError) => void;
8
+ }
9
+ declare const IssueComponent: ({ classNamePrefix, headTitle, onGetIssuePageDataSuccess, onGetIssuePageDataError, }: IssueTicketData) => JSX.Element;
10
+ export default IssueComponent;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ export interface IIssueTicketForm {
3
+ classNamePrefix?: string;
4
+ handleSubmit: (values: any, resetForm: any) => void;
5
+ selectTicketTypeOptions: Array<any>;
6
+ initialValues?: any;
7
+ }
8
+ declare const IssueTicketForm: ({ classNamePrefix, handleSubmit, selectTicketTypeOptions, initialValues, }: IIssueTicketForm) => JSX.Element;
9
+ export default IssueTicketForm;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ export interface ITicketsAssignedTable {
3
+ tableTitle?: string;
4
+ classNamePrefix?: string;
5
+ noTicketsAssignedText?: string;
6
+ issuePageData: {
7
+ tickets: Array<any>;
8
+ };
9
+ }
10
+ declare const TicketsAssignedTable: ({ tableTitle, classNamePrefix, issuePageData, noTicketsAssignedText, }: ITicketsAssignedTable) => JSX.Element;
11
+ export default TicketsAssignedTable;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { IDelegationsTicketType } from '../../api/guestTicketDelegation';
3
+ export interface ITicketsAvailableTable {
4
+ tableTitle?: string;
5
+ classNamePrefix?: string;
6
+ issuePageData: {
7
+ ticketTypes: IDelegationsTicketType;
8
+ };
9
+ }
10
+ declare const TicketsAvailableTable: ({ tableTitle, classNamePrefix, issuePageData, }: ITicketsAvailableTable) => JSX.Element;
11
+ export default TicketsAvailableTable;
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ interface IRegistrationProps {
3
+ registerFormFields?: Array<IFormFieldsSection>;
4
+ classNamePrefix?: string;
5
+ logo?: string;
6
+ onCustomerExistsError?: (error: any) => void;
7
+ issuePageErrorText?: string;
8
+ }
9
+ export declare const DelegationsContainer: FC<IRegistrationProps>;
10
+ export {};
@@ -14,3 +14,4 @@ export declare const VERIFICATION_MESSAGES: {
14
14
  FAILED: string;
15
15
  WRONG_CUSTOMER: string;
16
16
  };
17
+ export declare const DELEGATION_ACCESS_ERROR = "Delegation Access not found";
@@ -7,5 +7,6 @@ export { OrderDetailsContainer } from './orderDetailsContainer';
7
7
  export { ResetPasswordContainer } from './resetPasswordContainer';
8
8
  export { TicketResaleContainer } from './ticketResale';
9
9
  export { AddonsContainter } from './addonsContainer';
10
+ export { DelegationsContainer } from './delegationsContainer';
10
11
  export { SeatMapContainer } from './seatMapContainer';
11
12
  export { IDVerification } from './idVerificationContainer';
@@ -0,0 +1,45 @@
1
+ import { AxiosError } from 'axios';
2
+ import { FC } from 'react';
3
+ export interface ILoginFormProps {
4
+ alreadyHasUser?: boolean;
5
+ userExpired?: boolean;
6
+ onLoginSuccess?: (res: IProfileData) => void;
7
+ onLoginError?: (e: AxiosError) => void;
8
+ onGetProfileDataSuccess?: (res: IProfileData) => void;
9
+ onGetProfileDataError?: (e: AxiosError) => void;
10
+ onForgotPasswordButtonClick?: () => void;
11
+ onSignupButtonClick?: () => void;
12
+ logo?: string;
13
+ showForgotPasswordButton?: boolean;
14
+ showSignUpButton?: boolean;
15
+ }
16
+ interface IUserData {
17
+ id: string;
18
+ firstName: string;
19
+ lastName: string;
20
+ email: string;
21
+ city?: string;
22
+ country?: string;
23
+ countryId?: string;
24
+ phone?: string;
25
+ streetAddress?: string;
26
+ state?: string;
27
+ zip?: string;
28
+ zipCode?: string;
29
+ stateId?: string;
30
+ }
31
+ export declare const setLoggedUserData: (data: IUserData) => {
32
+ id: string;
33
+ first_name: string;
34
+ last_name: string;
35
+ email: string;
36
+ confirmEmail: string;
37
+ city: string;
38
+ country: string;
39
+ phone: string;
40
+ street_address: string;
41
+ state: string;
42
+ zip: string;
43
+ };
44
+ export declare const LoginForm: FC<ILoginFormProps>;
45
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const collectStates: (states: any) => {
2
+ label: any;
3
+ value: string;
4
+ }[];
@@ -0,0 +1 @@
1
+ export declare const formDefaultFields: IFormFieldsSection[];
@@ -0,0 +1,16 @@
1
+ import { AxiosError } from 'axios';
2
+ import { FC } from 'react';
3
+ interface IRegistrationProps {
4
+ formFields?: Array<IFormFieldsSection>;
5
+ additionalFieldAttribute?: IFieldAttribute;
6
+ registrationType: string;
7
+ onGetCountriesSuccess?: (res: any) => void;
8
+ onGetCountriesError?: (e: AxiosError) => void;
9
+ onRegisterAccountSuccess?: (res: any) => void;
10
+ onRegisterAccountError?: (e: AxiosError) => void;
11
+ onGetStatesSuccess?: (res: any) => void;
12
+ onGetStatesError?: (e: AxiosError) => void;
13
+ customerEmail: string;
14
+ }
15
+ export declare const RegistrationForm: FC<IRegistrationProps>;
16
+ export {};
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export { BillingInfoContainer } from './components/billing-info-container/index'
2
2
  export { PaymentContainer } from './components/paymentContainer/index';
3
3
  export { ConfirmationContainer } from './components/confirmationContainer/index';
4
4
  export { TicketsContainer } from './components/ticketsContainer/index';
5
- export { currencyNormalizerCreator, createFixedFloatNormalizer, } from './normalizers';
5
+ export { currencyNormalizerCreator, createFixedFloatNormalizer } from './normalizers';
6
6
  export { LoginModal } from './components/loginModal';
7
7
  export { MyTicketsContainer } from './components/myTicketsContainer';
8
8
  export { OrderDetailsContainer } from './components/orderDetailsContainer';
@@ -13,7 +13,9 @@ export { RsvpContainer } from './components/rsvpContainer';
13
13
  export { ResetPasswordContainer } from './components/resetPasswordContainer';
14
14
  export { ForgotPasswordModal } from './components/forgotPasswordModal';
15
15
  export { AddonsContainter } from './components/addonsContainer';
16
+ export { DelegationsContainer } from './components/delegationsContainer';
16
17
  export { PoweredBy } from './components/common/PoweredBy';
17
18
  export { SeatMapContainer } from './components/seatMapContainer';
18
19
  export { IDVerification } from './components/idVerificationContainer';
19
20
  export { VERIFICATION_STATUSES } from './components/idVerificationContainer/constants';
21
+ export { useCookieListener } from './hooks/useCookieListener';