@open-tender/store 0.1.289 → 0.1.291
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/CartButton.d.ts +2 -1
- package/dist/cjs/components/CartButton.js +2 -2
- package/dist/cjs/components/Header.d.ts +3 -1
- package/dist/cjs/components/Header.js +3 -2
- package/dist/esm/components/CartButton.d.ts +2 -1
- package/dist/esm/components/CartButton.js +2 -2
- package/dist/esm/components/Header.d.ts +3 -1
- package/dist/esm/components/Header.js +3 -2
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CartButtonProps } from '@open-tender/ui';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
declare const CartButton: ({ children }: {
|
|
3
|
+
declare const CartButton: ({ children, action }: {
|
|
4
4
|
children: (props: CartButtonProps) => ReactNode;
|
|
5
|
+
action?: () => void;
|
|
5
6
|
}) => ReactNode;
|
|
6
7
|
export default CartButton;
|
|
@@ -4,13 +4,13 @@ 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 CartButton = function (_a) {
|
|
7
|
-
var children = _a.children;
|
|
7
|
+
var children = _a.children, action = _a.action;
|
|
8
8
|
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
9
9
|
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).cartButton;
|
|
10
10
|
var _b = (0, hooks_1.useAppSelector)(slices_1.selectCartTotals), count = _b.count, total = _b.total;
|
|
11
11
|
var cartTotal = (0, utils_1.formatDollars)(total.toString());
|
|
12
12
|
var toggleCart = function () { return dispatch((0, slices_1.toggleCartSummary)()); };
|
|
13
|
-
var handlers = { toggleCart: toggleCart };
|
|
13
|
+
var handlers = { toggleCart: action !== null && action !== void 0 ? action : toggleCart };
|
|
14
14
|
if (!config)
|
|
15
15
|
return null;
|
|
16
16
|
return children({
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { HeaderProps, SignInButtonProps, TagsButtonProps, CartButtonProps, CancelButtonProps, ScreenConfig, Handlers } from '@open-tender/ui';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
|
-
declare const Header: ({ to, backText, backAction, pathname, navigate, children, SignInButtonView, TagsButtonView, CartButton, CancelButton, AccessibilityButton }: {
|
|
3
|
+
declare const Header: ({ to, backText, showImage, backAction, pathname, navigate, children, SignInButtonView, TagsButtonView, CartButton, CancelButton, AccessibilityButton }: {
|
|
4
4
|
to?: string;
|
|
5
5
|
backText?: string;
|
|
6
|
+
showImage?: boolean;
|
|
6
7
|
backAction?: () => void;
|
|
7
8
|
pathname: string;
|
|
8
9
|
navigate: (route: string) => void;
|
|
9
10
|
children: (props: HeaderProps & {
|
|
11
|
+
showImage?: boolean;
|
|
10
12
|
renderCartButton?: () => ReactNode;
|
|
11
13
|
renderCancelButton?: () => ReactNode;
|
|
12
14
|
renderAccessibilityButton?: () => ReactNode;
|
|
@@ -10,11 +10,11 @@ var CartButton_1 = tslib_1.__importDefault(require("./CartButton"));
|
|
|
10
10
|
var SignInButton_1 = tslib_1.__importDefault(require("./SignInButton"));
|
|
11
11
|
var TagsButton_1 = tslib_1.__importDefault(require("./TagsButton"));
|
|
12
12
|
var Header = function (_a) {
|
|
13
|
-
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, TagsButtonView = _a.TagsButtonView, CartButton = _a.CartButton, CancelButton = _a.CancelButton, AccessibilityButton = _a.AccessibilityButton;
|
|
13
|
+
var to = _a.to, _b = _a.backText, backText = _b === void 0 ? 'Back' : _b, _c = _a.showImage, showImage = _c === void 0 ? true : _c, backAction = _a.backAction, pathname = _a.pathname, navigate = _a.navigate, children = _a.children, SignInButtonView = _a.SignInButtonView, TagsButtonView = _a.TagsButtonView, CartButton = _a.CartButton, CancelButton = _a.CancelButton, AccessibilityButton = _a.AccessibilityButton;
|
|
14
14
|
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
15
15
|
var config = ((0, hooks_1.useAppSelector)(slices_1.selectKioskConfig) || {}).header;
|
|
16
16
|
var showButtons = !!(backAction || to);
|
|
17
|
-
var
|
|
17
|
+
var _d = (0, hooks_1.useAppSelector)(slices_1.selectStoreSettings), display_sign_in = _d.display_sign_in, display_allergens = _d.display_allergens, display_tags = _d.display_tags;
|
|
18
18
|
var back = function () {
|
|
19
19
|
if (backAction) {
|
|
20
20
|
backAction();
|
|
@@ -48,6 +48,7 @@ var Header = function (_a) {
|
|
|
48
48
|
config: config,
|
|
49
49
|
handlers: handlers,
|
|
50
50
|
showButtons: showButtons,
|
|
51
|
+
showImage: showImage,
|
|
51
52
|
backText: backText,
|
|
52
53
|
renderSignInButton: display_sign_in ? renderSignInButton : undefined,
|
|
53
54
|
renderTagsButton: TagsButtonView && (display_allergens || display_tags)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CartButtonProps } from '@open-tender/ui';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
declare const CartButton: ({ children }: {
|
|
3
|
+
declare const CartButton: ({ children, action }: {
|
|
4
4
|
children: (props: CartButtonProps) => ReactNode;
|
|
5
|
+
action?: () => void;
|
|
5
6
|
}) => ReactNode;
|
|
6
7
|
export default CartButton;
|
|
@@ -2,13 +2,13 @@ import { formatDollars } from '@open-tender/utils';
|
|
|
2
2
|
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
3
3
|
import { selectCartTotals, selectKioskConfig, toggleCartSummary } from '../slices';
|
|
4
4
|
var CartButton = function (_a) {
|
|
5
|
-
var children = _a.children;
|
|
5
|
+
var children = _a.children, action = _a.action;
|
|
6
6
|
var dispatch = useAppDispatch();
|
|
7
7
|
var config = useAppSelector(selectKioskConfig).cartButton;
|
|
8
8
|
var _b = useAppSelector(selectCartTotals), count = _b.count, total = _b.total;
|
|
9
9
|
var cartTotal = formatDollars(total.toString());
|
|
10
10
|
var toggleCart = function () { return dispatch(toggleCartSummary()); };
|
|
11
|
-
var handlers = { toggleCart: toggleCart };
|
|
11
|
+
var handlers = { toggleCart: action !== null && action !== void 0 ? action : toggleCart };
|
|
12
12
|
if (!config)
|
|
13
13
|
return null;
|
|
14
14
|
return children({
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { HeaderProps, SignInButtonProps, TagsButtonProps, CartButtonProps, CancelButtonProps, ScreenConfig, Handlers } from '@open-tender/ui';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
|
-
declare const Header: ({ to, backText, backAction, pathname, navigate, children, SignInButtonView, TagsButtonView, CartButton, CancelButton, AccessibilityButton }: {
|
|
3
|
+
declare const Header: ({ to, backText, showImage, backAction, pathname, navigate, children, SignInButtonView, TagsButtonView, CartButton, CancelButton, AccessibilityButton }: {
|
|
4
4
|
to?: string;
|
|
5
5
|
backText?: string;
|
|
6
|
+
showImage?: boolean;
|
|
6
7
|
backAction?: () => void;
|
|
7
8
|
pathname: string;
|
|
8
9
|
navigate: (route: string) => void;
|
|
9
10
|
children: (props: HeaderProps & {
|
|
11
|
+
showImage?: boolean;
|
|
10
12
|
renderCartButton?: () => ReactNode;
|
|
11
13
|
renderCancelButton?: () => ReactNode;
|
|
12
14
|
renderAccessibilityButton?: () => ReactNode;
|
|
@@ -7,11 +7,11 @@ import { default as CartButtonContainer } from './CartButton';
|
|
|
7
7
|
import { default as SignInButtonContainer } from './SignInButton';
|
|
8
8
|
import { default as TagsButtonContainer } from './TagsButton';
|
|
9
9
|
var Header = function (_a) {
|
|
10
|
-
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, TagsButtonView = _a.TagsButtonView, CartButton = _a.CartButton, CancelButton = _a.CancelButton, AccessibilityButton = _a.AccessibilityButton;
|
|
10
|
+
var to = _a.to, _b = _a.backText, backText = _b === void 0 ? 'Back' : _b, _c = _a.showImage, showImage = _c === void 0 ? true : _c, backAction = _a.backAction, pathname = _a.pathname, navigate = _a.navigate, children = _a.children, SignInButtonView = _a.SignInButtonView, TagsButtonView = _a.TagsButtonView, CartButton = _a.CartButton, CancelButton = _a.CancelButton, AccessibilityButton = _a.AccessibilityButton;
|
|
11
11
|
var dispatch = useAppDispatch();
|
|
12
12
|
var config = (useAppSelector(selectKioskConfig) || {}).header;
|
|
13
13
|
var showButtons = !!(backAction || to);
|
|
14
|
-
var
|
|
14
|
+
var _d = useAppSelector(selectStoreSettings), display_sign_in = _d.display_sign_in, display_allergens = _d.display_allergens, display_tags = _d.display_tags;
|
|
15
15
|
var back = function () {
|
|
16
16
|
if (backAction) {
|
|
17
17
|
backAction();
|
|
@@ -45,6 +45,7 @@ var Header = function (_a) {
|
|
|
45
45
|
config: config,
|
|
46
46
|
handlers: handlers,
|
|
47
47
|
showButtons: showButtons,
|
|
48
|
+
showImage: showImage,
|
|
48
49
|
backText: backText,
|
|
49
50
|
renderSignInButton: display_sign_in ? renderSignInButton : undefined,
|
|
50
51
|
renderTagsButton: TagsButtonView && (display_allergens || display_tags)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.291",
|
|
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",
|