@eventlook/sdk 1.5.0-beta.2 → 1.5.0-beta.4
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/.prettierrc +1 -14
- package/dist/cjs/index-DLC5Hr8L.js +35809 -0
- package/dist/cjs/index-DLC5Hr8L.js.map +1 -0
- package/dist/cjs/index.js +11 -49195
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.umd-BSCKGDNQ.js +13407 -0
- package/dist/cjs/index.umd-BSCKGDNQ.js.map +1 -0
- package/dist/esm/index-BwmbJihM.js +35805 -0
- package/dist/esm/index-BwmbJihM.js.map +1 -0
- package/dist/esm/index.js +10 -49198
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.umd-6fgyuQlr.js +13405 -0
- package/dist/esm/index.umd-6fgyuQlr.js.map +1 -0
- package/dist/types/components/ClientOnly.d.ts +5 -0
- package/dist/types/components/CustomSkeleton.d.ts +4 -0
- package/dist/types/components/Image.d.ts +14 -0
- package/dist/types/components/Label.d.ts +11 -0
- package/dist/types/components/TextIconLabel.d.ts +10 -0
- package/dist/types/components/TicketFormSkeleton.d.ts +3 -0
- package/dist/types/components/Trans.d.ts +12 -0
- package/dist/types/components/animate/DialogAnimate.d.ts +9 -0
- package/dist/types/components/animate/IconButtonAnimate.d.ts +7 -0
- package/dist/types/components/animate/MotionContainer.d.ts +10 -0
- package/dist/types/components/animate/MotionLazyContainer.d.ts +6 -0
- package/dist/types/components/animate/MotionViewport.d.ts +10 -0
- package/dist/types/components/animate/TextAnimate.d.ts +9 -0
- package/dist/types/components/animate/index.d.ts +7 -0
- package/dist/types/components/animate/variants/actions.d.ts +5 -0
- package/dist/types/components/animate/variants/background.d.ts +104 -0
- package/dist/types/components/animate/variants/bounce.d.ts +131 -0
- package/dist/types/components/animate/variants/container.d.ts +19 -0
- package/dist/types/components/animate/variants/fade.d.ts +217 -0
- package/dist/types/components/animate/variants/flip.d.ts +75 -0
- package/dist/types/components/animate/variants/index.d.ts +12 -0
- package/dist/types/components/animate/variants/path.d.ts +14 -0
- package/dist/types/components/animate/variants/rotate.d.ts +39 -0
- package/dist/types/components/animate/variants/scale.d.ts +75 -0
- package/dist/types/components/animate/variants/slide.d.ts +155 -0
- package/dist/types/components/animate/variants/transition.d.ts +13 -0
- package/dist/types/components/animate/variants/zoom.d.ts +199 -0
- package/dist/types/components/confirm-dialog/ConfirmDialog.d.ts +3 -0
- package/dist/types/components/confirm-dialog/index.d.ts +1 -0
- package/dist/types/components/confirm-dialog/types.d.ts +8 -0
- package/dist/types/components/hook-form/FormProvider.d.ts +9 -0
- package/dist/types/components/hook-form/RHFAutocomplete.d.ts +9 -0
- package/dist/types/components/hook-form/RHFCheckbox.d.ts +20 -0
- package/dist/types/components/hook-form/RHFCodes.d.ts +8 -0
- package/dist/types/components/hook-form/RHFDatePicker.d.ts +8 -0
- package/dist/types/components/hook-form/RHFPhone.d.ts +8 -0
- package/dist/types/components/hook-form/RHFRadioGroup.d.ts +14 -0
- package/dist/types/components/hook-form/RHFSelect.d.ts +23 -0
- package/dist/types/components/hook-form/RHFSlider.d.ts +8 -0
- package/dist/types/components/hook-form/RHFSwitch.d.ts +8 -0
- package/dist/types/components/hook-form/RHFTextField.d.ts +7 -0
- package/dist/types/components/hook-form/index.d.ts +9 -0
- package/dist/types/components/iconify/Iconify.d.ts +10 -0
- package/dist/types/components/iconify/index.d.ts +2 -0
- package/dist/types/components/iconify/types.d.ts +2 -0
- package/dist/types/components/index.d.ts +4 -0
- package/dist/types/context/GlobalContext.d.ts +16 -0
- package/dist/types/form/ChildEventCard.d.ts +7 -0
- package/dist/types/form/ChildEventDialog.d.ts +9 -0
- package/dist/types/form/ChildEvents.d.ts +8 -0
- package/dist/types/form/ContactPerson.d.ts +7 -0
- package/dist/types/form/EmailConfirmation.d.ts +8 -0
- package/dist/types/form/MerchandiseSelection.d.ts +9 -0
- package/dist/types/form/OrderSuccess.d.ts +9 -0
- package/dist/types/form/Payment.d.ts +7 -0
- package/dist/types/form/PaymentOverviewBox.d.ts +7 -0
- package/dist/types/form/PaymentPending.d.ts +3 -0
- package/dist/types/form/PaymentSuccess.d.ts +9 -0
- package/dist/types/form/ReleaseCountdown.d.ts +8 -0
- package/dist/types/form/ReleaseWithMerchandise.d.ts +12 -0
- package/dist/types/form/ScriptLoader.d.ts +3 -0
- package/dist/types/form/Shipping.d.ts +7 -0
- package/dist/types/form/TicketForm.d.ts +11 -0
- package/dist/types/form/TicketSelection.d.ts +7 -0
- package/dist/types/form/TicketSelectionMap.d.ts +7 -0
- package/dist/types/form/TicketWithMerchandiseSelection.d.ts +7 -0
- package/dist/types/form/TimeslotSelection.d.ts +7 -0
- package/dist/types/form/extra-field/ExtraField.d.ts +9 -0
- package/dist/types/form/extra-field/ReleaseExtraFields.d.ts +10 -0
- package/dist/types/form/index.d.ts +26 -0
- package/dist/types/form/payment/FeeBox.d.ts +8 -0
- package/dist/types/form/payment/PaymentOverviewCheckbox.d.ts +12 -0
- package/dist/types/form/payment/PaymentSkeleton.d.ts +7 -0
- package/dist/types/form/product/ProductCard.d.ts +9 -0
- package/dist/types/form/product/ProductVariantsDialog.d.ts +14 -0
- package/dist/types/form/shipping/ShippingSkeleton.d.ts +7 -0
- package/dist/types/form/style.d.ts +11 -0
- package/dist/types/form/timeslot/TimeslotCalendar.d.ts +12 -0
- package/dist/types/hooks/data/useActiveEventProducts.d.ts +8 -0
- package/dist/types/hooks/data/useAllowedPaymentMethods.d.ts +9 -0
- package/dist/types/hooks/data/useEvent.d.ts +8 -0
- package/dist/types/hooks/data/useEventActiveReleases.d.ts +8 -0
- package/dist/types/hooks/data/useEventShippingMethods.d.ts +8 -0
- package/dist/types/hooks/data/useEventTimeslots.d.ts +10 -0
- package/dist/types/hooks/useCountdown.d.ts +6 -0
- package/dist/types/hooks/useDebounce.d.ts +1 -0
- package/dist/types/hooks/useErrors.d.ts +4 -0
- package/dist/types/hooks/useEventListener.d.ts +5 -0
- package/dist/types/hooks/useFirstRender.d.ts +1 -0
- package/dist/types/hooks/useGlobal.d.ts +2 -0
- package/dist/types/hooks/useResponsive.d.ts +8 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/locales/cs.d.ts +157 -0
- package/dist/types/locales/en.d.ts +158 -0
- package/dist/types/locales/es.d.ts +158 -0
- package/dist/types/locales/index.d.ts +6 -0
- package/dist/types/locales/pl.d.ts +158 -0
- package/dist/types/locales/sk.d.ts +158 -0
- package/dist/types/locales/uk.d.ts +158 -0
- package/dist/types/modules/event-timeslot.d.ts +2 -0
- package/dist/types/modules/event.d.ts +5 -0
- package/dist/types/modules/order.d.ts +7 -0
- package/dist/types/modules/promo-code.d.ts +1 -0
- package/dist/types/modules/shopping-cart.d.ts +4 -0
- package/dist/types/utils/axios.d.ts +2 -0
- package/dist/types/utils/data/cookie.d.ts +1 -0
- package/dist/types/utils/data/currency.d.ts +5 -0
- package/dist/types/utils/data/event.d.ts +4 -0
- package/dist/types/utils/data/extra-field.d.ts +11 -0
- package/dist/types/utils/data/gender.d.ts +5 -0
- package/dist/types/utils/data/global.d.ts +1 -0
- package/dist/types/utils/data/gopay.d.ts +10 -0
- package/dist/types/utils/data/language.d.ts +10 -0
- package/dist/types/utils/data/order.d.ts +4 -0
- package/dist/types/utils/data/product.d.ts +3 -0
- package/dist/types/utils/data/promo-code.d.ts +4 -0
- package/dist/types/utils/data/shipping-method.d.ts +4 -0
- package/dist/types/utils/data/shopping-cart.d.ts +5 -0
- package/dist/types/utils/formatNumber.d.ts +8 -0
- package/dist/types/utils/global.d.ts +4 -0
- package/dist/types/utils/gtm.d.ts +28 -0
- package/dist/types/utils/isBrowser.d.ts +1 -0
- package/dist/types/utils/place.d.ts +2 -0
- package/dist/types/utils/price.d.ts +5 -0
- package/dist/types/utils/product.d.ts +3 -0
- package/dist/types/utils/translation.d.ts +2 -0
- package/dist/types/utils/types/animate.d.ts +26 -0
- package/dist/types/utils/types/artist.type.d.ts +17 -0
- package/dist/types/utils/types/company.type.d.ts +12 -0
- package/dist/types/utils/types/country.type.d.ts +39 -0
- package/dist/types/utils/types/customer.type.d.ts +10 -0
- package/dist/types/utils/types/event-product.type.d.ts +15 -0
- package/dist/types/utils/types/event-timeslot.type.d.ts +15 -0
- package/dist/types/utils/types/event.type.d.ts +62 -0
- package/dist/types/utils/types/extra-field.type.d.ts +18 -0
- package/dist/types/utils/types/file.type.d.ts +6 -0
- package/dist/types/utils/types/global.type.d.ts +76 -0
- package/dist/types/utils/types/gtm.type.d.ts +90 -0
- package/dist/types/utils/types/locale.type.d.ts +4 -0
- package/dist/types/utils/types/order.type.d.ts +69 -0
- package/dist/types/utils/types/palette.type.d.ts +1 -0
- package/dist/types/utils/types/payment-method.type.d.ts +23 -0
- package/dist/types/utils/types/pixel.type.d.ts +7 -0
- package/dist/types/utils/types/place.type.d.ts +19 -0
- package/dist/types/utils/types/product-image.type.d.ts +5 -0
- package/dist/types/utils/types/product-parameter.type.d.ts +7 -0
- package/dist/types/utils/types/product-variant.type.d.ts +9 -0
- package/dist/types/utils/types/product.type.d.ts +57 -0
- package/dist/types/utils/types/project.type.d.ts +24 -0
- package/dist/types/utils/types/promo-code.type.d.ts +15 -0
- package/dist/types/utils/types/release-category.type.d.ts +17 -0
- package/dist/types/utils/types/release.type.d.ts +28 -0
- package/dist/types/utils/types/shipping-method.type.d.ts +11 -0
- package/dist/types/utils/types/shopping-cart.type.d.ts +78 -0
- package/dist/types/utils/types/ticket.type.d.ts +110 -0
- package/dist/types/utils/types/translation.type.d.ts +18 -0
- package/dist/types/utils/types/user.type.d.ts +9 -0
- package/dist/types/utils/url.d.ts +1 -0
- package/eslint.config.mjs +103 -27
- package/package.json +10 -2
- package/src/@types/index.d.ts +3 -5
- package/src/components/TextIconLabel.tsx +1 -2
- package/src/components/animate/IconButtonAnimate.tsx +1 -2
- package/src/components/animate/MotionLazyContainer.tsx +1 -1
- package/src/components/hook-form/RHFCodes.tsx +1 -2
- package/src/components/hook-form/RHFSelect.tsx +1 -1
- package/src/form/PaymentPending.tsx +6 -3
- package/src/form/PaymentSuccess.tsx +2 -2
- package/src/form/ScriptLoader.tsx +1 -2
- package/src/form/Shipping.tsx +75 -77
- package/src/form/TicketForm.tsx +3 -3
- package/src/locales/en.tsx +1 -1
- package/src/utils/types/event.type.ts +0 -6
- package/tsconfig.build.json +1 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { IPlace } from '@utils/types/place.type';
|
|
3
|
+
import { Currencies } from '@utils/data/currency';
|
|
4
|
+
import { IPromoCode } from '@utils/types/promo-code.type';
|
|
5
|
+
import { IEventProductForm } from '@utils/types/product.type';
|
|
6
|
+
import { IExtraFieldForm } from '@utils/types/extra-field.type';
|
|
7
|
+
import { IEventTimeslot } from '@utils/types/event-timeslot.type';
|
|
8
|
+
import { IBase } from '@utils/types/global.type';
|
|
9
|
+
import { IOrder } from '@utils/types/order.type';
|
|
10
|
+
import { IFile } from '@utils/types/file.type';
|
|
11
|
+
import { IRelease } from '@utils/types/release.type';
|
|
12
|
+
import { TicketSelection } from '@seat-picker/seat-picker-sdk';
|
|
13
|
+
export interface ITicket extends IBase {
|
|
14
|
+
hidden: boolean;
|
|
15
|
+
name: string;
|
|
16
|
+
price: number;
|
|
17
|
+
quantity: number;
|
|
18
|
+
release: IRelease;
|
|
19
|
+
usedAt: string | null;
|
|
20
|
+
order: IOrder | null;
|
|
21
|
+
number: string;
|
|
22
|
+
qrUrl?: string;
|
|
23
|
+
pdf?: IFile;
|
|
24
|
+
applePassWallet?: IFile;
|
|
25
|
+
googlePassWallet?: IFile;
|
|
26
|
+
}
|
|
27
|
+
export interface ITicketFormTicket {
|
|
28
|
+
releaseId: number | '';
|
|
29
|
+
quantity: number | '';
|
|
30
|
+
itemName: string;
|
|
31
|
+
price: number;
|
|
32
|
+
products: IEventProductForm[];
|
|
33
|
+
extraFields: IExtraFieldForm[][];
|
|
34
|
+
eventTimeslotId?: number | null;
|
|
35
|
+
location?: ITicketLocation | null;
|
|
36
|
+
}
|
|
37
|
+
export interface ITicketLocation {
|
|
38
|
+
id: string;
|
|
39
|
+
type: TicketSelection[number]['locationType'];
|
|
40
|
+
locationDescription?: {
|
|
41
|
+
type: TicketSelection[number]['locationTypeDescription'][number]['type'] | 'custom';
|
|
42
|
+
label: string;
|
|
43
|
+
value: string;
|
|
44
|
+
}[] | null;
|
|
45
|
+
}
|
|
46
|
+
export type EventTicketsType = {
|
|
47
|
+
[eventId: string]: ITicketFormTicket[];
|
|
48
|
+
};
|
|
49
|
+
export interface ITicketForm {
|
|
50
|
+
uuid?: string | null;
|
|
51
|
+
eventId: number;
|
|
52
|
+
tickets: EventTicketsType;
|
|
53
|
+
total: number;
|
|
54
|
+
originalPrice: number;
|
|
55
|
+
firstName: string;
|
|
56
|
+
lastName: string;
|
|
57
|
+
email: string;
|
|
58
|
+
phone: string;
|
|
59
|
+
birthdate: Dayjs | null;
|
|
60
|
+
gender: string;
|
|
61
|
+
callback: string;
|
|
62
|
+
paymentMethodId: number | null;
|
|
63
|
+
paymentMethodOptionId: number | null;
|
|
64
|
+
termsAndConditions: boolean;
|
|
65
|
+
ticketInsurance: boolean;
|
|
66
|
+
ticketInsurancePrice: number;
|
|
67
|
+
ticketInsurancePricePerUnit: number;
|
|
68
|
+
smsNotification: boolean;
|
|
69
|
+
smsNotificationPrice: number;
|
|
70
|
+
iframeCampaignId?: number;
|
|
71
|
+
products: {
|
|
72
|
+
[eventId: string]: IEventProductForm[];
|
|
73
|
+
};
|
|
74
|
+
shipping: {
|
|
75
|
+
shippingMethodId: number | null;
|
|
76
|
+
branchId: string | null;
|
|
77
|
+
price: number;
|
|
78
|
+
};
|
|
79
|
+
extraFields: IExtraFieldForm[];
|
|
80
|
+
selectedDate: string | null;
|
|
81
|
+
eventTimeslotId: number | null;
|
|
82
|
+
promoCodes: IPromoCode[];
|
|
83
|
+
totalFee?: number | null;
|
|
84
|
+
isPaymentVerify: boolean;
|
|
85
|
+
}
|
|
86
|
+
export interface ITicketBody extends ITicketForm {
|
|
87
|
+
promoCodeIds: number[];
|
|
88
|
+
}
|
|
89
|
+
export interface IPaidTicket {
|
|
90
|
+
eventName: string;
|
|
91
|
+
releaseName: string;
|
|
92
|
+
releaseCategoryName: string;
|
|
93
|
+
qrUrl: string;
|
|
94
|
+
price: number;
|
|
95
|
+
number: string;
|
|
96
|
+
location: IPlace;
|
|
97
|
+
pdfUrl?: string;
|
|
98
|
+
applePassWalletUrl?: string;
|
|
99
|
+
googlePassWalletUrl?: string;
|
|
100
|
+
currency: Currencies;
|
|
101
|
+
firstName?: string;
|
|
102
|
+
lastName?: string;
|
|
103
|
+
eventTimeslot?: IEventTimeslot;
|
|
104
|
+
}
|
|
105
|
+
export interface ICreateTicket {
|
|
106
|
+
releaseName: string;
|
|
107
|
+
releaseCategoryName: string;
|
|
108
|
+
price: number;
|
|
109
|
+
number: string;
|
|
110
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IBaseLocale } from '@utils/types/locale.type';
|
|
2
|
+
import { IBase } from '@utils/types/global.type';
|
|
3
|
+
export interface IFaq {
|
|
4
|
+
title: string;
|
|
5
|
+
content: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ITranslation extends IBase {
|
|
8
|
+
value: {
|
|
9
|
+
text: string;
|
|
10
|
+
} & IBaseLocale;
|
|
11
|
+
}
|
|
12
|
+
export interface ITranslationEntity extends IBase {
|
|
13
|
+
translationValues: ITranslationValue[];
|
|
14
|
+
}
|
|
15
|
+
export interface ITranslationValue extends IBase {
|
|
16
|
+
text: string;
|
|
17
|
+
locale: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getSearchParamsInObject: (search: string) => Record<any, any>;
|
package/eslint.config.mjs
CHANGED
|
@@ -1,36 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
import js from '@eslint/js';
|
|
1
|
+
import eslint from '@eslint/js';
|
|
3
2
|
import tseslint from 'typescript-eslint';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import pluginReact from 'eslint-plugin-react';
|
|
4
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
5
|
+
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
6
|
+
import importX from 'eslint-plugin-import-x';
|
|
7
|
+
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
|
|
8
|
+
import prettierConfig from 'eslint-config-prettier/flat';
|
|
9
|
+
import prettierPlugin from 'eslint-plugin-prettier';
|
|
10
|
+
import globals from 'globals';
|
|
6
11
|
|
|
7
|
-
export default
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
export default tseslint.config(
|
|
13
|
+
// Global ignores
|
|
14
|
+
{ ignores: ['**/node_modules/*', 'dist/**', 'eslint.config.mjs'] },
|
|
15
|
+
|
|
16
|
+
// Base configs
|
|
17
|
+
eslint.configs.recommended,
|
|
18
|
+
tseslint.configs.recommended,
|
|
19
|
+
|
|
20
|
+
// React
|
|
21
|
+
pluginReact.configs.flat.recommended,
|
|
22
|
+
pluginReact.configs.flat['jsx-runtime'],
|
|
23
|
+
{ settings: { react: { version: 'detect' } } },
|
|
24
|
+
|
|
25
|
+
// JSX a11y
|
|
26
|
+
jsxA11y.flatConfigs.recommended,
|
|
27
|
+
|
|
28
|
+
// Import-x
|
|
29
|
+
importX.flatConfigs.recommended,
|
|
30
|
+
importX.flatConfigs.typescript,
|
|
31
|
+
|
|
32
|
+
// Project-wide settings
|
|
10
33
|
{
|
|
11
|
-
|
|
34
|
+
files: ['**/*.{ts,tsx}'],
|
|
12
35
|
plugins: {
|
|
13
|
-
'
|
|
14
|
-
|
|
36
|
+
'react-hooks': reactHooks,
|
|
37
|
+
prettier: prettierPlugin,
|
|
38
|
+
},
|
|
39
|
+
languageOptions: {
|
|
40
|
+
globals: { ...globals.browser, ...globals.es2021 },
|
|
41
|
+
parserOptions: {
|
|
42
|
+
projectService: true,
|
|
43
|
+
tsconfigRootDir: import.meta.dirname,
|
|
44
|
+
ecmaFeatures: { jsx: true },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
settings: {
|
|
48
|
+
react: { version: 'detect' },
|
|
49
|
+
'import-x/resolver-next': [
|
|
50
|
+
createTypeScriptImportResolver({ alwaysTryTypes: true }),
|
|
51
|
+
],
|
|
15
52
|
},
|
|
16
53
|
rules: {
|
|
17
|
-
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
54
|
+
// --- Carried over disabled rules ---
|
|
55
|
+
'no-alert': 'off',
|
|
56
|
+
'camelcase': 'off',
|
|
57
|
+
'no-console': 'off',
|
|
58
|
+
'no-unused-vars': 'off',
|
|
59
|
+
'no-param-reassign': 'off',
|
|
60
|
+
'no-underscore-dangle': 'off',
|
|
61
|
+
'no-restricted-exports': 'off',
|
|
62
|
+
'no-restricted-syntax': 'off',
|
|
63
|
+
'no-await-in-loop': 'off',
|
|
64
|
+
'no-plusplus': 'off',
|
|
65
|
+
'no-promise-executor-return': 'off',
|
|
66
|
+
|
|
67
|
+
// React
|
|
22
68
|
'react/no-children-prop': 'off',
|
|
23
|
-
'react/
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
69
|
+
'react/react-in-jsx-scope': 'off',
|
|
70
|
+
'react/no-array-index-key': 'off',
|
|
71
|
+
'react/require-default-props': 'off',
|
|
72
|
+
'react/jsx-props-no-spreading': 'off',
|
|
73
|
+
'react/function-component-definition': 'off',
|
|
74
|
+
'react/display-name': 'off',
|
|
75
|
+
'react/jsx-key': 'error',
|
|
76
|
+
'react-hooks/exhaustive-deps': 'off',
|
|
77
|
+
|
|
78
|
+
// a11y
|
|
79
|
+
'jsx-a11y/anchor-is-valid': 'off',
|
|
80
|
+
'jsx-a11y/control-has-associated-label': 'off',
|
|
81
|
+
'jsx-a11y/no-autofocus': 'off',
|
|
82
|
+
|
|
83
|
+
// Import
|
|
84
|
+
'import-x/prefer-default-export': 'off',
|
|
85
|
+
'import-x/no-cycle': 'off',
|
|
86
|
+
'import-x/no-extraneous-dependencies': ['error', { devDependencies: true }],
|
|
87
|
+
'import-x/no-named-as-default-member': 'off',
|
|
88
|
+
'import-x/no-named-as-default': 'off',
|
|
89
|
+
'import-x/default': 'off',
|
|
90
|
+
|
|
91
|
+
// TypeScript
|
|
92
|
+
'@typescript-eslint/naming-convention': 'off',
|
|
93
|
+
'@typescript-eslint/no-use-before-define': 'off',
|
|
94
|
+
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
|
|
95
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
96
|
+
'@typescript-eslint/no-empty-object-type': 'warn',
|
|
97
|
+
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],
|
|
98
|
+
|
|
99
|
+
// Warnings
|
|
100
|
+
'react/jsx-no-useless-fragment': ['warn', { allowExpressions: true }],
|
|
101
|
+
'prefer-destructuring': ['warn', { object: true, array: false }],
|
|
102
|
+
'react/no-unstable-nested-components': ['warn', { allowAsProps: true }],
|
|
103
|
+
'react/jsx-no-duplicate-props': ['warn', { ignoreCase: false }],
|
|
104
|
+
|
|
105
|
+
// Prettier
|
|
106
|
+
'prettier/prettier': 'error',
|
|
27
107
|
},
|
|
28
108
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
{
|
|
34
|
-
ignores: ['node_modules/**', 'dist/**'],
|
|
35
|
-
},
|
|
36
|
-
];
|
|
109
|
+
|
|
110
|
+
// Must be last — disables formatting rules that conflict with Prettier
|
|
111
|
+
prettierConfig,
|
|
112
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eventlook/sdk",
|
|
3
|
-
"version": "1.5.0-beta.
|
|
3
|
+
"version": "1.5.0-beta.4",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"dev": "concurrently --kill-others-on-fail --kill-others \"yarn watch:rollup\" \"yarn watch:types\" \"yarn watch:push\"",
|
|
24
24
|
"dev:simple": "concurrently --kill-others-on-fail \"yarn watch:rollup\" \"yarn watch:types\"",
|
|
25
25
|
"publish": "npm publish",
|
|
26
|
-
"lint
|
|
26
|
+
"lint": "eslint .",
|
|
27
|
+
"lint:fix": "eslint --fix .",
|
|
27
28
|
"prettier": "prettier --write 'src/**/*.{js,jsx,ts,tsx}'",
|
|
28
29
|
"format": "yarn lint:fix && yarn prettier"
|
|
29
30
|
},
|
|
@@ -39,6 +40,7 @@
|
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"@emotion/react": "^11.14.0",
|
|
41
42
|
"@emotion/styled": "^11.14.1",
|
|
43
|
+
"@eslint/js": "^9",
|
|
42
44
|
"@hookform/resolvers": "^5.2.2",
|
|
43
45
|
"@iconify/icons-carbon": "^1.2.20",
|
|
44
46
|
"@iconify/react": "^6.0.2",
|
|
@@ -60,8 +62,14 @@
|
|
|
60
62
|
"dayjs": "^1.11.19",
|
|
61
63
|
"eslint": "^9.39.3",
|
|
62
64
|
"eslint-config-prettier": "^10.1.8",
|
|
65
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
66
|
+
"eslint-plugin-import-x": "^4.16.1",
|
|
67
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
68
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
63
69
|
"eslint-plugin-react": "^7.37.5",
|
|
70
|
+
"eslint-plugin-react-hooks": "^5",
|
|
64
71
|
"framer-motion": "^12.34.4",
|
|
72
|
+
"globals": "^17.4.0",
|
|
65
73
|
"js-cookie": "^3.0.5",
|
|
66
74
|
"lodash": "^4.17.23",
|
|
67
75
|
"lottie-react": "^2.4.1",
|
package/src/@types/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { IGopay } from '@utils/types/gopay.type';
|
|
2
|
-
|
|
3
1
|
export {};
|
|
4
2
|
declare global {
|
|
5
3
|
interface Window {
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
5
|
dataLayer: any;
|
|
7
|
-
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
+
_gopay: any;
|
|
8
8
|
Packeta: Packeta;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -30,5 +30,3 @@ interface Packeta {
|
|
|
30
30
|
interface PacketaOptions {
|
|
31
31
|
language: string;
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
window._gopay = window._gopay || {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { forwardRef, ReactNode } from 'react';
|
|
2
2
|
import { m } from 'framer-motion';
|
|
3
|
-
import { forwardRef, ReactNode } from 'react';
|
|
4
3
|
import { Box, IconButton, IconButtonProps, SxProps } from '@mui/material';
|
|
5
4
|
|
|
6
5
|
interface Props extends IconButtonProps {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { LazyMotion } from 'framer-motion';
|
|
3
3
|
|
|
4
|
-
// @ts-ignore
|
|
4
|
+
// @ts-ignore -- dynamic import of generated features file
|
|
5
5
|
const loadFeatures = () => import('./features.js').then((res) => res.default);
|
|
6
6
|
|
|
7
7
|
type Props = {
|
|
@@ -143,7 +143,7 @@ export function RHFMultiSelect({
|
|
|
143
143
|
displayEmpty={!!placeholder}
|
|
144
144
|
labelId={name}
|
|
145
145
|
input={<OutlinedInput fullWidth label={label} error={!!error} />}
|
|
146
|
-
// @ts-ignore
|
|
146
|
+
// @ts-ignore -- MUI Select renderValue type mismatch with custom renderer
|
|
147
147
|
renderValue={renderValues}
|
|
148
148
|
MenuProps={{
|
|
149
149
|
PaperProps: {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { lazy, Suspense } from 'react';
|
|
2
2
|
import { Box, Typography } from '@mui/material';
|
|
3
|
-
import Lottie from 'lottie-react';
|
|
4
3
|
import bankTransferAnimation from '../utils/data/lottie/bank-transfer.json';
|
|
5
4
|
import { varBounce } from '@components/animate';
|
|
6
5
|
import { m } from 'framer-motion';
|
|
7
6
|
import useGlobal from '@hooks/useGlobal';
|
|
8
7
|
|
|
8
|
+
const Lottie = lazy(() => import('lottie-react'));
|
|
9
|
+
|
|
9
10
|
const PaymentPending: React.FC = () => {
|
|
10
11
|
const { t } = useGlobal();
|
|
11
12
|
|
|
@@ -17,7 +18,9 @@ const PaymentPending: React.FC = () => {
|
|
|
17
18
|
</Typography>
|
|
18
19
|
</m.div>
|
|
19
20
|
<Box maxWidth={600} mx="auto">
|
|
20
|
-
<
|
|
21
|
+
<Suspense fallback={null}>
|
|
22
|
+
<Lottie animationData={bankTransferAnimation} />
|
|
23
|
+
</Suspense>
|
|
21
24
|
</Box>
|
|
22
25
|
</Box>
|
|
23
26
|
);
|
|
@@ -50,9 +50,9 @@ const PaymentSuccess: React.FC<Props> = ({ setIsPaying, isIframe, pixels }) => {
|
|
|
50
50
|
const { data } = await postOrderPaid({
|
|
51
51
|
gopayId: Number(paymentId),
|
|
52
52
|
});
|
|
53
|
-
const tickets = data
|
|
53
|
+
const { tickets } = data;
|
|
54
54
|
setTickets(tickets);
|
|
55
|
-
const products = data
|
|
55
|
+
const { products } = data;
|
|
56
56
|
setProducts(products);
|
|
57
57
|
setState(data.state);
|
|
58
58
|
setGwUrl(data.gwUrl);
|
package/src/form/Shipping.tsx
CHANGED
|
@@ -136,85 +136,83 @@ const Shipping: React.FC<Props> = ({ event }) => {
|
|
|
136
136
|
{t('event.tickets.stepper.5.error')}
|
|
137
137
|
</Typography>
|
|
138
138
|
) : (
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
<
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
>
|
|
161
|
-
<
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
>
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
{paymentImages[shippingMethod.type]}
|
|
179
|
-
</Stack>
|
|
180
|
-
{shippingMethod.type === ShippingTypes.PACKETA &&
|
|
181
|
-
shippingMethod.id === Number(shippingMethodId) &&
|
|
182
|
-
branchId && (
|
|
183
|
-
<Box>
|
|
184
|
-
<Button
|
|
185
|
-
onClick={handleChangeBranch}
|
|
186
|
-
variant="outlined"
|
|
187
|
-
size="small"
|
|
188
|
-
>
|
|
189
|
-
{t('change')}
|
|
190
|
-
</Button>
|
|
191
|
-
</Box>
|
|
192
|
-
)}
|
|
139
|
+
<Controller
|
|
140
|
+
name="shipping.shippingMethodId"
|
|
141
|
+
control={control}
|
|
142
|
+
render={({ field, fieldState: { error } }) => (
|
|
143
|
+
<FormControl component="fieldset" sx={{ width: '100%' }}>
|
|
144
|
+
<RadioGroup {...field}>
|
|
145
|
+
{filteredShippingMethods.map((shippingMethod) => (
|
|
146
|
+
<ShippingMethodItem
|
|
147
|
+
key={shippingMethod.id}
|
|
148
|
+
active={Number(shippingMethodId) === shippingMethod.id}
|
|
149
|
+
>
|
|
150
|
+
<FormControlLabel
|
|
151
|
+
value={shippingMethod.id}
|
|
152
|
+
control={<Radio />}
|
|
153
|
+
label={
|
|
154
|
+
<Stack
|
|
155
|
+
direction="row"
|
|
156
|
+
justifyContent="space-between"
|
|
157
|
+
alignItems="center"
|
|
158
|
+
width="100%"
|
|
159
|
+
>
|
|
160
|
+
<Stack direction="row" alignItems="center">
|
|
161
|
+
<Box
|
|
162
|
+
sx={{
|
|
163
|
+
marginRight: 2,
|
|
164
|
+
}}
|
|
165
|
+
>
|
|
166
|
+
<Typography sx={{ lineHeight: 1.2 }}>
|
|
167
|
+
{t(`shipping_method.types.${shippingMethod.type}`)}
|
|
168
|
+
</Typography>
|
|
169
|
+
{displayBranchName &&
|
|
170
|
+
shippingMethod.type === ShippingTypes.PACKETA &&
|
|
171
|
+
shippingMethod.id === Number(shippingMethodId) && (
|
|
172
|
+
<Typography variant="caption" sx={{ lineHeight: 1 }}>
|
|
173
|
+
{displayBranchName}
|
|
174
|
+
</Typography>
|
|
175
|
+
)}
|
|
176
|
+
</Box>
|
|
177
|
+
{paymentImages[shippingMethod.type]}
|
|
193
178
|
</Stack>
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
179
|
+
{shippingMethod.type === ShippingTypes.PACKETA &&
|
|
180
|
+
shippingMethod.id === Number(shippingMethodId) &&
|
|
181
|
+
branchId && (
|
|
182
|
+
<Box>
|
|
183
|
+
<Button
|
|
184
|
+
onClick={handleChangeBranch}
|
|
185
|
+
variant="outlined"
|
|
186
|
+
size="small"
|
|
187
|
+
>
|
|
188
|
+
{t('change')}
|
|
189
|
+
</Button>
|
|
190
|
+
</Box>
|
|
191
|
+
)}
|
|
192
|
+
</Stack>
|
|
193
|
+
}
|
|
194
|
+
sx={{
|
|
195
|
+
'&:not(:last-of-type)': {
|
|
196
|
+
mb: 0,
|
|
197
|
+
},
|
|
198
|
+
'& .MuiFormControlLabel-label': {
|
|
199
|
+
width: '100%',
|
|
200
|
+
mr: 0,
|
|
201
|
+
},
|
|
202
|
+
}}
|
|
203
|
+
/>
|
|
204
|
+
</ShippingMethodItem>
|
|
205
|
+
))}
|
|
206
|
+
</RadioGroup>
|
|
208
207
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
</>
|
|
208
|
+
{!!error && (
|
|
209
|
+
<FormHelperText error={!!error} sx={{ mx: 0 }}>
|
|
210
|
+
{error?.message}
|
|
211
|
+
</FormHelperText>
|
|
212
|
+
)}
|
|
213
|
+
</FormControl>
|
|
214
|
+
)}
|
|
215
|
+
/>
|
|
218
216
|
)}
|
|
219
217
|
</>
|
|
220
218
|
)}
|
package/src/form/TicketForm.tsx
CHANGED
|
@@ -301,7 +301,7 @@ const TicketForm: React.FC<Props> = ({
|
|
|
301
301
|
});
|
|
302
302
|
|
|
303
303
|
const methods = useForm<ITicketForm>({
|
|
304
|
-
// @ts-ignore
|
|
304
|
+
// @ts-ignore -- yup resolver type mismatch with dynamic schema
|
|
305
305
|
resolver: yupResolver(ValidationSchema),
|
|
306
306
|
defaultValues,
|
|
307
307
|
});
|
|
@@ -496,7 +496,7 @@ const TicketForm: React.FC<Props> = ({
|
|
|
496
496
|
isInline={isInline}
|
|
497
497
|
/>
|
|
498
498
|
) : (
|
|
499
|
-
// @ts-ignore
|
|
499
|
+
// @ts-ignore -- FormProvider expects stricter form types
|
|
500
500
|
<FormProvider methods={methods} onSubmit={methods.handleSubmit(onSubmit)}>
|
|
501
501
|
<Typography
|
|
502
502
|
className="overview-card__event-info"
|
|
@@ -603,7 +603,7 @@ const TicketForm: React.FC<Props> = ({
|
|
|
603
603
|
<EmailConfirmation
|
|
604
604
|
open={formStep === 2 && !isIframe}
|
|
605
605
|
onClose={() => setFormStep(1)}
|
|
606
|
-
// @ts-ignore
|
|
606
|
+
// @ts-ignore -- handleSubmit return type mismatch with onConfirm prop
|
|
607
607
|
onConfirm={methods.handleSubmit(onSubmit)}
|
|
608
608
|
/>
|
|
609
609
|
</FormProvider>
|
package/src/locales/en.tsx
CHANGED
|
@@ -124,7 +124,7 @@ const en = {
|
|
|
124
124
|
label: 'SMS event reminder',
|
|
125
125
|
modal: {
|
|
126
126
|
description:
|
|
127
|
-
|
|
127
|
+
"Event reminder the day before: SMS will notify you about the upcoming event so you don't forget and have time to prepare.",
|
|
128
128
|
price: 'SMS event reminder price',
|
|
129
129
|
},
|
|
130
130
|
},
|