@gomusdev/web-components 3.7.0 → 3.8.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.
- package/README.md +6 -0
- package/dist-js/gomus-webcomponents.iife.js +61 -42
- package/dist-js/gomus-webcomponents.js +61 -42
- package/dist-js/gomus-webcomponents.min.iife.js +16 -16
- package/dist-js/gomus-webcomponents.min.js +1579 -1561
- package/dist-js/src/components/cart/components/CartDetails.svelte.d.ts +0 -1
- package/dist-js/src/components/cart/components/lib.d.ts +1 -5
- package/dist-js/src/components/ticketSelection/subcomponents/tickets/subcomponents/segment/SegmentDetails.svelte.d.ts +5 -3
- package/dist-js/src/lib/models/cart/cart.svelte.d.ts +11 -7
- package/dist-js/src/lib/models/cart/types.d.ts +19 -0
- package/dist-js/src/lib/stores/shop.svelte.d.ts +5 -3
- package/package.json +1 -1
|
@@ -6,9 +6,5 @@ export type ApiItem = PostCartData['items'][number];
|
|
|
6
6
|
export type DisplayItem = CartItem & {
|
|
7
7
|
display: NonNullable<CartItem['display']>;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
10
|
-
cart: Cart;
|
|
11
|
-
appliedCoupons: Set<string>;
|
|
12
|
-
};
|
|
13
|
-
export declare function createDisplayCart(baseCart: Cart, apiItems: ApiItem[]): DisplayCartResult;
|
|
9
|
+
export declare function createDisplayCart(baseCart: Cart, apiItems: ApiItem[]): Cart;
|
|
14
10
|
export {};
|
|
@@ -43,7 +43,7 @@ export declare class SegmentDetails {
|
|
|
43
43
|
originalPrice: number;
|
|
44
44
|
} | undefined;
|
|
45
45
|
}[];
|
|
46
|
-
coupons:
|
|
46
|
+
coupons: import('../../../../../../lib/models/cart/types').CouponItem[];
|
|
47
47
|
paymentModeId: undefined;
|
|
48
48
|
uid: string;
|
|
49
49
|
readonly nonEmptyItems: {
|
|
@@ -87,6 +87,8 @@ export declare class SegmentDetails {
|
|
|
87
87
|
}[];
|
|
88
88
|
readonly totalPriceCents: number;
|
|
89
89
|
readonly totalQuantity: number;
|
|
90
|
+
readonly valueVoucherCents: number;
|
|
91
|
+
readonly amountToPayCents: number;
|
|
90
92
|
toString(): string;
|
|
91
93
|
orderData(): {
|
|
92
94
|
items: {
|
|
@@ -125,8 +127,8 @@ export declare class SegmentDetails {
|
|
|
125
127
|
deleteItem(item: import('../../../../../../lib/models/cart/types').CartItem): void;
|
|
126
128
|
addItem(item: import('../../../../../../lib/models/cart/types').CartItem): void;
|
|
127
129
|
addItems(items: import('../../../../../../lib/models/cart/types').CartItem[]): void;
|
|
128
|
-
addCoupon(
|
|
129
|
-
removeCoupon(
|
|
130
|
+
addCoupon(item: import('../../../../../../lib/models/cart/types').CouponItem): void;
|
|
131
|
+
removeCoupon(code: string): void;
|
|
130
132
|
clearCoupons(): void;
|
|
131
133
|
};
|
|
132
134
|
filters: TicketSegmentFilter[] | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CartItem, Product } from '../../../../lib/models/cart/types.ts';
|
|
1
|
+
import { CartItem, CouponItem, Product } from '../../../../lib/models/cart/types.ts';
|
|
2
2
|
export type Cart = ReturnType<typeof createCart>;
|
|
3
3
|
export declare function createCart(products?: Product[], contingent?: number): {
|
|
4
4
|
items: {
|
|
@@ -40,7 +40,7 @@ export declare function createCart(products?: Product[], contingent?: number): {
|
|
|
40
40
|
originalPrice: number;
|
|
41
41
|
} | undefined;
|
|
42
42
|
}[];
|
|
43
|
-
coupons:
|
|
43
|
+
coupons: CouponItem[];
|
|
44
44
|
paymentModeId: undefined;
|
|
45
45
|
uid: string;
|
|
46
46
|
readonly nonEmptyItems: {
|
|
@@ -84,6 +84,8 @@ export declare function createCart(products?: Product[], contingent?: number): {
|
|
|
84
84
|
}[];
|
|
85
85
|
readonly totalPriceCents: number;
|
|
86
86
|
readonly totalQuantity: number;
|
|
87
|
+
readonly valueVoucherCents: number;
|
|
88
|
+
readonly amountToPayCents: number;
|
|
87
89
|
/**
|
|
88
90
|
* Generates a formatted string representation of the current object.
|
|
89
91
|
*/
|
|
@@ -125,8 +127,8 @@ export declare function createCart(products?: Product[], contingent?: number): {
|
|
|
125
127
|
deleteItem(item: CartItem): void;
|
|
126
128
|
addItem(item: CartItem): void;
|
|
127
129
|
addItems(items: CartItem[]): void;
|
|
128
|
-
addCoupon(
|
|
129
|
-
removeCoupon(
|
|
130
|
+
addCoupon(item: CouponItem): void;
|
|
131
|
+
removeCoupon(code: string): void;
|
|
130
132
|
clearCoupons(): void;
|
|
131
133
|
};
|
|
132
134
|
export declare function formatCurrency(priceCents: number): string;
|
|
@@ -170,7 +172,7 @@ export declare function createMainCart(): {
|
|
|
170
172
|
originalPrice: number;
|
|
171
173
|
} | undefined;
|
|
172
174
|
}[];
|
|
173
|
-
coupons:
|
|
175
|
+
coupons: CouponItem[];
|
|
174
176
|
paymentModeId: undefined;
|
|
175
177
|
uid: string;
|
|
176
178
|
readonly nonEmptyItems: {
|
|
@@ -214,6 +216,8 @@ export declare function createMainCart(): {
|
|
|
214
216
|
}[];
|
|
215
217
|
readonly totalPriceCents: number;
|
|
216
218
|
readonly totalQuantity: number;
|
|
219
|
+
readonly valueVoucherCents: number;
|
|
220
|
+
readonly amountToPayCents: number;
|
|
217
221
|
/**
|
|
218
222
|
* Generates a formatted string representation of the current object.
|
|
219
223
|
*/
|
|
@@ -255,7 +259,7 @@ export declare function createMainCart(): {
|
|
|
255
259
|
deleteItem(item: CartItem): void;
|
|
256
260
|
addItem(item: CartItem): void;
|
|
257
261
|
addItems(items: CartItem[]): void;
|
|
258
|
-
addCoupon(
|
|
259
|
-
removeCoupon(
|
|
262
|
+
addCoupon(item: CouponItem): void;
|
|
263
|
+
removeCoupon(code: string): void;
|
|
260
264
|
clearCoupons(): void;
|
|
261
265
|
};
|
|
@@ -4,6 +4,25 @@ import { UIEventTicket } from '../../../../lib/models/eventTicket/UIEventTicket.
|
|
|
4
4
|
import { UITicket } from '../../../../lib/models/ticket/UITicket.svelte.ts';
|
|
5
5
|
export type ProductType = 'Ticket' | 'Event' | 'Coupon';
|
|
6
6
|
export type CartItem = ReturnType<typeof createCartItem>;
|
|
7
|
+
/**
|
|
8
|
+
* A redeemed coupon code held in the cart. `kind` mirrors the German domain
|
|
9
|
+
* terms 1:1: Aktionstoken (order discount), Leistungsgutschein (free specific
|
|
10
|
+
* ticket), Wertgutschein (gift-card credit that pays toward the total).
|
|
11
|
+
*/
|
|
12
|
+
export type CouponKind = 'actionToken' | 'serviceVoucher' | 'valueVoucher';
|
|
13
|
+
export type CouponItem = {
|
|
14
|
+
code: string;
|
|
15
|
+
kind: CouponKind;
|
|
16
|
+
/** Only for valueVoucher — remaining balance at redemption time. */
|
|
17
|
+
valueCents?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Whether this coupon is currently applied to the cart. Set when the display
|
|
20
|
+
* cart is built (see createDisplayCart): value/service vouchers are applied
|
|
21
|
+
* client-side and are always true; an order-discount token is applied only
|
|
22
|
+
* once the backend confirms it on a cart line.
|
|
23
|
+
*/
|
|
24
|
+
applied?: boolean;
|
|
25
|
+
};
|
|
7
26
|
/**
|
|
8
27
|
* minimal props to define a Product in a CartItem
|
|
9
28
|
*/
|
|
@@ -113,7 +113,7 @@ export declare class Shop {
|
|
|
113
113
|
originalPrice: number;
|
|
114
114
|
} | undefined;
|
|
115
115
|
}[];
|
|
116
|
-
coupons:
|
|
116
|
+
coupons: import('../models/cart/types').CouponItem[];
|
|
117
117
|
paymentModeId: undefined;
|
|
118
118
|
uid: string;
|
|
119
119
|
readonly nonEmptyItems: {
|
|
@@ -157,6 +157,8 @@ export declare class Shop {
|
|
|
157
157
|
}[];
|
|
158
158
|
readonly totalPriceCents: number;
|
|
159
159
|
readonly totalQuantity: number;
|
|
160
|
+
readonly valueVoucherCents: number;
|
|
161
|
+
readonly amountToPayCents: number;
|
|
160
162
|
toString(): string;
|
|
161
163
|
orderData(): {
|
|
162
164
|
items: {
|
|
@@ -195,8 +197,8 @@ export declare class Shop {
|
|
|
195
197
|
deleteItem(item: import('../models/cart/types').CartItem): void;
|
|
196
198
|
addItem(item: import('../models/cart/types').CartItem): void;
|
|
197
199
|
addItems(items: import('../models/cart/types').CartItem[]): void;
|
|
198
|
-
addCoupon(
|
|
199
|
-
removeCoupon(
|
|
200
|
+
addCoupon(item: import('../models/cart/types').CouponItem): void;
|
|
201
|
+
removeCoupon(code: string): void;
|
|
200
202
|
clearCoupons(): void;
|
|
201
203
|
} | undefined;
|
|
202
204
|
get auth(): Auth;
|