@gomusdev/web-components 0.0.19 → 0.0.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.
- package/dist-js/components/cart/lib/CartItem.d.ts +135 -0
- package/dist-js/components/cart/lib/cart.svelte.d.ts +563 -24
- package/dist-js/components/cart/lib/localStorage.svelte.d.ts +146 -0
- package/dist-js/components/cart/mocks/gomusTicketMocks.d.ts +112 -0
- package/dist-js/components/ticketSelection/SpecUtils.d.ts +3 -0
- package/dist-js/components/ticketSelection/{lib.svelte.d.ts → TicketSelectionDetails.svelte.d.ts} +10 -7
- package/dist-js/components/ticketSelection/subcomponents/addToCartButton/AddToCartButton.svelte.d.ts +6 -0
- package/dist-js/components/ticketSelection/subcomponents/addToCartButton/AddToCartButton.svelte.spec.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/addToCartButton/entry.d.ts +0 -0
- package/dist-js/components/ticketSelection/subcomponents/calendar/lib/calendar.svelte.d.ts +1 -4
- package/dist-js/components/ticketSelection/subcomponents/tickets/Tickets.spec.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/TicketGroup.svelte.d.ts +626 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/TicketsSum.svelte.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/addToCartButton/entry.d.ts +0 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/utils.spec.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/utils.svelte.d.ts +9 -0
- package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/__mocks__/generateAvailableTimeSlots.d.ts +8 -0
- package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/generateAvailableTimeSlots.specs.d.ts +1 -121
- package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/lib.svelte.d.ts +1 -1
- package/dist-js/config/config.d.ts +11 -0
- package/dist-js/config/config.spec.d.ts +1 -0
- package/dist-js/gomus-webcomponents.css +159 -0
- package/dist-js/gomus-webcomponents.iife.js +2085 -2590
- package/dist-js/gomus-webcomponents.js +2082 -2587
- package/dist-js/lib/gomusTicket.spec.d.ts +1 -0
- package/dist-js/lib/gomusTicket.svelte.d.ts +122 -0
- package/dist-js/lib/helpers/PropertyTracker.d.ts +9 -0
- package/dist-js/lib/helpers/PropertyTracker.spec.d.ts +1 -0
- package/dist-js/lib/helpers/utils.d.ts +1 -0
- package/dist-js/lib/stores/shop.svelte.d.ts +55 -1
- package/dist-js/lib/stores/shop.svelte.test.d.ts +1 -3
- package/dist-js/lib/vitest/msw/handlers.d.ts +1 -1
- package/dist-js/mocks/ShopMocks.d.ts +179 -0
- package/dist-js/mocks/mocks.d.ts +1922 -0
- package/package.json +5 -1
- package/dist-js/components/cart/lib/lib.d.ts +0 -3
- package/dist-js/components/cart/mocks/gomusTickets.d.ts +0 -56
- package/dist-js/components/ticketSelection/subcomponents/checkoutButton/lib/lib.svelte.d.ts +0 -6
- package/dist-js/components/ticketSelection/subcomponents/tickets/lib/lib.svelte.d.ts +0 -9
- package/dist-js/lib/gomusTickets.svelte.d.ts +0 -47
- /package/dist-js/components/cart/{lib/cart.spec.d.ts → components/Cart.spec.d.ts} +0 -0
- /package/dist-js/components/{ticketSelection/lib.spec.d.ts → cart/lib/cart.svelte.spec.d.ts} +0 -0
- /package/dist-js/components/{ticketSelection/subcomponents/tickets/components/Tickets.spec.d.ts → cart/lib/localStorage.spec.d.ts} +0 -0
- /package/dist-js/components/{cart/components/items/Ticket.svelte.d.ts → if/If.svelte.d.ts} +0 -0
- /package/dist-js/components/{ticketSelection/subcomponents/checkoutButton → if}/entry.d.ts +0 -0
- /package/dist-js/{lib/gomusTickets.spec.d.ts → components/ticketSelection/TicketSelectionDetails.spec.d.ts} +0 -0
- /package/dist-js/{lib/helpers/reactivity.svelte.test.d.ts → components/ticketSelection/subcomponents/addToCartButton/AddToCartButton.spec.d.ts} +0 -0
- /package/dist-js/components/ticketSelection/subcomponents/tickets/{components/Tickets.svelte.d.ts → Tickets.svelte.d.ts} +0 -0
- /package/dist-js/components/ticketSelection/subcomponents/tickets/{components/fixtures → fixtures}/ticketFixtures.d.ts +0 -0
- /package/dist-js/components/ticketSelection/{SelectionTotal.svelte.d.ts → subcomponents/tickets/subcomponents/GroupBody.svelte.d.ts} +0 -0
- /package/dist-js/components/ticketSelection/subcomponents/{checkoutButton/components/CheckoutButton.svelte.d.ts → tickets/subcomponents/GroupSum.svelte.d.ts} +0 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { Cart } from './cart.svelte.ts';
|
|
2
|
+
import { OrderItemType } from './CartItem.ts';
|
|
3
|
+
export declare function updateLocalStorage(cart: Cart): string;
|
|
4
|
+
export declare function clearLocalStorage(): void;
|
|
5
|
+
export declare function loadFromLocalStorage(cart: Cart): {
|
|
6
|
+
type: OrderItemType;
|
|
7
|
+
item: {
|
|
8
|
+
type: "annual" | "timeslot" | "day";
|
|
9
|
+
shop_order: number;
|
|
10
|
+
max_capacity: number;
|
|
11
|
+
min_quantity: number;
|
|
12
|
+
max_quantity: number;
|
|
13
|
+
minAvailableCapacity: number;
|
|
14
|
+
selectedTime: string;
|
|
15
|
+
quantity: number;
|
|
16
|
+
id: number;
|
|
17
|
+
title: string;
|
|
18
|
+
ticket_type: "time_slot" | "annual" | "normal";
|
|
19
|
+
bookable: boolean;
|
|
20
|
+
museum_ids: number[];
|
|
21
|
+
exhibition_ids: number[];
|
|
22
|
+
price_cents: number;
|
|
23
|
+
discount: number;
|
|
24
|
+
vat_pct: number;
|
|
25
|
+
tax_included: boolean;
|
|
26
|
+
entry_duration: number | null;
|
|
27
|
+
min_persons: number;
|
|
28
|
+
max_persons: number;
|
|
29
|
+
quota_ids: number[];
|
|
30
|
+
first_entry: number;
|
|
31
|
+
last_entry: number;
|
|
32
|
+
personalizeable: boolean;
|
|
33
|
+
attendees: boolean | string;
|
|
34
|
+
identification: boolean | string;
|
|
35
|
+
free_timing: boolean;
|
|
36
|
+
is_collective: boolean;
|
|
37
|
+
is_upgrade: boolean;
|
|
38
|
+
is_mantle: boolean;
|
|
39
|
+
description: string | null;
|
|
40
|
+
sub_ticket_ids: number[];
|
|
41
|
+
sub_tickets: {
|
|
42
|
+
[key: string]: {
|
|
43
|
+
title?: string;
|
|
44
|
+
min_persons?: number;
|
|
45
|
+
max_persons?: number;
|
|
46
|
+
description?: string | null;
|
|
47
|
+
};
|
|
48
|
+
} | null;
|
|
49
|
+
is_sub_ticket: boolean;
|
|
50
|
+
created_at: string;
|
|
51
|
+
updated_at: string;
|
|
52
|
+
shipped_with_merchandise_id: number | null;
|
|
53
|
+
restricted_shop_account: boolean;
|
|
54
|
+
cash_point_order: number;
|
|
55
|
+
capacities: {
|
|
56
|
+
[key: string]: number;
|
|
57
|
+
};
|
|
58
|
+
total_capacities: {
|
|
59
|
+
[key: string]: number;
|
|
60
|
+
};
|
|
61
|
+
max_total_capacity: number;
|
|
62
|
+
dynamic_prices: {
|
|
63
|
+
[key: string]: number;
|
|
64
|
+
} | null;
|
|
65
|
+
uid: number;
|
|
66
|
+
} | {
|
|
67
|
+
type: "annual" | "timeslot" | "day";
|
|
68
|
+
shop_order: number;
|
|
69
|
+
max_capacity: number;
|
|
70
|
+
min_quantity: number;
|
|
71
|
+
max_quantity: number;
|
|
72
|
+
minAvailableCapacity: number;
|
|
73
|
+
selectedTime: string;
|
|
74
|
+
quantity: number;
|
|
75
|
+
id: number;
|
|
76
|
+
title: string;
|
|
77
|
+
ticket_type: "time_slot" | "annual" | "normal";
|
|
78
|
+
bookable: boolean;
|
|
79
|
+
museum_ids: number[];
|
|
80
|
+
exhibition_ids: number[];
|
|
81
|
+
price_cents: number;
|
|
82
|
+
discount: number;
|
|
83
|
+
vat_pct: number;
|
|
84
|
+
tax_included: boolean;
|
|
85
|
+
entry_duration: number | null;
|
|
86
|
+
min_persons: number;
|
|
87
|
+
max_persons: number;
|
|
88
|
+
quota_ids: number[];
|
|
89
|
+
first_entry: number;
|
|
90
|
+
last_entry: number;
|
|
91
|
+
personalizeable: boolean;
|
|
92
|
+
attendees: boolean | string;
|
|
93
|
+
identification: boolean | string;
|
|
94
|
+
free_timing: boolean;
|
|
95
|
+
is_collective: boolean;
|
|
96
|
+
is_upgrade: boolean;
|
|
97
|
+
is_mantle: boolean;
|
|
98
|
+
description: string | null;
|
|
99
|
+
sub_ticket_ids: number[];
|
|
100
|
+
sub_tickets: {
|
|
101
|
+
[key: string]: {
|
|
102
|
+
title?: string;
|
|
103
|
+
min_persons?: number;
|
|
104
|
+
max_persons?: number;
|
|
105
|
+
description?: string | null;
|
|
106
|
+
};
|
|
107
|
+
} | null;
|
|
108
|
+
is_sub_ticket: boolean;
|
|
109
|
+
created_at: string;
|
|
110
|
+
updated_at: string;
|
|
111
|
+
shipped_with_merchandise_id: number | null;
|
|
112
|
+
restricted_shop_account: boolean;
|
|
113
|
+
cash_point_order: number;
|
|
114
|
+
dynamic_prices: {
|
|
115
|
+
[key: string]: number;
|
|
116
|
+
} | null;
|
|
117
|
+
uid: number;
|
|
118
|
+
};
|
|
119
|
+
attributes: {
|
|
120
|
+
id: number;
|
|
121
|
+
time: string;
|
|
122
|
+
quantity: number;
|
|
123
|
+
shipped_with_merchandise_id?: number | null;
|
|
124
|
+
} | {
|
|
125
|
+
id: number;
|
|
126
|
+
time: string;
|
|
127
|
+
quantity: number;
|
|
128
|
+
shipped_with_merchandise_id?: number | null;
|
|
129
|
+
};
|
|
130
|
+
uuid: string;
|
|
131
|
+
price_cents: number;
|
|
132
|
+
price_formatted: string;
|
|
133
|
+
final_price_cents: number;
|
|
134
|
+
final_price_formatted: string;
|
|
135
|
+
total_price_cents: number;
|
|
136
|
+
total_price_formatted: string;
|
|
137
|
+
quantity: number;
|
|
138
|
+
time: string;
|
|
139
|
+
}[];
|
|
140
|
+
/**
|
|
141
|
+
* Synchronizes the given shopping cart with the local storage. The method ensures that the cart is loaded from local storage,
|
|
142
|
+
* updates are reflected in the local storage, and any external changes to the local storage are propagated to the cart.
|
|
143
|
+
*
|
|
144
|
+
* @return {void} This method does not return a value.
|
|
145
|
+
*/
|
|
146
|
+
export declare function syncCartToLocalStorage(cart: Cart): void;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
export declare function createMockGomusTicket(): {
|
|
2
|
+
type: "annual" | "timeslot" | "day";
|
|
3
|
+
shop_order: number;
|
|
4
|
+
max_capacity: number;
|
|
5
|
+
min_quantity: number;
|
|
6
|
+
max_quantity: number;
|
|
7
|
+
minAvailableCapacity: number;
|
|
8
|
+
selectedTime: string;
|
|
9
|
+
quantity: number;
|
|
10
|
+
id: number;
|
|
11
|
+
title: string;
|
|
12
|
+
ticket_type: "time_slot" | "annual" | "normal";
|
|
13
|
+
bookable: boolean;
|
|
14
|
+
museum_ids: number[];
|
|
15
|
+
exhibition_ids: number[];
|
|
16
|
+
price_cents: number;
|
|
17
|
+
discount: number;
|
|
18
|
+
vat_pct: number;
|
|
19
|
+
tax_included: boolean;
|
|
20
|
+
entry_duration: number | null;
|
|
21
|
+
min_persons: number;
|
|
22
|
+
max_persons: number;
|
|
23
|
+
quota_ids: number[];
|
|
24
|
+
first_entry: number;
|
|
25
|
+
last_entry: number;
|
|
26
|
+
personalizeable: boolean;
|
|
27
|
+
attendees: boolean | string;
|
|
28
|
+
identification: boolean | string;
|
|
29
|
+
free_timing: boolean;
|
|
30
|
+
is_collective: boolean;
|
|
31
|
+
is_upgrade: boolean;
|
|
32
|
+
is_mantle: boolean;
|
|
33
|
+
description: string | null;
|
|
34
|
+
sub_ticket_ids: number[];
|
|
35
|
+
sub_tickets: {
|
|
36
|
+
[key: string]: {
|
|
37
|
+
title?: string;
|
|
38
|
+
min_persons?: number;
|
|
39
|
+
max_persons?: number;
|
|
40
|
+
description?: string | null;
|
|
41
|
+
};
|
|
42
|
+
} | null;
|
|
43
|
+
is_sub_ticket: boolean;
|
|
44
|
+
created_at: string;
|
|
45
|
+
updated_at: string;
|
|
46
|
+
shipped_with_merchandise_id: number | null;
|
|
47
|
+
restricted_shop_account: boolean;
|
|
48
|
+
cash_point_order: number;
|
|
49
|
+
capacities: {
|
|
50
|
+
[key: string]: number;
|
|
51
|
+
};
|
|
52
|
+
total_capacities: {
|
|
53
|
+
[key: string]: number;
|
|
54
|
+
};
|
|
55
|
+
max_total_capacity: number;
|
|
56
|
+
dynamic_prices: {
|
|
57
|
+
[key: string]: number;
|
|
58
|
+
} | null;
|
|
59
|
+
uid: number;
|
|
60
|
+
} | {
|
|
61
|
+
type: "annual" | "timeslot" | "day";
|
|
62
|
+
shop_order: number;
|
|
63
|
+
max_capacity: number;
|
|
64
|
+
min_quantity: number;
|
|
65
|
+
max_quantity: number;
|
|
66
|
+
minAvailableCapacity: number;
|
|
67
|
+
selectedTime: string;
|
|
68
|
+
quantity: number;
|
|
69
|
+
id: number;
|
|
70
|
+
title: string;
|
|
71
|
+
ticket_type: "time_slot" | "annual" | "normal";
|
|
72
|
+
bookable: boolean;
|
|
73
|
+
museum_ids: number[];
|
|
74
|
+
exhibition_ids: number[];
|
|
75
|
+
price_cents: number;
|
|
76
|
+
discount: number;
|
|
77
|
+
vat_pct: number;
|
|
78
|
+
tax_included: boolean;
|
|
79
|
+
entry_duration: number | null;
|
|
80
|
+
min_persons: number;
|
|
81
|
+
max_persons: number;
|
|
82
|
+
quota_ids: number[];
|
|
83
|
+
first_entry: number;
|
|
84
|
+
last_entry: number;
|
|
85
|
+
personalizeable: boolean;
|
|
86
|
+
attendees: boolean | string;
|
|
87
|
+
identification: boolean | string;
|
|
88
|
+
free_timing: boolean;
|
|
89
|
+
is_collective: boolean;
|
|
90
|
+
is_upgrade: boolean;
|
|
91
|
+
is_mantle: boolean;
|
|
92
|
+
description: string | null;
|
|
93
|
+
sub_ticket_ids: number[];
|
|
94
|
+
sub_tickets: {
|
|
95
|
+
[key: string]: {
|
|
96
|
+
title?: string;
|
|
97
|
+
min_persons?: number;
|
|
98
|
+
max_persons?: number;
|
|
99
|
+
description?: string | null;
|
|
100
|
+
};
|
|
101
|
+
} | null;
|
|
102
|
+
is_sub_ticket: boolean;
|
|
103
|
+
created_at: string;
|
|
104
|
+
updated_at: string;
|
|
105
|
+
shipped_with_merchandise_id: number | null;
|
|
106
|
+
restricted_shop_account: boolean;
|
|
107
|
+
cash_point_order: number;
|
|
108
|
+
dynamic_prices: {
|
|
109
|
+
[key: string]: number;
|
|
110
|
+
} | null;
|
|
111
|
+
uid: number;
|
|
112
|
+
};
|
package/dist-js/components/ticketSelection/{lib.svelte.d.ts → TicketSelectionDetails.svelte.d.ts}
RENAMED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Cart } from '../cart/lib/cart.svelte.ts';
|
|
2
|
+
import { TicketGroupDetails } from './subcomponents/tickets/subcomponents/TicketGroup.svelte.ts';
|
|
2
3
|
import { CalendarDate } from '@internationalized/date';
|
|
3
|
-
import { CartItem } from '../cart/lib/cart.svelte';
|
|
4
4
|
export type TicketSelectionMode = 'ticket' | 'event' | 'tour';
|
|
5
|
-
export
|
|
5
|
+
export declare const validTicketSelectionFilters: readonly ["timeslot", "normal", "annual"];
|
|
6
|
+
export type TicketSelectionFilter = (typeof validTicketSelectionFilters)[number];
|
|
6
7
|
export declare class TicketSelectionDetails {
|
|
8
|
+
uid: number;
|
|
7
9
|
mode: TicketSelectionMode | undefined;
|
|
8
10
|
filters: TicketSelectionFilter[] | undefined;
|
|
9
11
|
eventId: number | undefined;
|
|
@@ -12,11 +14,12 @@ export declare class TicketSelectionDetails {
|
|
|
12
14
|
ticketIds: number[] | undefined;
|
|
13
15
|
selectedDate: CalendarDate | undefined;
|
|
14
16
|
selectedTimeslot: string | undefined;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
ticketGroups: TicketGroupDetails[];
|
|
18
|
+
preCarts: Cart[];
|
|
19
|
+
addTicketGroup(ticketGroup: TicketGroupDetails): void;
|
|
20
|
+
addPreCart(precart: Cart): void;
|
|
18
21
|
get isTimeslotsVisible(): boolean;
|
|
19
|
-
get isTicketsVisible(): boolean;
|
|
22
|
+
get isTicketsVisible(): boolean | undefined;
|
|
20
23
|
get isCalendarVisible(): boolean;
|
|
21
24
|
}
|
|
22
25
|
export declare const setTicketSelectionDetails: (host: HTMLElement, details: TicketSelectionDetails) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TicketSelectionDetails } from '../../../
|
|
1
|
+
import { TicketSelectionDetails } from '../../../TicketSelectionDetails.svelte.ts';
|
|
2
2
|
import { TicketsCalendarParams } from '@gomus/api/lib/types.ts';
|
|
3
3
|
import { DateValue, CalendarDate } from '@internationalized/date';
|
|
4
4
|
export type CalendarDates = {
|
|
@@ -33,6 +33,3 @@ export declare class TicketsCalendar extends Calendar {
|
|
|
33
33
|
params: TicketsCalendarParams;
|
|
34
34
|
get dates(): CalendarDates;
|
|
35
35
|
}
|
|
36
|
-
export declare class EventsCalendar {
|
|
37
|
-
}
|
|
38
|
-
export declare const ticketsCalendar: TicketsCalendar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|