@open-tender/utils 0.4.78 → 0.4.80

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.
@@ -18,7 +18,6 @@ const useCartGuestForm = (loading, error, cartId, joinCart) => {
18
18
  { label: 'Last Name', name: 'last_name', type: 'text', required: true }
19
19
  ];
20
20
  (0, react_1.useEffect)(() => {
21
- setData(Object.assign(Object.assign({}, initState), { cart_id: cartId }));
22
21
  return () => {
23
22
  setData(Object.assign(Object.assign({}, initState), { cart_id: cartId }));
24
23
  setErrors({});
@@ -32,6 +32,8 @@ export declare const useMenuItem: (builtItem: CartItem, auth: Auth | null, looku
32
32
  signature?: string | undefined;
33
33
  similarItems: number[];
34
34
  upsellItems: number[];
35
+ list_name: string | null;
36
+ list_id: string | null;
35
37
  allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
36
38
  cals: number | null;
37
39
  groups: import("@open-tender/types").CartItemGroups;
@@ -20,6 +20,8 @@ export declare const useOrderItem: (orderItem: CartItem, favorite?: MenuItemFavo
20
20
  signature?: string | undefined;
21
21
  similarItems: number[];
22
22
  upsellItems: number[];
23
+ list_name: string | null;
24
+ list_id: string | null;
23
25
  allergens: string[];
24
26
  allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
25
27
  cals: number | null;
@@ -24,6 +24,8 @@ export declare const rehydrateCart: (menuItems: MenuItems, simpleCartItems: Simp
24
24
  signature?: string | undefined;
25
25
  similarItems: number[];
26
26
  upsellItems: number[];
27
+ list_name: string | null;
28
+ list_id: string | null;
27
29
  allergens: string[];
28
30
  allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
29
31
  cals: number | null;
@@ -116,6 +118,8 @@ export declare const combineCarts: (cart: Cart, guestCart: Cart, cartOwner: Cart
116
118
  signature?: string | undefined;
117
119
  similarItems: number[];
118
120
  upsellItems: number[];
121
+ list_name: string | null;
122
+ list_id: string | null;
119
123
  allergens: string[];
120
124
  allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
121
125
  cals: number | null;
@@ -283,7 +283,7 @@ const makeOrderItem = (item, isEdit, soldOut = [], simpleItem, hasPoints = false
283
283
  id: item.id,
284
284
  imageUrl: item.large_image_url,
285
285
  increment: item.increment,
286
- // index: null,
286
+ index: item.index,
287
287
  ingredients: item.ingredients,
288
288
  isSoldOut: isSoldOut,
289
289
  madeFor: simpleItem ? simpleItem.made_for || null : null,
@@ -308,7 +308,9 @@ const makeOrderItem = (item, isEdit, soldOut = [], simpleItem, hasPoints = false
308
308
  totalPrice: null,
309
309
  upsellItems: item.upsell_items,
310
310
  itemShape: (_b = item.item_shape) !== null && _b !== void 0 ? _b : null,
311
- excludeFromBuilder: (_c = item.exclude_from_builder) !== null && _c !== void 0 ? _c : false
311
+ excludeFromBuilder: (_c = item.exclude_from_builder) !== null && _c !== void 0 ? _c : false,
312
+ list_id: item.list_id,
313
+ list_name: item.list_name
312
314
  };
313
315
  const pricedItem = (0, exports.calcPrices)(orderItem);
314
316
  return pricedItem;
@@ -906,7 +908,10 @@ exports.checkAmountRemaining = checkAmountRemaining;
906
908
  const makeDeviceType = (deviceType, deviceId) => {
907
909
  // when app is only built in phone mode (not Universal) react-native-device-info shows device type as "Handset"
908
910
  // so override it to "Tablet" if the deviceId has "iPad" in the name
909
- deviceType = (deviceType === 'Handset' && !!deviceId && /iPad/.test(deviceId)) ? 'Tablet' : deviceType;
911
+ deviceType =
912
+ deviceType === 'Handset' && !!deviceId && /iPad/.test(deviceId)
913
+ ? 'Tablet'
914
+ : deviceType;
910
915
  switch (deviceType === null || deviceType === void 0 ? void 0 : deviceType.toLowerCase()) {
911
916
  case 'tablet':
912
917
  return 'TABLET';
@@ -51,6 +51,9 @@ export declare const makeOtherMenuSections: (displayedSections: MenuDisplayedSec
51
51
  upsell_items: number[];
52
52
  item_shape: import("@open-tender/types").PizzaShape | null;
53
53
  exclude_from_builder: boolean;
54
+ list_name: string | null;
55
+ list_id: string | null;
56
+ index?: number | undefined;
54
57
  }[];
55
58
  }[];
56
59
  export declare const makeFlatCategories: (categories: MenuCategories) => {
@@ -96,6 +99,9 @@ export declare const makeFlatCategories: (categories: MenuCategories) => {
96
99
  upsell_items: number[];
97
100
  item_shape: import("@open-tender/types").PizzaShape | null;
98
101
  exclude_from_builder: boolean;
102
+ list_name: string | null;
103
+ list_id: string | null;
104
+ index?: number | undefined;
99
105
  }[];
100
106
  app_image_url: string | null;
101
107
  appearance: import("@open-tender/types").MenuCategoryAppearance;
@@ -15,7 +15,6 @@ export const useCartGuestForm = (loading, error, cartId, joinCart) => {
15
15
  { label: 'Last Name', name: 'last_name', type: 'text', required: true }
16
16
  ];
17
17
  useEffect(() => {
18
- setData(Object.assign(Object.assign({}, initState), { cart_id: cartId }));
19
18
  return () => {
20
19
  setData(Object.assign(Object.assign({}, initState), { cart_id: cartId }));
21
20
  setErrors({});
@@ -32,6 +32,8 @@ export declare const useMenuItem: (builtItem: CartItem, auth: Auth | null, looku
32
32
  signature?: string | undefined;
33
33
  similarItems: number[];
34
34
  upsellItems: number[];
35
+ list_name: string | null;
36
+ list_id: string | null;
35
37
  allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
36
38
  cals: number | null;
37
39
  groups: import("@open-tender/types").CartItemGroups;
@@ -20,6 +20,8 @@ export declare const useOrderItem: (orderItem: CartItem, favorite?: MenuItemFavo
20
20
  signature?: string | undefined;
21
21
  similarItems: number[];
22
22
  upsellItems: number[];
23
+ list_name: string | null;
24
+ list_id: string | null;
23
25
  allergens: string[];
24
26
  allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
25
27
  cals: number | null;
@@ -24,6 +24,8 @@ export declare const rehydrateCart: (menuItems: MenuItems, simpleCartItems: Simp
24
24
  signature?: string | undefined;
25
25
  similarItems: number[];
26
26
  upsellItems: number[];
27
+ list_name: string | null;
28
+ list_id: string | null;
27
29
  allergens: string[];
28
30
  allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
29
31
  cals: number | null;
@@ -116,6 +118,8 @@ export declare const combineCarts: (cart: Cart, guestCart: Cart, cartOwner: Cart
116
118
  signature?: string | undefined;
117
119
  similarItems: number[];
118
120
  upsellItems: number[];
121
+ list_name: string | null;
122
+ list_id: string | null;
119
123
  allergens: string[];
120
124
  allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
121
125
  cals: number | null;
@@ -268,7 +268,7 @@ export const makeOrderItem = (item, isEdit, soldOut = [], simpleItem, hasPoints
268
268
  id: item.id,
269
269
  imageUrl: item.large_image_url,
270
270
  increment: item.increment,
271
- // index: null,
271
+ index: item.index,
272
272
  ingredients: item.ingredients,
273
273
  isSoldOut: isSoldOut,
274
274
  madeFor: simpleItem ? simpleItem.made_for || null : null,
@@ -293,7 +293,9 @@ export const makeOrderItem = (item, isEdit, soldOut = [], simpleItem, hasPoints
293
293
  totalPrice: null,
294
294
  upsellItems: item.upsell_items,
295
295
  itemShape: (_b = item.item_shape) !== null && _b !== void 0 ? _b : null,
296
- excludeFromBuilder: (_c = item.exclude_from_builder) !== null && _c !== void 0 ? _c : false
296
+ excludeFromBuilder: (_c = item.exclude_from_builder) !== null && _c !== void 0 ? _c : false,
297
+ list_id: item.list_id,
298
+ list_name: item.list_name
297
299
  };
298
300
  const pricedItem = calcPrices(orderItem);
299
301
  return pricedItem;
@@ -866,7 +868,10 @@ export const checkAmountRemaining = (total, tenders) => {
866
868
  export const makeDeviceType = (deviceType, deviceId) => {
867
869
  // when app is only built in phone mode (not Universal) react-native-device-info shows device type as "Handset"
868
870
  // so override it to "Tablet" if the deviceId has "iPad" in the name
869
- deviceType = (deviceType === 'Handset' && !!deviceId && /iPad/.test(deviceId)) ? 'Tablet' : deviceType;
871
+ deviceType =
872
+ deviceType === 'Handset' && !!deviceId && /iPad/.test(deviceId)
873
+ ? 'Tablet'
874
+ : deviceType;
870
875
  switch (deviceType === null || deviceType === void 0 ? void 0 : deviceType.toLowerCase()) {
871
876
  case 'tablet':
872
877
  return 'TABLET';
@@ -51,6 +51,9 @@ export declare const makeOtherMenuSections: (displayedSections: MenuDisplayedSec
51
51
  upsell_items: number[];
52
52
  item_shape: import("@open-tender/types").PizzaShape | null;
53
53
  exclude_from_builder: boolean;
54
+ list_name: string | null;
55
+ list_id: string | null;
56
+ index?: number | undefined;
54
57
  }[];
55
58
  }[];
56
59
  export declare const makeFlatCategories: (categories: MenuCategories) => {
@@ -96,6 +99,9 @@ export declare const makeFlatCategories: (categories: MenuCategories) => {
96
99
  upsell_items: number[];
97
100
  item_shape: import("@open-tender/types").PizzaShape | null;
98
101
  exclude_from_builder: boolean;
102
+ list_name: string | null;
103
+ list_id: string | null;
104
+ index?: number | undefined;
99
105
  }[];
100
106
  app_image_url: string | null;
101
107
  appearance: import("@open-tender/types").MenuCategoryAppearance;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/utils",
3
- "version": "0.4.78",
3
+ "version": "0.4.80",
4
4
  "description": "A library of utils for use with Open Tender applications that utilize our cloud-based Order API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -36,7 +36,7 @@
36
36
  "private": false,
37
37
  "devDependencies": {
38
38
  "@emotion/react": "^11.10.4",
39
- "@open-tender/types": "^0.4.98",
39
+ "@open-tender/types": "^0.4.111",
40
40
  "@reduxjs/toolkit": "^1.8.5",
41
41
  "@types/google.maps": "^3.53.5",
42
42
  "@types/jest": "^29.5.11",