@open-tender/store 1.1.208 → 1.1.209
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 +2 -1
- package/dist/cjs/components/CategoryNav.js +4 -3
- package/dist/cjs/components/CategoryNavItem.d.ts +2 -1
- package/dist/cjs/components/CategoryNavItem.js +3 -2
- package/dist/cjs/components/CategoryNavOther.d.ts +2 -1
- package/dist/cjs/components/CategoryNavOther.js +9 -2
- package/dist/esm/components/CategoryNav.d.ts +2 -1
- package/dist/esm/components/CategoryNav.js +4 -3
- package/dist/esm/components/CategoryNavItem.d.ts +2 -1
- package/dist/esm/components/CategoryNavItem.js +3 -2
- package/dist/esm/components/CategoryNavOther.d.ts +2 -1
- package/dist/esm/components/CategoryNavOther.js +9 -2
- package/package.json +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CategoryNavProps, CategoryNavOtherProps, CategoryNavItemProps } from '@open-tender/ui';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
|
-
declare const CategoryNav: ({ children, navigate, CategoryNavOtherView, CategoryNavItemView }: {
|
|
3
|
+
declare const CategoryNav: ({ displayImage, children, navigate, CategoryNavOtherView, CategoryNavItemView }: {
|
|
4
|
+
displayImage?: boolean;
|
|
4
5
|
children: (props: CategoryNavProps) => ReactNode;
|
|
5
6
|
navigate: (route: string) => void;
|
|
6
7
|
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 children = _a.children, navigate = _a.navigate, CategoryNavOtherView = _a.CategoryNavOtherView, CategoryNavItemView = _a.CategoryNavItemView;
|
|
10
|
+
var displayImage = _a.displayImage, children = _a.children, navigate = _a.navigate, CategoryNavOtherView = _a.CategoryNavOtherView, CategoryNavItemView = _a.CategoryNavItemView;
|
|
11
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
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
|
-
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, navigate: navigate, category: item, children: CategoryNavItemView })); }, [navigate, CategoryNavItemView]);
|
|
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 })); }, [navigate, CategoryNavOtherView, displayImage]);
|
|
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 })); }, [navigate, CategoryNavItemView, displayImage]);
|
|
19
19
|
if (!config)
|
|
20
20
|
return null;
|
|
21
21
|
return children({
|
|
@@ -25,6 +25,7 @@ var CategoryNav = function (_a) {
|
|
|
25
25
|
favorites: favorites,
|
|
26
26
|
recents: recents,
|
|
27
27
|
navigationType: navigation_page,
|
|
28
|
+
displayImage: displayImage,
|
|
28
29
|
renderCategoryNavOther: renderCategoryNavOther,
|
|
29
30
|
renderCategoryNavItem: renderCategoryNavItem
|
|
30
31
|
});
|
|
@@ -1,10 +1,11 @@
|
|
|
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, isScrollable, isActive, children, navigate }: {
|
|
4
|
+
declare const CategoryNavItem: ({ category, isScrollable, isActive, displayImage, children, navigate }: {
|
|
5
5
|
category: MenuCategory;
|
|
6
6
|
isScrollable?: boolean;
|
|
7
7
|
isActive?: boolean;
|
|
8
|
+
displayImage?: boolean;
|
|
8
9
|
navigate?: (route: string) => void;
|
|
9
10
|
children: (props: CategoryNavItemProps) => ReactNode;
|
|
10
11
|
}) => 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, children = _a.children, navigate = _a.navigate;
|
|
7
|
+
var category = _a.category, isScrollable = _a.isScrollable, isActive = _a.isActive, displayImage = _a.displayImage, 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;
|
|
@@ -29,7 +29,8 @@ var CategoryNavItem = function (_a) {
|
|
|
29
29
|
title: name,
|
|
30
30
|
imageUrl: imageUrl,
|
|
31
31
|
apiUrl: apiUrl,
|
|
32
|
-
disabled: isScrollable
|
|
32
|
+
disabled: isScrollable,
|
|
33
|
+
displayImage: displayImage
|
|
33
34
|
});
|
|
34
35
|
};
|
|
35
36
|
exports.default = CategoryNavItem;
|
|
@@ -1,8 +1,9 @@
|
|
|
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, displayImage, navigate, children }: {
|
|
4
4
|
title: string;
|
|
5
5
|
path: string;
|
|
6
|
+
displayImage?: boolean;
|
|
6
7
|
navigate: (route: string) => void;
|
|
7
8
|
children: (props: CategoryNavOtherProps) => ReactNode;
|
|
8
9
|
}) => ReactNode;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
var hooks_1 = require("../app/hooks");
|
|
4
4
|
var slices_1 = require("../slices");
|
|
5
5
|
var CategoryNavOther = function (_a) {
|
|
6
|
-
var title = _a.title, path = _a.path, navigate = _a.navigate, children = _a.children;
|
|
6
|
+
var title = _a.title, path = _a.path, displayImage = _a.displayImage, navigate = _a.navigate, children = _a.children;
|
|
7
7
|
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
8
8
|
var apiUrl = (0, hooks_1.useAppSelector)(slices_1.selectKioskApi);
|
|
9
9
|
var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), categoryNavItem = _b.categoryNavItem, categoryNavItemSelected = _b.categoryNavItemSelected;
|
|
@@ -17,6 +17,13 @@ var CategoryNavOther = function (_a) {
|
|
|
17
17
|
var handlers = { browse: browse };
|
|
18
18
|
if (!config)
|
|
19
19
|
return null;
|
|
20
|
-
return children({
|
|
20
|
+
return children({
|
|
21
|
+
config: config,
|
|
22
|
+
handlers: handlers,
|
|
23
|
+
title: title,
|
|
24
|
+
imageUrl: null,
|
|
25
|
+
apiUrl: apiUrl,
|
|
26
|
+
displayImage: displayImage
|
|
27
|
+
});
|
|
21
28
|
};
|
|
22
29
|
exports.default = CategoryNavOther;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CategoryNavProps, CategoryNavOtherProps, CategoryNavItemProps } from '@open-tender/ui';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
|
-
declare const CategoryNav: ({ children, navigate, CategoryNavOtherView, CategoryNavItemView }: {
|
|
3
|
+
declare const CategoryNav: ({ displayImage, children, navigate, CategoryNavOtherView, CategoryNavItemView }: {
|
|
4
|
+
displayImage?: boolean;
|
|
4
5
|
children: (props: CategoryNavProps) => ReactNode;
|
|
5
6
|
navigate: (route: string) => void;
|
|
6
7
|
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 children = _a.children, navigate = _a.navigate, CategoryNavOtherView = _a.CategoryNavOtherView, CategoryNavItemView = _a.CategoryNavItemView;
|
|
8
|
+
var displayImage = _a.displayImage, children = _a.children, navigate = _a.navigate, CategoryNavOtherView = _a.CategoryNavOtherView, CategoryNavItemView = _a.CategoryNavItemView;
|
|
9
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
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
|
-
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, navigate: navigate, category: item, children: CategoryNavItemView })); }, [navigate, CategoryNavItemView]);
|
|
15
|
+
var renderCategoryNavOther = useCallback(function (title, path) { return (React.createElement(CategoryNavOtherContainer, { navigate: navigate, title: title, path: path, children: CategoryNavOtherView, displayImage: displayImage })); }, [navigate, CategoryNavOtherView, displayImage]);
|
|
16
|
+
var renderCategoryNavItem = useCallback(function (item) { return (React.createElement(CategoryNavItemContainer, { key: item.id, navigate: navigate, category: item, children: CategoryNavItemView, displayImage: displayImage })); }, [navigate, CategoryNavItemView, displayImage]);
|
|
17
17
|
if (!config)
|
|
18
18
|
return null;
|
|
19
19
|
return children({
|
|
@@ -23,6 +23,7 @@ var CategoryNav = function (_a) {
|
|
|
23
23
|
favorites: favorites,
|
|
24
24
|
recents: recents,
|
|
25
25
|
navigationType: navigation_page,
|
|
26
|
+
displayImage: displayImage,
|
|
26
27
|
renderCategoryNavOther: renderCategoryNavOther,
|
|
27
28
|
renderCategoryNavItem: renderCategoryNavItem
|
|
28
29
|
});
|
|
@@ -1,10 +1,11 @@
|
|
|
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, isScrollable, isActive, children, navigate }: {
|
|
4
|
+
declare const CategoryNavItem: ({ category, isScrollable, isActive, displayImage, children, navigate }: {
|
|
5
5
|
category: MenuCategory;
|
|
6
6
|
isScrollable?: boolean;
|
|
7
7
|
isActive?: boolean;
|
|
8
|
+
displayImage?: boolean;
|
|
8
9
|
navigate?: (route: string) => void;
|
|
9
10
|
children: (props: CategoryNavItemProps) => ReactNode;
|
|
10
11
|
}) => 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, children = _a.children, navigate = _a.navigate;
|
|
5
|
+
var category = _a.category, isScrollable = _a.isScrollable, isActive = _a.isActive, displayImage = _a.displayImage, 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;
|
|
@@ -27,7 +27,8 @@ var CategoryNavItem = function (_a) {
|
|
|
27
27
|
title: name,
|
|
28
28
|
imageUrl: imageUrl,
|
|
29
29
|
apiUrl: apiUrl,
|
|
30
|
-
disabled: isScrollable
|
|
30
|
+
disabled: isScrollable,
|
|
31
|
+
displayImage: displayImage
|
|
31
32
|
});
|
|
32
33
|
};
|
|
33
34
|
export default CategoryNavItem;
|
|
@@ -1,8 +1,9 @@
|
|
|
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, displayImage, navigate, children }: {
|
|
4
4
|
title: string;
|
|
5
5
|
path: string;
|
|
6
|
+
displayImage?: boolean;
|
|
6
7
|
navigate: (route: string) => void;
|
|
7
8
|
children: (props: CategoryNavOtherProps) => ReactNode;
|
|
8
9
|
}) => ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
2
2
|
import { selectCurrentSection, selectKioskApi, 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, displayImage = _a.displayImage, navigate = _a.navigate, children = _a.children;
|
|
5
5
|
var dispatch = useAppDispatch();
|
|
6
6
|
var apiUrl = useAppSelector(selectKioskApi);
|
|
7
7
|
var _b = useAppSelector(selectKioskConfig), categoryNavItem = _b.categoryNavItem, categoryNavItemSelected = _b.categoryNavItemSelected;
|
|
@@ -15,6 +15,13 @@ var CategoryNavOther = function (_a) {
|
|
|
15
15
|
var handlers = { browse: browse };
|
|
16
16
|
if (!config)
|
|
17
17
|
return null;
|
|
18
|
-
return children({
|
|
18
|
+
return children({
|
|
19
|
+
config: config,
|
|
20
|
+
handlers: handlers,
|
|
21
|
+
title: title,
|
|
22
|
+
imageUrl: null,
|
|
23
|
+
apiUrl: apiUrl,
|
|
24
|
+
displayImage: displayImage
|
|
25
|
+
});
|
|
19
26
|
};
|
|
20
27
|
export default CategoryNavOther;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.209",
|
|
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",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@emotion/react": "^11.11.1",
|
|
64
64
|
"@open-tender/types": "^0.4.85",
|
|
65
|
-
"@open-tender/ui": "^0.4.
|
|
65
|
+
"@open-tender/ui": "^0.4.22",
|
|
66
66
|
"@open-tender/utils": "^0.4.66",
|
|
67
67
|
"@reduxjs/toolkit": "^2.0.1",
|
|
68
68
|
"date-fns": "2.30.0",
|