@moonbase.sh/vue 0.1.36 → 0.1.37

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/index.cjs CHANGED
@@ -258,6 +258,10 @@ function useCart() {
258
258
  }
259
259
  const _ = storefront.pushOrderContent();
260
260
  },
261
+ setQuantity: (cartItem, quantity) => {
262
+ cartItem.quantity = quantity;
263
+ const _ = storefront.pushOrderContent();
264
+ },
261
265
  removeFromCart: (cartItem) => {
262
266
  const index = storefront.currentOrder.value.items.findIndex((i) => i.type === "Bundle" && cartItem.type === "Bundle" && i.bundleId === cartItem.bundleId || i.type === "Product" && cartItem.type === "Product" && i.productId === cartItem.productId);
263
267
  storefront.currentOrder.value.items.splice(index, 1);
package/dist/index.d.cts CHANGED
@@ -38,6 +38,7 @@ declare function useCart(): {
38
38
  currency: string;
39
39
  }>;
40
40
  addToCart: (item: StorefrontProduct | StorefrontBundle, variation?: PricingVariation) => void;
41
+ setQuantity: (cartItem: CartItem, quantity: number) => void;
41
42
  removeFromCart: (cartItem: CartItem) => void;
42
43
  checkout: (returnUrl: string) => Promise<void>;
43
44
  };
package/dist/index.d.ts CHANGED
@@ -38,6 +38,7 @@ declare function useCart(): {
38
38
  currency: string;
39
39
  }>;
40
40
  addToCart: (item: StorefrontProduct | StorefrontBundle, variation?: PricingVariation) => void;
41
+ setQuantity: (cartItem: CartItem, quantity: number) => void;
41
42
  removeFromCart: (cartItem: CartItem) => void;
42
43
  checkout: (returnUrl: string) => Promise<void>;
43
44
  };
package/dist/index.js CHANGED
@@ -226,6 +226,10 @@ function useCart() {
226
226
  }
227
227
  const _ = storefront.pushOrderContent();
228
228
  },
229
+ setQuantity: (cartItem, quantity) => {
230
+ cartItem.quantity = quantity;
231
+ const _ = storefront.pushOrderContent();
232
+ },
229
233
  removeFromCart: (cartItem) => {
230
234
  const index = storefront.currentOrder.value.items.findIndex((i) => i.type === "Bundle" && cartItem.type === "Bundle" && i.bundleId === cartItem.bundleId || i.type === "Product" && cartItem.type === "Product" && i.productId === cartItem.productId);
231
235
  storefront.currentOrder.value.items.splice(index, 1);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@moonbase.sh/vue",
3
3
  "type": "module",
4
- "version": "0.1.36",
4
+ "version": "0.1.37",
5
5
  "description": "Package to let you build vue.js storefronts with Moonbase.sh as payment and delivery provider",
6
6
  "author": "Tobias Lønnerød Madsen <m@dsen.tv>",
7
7
  "license": "MIT",
@@ -15,7 +15,7 @@
15
15
  "dependencies": {
16
16
  "@vue/devtools-api": "^6.5.0",
17
17
  "uuid": "^9.0.0",
18
- "@moonbase.sh/api-client": "0.1.36"
18
+ "@moonbase.sh/api-client": "0.1.37"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "vue": "^3.2.0"