@open-tender/store 1.1.198 → 1.1.200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/CategoryNav.d.ts +1 -2
- package/dist/cjs/components/CategoryNav.js +5 -4
- package/dist/cjs/components/CategoryNavItem.d.ts +1 -2
- package/dist/cjs/components/CategoryNavItem.js +4 -3
- package/dist/cjs/components/CheckoutTable.d.ts +13 -0
- package/dist/cjs/components/CheckoutTable.js +17 -0
- package/dist/cjs/components/DisabledModal.d.ts +8 -0
- package/dist/cjs/components/DisabledModal.js +10 -0
- package/dist/cjs/components/Header.d.ts +1 -1
- package/dist/cjs/components/Header.js +4 -2
- package/dist/cjs/components/index.d.ts +3 -1
- package/dist/cjs/components/index.js +5 -1
- package/dist/cjs/slices/checkout.js +3 -2
- package/dist/esm/components/CategoryNav.d.ts +1 -2
- package/dist/esm/components/CategoryNav.js +5 -4
- package/dist/esm/components/CategoryNavItem.d.ts +1 -2
- package/dist/esm/components/CategoryNavItem.js +5 -4
- package/dist/esm/components/CheckoutTable.d.ts +13 -0
- package/dist/esm/components/CheckoutTable.js +14 -0
- package/dist/esm/components/DisabledModal.d.ts +8 -0
- package/dist/esm/components/DisabledModal.js +8 -0
- package/dist/esm/components/Header.d.ts +1 -1
- package/dist/esm/components/Header.js +4 -2
- package/dist/esm/components/index.d.ts +3 -1
- package/dist/esm/components/index.js +3 -1
- package/dist/esm/slices/checkout.js +3 -2
- package/package.json +3 -3
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CategoryNavProps, CategoryNavOtherProps, CategoryNavItemProps } from '@open-tender/ui';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
|
-
declare const CategoryNav: ({
|
|
4
|
-
isVertical?: boolean;
|
|
3
|
+
declare const CategoryNav: ({ children, navigate, CategoryNavOtherView, CategoryNavItemView }: {
|
|
5
4
|
children: (props: CategoryNavProps) => ReactNode;
|
|
6
5
|
navigate: (route: string) => void;
|
|
7
6
|
CategoryNavOtherView: (props: CategoryNavOtherProps) => ReactNode;
|
|
@@ -7,15 +7,15 @@ var slices_1 = require("../slices");
|
|
|
7
7
|
var CategoryNavItem_1 = tslib_1.__importDefault(require("./CategoryNavItem"));
|
|
8
8
|
var CategoryNavOther_1 = tslib_1.__importDefault(require("./CategoryNavOther"));
|
|
9
9
|
var CategoryNav = function (_a) {
|
|
10
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var children = _a.children, navigate = _a.navigate, CategoryNavOtherView = _a.CategoryNavOtherView, CategoryNavItemView = _a.CategoryNavItemView;
|
|
11
|
+
var _b = (0, hooks_1.useAppSelector)(slices_1.selectStoreSettings), display_featured = _b.display_featured, display_favorites = _b.display_favorites, display_recents = _b.display_recents, navigation_page = _b.navigation_page;
|
|
12
12
|
var customer = ((0, hooks_1.useAppSelector)(slices_1.selectCustomerIdentified) || {}).customer;
|
|
13
13
|
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).categoryNav;
|
|
14
|
-
var
|
|
14
|
+
var _c = (0, hooks_1.useAppSelector)(slices_1.selectMenu), categories = _c.categories, featured = _c.featured, rest = tslib_1.__rest(_c, ["categories", "featured"]);
|
|
15
15
|
var favorites = customer && display_favorites ? rest.favorites : [];
|
|
16
16
|
var recents = customer && display_recents ? rest.recents : [];
|
|
17
17
|
var renderCategoryNavOther = (0, react_1.useCallback)(function (title, path) { return (react_1.default.createElement(CategoryNavOther_1.default, { navigate: navigate, title: title, path: path, children: CategoryNavOtherView })); }, [navigate, CategoryNavOtherView]);
|
|
18
|
-
var renderCategoryNavItem = (0, react_1.useCallback)(function (item) { return (react_1.default.createElement(CategoryNavItem_1.default, { key: item.id,
|
|
18
|
+
var renderCategoryNavItem = (0, react_1.useCallback)(function (item) { return (react_1.default.createElement(CategoryNavItem_1.default, { key: item.id, navigate: navigate, category: item, children: CategoryNavItemView })); }, [navigate, CategoryNavItemView]);
|
|
19
19
|
if (!config)
|
|
20
20
|
return null;
|
|
21
21
|
return children({
|
|
@@ -24,6 +24,7 @@ var CategoryNav = function (_a) {
|
|
|
24
24
|
featured: display_featured ? featured : [],
|
|
25
25
|
favorites: favorites,
|
|
26
26
|
recents: recents,
|
|
27
|
+
navigationType: navigation_page,
|
|
27
28
|
renderCategoryNavOther: renderCategoryNavOther,
|
|
28
29
|
renderCategoryNavItem: renderCategoryNavItem
|
|
29
30
|
});
|
|
@@ -1,10 +1,9 @@
|
|
|
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: ({ index, category,
|
|
4
|
+
declare const CategoryNavItem: ({ index, category, children, navigate, scrollToIndex }: {
|
|
5
5
|
index?: number;
|
|
6
6
|
category: MenuCategory;
|
|
7
|
-
isVertical?: boolean;
|
|
8
7
|
navigate: (route: string) => void;
|
|
9
8
|
children: (props: CategoryNavItemProps) => ReactNode;
|
|
10
9
|
scrollToIndex?: (index: number) => void;
|
|
@@ -4,12 +4,13 @@ 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 index = _a.index, category = _a.category,
|
|
7
|
+
var index = _a.index, category = _a.category, children = _a.children, navigate = _a.navigate, scrollToIndex = _a.scrollToIndex;
|
|
8
8
|
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
9
9
|
var apiUrl = (0, hooks_1.useAppSelector)(slices_1.selectKioskApi);
|
|
10
|
+
var display_category_nav_page = (0, hooks_1.useAppSelector)(slices_1.selectStoreSettings).display_category_nav_page;
|
|
10
11
|
var current = (0, hooks_1.useAppSelector)(slices_1.selectCurrentCategory);
|
|
11
12
|
var isCurrent = (current === null || current === void 0 ? void 0 : current.id) === category.id;
|
|
12
|
-
var
|
|
13
|
+
var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), categoryNavItem = _b.categoryNavItem, categoryNavItemSelected = _b.categoryNavItemSelected;
|
|
13
14
|
var config = isCurrent ? categoryNavItemSelected : categoryNavItem;
|
|
14
15
|
var name = category.name;
|
|
15
16
|
var imageUrl = (0, ui_1.makeImageUrl)(category);
|
|
@@ -19,7 +20,7 @@ var CategoryNavItem = function (_a) {
|
|
|
19
20
|
scrollToIndex(index);
|
|
20
21
|
}
|
|
21
22
|
else {
|
|
22
|
-
|
|
23
|
+
navigate(display_category_nav_page ? '/menu/category' : '/menu');
|
|
23
24
|
}
|
|
24
25
|
};
|
|
25
26
|
var handlers = { browse: browse };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InputButtonProps, ScreenConfig, Styles } from '@open-tender/ui';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
declare const CheckoutTable: ({ label, labelStyle, openTable, InputButtonView, children }: {
|
|
4
|
+
label: string;
|
|
5
|
+
labelStyle?: Styles;
|
|
6
|
+
openTable: () => void;
|
|
7
|
+
InputButtonView: (props: InputButtonProps) => React.ReactNode;
|
|
8
|
+
children: (props: {
|
|
9
|
+
config: ScreenConfig;
|
|
10
|
+
renderTableInput: () => ReactNode;
|
|
11
|
+
}) => ReactNode;
|
|
12
|
+
}) => React.ReactNode;
|
|
13
|
+
export default CheckoutTable;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
var hooks_1 = require("../app/hooks");
|
|
6
|
+
var slices_1 = require("../slices");
|
|
7
|
+
var InputButton_1 = tslib_1.__importDefault(require("./InputButton"));
|
|
8
|
+
var CheckoutTable = function (_a) {
|
|
9
|
+
var label = _a.label, labelStyle = _a.labelStyle, openTable = _a.openTable, InputButtonView = _a.InputButtonView, children = _a.children;
|
|
10
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).checkoutTable;
|
|
11
|
+
var table = (0, hooks_1.useAppSelector)(slices_1.selectOrder).table;
|
|
12
|
+
var renderTableInput = (0, react_1.useCallback)(function () {
|
|
13
|
+
return (react_1.default.createElement(InputButton_1.default, { label: label, labelStyle: labelStyle, value: table || '', open: openTable, isRequired: false, children: InputButtonView }));
|
|
14
|
+
}, [InputButtonView, label, labelStyle, openTable, table]);
|
|
15
|
+
return children({ config: config, renderTableInput: renderTableInput });
|
|
16
|
+
};
|
|
17
|
+
exports.default = CheckoutTable;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var hooks_1 = require("../app/hooks");
|
|
4
|
+
var slices_1 = require("../slices");
|
|
5
|
+
var DisabledModal = function (_a) {
|
|
6
|
+
var children = _a.children;
|
|
7
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).disabled;
|
|
8
|
+
return children({ config: config });
|
|
9
|
+
};
|
|
10
|
+
exports.default = DisabledModal;
|
|
@@ -8,6 +8,6 @@ declare const Header: ({ to, backText, backAction, pathname, navigate, children,
|
|
|
8
8
|
navigate: (route: string) => void;
|
|
9
9
|
children: (props: HeaderProps) => ReactNode;
|
|
10
10
|
SignInButtonView: (props: SignInButtonProps) => ReactNode;
|
|
11
|
-
TagsButtonView
|
|
11
|
+
TagsButtonView?: (props: TagsButtonProps) => ReactNode;
|
|
12
12
|
}) => React.ReactNode;
|
|
13
13
|
export default Header;
|
|
@@ -29,7 +29,9 @@ var Header = function (_a) {
|
|
|
29
29
|
};
|
|
30
30
|
var handlers = { back: back, open: open, startOver: startOver };
|
|
31
31
|
var renderSignInButton = (0, react_1.useCallback)(function () { return (react_1.default.createElement(SignInButton_1.default, { pathname: pathname, navigate: navigate, children: SignInButtonView })); }, [pathname, navigate, SignInButtonView]);
|
|
32
|
-
var renderTagsButton = (0, react_1.useCallback)(function () {
|
|
32
|
+
var renderTagsButton = (0, react_1.useCallback)(function () {
|
|
33
|
+
return TagsButtonView ? react_1.default.createElement(TagsButton_1.default, { children: TagsButtonView }) : null;
|
|
34
|
+
}, [TagsButtonView]);
|
|
33
35
|
if (!config)
|
|
34
36
|
return null;
|
|
35
37
|
return children({
|
|
@@ -38,7 +40,7 @@ var Header = function (_a) {
|
|
|
38
40
|
showButtons: showButtons,
|
|
39
41
|
backText: backText,
|
|
40
42
|
renderSignInButton: display_sign_in ? renderSignInButton : undefined,
|
|
41
|
-
renderTagsButton: renderTagsButton
|
|
43
|
+
renderTagsButton: TagsButtonView ? renderTagsButton : undefined
|
|
42
44
|
});
|
|
43
45
|
};
|
|
44
46
|
exports.default = Header;
|
|
@@ -20,8 +20,10 @@ import CheckoutContent from './CheckoutContent';
|
|
|
20
20
|
import CheckoutFooter from './CheckoutFooter';
|
|
21
21
|
import CheckoutHeader from './CheckoutHeader';
|
|
22
22
|
import CheckoutPromoCode from './CheckoutPromoCode';
|
|
23
|
+
import CheckoutTable from './CheckoutTable';
|
|
23
24
|
import CheckoutTotals from './CheckoutTotals';
|
|
24
25
|
import CheckTotals from './CheckTotals';
|
|
26
|
+
import DisabledModal from './DisabledModal';
|
|
25
27
|
import Discount from './Discount';
|
|
26
28
|
import ErrorMessage from './ErrorMessage';
|
|
27
29
|
import FavsButton from './FavsButton';
|
|
@@ -70,4 +72,4 @@ import TagsFilter from './TagsFilter';
|
|
|
70
72
|
import TextArea from './TextArea';
|
|
71
73
|
import UpsellItem from './UpsellItem';
|
|
72
74
|
import Upsells from './Upsells';
|
|
73
|
-
export { AccountLoyalty, AccountSection, Allergen, Applied, ButtonLink, CancelButton, Card, Cart, CartButton, CartItem, CartUpsellItem, CartUpsells, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, Checkout, CheckoutCart, CheckoutContent, CheckoutFooter, CheckoutHeader, CheckoutPromoCode, CheckoutTotals, CheckTotals, Discount, ErrorMessage, FavsButton, Header, Ingredients, Input, InputButton, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSize, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptionsModal, SignInPhone, SignInQr, SignUp, SuccessMessage, Tag, TextArea, UpsellItem, Upsells, IdleModal, TagsFilter, Switch, TagsButton };
|
|
75
|
+
export { AccountLoyalty, AccountSection, Allergen, Applied, ButtonLink, CancelButton, Card, Cart, CartButton, CartItem, CartUpsellItem, CartUpsells, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, Checkout, CheckoutCart, CheckoutContent, CheckoutFooter, CheckoutHeader, CheckoutPromoCode, CheckoutTotals, CheckTotals, Discount, ErrorMessage, FavsButton, Header, Ingredients, Input, InputButton, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSize, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptionsModal, SignInPhone, SignInQr, SignUp, SuccessMessage, Tag, TextArea, UpsellItem, Upsells, IdleModal, TagsFilter, Switch, TagsButton, CheckoutTable, DisabledModal };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OrderDetailsItem = exports.OrderDetails = exports.OrderCard = exports.Option = exports.NutritionalInfo = exports.ModalHeader = exports.ModalContent = exports.MenuOther = exports.MenuCategory = exports.MadeForNotes = exports.MadeForName = exports.Loader = exports.Keypad = exports.ItemSelections = exports.ItemSize = exports.ItemOptionSelected = exports.ItemOption = exports.ItemGroups = exports.ItemGroup = exports.InputButton = exports.Input = exports.Ingredients = exports.Header = exports.FavsButton = exports.ErrorMessage = exports.Discount = exports.CheckTotals = exports.CheckoutTotals = exports.CheckoutPromoCode = exports.CheckoutHeader = exports.CheckoutFooter = exports.CheckoutContent = exports.CheckoutCart = exports.Checkout = exports.CategoryNavOther = exports.CategoryNavItem = exports.CategoryNav = exports.CategoryItem = exports.CartUpsells = exports.CartUpsellItem = exports.CartItem = exports.CartButton = exports.Cart = exports.Card = exports.CancelButton = exports.ButtonLink = exports.Applied = exports.Allergen = exports.AccountSection = exports.AccountLoyalty = void 0;
|
|
4
|
-
exports.TagsButton = exports.Switch = exports.TagsFilter = exports.IdleModal = exports.Upsells = exports.UpsellItem = exports.TextArea = exports.Tag = exports.SuccessMessage = exports.SignUp = exports.SignInQr = exports.SignInPhone = exports.SignInOptionsModal = exports.SignInCheckout = exports.SignInButton = exports.SignIn = exports.Rewards = exports.Reward = exports.Quantity = exports.PromoCode = exports.PointsRewards = exports.PointsReward = void 0;
|
|
4
|
+
exports.DisabledModal = exports.CheckoutTable = exports.TagsButton = exports.Switch = exports.TagsFilter = exports.IdleModal = exports.Upsells = exports.UpsellItem = exports.TextArea = exports.Tag = exports.SuccessMessage = exports.SignUp = exports.SignInQr = exports.SignInPhone = exports.SignInOptionsModal = exports.SignInCheckout = exports.SignInButton = exports.SignIn = exports.Rewards = exports.Reward = exports.Quantity = exports.PromoCode = exports.PointsRewards = exports.PointsReward = void 0;
|
|
5
5
|
var tslib_1 = require("tslib");
|
|
6
6
|
var AccountLoyalty_1 = tslib_1.__importDefault(require("./AccountLoyalty"));
|
|
7
7
|
exports.AccountLoyalty = AccountLoyalty_1.default;
|
|
@@ -47,10 +47,14 @@ var CheckoutHeader_1 = tslib_1.__importDefault(require("./CheckoutHeader"));
|
|
|
47
47
|
exports.CheckoutHeader = CheckoutHeader_1.default;
|
|
48
48
|
var CheckoutPromoCode_1 = tslib_1.__importDefault(require("./CheckoutPromoCode"));
|
|
49
49
|
exports.CheckoutPromoCode = CheckoutPromoCode_1.default;
|
|
50
|
+
var CheckoutTable_1 = tslib_1.__importDefault(require("./CheckoutTable"));
|
|
51
|
+
exports.CheckoutTable = CheckoutTable_1.default;
|
|
50
52
|
var CheckoutTotals_1 = tslib_1.__importDefault(require("./CheckoutTotals"));
|
|
51
53
|
exports.CheckoutTotals = CheckoutTotals_1.default;
|
|
52
54
|
var CheckTotals_1 = tslib_1.__importDefault(require("./CheckTotals"));
|
|
53
55
|
exports.CheckTotals = CheckTotals_1.default;
|
|
56
|
+
var DisabledModal_1 = tslib_1.__importDefault(require("./DisabledModal"));
|
|
57
|
+
exports.DisabledModal = DisabledModal_1.default;
|
|
54
58
|
var Discount_1 = tslib_1.__importDefault(require("./Discount"));
|
|
55
59
|
exports.Discount = Discount_1.default;
|
|
56
60
|
var ErrorMessage_1 = tslib_1.__importDefault(require("./ErrorMessage"));
|
|
@@ -38,7 +38,7 @@ var getAmountDue = function (check) {
|
|
|
38
38
|
return check && check.totals ? check.totals.amount_due : null;
|
|
39
39
|
};
|
|
40
40
|
var prepareOrder = function (order, checkout) {
|
|
41
|
-
var order_uuid = order.orderId, requested_at = order.requestedAt, service_type = order.serviceType, order_type = order.orderType, revenue_center_id = order.revenueCenterId, prep_type = order.prepType;
|
|
41
|
+
var order_uuid = order.orderId, requested_at = order.requestedAt, service_type = order.serviceType, order_type = order.orderType, revenue_center_id = order.revenueCenterId, prep_type = order.prepType, table = order.table;
|
|
42
42
|
if (!order_uuid)
|
|
43
43
|
return null;
|
|
44
44
|
var simpleCart = (0, utils_1.makeSimpleCart)(order.cart);
|
|
@@ -61,7 +61,8 @@ var prepareOrder = function (order, checkout) {
|
|
|
61
61
|
points: points,
|
|
62
62
|
made_for: made_for,
|
|
63
63
|
phone: phone,
|
|
64
|
-
prep_type: prep_type
|
|
64
|
+
prep_type: prep_type,
|
|
65
|
+
notes_internal: table !== null && table.length > 0 ? "DINE IN -- TABLE ".concat(table) : null
|
|
65
66
|
};
|
|
66
67
|
};
|
|
67
68
|
exports.prepareOrder = prepareOrder;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CategoryNavProps, CategoryNavOtherProps, CategoryNavItemProps } from '@open-tender/ui';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
|
-
declare const CategoryNav: ({
|
|
4
|
-
isVertical?: boolean;
|
|
3
|
+
declare const CategoryNav: ({ children, navigate, CategoryNavOtherView, CategoryNavItemView }: {
|
|
5
4
|
children: (props: CategoryNavProps) => ReactNode;
|
|
6
5
|
navigate: (route: string) => void;
|
|
7
6
|
CategoryNavOtherView: (props: CategoryNavOtherProps) => ReactNode;
|
|
@@ -5,15 +5,15 @@ import { selectCustomerIdentified, selectKioskConfig, selectMenu, selectStoreSet
|
|
|
5
5
|
import { default as CategoryNavItemContainer } from './CategoryNavItem';
|
|
6
6
|
import { default as CategoryNavOtherContainer } from './CategoryNavOther';
|
|
7
7
|
var CategoryNav = function (_a) {
|
|
8
|
-
var
|
|
9
|
-
var
|
|
8
|
+
var children = _a.children, navigate = _a.navigate, CategoryNavOtherView = _a.CategoryNavOtherView, CategoryNavItemView = _a.CategoryNavItemView;
|
|
9
|
+
var _b = useAppSelector(selectStoreSettings), display_featured = _b.display_featured, display_favorites = _b.display_favorites, display_recents = _b.display_recents, navigation_page = _b.navigation_page;
|
|
10
10
|
var customer = (useAppSelector(selectCustomerIdentified) || {}).customer;
|
|
11
11
|
var config = useAppSelector(selectKioskConfig).categoryNav;
|
|
12
|
-
var
|
|
12
|
+
var _c = useAppSelector(selectMenu), categories = _c.categories, featured = _c.featured, rest = __rest(_c, ["categories", "featured"]);
|
|
13
13
|
var favorites = customer && display_favorites ? rest.favorites : [];
|
|
14
14
|
var recents = customer && display_recents ? rest.recents : [];
|
|
15
15
|
var renderCategoryNavOther = useCallback(function (title, path) { return (React.createElement(CategoryNavOtherContainer, { navigate: navigate, title: title, path: path, children: CategoryNavOtherView })); }, [navigate, CategoryNavOtherView]);
|
|
16
|
-
var renderCategoryNavItem = useCallback(function (item) { return (React.createElement(CategoryNavItemContainer, { key: item.id,
|
|
16
|
+
var renderCategoryNavItem = useCallback(function (item) { return (React.createElement(CategoryNavItemContainer, { key: item.id, navigate: navigate, category: item, children: CategoryNavItemView })); }, [navigate, CategoryNavItemView]);
|
|
17
17
|
if (!config)
|
|
18
18
|
return null;
|
|
19
19
|
return children({
|
|
@@ -22,6 +22,7 @@ var CategoryNav = function (_a) {
|
|
|
22
22
|
featured: display_featured ? featured : [],
|
|
23
23
|
favorites: favorites,
|
|
24
24
|
recents: recents,
|
|
25
|
+
navigationType: navigation_page,
|
|
25
26
|
renderCategoryNavOther: renderCategoryNavOther,
|
|
26
27
|
renderCategoryNavItem: renderCategoryNavItem
|
|
27
28
|
});
|
|
@@ -1,10 +1,9 @@
|
|
|
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: ({ index, category,
|
|
4
|
+
declare const CategoryNavItem: ({ index, category, children, navigate, scrollToIndex }: {
|
|
5
5
|
index?: number;
|
|
6
6
|
category: MenuCategory;
|
|
7
|
-
isVertical?: boolean;
|
|
8
7
|
navigate: (route: string) => void;
|
|
9
8
|
children: (props: CategoryNavItemProps) => ReactNode;
|
|
10
9
|
scrollToIndex?: (index: number) => void;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { makeImageUrl } from '@open-tender/ui';
|
|
2
2
|
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
3
|
-
import { selectCurrentCategory, selectKioskApi, selectKioskConfig, setCurrentCategory } from '../slices';
|
|
3
|
+
import { selectCurrentCategory, selectKioskApi, selectKioskConfig, selectStoreSettings, setCurrentCategory } from '../slices';
|
|
4
4
|
var CategoryNavItem = function (_a) {
|
|
5
|
-
var index = _a.index, category = _a.category,
|
|
5
|
+
var index = _a.index, category = _a.category, children = _a.children, navigate = _a.navigate, scrollToIndex = _a.scrollToIndex;
|
|
6
6
|
var dispatch = useAppDispatch();
|
|
7
7
|
var apiUrl = useAppSelector(selectKioskApi);
|
|
8
|
+
var display_category_nav_page = useAppSelector(selectStoreSettings).display_category_nav_page;
|
|
8
9
|
var current = useAppSelector(selectCurrentCategory);
|
|
9
10
|
var isCurrent = (current === null || current === void 0 ? void 0 : current.id) === category.id;
|
|
10
|
-
var
|
|
11
|
+
var _b = useAppSelector(selectKioskConfig), categoryNavItem = _b.categoryNavItem, categoryNavItemSelected = _b.categoryNavItemSelected;
|
|
11
12
|
var config = isCurrent ? categoryNavItemSelected : categoryNavItem;
|
|
12
13
|
var name = category.name;
|
|
13
14
|
var imageUrl = makeImageUrl(category);
|
|
@@ -17,7 +18,7 @@ var CategoryNavItem = function (_a) {
|
|
|
17
18
|
scrollToIndex(index);
|
|
18
19
|
}
|
|
19
20
|
else {
|
|
20
|
-
|
|
21
|
+
navigate(display_category_nav_page ? '/menu/category' : '/menu');
|
|
21
22
|
}
|
|
22
23
|
};
|
|
23
24
|
var handlers = { browse: browse };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InputButtonProps, ScreenConfig, Styles } from '@open-tender/ui';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
declare const CheckoutTable: ({ label, labelStyle, openTable, InputButtonView, children }: {
|
|
4
|
+
label: string;
|
|
5
|
+
labelStyle?: Styles;
|
|
6
|
+
openTable: () => void;
|
|
7
|
+
InputButtonView: (props: InputButtonProps) => React.ReactNode;
|
|
8
|
+
children: (props: {
|
|
9
|
+
config: ScreenConfig;
|
|
10
|
+
renderTableInput: () => ReactNode;
|
|
11
|
+
}) => ReactNode;
|
|
12
|
+
}) => React.ReactNode;
|
|
13
|
+
export default CheckoutTable;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { useAppSelector } from '../app/hooks';
|
|
3
|
+
import { selectKioskConfig, selectOrder } from '../slices';
|
|
4
|
+
import { default as InputButtonContainer } from './InputButton';
|
|
5
|
+
var CheckoutTable = function (_a) {
|
|
6
|
+
var label = _a.label, labelStyle = _a.labelStyle, openTable = _a.openTable, InputButtonView = _a.InputButtonView, children = _a.children;
|
|
7
|
+
var config = useAppSelector(selectKioskConfig).checkoutTable;
|
|
8
|
+
var table = useAppSelector(selectOrder).table;
|
|
9
|
+
var renderTableInput = useCallback(function () {
|
|
10
|
+
return (React.createElement(InputButtonContainer, { label: label, labelStyle: labelStyle, value: table || '', open: openTable, isRequired: false, children: InputButtonView }));
|
|
11
|
+
}, [InputButtonView, label, labelStyle, openTable, table]);
|
|
12
|
+
return children({ config: config, renderTableInput: renderTableInput });
|
|
13
|
+
};
|
|
14
|
+
export default CheckoutTable;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig } from '../slices';
|
|
3
|
+
var DisabledModal = function (_a) {
|
|
4
|
+
var children = _a.children;
|
|
5
|
+
var config = useAppSelector(selectKioskConfig).disabled;
|
|
6
|
+
return children({ config: config });
|
|
7
|
+
};
|
|
8
|
+
export default DisabledModal;
|
|
@@ -8,6 +8,6 @@ declare const Header: ({ to, backText, backAction, pathname, navigate, children,
|
|
|
8
8
|
navigate: (route: string) => void;
|
|
9
9
|
children: (props: HeaderProps) => ReactNode;
|
|
10
10
|
SignInButtonView: (props: SignInButtonProps) => ReactNode;
|
|
11
|
-
TagsButtonView
|
|
11
|
+
TagsButtonView?: (props: TagsButtonProps) => ReactNode;
|
|
12
12
|
}) => React.ReactNode;
|
|
13
13
|
export default Header;
|
|
@@ -26,7 +26,9 @@ var Header = function (_a) {
|
|
|
26
26
|
};
|
|
27
27
|
var handlers = { back: back, open: open, startOver: startOver };
|
|
28
28
|
var renderSignInButton = useCallback(function () { return (React.createElement(SignInButtonContainer, { pathname: pathname, navigate: navigate, children: SignInButtonView })); }, [pathname, navigate, SignInButtonView]);
|
|
29
|
-
var renderTagsButton = useCallback(function () {
|
|
29
|
+
var renderTagsButton = useCallback(function () {
|
|
30
|
+
return TagsButtonView ? React.createElement(TagsButtonContainer, { children: TagsButtonView }) : null;
|
|
31
|
+
}, [TagsButtonView]);
|
|
30
32
|
if (!config)
|
|
31
33
|
return null;
|
|
32
34
|
return children({
|
|
@@ -35,7 +37,7 @@ var Header = function (_a) {
|
|
|
35
37
|
showButtons: showButtons,
|
|
36
38
|
backText: backText,
|
|
37
39
|
renderSignInButton: display_sign_in ? renderSignInButton : undefined,
|
|
38
|
-
renderTagsButton: renderTagsButton
|
|
40
|
+
renderTagsButton: TagsButtonView ? renderTagsButton : undefined
|
|
39
41
|
});
|
|
40
42
|
};
|
|
41
43
|
export default Header;
|
|
@@ -20,8 +20,10 @@ import CheckoutContent from './CheckoutContent';
|
|
|
20
20
|
import CheckoutFooter from './CheckoutFooter';
|
|
21
21
|
import CheckoutHeader from './CheckoutHeader';
|
|
22
22
|
import CheckoutPromoCode from './CheckoutPromoCode';
|
|
23
|
+
import CheckoutTable from './CheckoutTable';
|
|
23
24
|
import CheckoutTotals from './CheckoutTotals';
|
|
24
25
|
import CheckTotals from './CheckTotals';
|
|
26
|
+
import DisabledModal from './DisabledModal';
|
|
25
27
|
import Discount from './Discount';
|
|
26
28
|
import ErrorMessage from './ErrorMessage';
|
|
27
29
|
import FavsButton from './FavsButton';
|
|
@@ -70,4 +72,4 @@ import TagsFilter from './TagsFilter';
|
|
|
70
72
|
import TextArea from './TextArea';
|
|
71
73
|
import UpsellItem from './UpsellItem';
|
|
72
74
|
import Upsells from './Upsells';
|
|
73
|
-
export { AccountLoyalty, AccountSection, Allergen, Applied, ButtonLink, CancelButton, Card, Cart, CartButton, CartItem, CartUpsellItem, CartUpsells, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, Checkout, CheckoutCart, CheckoutContent, CheckoutFooter, CheckoutHeader, CheckoutPromoCode, CheckoutTotals, CheckTotals, Discount, ErrorMessage, FavsButton, Header, Ingredients, Input, InputButton, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSize, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptionsModal, SignInPhone, SignInQr, SignUp, SuccessMessage, Tag, TextArea, UpsellItem, Upsells, IdleModal, TagsFilter, Switch, TagsButton };
|
|
75
|
+
export { AccountLoyalty, AccountSection, Allergen, Applied, ButtonLink, CancelButton, Card, Cart, CartButton, CartItem, CartUpsellItem, CartUpsells, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, Checkout, CheckoutCart, CheckoutContent, CheckoutFooter, CheckoutHeader, CheckoutPromoCode, CheckoutTotals, CheckTotals, Discount, ErrorMessage, FavsButton, Header, Ingredients, Input, InputButton, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSize, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptionsModal, SignInPhone, SignInQr, SignUp, SuccessMessage, Tag, TextArea, UpsellItem, Upsells, IdleModal, TagsFilter, Switch, TagsButton, CheckoutTable, DisabledModal };
|
|
@@ -20,8 +20,10 @@ import CheckoutContent from './CheckoutContent';
|
|
|
20
20
|
import CheckoutFooter from './CheckoutFooter';
|
|
21
21
|
import CheckoutHeader from './CheckoutHeader';
|
|
22
22
|
import CheckoutPromoCode from './CheckoutPromoCode';
|
|
23
|
+
import CheckoutTable from './CheckoutTable';
|
|
23
24
|
import CheckoutTotals from './CheckoutTotals';
|
|
24
25
|
import CheckTotals from './CheckTotals';
|
|
26
|
+
import DisabledModal from './DisabledModal';
|
|
25
27
|
import Discount from './Discount';
|
|
26
28
|
import ErrorMessage from './ErrorMessage';
|
|
27
29
|
import FavsButton from './FavsButton';
|
|
@@ -70,4 +72,4 @@ import TagsFilter from './TagsFilter';
|
|
|
70
72
|
import TextArea from './TextArea';
|
|
71
73
|
import UpsellItem from './UpsellItem';
|
|
72
74
|
import Upsells from './Upsells';
|
|
73
|
-
export { AccountLoyalty, AccountSection, Allergen, Applied, ButtonLink, CancelButton, Card, Cart, CartButton, CartItem, CartUpsellItem, CartUpsells, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, Checkout, CheckoutCart, CheckoutContent, CheckoutFooter, CheckoutHeader, CheckoutPromoCode, CheckoutTotals, CheckTotals, Discount, ErrorMessage, FavsButton, Header, Ingredients, Input, InputButton, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSize, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptionsModal, SignInPhone, SignInQr, SignUp, SuccessMessage, Tag, TextArea, UpsellItem, Upsells, IdleModal, TagsFilter, Switch, TagsButton };
|
|
75
|
+
export { AccountLoyalty, AccountSection, Allergen, Applied, ButtonLink, CancelButton, Card, Cart, CartButton, CartItem, CartUpsellItem, CartUpsells, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, Checkout, CheckoutCart, CheckoutContent, CheckoutFooter, CheckoutHeader, CheckoutPromoCode, CheckoutTotals, CheckTotals, Discount, ErrorMessage, FavsButton, Header, Ingredients, Input, InputButton, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSize, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptionsModal, SignInPhone, SignInQr, SignUp, SuccessMessage, Tag, TextArea, UpsellItem, Upsells, IdleModal, TagsFilter, Switch, TagsButton, CheckoutTable, DisabledModal };
|
|
@@ -35,7 +35,7 @@ var getAmountDue = function (check) {
|
|
|
35
35
|
return check && check.totals ? check.totals.amount_due : null;
|
|
36
36
|
};
|
|
37
37
|
export var prepareOrder = function (order, checkout) {
|
|
38
|
-
var order_uuid = order.orderId, requested_at = order.requestedAt, service_type = order.serviceType, order_type = order.orderType, revenue_center_id = order.revenueCenterId, prep_type = order.prepType;
|
|
38
|
+
var order_uuid = order.orderId, requested_at = order.requestedAt, service_type = order.serviceType, order_type = order.orderType, revenue_center_id = order.revenueCenterId, prep_type = order.prepType, table = order.table;
|
|
39
39
|
if (!order_uuid)
|
|
40
40
|
return null;
|
|
41
41
|
var simpleCart = makeSimpleCart(order.cart);
|
|
@@ -58,7 +58,8 @@ export var prepareOrder = function (order, checkout) {
|
|
|
58
58
|
points: points,
|
|
59
59
|
made_for: made_for,
|
|
60
60
|
phone: phone,
|
|
61
|
-
prep_type: prep_type
|
|
61
|
+
prep_type: prep_type,
|
|
62
|
+
notes_internal: table !== null && table.length > 0 ? "DINE IN -- TABLE ".concat(table) : null
|
|
62
63
|
};
|
|
63
64
|
};
|
|
64
65
|
export var CheckoutActionType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.200",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@emotion/react": "^11.11.1",
|
|
64
|
-
"@open-tender/types": "^0.4.
|
|
65
|
-
"@open-tender/ui": "^0.4.
|
|
64
|
+
"@open-tender/types": "^0.4.82",
|
|
65
|
+
"@open-tender/ui": "^0.4.15",
|
|
66
66
|
"@open-tender/utils": "^0.4.61",
|
|
67
67
|
"@reduxjs/toolkit": "^2.0.1",
|
|
68
68
|
"date-fns": "2.30.0",
|