@gomusdev/web-components 1.40.0 → 1.42.0

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,8 +1,8 @@
1
1
  import { Cart } from '../cart/cart.svelte.ts';
2
2
  import { CartItem } from '../cart/types.ts';
3
3
  import { Quotas } from '@gomus/types';
4
- type DateID = number;
5
- type Seats = {
4
+ export type DateID = number;
5
+ export type Seats = {
6
6
  min?: number;
7
7
  max?: number;
8
8
  booked?: number;
@@ -72,9 +72,8 @@ export declare function createCapacityManager(): {
72
72
  totalCapacity: number;
73
73
  }[];
74
74
  };
75
- addQuotas(quotas: Quotas): void;
76
- addSeats(dateId: DateID, seats: Seats): void;
75
+ addQuotas(quotas: Quotas, saveToLocalStorage?: boolean): void;
76
+ addSeats(dateId: DateID, seats: Seats, saveToLocalStorage?: boolean): void;
77
77
  capacityPolicy(item: CartItem): "quotas" | "unlimited" | "seats";
78
- capacity(cart: Cart, item: CartItem, preCart: Cart): import('./types').Capacity;
78
+ capacity(cart: Cart, item: CartItem, preCart: Cart): import('./types.ts').Capacity;
79
79
  };
80
- export {};
@@ -0,0 +1,5 @@
1
+ import { CapacityManager, DateID, Seats } from './CapacityManager.ts';
2
+ import { Quotas } from '@gomus/types';
3
+ export declare function saveCapacityToLocalStorage(allSeats: Record<DateID, Seats>, allQuotas: Quotas): void;
4
+ export declare function loadCapacityFromLocalStorage(manager: CapacityManager): void;
5
+ export declare function syncCapacityAcrossTabs(manager: CapacityManager): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -14,14 +14,7 @@ export declare class Shop {
14
14
  constructor();
15
15
  load(apiUrl: string, shopDomain: string, locale: string, type?: ShopKind): Promise<void>;
16
16
  get capacityManager(): {
17
- allSeats: Record<number, {
18
- min?: number;
19
- max?: number;
20
- booked?: number;
21
- available?: number;
22
- max_per_registration?: number | null;
23
- overbook?: boolean;
24
- }>;
17
+ allSeats: Record<import('../models/capacity/CapacityManager.ts').DateID, import('../models/capacity/CapacityManager.ts').Seats>;
25
18
  allQuotas: import('@gomus/types').Quotas;
26
19
  quotaManager: {
27
20
  apiData: {
@@ -74,15 +67,8 @@ export declare class Shop {
74
67
  totalCapacity: number;
75
68
  }[];
76
69
  };
77
- addQuotas(quotas: import('@gomus/types').Quotas): void;
78
- addSeats(dateId: number, seats: {
79
- min?: number;
80
- max?: number;
81
- booked?: number;
82
- available?: number;
83
- max_per_registration?: number | null;
84
- overbook?: boolean;
85
- }): void;
70
+ addQuotas(quotas: import('@gomus/types').Quotas, saveToLocalStorage?: boolean): void;
71
+ addSeats(dateId: import('../models/capacity/CapacityManager.ts').DateID, seats: import('../models/capacity/CapacityManager.ts').Seats, saveToLocalStorage?: boolean): void;
86
72
  capacityPolicy(item: import('../models/cart/types').CartItem): "quotas" | "unlimited" | "seats";
87
73
  capacity(cart: Cart, item: import('../models/cart/types').CartItem, preCart: Cart): import('../models/capacity/types').Capacity;
88
74
  };
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "Giantmonkey GmbH"
5
5
  },
6
6
  "license": "MIT",
7
- "version": "1.40.0",
7
+ "version": "1.42.0",
8
8
  "type": "module",
9
9
  "main": "./dist-js/gomus-webcomponents.iife.js",
10
10
  "module": "./dist-js/gomus-webcomponents.iife.js",