@open-tender/store 1.1.95 → 1.1.97

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.
@@ -1,10 +1,11 @@
1
1
  import { MenuItem, MenuItemFavorite } from '@open-tender/types';
2
2
  import { CategoryItemProps } from '@open-tender/ui';
3
3
  import { ReactNode } from 'react';
4
- declare const CategoryItem: ({ item, favorite, allergenAlerts, navigate, children }: {
4
+ declare const CategoryItem: ({ item, favorite, allergenAlerts, placeholder, navigate, children }: {
5
5
  item: MenuItem;
6
6
  favorite?: MenuItemFavorite;
7
7
  allergenAlerts?: string[];
8
+ placeholder?: string;
8
9
  navigate: (route: string) => void;
9
10
  children: (props: CategoryItemProps) => ReactNode;
10
11
  }) => ReactNode;
@@ -5,7 +5,7 @@ var utils_1 = require("@open-tender/utils");
5
5
  var hooks_1 = require("../app/hooks");
6
6
  var slices_1 = require("../slices");
7
7
  var CategoryItem = function (_a) {
8
- var item = _a.item, favorite = _a.favorite, allergenAlerts = _a.allergenAlerts, navigate = _a.navigate, children = _a.children;
8
+ var item = _a.item, favorite = _a.favorite, allergenAlerts = _a.allergenAlerts, placeholder = _a.placeholder, navigate = _a.navigate, children = _a.children;
9
9
  var dispatch = (0, hooks_1.useAppDispatch)();
10
10
  var apiUrl = (0, hooks_1.useAppSelector)(slices_1.selectKioskApi);
11
11
  var categoryItem = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).categoryItem;
@@ -23,6 +23,12 @@ var CategoryItem = function (_a) {
23
23
  navigate('/menu/item');
24
24
  };
25
25
  var handlers = { browse: browse };
26
- return children({ item: cartItem, config: categoryItem, handlers: handlers, apiUrl: apiUrl });
26
+ return children({
27
+ item: cartItem,
28
+ config: categoryItem,
29
+ handlers: handlers,
30
+ apiUrl: apiUrl,
31
+ placeholder: placeholder
32
+ });
27
33
  };
28
34
  exports.default = CategoryItem;
@@ -1,7 +1,8 @@
1
1
  import { HeaderProps, SignInButtonProps } from '@open-tender/ui';
2
2
  import React, { ReactNode } from 'react';
3
- declare const Header: ({ to, backAction, pathname, navigate, children, SignInButtonView }: {
3
+ declare const Header: ({ to, backText, backAction, pathname, navigate, children, SignInButtonView }: {
4
4
  to?: string;
5
+ backText?: string;
5
6
  backAction?: () => void;
6
7
  pathname: string;
7
8
  navigate: (route: string) => void;
@@ -6,7 +6,7 @@ var hooks_1 = require("../app/hooks");
6
6
  var slices_1 = require("../slices");
7
7
  var SignInButton_1 = tslib_1.__importDefault(require("./SignInButton"));
8
8
  var Header = function (_a) {
9
- var to = _a.to, backAction = _a.backAction, pathname = _a.pathname, navigate = _a.navigate, children = _a.children, SignInButtonView = _a.SignInButtonView;
9
+ var to = _a.to, _b = _a.backText, backText = _b === void 0 ? 'Back' : _b, backAction = _a.backAction, pathname = _a.pathname, navigate = _a.navigate, children = _a.children, SignInButtonView = _a.SignInButtonView;
10
10
  var dispatch = (0, hooks_1.useAppDispatch)();
11
11
  var header = ((0, hooks_1.useAppSelector)(slices_1.selectKioskConfig) || {}).header;
12
12
  var showButtons = !!(backAction || to);
@@ -29,6 +29,12 @@ var Header = function (_a) {
29
29
  var renderSignInButton = (0, react_1.useCallback)(function () { return (react_1.default.createElement(SignInButton_1.default, { pathname: pathname, navigate: navigate, children: SignInButtonView })); }, [pathname, navigate, SignInButtonView]);
30
30
  if (!header)
31
31
  return null;
32
- return children({ config: header, handlers: handlers, showButtons: showButtons, renderSignInButton: renderSignInButton });
32
+ return children({
33
+ config: header,
34
+ handlers: handlers,
35
+ showButtons: showButtons,
36
+ backText: backText,
37
+ renderSignInButton: renderSignInButton
38
+ });
33
39
  };
34
40
  exports.default = Header;
@@ -1,11 +1,12 @@
1
1
  import { CartItemGroup, CartItemOption, CartLevels } from '@open-tender/types';
2
2
  import { Handlers, ItemOptionProps } from '@open-tender/ui';
3
3
  import { ReactNode } from 'react';
4
- declare const ItemOption: ({ handlers, group, option, levels, children }: {
4
+ declare const ItemOption: ({ handlers, group, option, levels, placeholder, children }: {
5
5
  handlers: Handlers;
6
6
  group: CartItemGroup;
7
7
  option: CartItemOption;
8
8
  levels: CartLevels;
9
+ placeholder?: string;
9
10
  children: (props: ItemOptionProps) => ReactNode;
10
11
  }) => ReactNode;
11
12
  export default ItemOption;
@@ -4,7 +4,7 @@ var utils_1 = require("@open-tender/utils");
4
4
  var hooks_1 = require("../app/hooks");
5
5
  var slices_1 = require("../slices");
6
6
  var ItemOption = function (_a) {
7
- var handlers = _a.handlers, group = _a.group, option = _a.option, levels = _a.levels, children = _a.children;
7
+ var handlers = _a.handlers, group = _a.group, option = _a.option, levels = _a.levels, placeholder = _a.placeholder, children = _a.children;
8
8
  var dispatch = (0, hooks_1.useAppDispatch)();
9
9
  var apiUrl = (0, hooks_1.useAppSelector)(slices_1.selectKioskApi);
10
10
  var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).itemOption;
@@ -27,7 +27,8 @@ var ItemOption = function (_a) {
27
27
  handlers: { showNested: showNested },
28
28
  group: group,
29
29
  option: modifier,
30
- apiUrl: apiUrl
30
+ apiUrl: apiUrl,
31
+ placeholder: placeholder
31
32
  });
32
33
  };
33
34
  exports.default = ItemOption;
@@ -1,10 +1,11 @@
1
1
  import { MenuItem, MenuItemFavorite } from '@open-tender/types';
2
2
  import { CategoryItemProps } from '@open-tender/ui';
3
3
  import { ReactNode } from 'react';
4
- declare const CategoryItem: ({ item, favorite, allergenAlerts, navigate, children }: {
4
+ declare const CategoryItem: ({ item, favorite, allergenAlerts, placeholder, navigate, children }: {
5
5
  item: MenuItem;
6
6
  favorite?: MenuItemFavorite;
7
7
  allergenAlerts?: string[];
8
+ placeholder?: string;
8
9
  navigate: (route: string) => void;
9
10
  children: (props: CategoryItemProps) => ReactNode;
10
11
  }) => ReactNode;
@@ -3,7 +3,7 @@ import { makeOrderItem, rehydrateOrderItem, useOrderItem } from '@open-tender/ut
3
3
  import { useAppDispatch, useAppSelector } from '../app/hooks';
4
4
  import { selectCartCounts, selectKioskApi, selectKioskConfig, selectMenu, setCurrentItem } from '../slices';
5
5
  var CategoryItem = function (_a) {
6
- var item = _a.item, favorite = _a.favorite, allergenAlerts = _a.allergenAlerts, navigate = _a.navigate, children = _a.children;
6
+ var item = _a.item, favorite = _a.favorite, allergenAlerts = _a.allergenAlerts, placeholder = _a.placeholder, navigate = _a.navigate, children = _a.children;
7
7
  var dispatch = useAppDispatch();
8
8
  var apiUrl = useAppSelector(selectKioskApi);
9
9
  var categoryItem = useAppSelector(selectKioskConfig).categoryItem;
@@ -21,6 +21,12 @@ var CategoryItem = function (_a) {
21
21
  navigate('/menu/item');
22
22
  };
23
23
  var handlers = { browse: browse };
24
- return children({ item: cartItem, config: categoryItem, handlers: handlers, apiUrl: apiUrl });
24
+ return children({
25
+ item: cartItem,
26
+ config: categoryItem,
27
+ handlers: handlers,
28
+ apiUrl: apiUrl,
29
+ placeholder: placeholder
30
+ });
25
31
  };
26
32
  export default CategoryItem;
@@ -1,7 +1,8 @@
1
1
  import { HeaderProps, SignInButtonProps } from '@open-tender/ui';
2
2
  import React, { ReactNode } from 'react';
3
- declare const Header: ({ to, backAction, pathname, navigate, children, SignInButtonView }: {
3
+ declare const Header: ({ to, backText, backAction, pathname, navigate, children, SignInButtonView }: {
4
4
  to?: string;
5
+ backText?: string;
5
6
  backAction?: () => void;
6
7
  pathname: string;
7
8
  navigate: (route: string) => void;
@@ -3,7 +3,7 @@ import { useAppDispatch, useAppSelector } from '../app/hooks';
3
3
  import { selectKioskConfig, toggleSidebar } from '../slices';
4
4
  import { default as SignInButtonContainer } from './SignInButton';
5
5
  var Header = function (_a) {
6
- var to = _a.to, backAction = _a.backAction, pathname = _a.pathname, navigate = _a.navigate, children = _a.children, SignInButtonView = _a.SignInButtonView;
6
+ var to = _a.to, _b = _a.backText, backText = _b === void 0 ? 'Back' : _b, backAction = _a.backAction, pathname = _a.pathname, navigate = _a.navigate, children = _a.children, SignInButtonView = _a.SignInButtonView;
7
7
  var dispatch = useAppDispatch();
8
8
  var header = (useAppSelector(selectKioskConfig) || {}).header;
9
9
  var showButtons = !!(backAction || to);
@@ -26,6 +26,12 @@ var Header = function (_a) {
26
26
  var renderSignInButton = useCallback(function () { return (React.createElement(SignInButtonContainer, { pathname: pathname, navigate: navigate, children: SignInButtonView })); }, [pathname, navigate, SignInButtonView]);
27
27
  if (!header)
28
28
  return null;
29
- return children({ config: header, handlers: handlers, showButtons: showButtons, renderSignInButton: renderSignInButton });
29
+ return children({
30
+ config: header,
31
+ handlers: handlers,
32
+ showButtons: showButtons,
33
+ backText: backText,
34
+ renderSignInButton: renderSignInButton
35
+ });
30
36
  };
31
37
  export default Header;
@@ -1,11 +1,12 @@
1
1
  import { CartItemGroup, CartItemOption, CartLevels } from '@open-tender/types';
2
2
  import { Handlers, ItemOptionProps } from '@open-tender/ui';
3
3
  import { ReactNode } from 'react';
4
- declare const ItemOption: ({ handlers, group, option, levels, children }: {
4
+ declare const ItemOption: ({ handlers, group, option, levels, placeholder, children }: {
5
5
  handlers: Handlers;
6
6
  group: CartItemGroup;
7
7
  option: CartItemOption;
8
8
  levels: CartLevels;
9
+ placeholder?: string;
9
10
  children: (props: ItemOptionProps) => ReactNode;
10
11
  }) => ReactNode;
11
12
  export default ItemOption;
@@ -2,7 +2,7 @@ import { useModifier } from '@open-tender/utils';
2
2
  import { useAppDispatch, useAppSelector } from '../app/hooks';
3
3
  import { selectKioskApi, selectKioskConfig, setCurrentOption } from '../slices';
4
4
  var ItemOption = function (_a) {
5
- var handlers = _a.handlers, group = _a.group, option = _a.option, levels = _a.levels, children = _a.children;
5
+ var handlers = _a.handlers, group = _a.group, option = _a.option, levels = _a.levels, placeholder = _a.placeholder, children = _a.children;
6
6
  var dispatch = useAppDispatch();
7
7
  var apiUrl = useAppSelector(selectKioskApi);
8
8
  var config = useAppSelector(selectKioskConfig).itemOption;
@@ -25,7 +25,8 @@ var ItemOption = function (_a) {
25
25
  handlers: { showNested: showNested },
26
26
  group: group,
27
27
  option: modifier,
28
- apiUrl: apiUrl
28
+ apiUrl: apiUrl,
29
+ placeholder: placeholder
29
30
  });
30
31
  };
31
32
  export default ItemOption;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "1.1.95",
3
+ "version": "1.1.97",
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.60",
65
- "@open-tender/ui": "^0.3.78",
65
+ "@open-tender/ui": "^0.3.80",
66
66
  "@open-tender/utils": "^0.4.39",
67
67
  "@reduxjs/toolkit": "^2.0.1",
68
68
  "date-fns": "2.30.0",