@gomusdev/web-components 0.0.17 → 0.0.19
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/components/Cart.svelte.d.ts +1 -0
- package/dist-js/components/cart/components/items/Ticket.svelte.d.ts +1 -0
- package/dist-js/components/cart/entry.d.ts +0 -0
- package/dist-js/components/cart/lib/cart.spec.d.ts +1 -0
- package/dist-js/components/cart/lib/cart.svelte.d.ts +25 -0
- package/dist-js/components/cart/lib/lib.d.ts +3 -0
- package/dist-js/components/cart/mocks/gomusTickets.d.ts +56 -0
- package/dist-js/components/cart/mocks/testCart.d.ts +306 -0
- package/dist-js/components/donations/lib/donation.spec.d.ts +1 -0
- package/dist-js/components/donations/lib/donation.svelte.d.ts +9 -0
- package/dist-js/components/entry.d.ts +0 -0
- package/dist-js/components/forms/entry.d.ts +0 -0
- package/dist-js/components/forms/lib/Field.svelte.d.ts +26 -0
- package/dist-js/components/forms/lib/allFields.d.ts +3 -0
- package/dist-js/components/forms/lib/details.svelte.d.ts +11 -0
- package/dist-js/components/forms/lib/forms.svelte.d.ts +19 -0
- package/dist-js/components/graveyard/event/entry.d.ts +0 -0
- package/dist-js/components/graveyard/event/lib.svelte.d.ts +43 -0
- package/dist-js/components/graveyard/events/entry.d.ts +0 -0
- package/dist-js/components/if/If.svelte.spec.d.ts +1 -0
- package/dist-js/components/if/expression.d.ts +1 -0
- package/dist-js/components/if/expression.spec.d.ts +1 -0
- package/dist-js/components/init/GomusInit.svelte.d.ts +1 -0
- package/dist-js/components/init/GomusInit.test.d.ts +1 -0
- package/dist-js/components/init/Init.svelte.d.ts +1 -0
- package/dist-js/components/init/entry.d.ts +0 -0
- package/dist-js/components/mainnav/components/MainNav.spec.d.ts +1 -0
- package/dist-js/components/mainnav/fixtures/fixtures.d.ts +2 -0
- package/dist-js/components/mainnav/lib/generators/generate.d.ts +4 -0
- package/dist-js/components/mainnav/lib/generators/generate.spec.d.ts +1 -0
- package/dist-js/components/mainnav/lib/generators/labelGenerators.d.ts +2 -0
- package/dist-js/components/mainnav/lib/generators/navGenerators.d.ts +2 -0
- package/dist-js/components/mainnav/lib/generators/subNavGenerators.d.ts +7 -0
- package/dist-js/components/mainnav/lib/generators/urlGenerators.d.ts +2 -0
- package/dist-js/components/mainnav/lib/navigation.d.ts +32 -0
- package/dist-js/components/mainnav/lib/navigation.spec.d.ts +1 -0
- package/dist-js/components/mainnav/lib/states/OpenedDropdown.svelte.d.ts +20 -0
- package/dist-js/components/mainnav/lib/states/pageState.svelte.d.ts +7 -0
- package/dist-js/components/paypal/lib/PaymentError.d.ts +3 -0
- package/dist-js/components/paypal/lib/approvePaypalOrder.d.ts +4 -0
- package/dist-js/components/paypal/lib/getPaypalOrder.d.ts +1 -0
- package/dist-js/components/paypal/payment-method-component/paymentIcons.d.ts +14 -0
- package/dist-js/components/paypal/payment-method-component/paymentMethodStore.svelte.d.ts +3 -0
- package/dist-js/components/paypal/payment-methods/apm.d.ts +3 -0
- package/dist-js/components/paypal/payment-methods/applepay/applePay.d.ts +2 -0
- package/dist-js/components/paypal/payment-methods/currentOrder.svelte.d.ts +3 -0
- package/dist-js/components/paypal/payment-methods/defaults.d.ts +28 -0
- package/dist-js/components/paypal/payment-methods/googlepay/googlePay.d.ts +2 -0
- package/dist-js/components/paypal/payment-methods/loadPaypalScript.d.ts +5 -0
- package/dist-js/components/ticketSelection/SelectionTotal.svelte.d.ts +1 -0
- package/dist-js/components/ticketSelection/TicketSelection.spec.d.ts +1 -0
- package/dist-js/components/ticketSelection/TicketSelection.svelte.d.ts +1 -0
- package/dist-js/components/ticketSelection/entry.d.ts +0 -0
- package/dist-js/components/ticketSelection/lib.spec.d.ts +1 -0
- package/dist-js/components/ticketSelection/lib.svelte.d.ts +23 -0
- package/dist-js/components/ticketSelection/subcomponents/calendar/components/Calendar.svelte.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/calendar/components/CalendarUI.spec.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/calendar/components/CalendarUI.svelte.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/calendar/entry.d.ts +0 -0
- package/dist-js/components/ticketSelection/subcomponents/calendar/lib/calendar.svelte.d.ts +38 -0
- package/dist-js/components/ticketSelection/subcomponents/calendar/mocks/datesMock.d.ts +33 -0
- package/dist-js/components/ticketSelection/subcomponents/checkoutButton/components/CheckoutButton.svelte.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/checkoutButton/entry.d.ts +0 -0
- package/dist-js/components/ticketSelection/subcomponents/checkoutButton/lib/lib.svelte.d.ts +6 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/components/Tickets.spec.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/components/Tickets.svelte.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/components/fixtures/ticketFixtures.d.ts +191 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/entry.d.ts +0 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/lib/lib.svelte.d.ts +9 -0
- package/dist-js/components/ticketSelection/subcomponents/timeslots/Timeslots.spec.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/timeslots/Timeslots.svelte.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/timeslots/entry.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/generateAvailableTimeSlots.d.ts +50 -0
- package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/generateAvailableTimeSlots.specs.d.ts +121 -0
- package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/lib.spec.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/lib.svelte.d.ts +6 -0
- package/dist-js/config/config.d.ts +1 -0
- package/dist-js/e2e/APMs.e2e.spec.d.ts +1 -0
- package/dist-js/e2e/Card.e2e.spec.d.ts +1 -0
- package/dist-js/e2e/testApm.d.ts +7 -0
- package/dist-js/go.svelte.d.ts +1 -0
- package/dist-js/gomus-webcomponents.css +111 -0
- package/dist-js/gomus-webcomponents.iife.js +178 -294
- package/dist-js/gomus-webcomponents.js +17039 -0
- package/dist-js/lib/annual-ticket-personalization/index.d.ts +1 -0
- package/dist-js/lib/annual-ticket-personalization/stores.d.ts +3 -0
- package/dist-js/lib/gomusTickets.spec.d.ts +1 -0
- package/dist-js/lib/gomusTickets.svelte.d.ts +47 -0
- package/dist-js/lib/helpers/DataHolder.d.ts +3 -0
- package/dist-js/lib/helpers/Events.d.ts +6 -0
- package/dist-js/lib/helpers/ShadowStyles.svelte.d.ts +1 -0
- package/dist-js/lib/helpers/Wrapper.svelte.d.ts +1 -0
- package/dist-js/lib/helpers/context.spec.d.ts +1 -0
- package/dist-js/lib/helpers/context.svelte.d.ts +2 -0
- package/dist-js/lib/helpers/dataAttr.d.ts +9 -0
- package/dist-js/lib/helpers/dataAttr.spec.d.ts +1 -0
- package/dist-js/lib/helpers/fixtures/context/lib.d.ts +5 -0
- package/dist-js/lib/helpers/reactivity.svelte.test.d.ts +1 -0
- package/dist-js/lib/helpers/shopCart.d.ts +34 -0
- package/dist-js/lib/helpers/translations.d.ts +752 -0
- package/dist-js/lib/helpers/urls.d.ts +62 -0
- package/dist-js/lib/helpers/utils.d.ts +24 -0
- package/dist-js/lib/stores/__mocks__/shop.svelte.d.ts +2 -0
- package/dist-js/lib/stores/shop.svelte.d.ts +1170 -0
- package/dist-js/lib/stores/shop.svelte.test.d.ts +3 -0
- package/dist-js/lib/stores/user.svelte.d.ts +16 -0
- package/dist-js/lib/stores/user.svelte.test.d.ts +1 -0
- package/dist-js/lib/storybook/WrapperComponent.d.ts +1 -0
- package/dist-js/lib/storybook/sbGlobals.svelte.d.ts +9 -0
- package/dist-js/lib/types/types.d.ts +1 -0
- package/dist-js/lib/utils.d.ts +1 -0
- package/dist-js/lib/vitest/mockedCookies.d.ts +2 -0
- package/dist-js/lib/vitest/msw/basicHandlers.d.ts +3 -0
- package/dist-js/lib/vitest/msw/handlers.d.ts +1758 -0
- package/dist-js/lib/vitest/msw/vitestMSWSetup.d.ts +2 -0
- package/dist-js/lib/vitest/snapshotSerializer.d.ts +1 -0
- package/dist-js/main.d.ts +5 -0
- package/dist-js/sveltekit/app/environment.d.ts +1 -0
- package/dist-js/sveltekit/app/forms.d.ts +23 -0
- package/dist-js/sveltekit/app/navigation.d.ts +4 -0
- package/dist-js/sveltekit/app/stores.d.ts +2 -0
- package/dist-js/vitest-setup.d.ts +0 -0
- package/package.json +3 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NavEntry } from '../navigation.ts';
|
|
2
|
+
export declare class PageState {
|
|
3
|
+
currentPage: string | undefined;
|
|
4
|
+
isActivePage(currentUrl: string, entry: NavEntry): boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function setPageState(): PageState;
|
|
7
|
+
export declare function getPageState(): PageState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getPaypalOrder(orderId: string): Promise<any>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const paymentIcons: {
|
|
2
|
+
applepay: string;
|
|
3
|
+
bancontact: string;
|
|
4
|
+
blik: string;
|
|
5
|
+
eps: string;
|
|
6
|
+
googlepay: string;
|
|
7
|
+
ideal: string;
|
|
8
|
+
mybank: string;
|
|
9
|
+
p24: string;
|
|
10
|
+
paypal: string;
|
|
11
|
+
trustly: string;
|
|
12
|
+
card: string;
|
|
13
|
+
multibanco: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PayPalButtonsComponentOptions, PayPalNamespace } from '@paypal/paypal-js';
|
|
2
|
+
export declare function apmButton(paypal: PayPalNamespace, containerSelector: string, options: PayPalButtonsComponentOptions, currency?: string): Promise<void>;
|
|
3
|
+
export declare function apmFields(paypal: PayPalNamespace, containerSelector: string, options: {}): Promise<void>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const setCart: (card: string) => void;
|
|
2
|
+
export declare const setDefaultCart: () => void;
|
|
3
|
+
export declare const defaultCart: {
|
|
4
|
+
type: string;
|
|
5
|
+
attributes: {
|
|
6
|
+
id: number;
|
|
7
|
+
time: string;
|
|
8
|
+
quantity: number;
|
|
9
|
+
shipped_with_merchandise_id: null;
|
|
10
|
+
};
|
|
11
|
+
cart: {
|
|
12
|
+
name: string;
|
|
13
|
+
price_cents: number;
|
|
14
|
+
vats: {
|
|
15
|
+
vat_pct: string;
|
|
16
|
+
price_cents: number;
|
|
17
|
+
}[];
|
|
18
|
+
tax_included: boolean;
|
|
19
|
+
meta: {
|
|
20
|
+
startDate: string;
|
|
21
|
+
};
|
|
22
|
+
available: number[];
|
|
23
|
+
free_timing: boolean;
|
|
24
|
+
flex_description: null;
|
|
25
|
+
totalCents: number;
|
|
26
|
+
};
|
|
27
|
+
updated_at: string;
|
|
28
|
+
}[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SvelteComponent as default } from 'svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SvelteComponent as default } from 'svelte';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GomusTicket } from '../../lib/gomusTickets.svelte.ts';
|
|
2
|
+
import { CalendarDate } from '@internationalized/date';
|
|
3
|
+
import { CartItem } from '../cart/lib/cart.svelte';
|
|
4
|
+
export type TicketSelectionMode = 'ticket' | 'event' | 'tour';
|
|
5
|
+
export type TicketSelectionFilter = 'time_slot' | 'normal' | 'annual';
|
|
6
|
+
export declare class TicketSelectionDetails {
|
|
7
|
+
mode: TicketSelectionMode | undefined;
|
|
8
|
+
filters: TicketSelectionFilter[] | undefined;
|
|
9
|
+
eventId: number | undefined;
|
|
10
|
+
museumIds: number[] | undefined;
|
|
11
|
+
exhibitionIds: number[] | undefined;
|
|
12
|
+
ticketIds: number[] | undefined;
|
|
13
|
+
selectedDate: CalendarDate | undefined;
|
|
14
|
+
selectedTimeslot: string | undefined;
|
|
15
|
+
selectedTickets: CartItem[];
|
|
16
|
+
ticketList: GomusTicket[];
|
|
17
|
+
total: string | 0;
|
|
18
|
+
get isTimeslotsVisible(): boolean;
|
|
19
|
+
get isTicketsVisible(): boolean;
|
|
20
|
+
get isCalendarVisible(): boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare const setTicketSelectionDetails: (host: HTMLElement, details: TicketSelectionDetails) => void;
|
|
23
|
+
export declare const getTicketSelectionDetails: (host: HTMLElement) => TicketSelectionDetails | undefined;
|
package/dist-js/components/ticketSelection/subcomponents/calendar/components/Calendar.svelte.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SvelteComponent as default } from 'svelte';
|
package/dist-js/components/ticketSelection/subcomponents/calendar/components/CalendarUI.spec.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist-js/components/ticketSelection/subcomponents/calendar/components/CalendarUI.svelte.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SvelteComponent as default } from 'svelte';
|
|
File without changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { TicketSelectionDetails } from '../../../lib.svelte.js';
|
|
2
|
+
import { TicketsCalendarParams } from '@gomus/api/lib/types.ts';
|
|
3
|
+
import { DateValue, CalendarDate } from '@internationalized/date';
|
|
4
|
+
export type CalendarDates = {
|
|
5
|
+
[key: string]: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare abstract class Calendar {
|
|
8
|
+
startAt: CalendarDate;
|
|
9
|
+
selected: CalendarDate | undefined;
|
|
10
|
+
abstract get dates(): {
|
|
11
|
+
[key: string]: boolean;
|
|
12
|
+
} | undefined;
|
|
13
|
+
isDateDisabled(date: DateValue): boolean;
|
|
14
|
+
isDateUnavailable(date: DateValue): boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare class StaticCalendar extends Calendar {
|
|
17
|
+
#private;
|
|
18
|
+
params: {
|
|
19
|
+
start_at: undefined;
|
|
20
|
+
};
|
|
21
|
+
constructor(dates?: {
|
|
22
|
+
[key: string]: boolean;
|
|
23
|
+
});
|
|
24
|
+
get dates(): {
|
|
25
|
+
[key: string]: boolean;
|
|
26
|
+
};
|
|
27
|
+
set dates(dates: {
|
|
28
|
+
[key: string]: boolean;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export declare class TicketsCalendar extends Calendar {
|
|
32
|
+
details: TicketSelectionDetails | undefined;
|
|
33
|
+
params: TicketsCalendarParams;
|
|
34
|
+
get dates(): CalendarDates;
|
|
35
|
+
}
|
|
36
|
+
export declare class EventsCalendar {
|
|
37
|
+
}
|
|
38
|
+
export declare const ticketsCalendar: TicketsCalendar;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const datesMock: {
|
|
2
|
+
'2025-07-01': boolean;
|
|
3
|
+
'2025-07-02': boolean;
|
|
4
|
+
'2025-07-03': boolean;
|
|
5
|
+
'2025-07-04': boolean;
|
|
6
|
+
'2025-07-05': boolean;
|
|
7
|
+
'2025-07-06': boolean;
|
|
8
|
+
'2025-07-07': boolean;
|
|
9
|
+
'2025-07-08': boolean;
|
|
10
|
+
'2025-07-09': boolean;
|
|
11
|
+
'2025-07-10': boolean;
|
|
12
|
+
'2025-07-11': boolean;
|
|
13
|
+
'2025-07-12': boolean;
|
|
14
|
+
'2025-07-13': boolean;
|
|
15
|
+
'2025-07-14': boolean;
|
|
16
|
+
'2025-07-15': boolean;
|
|
17
|
+
'2025-07-16': boolean;
|
|
18
|
+
'2025-07-17': boolean;
|
|
19
|
+
'2025-07-18': boolean;
|
|
20
|
+
'2025-07-19': boolean;
|
|
21
|
+
'2025-07-20': boolean;
|
|
22
|
+
'2025-07-21': boolean;
|
|
23
|
+
'2025-07-22': boolean;
|
|
24
|
+
'2025-07-23': boolean;
|
|
25
|
+
'2025-07-24': boolean;
|
|
26
|
+
'2025-07-25': boolean;
|
|
27
|
+
'2025-07-26': boolean;
|
|
28
|
+
'2025-07-27': boolean;
|
|
29
|
+
'2025-07-28': boolean;
|
|
30
|
+
'2025-07-29': boolean;
|
|
31
|
+
'2025-07-30': boolean;
|
|
32
|
+
'2025-07-31': boolean;
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SvelteComponent as default } from 'svelte';
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TicketSelectionDetails } from '../../../lib.svelte.ts';
|
|
2
|
+
import { Cart } from '../../../../cart/lib/cart.svelte.js';
|
|
3
|
+
export declare class Details {
|
|
4
|
+
ticketSelectionDetails: TicketSelectionDetails | undefined;
|
|
5
|
+
addToCart(cart: Cart | undefined, url?: string | undefined): void;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist-js/components/ticketSelection/subcomponents/tickets/components/Tickets.svelte.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SvelteComponent as default } from 'svelte';
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
export declare const MOCKS: {
|
|
2
|
+
ticket1: {
|
|
3
|
+
id: number;
|
|
4
|
+
ticket_type: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
min_persons: number;
|
|
8
|
+
max_persons: number;
|
|
9
|
+
bookable: boolean;
|
|
10
|
+
museum_ids: number[];
|
|
11
|
+
exhibition_ids: never[];
|
|
12
|
+
price_cents: number;
|
|
13
|
+
discount: number;
|
|
14
|
+
vat_pct: number;
|
|
15
|
+
tax_included: boolean;
|
|
16
|
+
entry_duration: number;
|
|
17
|
+
quota_ids: number[];
|
|
18
|
+
first_entry: number;
|
|
19
|
+
last_entry: number;
|
|
20
|
+
personalizeable: boolean;
|
|
21
|
+
attendees: boolean;
|
|
22
|
+
identification: string;
|
|
23
|
+
free_timing: boolean;
|
|
24
|
+
is_collective: boolean;
|
|
25
|
+
is_upgrade: boolean;
|
|
26
|
+
is_mantle: boolean;
|
|
27
|
+
sub_ticket_ids: never[];
|
|
28
|
+
sub_tickets: {};
|
|
29
|
+
is_sub_ticket: boolean;
|
|
30
|
+
created_at: string;
|
|
31
|
+
updated_at: string;
|
|
32
|
+
cash_point_order: number;
|
|
33
|
+
shop_order: number;
|
|
34
|
+
capacities: {
|
|
35
|
+
'2025-09-23T10:00:00+02:00': number;
|
|
36
|
+
'2025-09-23T11:00:00+02:00': number;
|
|
37
|
+
'2025-09-23T12:00:00+02:00': number;
|
|
38
|
+
'2025-09-23T13:00:00+02:00': number;
|
|
39
|
+
'2025-09-23T14:00:00+02:00': number;
|
|
40
|
+
'2025-09-23T15:00:00+02:00': number;
|
|
41
|
+
'2025-09-23T16:00:00+02:00': number;
|
|
42
|
+
'2025-09-23T17:00:00+02:00': number;
|
|
43
|
+
};
|
|
44
|
+
total_capacities: {
|
|
45
|
+
'2025-09-23T10:00:00+02:00': number;
|
|
46
|
+
'2025-09-23T11:00:00+02:00': number;
|
|
47
|
+
'2025-09-23T12:00:00+02:00': number;
|
|
48
|
+
'2025-09-23T13:00:00+02:00': number;
|
|
49
|
+
'2025-09-23T14:00:00+02:00': number;
|
|
50
|
+
'2025-09-23T15:00:00+02:00': number;
|
|
51
|
+
'2025-09-23T16:00:00+02:00': number;
|
|
52
|
+
'2025-09-23T17:00:00+02:00': number;
|
|
53
|
+
};
|
|
54
|
+
max_capacity: number;
|
|
55
|
+
max_total_capacity: number;
|
|
56
|
+
shipped_with_merchandise_id: null;
|
|
57
|
+
restricted_shop_account: boolean;
|
|
58
|
+
dynamic_prices: null;
|
|
59
|
+
};
|
|
60
|
+
ticket2: {
|
|
61
|
+
id: number;
|
|
62
|
+
title: string;
|
|
63
|
+
description: string;
|
|
64
|
+
ticket_type: string;
|
|
65
|
+
bookable: boolean;
|
|
66
|
+
museum_ids: number[];
|
|
67
|
+
exhibition_ids: never[];
|
|
68
|
+
price_cents: number;
|
|
69
|
+
discount: number;
|
|
70
|
+
vat_pct: number;
|
|
71
|
+
tax_included: boolean;
|
|
72
|
+
entry_duration: number;
|
|
73
|
+
min_persons: number;
|
|
74
|
+
max_persons: number;
|
|
75
|
+
quota_ids: number[];
|
|
76
|
+
first_entry: number;
|
|
77
|
+
last_entry: number;
|
|
78
|
+
personalizeable: boolean;
|
|
79
|
+
attendees: boolean;
|
|
80
|
+
identification: string;
|
|
81
|
+
free_timing: boolean;
|
|
82
|
+
is_collective: boolean;
|
|
83
|
+
is_upgrade: boolean;
|
|
84
|
+
is_mantle: boolean;
|
|
85
|
+
sub_ticket_ids: never[];
|
|
86
|
+
sub_tickets: {};
|
|
87
|
+
is_sub_ticket: boolean;
|
|
88
|
+
created_at: string;
|
|
89
|
+
updated_at: string;
|
|
90
|
+
cash_point_order: number;
|
|
91
|
+
shop_order: number;
|
|
92
|
+
capacities: {
|
|
93
|
+
'2025-09-23T10:00:00+02:00': number;
|
|
94
|
+
'2025-09-23T10:30:00+02:00': number;
|
|
95
|
+
'2025-09-23T11:00:00+02:00': number;
|
|
96
|
+
'2025-09-23T11:30:00+02:00': number;
|
|
97
|
+
'2025-09-23T12:00:00+02:00': number;
|
|
98
|
+
'2025-09-23T12:30:00+02:00': number;
|
|
99
|
+
'2025-09-23T13:00:00+02:00': number;
|
|
100
|
+
'2025-09-23T13:30:00+02:00': number;
|
|
101
|
+
'2025-09-23T14:00:00+02:00': number;
|
|
102
|
+
'2025-09-23T14:30:00+02:00': number;
|
|
103
|
+
'2025-09-23T15:00:00+02:00': number;
|
|
104
|
+
'2025-09-23T15:30:00+02:00': number;
|
|
105
|
+
'2025-09-23T16:00:00+02:00': number;
|
|
106
|
+
'2025-09-23T16:30:00+02:00': number;
|
|
107
|
+
'2025-09-23T17:00:00+02:00': number;
|
|
108
|
+
'2025-09-23T17:30:00+02:00': number;
|
|
109
|
+
};
|
|
110
|
+
total_capacities: {
|
|
111
|
+
'2025-09-23T10:00:00+02:00': number;
|
|
112
|
+
'2025-09-23T10:30:00+02:00': number;
|
|
113
|
+
'2025-09-23T11:00:00+02:00': number;
|
|
114
|
+
'2025-09-23T11:30:00+02:00': number;
|
|
115
|
+
'2025-09-23T12:00:00+02:00': number;
|
|
116
|
+
'2025-09-23T12:30:00+02:00': number;
|
|
117
|
+
'2025-09-23T13:00:00+02:00': number;
|
|
118
|
+
'2025-09-23T13:30:00+02:00': number;
|
|
119
|
+
'2025-09-23T14:00:00+02:00': number;
|
|
120
|
+
'2025-09-23T14:30:00+02:00': number;
|
|
121
|
+
'2025-09-23T15:00:00+02:00': number;
|
|
122
|
+
'2025-09-23T15:30:00+02:00': number;
|
|
123
|
+
'2025-09-23T16:00:00+02:00': number;
|
|
124
|
+
'2025-09-23T16:30:00+02:00': number;
|
|
125
|
+
'2025-09-23T17:00:00+02:00': number;
|
|
126
|
+
'2025-09-23T17:30:00+02:00': number;
|
|
127
|
+
};
|
|
128
|
+
max_capacity: number;
|
|
129
|
+
max_total_capacity: number;
|
|
130
|
+
shipped_with_merchandise_id: null;
|
|
131
|
+
restricted_shop_account: boolean;
|
|
132
|
+
dynamic_prices: null;
|
|
133
|
+
};
|
|
134
|
+
quota1: {
|
|
135
|
+
ticket_ids: number[];
|
|
136
|
+
capacities: {
|
|
137
|
+
'2025-09-23T08:00:00+02:00': number;
|
|
138
|
+
'2025-09-23T10:00:00+02:00': number;
|
|
139
|
+
'2025-09-23T12:00:00+02:00': number;
|
|
140
|
+
'2025-09-23T14:00:00+02:00': number;
|
|
141
|
+
'2025-09-23T16:00:00+02:00': number;
|
|
142
|
+
'2025-09-23T18:00:00+02:00': number;
|
|
143
|
+
};
|
|
144
|
+
total_capacities: {
|
|
145
|
+
'2025-09-23T08:00:00+02:00': number;
|
|
146
|
+
'2025-09-23T10:00:00+02:00': number;
|
|
147
|
+
'2025-09-23T12:00:00+02:00': number;
|
|
148
|
+
'2025-09-23T14:00:00+02:00': number;
|
|
149
|
+
'2025-09-23T16:00:00+02:00': number;
|
|
150
|
+
'2025-09-23T18:00:00+02:00': number;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
quota12: {
|
|
154
|
+
ticket_ids: number[];
|
|
155
|
+
capacities: {
|
|
156
|
+
'2025-09-23T08:00:00+02:00': number;
|
|
157
|
+
'2025-09-23T10:00:00+02:00': number;
|
|
158
|
+
'2025-09-23T12:00:00+02:00': number;
|
|
159
|
+
'2025-09-23T14:00:00+02:00': number;
|
|
160
|
+
'2025-09-23T16:00:00+02:00': number;
|
|
161
|
+
'2025-09-23T18:00:00+02:00': number;
|
|
162
|
+
};
|
|
163
|
+
total_capacities: {
|
|
164
|
+
'2025-09-23T08:00:00+02:00': number;
|
|
165
|
+
'2025-09-23T10:00:00+02:00': number;
|
|
166
|
+
'2025-09-23T12:00:00+02:00': number;
|
|
167
|
+
'2025-09-23T14:00:00+02:00': number;
|
|
168
|
+
'2025-09-23T16:00:00+02:00': number;
|
|
169
|
+
'2025-09-23T18:00:00+02:00': number;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
quota2: {
|
|
173
|
+
ticket_ids: number[];
|
|
174
|
+
capacities: {
|
|
175
|
+
'2025-09-23T08:00:00+02:00': number;
|
|
176
|
+
'2025-09-23T10:00:00+02:00': number;
|
|
177
|
+
'2025-09-23T12:00:00+02:00': number;
|
|
178
|
+
'2025-09-23T14:00:00+02:00': number;
|
|
179
|
+
'2025-09-23T16:00:00+02:00': number;
|
|
180
|
+
'2025-09-23T18:00:00+02:00': number;
|
|
181
|
+
};
|
|
182
|
+
total_capacities: {
|
|
183
|
+
'2025-09-23T08:00:00+02:00': number;
|
|
184
|
+
'2025-09-23T10:00:00+02:00': number;
|
|
185
|
+
'2025-09-23T12:00:00+02:00': number;
|
|
186
|
+
'2025-09-23T14:00:00+02:00': number;
|
|
187
|
+
'2025-09-23T16:00:00+02:00': number;
|
|
188
|
+
'2025-09-23T18:00:00+02:00': number;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GomusTicket } from '../../../../../lib/gomusTickets.svelte.ts';
|
|
2
|
+
import { TicketSelectionDetails } from '../../../lib.svelte.ts';
|
|
3
|
+
export declare class Details {
|
|
4
|
+
ticketSelectionDetails: TicketSelectionDetails | undefined;
|
|
5
|
+
get allTickets(): (import('@gomus/types').GomusAnnualTicket | GomusTicket)[];
|
|
6
|
+
get timeslotTickets(): GomusTicket[];
|
|
7
|
+
get annualTickets(): import('@gomus/types').GomusAnnualTicket[];
|
|
8
|
+
updateSelectedTickets(ticket: GomusTicket, quantity: number): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SvelteComponent as default } from 'svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Quotas, Ticket, Tickets, TimeSlot } from '@gomus/types';
|
|
2
|
+
/**
|
|
3
|
+
* Transforms a single ticket into an array of formatted time slot entries.
|
|
4
|
+
* Each entry represents a specific time when the ticket can be used.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createTimeSlotEntriesFromTicket(ticket: Ticket): TimeSlot[];
|
|
7
|
+
/**
|
|
8
|
+
* Flattens all tickets into a single chronologically sorted array of time slots.
|
|
9
|
+
* This creates the base collection of all possible timeslots across all tickets.
|
|
10
|
+
*/
|
|
11
|
+
export declare function flattenTicketsIntoSlots(tickets: Tickets): TimeSlot[];
|
|
12
|
+
/**
|
|
13
|
+
* Removes duplicate time slots, keeping only one entry per time.
|
|
14
|
+
* When duplicates exist, preserves the one with the highest capacity.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getUniqueSlots(timeSlots: TimeSlot[]): TimeSlot[];
|
|
17
|
+
/**
|
|
18
|
+
* Filters time slots to only include those that belong to a specific quota,
|
|
19
|
+
* and removes duplicate times by keeping the slot with the highest capacity.
|
|
20
|
+
*
|
|
21
|
+
* This handles cases where the same time slot appears multiple times due to
|
|
22
|
+
* multiple tickets sharing the same quota.
|
|
23
|
+
*/
|
|
24
|
+
export declare function filterSlotsByQuota(allTimeSlots: TimeSlot[], quotaId: number): TimeSlot[];
|
|
25
|
+
/**
|
|
26
|
+
* Processes all quotas and aggregates their time slots into a single collection.
|
|
27
|
+
* This step ensures that each quota's constraints are properly applied to the available times.
|
|
28
|
+
*/
|
|
29
|
+
export declare function filterSlots(allTimeSlots: TimeSlot[], quotas: Quotas): TimeSlot[];
|
|
30
|
+
/**
|
|
31
|
+
* Consolidates time slots by merging multiple entries for the same time into one,
|
|
32
|
+
* summing up their capacities to get the total available capacity per time slot.
|
|
33
|
+
*
|
|
34
|
+
* This final step creates the definitive list of bookable time slots with accurate capacity information.
|
|
35
|
+
*/
|
|
36
|
+
export declare function combineSlots(timeSlots: TimeSlot[]): TimeSlot[];
|
|
37
|
+
/**
|
|
38
|
+
* Processes tickets and quotas to generate a consolidated list of available timeslots.
|
|
39
|
+
*
|
|
40
|
+
* This function handles the complex business logic of:
|
|
41
|
+
* 1. Extracting all possible timeslots from tickets
|
|
42
|
+
* 2. Applying quota constraints to determine actual availability
|
|
43
|
+
* 3. Consolidating overlapping time slots and summing their capacities
|
|
44
|
+
* 4. Providing a final sorted list of bookable time slots
|
|
45
|
+
*
|
|
46
|
+
* @param tickets - Collection of ticket types with their individual time slots and capacities
|
|
47
|
+
* @param quotas - Booking quotas that constrain which tickets can be booked when
|
|
48
|
+
* @returns Sorted array of consolidated time slots with accurate capacity and availability information
|
|
49
|
+
*/
|
|
50
|
+
export declare function generateAvailableTimeSlots(tickets: Tickets, quotas: Quotas): TimeSlot[];
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
export declare const mockedTicketsAndQuotas: {
|
|
2
|
+
tickets: {
|
|
3
|
+
'1': {
|
|
4
|
+
id: number;
|
|
5
|
+
title: string;
|
|
6
|
+
ticket_type: "time_slot" | "annual" | "normal";
|
|
7
|
+
bookable: boolean;
|
|
8
|
+
museum_ids: number[];
|
|
9
|
+
exhibition_ids: number[];
|
|
10
|
+
price_cents: number;
|
|
11
|
+
discount: number;
|
|
12
|
+
vat_pct: number;
|
|
13
|
+
tax_included: boolean;
|
|
14
|
+
entry_duration: number | null;
|
|
15
|
+
min_persons: number;
|
|
16
|
+
max_persons: number;
|
|
17
|
+
quota_ids: number[];
|
|
18
|
+
first_entry: number;
|
|
19
|
+
last_entry: number;
|
|
20
|
+
personalizeable: boolean;
|
|
21
|
+
attendees: boolean | string;
|
|
22
|
+
identification: boolean | string;
|
|
23
|
+
free_timing: boolean;
|
|
24
|
+
is_collective: boolean;
|
|
25
|
+
is_upgrade: boolean;
|
|
26
|
+
is_mantle: boolean;
|
|
27
|
+
description: string | null;
|
|
28
|
+
sub_ticket_ids: number[];
|
|
29
|
+
sub_tickets: {
|
|
30
|
+
[key: string]: {
|
|
31
|
+
title?: string;
|
|
32
|
+
min_persons?: number;
|
|
33
|
+
max_persons?: number;
|
|
34
|
+
description?: string | null;
|
|
35
|
+
};
|
|
36
|
+
} | null;
|
|
37
|
+
is_sub_ticket: boolean;
|
|
38
|
+
created_at: string;
|
|
39
|
+
updated_at: string;
|
|
40
|
+
shop_order: number;
|
|
41
|
+
shipped_with_merchandise_id: number | null;
|
|
42
|
+
restricted_shop_account: boolean;
|
|
43
|
+
cash_point_order: number;
|
|
44
|
+
capacities: {
|
|
45
|
+
[key: string]: number;
|
|
46
|
+
};
|
|
47
|
+
total_capacities: {
|
|
48
|
+
[key: string]: number;
|
|
49
|
+
};
|
|
50
|
+
max_capacity: number;
|
|
51
|
+
max_total_capacity: number;
|
|
52
|
+
dynamic_prices: {
|
|
53
|
+
[key: string]: number;
|
|
54
|
+
} | null;
|
|
55
|
+
};
|
|
56
|
+
'2': {
|
|
57
|
+
id: number;
|
|
58
|
+
title: string;
|
|
59
|
+
ticket_type: "time_slot" | "annual" | "normal";
|
|
60
|
+
bookable: boolean;
|
|
61
|
+
museum_ids: number[];
|
|
62
|
+
exhibition_ids: number[];
|
|
63
|
+
price_cents: number;
|
|
64
|
+
discount: number;
|
|
65
|
+
vat_pct: number;
|
|
66
|
+
tax_included: boolean;
|
|
67
|
+
entry_duration: number | null;
|
|
68
|
+
min_persons: number;
|
|
69
|
+
max_persons: number;
|
|
70
|
+
quota_ids: number[];
|
|
71
|
+
first_entry: number;
|
|
72
|
+
last_entry: number;
|
|
73
|
+
personalizeable: boolean;
|
|
74
|
+
attendees: boolean | string;
|
|
75
|
+
identification: boolean | string;
|
|
76
|
+
free_timing: boolean;
|
|
77
|
+
is_collective: boolean;
|
|
78
|
+
is_upgrade: boolean;
|
|
79
|
+
is_mantle: boolean;
|
|
80
|
+
description: string | null;
|
|
81
|
+
sub_ticket_ids: number[];
|
|
82
|
+
sub_tickets: {
|
|
83
|
+
[key: string]: {
|
|
84
|
+
title?: string;
|
|
85
|
+
min_persons?: number;
|
|
86
|
+
max_persons?: number;
|
|
87
|
+
description?: string | null;
|
|
88
|
+
};
|
|
89
|
+
} | null;
|
|
90
|
+
is_sub_ticket: boolean;
|
|
91
|
+
created_at: string;
|
|
92
|
+
updated_at: string;
|
|
93
|
+
shop_order: number;
|
|
94
|
+
shipped_with_merchandise_id: number | null;
|
|
95
|
+
restricted_shop_account: boolean;
|
|
96
|
+
cash_point_order: number;
|
|
97
|
+
capacities: {
|
|
98
|
+
[key: string]: number;
|
|
99
|
+
};
|
|
100
|
+
total_capacities: {
|
|
101
|
+
[key: string]: number;
|
|
102
|
+
};
|
|
103
|
+
max_capacity: number;
|
|
104
|
+
max_total_capacity: number;
|
|
105
|
+
dynamic_prices: {
|
|
106
|
+
[key: string]: number;
|
|
107
|
+
} | null;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
quotas: {
|
|
111
|
+
'1': {
|
|
112
|
+
ticket_ids: number[];
|
|
113
|
+
capacities: {
|
|
114
|
+
[key: string]: number;
|
|
115
|
+
};
|
|
116
|
+
total_capacities: {
|
|
117
|
+
[key: string]: number;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|