@gomusdev/web-components 1.26.1 → 1.26.3

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.
@@ -1,15 +1,16 @@
1
1
  import { TicketSelectionDetails } from '../../../TicketSelectionDetails.svelte.ts';
2
- import { DateValue, CalendarDate } from '@internationalized/date';
2
+ import { CalendarDate, DateValue } from '@internationalized/date';
3
3
  export type CalendarDates = {
4
4
  [key: string]: boolean;
5
5
  };
6
+ export type CalendarDatesDepthAvailabilityStatus = {
7
+ [key: string]: 'unavailable' | 'available' | 'fully_booked';
8
+ };
6
9
  export declare class Calendar {
7
10
  details: TicketSelectionDetails | undefined;
8
11
  startAt: CalendarDate;
9
12
  selected: CalendarDate | undefined;
10
- get dates(): {
11
- [key: string]: boolean;
12
- } | undefined;
13
+ get dates(): CalendarDatesDepthAvailabilityStatus | undefined;
13
14
  isDateDisabled(date: DateValue): boolean;
14
15
  isDateUnavailable(date: DateValue): boolean;
15
16
  get apiFilters(): string[] | undefined;
@@ -40,13 +41,7 @@ export declare class StaticCalendar extends Calendar {
40
41
  params: {
41
42
  start_at: undefined;
42
43
  };
43
- constructor(dates?: {
44
- [key: string]: boolean;
45
- });
46
- get dates(): {
47
- [key: string]: boolean;
48
- };
49
- set dates(dates: {
50
- [key: string]: boolean;
51
- });
44
+ constructor(dates?: CalendarDatesDepthAvailabilityStatus);
45
+ get dates(): CalendarDatesDepthAvailabilityStatus;
46
+ set dates(dates: CalendarDatesDepthAvailabilityStatus);
52
47
  }
@@ -1,33 +1,3 @@
1
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;
2
+ [key: string]: 'unavailable' | 'available' | 'fully_booked';
33
3
  };
@@ -31729,9 +31729,10 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
31729
31729
  "by_ticket_ids[]": tsd.ticketIds,
31730
31730
  "by_ticket_group_ids[]": tsd.ticketGroupIds
31731
31731
  }));
31732
- const selectedTime2 = "10:00";
31733
- const selectedDate = tsd.selectedDate.toString();
31734
- const timeslot = selectedDate + "T" + selectedTime2 + ":00+01:00";
31732
+ let timeslot;
31733
+ if (quotas && Object.values(quotas).length > 0 && Object.keys(Object.values(quotas)[0].capacities).length > 0) {
31734
+ timeslot = Object.keys(Object.values(quotas)[0].capacities)[0];
31735
+ }
31735
31736
  shop.capacityManager.addQuotas(quotas);
31736
31737
  const uiTickets = initUITimeslotTickets(tickets, timeslot);
31737
31738
  segment.preCart = createCart(uiTickets);
@@ -32287,11 +32288,15 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
32287
32288
  }
32288
32289
  }
32289
32290
  isDateDisabled(date2) {
32290
- return date2.compare($14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2())) < 0;
32291
+ if (this.dates) {
32292
+ return date2.compare($14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2())) < 0 || this.dates[date2.toString()] == "unavailable";
32293
+ } else {
32294
+ return date2.compare($14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2())) < 0;
32295
+ }
32291
32296
  }
32292
32297
  isDateUnavailable(date2) {
32293
32298
  if (this.dates) {
32294
- return !this.dates[date2.toString()];
32299
+ return this.dates[date2.toString()] == "fully_booked";
32295
32300
  }
32296
32301
  return false;
32297
32302
  }
@@ -32318,10 +32323,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
32318
32323
  "by_museum_ids[]": this.details.museumIds,
32319
32324
  "by_exhibition_ids[]": this.details.exhibitionIds,
32320
32325
  "by_event_ids[]": this.details.eventIds,
32321
- // https://gitlab.giantmonkey.de/gomus/gomus/-/merge_requests/11544
32322
- // this helps us to differentiate sold-out days from not available days
32323
- // the api gives an error right now
32324
- // depth: 'availability_status',
32326
+ depth: "availability_status",
32325
32327
  // these logic are there to minimize fetches
32326
32328
  start_at: startAt.toString(),
32327
32329
  end_at: startAt.add({ months: 1 }).toString()
@@ -31729,9 +31729,10 @@ async function loadDayTickets(segment) {
31729
31729
  "by_ticket_ids[]": tsd.ticketIds,
31730
31730
  "by_ticket_group_ids[]": tsd.ticketGroupIds
31731
31731
  }));
31732
- const selectedTime2 = "10:00";
31733
- const selectedDate = tsd.selectedDate.toString();
31734
- const timeslot = selectedDate + "T" + selectedTime2 + ":00+01:00";
31732
+ let timeslot;
31733
+ if (quotas && Object.values(quotas).length > 0 && Object.keys(Object.values(quotas)[0].capacities).length > 0) {
31734
+ timeslot = Object.keys(Object.values(quotas)[0].capacities)[0];
31735
+ }
31735
31736
  shop.capacityManager.addQuotas(quotas);
31736
31737
  const uiTickets = initUITimeslotTickets(tickets, timeslot);
31737
31738
  segment.preCart = createCart(uiTickets);
@@ -32287,11 +32288,15 @@ class Calendar {
32287
32288
  }
32288
32289
  }
32289
32290
  isDateDisabled(date2) {
32290
- return date2.compare($14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2())) < 0;
32291
+ if (this.dates) {
32292
+ return date2.compare($14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2())) < 0 || this.dates[date2.toString()] == "unavailable";
32293
+ } else {
32294
+ return date2.compare($14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2())) < 0;
32295
+ }
32291
32296
  }
32292
32297
  isDateUnavailable(date2) {
32293
32298
  if (this.dates) {
32294
- return !this.dates[date2.toString()];
32299
+ return this.dates[date2.toString()] == "fully_booked";
32295
32300
  }
32296
32301
  return false;
32297
32302
  }
@@ -32318,10 +32323,7 @@ class Calendar {
32318
32323
  "by_museum_ids[]": this.details.museumIds,
32319
32324
  "by_exhibition_ids[]": this.details.exhibitionIds,
32320
32325
  "by_event_ids[]": this.details.eventIds,
32321
- // https://gitlab.giantmonkey.de/gomus/gomus/-/merge_requests/11544
32322
- // this helps us to differentiate sold-out days from not available days
32323
- // the api gives an error right now
32324
- // depth: 'availability_status',
32326
+ depth: "availability_status",
32325
32327
  // these logic are there to minimize fetches
32326
32328
  start_at: startAt.toString(),
32327
32329
  end_at: startAt.add({ months: 1 }).toString()
@@ -1,4 +1,4 @@
1
- import { CalendarDates } from '../../components/ticketSelection/subcomponents/calendar/lib/calendar.svelte.ts';
1
+ import { CalendarDates, CalendarDatesDepthAvailabilityStatus } from '../../components/ticketSelection/subcomponents/calendar/lib/calendar.svelte.ts';
2
2
  import { ShopUrls } from '../helpers/urls';
3
3
  import { CapacityManager } from '../models/capacity/CapacityManager.ts';
4
4
  import { Cart } from '../models/cart/cart.svelte.ts';
@@ -242,7 +242,7 @@ export declare class Shop {
242
242
  auth?: Auth;
243
243
  capacityManager?: CapacityManager;
244
244
  };
245
- ticketsCalendar(params: TicketsCalendarParams): CalendarDates;
245
+ ticketsCalendar(params: TicketsCalendarParams): CalendarDatesDepthAvailabilityStatus;
246
246
  calendar(params: TicketsCalendarParams): CalendarDates;
247
247
  ticketsAndQuotas(params: TicketsAndQuotasParams): {
248
248
  tickets: {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "Giantmonkey GmbH"
5
5
  },
6
6
  "license": "MIT",
7
- "version": "1.26.1",
7
+ "version": "1.26.3",
8
8
  "type": "module",
9
9
  "main": "./dist-js/gomus-webcomponents.iife.js",
10
10
  "module": "./dist-js/gomus-webcomponents.iife.js",