@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.
@@ -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 = cart.totalQuantity;
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
- const cart = shop.cart;
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 = cart.totalQuantity;
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
- const cart = shop.cart;
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,5 +1,5 @@
1
- import { Cart } from '../cart.svelte.ts';
2
- import { CartItem } from '../types.ts';
1
+ import { Cart } from '../cart/cart.svelte.ts';
2
+ import { CartItem } from '../cart/types.ts';
3
3
  import { Quotas } from '@gomus/types';
4
4
  type DateID = number;
5
5
  type Seats = {
@@ -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/cart/capacity/CapacityManager.ts';
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/cart/capacity/types').Capacity;
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;
@@ -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
@@ -4,7 +4,7 @@
4
4
  "name": "Giantmonkey GmbH"
5
5
  },
6
6
  "license": "MIT",
7
- "version": "1.25.4",
7
+ "version": "1.26.1",
8
8
  "type": "module",
9
9
  "main": "./dist-js/gomus-webcomponents.iife.js",
10
10
  "module": "./dist-js/gomus-webcomponents.iife.js",