@gomusdev/web-components 4.15.0 → 4.16.1
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 +24 -0
- package/dist-js/components/cart/components/DonationRow.svelte.d.ts +1 -0
- package/dist-js/components/donations/components/DonationCheckbox.svelte.d.ts +1 -0
- package/dist-js/gomus-webcomponents.iife.js +319 -83
- package/dist-js/gomus-webcomponents.js +319 -83
- package/dist-js/gomus-webcomponents.min.iife.js +23 -23
- package/dist-js/gomus-webcomponents.min.js +7688 -7522
- package/dist-js/src/components/donations/components/DonationCheckbox.spec.d.ts +1 -0
- package/dist-js/src/components/ticketSelection/subcomponents/tickets/subcomponents/segment/SegmentDetails.svelte.d.ts +10 -1
- package/dist-js/src/lib/models/cart/cart.svelte.d.ts +21 -3
- package/dist-js/src/lib/models/cart/types.d.ts +11 -0
- package/dist-js/src/lib/stores/shop.svelte.d.ts +10 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -61,6 +61,7 @@ export declare class SegmentDetails {
|
|
|
61
61
|
} | undefined;
|
|
62
62
|
}[];
|
|
63
63
|
coupons: import('../../../../../../lib/models/cart/types').CouponItem[];
|
|
64
|
+
donations: import('../../../../../../lib/models/cart/types').CartDonation[];
|
|
64
65
|
paymentModeId: string | undefined;
|
|
65
66
|
uid: string;
|
|
66
67
|
readonly nonEmptyItems: {
|
|
@@ -120,6 +121,7 @@ export declare class SegmentDetails {
|
|
|
120
121
|
} | undefined;
|
|
121
122
|
}[];
|
|
122
123
|
readonly totalPriceCents: number;
|
|
124
|
+
readonly donationCents: number;
|
|
123
125
|
readonly totalQuantity: number;
|
|
124
126
|
readonly valueVoucherCents: number;
|
|
125
127
|
readonly amountToPayCents: number;
|
|
@@ -162,7 +164,10 @@ export declare class SegmentDetails {
|
|
|
162
164
|
reference: null;
|
|
163
165
|
payment_mode_id: string;
|
|
164
166
|
coupons: string[];
|
|
165
|
-
donations:
|
|
167
|
+
donations: {
|
|
168
|
+
value: number;
|
|
169
|
+
campaign_id: number;
|
|
170
|
+
}[];
|
|
166
171
|
affiliate: {};
|
|
167
172
|
total: number;
|
|
168
173
|
};
|
|
@@ -174,6 +179,10 @@ export declare class SegmentDetails {
|
|
|
174
179
|
addCoupon(item: import('../../../../../../lib/models/cart/types').CouponItem): void;
|
|
175
180
|
removeCoupon(code: string): void;
|
|
176
181
|
clearCoupons(): void;
|
|
182
|
+
hasDonation(campaignId: number, value: number): boolean;
|
|
183
|
+
addDonation(donation: import('../../../../../../lib/models/cart/types').CartDonation): void;
|
|
184
|
+
removeDonation(campaignId: number, value: number): void;
|
|
185
|
+
clearDonations(): void;
|
|
177
186
|
};
|
|
178
187
|
filters: TicketSegmentFilter[] | undefined;
|
|
179
188
|
ticketSelectionDetails: TicketSelectionDetails | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CartItem, CouponItem, Product } from '../../../../lib/models/cart/types.ts';
|
|
1
|
+
import { CartItem, CartDonation, 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: {
|
|
@@ -58,6 +58,7 @@ export declare function createCart(products?: Product[], contingent?: number): {
|
|
|
58
58
|
} | undefined;
|
|
59
59
|
}[];
|
|
60
60
|
coupons: CouponItem[];
|
|
61
|
+
donations: CartDonation[];
|
|
61
62
|
paymentModeId: string | undefined;
|
|
62
63
|
uid: string;
|
|
63
64
|
readonly nonEmptyItems: {
|
|
@@ -117,6 +118,7 @@ export declare function createCart(products?: Product[], contingent?: number): {
|
|
|
117
118
|
} | undefined;
|
|
118
119
|
}[];
|
|
119
120
|
readonly totalPriceCents: number;
|
|
121
|
+
readonly donationCents: number;
|
|
120
122
|
readonly totalQuantity: number;
|
|
121
123
|
readonly valueVoucherCents: number;
|
|
122
124
|
readonly amountToPayCents: number;
|
|
@@ -162,7 +164,10 @@ export declare function createCart(products?: Product[], contingent?: number): {
|
|
|
162
164
|
reference: null;
|
|
163
165
|
payment_mode_id: string;
|
|
164
166
|
coupons: string[];
|
|
165
|
-
donations:
|
|
167
|
+
donations: {
|
|
168
|
+
value: number;
|
|
169
|
+
campaign_id: number;
|
|
170
|
+
}[];
|
|
166
171
|
affiliate: {};
|
|
167
172
|
total: number;
|
|
168
173
|
};
|
|
@@ -174,6 +179,10 @@ export declare function createCart(products?: Product[], contingent?: number): {
|
|
|
174
179
|
addCoupon(item: CouponItem): void;
|
|
175
180
|
removeCoupon(code: string): void;
|
|
176
181
|
clearCoupons(): void;
|
|
182
|
+
hasDonation(campaignId: number, value: number): boolean;
|
|
183
|
+
addDonation(donation: CartDonation): void;
|
|
184
|
+
removeDonation(campaignId: number, value: number): void;
|
|
185
|
+
clearDonations(): void;
|
|
177
186
|
};
|
|
178
187
|
export declare function createMainCart(): {
|
|
179
188
|
items: {
|
|
@@ -233,6 +242,7 @@ export declare function createMainCart(): {
|
|
|
233
242
|
} | undefined;
|
|
234
243
|
}[];
|
|
235
244
|
coupons: CouponItem[];
|
|
245
|
+
donations: CartDonation[];
|
|
236
246
|
paymentModeId: string | undefined;
|
|
237
247
|
uid: string;
|
|
238
248
|
readonly nonEmptyItems: {
|
|
@@ -292,6 +302,7 @@ export declare function createMainCart(): {
|
|
|
292
302
|
} | undefined;
|
|
293
303
|
}[];
|
|
294
304
|
readonly totalPriceCents: number;
|
|
305
|
+
readonly donationCents: number;
|
|
295
306
|
readonly totalQuantity: number;
|
|
296
307
|
readonly valueVoucherCents: number;
|
|
297
308
|
readonly amountToPayCents: number;
|
|
@@ -337,7 +348,10 @@ export declare function createMainCart(): {
|
|
|
337
348
|
reference: null;
|
|
338
349
|
payment_mode_id: string;
|
|
339
350
|
coupons: string[];
|
|
340
|
-
donations:
|
|
351
|
+
donations: {
|
|
352
|
+
value: number;
|
|
353
|
+
campaign_id: number;
|
|
354
|
+
}[];
|
|
341
355
|
affiliate: {};
|
|
342
356
|
total: number;
|
|
343
357
|
};
|
|
@@ -349,4 +363,8 @@ export declare function createMainCart(): {
|
|
|
349
363
|
addCoupon(item: CouponItem): void;
|
|
350
364
|
removeCoupon(code: string): void;
|
|
351
365
|
clearCoupons(): void;
|
|
366
|
+
hasDonation(campaignId: number, value: number): boolean;
|
|
367
|
+
addDonation(donation: CartDonation): void;
|
|
368
|
+
removeDonation(campaignId: number, value: number): void;
|
|
369
|
+
clearDonations(): void;
|
|
352
370
|
};
|
|
@@ -24,6 +24,17 @@ export type CouponItem = {
|
|
|
24
24
|
*/
|
|
25
25
|
applied?: boolean;
|
|
26
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* A fixed donation held in the cart until checkout. Mirrors the
|
|
29
|
+
* POST /api/v4/orders wire format 1:1: `donations: [{ value, campaign_id }]`,
|
|
30
|
+
* `value` in cents. Identity is the (campaign_id, value) pair — the same pair
|
|
31
|
+
* is never held twice, so duplicate <go-donation-checkbox> instances for one
|
|
32
|
+
* campaign+amount mirror each other instead of stacking donations.
|
|
33
|
+
*/
|
|
34
|
+
export type CartDonation = {
|
|
35
|
+
value: number;
|
|
36
|
+
campaign_id: number;
|
|
37
|
+
};
|
|
27
38
|
/**
|
|
28
39
|
* minimal props to define a Product in a CartItem
|
|
29
40
|
*/
|
|
@@ -141,6 +141,7 @@ export declare class Shop {
|
|
|
141
141
|
} | undefined;
|
|
142
142
|
}[];
|
|
143
143
|
coupons: import('../models/cart/types').CouponItem[];
|
|
144
|
+
donations: import('../models/cart/types').CartDonation[];
|
|
144
145
|
paymentModeId: string | undefined;
|
|
145
146
|
uid: string;
|
|
146
147
|
readonly nonEmptyItems: {
|
|
@@ -200,6 +201,7 @@ export declare class Shop {
|
|
|
200
201
|
} | undefined;
|
|
201
202
|
}[];
|
|
202
203
|
readonly totalPriceCents: number;
|
|
204
|
+
readonly donationCents: number;
|
|
203
205
|
readonly totalQuantity: number;
|
|
204
206
|
readonly valueVoucherCents: number;
|
|
205
207
|
readonly amountToPayCents: number;
|
|
@@ -242,7 +244,10 @@ export declare class Shop {
|
|
|
242
244
|
reference: null;
|
|
243
245
|
payment_mode_id: string;
|
|
244
246
|
coupons: string[];
|
|
245
|
-
donations:
|
|
247
|
+
donations: {
|
|
248
|
+
value: number;
|
|
249
|
+
campaign_id: number;
|
|
250
|
+
}[];
|
|
246
251
|
affiliate: {};
|
|
247
252
|
total: number;
|
|
248
253
|
};
|
|
@@ -254,6 +259,10 @@ export declare class Shop {
|
|
|
254
259
|
addCoupon(item: import('../models/cart/types').CouponItem): void;
|
|
255
260
|
removeCoupon(code: string): void;
|
|
256
261
|
clearCoupons(): void;
|
|
262
|
+
hasDonation(campaignId: number, value: number): boolean;
|
|
263
|
+
addDonation(donation: import('../models/cart/types').CartDonation): void;
|
|
264
|
+
removeDonation(campaignId: number, value: number): void;
|
|
265
|
+
clearDonations(): void;
|
|
257
266
|
} | undefined;
|
|
258
267
|
get auth(): Auth;
|
|
259
268
|
get currentUser(): User | undefined;
|