@open-tender/store 1.1.7 → 1.1.9

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.
Files changed (91) hide show
  1. package/dist/cjs/components/Cart.d.ts +2 -1
  2. package/dist/cjs/components/Cart.js +3 -3
  3. package/dist/cjs/components/CartItem.d.ts +2 -1
  4. package/dist/cjs/components/CartItem.js +3 -2
  5. package/dist/cjs/components/CartUpsellItem.d.ts +2 -1
  6. package/dist/cjs/components/CartUpsellItem.js +2 -2
  7. package/dist/cjs/components/CartUpsells.d.ts +2 -1
  8. package/dist/cjs/components/CartUpsells.js +2 -2
  9. package/dist/cjs/components/CategoryItem.d.ts +2 -1
  10. package/dist/cjs/components/CategoryItem.js +2 -2
  11. package/dist/cjs/components/CategoryNav.d.ts +2 -1
  12. package/dist/cjs/components/CategoryNav.js +3 -3
  13. package/dist/cjs/components/CategoryNavItem.d.ts +2 -1
  14. package/dist/cjs/components/CategoryNavItem.js +3 -2
  15. package/dist/cjs/components/CategoryNavOther.d.ts +2 -1
  16. package/dist/cjs/components/CategoryNavOther.js +2 -2
  17. package/dist/cjs/components/Discount.d.ts +2 -1
  18. package/dist/cjs/components/Discount.js +2 -2
  19. package/dist/cjs/components/ItemGroup.d.ts +2 -2
  20. package/dist/cjs/components/ItemGroup.js +10 -3
  21. package/dist/cjs/components/ItemGroups.d.ts +2 -1
  22. package/dist/cjs/components/ItemGroups.js +2 -2
  23. package/dist/cjs/components/ItemOption.d.ts +2 -1
  24. package/dist/cjs/components/ItemOption.js +3 -2
  25. package/dist/cjs/components/ItemSelections.d.ts +2 -1
  26. package/dist/cjs/components/ItemSelections.js +2 -2
  27. package/dist/cjs/components/MenuOther.d.ts +2 -1
  28. package/dist/cjs/components/MenuOther.js +9 -2
  29. package/dist/cjs/components/Modal.js +1 -1
  30. package/dist/cjs/components/Option.d.ts +2 -1
  31. package/dist/cjs/components/Option.js +2 -2
  32. package/dist/cjs/components/OrderCard.d.ts +2 -1
  33. package/dist/cjs/components/OrderCard.js +3 -2
  34. package/dist/cjs/components/PointsReward.d.ts +2 -1
  35. package/dist/cjs/components/PointsReward.js +3 -2
  36. package/dist/cjs/components/PointsRewards.d.ts +2 -1
  37. package/dist/cjs/components/PointsRewards.js +2 -2
  38. package/dist/cjs/components/Reward.d.ts +2 -1
  39. package/dist/cjs/components/Reward.js +3 -2
  40. package/dist/cjs/components/Rewards.d.ts +2 -1
  41. package/dist/cjs/components/Rewards.js +2 -2
  42. package/dist/cjs/components/UpsellItem.d.ts +2 -1
  43. package/dist/cjs/components/UpsellItem.js +2 -2
  44. package/dist/cjs/components/Upsells.d.ts +2 -1
  45. package/dist/cjs/components/Upsells.js +2 -2
  46. package/dist/esm/components/Cart.d.ts +2 -1
  47. package/dist/esm/components/Cart.js +3 -3
  48. package/dist/esm/components/CartItem.d.ts +2 -1
  49. package/dist/esm/components/CartItem.js +3 -2
  50. package/dist/esm/components/CartUpsellItem.d.ts +2 -1
  51. package/dist/esm/components/CartUpsellItem.js +2 -2
  52. package/dist/esm/components/CartUpsells.d.ts +2 -1
  53. package/dist/esm/components/CartUpsells.js +2 -2
  54. package/dist/esm/components/CategoryItem.d.ts +2 -1
  55. package/dist/esm/components/CategoryItem.js +2 -2
  56. package/dist/esm/components/CategoryNav.d.ts +2 -1
  57. package/dist/esm/components/CategoryNav.js +3 -3
  58. package/dist/esm/components/CategoryNavItem.d.ts +2 -1
  59. package/dist/esm/components/CategoryNavItem.js +3 -2
  60. package/dist/esm/components/CategoryNavOther.d.ts +2 -1
  61. package/dist/esm/components/CategoryNavOther.js +2 -2
  62. package/dist/esm/components/Discount.d.ts +2 -1
  63. package/dist/esm/components/Discount.js +2 -2
  64. package/dist/esm/components/ItemGroup.d.ts +2 -2
  65. package/dist/esm/components/ItemGroup.js +9 -3
  66. package/dist/esm/components/ItemGroups.d.ts +2 -1
  67. package/dist/esm/components/ItemGroups.js +2 -2
  68. package/dist/esm/components/ItemOption.d.ts +2 -1
  69. package/dist/esm/components/ItemOption.js +3 -2
  70. package/dist/esm/components/ItemSelections.d.ts +2 -1
  71. package/dist/esm/components/ItemSelections.js +2 -2
  72. package/dist/esm/components/MenuOther.d.ts +2 -1
  73. package/dist/esm/components/MenuOther.js +9 -2
  74. package/dist/esm/components/Modal.js +1 -1
  75. package/dist/esm/components/Option.d.ts +2 -1
  76. package/dist/esm/components/Option.js +2 -2
  77. package/dist/esm/components/OrderCard.d.ts +2 -1
  78. package/dist/esm/components/OrderCard.js +3 -2
  79. package/dist/esm/components/PointsReward.d.ts +2 -1
  80. package/dist/esm/components/PointsReward.js +3 -2
  81. package/dist/esm/components/PointsRewards.d.ts +2 -1
  82. package/dist/esm/components/PointsRewards.js +2 -2
  83. package/dist/esm/components/Reward.d.ts +2 -1
  84. package/dist/esm/components/Reward.js +3 -2
  85. package/dist/esm/components/Rewards.d.ts +2 -1
  86. package/dist/esm/components/Rewards.js +2 -2
  87. package/dist/esm/components/UpsellItem.d.ts +2 -1
  88. package/dist/esm/components/UpsellItem.js +2 -2
  89. package/dist/esm/components/Upsells.d.ts +2 -1
  90. package/dist/esm/components/Upsells.js +2 -2
  91. package/package.json +3 -3
@@ -1,7 +1,8 @@
1
1
  import { CartProps } from '@open-tender/ui';
2
2
  import React, { ReactNode } from 'react';
3
- declare const Cart: ({ navigate, children }: {
3
+ declare const Cart: ({ navigate, children, apiUrl }: {
4
4
  navigate: (route: string) => void;
5
5
  children: (props: CartProps) => ReactNode;
6
+ apiUrl: string;
6
7
  }) => React.ReactNode;
7
8
  export default Cart;
@@ -8,7 +8,7 @@ var slices_1 = require("../slices");
8
8
  var CartItem_1 = tslib_1.__importDefault(require("./CartItem"));
9
9
  var CartUpsells_1 = tslib_1.__importDefault(require("./CartUpsells"));
10
10
  var Cart = function (_a) {
11
- var navigate = _a.navigate, children = _a.children;
11
+ var navigate = _a.navigate, children = _a.children, apiUrl = _a.apiUrl;
12
12
  var dispatch = (0, hooks_1.useAppDispatch)();
13
13
  var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).cart;
14
14
  var cart = (0, hooks_1.useAppSelector)(slices_1.selectOrder).cart;
@@ -23,8 +23,8 @@ var Cart = function (_a) {
23
23
  return;
24
24
  dispatch((0, slices_1.closeCartSummary)());
25
25
  }, [dispatch, isOpen, isEmpty]);
26
- var renderCartItem = function (item, isLast) { return (react_1.default.createElement(CartItem_1.default, { navigate: navigate, item: item, isLast: isLast, children: ui_1.CartItem })); };
27
- var renderCartUpsells = function () { return (react_1.default.createElement(CartUpsells_1.default, { children: ui_1.CartUpsells })); };
26
+ var renderCartItem = function (item, isLast) { return (react_1.default.createElement(CartItem_1.default, { navigate: navigate, item: item, isLast: isLast, children: ui_1.CartItem, apiUrl: apiUrl })); };
27
+ var renderCartUpsells = function () { return (react_1.default.createElement(CartUpsells_1.default, { apiUrl: apiUrl, children: ui_1.CartUpsells })); };
28
28
  if (!config)
29
29
  return null;
30
30
  return children({
@@ -1,11 +1,12 @@
1
1
  import { CartItem as CartItemType } from '@open-tender/types';
2
2
  import { CartItemProps } from '@open-tender/ui';
3
3
  import React, { ReactNode } from 'react';
4
- declare const CartItem: ({ item, isLast, isEditable, navigate, children }: {
4
+ declare const CartItem: ({ item, isLast, isEditable, navigate, children, apiUrl }: {
5
5
  item: CartItemType;
6
6
  isLast?: boolean;
7
7
  isEditable?: boolean;
8
8
  navigate: (route: string) => void;
9
9
  children: (props: CartItemProps) => ReactNode;
10
+ apiUrl: string;
10
11
  }) => React.ReactNode;
11
12
  export default CartItem;
@@ -7,7 +7,7 @@ var hooks_1 = require("../app/hooks");
7
7
  var slices_1 = require("../slices");
8
8
  var Quantity_1 = tslib_1.__importDefault(require("./Quantity"));
9
9
  var CartItem = function (_a) {
10
- var item = _a.item, _b = _a.isLast, isLast = _b === void 0 ? false : _b, _c = _a.isEditable, isEditable = _c === void 0 ? true : _c, navigate = _a.navigate, children = _a.children;
10
+ var item = _a.item, _b = _a.isLast, isLast = _b === void 0 ? false : _b, _c = _a.isEditable, isEditable = _c === void 0 ? true : _c, navigate = _a.navigate, children = _a.children, apiUrl = _a.apiUrl;
11
11
  var dispatch = (0, hooks_1.useAppDispatch)();
12
12
  var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).cartItem;
13
13
  var increment = function () { return dispatch((0, slices_1.incrementItemInCart)(item)); };
@@ -25,7 +25,8 @@ var CartItem = function (_a) {
25
25
  handlers: handlers,
26
26
  isLast: isLast,
27
27
  isEditable: isEditable,
28
- renderQuantity: renderQuantity
28
+ renderQuantity: renderQuantity,
29
+ apiUrl: apiUrl
29
30
  });
30
31
  };
31
32
  exports.default = CartItem;
@@ -1,10 +1,11 @@
1
1
  import { CartItem } from '@open-tender/types';
2
2
  import { CartUpsellItemProps } from '@open-tender/ui';
3
3
  import { ReactNode } from 'react';
4
- declare const CartUpsellItem: ({ item, callback, isLast, children }: {
4
+ declare const CartUpsellItem: ({ item, callback, isLast, children, apiUrl }: {
5
5
  item: CartItem;
6
6
  callback?: () => void;
7
7
  isLast?: boolean;
8
8
  children: (props: CartUpsellItemProps) => ReactNode;
9
+ apiUrl: string;
9
10
  }) => ReactNode;
10
11
  export default CartUpsellItem;
@@ -4,7 +4,7 @@ var utils_1 = require("@open-tender/utils");
4
4
  var hooks_1 = require("../app/hooks");
5
5
  var slices_1 = require("../slices");
6
6
  var CartUpsellItem = function (_a) {
7
- var item = _a.item, callback = _a.callback, isLast = _a.isLast, children = _a.children;
7
+ var item = _a.item, callback = _a.callback, isLast = _a.isLast, children = _a.children, apiUrl = _a.apiUrl;
8
8
  var dispatch = (0, hooks_1.useAppDispatch)();
9
9
  var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), config = _b.cartUpsellItem, cardConfig = _b.card;
10
10
  var builtItem = (0, utils_1.useBuilder)(item).item;
@@ -19,6 +19,6 @@ var CartUpsellItem = function (_a) {
19
19
  }
20
20
  };
21
21
  var handlers = { add: add };
22
- return children({ config: config, handlers: handlers, item: item, isLast: isLast, cardConfig: cardConfig });
22
+ return children({ config: config, handlers: handlers, item: item, isLast: isLast, cardConfig: cardConfig, apiUrl: apiUrl });
23
23
  };
24
24
  exports.default = CartUpsellItem;
@@ -1,6 +1,7 @@
1
1
  import { CartUpsellsProps } from '@open-tender/ui';
2
2
  import React, { ReactNode } from 'react';
3
- declare const CartUpsells: ({ children }: {
3
+ declare const CartUpsells: ({ children, apiUrl }: {
4
4
  children: (props: CartUpsellsProps) => ReactNode;
5
+ apiUrl: string;
5
6
  }) => React.ReactNode;
6
7
  export default CartUpsells;
@@ -8,12 +8,12 @@ var hooks_1 = require("../app/hooks");
8
8
  var slices_1 = require("../slices");
9
9
  var CartUpsellItem_1 = tslib_1.__importDefault(require("./CartUpsellItem"));
10
10
  var CartUpsells = function (_a) {
11
- var children = _a.children;
11
+ var children = _a.children, apiUrl = _a.apiUrl;
12
12
  var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).cartUpsells;
13
13
  var cartIds = (0, hooks_1.useAppSelector)(slices_1.selectCartIds);
14
14
  var _b = (0, hooks_1.useAppSelector)(slices_1.selectMenu), categories = _b.categories, soldOut = _b.soldOut;
15
15
  var upsellItems = (0, react_1.useMemo)(function () { return (0, utils_1.makeUpsellItemsForCart)(categories, cartIds, soldOut); }, [categories, cartIds, soldOut]);
16
- var renderCartUpsellItem = function (item, isLast) { return (react_1.default.createElement(CartUpsellItem_1.default, { item: item, isLast: isLast, children: ui_1.CartUpsellItem })); };
16
+ var renderCartUpsellItem = function (item, isLast) { return (react_1.default.createElement(CartUpsellItem_1.default, { item: item, isLast: isLast, children: ui_1.CartUpsellItem, apiUrl: apiUrl })); };
17
17
  if (!upsellItems.length)
18
18
  return null;
19
19
  return children({
@@ -1,11 +1,12 @@
1
1
  import { MenuItem, MenuItemFavorite } from '@open-tender/types';
2
2
  import { CategoryItemProps } from '@open-tender/ui';
3
3
  import { ReactNode } from 'react';
4
- declare const CategoryItem: ({ item, favorite, allergenAlerts, navigate, children }: {
4
+ declare const CategoryItem: ({ item, favorite, allergenAlerts, navigate, children, apiUrl }: {
5
5
  item: MenuItem;
6
6
  favorite?: MenuItemFavorite;
7
7
  allergenAlerts?: string[];
8
8
  navigate: (route: string) => void;
9
9
  children: (props: CategoryItemProps) => ReactNode;
10
+ apiUrl: string;
10
11
  }) => ReactNode;
11
12
  export default CategoryItem;
@@ -5,7 +5,7 @@ var utils_1 = require("@open-tender/utils");
5
5
  var hooks_1 = require("../app/hooks");
6
6
  var slices_1 = require("../slices");
7
7
  var CategoryItem = function (_a) {
8
- var item = _a.item, favorite = _a.favorite, allergenAlerts = _a.allergenAlerts, navigate = _a.navigate, children = _a.children;
8
+ var item = _a.item, favorite = _a.favorite, allergenAlerts = _a.allergenAlerts, navigate = _a.navigate, children = _a.children, apiUrl = _a.apiUrl;
9
9
  var dispatch = (0, hooks_1.useAppDispatch)();
10
10
  var categoryItem = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).categoryItem;
11
11
  var soldOut = (0, hooks_1.useAppSelector)(slices_1.selectMenu).soldOut;
@@ -22,6 +22,6 @@ var CategoryItem = function (_a) {
22
22
  navigate('/menu/item');
23
23
  };
24
24
  var handlers = { browse: browse };
25
- return children({ item: cartItem, config: categoryItem, handlers: handlers });
25
+ return children({ item: cartItem, config: categoryItem, handlers: handlers, apiUrl: apiUrl });
26
26
  };
27
27
  exports.default = CategoryItem;
@@ -1,7 +1,8 @@
1
1
  import { CategoryNavProps } from '@open-tender/ui';
2
2
  import React, { ReactNode } from 'react';
3
- declare const CategoryNav: ({ children, navigate }: {
3
+ declare const CategoryNav: ({ children, navigate, apiUrl }: {
4
4
  children: (props: CategoryNavProps) => ReactNode;
5
5
  navigate: (route: string) => void;
6
+ apiUrl: string;
6
7
  }) => React.ReactNode;
7
8
  export default CategoryNav;
@@ -8,11 +8,11 @@ var slices_1 = require("../slices");
8
8
  var CategoryNavItem_1 = tslib_1.__importDefault(require("./CategoryNavItem"));
9
9
  var CategoryNavOther_1 = tslib_1.__importDefault(require("./CategoryNavOther"));
10
10
  var CategoryNav = function (_a) {
11
- var children = _a.children, navigate = _a.navigate;
11
+ var children = _a.children, navigate = _a.navigate, apiUrl = _a.apiUrl;
12
12
  var categoryNav = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).categoryNav;
13
13
  var _b = (0, hooks_1.useAppSelector)(slices_1.selectMenu), categories = _b.categories, featured = _b.featured, favorites = _b.favorites, recents = _b.recents;
14
- var renderCategoryNavOther = function (title, path) { return (react_1.default.createElement(CategoryNavOther_1.default, { navigate: navigate, title: title, path: path, children: ui_1.CategoryNavOther })); };
15
- var renderCategoryNavItem = function (item) { return (react_1.default.createElement(CategoryNavItem_1.default, { navigate: navigate, category: item, children: ui_1.CategoryNavItem })); };
14
+ var renderCategoryNavOther = function (title, path) { return (react_1.default.createElement(CategoryNavOther_1.default, { apiUrl: apiUrl, navigate: navigate, title: title, path: path, children: ui_1.CategoryNavOther })); };
15
+ var renderCategoryNavItem = function (item) { return (react_1.default.createElement(CategoryNavItem_1.default, { apiUrl: apiUrl, navigate: navigate, category: item, children: ui_1.CategoryNavItem })); };
16
16
  return children({
17
17
  config: categoryNav,
18
18
  categories: categories,
@@ -1,9 +1,10 @@
1
1
  import { MenuCategory } from '@open-tender/types';
2
2
  import { CategoryNavItemProps } from '@open-tender/ui';
3
3
  import { ReactNode } from 'react';
4
- declare const CategoryNavItem: ({ category, children, navigate }: {
4
+ declare const CategoryNavItem: ({ category, children, navigate, apiUrl }: {
5
5
  category: MenuCategory;
6
6
  navigate: (route: string) => void;
7
7
  children: (props: CategoryNavItemProps) => ReactNode;
8
+ apiUrl: string;
8
9
  }) => ReactNode;
9
10
  export default CategoryNavItem;
@@ -4,7 +4,7 @@ var ui_1 = require("@open-tender/ui");
4
4
  var hooks_1 = require("../app/hooks");
5
5
  var slices_1 = require("../slices");
6
6
  var CategoryNavItem = function (_a) {
7
- var category = _a.category, children = _a.children, navigate = _a.navigate;
7
+ var category = _a.category, children = _a.children, navigate = _a.navigate, apiUrl = _a.apiUrl;
8
8
  var dispatch = (0, hooks_1.useAppDispatch)();
9
9
  var current = (0, hooks_1.useAppSelector)(slices_1.selectCurrentCategory);
10
10
  var isCurrent = (current === null || current === void 0 ? void 0 : current.id) === category.id;
@@ -21,7 +21,8 @@ var CategoryNavItem = function (_a) {
21
21
  config: config,
22
22
  handlers: handlers,
23
23
  title: name,
24
- imageUrl: imageUrl
24
+ imageUrl: imageUrl,
25
+ apiUrl: apiUrl
25
26
  });
26
27
  };
27
28
  exports.default = CategoryNavItem;
@@ -1,9 +1,10 @@
1
1
  import { CategoryNavOtherProps } from '@open-tender/ui';
2
2
  import { ReactNode } from 'react';
3
- declare const CategoryNavOther: ({ title, path, navigate, children }: {
3
+ declare const CategoryNavOther: ({ title, path, navigate, children, apiUrl }: {
4
4
  title: string;
5
5
  path: string;
6
6
  navigate: (route: string) => void;
7
7
  children: (props: CategoryNavOtherProps) => ReactNode;
8
+ apiUrl: string;
8
9
  }) => ReactNode;
9
10
  export default CategoryNavOther;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var hooks_1 = require("../app/hooks");
4
4
  var slices_1 = require("../slices");
5
5
  var CategoryNavOther = function (_a) {
6
- var title = _a.title, path = _a.path, navigate = _a.navigate, children = _a.children;
6
+ var title = _a.title, path = _a.path, navigate = _a.navigate, children = _a.children, apiUrl = _a.apiUrl;
7
7
  var dispatch = (0, hooks_1.useAppDispatch)();
8
8
  var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), categoryNavItem = _b.categoryNavItem, categoryNavItemSelected = _b.categoryNavItemSelected;
9
9
  var currentSection = (0, hooks_1.useAppSelector)(slices_1.selectCurrentSection);
@@ -14,6 +14,6 @@ var CategoryNavOther = function (_a) {
14
14
  navigate(path);
15
15
  };
16
16
  var handlers = { browse: browse };
17
- return children({ config: config, handlers: handlers, title: title, imageUrl: null });
17
+ return children({ config: config, handlers: handlers, title: title, imageUrl: null, apiUrl: apiUrl });
18
18
  };
19
19
  exports.default = CategoryNavOther;
@@ -1,8 +1,9 @@
1
1
  import { Discount as DiscountType } from '@open-tender/types';
2
2
  import { DiscountProps } from '@open-tender/ui';
3
3
  import { ReactNode } from 'react';
4
- declare const Discount: ({ discount, children }: {
4
+ declare const Discount: ({ discount, children, apiUrl }: {
5
5
  discount: DiscountType;
6
6
  children: (props: DiscountProps) => ReactNode;
7
+ apiUrl: string;
7
8
  }) => ReactNode;
8
9
  export default Discount;
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var hooks_1 = require("../app/hooks");
4
4
  var slices_1 = require("../slices");
5
5
  var Discount = function (_a) {
6
- var discount = _a.discount, children = _a.children;
6
+ var discount = _a.discount, children = _a.children, apiUrl = _a.apiUrl;
7
7
  var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), config = _b.discount, cardConfig = _b.card;
8
8
  if (!config)
9
9
  return null;
10
- return children({ config: config, discount: discount, cardConfig: cardConfig });
10
+ return children({ config: config, discount: discount, cardConfig: cardConfig, apiUrl: apiUrl });
11
11
  };
12
12
  exports.default = Discount;
@@ -1,9 +1,9 @@
1
1
  import { CartItemGroup } from '@open-tender/types';
2
2
  import { ItemGroupProps } from '@open-tender/ui';
3
- import { ReactNode } from 'react';
3
+ import React, { ReactNode } from 'react';
4
4
  declare const ItemGroup: ({ group, content, children }: {
5
5
  group: CartItemGroup;
6
6
  content: ReactNode;
7
7
  children: (props: ItemGroupProps) => ReactNode;
8
- }) => ReactNode;
8
+ }) => React.ReactNode;
9
9
  export default ItemGroup;
@@ -1,18 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ var ui_1 = require("@open-tender/ui");
3
5
  var utils_1 = require("@open-tender/utils");
6
+ var react_1 = tslib_1.__importDefault(require("react"));
4
7
  var hooks_1 = require("../app/hooks");
5
8
  var slices_1 = require("../slices");
9
+ var ErrorMessage_1 = tslib_1.__importDefault(require("./ErrorMessage"));
10
+ var SuccessMessage_1 = tslib_1.__importDefault(require("./SuccessMessage"));
6
11
  var ItemGroup = function (_a) {
7
12
  var group = _a.group, content = _a.content, children = _a.children;
8
- var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), config = _b.itemGroup, errorMessageConfig = _b.errorMessage, successMessageConfig = _b.successMessage;
13
+ var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).itemGroup;
9
14
  var modifierGroup = (0, utils_1.useModifierGroup)(group);
15
+ var renderErrorMessage = function (icon, children) { return (react_1.default.createElement(ErrorMessage_1.default, { icon: icon, content: children, children: ui_1.ErrorMessage })); };
16
+ var renderSuccessMessage = function (icon, children) { return (react_1.default.createElement(SuccessMessage_1.default, { icon: icon, content: children, children: ui_1.SuccessMessage })); };
10
17
  return children({
11
18
  config: config,
12
19
  group: modifierGroup,
13
20
  children: content,
14
- errorMessageConfig: errorMessageConfig,
15
- successMessageConfig: successMessageConfig
21
+ renderErrorMessage: renderErrorMessage,
22
+ renderSuccessMessage: renderSuccessMessage
16
23
  });
17
24
  };
18
25
  exports.default = ItemGroup;
@@ -1,11 +1,12 @@
1
1
  import { CartItemGroups, CartLevels } from '@open-tender/types';
2
2
  import { Handlers, ItemGroupsProps } from '@open-tender/ui';
3
3
  import React, { ReactNode } from 'react';
4
- declare const ItemGroups: ({ handlers, groups, levels, excludeSize, children }: {
4
+ declare const ItemGroups: ({ handlers, groups, levels, excludeSize, children, apiUrl }: {
5
5
  handlers: Handlers;
6
6
  groups: CartItemGroups;
7
7
  levels: CartLevels;
8
8
  excludeSize?: boolean;
9
9
  children: (props: ItemGroupsProps) => ReactNode;
10
+ apiUrl: string;
10
11
  }) => React.ReactNode;
11
12
  export default ItemGroups;
@@ -8,9 +8,9 @@ var slices_1 = require("../slices");
8
8
  var ItemGroup_1 = tslib_1.__importDefault(require("./ItemGroup"));
9
9
  var ItemOption_1 = tslib_1.__importDefault(require("./ItemOption"));
10
10
  var ItemGroups = function (_a) {
11
- var handlers = _a.handlers, groups = _a.groups, levels = _a.levels, _b = _a.excludeSize, excludeSize = _b === void 0 ? true : _b, children = _a.children;
11
+ var handlers = _a.handlers, groups = _a.groups, levels = _a.levels, _b = _a.excludeSize, excludeSize = _b === void 0 ? true : _b, children = _a.children, apiUrl = _a.apiUrl;
12
12
  var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).itemGroups;
13
- var renderItemOption = function (group, option) { return (react_1.default.createElement(ItemOption_1.default, { levels: levels, handlers: handlers, group: group, option: option, children: ui_1.ItemOption })); };
13
+ var renderItemOption = function (group, option) { return (react_1.default.createElement(ItemOption_1.default, { apiUrl: apiUrl, levels: levels, handlers: handlers, group: group, option: option, children: ui_1.ItemOption })); };
14
14
  var renderItemGroup = function (group, content) { return (react_1.default.createElement(ItemGroup_1.default, { group: group, content: content, children: ui_1.ItemGroup })); };
15
15
  if (!config)
16
16
  return null;
@@ -1,11 +1,12 @@
1
1
  import { CartItemGroup, CartItemOption, CartLevels } from '@open-tender/types';
2
2
  import { Handlers, ItemOptionProps } from '@open-tender/ui';
3
3
  import { ReactNode } from 'react';
4
- declare const ItemOption: ({ handlers, group, option, levels, children }: {
4
+ declare const ItemOption: ({ handlers, group, option, levels, children, apiUrl }: {
5
5
  handlers: Handlers;
6
6
  group: CartItemGroup;
7
7
  option: CartItemOption;
8
8
  levels: CartLevels;
9
9
  children: (props: ItemOptionProps) => ReactNode;
10
+ apiUrl: string;
10
11
  }) => ReactNode;
11
12
  export default ItemOption;
@@ -4,7 +4,7 @@ var utils_1 = require("@open-tender/utils");
4
4
  var hooks_1 = require("../app/hooks");
5
5
  var slices_1 = require("../slices");
6
6
  var ItemOption = function (_a) {
7
- var handlers = _a.handlers, group = _a.group, option = _a.option, levels = _a.levels, children = _a.children;
7
+ var handlers = _a.handlers, group = _a.group, option = _a.option, levels = _a.levels, children = _a.children, apiUrl = _a.apiUrl;
8
8
  var dispatch = (0, hooks_1.useAppDispatch)();
9
9
  var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), config = _b.itemOption, cardConfig = _b.card;
10
10
  var toggleOption = handlers.toggleOption, incrementOption = handlers.incrementOption, decrementOption = handlers.decrementOption, setOptionQuantity = handlers.setOptionQuantity;
@@ -24,7 +24,8 @@ var ItemOption = function (_a) {
24
24
  handlers: { showNested: showNested },
25
25
  group: group,
26
26
  option: modifier,
27
- cardConfig: cardConfig
27
+ cardConfig: cardConfig,
28
+ apiUrl: apiUrl
28
29
  });
29
30
  };
30
31
  exports.default = ItemOption;
@@ -1,11 +1,12 @@
1
1
  import { CartItemGroups, CartLevels } from '@open-tender/types';
2
2
  import { Handlers, ItemSelectionsProps } from '@open-tender/ui';
3
3
  import React, { ReactNode } from 'react';
4
- declare const ItemSelections: ({ handlers, groups, levels, isIncomplete, children }: {
4
+ declare const ItemSelections: ({ handlers, groups, levels, isIncomplete, children, apiUrl }: {
5
5
  handlers: Handlers;
6
6
  groups: CartItemGroups;
7
7
  levels: CartLevels;
8
8
  isIncomplete: boolean;
9
9
  children: (props: ItemSelectionsProps) => ReactNode;
10
+ apiUrl: string;
10
11
  }) => React.ReactNode;
11
12
  export default ItemSelections;
@@ -8,10 +8,10 @@ var slices_1 = require("../slices");
8
8
  var ErrorMessage_1 = tslib_1.__importDefault(require("./ErrorMessage"));
9
9
  var ItemOption_1 = tslib_1.__importDefault(require("./ItemOption"));
10
10
  var ItemSelections = function (_a) {
11
- var handlers = _a.handlers, groups = _a.groups, levels = _a.levels, isIncomplete = _a.isIncomplete, children = _a.children;
11
+ var handlers = _a.handlers, groups = _a.groups, levels = _a.levels, isIncomplete = _a.isIncomplete, children = _a.children, apiUrl = _a.apiUrl;
12
12
  var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).itemSelections;
13
13
  var renderErrorMessage = function (icon, children) { return (react_1.default.createElement(ErrorMessage_1.default, { icon: icon, content: children, children: ui_1.ErrorMessage })); };
14
- var renderItemOption = function (group, option) { return (react_1.default.createElement(ItemOption_1.default, { levels: levels, handlers: handlers, group: group, option: option, children: ui_1.ItemOption })); };
14
+ var renderItemOption = function (group, option) { return (react_1.default.createElement(ItemOption_1.default, { levels: levels, handlers: handlers, group: group, option: option, children: ui_1.ItemOption, apiUrl: apiUrl })); };
15
15
  return children({
16
16
  config: config,
17
17
  groups: groups,
@@ -1,12 +1,13 @@
1
1
  import { MenuItem } from '@open-tender/types';
2
2
  import { MenuOtherProps } from '@open-tender/ui';
3
3
  import { ReactNode } from 'react';
4
- declare const MenuOther: ({ title, subtitle, path, item, children, navigate }: {
4
+ declare const MenuOther: ({ title, subtitle, path, item, children, navigate, apiUrl }: {
5
5
  title: string;
6
6
  subtitle: string;
7
7
  path: string;
8
8
  item: MenuItem;
9
9
  navigate: (route: string) => void;
10
10
  children: (props: MenuOtherProps) => ReactNode;
11
+ apiUrl: string;
11
12
  }) => ReactNode;
12
13
  export default MenuOther;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var hooks_1 = require("../app/hooks");
4
4
  var slices_1 = require("../slices");
5
5
  var MenuOther = function (_a) {
6
- var title = _a.title, subtitle = _a.subtitle, path = _a.path, item = _a.item, children = _a.children, navigate = _a.navigate;
6
+ var title = _a.title, subtitle = _a.subtitle, path = _a.path, item = _a.item, children = _a.children, navigate = _a.navigate, apiUrl = _a.apiUrl;
7
7
  var dispatch = (0, hooks_1.useAppDispatch)();
8
8
  var menuCategory = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).menuCategory;
9
9
  var browse = function () {
@@ -11,6 +11,13 @@ var MenuOther = function (_a) {
11
11
  navigate(path);
12
12
  };
13
13
  var handlers = { browse: browse };
14
- return children({ config: menuCategory, handlers: handlers, title: title, subtitle: subtitle, item: item });
14
+ return children({
15
+ config: menuCategory,
16
+ handlers: handlers,
17
+ title: title,
18
+ subtitle: subtitle,
19
+ item: item,
20
+ apiUrl: apiUrl
21
+ });
15
22
  };
16
23
  exports.default = MenuOther;
@@ -11,6 +11,6 @@ var Modal = function (_a) {
11
11
  var handlers = { close: close };
12
12
  if (!config)
13
13
  return null;
14
- return (react_1.default.createElement(react_transition_group_1.TransitionGroup, { component: null }, show ? (react_1.default.createElement(react_transition_group_1.CSSTransition, { key: "modal", classNames: "md", timeout: { enter: 250, exit: 250 } }, children({ config: config, handlers: handlers, children: content }))) : null));
14
+ return (react_1.default.createElement(react_transition_group_1.TransitionGroup, { component: null }, show && (react_1.default.createElement(react_transition_group_1.CSSTransition, { key: "modal", classNames: "md", timeout: { enter: 250, exit: 250 } }, children({ config: config, handlers: handlers, children: content })))));
15
15
  };
16
16
  exports.default = Modal;
@@ -1,11 +1,12 @@
1
1
  import { CartItemOption, CartLevels } from '@open-tender/types';
2
2
  import { Handlers, OptionProps } from '@open-tender/ui';
3
3
  import React, { ReactNode } from 'react';
4
- declare const Option: ({ option, levels, handlers, close, children }: {
4
+ declare const Option: ({ option, levels, handlers, close, children, apiUrl }: {
5
5
  option: CartItemOption | null;
6
6
  levels: CartLevels | null;
7
7
  handlers: Handlers;
8
8
  close: () => void;
9
9
  children: (props: OptionProps) => ReactNode;
10
+ apiUrl: string;
10
11
  }) => React.ReactNode;
11
12
  export default Option;
@@ -7,12 +7,12 @@ var hooks_1 = require("../app/hooks");
7
7
  var slices_1 = require("../slices");
8
8
  var ItemGroups_1 = tslib_1.__importDefault(require("./ItemGroups"));
9
9
  var Option = function (_a) {
10
- var option = _a.option, levels = _a.levels, handlers = _a.handlers, close = _a.close, children = _a.children;
10
+ var option = _a.option, levels = _a.levels, handlers = _a.handlers, close = _a.close, children = _a.children, apiUrl = _a.apiUrl;
11
11
  var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), config = _b.option, modalContentConfig = _b.modalContent;
12
12
  var handlersOption = tslib_1.__assign(tslib_1.__assign({}, handlers), { close: close });
13
13
  if (!config || !option || !levels)
14
14
  return null;
15
- var renderItemGroups = function (excludeSize) { return (react_1.default.createElement(ItemGroups_1.default, { levels: levels, handlers: handlersOption, groups: option.groups, excludeSize: excludeSize, children: ui_1.ItemGroups })); };
15
+ var renderItemGroups = function (excludeSize) { return (react_1.default.createElement(ItemGroups_1.default, { levels: levels, handlers: handlersOption, groups: option.groups, excludeSize: excludeSize, children: ui_1.ItemGroups, apiUrl: apiUrl })); };
16
16
  return children({
17
17
  config: config,
18
18
  handlers: handlersOption,
@@ -1,9 +1,10 @@
1
1
  import { Order } from '@open-tender/types';
2
2
  import { OrderCardProps } from '@open-tender/ui';
3
3
  import React, { ReactNode } from 'react';
4
- declare const OrderCard: ({ order, navigate, children }: {
4
+ declare const OrderCard: ({ order, navigate, children, apiUrl }: {
5
5
  order: Order;
6
6
  navigate: (route: string) => void;
7
7
  children: (props: OrderCardProps) => ReactNode;
8
+ apiUrl: string;
8
9
  }) => React.ReactNode;
9
10
  export default OrderCard;
@@ -8,7 +8,7 @@ var hooks_2 = require("../hooks");
8
8
  var slices_1 = require("../slices");
9
9
  var ErrorMessage_1 = tslib_1.__importDefault(require("./ErrorMessage"));
10
10
  var OrderCard = function (_a) {
11
- var order = _a.order, navigate = _a.navigate, children = _a.children;
11
+ var order = _a.order, navigate = _a.navigate, children = _a.children, apiUrl = _a.apiUrl;
12
12
  var dispatch = (0, hooks_1.useAppDispatch)();
13
13
  var _b = (0, react_1.useState)(null), errMsg = _b[0], setErrMsg = _b[1];
14
14
  var _c = (0, react_1.useState)(false), isReordering = _c[0], setIsReordering = _c[1];
@@ -50,7 +50,8 @@ var OrderCard = function (_a) {
50
50
  orderNo: orderNo,
51
51
  itemNames: itemNames,
52
52
  itemImages: itemImages,
53
- renderErrorMessage: renderErrorMessage
53
+ renderErrorMessage: renderErrorMessage,
54
+ apiUrl: apiUrl
54
55
  });
55
56
  };
56
57
  exports.default = OrderCard;
@@ -1,10 +1,11 @@
1
1
  import { OrderItem } from '@open-tender/types';
2
2
  import { PointsRewardProps } from '@open-tender/ui';
3
3
  import React, { ReactNode } from 'react';
4
- declare const PointsReward: ({ item, callback, children }: {
4
+ declare const PointsReward: ({ item, callback, children, apiUrl }: {
5
5
  item: OrderItem;
6
6
  callback?: () => void;
7
7
  isLast?: boolean;
8
8
  children: (props: PointsRewardProps) => ReactNode;
9
+ apiUrl: string;
9
10
  }) => React.ReactNode;
10
11
  export default PointsReward;
@@ -9,7 +9,7 @@ var slices_1 = require("../slices");
9
9
  var Quantity_1 = tslib_1.__importDefault(require("./Quantity"));
10
10
  var PointsReward = function (_a) {
11
11
  var _b;
12
- var item = _a.item, callback = _a.callback, children = _a.children;
12
+ var item = _a.item, callback = _a.callback, children = _a.children, apiUrl = _a.apiUrl;
13
13
  var dispatch = (0, hooks_1.useAppDispatch)();
14
14
  var _c = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), config = _c.pointsReward, successMessageConfig = _c.successMessage, cardConfig = _c.card;
15
15
  var checkPoints = (0, hooks_1.useAppSelector)(slices_1.selectPosCheckout).points;
@@ -56,7 +56,8 @@ var PointsReward = function (_a) {
56
56
  pointsRemaining: pointsRemaining,
57
57
  successMessageConfig: successMessageConfig,
58
58
  cardConfig: cardConfig,
59
- renderQuantity: renderQuantity
59
+ renderQuantity: renderQuantity,
60
+ apiUrl: apiUrl
60
61
  });
61
62
  };
62
63
  exports.default = PointsReward;
@@ -1,6 +1,7 @@
1
1
  import { PointsRewardsProps } from '@open-tender/ui';
2
2
  import React, { ReactNode } from 'react';
3
- declare const PointsRewards: ({ children }: {
3
+ declare const PointsRewards: ({ children, apiUrl }: {
4
4
  children: (props: PointsRewardsProps) => ReactNode;
5
+ apiUrl: string;
5
6
  }) => React.ReactNode;
6
7
  export default PointsRewards;
@@ -8,10 +8,10 @@ var hooks_2 = require("../hooks");
8
8
  var slices_1 = require("../slices");
9
9
  var PointsReward_1 = tslib_1.__importDefault(require("./PointsReward"));
10
10
  var PointsRewards = function (_a) {
11
- var children = _a.children;
11
+ var children = _a.children, apiUrl = _a.apiUrl;
12
12
  var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).pointsRewards;
13
13
  var _b = (0, hooks_2.useCustomerRewards)(), items = _b.items, points = _b.points, pointsApplied = _b.pointsApplied, pointsRemaining = _b.pointsRemaining;
14
- var renderPointReward = function (item) { return (react_1.default.createElement(PointsReward_1.default, { item: item, children: ui_1.PointsReward })); };
14
+ var renderPointReward = function (item) { return (react_1.default.createElement(PointsReward_1.default, { apiUrl: apiUrl, item: item, children: ui_1.PointsReward })); };
15
15
  return children({
16
16
  config: config,
17
17
  items: items,
@@ -1,10 +1,11 @@
1
1
  import { Discount } from '@open-tender/types';
2
2
  import { RewardProps } from '@open-tender/ui';
3
3
  import React, { ReactNode } from 'react';
4
- declare const Reward: ({ reward, callback, isLast, children }: {
4
+ declare const Reward: ({ reward, callback, isLast, children, apiUrl }: {
5
5
  reward: Discount;
6
6
  callback?: () => void;
7
7
  isLast?: boolean;
8
8
  children: (props: RewardProps) => ReactNode;
9
+ apiUrl: string;
9
10
  }) => React.ReactNode;
10
11
  export default Reward;
@@ -7,7 +7,7 @@ var hooks_1 = require("../app/hooks");
7
7
  var slices_1 = require("../slices");
8
8
  var Applied_1 = tslib_1.__importDefault(require("./Applied"));
9
9
  var Reward = function (_a) {
10
- var reward = _a.reward, callback = _a.callback, isLast = _a.isLast, children = _a.children;
10
+ var reward = _a.reward, callback = _a.callback, isLast = _a.isLast, children = _a.children, apiUrl = _a.apiUrl;
11
11
  var dispatch = (0, hooks_1.useAppDispatch)();
12
12
  var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), config = _b.reward, cardConfig = _b.card;
13
13
  var check = (0, hooks_1.useAppSelector)(slices_1.selectPosCheckout).check;
@@ -33,7 +33,8 @@ var Reward = function (_a) {
33
33
  isApplied: isApplied,
34
34
  isLast: isLast,
35
35
  cardConfig: cardConfig,
36
- renderApplied: renderApplied
36
+ renderApplied: renderApplied,
37
+ apiUrl: apiUrl
37
38
  });
38
39
  };
39
40
  exports.default = Reward;