tf-checkout-react 1.6.6-beta.3 → 1.6.6-beta.31

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 (110) hide show
  1. package/README.md +61 -40
  2. package/dist/adapters/customFields.d.ts +1 -0
  3. package/dist/api/checkout.d.ts +1 -0
  4. package/dist/api/common.d.ts +1 -0
  5. package/dist/api/index.d.ts +1 -0
  6. package/dist/api/preRegistrationComplete.d.ts +1 -1
  7. package/dist/components/addonsContainer/AddonComponent.d.ts +5 -1
  8. package/dist/components/addonsContainer/SimpleAddonsContainer.d.ts +17 -0
  9. package/dist/components/addonsContainer/index.d.ts +5 -1
  10. package/dist/components/billing-info-container/index.d.ts +8 -1
  11. package/dist/components/billing-info-container/utils.d.ts +25 -1
  12. package/dist/components/common/DatePickerField.d.ts +7 -1
  13. package/dist/components/countdown/index.d.ts +1 -1
  14. package/dist/components/forgotPasswordModal/index.d.ts +2 -1
  15. package/dist/components/myTicketsContainer/index.d.ts +3 -2
  16. package/dist/components/orderDetailsContainer/index.d.ts +7 -1
  17. package/dist/components/paymentContainer/OrderDetails.d.ts +8 -0
  18. package/dist/components/paymentContainer/handlePayment.d.ts +15 -0
  19. package/dist/components/paymentContainer/index.d.ts +10 -5
  20. package/dist/components/preRegistration/FieldsSection.d.ts +7 -1
  21. package/dist/components/preRegistration/PreRegistrationComplete.d.ts +6 -0
  22. package/dist/components/preRegistration/constants.d.ts +2 -2
  23. package/dist/components/preRegistration/index.d.ts +6 -0
  24. package/dist/components/resetPasswordContainer/index.d.ts +2 -2
  25. package/dist/components/stripePayment/index.d.ts +18 -3
  26. package/dist/components/ticketsContainer/InfoIcon.d.ts +5 -0
  27. package/dist/components/ticketsContainer/TicketsSection.d.ts +3 -2
  28. package/dist/components/ticketsContainer/TimeSlotsSection.d.ts +25 -0
  29. package/dist/components/ticketsContainer/index.d.ts +18 -5
  30. package/dist/components/timerWidget/index.d.ts +2 -1
  31. package/dist/constants/index.d.ts +5 -0
  32. package/dist/index.d.ts +4 -1
  33. package/dist/tf-checkout-react.cjs.development.js +5196 -3599
  34. package/dist/tf-checkout-react.cjs.development.js.map +1 -1
  35. package/dist/tf-checkout-react.cjs.production.min.js +1 -1
  36. package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
  37. package/dist/tf-checkout-react.esm.js +5199 -3605
  38. package/dist/tf-checkout-react.esm.js.map +1 -1
  39. package/dist/tf-checkout-styles.css +1 -1
  40. package/dist/types/add_on.d.ts +1 -0
  41. package/dist/types/checkoutPageConfigs.d.ts +1 -1
  42. package/dist/types/order-data.d.ts +2 -1
  43. package/dist/utils/auth.d.ts +8 -0
  44. package/dist/utils/customFields.d.ts +11 -0
  45. package/dist/utils/getDomain.d.ts +1 -1
  46. package/dist/utils/index.d.ts +1 -1
  47. package/dist/utils/setConfigs.d.ts +1 -0
  48. package/package.json +3 -2
  49. package/src/adapters/customFields.ts +7 -1
  50. package/src/api/auth.ts +2 -1
  51. package/src/api/checkout.ts +8 -4
  52. package/src/api/common.ts +49 -2
  53. package/src/api/interceptors.ts +7 -23
  54. package/src/api/preRegistrationComplete.ts +1 -1
  55. package/src/api/publicRequest.ts +10 -0
  56. package/src/components/addonsContainer/AddonComponent.tsx +71 -11
  57. package/src/components/addonsContainer/SimpleAddonsContainer.tsx +388 -0
  58. package/src/components/addonsContainer/index.tsx +189 -58
  59. package/src/components/billing-info-container/index.tsx +704 -390
  60. package/src/components/billing-info-container/{utils.ts → utils.tsx} +119 -0
  61. package/src/components/common/CheckboxField/index.tsx +1 -1
  62. package/src/components/common/DatePickerField.tsx +25 -10
  63. package/src/components/common/SnackbarAlert.tsx +32 -34
  64. package/src/components/confirmationContainer/index.tsx +1 -1
  65. package/src/components/countdown/index.tsx +22 -22
  66. package/src/components/delegationsContainer/IssueComponent.tsx +2 -1
  67. package/src/components/forgotPasswordModal/index.tsx +44 -13
  68. package/src/components/loginForm/index.tsx +1 -1
  69. package/src/components/loginModal/index.tsx +2 -2
  70. package/src/components/loginModal/style.css +3 -1
  71. package/src/components/myTicketsContainer/index.tsx +13 -9
  72. package/src/components/orderDetailsContainer/index.tsx +188 -173
  73. package/src/components/paymentContainer/OrderDetails.tsx +170 -0
  74. package/src/components/paymentContainer/handlePayment.ts +86 -0
  75. package/src/components/paymentContainer/index.tsx +253 -226
  76. package/src/components/paymentContainer/style.css +113 -0
  77. package/src/components/preRegistration/FieldsSection.tsx +8 -0
  78. package/src/components/preRegistration/PreRegistrationComplete.tsx +128 -118
  79. package/src/components/preRegistration/PreRegistrationInformations.tsx +21 -15
  80. package/src/components/preRegistration/constants.tsx +10 -4
  81. package/src/components/preRegistration/index.tsx +194 -174
  82. package/src/components/registerForm/constants.tsx +3 -1
  83. package/src/components/registerForm/index.tsx +3 -3
  84. package/src/components/resetPasswordContainer/index.tsx +12 -13
  85. package/src/components/seatMapContainer/TicketsSection.tsx +2 -2
  86. package/src/components/stripePayment/index.tsx +129 -24
  87. package/src/components/ticketsContainer/InfoIcon.tsx +35 -0
  88. package/src/components/ticketsContainer/PromoCodeSection.tsx +34 -28
  89. package/src/components/ticketsContainer/TicketRow.tsx +1 -1
  90. package/src/components/ticketsContainer/TicketsSection.tsx +178 -52
  91. package/src/components/ticketsContainer/TimeSlotsSection.tsx +120 -0
  92. package/src/components/ticketsContainer/index.tsx +209 -99
  93. package/src/components/timerWidget/index.tsx +15 -3
  94. package/src/constants/index.ts +2 -0
  95. package/src/hoc/CustomFields/index.tsx +9 -1
  96. package/src/index.ts +7 -2
  97. package/src/types/add_on.ts +1 -0
  98. package/src/types/api/common.d.ts +27 -0
  99. package/src/types/api/orders.d.ts +19 -3
  100. package/src/types/api/payment.d.ts +5 -2
  101. package/src/types/api/preRegistrationComplete.d.ts +2 -2
  102. package/src/types/checkoutPageConfigs.ts +1 -1
  103. package/src/types/order-data.ts +2 -1
  104. package/src/types/pre-registration-complete.d.ts +6 -1
  105. package/src/utils/auth.ts +32 -0
  106. package/src/utils/cookies.ts +42 -11
  107. package/src/utils/customFields.ts +22 -0
  108. package/src/utils/getDomain.ts +10 -4
  109. package/src/utils/index.ts +1 -1
  110. package/src/utils/setConfigs.ts +3 -1
@@ -1,6 +1,16 @@
1
1
  /// <reference types="react" />
2
2
  import './style.css';
3
- import { StripeCardNumberElementOptions } from '@stripe/stripe-js';
3
+ import { Stripe, StripeCardNumberElement, StripeCardNumberElementOptions, StripeError } from '@stripe/stripe-js';
4
+ interface PaymentFieldsData {
5
+ billing_info: {
6
+ city?: string;
7
+ street_address?: string;
8
+ state?: string;
9
+ };
10
+ postalCode?: string;
11
+ disableZipSection?: boolean;
12
+ cardComplete?: boolean;
13
+ }
4
14
  export interface ICheckoutForm {
5
15
  total: string | number;
6
16
  currency: string;
@@ -14,11 +24,16 @@ export interface ICheckoutForm {
14
24
  isLoading: any;
15
25
  handleSetLoading: (loading: any) => void;
16
26
  conditions: any;
17
- disableZipSection: boolean;
27
+ disableZipSection?: boolean;
18
28
  paymentButtonText?: string;
19
29
  forPaymentPlan?: boolean;
20
30
  orderId?: string;
21
31
  hasSeatMapActions: boolean;
32
+ enableAddressElement?: boolean;
33
+ collectPaymentMethodOnly?: boolean;
34
+ displayPaymentButton?: boolean;
35
+ onPaymentFieldsUpdate?: (error: any, paymentFieldsData: PaymentFieldsData, stripe: Stripe | null, card: StripeCardNumberElement | null) => void;
36
+ stripeCardError?: StripeError | null;
22
37
  }
23
- declare const CheckoutForm: ({ total, orderId, onSubmit, stripeCardOptions, error, stripe_client_secret, currency, billing_info, isLoading, handleSetLoading, conditions, disableZipSection, paymentButtonText, forPaymentPlan, hasSeatMapActions, }: ICheckoutForm) => JSX.Element;
38
+ declare const CheckoutForm: ({ total, orderId, onSubmit, stripeCardOptions, error, stripe_client_secret, currency, billing_info, isLoading, handleSetLoading, conditions, disableZipSection, paymentButtonText, forPaymentPlan, hasSeatMapActions, enableAddressElement, displayPaymentButton, onPaymentFieldsUpdate, stripeCardError, }: ICheckoutForm) => JSX.Element;
24
39
  export default CheckoutForm;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare const InfoIcon: ({ size }: {
3
+ size?: number | undefined;
4
+ }) => JSX.Element;
5
+ export default InfoIcon;
@@ -12,8 +12,9 @@ interface ITicketsSectionProps {
12
12
  ticketsHeaderComponent?: ReactNode;
13
13
  tableTicketsHeaderComponent?: ReactNode;
14
14
  showGroupNameBlock?: boolean;
15
- currencySybmol?: string;
15
+ currencySymbol?: string;
16
16
  isSeatMapAllowed?: boolean;
17
+ descriptionTrigger?: 'click' | 'hover';
17
18
  }
18
- export declare const TicketsSection: ({ event, ticketsList, selectedTickets, handleTicketSelect, sortBySoldOut, ticketsHeaderComponent, tableTicketsHeaderComponent, hideTicketsHeader, hideTableTicketsHeader, showGroupNameBlock, currencySybmol, isSeatMapAllowed, tableTickets, }: ITicketsSectionProps) => JSX.Element;
19
+ export declare const TicketsSection: ({ event, ticketsList, selectedTickets, handleTicketSelect, sortBySoldOut, ticketsHeaderComponent, tableTicketsHeaderComponent, hideTicketsHeader, hideTableTicketsHeader, showGroupNameBlock, currencySymbol, isSeatMapAllowed, tableTickets, descriptionTrigger, }: ITicketsSectionProps) => JSX.Element;
19
20
  export {};
@@ -0,0 +1,25 @@
1
+ import React, { ReactNode } from 'react';
2
+ interface Props {
3
+ event: any;
4
+ eventId: number;
5
+ availableDates: string[];
6
+ selectedDate: string | null;
7
+ timeSlotGroups: {
8
+ [key: string]: any[];
9
+ };
10
+ setTimeSlotGroups: (value: {
11
+ [key: string]: any[];
12
+ }) => void;
13
+ setSelectedDate: (value: string | null) => void;
14
+ getTimeSlots: (date: string | null, type?: string) => Promise<void>;
15
+ selectedTickets: any;
16
+ handleTicketSelect: any;
17
+ sortBySoldOut: boolean;
18
+ hideTicketsHeader: boolean;
19
+ ticketsHeaderComponent?: ReactNode;
20
+ showGroupNameBlock?: boolean;
21
+ currencySymbol?: string;
22
+ isSeatMapAllowed?: boolean;
23
+ }
24
+ declare const TimeSlotsSection: React.FC<Props>;
25
+ export default TimeSlotsSection;
@@ -9,6 +9,7 @@ interface CartSuccess {
9
9
  hash?: string | number;
10
10
  total?: string | number;
11
11
  hasAddOn?: boolean;
12
+ eventSlug?: string;
12
13
  }
13
14
  export interface IGetTickets {
14
15
  eventId: number;
@@ -16,12 +17,24 @@ export interface IGetTickets {
16
17
  getTicketsLabel?: string;
17
18
  contentStyle?: React.CSSProperties;
18
19
  onAddToCartError: (e: AxiosError) => void;
19
- onGetTicketsSuccess: (response: any) => void;
20
+ onGetTicketsSuccess: (response: {
21
+ data: {
22
+ attributes: {
23
+ tickets: ITicketData[];
24
+ };
25
+ };
26
+ }) => void;
20
27
  onGetTicketsPress: () => void;
21
28
  onGetTicketsError: (e: AxiosError) => void;
22
29
  onLogoutSuccess: () => void;
23
30
  onLogoutError: (e: AxiosError) => void;
24
- onGetProfileDataSuccess: (response: any) => void;
31
+ onGetProfileDataSuccess: (response: {
32
+ data: {
33
+ attributes: {
34
+ [key: string]: string | number | boolean | null;
35
+ };
36
+ };
37
+ }) => void;
25
38
  onGetProfileDataError: (e: AxiosError) => void;
26
39
  onLoginSuccess: () => void;
27
40
  handleNotInvitedModalClose: () => void;
@@ -41,7 +54,7 @@ export interface IGetTickets {
41
54
  sortBySoldOut?: boolean;
42
55
  disableCountdownLeadingZero?: boolean;
43
56
  isLoggedIn?: boolean;
44
- actionsSectionComponent?: any;
57
+ actionsSectionComponent?: ReactNode;
45
58
  ticketsHeaderComponent?: ReactNode;
46
59
  hideTicketsHeader?: boolean;
47
60
  tableTicketsHeaderComponent?: ReactNode;
@@ -52,7 +65,7 @@ export interface IGetTickets {
52
65
  showPoweredByImage?: boolean;
53
66
  promoText?: string;
54
67
  showGroupNameBlock?: boolean;
55
- currencySybmol?: string;
68
+ currencySymbol?: string;
56
69
  onReserveButtonClick?: () => void;
57
70
  onPendingVerification?: () => void;
58
71
  showAlertIcons?: boolean;
@@ -65,5 +78,5 @@ export interface ISelectedTickets {
65
78
  isTable: boolean;
66
79
  [key: string]: string | number | boolean;
67
80
  }
68
- export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, onLogoutSuccess, onLogoutError, onGetProfileDataSuccess, onGetProfileDataError, onGetTicketsPress, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons, hideWaitingList, enableBillingInfoAutoCreate, isButtonScrollable, sortBySoldOut, disableCountdownLeadingZero, isLoggedIn, actionsSectionComponent: ActionsSectionComponent, ticketsHeaderComponent, hideTicketsHeader, tableTicketsHeaderComponent, hideTableTicketsHeader, enableInfluencersSection, enableAddOns, handleNotInvitedModalClose, handleInvalidLinkModalClose, ordersPath, showPoweredByImage, promoText, showGroupNameBlock, currencySybmol, onReserveButtonClick, onPendingVerification, showAlertIcons, }: IGetTickets) => JSX.Element;
81
+ export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, onLogoutSuccess, onLogoutError, onGetProfileDataSuccess, onGetProfileDataError, onGetTicketsPress, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons, hideWaitingList, enableBillingInfoAutoCreate, isButtonScrollable, sortBySoldOut, disableCountdownLeadingZero, isLoggedIn, actionsSectionComponent: ActionsSectionComponent, ticketsHeaderComponent, hideTicketsHeader, tableTicketsHeaderComponent, hideTableTicketsHeader, enableInfluencersSection, enableAddOns, handleNotInvitedModalClose, handleInvalidLinkModalClose, ordersPath, showPoweredByImage, promoText, showGroupNameBlock, currencySymbol, onReserveButtonClick, onPendingVerification, showAlertIcons, }: IGetTickets) => JSX.Element;
69
82
  export {};
@@ -4,6 +4,7 @@ export interface ITimerWidgetPage {
4
4
  expires_at: number;
5
5
  buyLoading?: boolean;
6
6
  onCountdownFinish?: () => void;
7
+ container?: string;
7
8
  }
8
9
  export interface IRenderer {
9
10
  minutes: number;
@@ -11,5 +12,5 @@ export interface IRenderer {
11
12
  completed: number;
12
13
  handleCountdownFinish: () => void;
13
14
  }
14
- declare const _default: React.MemoExoticComponent<({ expires_at, buyLoading, onCountdownFinish, }: ITimerWidgetPage) => JSX.Element | null>;
15
+ declare const _default: React.MemoExoticComponent<({ expires_at, buyLoading, onCountdownFinish, container, }: ITimerWidgetPage) => JSX.Element | null>;
15
16
  export default _default;
@@ -1 +1,6 @@
1
1
  export declare const X_TF_ECOMMERCE = "X-TF-ECOMMERCE";
2
+ export declare const FEES_STYLES: {
3
+ TRADITIONAL: string;
4
+ DISPLAY_BOTH: string;
5
+ };
6
+ export declare const DEFAULT_FEES_STYLE: string;
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export { currencyNormalizerCreator, createFixedFloatNormalizer } from './normali
6
6
  export { LoginModal } from './components/loginModal';
7
7
  export { MyTicketsContainer } from './components/myTicketsContainer';
8
8
  export { OrderDetailsContainer } from './components/orderDetailsContainer';
9
- export { setConfigs } from './utils/setConfigs';
9
+ export { DEFAULT_FEES_STYLE } from './constants/index';
10
10
  export { TicketResaleContainer } from './components';
11
11
  export { RedirectModal } from './components/common/RedirectModal';
12
12
  export { RsvpContainer } from './components/rsvpContainer';
@@ -22,3 +22,6 @@ export { PoweredBy } from './components/common/PoweredBy';
22
22
  export { SeatMapContainer } from './components/seatMapContainer';
23
23
  export { IDVerification } from './components/idVerificationContainer';
24
24
  export { VERIFICATION_STATUSES } from './components/idVerificationContainer/constants';
25
+ export { setConfigs } from './utils/setConfigs';
26
+ export { logoutUser } from './utils/auth';
27
+ export { OrderDetails } from './components/paymentContainer/OrderDetails';