@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,10 +1,11 @@
1
1
  import { Discounts } from '@open-tender/types';
2
2
  import { RewardsProps } from '@open-tender/ui';
3
3
  import React, { ReactNode } from 'react';
4
- declare const Rewards: ({ title, subtitle, rewards, children }: {
4
+ declare const Rewards: ({ title, subtitle, rewards, children, apiUrl }: {
5
5
  title: string;
6
6
  subtitle?: string;
7
7
  rewards: Discounts;
8
8
  children: (props: RewardsProps) => ReactNode;
9
+ apiUrl: string;
9
10
  }) => React.ReactNode;
10
11
  export default Rewards;
@@ -7,9 +7,9 @@ var hooks_1 = require("../app/hooks");
7
7
  var slices_1 = require("../slices");
8
8
  var Reward_1 = tslib_1.__importDefault(require("./Reward"));
9
9
  var Rewards = function (_a) {
10
- var title = _a.title, subtitle = _a.subtitle, rewards = _a.rewards, children = _a.children;
10
+ var title = _a.title, subtitle = _a.subtitle, rewards = _a.rewards, children = _a.children, apiUrl = _a.apiUrl;
11
11
  var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).rewards;
12
- var renderReward = function (reward, isLast) { return (react_1.default.createElement(Reward_1.default, { reward: reward, isLast: isLast, children: ui_1.Reward })); };
12
+ var renderReward = function (reward, isLast) { return (react_1.default.createElement(Reward_1.default, { apiUrl: apiUrl, reward: reward, isLast: isLast, children: ui_1.Reward })); };
13
13
  return children({ config: config, title: title, subtitle: subtitle, rewards: rewards, renderReward: renderReward });
14
14
  };
15
15
  exports.default = Rewards;
@@ -1,10 +1,11 @@
1
1
  import { CartItem } from '@open-tender/types';
2
2
  import { UpsellItemProps } from '@open-tender/ui';
3
3
  import { ReactNode } from 'react';
4
- declare const UpsellItem: ({ item, callback, isLast, children }: {
4
+ declare const UpsellItem: ({ item, callback, isLast, children, apiUrl }: {
5
5
  item: CartItem;
6
6
  callback?: () => void;
7
7
  isLast?: boolean;
8
8
  children: (props: UpsellItemProps) => ReactNode;
9
+ apiUrl: string;
9
10
  }) => ReactNode;
10
11
  export default UpsellItem;
@@ -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 UpsellItem = 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.upsellItem, cardConfig = _b.card;
10
10
  var builtItem = (0, utils_1.useBuilder)(item).item;
@@ -19,6 +19,6 @@ var UpsellItem = 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 = UpsellItem;
@@ -1,8 +1,9 @@
1
1
  import { UpsellsProps } from '@open-tender/ui';
2
2
  import React, { ReactNode } from 'react';
3
- declare const Upsells: ({ itemIds, close, children }: {
3
+ declare const Upsells: ({ itemIds, close, children, apiUrl }: {
4
4
  itemIds: number[];
5
5
  close: () => void;
6
6
  children: (props: UpsellsProps) => ReactNode;
7
+ apiUrl: string;
7
8
  }) => React.ReactNode;
8
9
  export default Upsells;
@@ -8,13 +8,13 @@ var hooks_1 = require("../app/hooks");
8
8
  var slices_1 = require("../slices");
9
9
  var UpsellItem_1 = tslib_1.__importDefault(require("./UpsellItem"));
10
10
  var Upsells = function (_a) {
11
- var itemIds = _a.itemIds, close = _a.close, children = _a.children;
11
+ var itemIds = _a.itemIds, close = _a.close, children = _a.children, apiUrl = _a.apiUrl;
12
12
  var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).upsells;
13
13
  var categories = (0, hooks_1.useAppSelector)(slices_1.selectMenu).categories;
14
14
  var itemLookup = (0, react_1.useMemo)(function () { return (0, utils_1.makeMenuItemLookup)(categories); }, [categories]);
15
15
  var items = (0, utils_1.makeUpsellItems)(itemIds, itemLookup);
16
16
  var handlers = { close: close };
17
- var renderUpsellItem = function (item, isLast) { return (react_1.default.createElement(UpsellItem_1.default, { item: item, isLast: isLast, children: ui_1.UpsellItem })); };
17
+ var renderUpsellItem = function (item, isLast) { return (react_1.default.createElement(UpsellItem_1.default, { apiUrl: apiUrl, item: item, isLast: isLast, children: ui_1.UpsellItem })); };
18
18
  return children({
19
19
  config: config,
20
20
  handlers: handlers,
@@ -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;
@@ -5,7 +5,7 @@ import { closeCartSummary, selectCartSummary, selectCartTotals, selectKioskConfi
5
5
  import { default as CartItemContainer } from './CartItem';
6
6
  import { default as CartUpsellsContainer } from './CartUpsells';
7
7
  var Cart = function (_a) {
8
- var navigate = _a.navigate, children = _a.children;
8
+ var navigate = _a.navigate, children = _a.children, apiUrl = _a.apiUrl;
9
9
  var dispatch = useAppDispatch();
10
10
  var config = useAppSelector(selectKioskConfig).cart;
11
11
  var cart = useAppSelector(selectOrder).cart;
@@ -20,8 +20,8 @@ var Cart = function (_a) {
20
20
  return;
21
21
  dispatch(closeCartSummary());
22
22
  }, [dispatch, isOpen, isEmpty]);
23
- var renderCartItem = function (item, isLast) { return (React.createElement(CartItemContainer, { navigate: navigate, item: item, isLast: isLast, children: CartItem })); };
24
- var renderCartUpsells = function () { return (React.createElement(CartUpsellsContainer, { children: CartUpsells })); };
23
+ var renderCartItem = function (item, isLast) { return (React.createElement(CartItemContainer, { navigate: navigate, item: item, isLast: isLast, children: CartItem, apiUrl: apiUrl })); };
24
+ var renderCartUpsells = function () { return (React.createElement(CartUpsellsContainer, { apiUrl: apiUrl, children: CartUpsells })); };
25
25
  if (!config)
26
26
  return null;
27
27
  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;
@@ -4,7 +4,7 @@ import { useAppDispatch, useAppSelector } from '../app/hooks';
4
4
  import { decrementItemInCart, incrementItemInCart, removeItemFromCart, selectKioskConfig, setCurrentItem } from '../slices';
5
5
  import { default as QuantityContainer } from './Quantity';
6
6
  var CartItem = function (_a) {
7
- 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;
7
+ 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;
8
8
  var dispatch = useAppDispatch();
9
9
  var config = useAppSelector(selectKioskConfig).cartItem;
10
10
  var increment = function () { return dispatch(incrementItemInCart(item)); };
@@ -22,7 +22,8 @@ var CartItem = function (_a) {
22
22
  handlers: handlers,
23
23
  isLast: isLast,
24
24
  isEditable: isEditable,
25
- renderQuantity: renderQuantity
25
+ renderQuantity: renderQuantity,
26
+ apiUrl: apiUrl
26
27
  });
27
28
  };
28
29
  export 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;
@@ -2,7 +2,7 @@ import { hasGroupsBelowMin, useBuilder } from '@open-tender/utils';
2
2
  import { useAppDispatch, useAppSelector } from '../app/hooks';
3
3
  import { addItemToCart, selectKioskConfig } from '../slices';
4
4
  var CartUpsellItem = function (_a) {
5
- var item = _a.item, callback = _a.callback, isLast = _a.isLast, children = _a.children;
5
+ var item = _a.item, callback = _a.callback, isLast = _a.isLast, children = _a.children, apiUrl = _a.apiUrl;
6
6
  var dispatch = useAppDispatch();
7
7
  var _b = useAppSelector(selectKioskConfig), config = _b.cartUpsellItem, cardConfig = _b.card;
8
8
  var builtItem = useBuilder(item).item;
@@ -17,6 +17,6 @@ var CartUpsellItem = function (_a) {
17
17
  }
18
18
  };
19
19
  var handlers = { add: add };
20
- return children({ config: config, handlers: handlers, item: item, isLast: isLast, cardConfig: cardConfig });
20
+ return children({ config: config, handlers: handlers, item: item, isLast: isLast, cardConfig: cardConfig, apiUrl: apiUrl });
21
21
  };
22
22
  export 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;
@@ -5,12 +5,12 @@ import { useAppSelector } from '../app/hooks';
5
5
  import { selectCartIds, selectKioskConfig, selectMenu } from '../slices';
6
6
  import { default as CartUpsellItemContainer } from './CartUpsellItem';
7
7
  var CartUpsells = function (_a) {
8
- var children = _a.children;
8
+ var children = _a.children, apiUrl = _a.apiUrl;
9
9
  var config = useAppSelector(selectKioskConfig).cartUpsells;
10
10
  var cartIds = useAppSelector(selectCartIds);
11
11
  var _b = useAppSelector(selectMenu), categories = _b.categories, soldOut = _b.soldOut;
12
12
  var upsellItems = useMemo(function () { return makeUpsellItemsForCart(categories, cartIds, soldOut); }, [categories, cartIds, soldOut]);
13
- var renderCartUpsellItem = function (item, isLast) { return (React.createElement(CartUpsellItemContainer, { item: item, isLast: isLast, children: CartUpsellItem })); };
13
+ var renderCartUpsellItem = function (item, isLast) { return (React.createElement(CartUpsellItemContainer, { item: item, isLast: isLast, children: CartUpsellItem, apiUrl: apiUrl })); };
14
14
  if (!upsellItems.length)
15
15
  return null;
16
16
  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;
@@ -3,7 +3,7 @@ import { makeOrderItem, rehydrateOrderItem, useOrderItem } from '@open-tender/ut
3
3
  import { useAppDispatch, useAppSelector } from '../app/hooks';
4
4
  import { selectCartCounts, selectKioskConfig, selectMenu, setCurrentItem } from '../slices';
5
5
  var CategoryItem = function (_a) {
6
- var item = _a.item, favorite = _a.favorite, allergenAlerts = _a.allergenAlerts, navigate = _a.navigate, children = _a.children;
6
+ var item = _a.item, favorite = _a.favorite, allergenAlerts = _a.allergenAlerts, navigate = _a.navigate, children = _a.children, apiUrl = _a.apiUrl;
7
7
  var dispatch = useAppDispatch();
8
8
  var categoryItem = useAppSelector(selectKioskConfig).categoryItem;
9
9
  var soldOut = useAppSelector(selectMenu).soldOut;
@@ -20,6 +20,6 @@ var CategoryItem = function (_a) {
20
20
  navigate('/menu/item');
21
21
  };
22
22
  var handlers = { browse: browse };
23
- return children({ item: cartItem, config: categoryItem, handlers: handlers });
23
+ return children({ item: cartItem, config: categoryItem, handlers: handlers, apiUrl: apiUrl });
24
24
  };
25
25
  export 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;
@@ -5,11 +5,11 @@ import { selectKioskConfig, selectMenu } from '../slices';
5
5
  import { default as CategoryNavItemContainer } from './CategoryNavItem';
6
6
  import { default as CategoryNavOtherContainer } from './CategoryNavOther';
7
7
  var CategoryNav = function (_a) {
8
- var children = _a.children, navigate = _a.navigate;
8
+ var children = _a.children, navigate = _a.navigate, apiUrl = _a.apiUrl;
9
9
  var categoryNav = useAppSelector(selectKioskConfig).categoryNav;
10
10
  var _b = useAppSelector(selectMenu), categories = _b.categories, featured = _b.featured, favorites = _b.favorites, recents = _b.recents;
11
- var renderCategoryNavOther = function (title, path) { return (React.createElement(CategoryNavOtherContainer, { navigate: navigate, title: title, path: path, children: CategoryNavOther })); };
12
- var renderCategoryNavItem = function (item) { return (React.createElement(CategoryNavItemContainer, { navigate: navigate, category: item, children: CategoryNavItem })); };
11
+ var renderCategoryNavOther = function (title, path) { return (React.createElement(CategoryNavOtherContainer, { apiUrl: apiUrl, navigate: navigate, title: title, path: path, children: CategoryNavOther })); };
12
+ var renderCategoryNavItem = function (item) { return (React.createElement(CategoryNavItemContainer, { apiUrl: apiUrl, navigate: navigate, category: item, children: CategoryNavItem })); };
13
13
  return children({
14
14
  config: categoryNav,
15
15
  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;
@@ -2,7 +2,7 @@ import { makeImageUrl } from '@open-tender/ui';
2
2
  import { useAppDispatch, useAppSelector } from '../app/hooks';
3
3
  import { selectCurrentCategory, selectKioskConfig, setCurrentCategory } from '../slices';
4
4
  var CategoryNavItem = function (_a) {
5
- var category = _a.category, children = _a.children, navigate = _a.navigate;
5
+ var category = _a.category, children = _a.children, navigate = _a.navigate, apiUrl = _a.apiUrl;
6
6
  var dispatch = useAppDispatch();
7
7
  var current = useAppSelector(selectCurrentCategory);
8
8
  var isCurrent = (current === null || current === void 0 ? void 0 : current.id) === category.id;
@@ -19,7 +19,8 @@ var CategoryNavItem = function (_a) {
19
19
  config: config,
20
20
  handlers: handlers,
21
21
  title: name,
22
- imageUrl: imageUrl
22
+ imageUrl: imageUrl,
23
+ apiUrl: apiUrl
23
24
  });
24
25
  };
25
26
  export 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;
@@ -1,7 +1,7 @@
1
1
  import { useAppDispatch, useAppSelector } from '../app/hooks';
2
2
  import { selectCurrentSection, selectKioskConfig, setCurrentCategory } from '../slices';
3
3
  var CategoryNavOther = function (_a) {
4
- var title = _a.title, path = _a.path, navigate = _a.navigate, children = _a.children;
4
+ var title = _a.title, path = _a.path, navigate = _a.navigate, children = _a.children, apiUrl = _a.apiUrl;
5
5
  var dispatch = useAppDispatch();
6
6
  var _b = useAppSelector(selectKioskConfig), categoryNavItem = _b.categoryNavItem, categoryNavItemSelected = _b.categoryNavItemSelected;
7
7
  var currentSection = useAppSelector(selectCurrentSection);
@@ -12,6 +12,6 @@ var CategoryNavOther = function (_a) {
12
12
  navigate(path);
13
13
  };
14
14
  var handlers = { browse: browse };
15
- return children({ config: config, handlers: handlers, title: title, imageUrl: null });
15
+ return children({ config: config, handlers: handlers, title: title, imageUrl: null, apiUrl: apiUrl });
16
16
  };
17
17
  export 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;
@@ -1,10 +1,10 @@
1
1
  import { useAppSelector } from '../app/hooks';
2
2
  import { selectKioskConfig } from '../slices';
3
3
  var Discount = function (_a) {
4
- var discount = _a.discount, children = _a.children;
4
+ var discount = _a.discount, children = _a.children, apiUrl = _a.apiUrl;
5
5
  var _b = useAppSelector(selectKioskConfig), config = _b.discount, cardConfig = _b.card;
6
6
  if (!config)
7
7
  return null;
8
- return children({ config: config, discount: discount, cardConfig: cardConfig });
8
+ return children({ config: config, discount: discount, cardConfig: cardConfig, apiUrl: apiUrl });
9
9
  };
10
10
  export 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,16 +1,22 @@
1
+ import { ErrorMessage, SuccessMessage } from '@open-tender/ui';
1
2
  import { useModifierGroup } from '@open-tender/utils';
3
+ import React from 'react';
2
4
  import { useAppSelector } from '../app/hooks';
3
5
  import { selectKioskConfig } from '../slices';
6
+ import { default as ErrorMessageContainer } from './ErrorMessage';
7
+ import { default as SuccessMessageContainer } from './SuccessMessage';
4
8
  var ItemGroup = function (_a) {
5
9
  var group = _a.group, content = _a.content, children = _a.children;
6
- var _b = useAppSelector(selectKioskConfig), config = _b.itemGroup, errorMessageConfig = _b.errorMessage, successMessageConfig = _b.successMessage;
10
+ var config = useAppSelector(selectKioskConfig).itemGroup;
7
11
  var modifierGroup = useModifierGroup(group);
12
+ var renderErrorMessage = function (icon, children) { return (React.createElement(ErrorMessageContainer, { icon: icon, content: children, children: ErrorMessage })); };
13
+ var renderSuccessMessage = function (icon, children) { return (React.createElement(SuccessMessageContainer, { icon: icon, content: children, children: SuccessMessage })); };
8
14
  return children({
9
15
  config: config,
10
16
  group: modifierGroup,
11
17
  children: content,
12
- errorMessageConfig: errorMessageConfig,
13
- successMessageConfig: successMessageConfig
18
+ renderErrorMessage: renderErrorMessage,
19
+ renderSuccessMessage: renderSuccessMessage
14
20
  });
15
21
  };
16
22
  export 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;
@@ -5,9 +5,9 @@ import { selectKioskConfig } from '../slices';
5
5
  import { default as ItemGroupContainer } from './ItemGroup';
6
6
  import { default as ItemOptionContainer } from './ItemOption';
7
7
  var ItemGroups = function (_a) {
8
- var handlers = _a.handlers, groups = _a.groups, levels = _a.levels, _b = _a.excludeSize, excludeSize = _b === void 0 ? true : _b, children = _a.children;
8
+ 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;
9
9
  var config = useAppSelector(selectKioskConfig).itemGroups;
10
- var renderItemOption = function (group, option) { return (React.createElement(ItemOptionContainer, { levels: levels, handlers: handlers, group: group, option: option, children: ItemOption })); };
10
+ var renderItemOption = function (group, option) { return (React.createElement(ItemOptionContainer, { apiUrl: apiUrl, levels: levels, handlers: handlers, group: group, option: option, children: ItemOption })); };
11
11
  var renderItemGroup = function (group, content) { return (React.createElement(ItemGroupContainer, { group: group, content: content, children: ItemGroup })); };
12
12
  if (!config)
13
13
  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;
@@ -2,7 +2,7 @@ import { useModifier } from '@open-tender/utils';
2
2
  import { useAppDispatch, useAppSelector } from '../app/hooks';
3
3
  import { selectKioskConfig, setCurrentOption } from '../slices';
4
4
  var ItemOption = function (_a) {
5
- var handlers = _a.handlers, group = _a.group, option = _a.option, levels = _a.levels, children = _a.children;
5
+ var handlers = _a.handlers, group = _a.group, option = _a.option, levels = _a.levels, children = _a.children, apiUrl = _a.apiUrl;
6
6
  var dispatch = useAppDispatch();
7
7
  var _b = useAppSelector(selectKioskConfig), config = _b.itemOption, cardConfig = _b.card;
8
8
  var toggleOption = handlers.toggleOption, incrementOption = handlers.incrementOption, decrementOption = handlers.decrementOption, setOptionQuantity = handlers.setOptionQuantity;
@@ -22,7 +22,8 @@ var ItemOption = function (_a) {
22
22
  handlers: { showNested: showNested },
23
23
  group: group,
24
24
  option: modifier,
25
- cardConfig: cardConfig
25
+ cardConfig: cardConfig,
26
+ apiUrl: apiUrl
26
27
  });
27
28
  };
28
29
  export 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;
@@ -5,10 +5,10 @@ import { selectKioskConfig } from '../slices';
5
5
  import { default as ErrorMessageContainer } from './ErrorMessage';
6
6
  import { default as ItemOptionContainer } from './ItemOption';
7
7
  var ItemSelections = function (_a) {
8
- var handlers = _a.handlers, groups = _a.groups, levels = _a.levels, isIncomplete = _a.isIncomplete, children = _a.children;
8
+ var handlers = _a.handlers, groups = _a.groups, levels = _a.levels, isIncomplete = _a.isIncomplete, children = _a.children, apiUrl = _a.apiUrl;
9
9
  var config = useAppSelector(selectKioskConfig).itemSelections;
10
10
  var renderErrorMessage = function (icon, children) { return (React.createElement(ErrorMessageContainer, { icon: icon, content: children, children: ErrorMessage })); };
11
- var renderItemOption = function (group, option) { return (React.createElement(ItemOptionContainer, { levels: levels, handlers: handlers, group: group, option: option, children: ItemOption })); };
11
+ var renderItemOption = function (group, option) { return (React.createElement(ItemOptionContainer, { levels: levels, handlers: handlers, group: group, option: option, children: ItemOption, apiUrl: apiUrl })); };
12
12
  return children({
13
13
  config: config,
14
14
  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;
@@ -1,7 +1,7 @@
1
1
  import { useAppDispatch, useAppSelector } from '../app/hooks';
2
2
  import { selectKioskConfig, setCurrentCategory } from '../slices';
3
3
  var MenuOther = function (_a) {
4
- var title = _a.title, subtitle = _a.subtitle, path = _a.path, item = _a.item, children = _a.children, navigate = _a.navigate;
4
+ var title = _a.title, subtitle = _a.subtitle, path = _a.path, item = _a.item, children = _a.children, navigate = _a.navigate, apiUrl = _a.apiUrl;
5
5
  var dispatch = useAppDispatch();
6
6
  var menuCategory = useAppSelector(selectKioskConfig).menuCategory;
7
7
  var browse = function () {
@@ -9,6 +9,13 @@ var MenuOther = function (_a) {
9
9
  navigate(path);
10
10
  };
11
11
  var handlers = { browse: browse };
12
- return children({ config: menuCategory, handlers: handlers, title: title, subtitle: subtitle, item: item });
12
+ return children({
13
+ config: menuCategory,
14
+ handlers: handlers,
15
+ title: title,
16
+ subtitle: subtitle,
17
+ item: item,
18
+ apiUrl: apiUrl
19
+ });
13
20
  };
14
21
  export default MenuOther;
@@ -8,6 +8,6 @@ var Modal = function (_a) {
8
8
  var handlers = { close: close };
9
9
  if (!config)
10
10
  return null;
11
- return (React.createElement(TransitionGroup, { component: null }, show ? (React.createElement(CSSTransition, { key: "modal", classNames: "md", timeout: { enter: 250, exit: 250 } }, children({ config: config, handlers: handlers, children: content }))) : null));
11
+ return (React.createElement(TransitionGroup, { component: null }, show && (React.createElement(CSSTransition, { key: "modal", classNames: "md", timeout: { enter: 250, exit: 250 } }, children({ config: config, handlers: handlers, children: content })))));
12
12
  };
13
13
  export 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;
@@ -5,12 +5,12 @@ import { useAppSelector } from '../app/hooks';
5
5
  import { selectKioskConfig } from '../slices';
6
6
  import { default as ItemGroupsContainer } from './ItemGroups';
7
7
  var Option = function (_a) {
8
- var option = _a.option, levels = _a.levels, handlers = _a.handlers, close = _a.close, children = _a.children;
8
+ var option = _a.option, levels = _a.levels, handlers = _a.handlers, close = _a.close, children = _a.children, apiUrl = _a.apiUrl;
9
9
  var _b = useAppSelector(selectKioskConfig), config = _b.option, modalContentConfig = _b.modalContent;
10
10
  var handlersOption = __assign(__assign({}, handlers), { close: close });
11
11
  if (!config || !option || !levels)
12
12
  return null;
13
- var renderItemGroups = function (excludeSize) { return (React.createElement(ItemGroupsContainer, { levels: levels, handlers: handlersOption, groups: option.groups, excludeSize: excludeSize, children: ItemGroups })); };
13
+ var renderItemGroups = function (excludeSize) { return (React.createElement(ItemGroupsContainer, { levels: levels, handlers: handlersOption, groups: option.groups, excludeSize: excludeSize, children: ItemGroups, apiUrl: apiUrl })); };
14
14
  return children({
15
15
  config: config,
16
16
  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;
@@ -5,7 +5,7 @@ import { useOrder } from '../hooks';
5
5
  import { selectKioskConfig, selectOrder, reorder as reorderPastOrder } from '../slices';
6
6
  import { default as ErrorMessageContainer } from './ErrorMessage';
7
7
  var OrderCard = function (_a) {
8
- var order = _a.order, navigate = _a.navigate, children = _a.children;
8
+ var order = _a.order, navigate = _a.navigate, children = _a.children, apiUrl = _a.apiUrl;
9
9
  var dispatch = useAppDispatch();
10
10
  var _b = useState(null), errMsg = _b[0], setErrMsg = _b[1];
11
11
  var _c = useState(false), isReordering = _c[0], setIsReordering = _c[1];
@@ -47,7 +47,8 @@ var OrderCard = function (_a) {
47
47
  orderNo: orderNo,
48
48
  itemNames: itemNames,
49
49
  itemImages: itemImages,
50
- renderErrorMessage: renderErrorMessage
50
+ renderErrorMessage: renderErrorMessage,
51
+ apiUrl: apiUrl
51
52
  });
52
53
  };
53
54
  export 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;