tf-checkout-react 1.3.11 → 1.3.12-beta.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.
Files changed (43) hide show
  1. package/dist/api/index.d.ts +1 -0
  2. package/dist/components/billing-info-container/index.d.ts +1 -3
  3. package/dist/components/forgotPasswordModal/index.d.ts +4 -5
  4. package/dist/components/loginForm/index.d.ts +45 -0
  5. package/dist/components/loginModal/index.d.ts +5 -43
  6. package/dist/components/preRegistration/FieldsSection.d.ts +13 -0
  7. package/dist/components/preRegistration/constants.d.ts +2 -0
  8. package/dist/components/preRegistration/index.d.ts +10 -0
  9. package/dist/components/preRegistration/utils.d.ts +9 -0
  10. package/dist/hooks/useCookieListener.d.ts +1 -0
  11. package/dist/hooks/useEventListener.d.ts +1 -0
  12. package/dist/index.d.ts +1 -0
  13. package/dist/tf-checkout-react.cjs.development.js +706 -90
  14. package/dist/tf-checkout-react.cjs.development.js.map +1 -1
  15. package/dist/tf-checkout-react.cjs.production.min.js +1 -1
  16. package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
  17. package/dist/tf-checkout-react.esm.js +707 -92
  18. package/dist/tf-checkout-react.esm.js.map +1 -1
  19. package/dist/utils/index.d.ts +1 -0
  20. package/dist/utils/replaceVarInString.d.ts +1 -0
  21. package/package.json +1 -1
  22. package/src/.DS_Store +0 -0
  23. package/src/api/index.ts +15 -0
  24. package/src/components/.DS_Store +0 -0
  25. package/src/components/billing-info-container/index.tsx +9 -8
  26. package/src/components/common/SelectField.tsx +1 -1
  27. package/src/components/common/dist/PhoneNumberField.js +96 -0
  28. package/src/components/forgotPasswordModal/index.tsx +12 -14
  29. package/src/components/loginForm/index.tsx +195 -0
  30. package/src/components/loginModal/index.tsx +39 -184
  31. package/src/components/preRegistration/FieldsSection.tsx +136 -0
  32. package/src/components/preRegistration/constants.tsx +155 -0
  33. package/src/components/preRegistration/index.tsx +219 -0
  34. package/src/components/preRegistration/utils.ts +95 -0
  35. package/src/hooks/useCookieListener.ts +32 -0
  36. package/src/hooks/useEventListener.ts +32 -0
  37. package/src/index.ts +2 -1
  38. package/src/types/api/auth.d.ts +55 -0
  39. package/src/types/api/preRegistration.d.ts +11 -0
  40. package/src/types/formFields.d.ts +30 -0
  41. package/src/utils/cookies.ts +7 -7
  42. package/src/utils/index.ts +1 -0
  43. package/src/utils/replaceVarInString.ts +9 -0
@@ -42,4 +42,5 @@ export declare const validatePhoneNumber: (phone: string) => Promise<any>;
42
42
  export declare const getAddons: (eventId: string) => Promise<any>;
43
43
  export declare const selectAddons: (data: any) => void;
44
44
  export declare const getCheckoutPageConfigs: () => Promise<any>;
45
+ export declare const confirmPreRegistration: (eventId: string | number, data: IConfirmPreRegistrationRequestData) => Promise<any>;
45
46
  export {};
@@ -20,8 +20,6 @@ export interface IBillingInfoPage {
20
20
  onGetStatesError?: (e: AxiosError) => void;
21
21
  onGetProfileDataSuccess?: (res: any) => void;
22
22
  onGetProfileDataError?: (e: AxiosError) => void;
23
- onAuthorizeSuccess?: () => void;
24
- onAuthorizeError?: (e: AxiosError) => void;
25
23
  onLogin?: () => void;
26
24
  onLoginSuccess?: () => void;
27
25
  onErrorClose?: () => void;
@@ -49,4 +47,4 @@ export interface IBillingInfoPage {
49
47
  showSignUpButton?: boolean;
50
48
  brandOptIn?: boolean;
51
49
  }
52
- export declare const BillingInfoContainer: React.MemoExoticComponent<({ data, ticketHoldersFields, initialValues, buttonName, handleSubmit, theme, onRegisterSuccess, onRegisterError, onSubmitError, onGetCartSuccess, onGetCartError, onGetCountriesSuccess, onGetCountriesError, onGetStatesSuccess, onGetStatesError, onGetProfileDataSuccess, onGetProfileDataError, onAuthorizeSuccess, onAuthorizeError, onLogin, onLoginSuccess, isLoggedIn: pIsLoggedIn, accountInfoTitle, hideLogo, themeOptions, onErrorClose, hideErrorsAlertSection, onSkipBillingPage, skipPage, canSkipHolderNames, onForgotPasswordSuccess, onForgotPasswordError, shouldFetchCountries, onCountdownFinish, enableTimer, logo, showForgotPasswordButton, showSignUpButton, brandOptIn, }: IBillingInfoPage) => JSX.Element>;
50
+ export declare const BillingInfoContainer: React.MemoExoticComponent<({ data, ticketHoldersFields, initialValues, buttonName, handleSubmit, theme, onRegisterSuccess, onRegisterError, onSubmitError, onGetCartSuccess, onGetCartError, onGetCountriesSuccess, onGetCountriesError, onGetStatesSuccess, onGetStatesError, onGetProfileDataSuccess, onGetProfileDataError, onLogin, onLoginSuccess, isLoggedIn: pIsLoggedIn, accountInfoTitle, hideLogo, themeOptions, onErrorClose, hideErrorsAlertSection, onSkipBillingPage, skipPage, canSkipHolderNames, onForgotPasswordSuccess, onForgotPasswordError, shouldFetchCountries, onCountdownFinish, enableTimer, logo, showForgotPasswordButton, showSignUpButton, brandOptIn, }: IBillingInfoPage) => JSX.Element>;
@@ -1,11 +1,10 @@
1
- import { FC } from 'react';
2
- import { AxiosError } from 'axios';
3
1
  import './style.css';
4
- interface IForgotPasswordProps {
2
+ import { AxiosError } from 'axios';
3
+ import { FC } from 'react';
4
+ export interface IForgotPasswordProps {
5
5
  onClose: () => void;
6
- onLogin: () => void;
6
+ onLoginButtonClick: () => void;
7
7
  onForgotPasswordSuccess: (res: any) => void;
8
8
  onForgotPasswordError: (e: AxiosError) => void;
9
9
  }
10
10
  export declare const ForgotPasswordModal: FC<IForgotPasswordProps>;
11
- export {};
@@ -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 {};
@@ -1,49 +1,11 @@
1
1
  import './style.css';
2
- import { AxiosError } from 'axios';
3
2
  import { FC } from 'react';
4
- interface Props {
3
+ import { ILoginFormProps } from '../loginForm';
4
+ export interface ILoginModalProps extends ILoginFormProps {
5
+ onLogin: (res: IProfileData) => void;
5
6
  onClose: () => void;
6
- onLogin: () => void;
7
- alreadyHasUser?: boolean;
8
- userExpired?: boolean;
9
- onAuthorizeSuccess?: (res: any) => void;
10
- onAuthorizeError?: (e: AxiosError) => void;
11
- onGetProfileDataSuccess?: (res: any) => void;
12
- onGetProfileDataError?: (e: AxiosError) => void;
7
+ modalClassname?: string;
13
8
  onForgotPassword?: () => void;
14
9
  onSignup?: () => void;
15
- modalClassname?: string;
16
- logo?: string;
17
- showForgotPasswordButton?: boolean;
18
- showSignUpButton?: boolean;
19
- }
20
- interface IUserData {
21
- id: string;
22
- firstName: string;
23
- lastName: string;
24
- email: string;
25
- city?: string;
26
- country?: string;
27
- countryId?: string;
28
- phone?: string;
29
- streetAddress?: string;
30
- state?: string;
31
- zip?: string;
32
- zipCode?: string;
33
- stateId?: string;
34
10
  }
35
- export declare const setLoggedUserData: (data: IUserData) => {
36
- id: string;
37
- first_name: string;
38
- last_name: string;
39
- email: string;
40
- confirmEmail: string;
41
- city: string;
42
- country: string;
43
- phone: string;
44
- street_address: string;
45
- state: string;
46
- zip: string;
47
- };
48
- export declare const LoginModal: FC<Props>;
49
- export {};
11
+ export declare const LoginModal: FC<ILoginModalProps>;
@@ -0,0 +1,13 @@
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, shouldValidate?: boolean | undefined) => void;
7
+ countries?: {
8
+ [key: string]: string | number;
9
+ }[];
10
+ theme?: 'dark' | 'light';
11
+ containerClass?: string;
12
+ }
13
+ export declare const FieldsSection: ({ formFields, countries, values, setFieldValue, theme, containerClass, }: IFieldsSectionProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export declare const formFieldsNotLoggedIn: IFormFieldsSection[];
2
+ export declare const formFieldsLoggedIn: IFormFieldsSection[];
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ import { IForgotPasswordProps } from '../forgotPasswordModal';
3
+ import { ILoginModalProps } from '../loginModal';
4
+ interface IPreRegistrationProps extends ILoginModalProps, IForgotPasswordProps {
5
+ eventId: string | number;
6
+ formFields?: IFormFieldsSection[];
7
+ additionalFieldAttribute?: IFieldAttribute;
8
+ }
9
+ export declare const PreRegistration: FC<IPreRegistrationProps>;
10
+ export {};
@@ -0,0 +1,9 @@
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 getFormInitialValues: (fieldsSections: IFormFieldsSection[]) => {
7
+ [key: string]: string | number | boolean;
8
+ };
9
+ export declare const updateFormFieldsAttributes: (formFields: IFormFieldsSection[], attributes?: IFieldAttribute | undefined) => IFormFieldsSection[];
@@ -0,0 +1 @@
1
+ export declare const useCookieListener: (key: string, handler: (value: string | null) => void) => void;
@@ -0,0 +1 @@
1
+ export declare const useEventListener: (eventName: string, handler: () => void, element?: Window & typeof globalThis) => void;
package/dist/index.d.ts CHANGED
@@ -13,3 +13,4 @@ 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 { PreRegistration } from './components/preRegistration';