@open-tender/store 1.1.67 → 1.1.69
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/AccountSection.d.ts +12 -0
- package/dist/cjs/components/AccountSection.js +21 -0
- package/dist/cjs/components/CheckoutContent.d.ts +7 -0
- package/dist/cjs/components/CheckoutContent.js +12 -0
- package/dist/cjs/components/CheckoutFooter.d.ts +9 -0
- package/dist/cjs/components/CheckoutFooter.js +17 -0
- package/dist/cjs/components/CheckoutHeader.d.ts +8 -0
- package/dist/cjs/components/CheckoutHeader.js +16 -0
- package/dist/cjs/components/FavsButton.d.ts +11 -0
- package/dist/cjs/components/FavsButton.js +19 -0
- package/dist/cjs/components/InputButton.d.ts +12 -0
- package/dist/cjs/components/InputButton.js +20 -0
- package/dist/cjs/components/ItemOption.js +2 -3
- package/dist/cjs/components/ItemOptionSelected.js +2 -3
- package/dist/cjs/components/ItemSize.d.ts +9 -0
- package/dist/cjs/components/ItemSize.js +21 -0
- package/dist/cjs/components/OrderCard.js +3 -4
- package/dist/cjs/components/SignInCheckout.d.ts +1 -4
- package/dist/cjs/components/SignInCheckout.js +10 -5
- package/dist/cjs/components/SignInOptions.js +2 -3
- package/dist/cjs/components/index.d.ts +7 -1
- package/dist/cjs/components/index.js +13 -1
- package/dist/esm/components/AccountSection.d.ts +12 -0
- package/dist/esm/components/AccountSection.js +19 -0
- package/dist/esm/components/CheckoutContent.d.ts +7 -0
- package/dist/esm/components/CheckoutContent.js +10 -0
- package/dist/esm/components/CheckoutFooter.d.ts +9 -0
- package/dist/esm/components/CheckoutFooter.js +15 -0
- package/dist/esm/components/CheckoutHeader.d.ts +8 -0
- package/dist/esm/components/CheckoutHeader.js +14 -0
- package/dist/esm/components/FavsButton.d.ts +11 -0
- package/dist/esm/components/FavsButton.js +17 -0
- package/dist/esm/components/InputButton.d.ts +12 -0
- package/dist/esm/components/InputButton.js +18 -0
- package/dist/esm/components/ItemOption.js +2 -3
- package/dist/esm/components/ItemOptionSelected.js +2 -3
- package/dist/esm/components/ItemSize.d.ts +9 -0
- package/dist/esm/components/ItemSize.js +19 -0
- package/dist/esm/components/OrderCard.js +3 -4
- package/dist/esm/components/SignInCheckout.d.ts +1 -4
- package/dist/esm/components/SignInCheckout.js +11 -6
- package/dist/esm/components/SignInOptions.js +2 -3
- package/dist/esm/components/index.d.ts +7 -1
- package/dist/esm/components/index.js +7 -1
- package/package.json +2 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AccountSectionProps } from '@open-tender/ui';
|
|
3
|
+
declare const AccountSection: ({ title, subtitle, path, hasMore, navigate, content, children }: {
|
|
4
|
+
title: string;
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
path: string;
|
|
7
|
+
hasMore: boolean;
|
|
8
|
+
navigate: (route: string) => void;
|
|
9
|
+
content: React.ReactNode;
|
|
10
|
+
children: (props: AccountSectionProps) => React.ReactNode;
|
|
11
|
+
}) => import("react").ReactNode;
|
|
12
|
+
export default AccountSection;
|
|
@@ -0,0 +1,21 @@
|
|
|
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 AccountSection = function (_a) {
|
|
6
|
+
var title = _a.title, subtitle = _a.subtitle, path = _a.path, hasMore = _a.hasMore, navigate = _a.navigate, content = _a.content, children = _a.children;
|
|
7
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).accountSection;
|
|
8
|
+
var view = function () { return navigate(path); };
|
|
9
|
+
var handlers = { view: view };
|
|
10
|
+
if (!config)
|
|
11
|
+
return null;
|
|
12
|
+
return children({
|
|
13
|
+
config: config,
|
|
14
|
+
handlers: handlers,
|
|
15
|
+
hasMore: hasMore,
|
|
16
|
+
title: title,
|
|
17
|
+
subtitle: subtitle,
|
|
18
|
+
children: content
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
exports.default = AccountSection;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CheckoutContentProps } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const CheckoutContent: ({ children, content }: {
|
|
4
|
+
children: (props: CheckoutContentProps) => ReactNode;
|
|
5
|
+
content: ReactNode;
|
|
6
|
+
}) => ReactNode;
|
|
7
|
+
export default CheckoutContent;
|
|
@@ -0,0 +1,12 @@
|
|
|
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 CheckoutContent = function (_a) {
|
|
6
|
+
var children = _a.children, content = _a.content;
|
|
7
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).checkoutContent;
|
|
8
|
+
if (!config)
|
|
9
|
+
return null;
|
|
10
|
+
return children({ config: config, children: content });
|
|
11
|
+
};
|
|
12
|
+
exports.default = CheckoutContent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Handlers, CheckoutFooterProps } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const CheckoutFooter: ({ handlers, backTitle, proceedTitle, children }: {
|
|
4
|
+
handlers: Handlers;
|
|
5
|
+
backTitle: string;
|
|
6
|
+
proceedTitle?: string;
|
|
7
|
+
children: (props: CheckoutFooterProps) => ReactNode;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
export default CheckoutFooter;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 CheckoutFooter = function (_a) {
|
|
6
|
+
var handlers = _a.handlers, backTitle = _a.backTitle, proceedTitle = _a.proceedTitle, children = _a.children;
|
|
7
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).checkoutFooter;
|
|
8
|
+
if (!config)
|
|
9
|
+
return null;
|
|
10
|
+
return children({
|
|
11
|
+
config: config,
|
|
12
|
+
handlers: handlers,
|
|
13
|
+
backTitle: backTitle,
|
|
14
|
+
proceedTitle: proceedTitle
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
exports.default = CheckoutFooter;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CheckoutHeaderProps } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const CheckoutHeader: ({ title, subtitle, children }: {
|
|
4
|
+
title: string;
|
|
5
|
+
subtitle?: string | null;
|
|
6
|
+
children: (props: CheckoutHeaderProps) => ReactNode;
|
|
7
|
+
}) => ReactNode;
|
|
8
|
+
export default CheckoutHeader;
|
|
@@ -0,0 +1,16 @@
|
|
|
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 CheckoutHeader = function (_a) {
|
|
6
|
+
var title = _a.title, subtitle = _a.subtitle, children = _a.children;
|
|
7
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).checkoutHeader;
|
|
8
|
+
if (!config)
|
|
9
|
+
return null;
|
|
10
|
+
return children({
|
|
11
|
+
config: config,
|
|
12
|
+
title: title,
|
|
13
|
+
subtitle: subtitle
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
exports.default = CheckoutHeader;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MenuItem } from '@open-tender/types';
|
|
2
|
+
import { FavsButtonProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const FavsButton: ({ title, path, item, navigate, children }: {
|
|
5
|
+
title: string;
|
|
6
|
+
path: string;
|
|
7
|
+
item: MenuItem;
|
|
8
|
+
navigate: (route: string) => void;
|
|
9
|
+
children: (props: FavsButtonProps) => ReactNode;
|
|
10
|
+
}) => ReactNode;
|
|
11
|
+
export default FavsButton;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var hooks_1 = require("../app/hooks");
|
|
4
|
+
var hooks_2 = require("../hooks");
|
|
5
|
+
var slices_1 = require("../slices");
|
|
6
|
+
var FavsButton = function (_a) {
|
|
7
|
+
var title = _a.title, path = _a.path, item = _a.item, navigate = _a.navigate, children = _a.children;
|
|
8
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).favsButton;
|
|
9
|
+
var imageUrl = (0, hooks_2.useKioskImageUrl)(item);
|
|
10
|
+
var browse = function () { return navigate(path); };
|
|
11
|
+
var handlers = { browse: browse };
|
|
12
|
+
return children({
|
|
13
|
+
config: config,
|
|
14
|
+
handlers: handlers,
|
|
15
|
+
title: title,
|
|
16
|
+
imageUrl: imageUrl
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
exports.default = FavsButton;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InputButtonProps, Styles } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const InputButton: ({ label, value, open, isRequired, style, labelStyle, children }: {
|
|
4
|
+
label?: string;
|
|
5
|
+
value: string;
|
|
6
|
+
open: () => void;
|
|
7
|
+
isRequired?: boolean;
|
|
8
|
+
style?: Styles;
|
|
9
|
+
labelStyle?: Styles;
|
|
10
|
+
children: (props: InputButtonProps) => ReactNode;
|
|
11
|
+
}) => ReactNode;
|
|
12
|
+
export default InputButton;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 InputButton = function (_a) {
|
|
6
|
+
var label = _a.label, value = _a.value, open = _a.open, isRequired = _a.isRequired, style = _a.style, labelStyle = _a.labelStyle, children = _a.children;
|
|
7
|
+
var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), config = _b.inputButton, labelConfig = _b.label;
|
|
8
|
+
var handlers = { open: open };
|
|
9
|
+
return children({
|
|
10
|
+
config: config,
|
|
11
|
+
labelConfig: labelConfig,
|
|
12
|
+
handlers: handlers,
|
|
13
|
+
label: label,
|
|
14
|
+
value: value,
|
|
15
|
+
isRequired: isRequired,
|
|
16
|
+
style: style,
|
|
17
|
+
labelStyle: labelStyle
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
exports.default = InputButton;
|
|
@@ -6,7 +6,7 @@ var slices_1 = require("../slices");
|
|
|
6
6
|
var ItemOption = function (_a) {
|
|
7
7
|
var handlers = _a.handlers, group = _a.group, option = _a.option, levels = _a.levels, children = _a.children, apiUrl = _a.apiUrl;
|
|
8
8
|
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
9
|
-
var
|
|
9
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).itemOption;
|
|
10
10
|
var toggleOption = handlers.toggleOption, incrementOption = handlers.incrementOption, decrementOption = handlers.decrementOption, setOptionQuantity = handlers.setOptionQuantity;
|
|
11
11
|
var allergenAlerts = [];
|
|
12
12
|
var modifier = (0, utils_1.useModifier)(group, option, levels, toggleOption, incrementOption, decrementOption, setOptionQuantity, allergenAlerts);
|
|
@@ -19,14 +19,13 @@ var ItemOption = function (_a) {
|
|
|
19
19
|
};
|
|
20
20
|
dispatch((0, slices_1.setCurrentOption)(currentOption));
|
|
21
21
|
};
|
|
22
|
-
if (!config
|
|
22
|
+
if (!config)
|
|
23
23
|
return null;
|
|
24
24
|
return children({
|
|
25
25
|
config: config,
|
|
26
26
|
handlers: { showNested: showNested },
|
|
27
27
|
group: group,
|
|
28
28
|
option: modifier,
|
|
29
|
-
cardConfig: cardConfig,
|
|
30
29
|
apiUrl: apiUrl
|
|
31
30
|
});
|
|
32
31
|
};
|
|
@@ -6,7 +6,7 @@ var slices_1 = require("../slices");
|
|
|
6
6
|
var ItemOptionSelected = function (_a) {
|
|
7
7
|
var handlers = _a.handlers, group = _a.group, option = _a.option, levels = _a.levels, children = _a.children, apiUrl = _a.apiUrl;
|
|
8
8
|
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
9
|
-
var
|
|
9
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).itemOptionSelected;
|
|
10
10
|
var toggleOption = handlers.toggleOption, incrementOption = handlers.incrementOption, decrementOption = handlers.decrementOption, setOptionQuantity = handlers.setOptionQuantity;
|
|
11
11
|
var allergenAlerts = [];
|
|
12
12
|
var modifier = (0, utils_1.useModifier)(group, option, levels, toggleOption, incrementOption, decrementOption, setOptionQuantity, allergenAlerts);
|
|
@@ -19,14 +19,13 @@ var ItemOptionSelected = function (_a) {
|
|
|
19
19
|
};
|
|
20
20
|
dispatch((0, slices_1.setCurrentOption)(currentOption));
|
|
21
21
|
};
|
|
22
|
-
if (!config
|
|
22
|
+
if (!config)
|
|
23
23
|
return null;
|
|
24
24
|
return children({
|
|
25
25
|
config: config,
|
|
26
26
|
handlers: { showNested: showNested },
|
|
27
27
|
group: group,
|
|
28
28
|
option: modifier,
|
|
29
|
-
cardConfig: cardConfig,
|
|
30
29
|
apiUrl: apiUrl
|
|
31
30
|
});
|
|
32
31
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CartItemGroup } from '@open-tender/types';
|
|
2
|
+
import { ItemSizeProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const ItemSize: ({ sizeGroup, toggleSize, children }: {
|
|
5
|
+
sizeGroup?: CartItemGroup | null;
|
|
6
|
+
toggleSize: (optionId: number) => void;
|
|
7
|
+
children: (props: ItemSizeProps) => ReactNode;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
export default ItemSize;
|
|
@@ -0,0 +1,21 @@
|
|
|
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 ItemSize = function (_a) {
|
|
6
|
+
var _b;
|
|
7
|
+
var sizeGroup = _a.sizeGroup, toggleSize = _a.toggleSize, children = _a.children;
|
|
8
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).itemSize;
|
|
9
|
+
var appliedOption = (_b = sizeGroup === null || sizeGroup === void 0 ? void 0 : sizeGroup.options) === null || _b === void 0 ? void 0 : _b.find(function (i) { return i.quantity > 0; });
|
|
10
|
+
var appliedId = (appliedOption === null || appliedOption === void 0 ? void 0 : appliedOption.id) || null;
|
|
11
|
+
var handlers = { toggleSize: toggleSize };
|
|
12
|
+
if (!config || !sizeGroup)
|
|
13
|
+
return null;
|
|
14
|
+
return children({
|
|
15
|
+
config: config,
|
|
16
|
+
handlers: handlers,
|
|
17
|
+
sizeGroup: sizeGroup,
|
|
18
|
+
appliedId: appliedId
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
exports.default = ItemSize;
|
|
@@ -11,10 +11,10 @@ var OrderCard = function (_a) {
|
|
|
11
11
|
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
12
12
|
var _b = (0, react_1.useState)(null), errMsg = _b[0], setErrMsg = _b[1];
|
|
13
13
|
var _c = (0, react_1.useState)(false), isReordering = _c[0], setIsReordering = _c[1];
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).orderCard;
|
|
15
|
+
var _d = (0, hooks_1.useAppSelector)(slices_1.selectOrder), loading = _d.loading, error = _d.error;
|
|
16
16
|
var isLoading = loading === 'pending';
|
|
17
|
-
var
|
|
17
|
+
var _e = (0, hooks_2.useOrder)(order), itemImages = _e.itemImages, itemNames = _e.itemNames, orderNo = _e.orderNo, title = _e.title, subtitle = _e.subtitle;
|
|
18
18
|
var view = function () {
|
|
19
19
|
dispatch((0, slices_1.openModal)({ type: 'ORDER_DETAILS', args: { order: order } }));
|
|
20
20
|
};
|
|
@@ -43,7 +43,6 @@ var OrderCard = function (_a) {
|
|
|
43
43
|
handlers: handlers,
|
|
44
44
|
isReordering: isReordering,
|
|
45
45
|
errMsg: errMsg,
|
|
46
|
-
cardConfig: cardConfig,
|
|
47
46
|
subtitle: subtitle,
|
|
48
47
|
title: title,
|
|
49
48
|
orderNo: orderNo,
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { KioskSignInType } from '@open-tender/types';
|
|
2
1
|
import { SignInCheckoutProps } from '@open-tender/ui';
|
|
3
2
|
import { ReactNode } from 'react';
|
|
4
|
-
declare const SignInCheckout: ({
|
|
5
|
-
setSignInType: (signInType: KioskSignInType) => void;
|
|
6
|
-
navigate: (route: string) => void;
|
|
3
|
+
declare const SignInCheckout: ({ children }: {
|
|
7
4
|
children: (props: SignInCheckoutProps) => ReactNode;
|
|
8
5
|
}) => ReactNode;
|
|
9
6
|
export default SignInCheckout;
|
|
@@ -13,19 +13,20 @@ var endpoints = [
|
|
|
13
13
|
'REWARDS'
|
|
14
14
|
];
|
|
15
15
|
var SignInCheckout = function (_a) {
|
|
16
|
-
var
|
|
16
|
+
var children = _a.children;
|
|
17
17
|
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
18
18
|
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).signInCheckout;
|
|
19
19
|
var customer = (0, hooks_1.useAppSelector)(slices_1.selectCustomerIdentified);
|
|
20
20
|
var customerId = ((customer === null || customer === void 0 ? void 0 : customer.customer) || {}).customer_id;
|
|
21
|
+
var signIn = function () {
|
|
22
|
+
dispatch((0, slices_1.openModal)({ type: 'SIGN_IN' }));
|
|
23
|
+
};
|
|
21
24
|
var signOut = function () {
|
|
22
25
|
dispatch((0, slices_1.resetCustomerIdentify)());
|
|
23
26
|
dispatch((0, slices_1.resetCustomer)());
|
|
24
27
|
dispatch((0, slices_1.resetMenu)());
|
|
25
|
-
setSignInType(null);
|
|
26
28
|
};
|
|
27
|
-
var
|
|
28
|
-
var handlers = { setSignInType: setSignInType, goToAccount: goToAccount, signOut: signOut };
|
|
29
|
+
var handlers = { signIn: signIn, signOut: signOut };
|
|
29
30
|
(0, react_1.useEffect)(function () {
|
|
30
31
|
if (customerId) {
|
|
31
32
|
dispatch((0, slices_1.fetchCustomer)({ customerId: customerId, endpoints: endpoints }));
|
|
@@ -33,6 +34,10 @@ var SignInCheckout = function (_a) {
|
|
|
33
34
|
}, [dispatch, customerId]);
|
|
34
35
|
if (!config)
|
|
35
36
|
return null;
|
|
36
|
-
return children({
|
|
37
|
+
return children({
|
|
38
|
+
config: config,
|
|
39
|
+
handlers: handlers,
|
|
40
|
+
customer: customer
|
|
41
|
+
});
|
|
37
42
|
};
|
|
38
43
|
exports.default = SignInCheckout;
|
|
@@ -8,8 +8,8 @@ var SignInPhone_1 = tslib_1.__importDefault(require("./SignInPhone"));
|
|
|
8
8
|
var SignInQr_1 = tslib_1.__importDefault(require("./SignInQr"));
|
|
9
9
|
var SignInOptions = function (_a) {
|
|
10
10
|
var listener = _a.listener, cameraScanner = _a.cameraScanner, close = _a.close, children = _a.children, SignInQrView = _a.SignInQrView, SignInPhoneView = _a.SignInPhoneView, KeypadView = _a.KeypadView, ErrorMessageView = _a.ErrorMessageView;
|
|
11
|
-
var
|
|
12
|
-
var
|
|
11
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).signInOptions;
|
|
12
|
+
var _b = (0, react_1.useState)(null), signInType = _b[0], setSignInType = _b[1];
|
|
13
13
|
var terminal = (0, hooks_1.useAppSelector)(slices_1.selectKioskTerminal);
|
|
14
14
|
// @ts-ignore
|
|
15
15
|
// TODO: fix typescript errors
|
|
@@ -23,7 +23,6 @@ var SignInOptions = function (_a) {
|
|
|
23
23
|
config: config,
|
|
24
24
|
handlers: handlers,
|
|
25
25
|
signInType: signInType,
|
|
26
|
-
modalContentConfig: modalContentConfig,
|
|
27
26
|
renderSignInQr: renderSignInQr,
|
|
28
27
|
renderSignInPhone: renderSignInPhone
|
|
29
28
|
});
|
|
@@ -10,18 +10,24 @@ import CategoryNav from './CategoryNav';
|
|
|
10
10
|
import CategoryNavItem from './CategoryNavItem';
|
|
11
11
|
import CategoryNavOther from './CategoryNavOther';
|
|
12
12
|
import CheckoutCart from './CheckoutCart';
|
|
13
|
+
import CheckoutContent from './CheckoutContent';
|
|
14
|
+
import CheckoutFooter from './CheckoutFooter';
|
|
15
|
+
import CheckoutHeader from './CheckoutHeader';
|
|
13
16
|
import CheckoutTotals from './CheckoutTotals';
|
|
14
17
|
import CheckTotals from './CheckTotals';
|
|
15
18
|
import Discount from './Discount';
|
|
16
19
|
import ErrorMessage from './ErrorMessage';
|
|
20
|
+
import FavsButton from './FavsButton';
|
|
17
21
|
import Header from './Header';
|
|
18
22
|
import Ingredients from './Ingredients';
|
|
19
23
|
import Input from './Input';
|
|
24
|
+
import InputButton from './InputButton';
|
|
20
25
|
import ItemGroup from './ItemGroup';
|
|
21
26
|
import ItemGroups from './ItemGroups';
|
|
22
27
|
import ItemOption from './ItemOption';
|
|
23
28
|
import ItemOptionSelected from './ItemOptionSelected';
|
|
24
29
|
import ItemSelections from './ItemSelections';
|
|
30
|
+
import ItemSize from './ItemSize';
|
|
25
31
|
import Keypad from './Keypad';
|
|
26
32
|
import Loader from './Loader';
|
|
27
33
|
import MadeForName from './MadeForName';
|
|
@@ -52,4 +58,4 @@ import Tag from './Tag';
|
|
|
52
58
|
import TextArea from './TextArea';
|
|
53
59
|
import UpsellItem from './UpsellItem';
|
|
54
60
|
import Upsells from './Upsells';
|
|
55
|
-
export { Allergen, Applied, ButtonLink, Card, Cart, CartItem, CartUpsellItem, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, CheckoutCart, CheckoutTotals, CheckTotals, Discount, ErrorMessage, Header, Ingredients, Input, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptions, SignInPhone, SignInQr, SuccessMessage, Tag, TextArea, UpsellItem, Upsells };
|
|
61
|
+
export { Allergen, Applied, ButtonLink, Card, Cart, CartItem, CartUpsellItem, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, CheckoutCart, CheckoutTotals, CheckTotals, Discount, ErrorMessage, Header, Ingredients, Input, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptions, SignInPhone, SignInQr, SuccessMessage, Tag, TextArea, UpsellItem, Upsells, CheckoutContent, InputButton, CheckoutFooter, CheckoutHeader, FavsButton, ItemSize };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SuccessMessage = exports.SignInQr = exports.SignInPhone = exports.SignInOptions = exports.SignInCheckout = exports.SignInButton = exports.SignIn = exports.Rewards = exports.Reward = exports.Quantity = exports.PromoCode = exports.PointsRewards = exports.PointsReward = 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.ItemOptionSelected = exports.ItemOption = exports.ItemGroups = exports.ItemGroup = exports.Input = exports.Ingredients = exports.Header = exports.ErrorMessage = exports.Discount = exports.CheckTotals = exports.CheckoutTotals = exports.CheckoutCart = exports.CategoryNavOther = exports.CategoryNavItem = exports.CategoryNav = exports.CategoryItem = exports.CartUpsellItem = exports.CartItem = exports.Cart = exports.Card = exports.ButtonLink = exports.Applied = exports.Allergen = void 0;
|
|
4
|
-
exports.Upsells = exports.UpsellItem = exports.TextArea = exports.Tag = void 0;
|
|
4
|
+
exports.ItemSize = exports.FavsButton = exports.CheckoutHeader = exports.CheckoutFooter = exports.InputButton = exports.CheckoutContent = exports.Upsells = exports.UpsellItem = exports.TextArea = exports.Tag = void 0;
|
|
5
5
|
var tslib_1 = require("tslib");
|
|
6
6
|
var Allergen_1 = tslib_1.__importDefault(require("./Allergen"));
|
|
7
7
|
exports.Allergen = Allergen_1.default;
|
|
@@ -27,6 +27,12 @@ var CategoryNavOther_1 = tslib_1.__importDefault(require("./CategoryNavOther"));
|
|
|
27
27
|
exports.CategoryNavOther = CategoryNavOther_1.default;
|
|
28
28
|
var CheckoutCart_1 = tslib_1.__importDefault(require("./CheckoutCart"));
|
|
29
29
|
exports.CheckoutCart = CheckoutCart_1.default;
|
|
30
|
+
var CheckoutContent_1 = tslib_1.__importDefault(require("./CheckoutContent"));
|
|
31
|
+
exports.CheckoutContent = CheckoutContent_1.default;
|
|
32
|
+
var CheckoutFooter_1 = tslib_1.__importDefault(require("./CheckoutFooter"));
|
|
33
|
+
exports.CheckoutFooter = CheckoutFooter_1.default;
|
|
34
|
+
var CheckoutHeader_1 = tslib_1.__importDefault(require("./CheckoutHeader"));
|
|
35
|
+
exports.CheckoutHeader = CheckoutHeader_1.default;
|
|
30
36
|
var CheckoutTotals_1 = tslib_1.__importDefault(require("./CheckoutTotals"));
|
|
31
37
|
exports.CheckoutTotals = CheckoutTotals_1.default;
|
|
32
38
|
var CheckTotals_1 = tslib_1.__importDefault(require("./CheckTotals"));
|
|
@@ -35,12 +41,16 @@ var Discount_1 = tslib_1.__importDefault(require("./Discount"));
|
|
|
35
41
|
exports.Discount = Discount_1.default;
|
|
36
42
|
var ErrorMessage_1 = tslib_1.__importDefault(require("./ErrorMessage"));
|
|
37
43
|
exports.ErrorMessage = ErrorMessage_1.default;
|
|
44
|
+
var FavsButton_1 = tslib_1.__importDefault(require("./FavsButton"));
|
|
45
|
+
exports.FavsButton = FavsButton_1.default;
|
|
38
46
|
var Header_1 = tslib_1.__importDefault(require("./Header"));
|
|
39
47
|
exports.Header = Header_1.default;
|
|
40
48
|
var Ingredients_1 = tslib_1.__importDefault(require("./Ingredients"));
|
|
41
49
|
exports.Ingredients = Ingredients_1.default;
|
|
42
50
|
var Input_1 = tslib_1.__importDefault(require("./Input"));
|
|
43
51
|
exports.Input = Input_1.default;
|
|
52
|
+
var InputButton_1 = tslib_1.__importDefault(require("./InputButton"));
|
|
53
|
+
exports.InputButton = InputButton_1.default;
|
|
44
54
|
var ItemGroup_1 = tslib_1.__importDefault(require("./ItemGroup"));
|
|
45
55
|
exports.ItemGroup = ItemGroup_1.default;
|
|
46
56
|
var ItemGroups_1 = tslib_1.__importDefault(require("./ItemGroups"));
|
|
@@ -51,6 +61,8 @@ var ItemOptionSelected_1 = tslib_1.__importDefault(require("./ItemOptionSelected
|
|
|
51
61
|
exports.ItemOptionSelected = ItemOptionSelected_1.default;
|
|
52
62
|
var ItemSelections_1 = tslib_1.__importDefault(require("./ItemSelections"));
|
|
53
63
|
exports.ItemSelections = ItemSelections_1.default;
|
|
64
|
+
var ItemSize_1 = tslib_1.__importDefault(require("./ItemSize"));
|
|
65
|
+
exports.ItemSize = ItemSize_1.default;
|
|
54
66
|
var Keypad_1 = tslib_1.__importDefault(require("./Keypad"));
|
|
55
67
|
exports.Keypad = Keypad_1.default;
|
|
56
68
|
var Loader_1 = tslib_1.__importDefault(require("./Loader"));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AccountSectionProps } from '@open-tender/ui';
|
|
3
|
+
declare const AccountSection: ({ title, subtitle, path, hasMore, navigate, content, children }: {
|
|
4
|
+
title: string;
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
path: string;
|
|
7
|
+
hasMore: boolean;
|
|
8
|
+
navigate: (route: string) => void;
|
|
9
|
+
content: React.ReactNode;
|
|
10
|
+
children: (props: AccountSectionProps) => React.ReactNode;
|
|
11
|
+
}) => import("react").ReactNode;
|
|
12
|
+
export default AccountSection;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig } from '../slices';
|
|
3
|
+
var AccountSection = function (_a) {
|
|
4
|
+
var title = _a.title, subtitle = _a.subtitle, path = _a.path, hasMore = _a.hasMore, navigate = _a.navigate, content = _a.content, children = _a.children;
|
|
5
|
+
var config = useAppSelector(selectKioskConfig).accountSection;
|
|
6
|
+
var view = function () { return navigate(path); };
|
|
7
|
+
var handlers = { view: view };
|
|
8
|
+
if (!config)
|
|
9
|
+
return null;
|
|
10
|
+
return children({
|
|
11
|
+
config: config,
|
|
12
|
+
handlers: handlers,
|
|
13
|
+
hasMore: hasMore,
|
|
14
|
+
title: title,
|
|
15
|
+
subtitle: subtitle,
|
|
16
|
+
children: content
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
export default AccountSection;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CheckoutContentProps } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const CheckoutContent: ({ children, content }: {
|
|
4
|
+
children: (props: CheckoutContentProps) => ReactNode;
|
|
5
|
+
content: ReactNode;
|
|
6
|
+
}) => ReactNode;
|
|
7
|
+
export default CheckoutContent;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig } from '../slices';
|
|
3
|
+
var CheckoutContent = function (_a) {
|
|
4
|
+
var children = _a.children, content = _a.content;
|
|
5
|
+
var config = useAppSelector(selectKioskConfig).checkoutContent;
|
|
6
|
+
if (!config)
|
|
7
|
+
return null;
|
|
8
|
+
return children({ config: config, children: content });
|
|
9
|
+
};
|
|
10
|
+
export default CheckoutContent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Handlers, CheckoutFooterProps } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const CheckoutFooter: ({ handlers, backTitle, proceedTitle, children }: {
|
|
4
|
+
handlers: Handlers;
|
|
5
|
+
backTitle: string;
|
|
6
|
+
proceedTitle?: string;
|
|
7
|
+
children: (props: CheckoutFooterProps) => ReactNode;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
export default CheckoutFooter;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig } from '../slices';
|
|
3
|
+
var CheckoutFooter = function (_a) {
|
|
4
|
+
var handlers = _a.handlers, backTitle = _a.backTitle, proceedTitle = _a.proceedTitle, children = _a.children;
|
|
5
|
+
var config = useAppSelector(selectKioskConfig).checkoutFooter;
|
|
6
|
+
if (!config)
|
|
7
|
+
return null;
|
|
8
|
+
return children({
|
|
9
|
+
config: config,
|
|
10
|
+
handlers: handlers,
|
|
11
|
+
backTitle: backTitle,
|
|
12
|
+
proceedTitle: proceedTitle
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
export default CheckoutFooter;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CheckoutHeaderProps } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const CheckoutHeader: ({ title, subtitle, children }: {
|
|
4
|
+
title: string;
|
|
5
|
+
subtitle?: string | null;
|
|
6
|
+
children: (props: CheckoutHeaderProps) => ReactNode;
|
|
7
|
+
}) => ReactNode;
|
|
8
|
+
export default CheckoutHeader;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig } from '../slices';
|
|
3
|
+
var CheckoutHeader = function (_a) {
|
|
4
|
+
var title = _a.title, subtitle = _a.subtitle, children = _a.children;
|
|
5
|
+
var config = useAppSelector(selectKioskConfig).checkoutHeader;
|
|
6
|
+
if (!config)
|
|
7
|
+
return null;
|
|
8
|
+
return children({
|
|
9
|
+
config: config,
|
|
10
|
+
title: title,
|
|
11
|
+
subtitle: subtitle
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
export default CheckoutHeader;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MenuItem } from '@open-tender/types';
|
|
2
|
+
import { FavsButtonProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const FavsButton: ({ title, path, item, navigate, children }: {
|
|
5
|
+
title: string;
|
|
6
|
+
path: string;
|
|
7
|
+
item: MenuItem;
|
|
8
|
+
navigate: (route: string) => void;
|
|
9
|
+
children: (props: FavsButtonProps) => ReactNode;
|
|
10
|
+
}) => ReactNode;
|
|
11
|
+
export default FavsButton;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { useKioskImageUrl } from '../hooks';
|
|
3
|
+
import { selectKioskConfig } from '../slices';
|
|
4
|
+
var FavsButton = function (_a) {
|
|
5
|
+
var title = _a.title, path = _a.path, item = _a.item, navigate = _a.navigate, children = _a.children;
|
|
6
|
+
var config = useAppSelector(selectKioskConfig).favsButton;
|
|
7
|
+
var imageUrl = useKioskImageUrl(item);
|
|
8
|
+
var browse = function () { return navigate(path); };
|
|
9
|
+
var handlers = { browse: browse };
|
|
10
|
+
return children({
|
|
11
|
+
config: config,
|
|
12
|
+
handlers: handlers,
|
|
13
|
+
title: title,
|
|
14
|
+
imageUrl: imageUrl
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
export default FavsButton;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InputButtonProps, Styles } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const InputButton: ({ label, value, open, isRequired, style, labelStyle, children }: {
|
|
4
|
+
label?: string;
|
|
5
|
+
value: string;
|
|
6
|
+
open: () => void;
|
|
7
|
+
isRequired?: boolean;
|
|
8
|
+
style?: Styles;
|
|
9
|
+
labelStyle?: Styles;
|
|
10
|
+
children: (props: InputButtonProps) => ReactNode;
|
|
11
|
+
}) => ReactNode;
|
|
12
|
+
export default InputButton;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig } from '../slices';
|
|
3
|
+
var InputButton = function (_a) {
|
|
4
|
+
var label = _a.label, value = _a.value, open = _a.open, isRequired = _a.isRequired, style = _a.style, labelStyle = _a.labelStyle, children = _a.children;
|
|
5
|
+
var _b = useAppSelector(selectKioskConfig), config = _b.inputButton, labelConfig = _b.label;
|
|
6
|
+
var handlers = { open: open };
|
|
7
|
+
return children({
|
|
8
|
+
config: config,
|
|
9
|
+
labelConfig: labelConfig,
|
|
10
|
+
handlers: handlers,
|
|
11
|
+
label: label,
|
|
12
|
+
value: value,
|
|
13
|
+
isRequired: isRequired,
|
|
14
|
+
style: style,
|
|
15
|
+
labelStyle: labelStyle
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
export default InputButton;
|
|
@@ -4,7 +4,7 @@ import { selectKioskConfig, setCurrentOption } from '../slices';
|
|
|
4
4
|
var ItemOption = function (_a) {
|
|
5
5
|
var handlers = _a.handlers, group = _a.group, option = _a.option, levels = _a.levels, children = _a.children, apiUrl = _a.apiUrl;
|
|
6
6
|
var dispatch = useAppDispatch();
|
|
7
|
-
var
|
|
7
|
+
var config = useAppSelector(selectKioskConfig).itemOption;
|
|
8
8
|
var toggleOption = handlers.toggleOption, incrementOption = handlers.incrementOption, decrementOption = handlers.decrementOption, setOptionQuantity = handlers.setOptionQuantity;
|
|
9
9
|
var allergenAlerts = [];
|
|
10
10
|
var modifier = useModifier(group, option, levels, toggleOption, incrementOption, decrementOption, setOptionQuantity, allergenAlerts);
|
|
@@ -17,14 +17,13 @@ var ItemOption = function (_a) {
|
|
|
17
17
|
};
|
|
18
18
|
dispatch(setCurrentOption(currentOption));
|
|
19
19
|
};
|
|
20
|
-
if (!config
|
|
20
|
+
if (!config)
|
|
21
21
|
return null;
|
|
22
22
|
return children({
|
|
23
23
|
config: config,
|
|
24
24
|
handlers: { showNested: showNested },
|
|
25
25
|
group: group,
|
|
26
26
|
option: modifier,
|
|
27
|
-
cardConfig: cardConfig,
|
|
28
27
|
apiUrl: apiUrl
|
|
29
28
|
});
|
|
30
29
|
};
|
|
@@ -4,7 +4,7 @@ import { selectKioskConfig, setCurrentOption } from '../slices';
|
|
|
4
4
|
var ItemOptionSelected = function (_a) {
|
|
5
5
|
var handlers = _a.handlers, group = _a.group, option = _a.option, levels = _a.levels, children = _a.children, apiUrl = _a.apiUrl;
|
|
6
6
|
var dispatch = useAppDispatch();
|
|
7
|
-
var
|
|
7
|
+
var config = useAppSelector(selectKioskConfig).itemOptionSelected;
|
|
8
8
|
var toggleOption = handlers.toggleOption, incrementOption = handlers.incrementOption, decrementOption = handlers.decrementOption, setOptionQuantity = handlers.setOptionQuantity;
|
|
9
9
|
var allergenAlerts = [];
|
|
10
10
|
var modifier = useModifier(group, option, levels, toggleOption, incrementOption, decrementOption, setOptionQuantity, allergenAlerts);
|
|
@@ -17,14 +17,13 @@ var ItemOptionSelected = function (_a) {
|
|
|
17
17
|
};
|
|
18
18
|
dispatch(setCurrentOption(currentOption));
|
|
19
19
|
};
|
|
20
|
-
if (!config
|
|
20
|
+
if (!config)
|
|
21
21
|
return null;
|
|
22
22
|
return children({
|
|
23
23
|
config: config,
|
|
24
24
|
handlers: { showNested: showNested },
|
|
25
25
|
group: group,
|
|
26
26
|
option: modifier,
|
|
27
|
-
cardConfig: cardConfig,
|
|
28
27
|
apiUrl: apiUrl
|
|
29
28
|
});
|
|
30
29
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CartItemGroup } from '@open-tender/types';
|
|
2
|
+
import { ItemSizeProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const ItemSize: ({ sizeGroup, toggleSize, children }: {
|
|
5
|
+
sizeGroup?: CartItemGroup | null;
|
|
6
|
+
toggleSize: (optionId: number) => void;
|
|
7
|
+
children: (props: ItemSizeProps) => ReactNode;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
export default ItemSize;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig } from '../slices';
|
|
3
|
+
var ItemSize = function (_a) {
|
|
4
|
+
var _b;
|
|
5
|
+
var sizeGroup = _a.sizeGroup, toggleSize = _a.toggleSize, children = _a.children;
|
|
6
|
+
var config = useAppSelector(selectKioskConfig).itemSize;
|
|
7
|
+
var appliedOption = (_b = sizeGroup === null || sizeGroup === void 0 ? void 0 : sizeGroup.options) === null || _b === void 0 ? void 0 : _b.find(function (i) { return i.quantity > 0; });
|
|
8
|
+
var appliedId = (appliedOption === null || appliedOption === void 0 ? void 0 : appliedOption.id) || null;
|
|
9
|
+
var handlers = { toggleSize: toggleSize };
|
|
10
|
+
if (!config || !sizeGroup)
|
|
11
|
+
return null;
|
|
12
|
+
return children({
|
|
13
|
+
config: config,
|
|
14
|
+
handlers: handlers,
|
|
15
|
+
sizeGroup: sizeGroup,
|
|
16
|
+
appliedId: appliedId
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
export default ItemSize;
|
|
@@ -8,10 +8,10 @@ var OrderCard = function (_a) {
|
|
|
8
8
|
var dispatch = useAppDispatch();
|
|
9
9
|
var _b = useState(null), errMsg = _b[0], setErrMsg = _b[1];
|
|
10
10
|
var _c = useState(false), isReordering = _c[0], setIsReordering = _c[1];
|
|
11
|
-
var
|
|
12
|
-
var
|
|
11
|
+
var config = useAppSelector(selectKioskConfig).orderCard;
|
|
12
|
+
var _d = useAppSelector(selectOrder), loading = _d.loading, error = _d.error;
|
|
13
13
|
var isLoading = loading === 'pending';
|
|
14
|
-
var
|
|
14
|
+
var _e = useOrder(order), itemImages = _e.itemImages, itemNames = _e.itemNames, orderNo = _e.orderNo, title = _e.title, subtitle = _e.subtitle;
|
|
15
15
|
var view = function () {
|
|
16
16
|
dispatch(openModal({ type: 'ORDER_DETAILS', args: { order: order } }));
|
|
17
17
|
};
|
|
@@ -40,7 +40,6 @@ var OrderCard = function (_a) {
|
|
|
40
40
|
handlers: handlers,
|
|
41
41
|
isReordering: isReordering,
|
|
42
42
|
errMsg: errMsg,
|
|
43
|
-
cardConfig: cardConfig,
|
|
44
43
|
subtitle: subtitle,
|
|
45
44
|
title: title,
|
|
46
45
|
orderNo: orderNo,
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { KioskSignInType } from '@open-tender/types';
|
|
2
1
|
import { SignInCheckoutProps } from '@open-tender/ui';
|
|
3
2
|
import { ReactNode } from 'react';
|
|
4
|
-
declare const SignInCheckout: ({
|
|
5
|
-
setSignInType: (signInType: KioskSignInType) => void;
|
|
6
|
-
navigate: (route: string) => void;
|
|
3
|
+
declare const SignInCheckout: ({ children }: {
|
|
7
4
|
children: (props: SignInCheckoutProps) => ReactNode;
|
|
8
5
|
}) => ReactNode;
|
|
9
6
|
export default SignInCheckout;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
3
|
-
import { fetchCustomer, resetCustomer, resetCustomerIdentify, resetMenu, selectCustomerIdentified, selectKioskConfig } from '../slices';
|
|
3
|
+
import { fetchCustomer, openModal, resetCustomer, resetCustomerIdentify, resetMenu, selectCustomerIdentified, selectKioskConfig } from '../slices';
|
|
4
4
|
var endpoints = [
|
|
5
5
|
'ACCOUNT',
|
|
6
6
|
'DEALS',
|
|
@@ -11,19 +11,20 @@ var endpoints = [
|
|
|
11
11
|
'REWARDS'
|
|
12
12
|
];
|
|
13
13
|
var SignInCheckout = function (_a) {
|
|
14
|
-
var
|
|
14
|
+
var children = _a.children;
|
|
15
15
|
var dispatch = useAppDispatch();
|
|
16
16
|
var config = useAppSelector(selectKioskConfig).signInCheckout;
|
|
17
17
|
var customer = useAppSelector(selectCustomerIdentified);
|
|
18
18
|
var customerId = ((customer === null || customer === void 0 ? void 0 : customer.customer) || {}).customer_id;
|
|
19
|
+
var signIn = function () {
|
|
20
|
+
dispatch(openModal({ type: 'SIGN_IN' }));
|
|
21
|
+
};
|
|
19
22
|
var signOut = function () {
|
|
20
23
|
dispatch(resetCustomerIdentify());
|
|
21
24
|
dispatch(resetCustomer());
|
|
22
25
|
dispatch(resetMenu());
|
|
23
|
-
setSignInType(null);
|
|
24
26
|
};
|
|
25
|
-
var
|
|
26
|
-
var handlers = { setSignInType: setSignInType, goToAccount: goToAccount, signOut: signOut };
|
|
27
|
+
var handlers = { signIn: signIn, signOut: signOut };
|
|
27
28
|
useEffect(function () {
|
|
28
29
|
if (customerId) {
|
|
29
30
|
dispatch(fetchCustomer({ customerId: customerId, endpoints: endpoints }));
|
|
@@ -31,6 +32,10 @@ var SignInCheckout = function (_a) {
|
|
|
31
32
|
}, [dispatch, customerId]);
|
|
32
33
|
if (!config)
|
|
33
34
|
return null;
|
|
34
|
-
return children({
|
|
35
|
+
return children({
|
|
36
|
+
config: config,
|
|
37
|
+
handlers: handlers,
|
|
38
|
+
customer: customer
|
|
39
|
+
});
|
|
35
40
|
};
|
|
36
41
|
export default SignInCheckout;
|
|
@@ -5,8 +5,8 @@ import { default as SignInPhoneContainer } from './SignInPhone';
|
|
|
5
5
|
import { default as SignInQrContainer } from './SignInQr';
|
|
6
6
|
var SignInOptions = function (_a) {
|
|
7
7
|
var listener = _a.listener, cameraScanner = _a.cameraScanner, close = _a.close, children = _a.children, SignInQrView = _a.SignInQrView, SignInPhoneView = _a.SignInPhoneView, KeypadView = _a.KeypadView, ErrorMessageView = _a.ErrorMessageView;
|
|
8
|
-
var
|
|
9
|
-
var
|
|
8
|
+
var config = useAppSelector(selectKioskConfig).signInOptions;
|
|
9
|
+
var _b = useState(null), signInType = _b[0], setSignInType = _b[1];
|
|
10
10
|
var terminal = useAppSelector(selectKioskTerminal);
|
|
11
11
|
// @ts-ignore
|
|
12
12
|
// TODO: fix typescript errors
|
|
@@ -20,7 +20,6 @@ var SignInOptions = function (_a) {
|
|
|
20
20
|
config: config,
|
|
21
21
|
handlers: handlers,
|
|
22
22
|
signInType: signInType,
|
|
23
|
-
modalContentConfig: modalContentConfig,
|
|
24
23
|
renderSignInQr: renderSignInQr,
|
|
25
24
|
renderSignInPhone: renderSignInPhone
|
|
26
25
|
});
|
|
@@ -10,18 +10,24 @@ import CategoryNav from './CategoryNav';
|
|
|
10
10
|
import CategoryNavItem from './CategoryNavItem';
|
|
11
11
|
import CategoryNavOther from './CategoryNavOther';
|
|
12
12
|
import CheckoutCart from './CheckoutCart';
|
|
13
|
+
import CheckoutContent from './CheckoutContent';
|
|
14
|
+
import CheckoutFooter from './CheckoutFooter';
|
|
15
|
+
import CheckoutHeader from './CheckoutHeader';
|
|
13
16
|
import CheckoutTotals from './CheckoutTotals';
|
|
14
17
|
import CheckTotals from './CheckTotals';
|
|
15
18
|
import Discount from './Discount';
|
|
16
19
|
import ErrorMessage from './ErrorMessage';
|
|
20
|
+
import FavsButton from './FavsButton';
|
|
17
21
|
import Header from './Header';
|
|
18
22
|
import Ingredients from './Ingredients';
|
|
19
23
|
import Input from './Input';
|
|
24
|
+
import InputButton from './InputButton';
|
|
20
25
|
import ItemGroup from './ItemGroup';
|
|
21
26
|
import ItemGroups from './ItemGroups';
|
|
22
27
|
import ItemOption from './ItemOption';
|
|
23
28
|
import ItemOptionSelected from './ItemOptionSelected';
|
|
24
29
|
import ItemSelections from './ItemSelections';
|
|
30
|
+
import ItemSize from './ItemSize';
|
|
25
31
|
import Keypad from './Keypad';
|
|
26
32
|
import Loader from './Loader';
|
|
27
33
|
import MadeForName from './MadeForName';
|
|
@@ -52,4 +58,4 @@ import Tag from './Tag';
|
|
|
52
58
|
import TextArea from './TextArea';
|
|
53
59
|
import UpsellItem from './UpsellItem';
|
|
54
60
|
import Upsells from './Upsells';
|
|
55
|
-
export { Allergen, Applied, ButtonLink, Card, Cart, CartItem, CartUpsellItem, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, CheckoutCart, CheckoutTotals, CheckTotals, Discount, ErrorMessage, Header, Ingredients, Input, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptions, SignInPhone, SignInQr, SuccessMessage, Tag, TextArea, UpsellItem, Upsells };
|
|
61
|
+
export { Allergen, Applied, ButtonLink, Card, Cart, CartItem, CartUpsellItem, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, CheckoutCart, CheckoutTotals, CheckTotals, Discount, ErrorMessage, Header, Ingredients, Input, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptions, SignInPhone, SignInQr, SuccessMessage, Tag, TextArea, UpsellItem, Upsells, CheckoutContent, InputButton, CheckoutFooter, CheckoutHeader, FavsButton, ItemSize };
|
|
@@ -10,18 +10,24 @@ import CategoryNav from './CategoryNav';
|
|
|
10
10
|
import CategoryNavItem from './CategoryNavItem';
|
|
11
11
|
import CategoryNavOther from './CategoryNavOther';
|
|
12
12
|
import CheckoutCart from './CheckoutCart';
|
|
13
|
+
import CheckoutContent from './CheckoutContent';
|
|
14
|
+
import CheckoutFooter from './CheckoutFooter';
|
|
15
|
+
import CheckoutHeader from './CheckoutHeader';
|
|
13
16
|
import CheckoutTotals from './CheckoutTotals';
|
|
14
17
|
import CheckTotals from './CheckTotals';
|
|
15
18
|
import Discount from './Discount';
|
|
16
19
|
import ErrorMessage from './ErrorMessage';
|
|
20
|
+
import FavsButton from './FavsButton';
|
|
17
21
|
import Header from './Header';
|
|
18
22
|
import Ingredients from './Ingredients';
|
|
19
23
|
import Input from './Input';
|
|
24
|
+
import InputButton from './InputButton';
|
|
20
25
|
import ItemGroup from './ItemGroup';
|
|
21
26
|
import ItemGroups from './ItemGroups';
|
|
22
27
|
import ItemOption from './ItemOption';
|
|
23
28
|
import ItemOptionSelected from './ItemOptionSelected';
|
|
24
29
|
import ItemSelections from './ItemSelections';
|
|
30
|
+
import ItemSize from './ItemSize';
|
|
25
31
|
import Keypad from './Keypad';
|
|
26
32
|
import Loader from './Loader';
|
|
27
33
|
import MadeForName from './MadeForName';
|
|
@@ -52,4 +58,4 @@ import Tag from './Tag';
|
|
|
52
58
|
import TextArea from './TextArea';
|
|
53
59
|
import UpsellItem from './UpsellItem';
|
|
54
60
|
import Upsells from './Upsells';
|
|
55
|
-
export { Allergen, Applied, ButtonLink, Card, Cart, CartItem, CartUpsellItem, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, CheckoutCart, CheckoutTotals, CheckTotals, Discount, ErrorMessage, Header, Ingredients, Input, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptions, SignInPhone, SignInQr, SuccessMessage, Tag, TextArea, UpsellItem, Upsells };
|
|
61
|
+
export { Allergen, Applied, ButtonLink, Card, Cart, CartItem, CartUpsellItem, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, CheckoutCart, CheckoutTotals, CheckTotals, Discount, ErrorMessage, Header, Ingredients, Input, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptions, SignInPhone, SignInQr, SuccessMessage, Tag, TextArea, UpsellItem, Upsells, CheckoutContent, InputButton, CheckoutFooter, CheckoutHeader, FavsButton, ItemSize };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.69",
|
|
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.58",
|
|
65
|
-
"@open-tender/ui": "^0.3.
|
|
65
|
+
"@open-tender/ui": "^0.3.64",
|
|
66
66
|
"@open-tender/utils": "^0.4.31",
|
|
67
67
|
"@reduxjs/toolkit": "^2.0.1",
|
|
68
68
|
"date-fns": "2.30.0",
|