@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.
Files changed (51) hide show
  1. package/dist-js/components/cart/lib/CartItem.d.ts +135 -0
  2. package/dist-js/components/cart/lib/cart.svelte.d.ts +563 -24
  3. package/dist-js/components/cart/lib/localStorage.svelte.d.ts +146 -0
  4. package/dist-js/components/cart/mocks/gomusTicketMocks.d.ts +112 -0
  5. package/dist-js/components/ticketSelection/SpecUtils.d.ts +3 -0
  6. package/dist-js/components/ticketSelection/{lib.svelte.d.ts → TicketSelectionDetails.svelte.d.ts} +10 -7
  7. package/dist-js/components/ticketSelection/subcomponents/addToCartButton/AddToCartButton.svelte.d.ts +6 -0
  8. package/dist-js/components/ticketSelection/subcomponents/addToCartButton/AddToCartButton.svelte.spec.d.ts +1 -0
  9. package/dist-js/components/ticketSelection/subcomponents/addToCartButton/entry.d.ts +0 -0
  10. package/dist-js/components/ticketSelection/subcomponents/calendar/lib/calendar.svelte.d.ts +1 -4
  11. package/dist-js/components/ticketSelection/subcomponents/tickets/Tickets.spec.d.ts +1 -0
  12. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/TicketGroup.svelte.d.ts +626 -0
  13. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/TicketsSum.svelte.d.ts +1 -0
  14. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/addToCartButton/entry.d.ts +0 -0
  15. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/utils.spec.d.ts +1 -0
  16. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/utils.svelte.d.ts +9 -0
  17. package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/__mocks__/generateAvailableTimeSlots.d.ts +8 -0
  18. package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/generateAvailableTimeSlots.specs.d.ts +1 -121
  19. package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/lib.svelte.d.ts +1 -1
  20. package/dist-js/config/config.d.ts +11 -0
  21. package/dist-js/config/config.spec.d.ts +1 -0
  22. package/dist-js/gomus-webcomponents.css +159 -0
  23. package/dist-js/gomus-webcomponents.iife.js +2085 -2590
  24. package/dist-js/gomus-webcomponents.js +2082 -2587
  25. package/dist-js/lib/gomusTicket.spec.d.ts +1 -0
  26. package/dist-js/lib/gomusTicket.svelte.d.ts +122 -0
  27. package/dist-js/lib/helpers/PropertyTracker.d.ts +9 -0
  28. package/dist-js/lib/helpers/PropertyTracker.spec.d.ts +1 -0
  29. package/dist-js/lib/helpers/utils.d.ts +1 -0
  30. package/dist-js/lib/stores/shop.svelte.d.ts +55 -1
  31. package/dist-js/lib/stores/shop.svelte.test.d.ts +1 -3
  32. package/dist-js/lib/vitest/msw/handlers.d.ts +1 -1
  33. package/dist-js/mocks/ShopMocks.d.ts +179 -0
  34. package/dist-js/mocks/mocks.d.ts +1922 -0
  35. package/package.json +5 -1
  36. package/dist-js/components/cart/lib/lib.d.ts +0 -3
  37. package/dist-js/components/cart/mocks/gomusTickets.d.ts +0 -56
  38. package/dist-js/components/ticketSelection/subcomponents/checkoutButton/lib/lib.svelte.d.ts +0 -6
  39. package/dist-js/components/ticketSelection/subcomponents/tickets/lib/lib.svelte.d.ts +0 -9
  40. package/dist-js/lib/gomusTickets.svelte.d.ts +0 -47
  41. /package/dist-js/components/cart/{lib/cart.spec.d.ts → components/Cart.spec.d.ts} +0 -0
  42. /package/dist-js/components/{ticketSelection/lib.spec.d.ts → cart/lib/cart.svelte.spec.d.ts} +0 -0
  43. /package/dist-js/components/{ticketSelection/subcomponents/tickets/components/Tickets.spec.d.ts → cart/lib/localStorage.spec.d.ts} +0 -0
  44. /package/dist-js/components/{cart/components/items/Ticket.svelte.d.ts → if/If.svelte.d.ts} +0 -0
  45. /package/dist-js/components/{ticketSelection/subcomponents/checkoutButton → if}/entry.d.ts +0 -0
  46. /package/dist-js/{lib/gomusTickets.spec.d.ts → components/ticketSelection/TicketSelectionDetails.spec.d.ts} +0 -0
  47. /package/dist-js/{lib/helpers/reactivity.svelte.test.d.ts → components/ticketSelection/subcomponents/addToCartButton/AddToCartButton.spec.d.ts} +0 -0
  48. /package/dist-js/components/ticketSelection/subcomponents/tickets/{components/Tickets.svelte.d.ts → Tickets.svelte.d.ts} +0 -0
  49. /package/dist-js/components/ticketSelection/subcomponents/tickets/{components/fixtures → fixtures}/ticketFixtures.d.ts +0 -0
  50. /package/dist-js/components/ticketSelection/{SelectionTotal.svelte.d.ts → subcomponents/tickets/subcomponents/GroupBody.svelte.d.ts} +0 -0
  51. /package/dist-js/components/ticketSelection/subcomponents/{checkoutButton/components/CheckoutButton.svelte.d.ts → tickets/subcomponents/GroupSum.svelte.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,122 @@
1
+ import { AnnualTicket, Ticket, Tickets } from '@gomus/types';
2
+ interface Options {
3
+ minAvailableCapacity?: number;
4
+ selectedTime?: string;
5
+ quantity?: number;
6
+ }
7
+ type UITicketTypes = 'timeslot' | 'annual' | 'day';
8
+ export type UITicket = ReturnType<typeof createUITicket>;
9
+ export declare function createUITicket(apiTicket: Ticket | AnnualTicket, options?: Options): {
10
+ type: UITicketTypes;
11
+ shop_order: number;
12
+ max_capacity: number;
13
+ min_quantity: number;
14
+ max_quantity: number;
15
+ minAvailableCapacity: number;
16
+ selectedTime: string;
17
+ quantity: number;
18
+ id: number;
19
+ title: string;
20
+ ticket_type: "time_slot" | "annual" | "normal";
21
+ bookable: boolean;
22
+ museum_ids: number[];
23
+ exhibition_ids: number[];
24
+ price_cents: number;
25
+ discount: number;
26
+ vat_pct: number;
27
+ tax_included: boolean;
28
+ entry_duration: number | null;
29
+ min_persons: number;
30
+ max_persons: number;
31
+ quota_ids: number[];
32
+ first_entry: number;
33
+ last_entry: number;
34
+ personalizeable: boolean;
35
+ attendees: boolean | string;
36
+ identification: boolean | string;
37
+ free_timing: boolean;
38
+ is_collective: boolean;
39
+ is_upgrade: boolean;
40
+ is_mantle: boolean;
41
+ description: string | null;
42
+ sub_ticket_ids: number[];
43
+ sub_tickets: {
44
+ [key: string]: {
45
+ title?: string;
46
+ min_persons?: number;
47
+ max_persons?: number;
48
+ description?: string | null;
49
+ };
50
+ } | null;
51
+ is_sub_ticket: boolean;
52
+ created_at: string;
53
+ updated_at: string;
54
+ shipped_with_merchandise_id: number | null;
55
+ restricted_shop_account: boolean;
56
+ cash_point_order: number;
57
+ capacities: {
58
+ [key: string]: number;
59
+ };
60
+ total_capacities: {
61
+ [key: string]: number;
62
+ };
63
+ max_total_capacity: number;
64
+ dynamic_prices: {
65
+ [key: string]: number;
66
+ } | null;
67
+ uid: number;
68
+ } | {
69
+ type: UITicketTypes;
70
+ shop_order: number;
71
+ max_capacity: number;
72
+ min_quantity: number;
73
+ max_quantity: number;
74
+ minAvailableCapacity: number;
75
+ selectedTime: string;
76
+ quantity: number;
77
+ id: number;
78
+ title: string;
79
+ ticket_type: "time_slot" | "annual" | "normal";
80
+ bookable: boolean;
81
+ museum_ids: number[];
82
+ exhibition_ids: number[];
83
+ price_cents: number;
84
+ discount: number;
85
+ vat_pct: number;
86
+ tax_included: boolean;
87
+ entry_duration: number | null;
88
+ min_persons: number;
89
+ max_persons: number;
90
+ quota_ids: number[];
91
+ first_entry: number;
92
+ last_entry: number;
93
+ personalizeable: boolean;
94
+ attendees: boolean | string;
95
+ identification: boolean | string;
96
+ free_timing: boolean;
97
+ is_collective: boolean;
98
+ is_upgrade: boolean;
99
+ is_mantle: boolean;
100
+ description: string | null;
101
+ sub_ticket_ids: number[];
102
+ sub_tickets: {
103
+ [key: string]: {
104
+ title?: string;
105
+ min_persons?: number;
106
+ max_persons?: number;
107
+ description?: string | null;
108
+ };
109
+ } | null;
110
+ is_sub_ticket: boolean;
111
+ created_at: string;
112
+ updated_at: string;
113
+ shipped_with_merchandise_id: number | null;
114
+ restricted_shop_account: boolean;
115
+ cash_point_order: number;
116
+ dynamic_prices: {
117
+ [key: string]: number;
118
+ } | null;
119
+ uid: number;
120
+ };
121
+ export declare function initUITimeslotTickets(tickets: Tickets): UITicket[];
122
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Observes the provided object and triggers a callback function whenever a property is updated.
3
+ *
4
+ * @param {T} obj - The object to be observed.
5
+ * @param {function(string, any): void} onChange - The callback function that gets invoked when a property is updated.
6
+ * The first argument is the property name, and the second is the new value of the property.
7
+ * @return {T} The proxied object that listens to property updates.
8
+ */
9
+ export declare function PropertyTracker<T extends object>(obj: T, onChange: (obj: T, prop: string, value: any) => void): T;
@@ -0,0 +1 @@
1
+ export {};
@@ -22,3 +22,4 @@ export declare function currency(value: number, currency: string): string;
22
22
  * ```
23
23
  */
24
24
  export declare function parseIds(ids: string | undefined): number[] | undefined;
25
+ export declare function parseTokens<ValidToken>(tokens: string | undefined, possibleTokens: readonly ValidToken[]): ValidToken[] | undefined;
@@ -127,7 +127,61 @@ export declare class Shop {
127
127
  };
128
128
  meta: import('@gomus/types').components["schemas"]["meta"];
129
129
  };
130
- tickets(params: TicketsParams): TicketsResponse;
130
+ tickets(params: TicketsParams): {
131
+ [key: string]: {
132
+ id: number;
133
+ title: string;
134
+ ticket_type: "time_slot" | "annual" | "normal";
135
+ bookable: boolean;
136
+ museum_ids: number[];
137
+ exhibition_ids: number[];
138
+ price_cents: number;
139
+ discount: number;
140
+ vat_pct: number;
141
+ tax_included: boolean;
142
+ entry_duration: number | null;
143
+ min_persons: number;
144
+ max_persons: number;
145
+ quota_ids: number[];
146
+ first_entry: number;
147
+ last_entry: number;
148
+ personalizeable: boolean;
149
+ attendees: boolean | string;
150
+ identification: boolean | string;
151
+ free_timing: boolean;
152
+ is_collective: boolean;
153
+ is_upgrade: boolean;
154
+ is_mantle: boolean;
155
+ description: string | null;
156
+ sub_ticket_ids: number[];
157
+ sub_tickets: {
158
+ [key: string]: {
159
+ title?: string;
160
+ min_persons?: number;
161
+ max_persons?: number;
162
+ description?: string | null;
163
+ };
164
+ } | null;
165
+ is_sub_ticket: boolean;
166
+ created_at: string;
167
+ updated_at: string;
168
+ shop_order: number;
169
+ shipped_with_merchandise_id: number | null;
170
+ restricted_shop_account: boolean;
171
+ cash_point_order: number;
172
+ capacities: {
173
+ [key: string]: number;
174
+ };
175
+ total_capacities: {
176
+ [key: string]: number;
177
+ };
178
+ max_capacity: number;
179
+ max_total_capacity: number;
180
+ dynamic_prices: {
181
+ [key: string]: number;
182
+ } | null;
183
+ };
184
+ };
131
185
  /**
132
186
  * Returns a reactive value that will contain the fetched data, no need to await.
133
187
  *
@@ -1,3 +1 @@
1
- export declare const getShop_success: import('msw').HttpHandler;
2
- export declare const getShop_fail: import('msw').HttpHandler;
3
- export declare const dummyShop: readonly ["https://example.com", "dummy_shop_domain", "en"];
1
+ export {};
@@ -1487,7 +1487,7 @@ export function getGetTickets200Response(): {
1487
1487
  tickets: {
1488
1488
  id: number;
1489
1489
  title: string;
1490
- ticket_type: "annual" | "normal" | "time_slot";
1490
+ ticket_type: "annual" | "time_slot" | "normal";
1491
1491
  bookable: boolean;
1492
1492
  museum_ids: number[];
1493
1493
  exhibition_ids: number[];
@@ -0,0 +1,179 @@
1
+ import { Quota, Ticket, TimeSlot } from '@gomus/types';
2
+ export declare const dummyShop: readonly ["https://example.com", "dummy_shop_domain", "en"];
3
+ export declare const mockedTicketsAndQuotas: {
4
+ tickets: {
5
+ '1': {
6
+ id: number;
7
+ title: string;
8
+ ticket_type: "time_slot" | "annual" | "normal";
9
+ bookable: boolean;
10
+ museum_ids: number[];
11
+ exhibition_ids: number[];
12
+ price_cents: number;
13
+ discount: number;
14
+ vat_pct: number;
15
+ tax_included: boolean;
16
+ entry_duration: number | null;
17
+ min_persons: number;
18
+ max_persons: number;
19
+ quota_ids: number[];
20
+ first_entry: number;
21
+ last_entry: number;
22
+ personalizeable: boolean;
23
+ attendees: boolean | string;
24
+ identification: boolean | string;
25
+ free_timing: boolean;
26
+ is_collective: boolean;
27
+ is_upgrade: boolean;
28
+ is_mantle: boolean;
29
+ description: string | null;
30
+ sub_ticket_ids: number[];
31
+ sub_tickets: {
32
+ [key: string]: {
33
+ title?: string;
34
+ min_persons?: number;
35
+ max_persons?: number;
36
+ description?: string | null;
37
+ };
38
+ } | null;
39
+ is_sub_ticket: boolean;
40
+ created_at: string;
41
+ updated_at: string;
42
+ shop_order: number;
43
+ shipped_with_merchandise_id: number | null;
44
+ restricted_shop_account: boolean;
45
+ cash_point_order: number;
46
+ capacities: {
47
+ [key: string]: number;
48
+ };
49
+ total_capacities: {
50
+ [key: string]: number;
51
+ };
52
+ max_capacity: number;
53
+ max_total_capacity: number;
54
+ dynamic_prices: {
55
+ [key: string]: number;
56
+ } | null;
57
+ };
58
+ '2': {
59
+ id: number;
60
+ title: string;
61
+ ticket_type: "time_slot" | "annual" | "normal";
62
+ bookable: boolean;
63
+ museum_ids: number[];
64
+ exhibition_ids: number[];
65
+ price_cents: number;
66
+ discount: number;
67
+ vat_pct: number;
68
+ tax_included: boolean;
69
+ entry_duration: number | null;
70
+ min_persons: number;
71
+ max_persons: number;
72
+ quota_ids: number[];
73
+ first_entry: number;
74
+ last_entry: number;
75
+ personalizeable: boolean;
76
+ attendees: boolean | string;
77
+ identification: boolean | string;
78
+ free_timing: boolean;
79
+ is_collective: boolean;
80
+ is_upgrade: boolean;
81
+ is_mantle: boolean;
82
+ description: string | null;
83
+ sub_ticket_ids: number[];
84
+ sub_tickets: {
85
+ [key: string]: {
86
+ title?: string;
87
+ min_persons?: number;
88
+ max_persons?: number;
89
+ description?: string | null;
90
+ };
91
+ } | null;
92
+ is_sub_ticket: boolean;
93
+ created_at: string;
94
+ updated_at: string;
95
+ shop_order: number;
96
+ shipped_with_merchandise_id: number | null;
97
+ restricted_shop_account: boolean;
98
+ cash_point_order: number;
99
+ capacities: {
100
+ [key: string]: number;
101
+ };
102
+ total_capacities: {
103
+ [key: string]: number;
104
+ };
105
+ max_capacity: number;
106
+ max_total_capacity: number;
107
+ dynamic_prices: {
108
+ [key: string]: number;
109
+ } | null;
110
+ };
111
+ };
112
+ quotas: {
113
+ '1': {
114
+ ticket_ids: number[];
115
+ capacities: {
116
+ [key: string]: number;
117
+ };
118
+ total_capacities: {
119
+ [key: string]: number;
120
+ };
121
+ };
122
+ };
123
+ };
124
+ export declare function createMockTicket(ticket?: Partial<Ticket>): Ticket;
125
+ export declare function createMockTimeSlot(timeSlot?: Partial<TimeSlot>): TimeSlot;
126
+ export declare function createMockQuota(quota?: Partial<Quota>): Quota;
127
+ export declare const response_success: {
128
+ shop: {
129
+ name: string;
130
+ config: {
131
+ url: string;
132
+ success_link: string;
133
+ pending_link: string;
134
+ fail_link: string;
135
+ back_link: string;
136
+ confirmation_link: string;
137
+ password_reset_link: string;
138
+ personalization_link: string;
139
+ registration: boolean;
140
+ guest: {
141
+ enabled: boolean;
142
+ limit: number;
143
+ };
144
+ min_total: number;
145
+ max_total: number;
146
+ defaults: {
147
+ price_target_audience_id: number;
148
+ };
149
+ currency: string;
150
+ time_zone: string;
151
+ locale: string;
152
+ custom_css: string;
153
+ custom_js: string;
154
+ donations: {
155
+ enabled: boolean;
156
+ options: number[];
157
+ guest_limit: number;
158
+ free_donations: boolean;
159
+ };
160
+ dynamic_pricing: boolean;
161
+ };
162
+ translations: {
163
+ [x: string]: string;
164
+ };
165
+ payment_modes: {
166
+ [x: string]: {
167
+ id: number;
168
+ name: string;
169
+ icons: string[];
170
+ };
171
+ };
172
+ content: {
173
+ [x: string]: string;
174
+ };
175
+ settings: {};
176
+ };
177
+ };
178
+ export declare const getShop_success: import('msw').HttpHandler;
179
+ export declare const getShop_fail: import('msw').HttpHandler;