@open-tender/store 1.1.4 → 1.1.5
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/LICENSE.md +21 -21
- package/README.md +3 -3
- package/dist/cjs/components/Allergen.d.ts +8 -0
- package/dist/cjs/components/Allergen.js +10 -0
- package/dist/cjs/components/Applied.d.ts +6 -0
- package/dist/cjs/components/Applied.js +10 -0
- package/dist/cjs/components/ButtonLink.d.ts +9 -0
- package/dist/cjs/components/ButtonLink.js +10 -0
- package/dist/cjs/components/Card.d.ts +7 -0
- package/dist/cjs/components/Card.js +10 -0
- package/dist/cjs/components/Cart.d.ts +7 -0
- package/dist/cjs/components/Cart.js +41 -0
- package/dist/cjs/components/CartItem.d.ts +11 -0
- package/dist/cjs/components/CartItem.js +31 -0
- package/dist/cjs/components/CartUpsellItem.d.ts +10 -0
- package/dist/cjs/components/CartUpsellItem.js +24 -0
- package/dist/cjs/components/CartUpsells.d.ts +6 -0
- package/dist/cjs/components/CartUpsells.js +25 -0
- package/dist/cjs/components/CategoryItem.d.ts +11 -0
- package/dist/cjs/components/CategoryItem.js +27 -0
- package/dist/cjs/components/CategoryNav.d.ts +7 -0
- package/dist/cjs/components/CategoryNav.js +26 -0
- package/dist/cjs/components/CategoryNavItem.d.ts +9 -0
- package/dist/cjs/components/CategoryNavItem.js +27 -0
- package/dist/cjs/components/CategoryNavOther.d.ts +9 -0
- package/dist/cjs/components/CategoryNavOther.js +19 -0
- package/dist/cjs/components/CheckTotals.d.ts +8 -0
- package/dist/cjs/components/CheckTotals.js +10 -0
- package/dist/cjs/components/Discount.d.ts +8 -0
- package/dist/cjs/components/Discount.js +12 -0
- package/dist/cjs/components/ErrorMessage.d.ts +9 -0
- package/dist/cjs/components/ErrorMessage.js +10 -0
- package/dist/cjs/components/Header.d.ts +9 -0
- package/dist/cjs/components/Header.js +26 -0
- package/dist/cjs/components/Ingredients.d.ts +10 -0
- package/dist/cjs/components/Ingredients.js +11 -0
- package/dist/cjs/components/Input.d.ts +11 -0
- package/dist/cjs/components/Input.js +22 -0
- package/dist/cjs/components/ItemGroup.d.ts +9 -0
- package/dist/cjs/components/ItemGroup.js +18 -0
- package/dist/cjs/components/ItemGroups.d.ts +11 -0
- package/dist/cjs/components/ItemGroups.js +25 -0
- package/dist/cjs/components/ItemOption.d.ts +11 -0
- package/dist/cjs/components/ItemOption.js +30 -0
- package/dist/cjs/components/ItemSelections.d.ts +11 -0
- package/dist/cjs/components/ItemSelections.js +23 -0
- package/dist/cjs/components/Label.d.ts +10 -0
- package/dist/cjs/components/Label.js +10 -0
- package/dist/cjs/components/Loader.d.ts +8 -0
- package/dist/cjs/components/Loader.js +10 -0
- package/dist/cjs/components/MadeForNotes.d.ts +14 -0
- package/dist/cjs/components/MadeForNotes.js +29 -0
- package/dist/cjs/components/MenuCategory.d.ts +3 -3
- package/dist/cjs/components/MenuCategory.js +5 -5
- package/dist/cjs/components/MenuOther.d.ts +12 -0
- package/dist/cjs/components/MenuOther.js +16 -0
- package/dist/cjs/components/Modal.d.ts +9 -0
- package/dist/cjs/components/Modal.js +16 -0
- package/dist/cjs/components/ModalContent.d.ts +14 -0
- package/dist/cjs/components/ModalContent.js +20 -0
- package/dist/cjs/components/ModalHeader.d.ts +8 -0
- package/dist/cjs/components/ModalHeader.js +10 -0
- package/dist/cjs/components/NutritionalInfo.d.ts +11 -0
- package/dist/cjs/components/NutritionalInfo.js +18 -0
- package/dist/cjs/components/Option.d.ts +11 -0
- package/dist/cjs/components/Option.js +24 -0
- package/dist/cjs/components/OrderCard.d.ts +9 -0
- package/dist/cjs/components/OrderCard.js +56 -0
- package/dist/cjs/components/PointsReward.d.ts +10 -0
- package/dist/cjs/components/PointsReward.js +62 -0
- package/dist/cjs/components/PointsRewards.d.ts +6 -0
- package/dist/cjs/components/PointsRewards.js +24 -0
- package/dist/cjs/components/PromoCode.d.ts +7 -0
- package/dist/cjs/components/PromoCode.js +52 -0
- package/dist/cjs/components/Quantity.d.ts +13 -0
- package/dist/cjs/components/Quantity.js +19 -0
- package/dist/cjs/components/Reward.d.ts +10 -0
- package/dist/cjs/components/Reward.js +39 -0
- package/dist/cjs/components/Rewards.d.ts +10 -0
- package/dist/cjs/components/Rewards.js +15 -0
- package/dist/cjs/components/SignIn.d.ts +11 -0
- package/dist/cjs/components/SignIn.js +37 -0
- package/dist/cjs/components/SignInButton.d.ts +8 -0
- package/dist/cjs/components/SignInButton.js +41 -0
- package/dist/cjs/components/SignInCheckout.d.ts +9 -0
- package/dist/cjs/components/SignInCheckout.js +38 -0
- package/dist/cjs/components/SignInOptions.d.ts +7 -0
- package/dist/cjs/components/SignInOptions.js +28 -0
- package/dist/cjs/components/SignInPhone.d.ts +7 -0
- package/dist/cjs/components/SignInPhone.js +59 -0
- package/dist/cjs/components/SignInQr.d.ts +7 -0
- package/dist/cjs/components/SignInQr.js +61 -0
- package/dist/cjs/components/SuccessMessage.d.ts +9 -0
- package/dist/cjs/components/SuccessMessage.js +10 -0
- package/dist/cjs/components/Tag.d.ts +8 -0
- package/dist/cjs/components/Tag.js +10 -0
- package/dist/cjs/components/TextArea.d.ts +11 -0
- package/dist/cjs/components/TextArea.js +22 -0
- package/dist/cjs/components/UpsellItem.d.ts +10 -0
- package/dist/cjs/components/UpsellItem.js +24 -0
- package/dist/cjs/components/Upsells.d.ts +8 -0
- package/dist/cjs/components/Upsells.js +25 -0
- package/dist/cjs/components/index.d.ts +47 -1
- package/dist/cjs/components/index.js +93 -1
- package/dist/cjs/config/index.js +1 -1
- package/dist/cjs/hooks/useBarcode.js +1 -1
- package/dist/cjs/hooks/useChipDNATender/useChipDNATender.js +1 -1
- package/dist/cjs/hooks/useEmployee.js +8 -4
- package/dist/cjs/hooks/useGiftCardBalance.js +1 -1
- package/dist/cjs/hooks/useOrderValidate.js +1 -1
- package/dist/cjs/hooks/usePunch.js +1 -1
- package/dist/cjs/slices/alerts.js +1 -1
- package/dist/cjs/slices/arrivals.js +32 -36
- package/dist/cjs/slices/checkout.d.ts +1 -1
- package/dist/cjs/slices/checkout.js +329 -351
- package/dist/cjs/slices/config.js +79 -81
- package/dist/cjs/slices/customer.js +17 -19
- package/dist/cjs/slices/customerIdentify.js +16 -18
- package/dist/cjs/slices/deals.js +16 -18
- package/dist/cjs/slices/discounts.js +19 -21
- package/dist/cjs/slices/errorAlerts.d.ts +1 -1
- package/dist/cjs/slices/errorAlerts.js +34 -38
- package/dist/cjs/slices/kds.js +253 -275
- package/dist/cjs/slices/kiosk.d.ts +1 -1
- package/dist/cjs/slices/kiosk.js +50 -52
- package/dist/cjs/slices/menu.js +24 -26
- package/dist/cjs/slices/menuPages.js +16 -18
- package/dist/cjs/slices/notifications.js +1 -1
- package/dist/cjs/slices/offlineAuths.js +32 -36
- package/dist/cjs/slices/order.js +25 -27
- package/dist/cjs/slices/pos.js +59 -65
- package/dist/cjs/slices/punches.d.ts +1 -1
- package/dist/cjs/slices/punches.js +16 -18
- package/dist/cjs/slices/refund.js +54 -60
- package/dist/cjs/slices/settings.js +56 -62
- package/dist/cjs/slices/surcharges.js +19 -21
- package/dist/cjs/slices/taxes.js +19 -21
- package/dist/cjs/utils/punches.js +1 -1
- package/dist/esm/components/Allergen.d.ts +8 -0
- package/dist/esm/components/Allergen.js +8 -0
- package/dist/esm/components/Applied.d.ts +6 -0
- package/dist/esm/components/Applied.js +8 -0
- package/dist/esm/components/ButtonLink.d.ts +9 -0
- package/dist/esm/components/ButtonLink.js +8 -0
- package/dist/esm/components/Card.d.ts +7 -0
- package/dist/esm/components/Card.js +8 -0
- package/dist/esm/components/Cart.d.ts +7 -0
- package/dist/esm/components/Cart.js +38 -0
- package/dist/esm/components/CartItem.d.ts +11 -0
- package/dist/esm/components/CartItem.js +28 -0
- package/dist/esm/components/CartUpsellItem.d.ts +10 -0
- package/dist/esm/components/CartUpsellItem.js +22 -0
- package/dist/esm/components/CartUpsells.d.ts +6 -0
- package/dist/esm/components/CartUpsells.js +22 -0
- package/dist/esm/components/CategoryItem.d.ts +11 -0
- package/dist/esm/components/CategoryItem.js +25 -0
- package/dist/esm/components/CategoryNav.d.ts +7 -0
- package/dist/esm/components/CategoryNav.js +23 -0
- package/dist/esm/components/CategoryNavItem.d.ts +9 -0
- package/dist/esm/components/CategoryNavItem.js +25 -0
- package/dist/esm/components/CategoryNavOther.d.ts +9 -0
- package/dist/esm/components/CategoryNavOther.js +17 -0
- package/dist/esm/components/CheckTotals.d.ts +8 -0
- package/dist/esm/components/CheckTotals.js +8 -0
- package/dist/esm/components/Discount.d.ts +8 -0
- package/dist/esm/components/Discount.js +10 -0
- package/dist/esm/components/ErrorMessage.d.ts +9 -0
- package/dist/esm/components/ErrorMessage.js +8 -0
- package/dist/esm/components/Header.d.ts +9 -0
- package/dist/esm/components/Header.js +23 -0
- package/dist/esm/components/Ingredients.d.ts +10 -0
- package/dist/esm/components/Ingredients.js +9 -0
- package/dist/esm/components/Input.d.ts +11 -0
- package/dist/esm/components/Input.js +20 -0
- package/dist/esm/components/ItemGroup.d.ts +9 -0
- package/dist/esm/components/ItemGroup.js +16 -0
- package/dist/esm/components/ItemGroups.d.ts +11 -0
- package/dist/esm/components/ItemGroups.js +22 -0
- package/dist/esm/components/ItemOption.d.ts +11 -0
- package/dist/esm/components/ItemOption.js +28 -0
- package/dist/esm/components/ItemSelections.d.ts +11 -0
- package/dist/esm/components/ItemSelections.js +20 -0
- package/dist/esm/components/Label.d.ts +10 -0
- package/dist/esm/components/Label.js +8 -0
- package/dist/esm/components/Loader.d.ts +8 -0
- package/dist/esm/components/Loader.js +8 -0
- package/dist/esm/components/MadeForNotes.d.ts +14 -0
- package/dist/esm/components/MadeForNotes.js +26 -0
- package/dist/esm/components/MenuCategory.d.ts +3 -3
- package/dist/esm/components/MenuCategory.js +1 -1
- package/dist/esm/components/MenuOther.d.ts +12 -0
- package/dist/esm/components/MenuOther.js +14 -0
- package/dist/esm/components/Modal.d.ts +9 -0
- package/dist/esm/components/Modal.js +13 -0
- package/dist/esm/components/ModalContent.d.ts +14 -0
- package/dist/esm/components/ModalContent.js +18 -0
- package/dist/esm/components/ModalHeader.d.ts +8 -0
- package/dist/esm/components/ModalHeader.js +8 -0
- package/dist/esm/components/NutritionalInfo.d.ts +11 -0
- package/dist/esm/components/NutritionalInfo.js +16 -0
- package/dist/esm/components/Option.d.ts +11 -0
- package/dist/esm/components/Option.js +22 -0
- package/dist/esm/components/OrderCard.d.ts +9 -0
- package/dist/esm/components/OrderCard.js +53 -0
- package/dist/esm/components/PointsReward.d.ts +10 -0
- package/dist/esm/components/PointsReward.js +60 -0
- package/dist/esm/components/PointsRewards.d.ts +6 -0
- package/dist/esm/components/PointsRewards.js +21 -0
- package/dist/esm/components/PromoCode.d.ts +7 -0
- package/dist/esm/components/PromoCode.js +49 -0
- package/dist/esm/components/Quantity.d.ts +13 -0
- package/dist/esm/components/Quantity.js +17 -0
- package/dist/esm/components/Reward.d.ts +10 -0
- package/dist/esm/components/Reward.js +36 -0
- package/dist/esm/components/Rewards.d.ts +10 -0
- package/dist/esm/components/Rewards.js +12 -0
- package/dist/esm/components/SignIn.d.ts +11 -0
- package/dist/esm/components/SignIn.js +35 -0
- package/dist/esm/components/SignInButton.d.ts +8 -0
- package/dist/esm/components/SignInButton.js +39 -0
- package/dist/esm/components/SignInCheckout.d.ts +9 -0
- package/dist/esm/components/SignInCheckout.js +36 -0
- package/dist/esm/components/SignInOptions.d.ts +7 -0
- package/dist/esm/components/SignInOptions.js +25 -0
- package/dist/esm/components/SignInPhone.d.ts +7 -0
- package/dist/esm/components/SignInPhone.js +56 -0
- package/dist/esm/components/SignInQr.d.ts +7 -0
- package/dist/esm/components/SignInQr.js +59 -0
- package/dist/esm/components/SuccessMessage.d.ts +9 -0
- package/dist/esm/components/SuccessMessage.js +8 -0
- package/dist/esm/components/Tag.d.ts +8 -0
- package/dist/esm/components/Tag.js +8 -0
- package/dist/esm/components/TextArea.d.ts +11 -0
- package/dist/esm/components/TextArea.js +20 -0
- package/dist/esm/components/UpsellItem.d.ts +10 -0
- package/dist/esm/components/UpsellItem.js +22 -0
- package/dist/esm/components/Upsells.d.ts +8 -0
- package/dist/esm/components/Upsells.js +22 -0
- package/dist/esm/components/index.d.ts +47 -1
- package/dist/esm/components/index.js +47 -1
- package/dist/esm/config/index.js +1 -1
- package/dist/esm/hooks/useBarcode.js +1 -1
- package/dist/esm/hooks/useChipDNATender/useChipDNATender.js +1 -1
- package/dist/esm/hooks/useEmployee.js +9 -5
- package/dist/esm/hooks/useGiftCardBalance.js +1 -1
- package/dist/esm/hooks/useOrderValidate.js +1 -1
- package/dist/esm/hooks/usePunch.js +1 -1
- package/dist/esm/slices/alerts.js +1 -1
- package/dist/esm/slices/arrivals.js +32 -36
- package/dist/esm/slices/checkout.d.ts +1 -1
- package/dist/esm/slices/checkout.js +329 -351
- package/dist/esm/slices/config.js +79 -81
- package/dist/esm/slices/customer.js +17 -19
- package/dist/esm/slices/customerIdentify.js +16 -18
- package/dist/esm/slices/deals.js +16 -18
- package/dist/esm/slices/discounts.js +19 -21
- package/dist/esm/slices/errorAlerts.d.ts +1 -1
- package/dist/esm/slices/errorAlerts.js +34 -38
- package/dist/esm/slices/kds.js +253 -275
- package/dist/esm/slices/kiosk.d.ts +1 -1
- package/dist/esm/slices/kiosk.js +50 -52
- package/dist/esm/slices/menu.js +24 -26
- package/dist/esm/slices/menuPages.js +16 -18
- package/dist/esm/slices/notifications.js +1 -1
- package/dist/esm/slices/offlineAuths.js +32 -36
- package/dist/esm/slices/order.js +25 -27
- package/dist/esm/slices/pos.js +59 -65
- package/dist/esm/slices/punches.d.ts +1 -1
- package/dist/esm/slices/punches.js +16 -18
- package/dist/esm/slices/refund.js +54 -60
- package/dist/esm/slices/settings.js +56 -62
- package/dist/esm/slices/surcharges.js +19 -21
- package/dist/esm/slices/taxes.js +19 -21
- package/dist/esm/utils/punches.js +1 -1
- package/package.json +82 -75
- package/dist/.DS_Store +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { makeOrderItem, rehydrateOrderItem, useOrderItem } from '@open-tender/utils';
|
|
3
|
+
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
4
|
+
import { selectCartCounts, selectKioskConfig, selectMenu, setCurrentItem } from '../slices';
|
|
5
|
+
var CategoryItem = function (_a) {
|
|
6
|
+
var item = _a.item, favorite = _a.favorite, allergenAlerts = _a.allergenAlerts, navigate = _a.navigate, children = _a.children;
|
|
7
|
+
var dispatch = useAppDispatch();
|
|
8
|
+
var categoryItem = useAppSelector(selectKioskConfig).categoryItem;
|
|
9
|
+
var soldOut = useAppSelector(selectMenu).soldOut;
|
|
10
|
+
var cartCounts = useAppSelector(selectCartCounts);
|
|
11
|
+
var hasPoints = false;
|
|
12
|
+
var displaySettings = {};
|
|
13
|
+
var _b = displaySettings || {}, _c = _b.calories, showCals = _c === void 0 ? false : _c, _d = _b.tags, showTags = _d === void 0 ? false : _d, _e = _b.allergens, showAllergens = _e === void 0 ? false : _e;
|
|
14
|
+
var showDesc = 'SHOW';
|
|
15
|
+
var orderItem = favorite
|
|
16
|
+
? __assign(__assign({}, rehydrateOrderItem(item, favorite.item)), { index: -1 }) : makeOrderItem(item, undefined, soldOut, undefined, hasPoints);
|
|
17
|
+
var cartItem = useOrderItem(orderItem, favorite, allergenAlerts, cartCounts, showCals, showTags, showAllergens, showDesc);
|
|
18
|
+
var browse = function () {
|
|
19
|
+
dispatch(setCurrentItem(cartItem));
|
|
20
|
+
navigate('/menu/item');
|
|
21
|
+
};
|
|
22
|
+
var handlers = { browse: browse };
|
|
23
|
+
return children({ item: cartItem, config: categoryItem, handlers: handlers });
|
|
24
|
+
};
|
|
25
|
+
export default CategoryItem;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CategoryNavProps } from '@open-tender/ui';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
declare const CategoryNav: ({ children, navigate }: {
|
|
4
|
+
children: (props: CategoryNavProps) => ReactNode;
|
|
5
|
+
navigate: (route: string) => void;
|
|
6
|
+
}) => React.ReactNode;
|
|
7
|
+
export default CategoryNav;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CategoryNavItem, CategoryNavOther } from '@open-tender/ui';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useAppSelector } from '../app/hooks';
|
|
4
|
+
import { selectKioskConfig, selectMenu } from '../slices';
|
|
5
|
+
import { default as CategoryNavItemContainer } from './CategoryNavItem';
|
|
6
|
+
import { default as CategoryNavOtherContainer } from './CategoryNavOther';
|
|
7
|
+
var CategoryNav = function (_a) {
|
|
8
|
+
var children = _a.children, navigate = _a.navigate;
|
|
9
|
+
var categoryNav = useAppSelector(selectKioskConfig).categoryNav;
|
|
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 })); };
|
|
13
|
+
return children({
|
|
14
|
+
config: categoryNav,
|
|
15
|
+
categories: categories,
|
|
16
|
+
featured: featured,
|
|
17
|
+
favorites: favorites,
|
|
18
|
+
recents: recents,
|
|
19
|
+
renderCategoryNavOther: renderCategoryNavOther,
|
|
20
|
+
renderCategoryNavItem: renderCategoryNavItem
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
export default CategoryNav;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MenuCategory } from '@open-tender/types';
|
|
2
|
+
import { CategoryNavItemProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const CategoryNavItem: ({ category, children, navigate }: {
|
|
5
|
+
category: MenuCategory;
|
|
6
|
+
navigate: (route: string) => void;
|
|
7
|
+
children: (props: CategoryNavItemProps) => ReactNode;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
export default CategoryNavItem;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { makeImageUrl } from '@open-tender/ui';
|
|
2
|
+
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
3
|
+
import { selectCurrentCategory, selectKioskConfig, setCurrentCategory } from '../slices';
|
|
4
|
+
var CategoryNavItem = function (_a) {
|
|
5
|
+
var category = _a.category, children = _a.children, navigate = _a.navigate;
|
|
6
|
+
var dispatch = useAppDispatch();
|
|
7
|
+
var current = useAppSelector(selectCurrentCategory);
|
|
8
|
+
var isCurrent = (current === null || current === void 0 ? void 0 : current.id) === category.id;
|
|
9
|
+
var _b = useAppSelector(selectKioskConfig), categoryNavItem = _b.categoryNavItem, categoryNavItemSelected = _b.categoryNavItemSelected;
|
|
10
|
+
var config = isCurrent ? categoryNavItemSelected : categoryNavItem;
|
|
11
|
+
var name = category.name;
|
|
12
|
+
var imageUrl = makeImageUrl(category);
|
|
13
|
+
var browse = function () {
|
|
14
|
+
dispatch(setCurrentCategory(category));
|
|
15
|
+
navigate('/menu/category');
|
|
16
|
+
};
|
|
17
|
+
var handlers = { browse: browse };
|
|
18
|
+
return children({
|
|
19
|
+
config: config,
|
|
20
|
+
handlers: handlers,
|
|
21
|
+
title: name,
|
|
22
|
+
imageUrl: imageUrl
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
export default CategoryNavItem;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CategoryNavOtherProps } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const CategoryNavOther: ({ title, path, navigate, children }: {
|
|
4
|
+
title: string;
|
|
5
|
+
path: string;
|
|
6
|
+
navigate: (route: string) => void;
|
|
7
|
+
children: (props: CategoryNavOtherProps) => ReactNode;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
export default CategoryNavOther;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectCurrentSection, selectKioskConfig, setCurrentCategory } from '../slices';
|
|
3
|
+
var CategoryNavOther = function (_a) {
|
|
4
|
+
var title = _a.title, path = _a.path, navigate = _a.navigate, children = _a.children;
|
|
5
|
+
var dispatch = useAppDispatch();
|
|
6
|
+
var _b = useAppSelector(selectKioskConfig), categoryNavItem = _b.categoryNavItem, categoryNavItemSelected = _b.categoryNavItemSelected;
|
|
7
|
+
var currentSection = useAppSelector(selectCurrentSection);
|
|
8
|
+
var isCurrent = path === currentSection;
|
|
9
|
+
var config = isCurrent ? categoryNavItemSelected : categoryNavItem;
|
|
10
|
+
var browse = function () {
|
|
11
|
+
dispatch(setCurrentCategory(null));
|
|
12
|
+
navigate(path);
|
|
13
|
+
};
|
|
14
|
+
var handlers = { browse: browse };
|
|
15
|
+
return children({ config: config, handlers: handlers, title: title, imageUrl: null });
|
|
16
|
+
};
|
|
17
|
+
export default CategoryNavOther;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Order } from '@open-tender/types';
|
|
2
|
+
import { CheckTotalsProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const CheckTotals: ({ check, children }: {
|
|
5
|
+
check: Order;
|
|
6
|
+
children: (props: CheckTotalsProps) => ReactNode;
|
|
7
|
+
}) => ReactNode;
|
|
8
|
+
export default CheckTotals;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig } from '../slices';
|
|
3
|
+
var CheckTotals = function (_a) {
|
|
4
|
+
var check = _a.check, children = _a.children;
|
|
5
|
+
var config = useAppSelector(selectKioskConfig).checkTotals;
|
|
6
|
+
return children({ config: config, check: check });
|
|
7
|
+
};
|
|
8
|
+
export default CheckTotals;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Discount as DiscountType } from '@open-tender/types';
|
|
2
|
+
import { DiscountProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const Discount: ({ discount, children }: {
|
|
5
|
+
discount: DiscountType;
|
|
6
|
+
children: (props: DiscountProps) => ReactNode;
|
|
7
|
+
}) => ReactNode;
|
|
8
|
+
export default Discount;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig } from '../slices';
|
|
3
|
+
var Discount = function (_a) {
|
|
4
|
+
var discount = _a.discount, children = _a.children;
|
|
5
|
+
var _b = useAppSelector(selectKioskConfig), config = _b.discount, cardConfig = _b.card;
|
|
6
|
+
if (!config)
|
|
7
|
+
return null;
|
|
8
|
+
return children({ config: config, discount: discount, cardConfig: cardConfig });
|
|
9
|
+
};
|
|
10
|
+
export default Discount;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ErrorMessageProps, Styles } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const ErrorMessage: ({ content, icon, style, children }: {
|
|
4
|
+
content: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
style?: Styles;
|
|
7
|
+
children: (props: ErrorMessageProps) => ReactNode;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
export default ErrorMessage;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig } from '../slices';
|
|
3
|
+
var ErrorMessage = function (_a) {
|
|
4
|
+
var content = _a.content, icon = _a.icon, style = _a.style, children = _a.children;
|
|
5
|
+
var config = useAppSelector(selectKioskConfig).errorMessage;
|
|
6
|
+
return children({ config: config, icon: icon, style: style, children: content });
|
|
7
|
+
};
|
|
8
|
+
export default ErrorMessage;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HeaderProps } from '@open-tender/ui';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
declare const Header: ({ to, pathname, navigate, children }: {
|
|
4
|
+
to?: string;
|
|
5
|
+
pathname: string;
|
|
6
|
+
navigate: (route: string) => void;
|
|
7
|
+
children: (props: HeaderProps) => ReactNode;
|
|
8
|
+
}) => React.ReactNode;
|
|
9
|
+
export default Header;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SignInButton } from '@open-tender/ui';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
4
|
+
import { selectKioskConfig, toggleSidebar } from '../slices';
|
|
5
|
+
import { default as SignInButtonContainer } from './SignInButton';
|
|
6
|
+
var Header = function (_a) {
|
|
7
|
+
var to = _a.to, pathname = _a.pathname, navigate = _a.navigate, children = _a.children;
|
|
8
|
+
var dispatch = useAppDispatch();
|
|
9
|
+
var header = (useAppSelector(selectKioskConfig) || {}).header;
|
|
10
|
+
var back = function () {
|
|
11
|
+
if (to)
|
|
12
|
+
navigate(to);
|
|
13
|
+
};
|
|
14
|
+
var open = function () {
|
|
15
|
+
dispatch(toggleSidebar());
|
|
16
|
+
};
|
|
17
|
+
var handlers = to ? { back: back, open: open } : null;
|
|
18
|
+
var renderSignInButton = function () { return (React.createElement(SignInButtonContainer, { pathname: pathname, navigate: navigate, children: SignInButton })); };
|
|
19
|
+
if (!header)
|
|
20
|
+
return null;
|
|
21
|
+
return children({ config: header, handlers: handlers, renderSignInButton: renderSignInButton });
|
|
22
|
+
};
|
|
23
|
+
export default Header;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IngredientsProps } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const Ingredients: ({ title, subtitle, ingredients, close, children }: {
|
|
4
|
+
title: string;
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
ingredients: string;
|
|
7
|
+
close: () => void;
|
|
8
|
+
children: (props: IngredientsProps) => ReactNode;
|
|
9
|
+
}) => ReactNode;
|
|
10
|
+
export default Ingredients;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig } from '../slices';
|
|
3
|
+
var Ingredients = function (_a) {
|
|
4
|
+
var title = _a.title, subtitle = _a.subtitle, ingredients = _a.ingredients, close = _a.close, children = _a.children;
|
|
5
|
+
var config = useAppSelector(selectKioskConfig).ingredients;
|
|
6
|
+
var handlers = { close: close };
|
|
7
|
+
return children({ config: config, handlers: handlers, title: title, subtitle: subtitle, ingredients: ingredients });
|
|
8
|
+
};
|
|
9
|
+
export default Ingredients;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InputProps, Styles } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const Input: ({ label, value, setValue, isRequired, style, children }: {
|
|
4
|
+
label?: string;
|
|
5
|
+
value: string;
|
|
6
|
+
setValue: (value: string) => void;
|
|
7
|
+
isRequired?: boolean;
|
|
8
|
+
style?: Styles;
|
|
9
|
+
children: (props: InputProps) => ReactNode;
|
|
10
|
+
}) => ReactNode;
|
|
11
|
+
export default Input;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig } from '../slices';
|
|
3
|
+
var Input = function (_a) {
|
|
4
|
+
var label = _a.label, value = _a.value, setValue = _a.setValue, isRequired = _a.isRequired, style = _a.style, children = _a.children;
|
|
5
|
+
var _b = useAppSelector(selectKioskConfig), config = _b.input, labelConfig = _b.label;
|
|
6
|
+
var update = function (evt) {
|
|
7
|
+
setValue(evt.target.value);
|
|
8
|
+
};
|
|
9
|
+
var handlers = { update: update };
|
|
10
|
+
return children({
|
|
11
|
+
config: config,
|
|
12
|
+
handlers: handlers,
|
|
13
|
+
label: label,
|
|
14
|
+
value: value,
|
|
15
|
+
isRequired: isRequired,
|
|
16
|
+
style: style,
|
|
17
|
+
labelConfig: labelConfig
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
export default Input;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CartItemGroup } from '@open-tender/types';
|
|
2
|
+
import { ItemGroupProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const ItemGroup: ({ group, content, children }: {
|
|
5
|
+
group: CartItemGroup;
|
|
6
|
+
content: ReactNode;
|
|
7
|
+
children: (props: ItemGroupProps) => ReactNode;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
export default ItemGroup;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useModifierGroup } from '@open-tender/utils';
|
|
2
|
+
import { useAppSelector } from '../app/hooks';
|
|
3
|
+
import { selectKioskConfig } from '../slices';
|
|
4
|
+
var ItemGroup = function (_a) {
|
|
5
|
+
var group = _a.group, content = _a.content, children = _a.children;
|
|
6
|
+
var _b = useAppSelector(selectKioskConfig), config = _b.itemGroup, errorMessageConfig = _b.errorMessage, successMessageConfig = _b.successMessage;
|
|
7
|
+
var modifierGroup = useModifierGroup(group);
|
|
8
|
+
return children({
|
|
9
|
+
config: config,
|
|
10
|
+
group: modifierGroup,
|
|
11
|
+
children: content,
|
|
12
|
+
errorMessageConfig: errorMessageConfig,
|
|
13
|
+
successMessageConfig: successMessageConfig
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
export default ItemGroup;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CartItemGroups, CartLevels } from '@open-tender/types';
|
|
2
|
+
import { Handlers, ItemGroupsProps } from '@open-tender/ui';
|
|
3
|
+
import React, { ReactNode } from 'react';
|
|
4
|
+
declare const ItemGroups: ({ handlers, groups, levels, excludeSize, children }: {
|
|
5
|
+
handlers: Handlers;
|
|
6
|
+
groups: CartItemGroups;
|
|
7
|
+
levels: CartLevels;
|
|
8
|
+
excludeSize?: boolean;
|
|
9
|
+
children: (props: ItemGroupsProps) => ReactNode;
|
|
10
|
+
}) => React.ReactNode;
|
|
11
|
+
export default ItemGroups;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ItemOption, ItemGroup } from '@open-tender/ui';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useAppSelector } from '../app/hooks';
|
|
4
|
+
import { selectKioskConfig } from '../slices';
|
|
5
|
+
import { default as ItemGroupContainer } from './ItemGroup';
|
|
6
|
+
import { default as ItemOptionContainer } from './ItemOption';
|
|
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;
|
|
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 })); };
|
|
11
|
+
var renderItemGroup = function (group, content) { return (React.createElement(ItemGroupContainer, { group: group, content: content, children: ItemGroup })); };
|
|
12
|
+
if (!config)
|
|
13
|
+
return null;
|
|
14
|
+
return children({
|
|
15
|
+
config: config,
|
|
16
|
+
groups: groups,
|
|
17
|
+
excludeSize: excludeSize,
|
|
18
|
+
renderItemOption: renderItemOption,
|
|
19
|
+
renderItemGroup: renderItemGroup
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
export default ItemGroups;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CartItemGroup, CartItemOption, CartLevels } from '@open-tender/types';
|
|
2
|
+
import { Handlers, ItemOptionProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const ItemOption: ({ handlers, group, option, levels, children }: {
|
|
5
|
+
handlers: Handlers;
|
|
6
|
+
group: CartItemGroup;
|
|
7
|
+
option: CartItemOption;
|
|
8
|
+
levels: CartLevels;
|
|
9
|
+
children: (props: ItemOptionProps) => ReactNode;
|
|
10
|
+
}) => ReactNode;
|
|
11
|
+
export default ItemOption;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useModifier } from '@open-tender/utils';
|
|
2
|
+
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
3
|
+
import { selectKioskConfig, setCurrentOption } from '../slices';
|
|
4
|
+
var ItemOption = function (_a) {
|
|
5
|
+
var handlers = _a.handlers, group = _a.group, option = _a.option, levels = _a.levels, children = _a.children;
|
|
6
|
+
var dispatch = useAppDispatch();
|
|
7
|
+
var _b = useAppSelector(selectKioskConfig), config = _b.itemOption, cardConfig = _b.card;
|
|
8
|
+
var toggleOption = handlers.toggleOption, incrementOption = handlers.incrementOption, decrementOption = handlers.decrementOption, setOptionQuantity = handlers.setOptionQuantity;
|
|
9
|
+
var allergenAlerts = [];
|
|
10
|
+
var modifier = useModifier(group, option, levels, toggleOption, incrementOption, decrementOption, setOptionQuantity, allergenAlerts);
|
|
11
|
+
var showNested = function () {
|
|
12
|
+
// dispatch(setCurrentOption(modifier))
|
|
13
|
+
var currentOption = {
|
|
14
|
+
groupId: group.id,
|
|
15
|
+
optionId: option.id,
|
|
16
|
+
levels: modifier.updatedLevels
|
|
17
|
+
};
|
|
18
|
+
dispatch(setCurrentOption(currentOption));
|
|
19
|
+
};
|
|
20
|
+
return children({
|
|
21
|
+
config: config,
|
|
22
|
+
handlers: { showNested: showNested },
|
|
23
|
+
group: group,
|
|
24
|
+
option: modifier,
|
|
25
|
+
cardConfig: cardConfig
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
export default ItemOption;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CartItemGroups, CartLevels } from '@open-tender/types';
|
|
2
|
+
import { Handlers, ItemSelectionsProps } from '@open-tender/ui';
|
|
3
|
+
import React, { ReactNode } from 'react';
|
|
4
|
+
declare const ItemSelections: ({ handlers, groups, levels, isIncomplete, children }: {
|
|
5
|
+
handlers: Handlers;
|
|
6
|
+
groups: CartItemGroups;
|
|
7
|
+
levels: CartLevels;
|
|
8
|
+
isIncomplete: boolean;
|
|
9
|
+
children: (props: ItemSelectionsProps) => ReactNode;
|
|
10
|
+
}) => React.ReactNode;
|
|
11
|
+
export default ItemSelections;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ErrorMessage, ItemOption } from '@open-tender/ui';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useAppSelector } from '../app/hooks';
|
|
4
|
+
import { selectKioskConfig } from '../slices';
|
|
5
|
+
import { default as ErrorMessageContainer } from './ErrorMessage';
|
|
6
|
+
import { default as ItemOptionContainer } from './ItemOption';
|
|
7
|
+
var ItemSelections = function (_a) {
|
|
8
|
+
var handlers = _a.handlers, groups = _a.groups, levels = _a.levels, isIncomplete = _a.isIncomplete, children = _a.children;
|
|
9
|
+
var config = useAppSelector(selectKioskConfig).itemSelections;
|
|
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 })); };
|
|
12
|
+
return children({
|
|
13
|
+
config: config,
|
|
14
|
+
groups: groups,
|
|
15
|
+
isIncomplete: isIncomplete,
|
|
16
|
+
renderErrorMessage: renderErrorMessage,
|
|
17
|
+
renderItemOption: renderItemOption
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
export default ItemSelections;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LabelProps, Styles } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const Label: ({ content, label, isRequired, style, children }: {
|
|
4
|
+
content: ReactNode;
|
|
5
|
+
label?: string;
|
|
6
|
+
isRequired?: boolean;
|
|
7
|
+
style?: Styles;
|
|
8
|
+
children: (props: LabelProps) => ReactNode;
|
|
9
|
+
}) => ReactNode;
|
|
10
|
+
export default Label;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig } from '../slices';
|
|
3
|
+
var Label = function (_a) {
|
|
4
|
+
var content = _a.content, label = _a.label, isRequired = _a.isRequired, style = _a.style, children = _a.children;
|
|
5
|
+
var config = useAppSelector(selectKioskConfig).label;
|
|
6
|
+
return children({ config: config, label: label, isRequired: isRequired, style: style, children: content });
|
|
7
|
+
};
|
|
8
|
+
export default Label;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LoaderProps, Styles } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const Loader: ({ text, style, children }: {
|
|
4
|
+
text?: string;
|
|
5
|
+
style?: Styles;
|
|
6
|
+
children: (props: LoaderProps) => ReactNode;
|
|
7
|
+
}) => ReactNode;
|
|
8
|
+
export default Loader;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig } from '../slices';
|
|
3
|
+
var Loader = function (_a) {
|
|
4
|
+
var text = _a.text, style = _a.style, children = _a.children;
|
|
5
|
+
var config = useAppSelector(selectKioskConfig).loader;
|
|
6
|
+
return children({ config: config, text: text, style: style });
|
|
7
|
+
};
|
|
8
|
+
export default Loader;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MadeForNotesProps } from '@open-tender/ui';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
declare const MadeForNotes: ({ subtitle, hasMadeFor, madeFor, setMadeFor, hasNotes, notes, setNotes, close, children }: {
|
|
4
|
+
subtitle: string;
|
|
5
|
+
hasMadeFor: boolean;
|
|
6
|
+
madeFor: string | null;
|
|
7
|
+
setMadeFor: (madeFor: string) => void;
|
|
8
|
+
hasNotes: boolean;
|
|
9
|
+
notes: string | null;
|
|
10
|
+
setNotes: (notes: string) => void;
|
|
11
|
+
close: () => void;
|
|
12
|
+
children: (props: MadeForNotesProps) => ReactNode;
|
|
13
|
+
}) => React.ReactNode;
|
|
14
|
+
export default MadeForNotes;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Input } from '@open-tender/ui';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useAppSelector } from '../app/hooks';
|
|
4
|
+
import { selectKioskConfig } from '../slices';
|
|
5
|
+
import { default as InputContainer } from './Input';
|
|
6
|
+
import { default as TextAreaContainer } from './TextArea';
|
|
7
|
+
var MadeForNotes = function (_a) {
|
|
8
|
+
var subtitle = _a.subtitle, hasMadeFor = _a.hasMadeFor, madeFor = _a.madeFor, setMadeFor = _a.setMadeFor, hasNotes = _a.hasNotes, notes = _a.notes, setNotes = _a.setNotes, close = _a.close, children = _a.children;
|
|
9
|
+
var _b = useAppSelector(selectKioskConfig), config = _b.madeForNotes, modalContentConfig = _b.modalContent;
|
|
10
|
+
var handlers = { submit: close };
|
|
11
|
+
var renderInput = function (label, value, isRequired, style) { return (React.createElement(InputContainer, { label: label, setValue: setMadeFor, value: value, isRequired: isRequired, style: style, children: Input })); };
|
|
12
|
+
var renderTextArea = function (label, value, isRequired, style) { return (React.createElement(TextAreaContainer, { label: label, setValue: setNotes, value: value, isRequired: isRequired, style: style, children: Input })); };
|
|
13
|
+
return children({
|
|
14
|
+
config: config,
|
|
15
|
+
handlers: handlers,
|
|
16
|
+
subtitle: subtitle,
|
|
17
|
+
hasMadeFor: hasMadeFor,
|
|
18
|
+
madeFor: madeFor,
|
|
19
|
+
hasNotes: hasNotes,
|
|
20
|
+
notes: notes,
|
|
21
|
+
modalContentConfig: modalContentConfig,
|
|
22
|
+
renderInput: renderInput,
|
|
23
|
+
renderTextArea: renderTextArea
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
export default MadeForNotes;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { MenuCategory as MenuCategoryType } from '@open-tender/types';
|
|
3
2
|
import { MenuCategoryProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
4
|
declare const MenuCategory: ({ category, navigate, children }: {
|
|
5
5
|
category: MenuCategoryType;
|
|
6
6
|
navigate: (route: string) => void;
|
|
7
|
-
children: (props: MenuCategoryProps) =>
|
|
8
|
-
}) =>
|
|
7
|
+
children: (props: MenuCategoryProps) => ReactNode;
|
|
8
|
+
}) => ReactNode;
|
|
9
9
|
export default MenuCategory;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useKioskImageUrl } from '../hooks';
|
|
2
1
|
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
2
|
+
import { useKioskImageUrl } from '../hooks';
|
|
3
3
|
import { selectKioskConfig, setCurrentCategory } from '../slices';
|
|
4
4
|
var MenuCategory = function (_a) {
|
|
5
5
|
var category = _a.category, navigate = _a.navigate, children = _a.children;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MenuItem } from '@open-tender/types';
|
|
2
|
+
import { MenuOtherProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const MenuOther: ({ title, subtitle, path, item, children, navigate }: {
|
|
5
|
+
title: string;
|
|
6
|
+
subtitle: string;
|
|
7
|
+
path: string;
|
|
8
|
+
item: MenuItem;
|
|
9
|
+
navigate: (route: string) => void;
|
|
10
|
+
children: (props: MenuOtherProps) => ReactNode;
|
|
11
|
+
}) => ReactNode;
|
|
12
|
+
export default MenuOther;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig, setCurrentCategory } from '../slices';
|
|
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;
|
|
5
|
+
var dispatch = useAppDispatch();
|
|
6
|
+
var menuCategory = useAppSelector(selectKioskConfig).menuCategory;
|
|
7
|
+
var browse = function () {
|
|
8
|
+
dispatch(setCurrentCategory(null));
|
|
9
|
+
navigate(path);
|
|
10
|
+
};
|
|
11
|
+
var handlers = { browse: browse };
|
|
12
|
+
return children({ config: menuCategory, handlers: handlers, title: title, subtitle: subtitle, item: item });
|
|
13
|
+
};
|
|
14
|
+
export default MenuOther;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ModalProps } from '@open-tender/ui';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
declare const Modal: ({ show, close, content, children }: {
|
|
4
|
+
show: boolean;
|
|
5
|
+
close: () => void;
|
|
6
|
+
content: ReactNode;
|
|
7
|
+
children: (props: ModalProps) => ReactNode;
|
|
8
|
+
}) => React.JSX.Element | null;
|
|
9
|
+
export default Modal;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CSSTransition, TransitionGroup } from 'react-transition-group';
|
|
3
|
+
import { useAppSelector } from '../app/hooks';
|
|
4
|
+
import { selectKioskConfig } from '../slices';
|
|
5
|
+
var Modal = function (_a) {
|
|
6
|
+
var show = _a.show, close = _a.close, content = _a.content, children = _a.children;
|
|
7
|
+
var config = useAppSelector(selectKioskConfig).modal;
|
|
8
|
+
var handlers = { close: close };
|
|
9
|
+
if (!config)
|
|
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));
|
|
12
|
+
};
|
|
13
|
+
export default Modal;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ModalContentProps, Styles } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const ModalContent: ({ title, subtitle, content, submit, submitText, cancel, cancelText, style, children }: {
|
|
4
|
+
title: string;
|
|
5
|
+
subtitle?: string | null;
|
|
6
|
+
content: ReactNode;
|
|
7
|
+
submit?: () => void;
|
|
8
|
+
submitText?: string;
|
|
9
|
+
cancel: () => void;
|
|
10
|
+
cancelText?: string;
|
|
11
|
+
style?: Styles;
|
|
12
|
+
children: (props: ModalContentProps) => ReactNode;
|
|
13
|
+
}) => ReactNode;
|
|
14
|
+
export default ModalContent;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig } from '../slices';
|
|
3
|
+
var ModalContent = function (_a) {
|
|
4
|
+
var title = _a.title, subtitle = _a.subtitle, content = _a.content, submit = _a.submit, submitText = _a.submitText, cancel = _a.cancel, cancelText = _a.cancelText, style = _a.style, children = _a.children;
|
|
5
|
+
var config = useAppSelector(selectKioskConfig).modalContent;
|
|
6
|
+
return children({
|
|
7
|
+
config: config,
|
|
8
|
+
title: title,
|
|
9
|
+
subtitle: subtitle,
|
|
10
|
+
children: content,
|
|
11
|
+
submit: submit,
|
|
12
|
+
submitText: submitText,
|
|
13
|
+
cancel: cancel,
|
|
14
|
+
cancelText: cancelText,
|
|
15
|
+
style: style
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
export default ModalContent;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ModalHeaderProps } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const ModalHeader: ({ title, subtitle, children }: {
|
|
4
|
+
title: string;
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
children: (props: ModalHeaderProps) => ReactNode;
|
|
7
|
+
}) => ReactNode;
|
|
8
|
+
export default ModalHeader;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig } from '../slices';
|
|
3
|
+
var ModalHeader = function (_a) {
|
|
4
|
+
var title = _a.title, subtitle = _a.subtitle, children = _a.children;
|
|
5
|
+
var config = useAppSelector(selectKioskConfig).modalHeader;
|
|
6
|
+
return children({ config: config, title: title, subtitle: subtitle });
|
|
7
|
+
};
|
|
8
|
+
export default ModalHeader;
|