@open-tender/store 1.1.268 → 1.1.270
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/CategoryItem.d.ts +2 -1
- package/dist/cjs/components/CategoryItem.js +2 -1
- package/dist/cjs/components/CategoryNav.js +1 -1
- package/dist/cjs/components/CategoryNavItem.d.ts +3 -1
- package/dist/cjs/components/CategoryNavItem.js +4 -2
- package/dist/esm/components/CategoryItem.d.ts +2 -1
- package/dist/esm/components/CategoryItem.js +2 -1
- package/dist/esm/components/CategoryNav.js +1 -1
- package/dist/esm/components/CategoryNavItem.d.ts +3 -1
- package/dist/esm/components/CategoryNavItem.js +4 -2
- package/package.json +4 -4
|
@@ -6,8 +6,9 @@ interface CategoryItemInterface {
|
|
|
6
6
|
favorite?: MenuItemFavorite;
|
|
7
7
|
allergenAlerts?: string[];
|
|
8
8
|
placeholder?: string;
|
|
9
|
+
index?: number;
|
|
9
10
|
navigate: (route: string) => void;
|
|
10
11
|
children: (props: CategoryItemProps) => ReactNode;
|
|
11
12
|
}
|
|
12
|
-
declare const _default: import("react").MemoExoticComponent<({ item, favorite, allergenAlerts, placeholder, navigate, children }: CategoryItemInterface) => ReactNode>;
|
|
13
|
+
declare const _default: import("react").MemoExoticComponent<({ item, favorite, allergenAlerts, placeholder, index, navigate, children }: CategoryItemInterface) => ReactNode>;
|
|
13
14
|
export default _default;
|
|
@@ -6,7 +6,7 @@ var react_1 = require("react");
|
|
|
6
6
|
var hooks_1 = require("../app/hooks");
|
|
7
7
|
var slices_1 = require("../slices");
|
|
8
8
|
var CategoryItem = function (_a) {
|
|
9
|
-
var item = _a.item, favorite = _a.favorite, allergenAlerts = _a.allergenAlerts, placeholder = _a.placeholder, navigate = _a.navigate, children = _a.children;
|
|
9
|
+
var item = _a.item, favorite = _a.favorite, allergenAlerts = _a.allergenAlerts, placeholder = _a.placeholder, index = _a.index, navigate = _a.navigate, children = _a.children;
|
|
10
10
|
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
11
11
|
var apiUrl = (0, hooks_1.useAppSelector)(slices_1.selectKioskApi);
|
|
12
12
|
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).categoryItem;
|
|
@@ -38,6 +38,7 @@ var CategoryItem = function (_a) {
|
|
|
38
38
|
handlers: handlers,
|
|
39
39
|
apiUrl: apiUrl,
|
|
40
40
|
placeholder: placeholder,
|
|
41
|
+
index: index,
|
|
41
42
|
displayCals: display_cals,
|
|
42
43
|
navigationType: navigation_page,
|
|
43
44
|
displayDescription: display_descriptions
|
|
@@ -15,7 +15,7 @@ var CategoryNav = function (_a) {
|
|
|
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, displayImage: displayImage, navigationType: navigation_page })); }, [navigate, CategoryNavOtherView, displayImage, navigation_page]);
|
|
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, displayImage: displayImage, navigationType: navigation_page })); }, [navigate, CategoryNavItemView, displayImage, navigation_page]);
|
|
18
|
+
var renderCategoryNavItem = (0, react_1.useCallback)(function (item, index, setItemLayout) { return (react_1.default.createElement(CategoryNavItem_1.default, { key: item.id, navigate: navigate, category: item, index: index, setItemLayout: setItemLayout, children: CategoryNavItemView, displayImage: displayImage, navigationType: navigation_page })); }, [navigate, CategoryNavItemView, displayImage, navigation_page]);
|
|
19
19
|
if (!config)
|
|
20
20
|
return null;
|
|
21
21
|
return children({
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { MenuCategory, NavigationPageType } from '@open-tender/types';
|
|
2
2
|
import { CategoryNavItemProps } from '@open-tender/ui';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
-
declare const CategoryNavItem: ({ category, isScrollable, isActive, displayImage, navigationType, children, navigate }: {
|
|
4
|
+
declare const CategoryNavItem: ({ category, isScrollable, isActive, displayImage, navigationType, index, setItemLayout, children, navigate }: {
|
|
5
5
|
category: MenuCategory;
|
|
6
6
|
isScrollable?: boolean;
|
|
7
7
|
isActive?: boolean;
|
|
8
8
|
displayImage?: boolean;
|
|
9
9
|
navigationType?: NavigationPageType;
|
|
10
|
+
index: number;
|
|
11
|
+
setItemLayout?: (x: number, index: number) => void;
|
|
10
12
|
navigate?: (route: string) => void;
|
|
11
13
|
children: (props: CategoryNavItemProps) => ReactNode;
|
|
12
14
|
}) => ReactNode;
|
|
@@ -4,7 +4,7 @@ var ui_1 = require("@open-tender/ui");
|
|
|
4
4
|
var hooks_1 = require("../app/hooks");
|
|
5
5
|
var slices_1 = require("../slices");
|
|
6
6
|
var CategoryNavItem = function (_a) {
|
|
7
|
-
var category = _a.category, isScrollable = _a.isScrollable, isActive = _a.isActive, displayImage = _a.displayImage, navigationType = _a.navigationType, children = _a.children, navigate = _a.navigate;
|
|
7
|
+
var category = _a.category, isScrollable = _a.isScrollable, isActive = _a.isActive, displayImage = _a.displayImage, navigationType = _a.navigationType, index = _a.index, setItemLayout = _a.setItemLayout, children = _a.children, navigate = _a.navigate;
|
|
8
8
|
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
9
9
|
var apiUrl = (0, hooks_1.useAppSelector)(slices_1.selectKioskApi);
|
|
10
10
|
var display_category_nav_page = (0, hooks_1.useAppSelector)(slices_1.selectStoreSettings).display_category_nav_page;
|
|
@@ -31,7 +31,9 @@ var CategoryNavItem = function (_a) {
|
|
|
31
31
|
apiUrl: apiUrl,
|
|
32
32
|
disabled: isScrollable,
|
|
33
33
|
displayImage: displayImage,
|
|
34
|
-
navigationType: navigationType
|
|
34
|
+
navigationType: navigationType,
|
|
35
|
+
index: index,
|
|
36
|
+
setItemLayout: setItemLayout
|
|
35
37
|
});
|
|
36
38
|
};
|
|
37
39
|
exports.default = CategoryNavItem;
|
|
@@ -6,8 +6,9 @@ interface CategoryItemInterface {
|
|
|
6
6
|
favorite?: MenuItemFavorite;
|
|
7
7
|
allergenAlerts?: string[];
|
|
8
8
|
placeholder?: string;
|
|
9
|
+
index?: number;
|
|
9
10
|
navigate: (route: string) => void;
|
|
10
11
|
children: (props: CategoryItemProps) => ReactNode;
|
|
11
12
|
}
|
|
12
|
-
declare const _default: import("react").MemoExoticComponent<({ item, favorite, allergenAlerts, placeholder, navigate, children }: CategoryItemInterface) => ReactNode>;
|
|
13
|
+
declare const _default: import("react").MemoExoticComponent<({ item, favorite, allergenAlerts, placeholder, index, navigate, children }: CategoryItemInterface) => ReactNode>;
|
|
13
14
|
export default _default;
|
|
@@ -4,7 +4,7 @@ import { memo, useMemo } from 'react';
|
|
|
4
4
|
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
5
5
|
import { selectCartCounts, selectKioskApi, selectKioskConfig, selectMenu, selectPointsProgram, selectStoreSettings, setCurrentItem } from '../slices';
|
|
6
6
|
var CategoryItem = function (_a) {
|
|
7
|
-
var item = _a.item, favorite = _a.favorite, allergenAlerts = _a.allergenAlerts, placeholder = _a.placeholder, navigate = _a.navigate, children = _a.children;
|
|
7
|
+
var item = _a.item, favorite = _a.favorite, allergenAlerts = _a.allergenAlerts, placeholder = _a.placeholder, index = _a.index, navigate = _a.navigate, children = _a.children;
|
|
8
8
|
var dispatch = useAppDispatch();
|
|
9
9
|
var apiUrl = useAppSelector(selectKioskApi);
|
|
10
10
|
var config = useAppSelector(selectKioskConfig).categoryItem;
|
|
@@ -36,6 +36,7 @@ var CategoryItem = function (_a) {
|
|
|
36
36
|
handlers: handlers,
|
|
37
37
|
apiUrl: apiUrl,
|
|
38
38
|
placeholder: placeholder,
|
|
39
|
+
index: index,
|
|
39
40
|
displayCals: display_cals,
|
|
40
41
|
navigationType: navigation_page,
|
|
41
42
|
displayDescription: display_descriptions
|
|
@@ -13,7 +13,7 @@ var CategoryNav = function (_a) {
|
|
|
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, displayImage: displayImage, navigationType: navigation_page })); }, [navigate, CategoryNavOtherView, displayImage, navigation_page]);
|
|
16
|
-
var renderCategoryNavItem = useCallback(function (item) { return (React.createElement(CategoryNavItemContainer, { key: item.id, navigate: navigate, category: item, children: CategoryNavItemView, displayImage: displayImage, navigationType: navigation_page })); }, [navigate, CategoryNavItemView, displayImage, navigation_page]);
|
|
16
|
+
var renderCategoryNavItem = useCallback(function (item, index, setItemLayout) { return (React.createElement(CategoryNavItemContainer, { key: item.id, navigate: navigate, category: item, index: index, setItemLayout: setItemLayout, children: CategoryNavItemView, displayImage: displayImage, navigationType: navigation_page })); }, [navigate, CategoryNavItemView, displayImage, navigation_page]);
|
|
17
17
|
if (!config)
|
|
18
18
|
return null;
|
|
19
19
|
return children({
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { MenuCategory, NavigationPageType } from '@open-tender/types';
|
|
2
2
|
import { CategoryNavItemProps } from '@open-tender/ui';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
-
declare const CategoryNavItem: ({ category, isScrollable, isActive, displayImage, navigationType, children, navigate }: {
|
|
4
|
+
declare const CategoryNavItem: ({ category, isScrollable, isActive, displayImage, navigationType, index, setItemLayout, children, navigate }: {
|
|
5
5
|
category: MenuCategory;
|
|
6
6
|
isScrollable?: boolean;
|
|
7
7
|
isActive?: boolean;
|
|
8
8
|
displayImage?: boolean;
|
|
9
9
|
navigationType?: NavigationPageType;
|
|
10
|
+
index: number;
|
|
11
|
+
setItemLayout?: (x: number, index: number) => void;
|
|
10
12
|
navigate?: (route: string) => void;
|
|
11
13
|
children: (props: CategoryNavItemProps) => ReactNode;
|
|
12
14
|
}) => ReactNode;
|
|
@@ -2,7 +2,7 @@ import { makeImageUrl } from '@open-tender/ui';
|
|
|
2
2
|
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
3
3
|
import { selectCurrentCategory, selectKioskApi, selectKioskConfig, selectStoreSettings, setCurrentCategory } from '../slices';
|
|
4
4
|
var CategoryNavItem = function (_a) {
|
|
5
|
-
var category = _a.category, isScrollable = _a.isScrollable, isActive = _a.isActive, displayImage = _a.displayImage, navigationType = _a.navigationType, children = _a.children, navigate = _a.navigate;
|
|
5
|
+
var category = _a.category, isScrollable = _a.isScrollable, isActive = _a.isActive, displayImage = _a.displayImage, navigationType = _a.navigationType, index = _a.index, setItemLayout = _a.setItemLayout, children = _a.children, navigate = _a.navigate;
|
|
6
6
|
var dispatch = useAppDispatch();
|
|
7
7
|
var apiUrl = useAppSelector(selectKioskApi);
|
|
8
8
|
var display_category_nav_page = useAppSelector(selectStoreSettings).display_category_nav_page;
|
|
@@ -29,7 +29,9 @@ var CategoryNavItem = function (_a) {
|
|
|
29
29
|
apiUrl: apiUrl,
|
|
30
30
|
disabled: isScrollable,
|
|
31
31
|
displayImage: displayImage,
|
|
32
|
-
navigationType: navigationType
|
|
32
|
+
navigationType: navigationType,
|
|
33
|
+
index: index,
|
|
34
|
+
setItemLayout: setItemLayout
|
|
33
35
|
});
|
|
34
36
|
};
|
|
35
37
|
export default CategoryNavItem;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.270",
|
|
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,9 +61,9 @@
|
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@emotion/react": "^11.11.1",
|
|
64
|
-
"@open-tender/types": "^0.4.
|
|
65
|
-
"@open-tender/ui": "^0.4.
|
|
66
|
-
"@open-tender/utils": "^0.5.
|
|
64
|
+
"@open-tender/types": "^0.4.145",
|
|
65
|
+
"@open-tender/ui": "^0.4.49",
|
|
66
|
+
"@open-tender/utils": "^0.5.30",
|
|
67
67
|
"@reduxjs/toolkit": "^2.0.1",
|
|
68
68
|
"date-fns": "2.30.0",
|
|
69
69
|
"date-fns-tz": "^2.0.0",
|