@gomusdev/web-components 1.25.4 → 1.26.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/dist-js/gomus-webcomponents.iife.js +6 -3
- package/dist-js/gomus-webcomponents.js +6 -3
- package/dist-js/lib/models/{cart/capacity → capacity}/CapacityManager.d.ts +2 -2
- package/dist-js/lib/models/{cart/capacity → capacity}/types.d.ts +2 -2
- package/dist-js/lib/stores/shop.svelte.d.ts +2 -2
- package/dist-js/mocks/ScalingPricesMocks.d.ts +15 -0
- package/dist-js/mocks/mocks.d.ts +66 -0
- package/package.json +1 -1
- /package/dist-js/lib/models/{cart/capacity → capacity}/calculators/quotaManager/QuotaManager.d.ts +0 -0
- /package/dist-js/lib/models/{cart/capacity → capacity}/calculators/quotaManager/QuotaManager.spec.d.ts +0 -0
- /package/dist-js/lib/models/{cart/capacity → capacity}/calculators/quotas.d.ts +0 -0
- /package/dist-js/lib/models/{cart/capacity → capacity}/calculators/seats.d.ts +0 -0
- /package/dist-js/lib/models/{cart/capacity → capacity}/calculators/seats.spec.d.ts +0 -0
- /package/dist-js/lib/models/{cart/capacity → capacity}/calculators/unlimited.d.ts +0 -0
|
@@ -11023,7 +11023,10 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
11023
11023
|
let available = max_in_cart;
|
|
11024
11024
|
if (seats.overbook) available = Math.min(seats.max || 100, seats.max_per_registration || 100);
|
|
11025
11025
|
const preCartTotal = preCart.totalQuantity;
|
|
11026
|
-
const cartTotal =
|
|
11026
|
+
const cartTotal = sum(
|
|
11027
|
+
cart.items.filter((i) => preCart.items.some((pi) => pi.uuid === i.uuid)),
|
|
11028
|
+
(i) => i.quantity
|
|
11029
|
+
);
|
|
11027
11030
|
const max2 = Math.max(available - cartTotal - preCartTotal + item.quantity, 0);
|
|
11028
11031
|
const ret = {
|
|
11029
11032
|
max: max2,
|
|
@@ -16105,7 +16108,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
16105
16108
|
function CheckoutForm($$anchor, $$props) {
|
|
16106
16109
|
push($$props, true);
|
|
16107
16110
|
let custom2 = prop($$props, "custom", 7, false);
|
|
16108
|
-
|
|
16111
|
+
let cart = /* @__PURE__ */ user_derived(() => shop.cart);
|
|
16109
16112
|
Forms.defineForm({
|
|
16110
16113
|
id: "checkoutGuest",
|
|
16111
16114
|
fields: [
|
|
@@ -16125,7 +16128,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
16125
16128
|
form.details.apiErrors = auth.error.errors;
|
|
16126
16129
|
return;
|
|
16127
16130
|
}
|
|
16128
|
-
const checkout = await shop.checkout(cart.orderData());
|
|
16131
|
+
const checkout = await shop.checkout(get$2(cart).orderData());
|
|
16129
16132
|
if (checkout.error) {
|
|
16130
16133
|
form.details.apiErrors = checkout.error;
|
|
16131
16134
|
return;
|
|
@@ -11023,7 +11023,10 @@ const maxQuantity_Seats = function(manager, cart, item, preCart) {
|
|
|
11023
11023
|
let available = max_in_cart;
|
|
11024
11024
|
if (seats.overbook) available = Math.min(seats.max || 100, seats.max_per_registration || 100);
|
|
11025
11025
|
const preCartTotal = preCart.totalQuantity;
|
|
11026
|
-
const cartTotal =
|
|
11026
|
+
const cartTotal = sum(
|
|
11027
|
+
cart.items.filter((i) => preCart.items.some((pi) => pi.uuid === i.uuid)),
|
|
11028
|
+
(i) => i.quantity
|
|
11029
|
+
);
|
|
11027
11030
|
const max2 = Math.max(available - cartTotal - preCartTotal + item.quantity, 0);
|
|
11028
11031
|
const ret = {
|
|
11029
11032
|
max: max2,
|
|
@@ -16105,7 +16108,7 @@ customElements.define("go-cart-counter", create_custom_element(CartCounter, {},
|
|
|
16105
16108
|
function CheckoutForm($$anchor, $$props) {
|
|
16106
16109
|
push($$props, true);
|
|
16107
16110
|
let custom2 = prop($$props, "custom", 7, false);
|
|
16108
|
-
|
|
16111
|
+
let cart = /* @__PURE__ */ user_derived(() => shop.cart);
|
|
16109
16112
|
Forms.defineForm({
|
|
16110
16113
|
id: "checkoutGuest",
|
|
16111
16114
|
fields: [
|
|
@@ -16125,7 +16128,7 @@ function CheckoutForm($$anchor, $$props) {
|
|
|
16125
16128
|
form.details.apiErrors = auth.error.errors;
|
|
16126
16129
|
return;
|
|
16127
16130
|
}
|
|
16128
|
-
const checkout = await shop.checkout(cart.orderData());
|
|
16131
|
+
const checkout = await shop.checkout(get$2(cart).orderData());
|
|
16129
16132
|
if (checkout.error) {
|
|
16130
16133
|
form.details.apiErrors = checkout.error;
|
|
16131
16134
|
return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CapacityManager } from './CapacityManager.ts';
|
|
2
|
-
import { Cart } from '../cart.svelte.ts';
|
|
3
|
-
import { CartItem } from '../types.ts';
|
|
2
|
+
import { Cart } from '../cart/cart.svelte.ts';
|
|
3
|
+
import { CartItem } from '../cart/types.ts';
|
|
4
4
|
export type Capacity = {
|
|
5
5
|
min: number;
|
|
6
6
|
max: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CalendarDates } from '../../components/ticketSelection/subcomponents/calendar/lib/calendar.svelte.ts';
|
|
2
2
|
import { ShopUrls } from '../helpers/urls';
|
|
3
|
-
import { CapacityManager } from '../models/
|
|
3
|
+
import { CapacityManager } from '../models/capacity/CapacityManager.ts';
|
|
4
4
|
import { Cart } from '../models/cart/cart.svelte.ts';
|
|
5
5
|
import { Auth } from './auth.svelte.ts';
|
|
6
6
|
import { User } from './user.svelte.ts';
|
|
@@ -84,7 +84,7 @@ export declare class Shop {
|
|
|
84
84
|
overbook?: boolean;
|
|
85
85
|
}): void;
|
|
86
86
|
capacityPolicy(item: import('../models/cart/types').CartItem): "quotas" | "unlimited" | "seats";
|
|
87
|
-
capacity(cart: Cart, item: import('../models/cart/types').CartItem, preCart: Cart): import('../models/
|
|
87
|
+
capacity(cart: Cart, item: import('../models/cart/types').CartItem, preCart: Cart): import('../models/capacity/types').Capacity;
|
|
88
88
|
};
|
|
89
89
|
get cart(): {
|
|
90
90
|
items: import('../models/cart/types').CartItem[];
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
export declare const ScalingPriceFactories: {
|
|
2
|
+
ticket({ options }: {
|
|
3
|
+
options?: {} | undefined;
|
|
4
|
+
}): {
|
|
5
|
+
scale_price_id: number;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
group: boolean;
|
|
9
|
+
optional: boolean;
|
|
10
|
+
price_cents: number;
|
|
11
|
+
vat_pct: number;
|
|
12
|
+
accounting_article_id: number;
|
|
13
|
+
accounting_article_type: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
1
16
|
export declare const ScalingPricesMocks: {
|
|
2
17
|
ticket1: {
|
|
3
18
|
scale_price_id: number;
|
package/dist-js/mocks/mocks.d.ts
CHANGED
|
@@ -2010,6 +2010,72 @@ export declare const CartItemMocks: {
|
|
|
2010
2010
|
quantity: number;
|
|
2011
2011
|
time: string;
|
|
2012
2012
|
};
|
|
2013
|
+
eventScaledItem2: () => {
|
|
2014
|
+
type: import('../lib/models/cart/types').ProductType;
|
|
2015
|
+
product: {
|
|
2016
|
+
type: "scale";
|
|
2017
|
+
minAvailableCapacity: number;
|
|
2018
|
+
selectedTime: string;
|
|
2019
|
+
quantity: number;
|
|
2020
|
+
accounting_article_id: number;
|
|
2021
|
+
accounting_article_type: string;
|
|
2022
|
+
description: string;
|
|
2023
|
+
group: boolean;
|
|
2024
|
+
optional: boolean;
|
|
2025
|
+
price_cents: number;
|
|
2026
|
+
scale_price_id: number;
|
|
2027
|
+
title: string;
|
|
2028
|
+
vat_pct: number;
|
|
2029
|
+
id: number;
|
|
2030
|
+
tax_included: boolean;
|
|
2031
|
+
product_type: import('../lib/models/cart/types').ProductType;
|
|
2032
|
+
uid: number;
|
|
2033
|
+
dateId: number;
|
|
2034
|
+
scalePriceId: number;
|
|
2035
|
+
} | {
|
|
2036
|
+
type: "scale";
|
|
2037
|
+
product_type: import('../lib/models/cart/types').ProductType;
|
|
2038
|
+
accounting_article_id: number;
|
|
2039
|
+
accounting_article_type: string;
|
|
2040
|
+
description: string;
|
|
2041
|
+
group: boolean;
|
|
2042
|
+
optional: boolean;
|
|
2043
|
+
price_cents: number;
|
|
2044
|
+
scale_price_id: number;
|
|
2045
|
+
title: string;
|
|
2046
|
+
vat_pct: number;
|
|
2047
|
+
id: number;
|
|
2048
|
+
tax_included: boolean;
|
|
2049
|
+
uid: number;
|
|
2050
|
+
dateId: number;
|
|
2051
|
+
scalePriceId: number;
|
|
2052
|
+
};
|
|
2053
|
+
orderAttributes(): {
|
|
2054
|
+
shipped_with_merchandise_id: null;
|
|
2055
|
+
shipping_mode: string;
|
|
2056
|
+
id: number;
|
|
2057
|
+
time: string;
|
|
2058
|
+
quantity: number;
|
|
2059
|
+
} | {
|
|
2060
|
+
shipped_with_merchandise_id: null;
|
|
2061
|
+
shipping_mode: string;
|
|
2062
|
+
id: number;
|
|
2063
|
+
quantities: {
|
|
2064
|
+
[x: number]: number;
|
|
2065
|
+
};
|
|
2066
|
+
};
|
|
2067
|
+
uuid: string;
|
|
2068
|
+
subUId: string;
|
|
2069
|
+
toString(): string;
|
|
2070
|
+
price_cents: number;
|
|
2071
|
+
price_formatted: string;
|
|
2072
|
+
final_price_cents: number;
|
|
2073
|
+
final_price_formatted: string;
|
|
2074
|
+
total_price_cents: number;
|
|
2075
|
+
total_price_formatted: string;
|
|
2076
|
+
quantity: number;
|
|
2077
|
+
time: string;
|
|
2078
|
+
};
|
|
2013
2079
|
};
|
|
2014
2080
|
export declare const ShopMocks: {
|
|
2015
2081
|
mockNoTickets: () => void;
|
package/package.json
CHANGED
/package/dist-js/lib/models/{cart/capacity → capacity}/calculators/quotaManager/QuotaManager.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|