@open-tender/store 1.1.21 → 1.1.24
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/Keypad.d.ts +10 -0
- package/dist/cjs/components/Keypad.js +16 -0
- package/dist/cjs/components/OrderDetails.d.ts +11 -0
- package/dist/cjs/components/OrderDetails.js +41 -0
- package/dist/cjs/components/OrderDetailsItem.d.ts +9 -0
- package/dist/cjs/components/OrderDetailsItem.js +12 -0
- package/dist/cjs/components/SignInOptions.d.ts +3 -3
- package/dist/cjs/components/SignInOptions.js +2 -2
- package/dist/cjs/components/SignInPhone.d.ts +3 -3
- package/dist/cjs/components/SignInPhone.js +8 -5
- package/dist/cjs/components/index.d.ts +3 -1
- package/dist/cjs/components/index.js +5 -1
- package/dist/cjs/config/index.js +6 -0
- package/dist/cjs/config/orderDetails.d.ts +3 -0
- package/dist/cjs/config/orderDetails.js +106 -0
- package/dist/cjs/config/orderDetailsItem.d.ts +3 -0
- package/dist/cjs/config/orderDetailsItem.js +64 -0
- package/dist/cjs/config/page.d.ts +3 -0
- package/dist/cjs/config/page.js +79 -0
- package/dist/cjs/utils/index.d.ts +1 -0
- package/dist/cjs/utils/index.js +1 -0
- package/dist/cjs/utils/keyboard.d.ts +1 -0
- package/dist/cjs/utils/keyboard.js +14 -0
- package/dist/esm/components/Keypad.d.ts +10 -0
- package/dist/esm/components/Keypad.js +14 -0
- package/dist/esm/components/OrderDetails.d.ts +11 -0
- package/dist/esm/components/OrderDetails.js +38 -0
- package/dist/esm/components/OrderDetailsItem.d.ts +9 -0
- package/dist/esm/components/OrderDetailsItem.js +10 -0
- package/dist/esm/components/SignInOptions.d.ts +3 -3
- package/dist/esm/components/SignInOptions.js +2 -2
- package/dist/esm/components/SignInPhone.d.ts +3 -3
- package/dist/esm/components/SignInPhone.js +10 -7
- package/dist/esm/components/index.d.ts +3 -1
- package/dist/esm/components/index.js +3 -1
- package/dist/esm/config/index.js +6 -0
- package/dist/esm/config/orderDetails.d.ts +3 -0
- package/dist/esm/config/orderDetails.js +104 -0
- package/dist/esm/config/orderDetailsItem.d.ts +3 -0
- package/dist/esm/config/orderDetailsItem.js +62 -0
- package/dist/esm/config/page.d.ts +3 -0
- package/dist/esm/config/page.js +77 -0
- package/dist/esm/utils/index.d.ts +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/keyboard.d.ts +1 -0
- package/dist/esm/utils/keyboard.js +10 -0
- package/package.json +3 -3
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Handlers, KeypadProps, KeypadType } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const Keypad: ({ children, maxLength, type, value, handlers }: {
|
|
4
|
+
children: (props: KeypadProps) => ReactNode;
|
|
5
|
+
maxLength?: number;
|
|
6
|
+
type?: KeypadType;
|
|
7
|
+
value: string;
|
|
8
|
+
handlers: Handlers;
|
|
9
|
+
}) => ReactNode;
|
|
10
|
+
export default Keypad;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var react_1 = require("react");
|
|
4
|
+
var hooks_1 = require("../app/hooks");
|
|
5
|
+
var slices_1 = require("../slices");
|
|
6
|
+
var utils_1 = require("../utils");
|
|
7
|
+
var Keypad = function (_a) {
|
|
8
|
+
var children = _a.children, maxLength = _a.maxLength, type = _a.type, value = _a.value, handlers = _a.handlers;
|
|
9
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).keypad;
|
|
10
|
+
var handleOnKeyPress = (0, react_1.useCallback)(function (key) { return handlers.change((0, utils_1.getKeyboardValue)(key, value, maxLength)); }, [maxLength, value, handlers]);
|
|
11
|
+
var viewHandlers = (0, react_1.useMemo)(function () { return ({ keyPress: handleOnKeyPress }); }, [handleOnKeyPress]);
|
|
12
|
+
if (!config)
|
|
13
|
+
return null;
|
|
14
|
+
return children({ config: config, handlers: viewHandlers, value: value, type: type });
|
|
15
|
+
};
|
|
16
|
+
exports.default = Keypad;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Order } from '@open-tender/types';
|
|
2
|
+
import { CheckTotalsProps, OrderDetailsItemProps, OrderDetailsProps } from '@open-tender/ui';
|
|
3
|
+
import React, { ReactNode } from 'react';
|
|
4
|
+
declare const OrderDetails: ({ apiUrl, order, children, CheckTotalsView, OrderDetailsItemView }: {
|
|
5
|
+
apiUrl: string;
|
|
6
|
+
order: Order;
|
|
7
|
+
children: (props: OrderDetailsProps) => ReactNode;
|
|
8
|
+
CheckTotalsView: (props: CheckTotalsProps) => ReactNode;
|
|
9
|
+
OrderDetailsItemView: (props: OrderDetailsItemProps) => ReactNode;
|
|
10
|
+
}) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
11
|
+
export default OrderDetails;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
var hooks_1 = require("../app/hooks");
|
|
6
|
+
var hooks_2 = require("../hooks");
|
|
7
|
+
var slices_1 = require("../slices");
|
|
8
|
+
var CheckTotals_1 = tslib_1.__importDefault(require("./CheckTotals"));
|
|
9
|
+
var OrderDetailsItem_1 = tslib_1.__importDefault(require("./OrderDetailsItem"));
|
|
10
|
+
var OrderDetails = function (_a) {
|
|
11
|
+
var apiUrl = _a.apiUrl, order = _a.order, children = _a.children, CheckTotalsView = _a.CheckTotalsView, OrderDetailsItemView = _a.OrderDetailsItemView;
|
|
12
|
+
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
13
|
+
var _b = (0, react_1.useState)(null), errMsg = _b[0], setErrMsg = _b[1];
|
|
14
|
+
var _c = (0, react_1.useState)(false), isReordering = _c[0], setIsReordering = _c[1];
|
|
15
|
+
var _d = (0, hooks_2.useOrder)(order), subtitle = _d.title, title = _d.orderNo, requestedAt = _d.requestedAt;
|
|
16
|
+
var _e = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), config = _e.orderDetails, modalContentConfig = _e.modalContent;
|
|
17
|
+
var reorder = function () {
|
|
18
|
+
setErrMsg(null);
|
|
19
|
+
setIsReordering(true);
|
|
20
|
+
dispatch((0, slices_1.reorder)(order.cart));
|
|
21
|
+
};
|
|
22
|
+
var renderCheckTotals = (0, react_1.useCallback)(function () { return react_1.default.createElement(CheckTotals_1.default, { check: order, children: CheckTotalsView }); }, [order, CheckTotalsView]);
|
|
23
|
+
var renderOrderDetailsItem = (0, react_1.useCallback)(function (orderItem) { return (react_1.default.createElement(OrderDetailsItem_1.default, { key: orderItem.id, apiUrl: apiUrl, orderItem: orderItem, children: OrderDetailsItemView })); }, [apiUrl, OrderDetailsItemView]);
|
|
24
|
+
if (!config)
|
|
25
|
+
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
26
|
+
return children({
|
|
27
|
+
config: config,
|
|
28
|
+
modalContentConfig: modalContentConfig,
|
|
29
|
+
renderCheckTotals: renderCheckTotals,
|
|
30
|
+
requestedAt: requestedAt,
|
|
31
|
+
order: order,
|
|
32
|
+
title: title,
|
|
33
|
+
subtitle: subtitle,
|
|
34
|
+
isReordering: isReordering,
|
|
35
|
+
errMsg: errMsg,
|
|
36
|
+
handlers: { reorder: reorder },
|
|
37
|
+
apiUrl: apiUrl,
|
|
38
|
+
renderOrderDetailsItem: renderOrderDetailsItem
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
exports.default = OrderDetails;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OrderItem } from '@open-tender/types';
|
|
2
|
+
import { OrderDetailsItemProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const OrderDetailsItem: ({ apiUrl, orderItem, children }: {
|
|
5
|
+
apiUrl: string;
|
|
6
|
+
orderItem: OrderItem;
|
|
7
|
+
children: (props: OrderDetailsItemProps) => ReactNode;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
export default OrderDetailsItem;
|
|
@@ -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 OrderDetailsItem = function (_a) {
|
|
6
|
+
var apiUrl = _a.apiUrl, orderItem = _a.orderItem, children = _a.children;
|
|
7
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).orderDetailsItem;
|
|
8
|
+
if (!config)
|
|
9
|
+
return null;
|
|
10
|
+
return children({ config: config, orderItem: orderItem, apiUrl: apiUrl });
|
|
11
|
+
};
|
|
12
|
+
exports.default = OrderDetailsItem;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { SignInOptionsProps, SignInQrProps, SignInPhoneProps,
|
|
1
|
+
import { SignInOptionsProps, SignInQrProps, SignInPhoneProps, ErrorMessageProps, KeypadProps } from '@open-tender/ui';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
|
-
declare const SignInOptions: ({ close, children, SignInQrView, SignInPhoneView,
|
|
3
|
+
declare const SignInOptions: ({ close, children, SignInQrView, SignInPhoneView, KeypadView, ErrorMessageView }: {
|
|
4
4
|
close: () => void;
|
|
5
5
|
children: (props: SignInOptionsProps) => ReactNode;
|
|
6
6
|
SignInQrView: (props: SignInQrProps) => ReactNode;
|
|
7
7
|
SignInPhoneView: (props: SignInPhoneProps) => ReactNode;
|
|
8
|
-
|
|
8
|
+
KeypadView: (props: KeypadProps) => ReactNode;
|
|
9
9
|
ErrorMessageView: (props: ErrorMessageProps) => ReactNode;
|
|
10
10
|
}) => React.ReactNode;
|
|
11
11
|
export default SignInOptions;
|
|
@@ -7,12 +7,12 @@ var slices_1 = require("../slices");
|
|
|
7
7
|
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
|
-
var close = _a.close, children = _a.children, SignInQrView = _a.SignInQrView, SignInPhoneView = _a.SignInPhoneView,
|
|
10
|
+
var close = _a.close, children = _a.children, SignInQrView = _a.SignInQrView, SignInPhoneView = _a.SignInPhoneView, KeypadView = _a.KeypadView, ErrorMessageView = _a.ErrorMessageView;
|
|
11
11
|
var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), config = _b.signInOptions, modalContentConfig = _b.modalContent;
|
|
12
12
|
var _c = (0, react_1.useState)(null), signInType = _c[0], setSignInType = _c[1];
|
|
13
13
|
var handlers = { close: close, setSignInType: setSignInType };
|
|
14
14
|
var renderSignInQr = (0, react_1.useCallback)(function (close) { return (react_1.default.createElement(SignInQr_1.default, { close: close, children: SignInQrView })); }, [SignInQrView]);
|
|
15
|
-
var renderSignInPhone = (0, react_1.useCallback)(function (close) { return (react_1.default.createElement(SignInPhone_1.default, { ErrorMessageView: ErrorMessageView,
|
|
15
|
+
var renderSignInPhone = (0, react_1.useCallback)(function (close) { return (react_1.default.createElement(SignInPhone_1.default, { ErrorMessageView: ErrorMessageView, KeypadView: KeypadView, close: close, children: SignInPhoneView })); }, [SignInPhoneView, KeypadView, ErrorMessageView]);
|
|
16
16
|
if (!config)
|
|
17
17
|
return null;
|
|
18
18
|
return children({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SignInPhoneProps,
|
|
1
|
+
import { SignInPhoneProps, ErrorMessageProps, KeypadProps } from '@open-tender/ui';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
|
-
declare const SignInPhone: ({ close, children,
|
|
3
|
+
declare const SignInPhone: ({ close, children, KeypadView, ErrorMessageView }: {
|
|
4
4
|
close: () => void;
|
|
5
5
|
children: (props: SignInPhoneProps) => ReactNode;
|
|
6
|
-
|
|
6
|
+
KeypadView: (props: KeypadProps) => ReactNode;
|
|
7
7
|
ErrorMessageView: (props: ErrorMessageProps) => ReactNode;
|
|
8
8
|
}) => React.ReactNode;
|
|
9
9
|
export default SignInPhone;
|
|
@@ -5,10 +5,11 @@ var utils_1 = require("@open-tender/utils");
|
|
|
5
5
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
var hooks_1 = require("../app/hooks");
|
|
7
7
|
var slices_1 = require("../slices");
|
|
8
|
+
var utils_2 = require("../utils");
|
|
8
9
|
var ErrorMessage_1 = tslib_1.__importDefault(require("./ErrorMessage"));
|
|
9
|
-
var
|
|
10
|
+
var Keypad_1 = tslib_1.__importDefault(require("./Keypad"));
|
|
10
11
|
var SignInPhone = function (_a) {
|
|
11
|
-
var close = _a.close, children = _a.children,
|
|
12
|
+
var close = _a.close, children = _a.children, KeypadView = _a.KeypadView, ErrorMessageView = _a.ErrorMessageView;
|
|
12
13
|
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
13
14
|
var _b = (0, react_1.useState)(''), phone = _b[0], setPhone = _b[1];
|
|
14
15
|
var _c = (0, react_1.useState)(false), submitted = _c[0], setSubmitted = _c[1];
|
|
@@ -40,15 +41,17 @@ var SignInPhone = function (_a) {
|
|
|
40
41
|
if (hasCustomer)
|
|
41
42
|
close();
|
|
42
43
|
}, [hasCustomer, close]);
|
|
43
|
-
var
|
|
44
|
+
var keypadHandlers = (0, react_1.useMemo)(function () { return ({
|
|
45
|
+
change: function (value) { return setPhone((0, utils_2.makePhone)(value)); }
|
|
46
|
+
}); }, []);
|
|
47
|
+
var renderKeypad = (0, react_1.useCallback)(function () { return (react_1.default.createElement(Keypad_1.default, { handlers: keypadHandlers, value: phone, children: KeypadView })); }, [KeypadView, phone, keypadHandlers]);
|
|
44
48
|
var renderErrorMessage = (0, react_1.useCallback)(function (errMsg) { return (react_1.default.createElement(ErrorMessage_1.default, { content: errMsg, children: ErrorMessageView })); }, [ErrorMessageView]);
|
|
45
49
|
return children({
|
|
46
50
|
config: config,
|
|
47
51
|
handlers: handlers,
|
|
48
|
-
phone: phone,
|
|
49
52
|
errMsg: errMsg,
|
|
50
53
|
modalContentConfig: modalContentConfig,
|
|
51
|
-
|
|
54
|
+
renderKeypad: renderKeypad,
|
|
52
55
|
renderErrorMessage: renderErrorMessage
|
|
53
56
|
});
|
|
54
57
|
};
|
|
@@ -28,6 +28,8 @@ import ModalHeader from './ModalHeader';
|
|
|
28
28
|
import NutritionalInfo from './NutritionalInfo';
|
|
29
29
|
import Option from './Option';
|
|
30
30
|
import OrderCard from './OrderCard';
|
|
31
|
+
import OrderDetails from './OrderDetails';
|
|
32
|
+
import OrderDetailsItem from './OrderDetailsItem';
|
|
31
33
|
import PointsReward from './PointsReward';
|
|
32
34
|
import PointsRewards from './PointsRewards';
|
|
33
35
|
import PromoCode from './PromoCode';
|
|
@@ -45,4 +47,4 @@ import Tag from './Tag';
|
|
|
45
47
|
import TextArea from './TextArea';
|
|
46
48
|
import UpsellItem from './UpsellItem';
|
|
47
49
|
import Upsells from './Upsells';
|
|
48
|
-
export { Allergen, Applied, ButtonLink, Card, Cart, CartItem, CartUpsellItem, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, CheckTotals, Discount, ErrorMessage, Header, Ingredients, Input, ItemGroup, ItemGroups, ItemOption, ItemSelections, Loader, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptions, SignInPhone, SignInQr, SuccessMessage, Tag, TextArea, UpsellItem, Upsells };
|
|
50
|
+
export { Allergen, Applied, ButtonLink, Card, Cart, CartItem, CartUpsellItem, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, CheckTotals, Discount, ErrorMessage, Header, Ingredients, Input, ItemGroup, ItemGroups, ItemOption, ItemSelections, Loader, 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 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Upsells = exports.UpsellItem = exports.TextArea = exports.Tag = 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.OrderCard = exports.Option = exports.NutritionalInfo = exports.ModalHeader = exports.ModalContent = exports.MenuOther = exports.MenuCategory = exports.MadeForNotes = exports.Loader = exports.ItemSelections = exports.ItemOption = exports.ItemGroups = exports.ItemGroup = exports.Input = exports.Ingredients = exports.Header = exports.ErrorMessage = exports.Discount = exports.CheckTotals = exports.CategoryNavOther = exports.CategoryNavItem = exports.CategoryNav = exports.CategoryItem = exports.CartUpsellItem = exports.CartItem = exports.Cart = exports.Card = exports.ButtonLink = exports.Applied = exports.Allergen = void 0;
|
|
3
|
+
exports.Upsells = exports.UpsellItem = exports.TextArea = exports.Tag = 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.Loader = exports.ItemSelections = exports.ItemOption = exports.ItemGroups = exports.ItemGroup = exports.Input = exports.Ingredients = exports.Header = exports.ErrorMessage = exports.Discount = exports.CheckTotals = 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
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var Allergen_1 = tslib_1.__importDefault(require("./Allergen"));
|
|
6
6
|
exports.Allergen = Allergen_1.default;
|
|
@@ -62,6 +62,10 @@ var Option_1 = tslib_1.__importDefault(require("./Option"));
|
|
|
62
62
|
exports.Option = Option_1.default;
|
|
63
63
|
var OrderCard_1 = tslib_1.__importDefault(require("./OrderCard"));
|
|
64
64
|
exports.OrderCard = OrderCard_1.default;
|
|
65
|
+
var OrderDetails_1 = tslib_1.__importDefault(require("./OrderDetails"));
|
|
66
|
+
exports.OrderDetails = OrderDetails_1.default;
|
|
67
|
+
var OrderDetailsItem_1 = tslib_1.__importDefault(require("./OrderDetailsItem"));
|
|
68
|
+
exports.OrderDetailsItem = OrderDetailsItem_1.default;
|
|
65
69
|
var PointsReward_1 = tslib_1.__importDefault(require("./PointsReward"));
|
|
66
70
|
exports.PointsReward = PointsReward_1.default;
|
|
67
71
|
var PointsRewards_1 = tslib_1.__importDefault(require("./PointsRewards"));
|
package/dist/cjs/config/index.js
CHANGED
|
@@ -48,6 +48,9 @@ var modalHeader_1 = tslib_1.__importDefault(require("./modalHeader"));
|
|
|
48
48
|
var nutritionalInfo_1 = tslib_1.__importDefault(require("./nutritionalInfo"));
|
|
49
49
|
var option_1 = tslib_1.__importDefault(require("./option"));
|
|
50
50
|
var orderCard_1 = tslib_1.__importDefault(require("./orderCard"));
|
|
51
|
+
var orderDetails_1 = tslib_1.__importDefault(require("./orderDetails"));
|
|
52
|
+
var orderDetailsItem_1 = tslib_1.__importDefault(require("./orderDetailsItem"));
|
|
53
|
+
var page_1 = tslib_1.__importDefault(require("./page"));
|
|
51
54
|
var pointsReward_1 = tslib_1.__importDefault(require("./pointsReward"));
|
|
52
55
|
var pointsRewards_1 = tslib_1.__importDefault(require("./pointsRewards"));
|
|
53
56
|
var promoCode_1 = tslib_1.__importDefault(require("./promoCode"));
|
|
@@ -113,6 +116,9 @@ var config = {
|
|
|
113
116
|
nutritionalInfo: nutritionalInfo_1.default,
|
|
114
117
|
option: option_1.default,
|
|
115
118
|
orderCard: orderCard_1.default,
|
|
119
|
+
orderDetails: orderDetails_1.default,
|
|
120
|
+
orderDetailsItem: orderDetailsItem_1.default,
|
|
121
|
+
page: page_1.default,
|
|
116
122
|
pointsReward: pointsReward_1.default,
|
|
117
123
|
pointsRewards: pointsRewards_1.default,
|
|
118
124
|
promoCode: promoCode_1.default,
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var styles_1 = tslib_1.__importDefault(require("../styles"));
|
|
5
|
+
var utils_1 = require("../utils");
|
|
6
|
+
var orderDetails = {
|
|
7
|
+
orderDetails__totalsContainer: {
|
|
8
|
+
classes: '',
|
|
9
|
+
props: {},
|
|
10
|
+
style: {
|
|
11
|
+
width: '100%'
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
orderDetails__orderNumber: {
|
|
15
|
+
classes: '',
|
|
16
|
+
props: {},
|
|
17
|
+
style: tslib_1.__assign(tslib_1.__assign({}, styles_1.default.textHeadline), { fontSize: utils_1.theme.fontSizes.xsmall, textTransform: 'uppercase', textAlign: 'center' })
|
|
18
|
+
},
|
|
19
|
+
orderDetails__orderTitle: {
|
|
20
|
+
classes: '',
|
|
21
|
+
props: {},
|
|
22
|
+
style: tslib_1.__assign(tslib_1.__assign({}, styles_1.default.textHeading), { fontSize: utils_1.theme.fontSizes.xxlarge, textAlign: 'center' })
|
|
23
|
+
},
|
|
24
|
+
orderDetails__buttonsContainer: {
|
|
25
|
+
classes: '',
|
|
26
|
+
props: {},
|
|
27
|
+
style: {
|
|
28
|
+
width: '100%',
|
|
29
|
+
justifyContent: 'center',
|
|
30
|
+
flexDirection: 'row',
|
|
31
|
+
gap: utils_1.theme.spacing.margin.small,
|
|
32
|
+
marginBottom: utils_1.theme.spacing.margin.large
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
orderDetails__reorderButton: {
|
|
36
|
+
classes: '',
|
|
37
|
+
props: {},
|
|
38
|
+
style: tslib_1.__assign(tslib_1.__assign({}, styles_1.default.buttonPrimary), { fontSize: utils_1.theme.fontSizes.small })
|
|
39
|
+
},
|
|
40
|
+
orderDetails__rateOrderButton: {
|
|
41
|
+
classes: '',
|
|
42
|
+
props: {},
|
|
43
|
+
style: tslib_1.__assign(tslib_1.__assign({}, styles_1.default.buttonSecondary), { fontSize: utils_1.theme.fontSizes.small })
|
|
44
|
+
},
|
|
45
|
+
orderDetails__summary: {
|
|
46
|
+
classes: '',
|
|
47
|
+
props: {},
|
|
48
|
+
style: {
|
|
49
|
+
width: '100%',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
marginBottom: utils_1.theme.spacing.margin.large
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
orderDetails__summaryItem: {
|
|
55
|
+
classes: '',
|
|
56
|
+
props: {},
|
|
57
|
+
style: {
|
|
58
|
+
width: '100%',
|
|
59
|
+
flexDirection: 'row',
|
|
60
|
+
alignItems: 'center'
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
orderDetails__divider: {
|
|
64
|
+
classes: '',
|
|
65
|
+
props: {},
|
|
66
|
+
style: {
|
|
67
|
+
width: '100%',
|
|
68
|
+
height: 0.5,
|
|
69
|
+
backgroundColor: utils_1.theme.colors.text.primary,
|
|
70
|
+
marginTop: utils_1.theme.spacing.margin.small,
|
|
71
|
+
marginBottom: utils_1.theme.spacing.margin.small
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
orderDetails__summaryLabel: {
|
|
75
|
+
classes: '',
|
|
76
|
+
props: {},
|
|
77
|
+
style: tslib_1.__assign(tslib_1.__assign({ width: '35%' }, styles_1.default.textHeadline), { fontSize: utils_1.theme.fontSizes.xxxsmall, textTransform: 'uppercase' })
|
|
78
|
+
},
|
|
79
|
+
orderDetails__summaryValuesContainer: {
|
|
80
|
+
classes: '',
|
|
81
|
+
props: {},
|
|
82
|
+
style: {
|
|
83
|
+
flexGrow: 1,
|
|
84
|
+
gap: 5
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
orderDetails__summaryValue: {
|
|
88
|
+
classes: '',
|
|
89
|
+
props: {},
|
|
90
|
+
style: tslib_1.__assign(tslib_1.__assign({}, styles_1.default.textBody), { fontSize: utils_1.theme.fontSizes.xxsmall })
|
|
91
|
+
},
|
|
92
|
+
orderDetails__itemsContainer: {
|
|
93
|
+
classes: '',
|
|
94
|
+
props: {},
|
|
95
|
+
style: {
|
|
96
|
+
width: '100%',
|
|
97
|
+
gap: utils_1.theme.spacing.margin.small
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
orderDetails__itemsTitle: {
|
|
101
|
+
classes: '',
|
|
102
|
+
props: {},
|
|
103
|
+
style: tslib_1.__assign(tslib_1.__assign({}, styles_1.default.textHeadline), { fontSize: utils_1.theme.fontSizes.xxxsmall, textTransform: 'uppercase' })
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
exports.default = orderDetails;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var styles_1 = tslib_1.__importDefault(require("../styles"));
|
|
5
|
+
var utils_1 = require("../utils");
|
|
6
|
+
var orderDetailsItem = {
|
|
7
|
+
orderDetailsItem__container: {
|
|
8
|
+
classes: '',
|
|
9
|
+
props: {},
|
|
10
|
+
style: {
|
|
11
|
+
width: '100%',
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
flexDirection: 'row',
|
|
14
|
+
gap: utils_1.theme.spacing.padding.small
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
orderDetailsItem__image: {
|
|
18
|
+
classes: '',
|
|
19
|
+
props: {},
|
|
20
|
+
style: {
|
|
21
|
+
aspectRatio: 1,
|
|
22
|
+
backgroundPosition: 'center',
|
|
23
|
+
backgroundSize: 'cover',
|
|
24
|
+
flexBasis: 60,
|
|
25
|
+
flexGrow: 0,
|
|
26
|
+
flexShrink: 0
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
orderDetailsItem__content: {
|
|
30
|
+
classes: '',
|
|
31
|
+
props: {},
|
|
32
|
+
style: {
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
flexDirection: 'row',
|
|
35
|
+
gap: utils_1.theme.spacing.margin.large,
|
|
36
|
+
flexGrow: 1,
|
|
37
|
+
flexShrink: 1
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
orderDetailsItem__header: {
|
|
41
|
+
classes: '',
|
|
42
|
+
props: {},
|
|
43
|
+
style: {
|
|
44
|
+
gap: 5,
|
|
45
|
+
flexGrow: 1
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
orderDetailsItem__title: {
|
|
49
|
+
classes: '',
|
|
50
|
+
props: {},
|
|
51
|
+
style: tslib_1.__assign(tslib_1.__assign({}, styles_1.default.textHeading), { fontSize: utils_1.theme.fontSizes.xxxsmall })
|
|
52
|
+
},
|
|
53
|
+
orderDetailsItem__description: {
|
|
54
|
+
classes: '',
|
|
55
|
+
props: {},
|
|
56
|
+
style: tslib_1.__assign(tslib_1.__assign({}, styles_1.default.textBody), { fontSize: utils_1.theme.fontSizes.xxxsmall })
|
|
57
|
+
},
|
|
58
|
+
orderDetailsItem__price: {
|
|
59
|
+
classes: '',
|
|
60
|
+
props: {},
|
|
61
|
+
style: tslib_1.__assign(tslib_1.__assign({}, styles_1.default.textHeading), { fontSize: utils_1.theme.fontSizes.xxxsmall })
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
exports.default = orderDetailsItem;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var styles_1 = tslib_1.__importDefault(require("../styles"));
|
|
5
|
+
var utils_1 = require("../utils");
|
|
6
|
+
var page = {
|
|
7
|
+
page: {
|
|
8
|
+
classes: '',
|
|
9
|
+
props: {},
|
|
10
|
+
style: {
|
|
11
|
+
alignItems: 'stretch',
|
|
12
|
+
flexBasis: 'auto',
|
|
13
|
+
flexGrow: 1,
|
|
14
|
+
flexShrink: 1,
|
|
15
|
+
overflow: 'hidden'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
page__header: {
|
|
19
|
+
classes: '',
|
|
20
|
+
props: {},
|
|
21
|
+
style: {
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
justifyContent: 'center',
|
|
24
|
+
marginBottom: utils_1.theme.spacing.margin.medium,
|
|
25
|
+
marginTop: utils_1.theme.spacing.margin.medium,
|
|
26
|
+
paddingLeft: utils_1.theme.spacing.padding.medium,
|
|
27
|
+
paddingRight: utils_1.theme.spacing.padding.medium,
|
|
28
|
+
paddingTop: utils_1.theme.spacing.padding.large
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
page__title: {
|
|
32
|
+
classes: '',
|
|
33
|
+
props: {
|
|
34
|
+
as: 'h1',
|
|
35
|
+
text: 'Welcome back!'
|
|
36
|
+
},
|
|
37
|
+
style: tslib_1.__assign({}, styles_1.default.textHeadline)
|
|
38
|
+
},
|
|
39
|
+
page__content: {
|
|
40
|
+
classes: '',
|
|
41
|
+
props: {},
|
|
42
|
+
style: {
|
|
43
|
+
alignItems: 'stretch',
|
|
44
|
+
flexDirection: 'row',
|
|
45
|
+
flexWrap: 'wrap',
|
|
46
|
+
justifyContent: 'flex-start',
|
|
47
|
+
paddingBottom: utils_1.theme.spacing.padding.large,
|
|
48
|
+
paddingLeft: utils_1.theme.spacing.padding.medium,
|
|
49
|
+
paddingRight: utils_1.theme.spacing.padding.medium,
|
|
50
|
+
paddingTop: utils_1.theme.spacing.padding.large,
|
|
51
|
+
overflow: 'scroll'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
page__content__item: {
|
|
55
|
+
classes: '',
|
|
56
|
+
props: {},
|
|
57
|
+
style: {
|
|
58
|
+
alignItems: 'stretch',
|
|
59
|
+
flexBasis: '33.333%',
|
|
60
|
+
flexGrow: 0,
|
|
61
|
+
flexShrink: 0,
|
|
62
|
+
padding: utils_1.theme.spacing.padding.small
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
page__footer: {
|
|
66
|
+
classes: '',
|
|
67
|
+
props: {},
|
|
68
|
+
style: {
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
flexBasis: 200,
|
|
71
|
+
flexGrow: 0,
|
|
72
|
+
flexShrink: 1,
|
|
73
|
+
flexDirection: 'row',
|
|
74
|
+
gap: 100,
|
|
75
|
+
justifyContent: 'center'
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
exports.default = page;
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./keyboard"), exports);
|
|
4
5
|
tslib_1.__exportStar(require("./menu"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./orders"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./pos"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getKeyboardValue: (key: string, value: string, maxLength?: number) => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getKeyboardValue = void 0;
|
|
4
|
+
var getKeyboardValue = function (key, value, maxLength) {
|
|
5
|
+
if (key === 'del')
|
|
6
|
+
return value.slice(0, -1);
|
|
7
|
+
else if (key === 'clr')
|
|
8
|
+
return '';
|
|
9
|
+
else if (maxLength && value.length >= maxLength)
|
|
10
|
+
return value;
|
|
11
|
+
else
|
|
12
|
+
return value + key;
|
|
13
|
+
};
|
|
14
|
+
exports.getKeyboardValue = getKeyboardValue;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Handlers, KeypadProps, KeypadType } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const Keypad: ({ children, maxLength, type, value, handlers }: {
|
|
4
|
+
children: (props: KeypadProps) => ReactNode;
|
|
5
|
+
maxLength?: number;
|
|
6
|
+
type?: KeypadType;
|
|
7
|
+
value: string;
|
|
8
|
+
handlers: Handlers;
|
|
9
|
+
}) => ReactNode;
|
|
10
|
+
export default Keypad;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useCallback, useMemo } from 'react';
|
|
2
|
+
import { useAppSelector } from '../app/hooks';
|
|
3
|
+
import { selectKioskConfig } from '../slices';
|
|
4
|
+
import { getKeyboardValue } from '../utils';
|
|
5
|
+
var Keypad = function (_a) {
|
|
6
|
+
var children = _a.children, maxLength = _a.maxLength, type = _a.type, value = _a.value, handlers = _a.handlers;
|
|
7
|
+
var config = useAppSelector(selectKioskConfig).keypad;
|
|
8
|
+
var handleOnKeyPress = useCallback(function (key) { return handlers.change(getKeyboardValue(key, value, maxLength)); }, [maxLength, value, handlers]);
|
|
9
|
+
var viewHandlers = useMemo(function () { return ({ keyPress: handleOnKeyPress }); }, [handleOnKeyPress]);
|
|
10
|
+
if (!config)
|
|
11
|
+
return null;
|
|
12
|
+
return children({ config: config, handlers: viewHandlers, value: value, type: type });
|
|
13
|
+
};
|
|
14
|
+
export default Keypad;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Order } from '@open-tender/types';
|
|
2
|
+
import { CheckTotalsProps, OrderDetailsItemProps, OrderDetailsProps } from '@open-tender/ui';
|
|
3
|
+
import React, { ReactNode } from 'react';
|
|
4
|
+
declare const OrderDetails: ({ apiUrl, order, children, CheckTotalsView, OrderDetailsItemView }: {
|
|
5
|
+
apiUrl: string;
|
|
6
|
+
order: Order;
|
|
7
|
+
children: (props: OrderDetailsProps) => ReactNode;
|
|
8
|
+
CheckTotalsView: (props: CheckTotalsProps) => ReactNode;
|
|
9
|
+
OrderDetailsItemView: (props: OrderDetailsItemProps) => ReactNode;
|
|
10
|
+
}) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
11
|
+
export default OrderDetails;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { useCallback, useState } from 'react';
|
|
2
|
+
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
3
|
+
import { useOrder } from '../hooks';
|
|
4
|
+
import { selectKioskConfig, reorder as reorderPastOrder } from '../slices';
|
|
5
|
+
import { default as CheckTotalsContainer } from './CheckTotals';
|
|
6
|
+
import { default as OrderDetailsItemContainer } from './OrderDetailsItem';
|
|
7
|
+
var OrderDetails = function (_a) {
|
|
8
|
+
var apiUrl = _a.apiUrl, order = _a.order, children = _a.children, CheckTotalsView = _a.CheckTotalsView, OrderDetailsItemView = _a.OrderDetailsItemView;
|
|
9
|
+
var dispatch = useAppDispatch();
|
|
10
|
+
var _b = useState(null), errMsg = _b[0], setErrMsg = _b[1];
|
|
11
|
+
var _c = useState(false), isReordering = _c[0], setIsReordering = _c[1];
|
|
12
|
+
var _d = useOrder(order), subtitle = _d.title, title = _d.orderNo, requestedAt = _d.requestedAt;
|
|
13
|
+
var _e = useAppSelector(selectKioskConfig), config = _e.orderDetails, modalContentConfig = _e.modalContent;
|
|
14
|
+
var reorder = function () {
|
|
15
|
+
setErrMsg(null);
|
|
16
|
+
setIsReordering(true);
|
|
17
|
+
dispatch(reorderPastOrder(order.cart));
|
|
18
|
+
};
|
|
19
|
+
var renderCheckTotals = useCallback(function () { return React.createElement(CheckTotalsContainer, { check: order, children: CheckTotalsView }); }, [order, CheckTotalsView]);
|
|
20
|
+
var renderOrderDetailsItem = useCallback(function (orderItem) { return (React.createElement(OrderDetailsItemContainer, { key: orderItem.id, apiUrl: apiUrl, orderItem: orderItem, children: OrderDetailsItemView })); }, [apiUrl, OrderDetailsItemView]);
|
|
21
|
+
if (!config)
|
|
22
|
+
return React.createElement(React.Fragment, null);
|
|
23
|
+
return children({
|
|
24
|
+
config: config,
|
|
25
|
+
modalContentConfig: modalContentConfig,
|
|
26
|
+
renderCheckTotals: renderCheckTotals,
|
|
27
|
+
requestedAt: requestedAt,
|
|
28
|
+
order: order,
|
|
29
|
+
title: title,
|
|
30
|
+
subtitle: subtitle,
|
|
31
|
+
isReordering: isReordering,
|
|
32
|
+
errMsg: errMsg,
|
|
33
|
+
handlers: { reorder: reorder },
|
|
34
|
+
apiUrl: apiUrl,
|
|
35
|
+
renderOrderDetailsItem: renderOrderDetailsItem
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
export default OrderDetails;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OrderItem } from '@open-tender/types';
|
|
2
|
+
import { OrderDetailsItemProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const OrderDetailsItem: ({ apiUrl, orderItem, children }: {
|
|
5
|
+
apiUrl: string;
|
|
6
|
+
orderItem: OrderItem;
|
|
7
|
+
children: (props: OrderDetailsItemProps) => ReactNode;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
export default OrderDetailsItem;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectKioskConfig } from '../slices';
|
|
3
|
+
var OrderDetailsItem = function (_a) {
|
|
4
|
+
var apiUrl = _a.apiUrl, orderItem = _a.orderItem, children = _a.children;
|
|
5
|
+
var config = useAppSelector(selectKioskConfig).orderDetailsItem;
|
|
6
|
+
if (!config)
|
|
7
|
+
return null;
|
|
8
|
+
return children({ config: config, orderItem: orderItem, apiUrl: apiUrl });
|
|
9
|
+
};
|
|
10
|
+
export default OrderDetailsItem;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { SignInOptionsProps, SignInQrProps, SignInPhoneProps,
|
|
1
|
+
import { SignInOptionsProps, SignInQrProps, SignInPhoneProps, ErrorMessageProps, KeypadProps } from '@open-tender/ui';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
|
-
declare const SignInOptions: ({ close, children, SignInQrView, SignInPhoneView,
|
|
3
|
+
declare const SignInOptions: ({ close, children, SignInQrView, SignInPhoneView, KeypadView, ErrorMessageView }: {
|
|
4
4
|
close: () => void;
|
|
5
5
|
children: (props: SignInOptionsProps) => ReactNode;
|
|
6
6
|
SignInQrView: (props: SignInQrProps) => ReactNode;
|
|
7
7
|
SignInPhoneView: (props: SignInPhoneProps) => ReactNode;
|
|
8
|
-
|
|
8
|
+
KeypadView: (props: KeypadProps) => ReactNode;
|
|
9
9
|
ErrorMessageView: (props: ErrorMessageProps) => ReactNode;
|
|
10
10
|
}) => React.ReactNode;
|
|
11
11
|
export default SignInOptions;
|
|
@@ -4,12 +4,12 @@ import { selectKioskConfig } from '../slices';
|
|
|
4
4
|
import { default as SignInPhoneContainer } from './SignInPhone';
|
|
5
5
|
import { default as SignInQrContainer } from './SignInQr';
|
|
6
6
|
var SignInOptions = function (_a) {
|
|
7
|
-
var close = _a.close, children = _a.children, SignInQrView = _a.SignInQrView, SignInPhoneView = _a.SignInPhoneView,
|
|
7
|
+
var close = _a.close, children = _a.children, SignInQrView = _a.SignInQrView, SignInPhoneView = _a.SignInPhoneView, KeypadView = _a.KeypadView, ErrorMessageView = _a.ErrorMessageView;
|
|
8
8
|
var _b = useAppSelector(selectKioskConfig), config = _b.signInOptions, modalContentConfig = _b.modalContent;
|
|
9
9
|
var _c = useState(null), signInType = _c[0], setSignInType = _c[1];
|
|
10
10
|
var handlers = { close: close, setSignInType: setSignInType };
|
|
11
11
|
var renderSignInQr = useCallback(function (close) { return (React.createElement(SignInQrContainer, { close: close, children: SignInQrView })); }, [SignInQrView]);
|
|
12
|
-
var renderSignInPhone = useCallback(function (close) { return (React.createElement(SignInPhoneContainer, { ErrorMessageView: ErrorMessageView,
|
|
12
|
+
var renderSignInPhone = useCallback(function (close) { return (React.createElement(SignInPhoneContainer, { ErrorMessageView: ErrorMessageView, KeypadView: KeypadView, close: close, children: SignInPhoneView })); }, [SignInPhoneView, KeypadView, ErrorMessageView]);
|
|
13
13
|
if (!config)
|
|
14
14
|
return null;
|
|
15
15
|
return children({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SignInPhoneProps,
|
|
1
|
+
import { SignInPhoneProps, ErrorMessageProps, KeypadProps } from '@open-tender/ui';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
|
-
declare const SignInPhone: ({ close, children,
|
|
3
|
+
declare const SignInPhone: ({ close, children, KeypadView, ErrorMessageView }: {
|
|
4
4
|
close: () => void;
|
|
5
5
|
children: (props: SignInPhoneProps) => ReactNode;
|
|
6
|
-
|
|
6
|
+
KeypadView: (props: KeypadProps) => ReactNode;
|
|
7
7
|
ErrorMessageView: (props: ErrorMessageProps) => ReactNode;
|
|
8
8
|
}) => React.ReactNode;
|
|
9
9
|
export default SignInPhone;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { handleRespError
|
|
2
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
1
|
+
import { handleRespError } from '@open-tender/utils';
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
4
4
|
import { fetchCustomerIdentify, selectCustomerIdentify, selectKioskConfig } from '../slices';
|
|
5
|
+
import { makePhone } from '../utils';
|
|
5
6
|
import { default as ErrorMessageContainer } from './ErrorMessage';
|
|
6
|
-
import { default as
|
|
7
|
+
import { default as KeypadContainer } from './Keypad';
|
|
7
8
|
var SignInPhone = function (_a) {
|
|
8
|
-
var close = _a.close, children = _a.children,
|
|
9
|
+
var close = _a.close, children = _a.children, KeypadView = _a.KeypadView, ErrorMessageView = _a.ErrorMessageView;
|
|
9
10
|
var dispatch = useAppDispatch();
|
|
10
11
|
var _b = useState(''), phone = _b[0], setPhone = _b[1];
|
|
11
12
|
var _c = useState(false), submitted = _c[0], setSubmitted = _c[1];
|
|
@@ -37,15 +38,17 @@ var SignInPhone = function (_a) {
|
|
|
37
38
|
if (hasCustomer)
|
|
38
39
|
close();
|
|
39
40
|
}, [hasCustomer, close]);
|
|
40
|
-
var
|
|
41
|
+
var keypadHandlers = useMemo(function () { return ({
|
|
42
|
+
change: function (value) { return setPhone(makePhone(value)); }
|
|
43
|
+
}); }, []);
|
|
44
|
+
var renderKeypad = useCallback(function () { return (React.createElement(KeypadContainer, { handlers: keypadHandlers, value: phone, children: KeypadView })); }, [KeypadView, phone, keypadHandlers]);
|
|
41
45
|
var renderErrorMessage = useCallback(function (errMsg) { return (React.createElement(ErrorMessageContainer, { content: errMsg, children: ErrorMessageView })); }, [ErrorMessageView]);
|
|
42
46
|
return children({
|
|
43
47
|
config: config,
|
|
44
48
|
handlers: handlers,
|
|
45
|
-
phone: phone,
|
|
46
49
|
errMsg: errMsg,
|
|
47
50
|
modalContentConfig: modalContentConfig,
|
|
48
|
-
|
|
51
|
+
renderKeypad: renderKeypad,
|
|
49
52
|
renderErrorMessage: renderErrorMessage
|
|
50
53
|
});
|
|
51
54
|
};
|
|
@@ -28,6 +28,8 @@ import ModalHeader from './ModalHeader';
|
|
|
28
28
|
import NutritionalInfo from './NutritionalInfo';
|
|
29
29
|
import Option from './Option';
|
|
30
30
|
import OrderCard from './OrderCard';
|
|
31
|
+
import OrderDetails from './OrderDetails';
|
|
32
|
+
import OrderDetailsItem from './OrderDetailsItem';
|
|
31
33
|
import PointsReward from './PointsReward';
|
|
32
34
|
import PointsRewards from './PointsRewards';
|
|
33
35
|
import PromoCode from './PromoCode';
|
|
@@ -45,4 +47,4 @@ import Tag from './Tag';
|
|
|
45
47
|
import TextArea from './TextArea';
|
|
46
48
|
import UpsellItem from './UpsellItem';
|
|
47
49
|
import Upsells from './Upsells';
|
|
48
|
-
export { Allergen, Applied, ButtonLink, Card, Cart, CartItem, CartUpsellItem, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, CheckTotals, Discount, ErrorMessage, Header, Ingredients, Input, ItemGroup, ItemGroups, ItemOption, ItemSelections, Loader, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptions, SignInPhone, SignInQr, SuccessMessage, Tag, TextArea, UpsellItem, Upsells };
|
|
50
|
+
export { Allergen, Applied, ButtonLink, Card, Cart, CartItem, CartUpsellItem, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, CheckTotals, Discount, ErrorMessage, Header, Ingredients, Input, ItemGroup, ItemGroups, ItemOption, ItemSelections, Loader, 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 };
|
|
@@ -28,6 +28,8 @@ import ModalHeader from './ModalHeader';
|
|
|
28
28
|
import NutritionalInfo from './NutritionalInfo';
|
|
29
29
|
import Option from './Option';
|
|
30
30
|
import OrderCard from './OrderCard';
|
|
31
|
+
import OrderDetails from './OrderDetails';
|
|
32
|
+
import OrderDetailsItem from './OrderDetailsItem';
|
|
31
33
|
import PointsReward from './PointsReward';
|
|
32
34
|
import PointsRewards from './PointsRewards';
|
|
33
35
|
import PromoCode from './PromoCode';
|
|
@@ -45,4 +47,4 @@ import Tag from './Tag';
|
|
|
45
47
|
import TextArea from './TextArea';
|
|
46
48
|
import UpsellItem from './UpsellItem';
|
|
47
49
|
import Upsells from './Upsells';
|
|
48
|
-
export { Allergen, Applied, ButtonLink, Card, Cart, CartItem, CartUpsellItem, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, CheckTotals, Discount, ErrorMessage, Header, Ingredients, Input, ItemGroup, ItemGroups, ItemOption, ItemSelections, Loader, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptions, SignInPhone, SignInQr, SuccessMessage, Tag, TextArea, UpsellItem, Upsells };
|
|
50
|
+
export { Allergen, Applied, ButtonLink, Card, Cart, CartItem, CartUpsellItem, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, CheckTotals, Discount, ErrorMessage, Header, Ingredients, Input, ItemGroup, ItemGroups, ItemOption, ItemSelections, Loader, 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 };
|
package/dist/esm/config/index.js
CHANGED
|
@@ -45,6 +45,9 @@ import modalHeader from './modalHeader';
|
|
|
45
45
|
import nutritionalInfo from './nutritionalInfo';
|
|
46
46
|
import option from './option';
|
|
47
47
|
import orderCard from './orderCard';
|
|
48
|
+
import orderDetails from './orderDetails';
|
|
49
|
+
import orderDetailsItem from './orderDetailsItem';
|
|
50
|
+
import page from './page';
|
|
48
51
|
import pointsReward from './pointsReward';
|
|
49
52
|
import pointsRewards from './pointsRewards';
|
|
50
53
|
import promoCode from './promoCode';
|
|
@@ -110,6 +113,9 @@ var config = {
|
|
|
110
113
|
nutritionalInfo: nutritionalInfo,
|
|
111
114
|
option: option,
|
|
112
115
|
orderCard: orderCard,
|
|
116
|
+
orderDetails: orderDetails,
|
|
117
|
+
orderDetailsItem: orderDetailsItem,
|
|
118
|
+
page: page,
|
|
113
119
|
pointsReward: pointsReward,
|
|
114
120
|
pointsRewards: pointsRewards,
|
|
115
121
|
promoCode: promoCode,
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import styles from '../styles';
|
|
3
|
+
import { theme } from '../utils';
|
|
4
|
+
var orderDetails = {
|
|
5
|
+
orderDetails__totalsContainer: {
|
|
6
|
+
classes: '',
|
|
7
|
+
props: {},
|
|
8
|
+
style: {
|
|
9
|
+
width: '100%'
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
orderDetails__orderNumber: {
|
|
13
|
+
classes: '',
|
|
14
|
+
props: {},
|
|
15
|
+
style: __assign(__assign({}, styles.textHeadline), { fontSize: theme.fontSizes.xsmall, textTransform: 'uppercase', textAlign: 'center' })
|
|
16
|
+
},
|
|
17
|
+
orderDetails__orderTitle: {
|
|
18
|
+
classes: '',
|
|
19
|
+
props: {},
|
|
20
|
+
style: __assign(__assign({}, styles.textHeading), { fontSize: theme.fontSizes.xxlarge, textAlign: 'center' })
|
|
21
|
+
},
|
|
22
|
+
orderDetails__buttonsContainer: {
|
|
23
|
+
classes: '',
|
|
24
|
+
props: {},
|
|
25
|
+
style: {
|
|
26
|
+
width: '100%',
|
|
27
|
+
justifyContent: 'center',
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
gap: theme.spacing.margin.small,
|
|
30
|
+
marginBottom: theme.spacing.margin.large
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
orderDetails__reorderButton: {
|
|
34
|
+
classes: '',
|
|
35
|
+
props: {},
|
|
36
|
+
style: __assign(__assign({}, styles.buttonPrimary), { fontSize: theme.fontSizes.small })
|
|
37
|
+
},
|
|
38
|
+
orderDetails__rateOrderButton: {
|
|
39
|
+
classes: '',
|
|
40
|
+
props: {},
|
|
41
|
+
style: __assign(__assign({}, styles.buttonSecondary), { fontSize: theme.fontSizes.small })
|
|
42
|
+
},
|
|
43
|
+
orderDetails__summary: {
|
|
44
|
+
classes: '',
|
|
45
|
+
props: {},
|
|
46
|
+
style: {
|
|
47
|
+
width: '100%',
|
|
48
|
+
alignItems: 'center',
|
|
49
|
+
marginBottom: theme.spacing.margin.large
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
orderDetails__summaryItem: {
|
|
53
|
+
classes: '',
|
|
54
|
+
props: {},
|
|
55
|
+
style: {
|
|
56
|
+
width: '100%',
|
|
57
|
+
flexDirection: 'row',
|
|
58
|
+
alignItems: 'center'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
orderDetails__divider: {
|
|
62
|
+
classes: '',
|
|
63
|
+
props: {},
|
|
64
|
+
style: {
|
|
65
|
+
width: '100%',
|
|
66
|
+
height: 0.5,
|
|
67
|
+
backgroundColor: theme.colors.text.primary,
|
|
68
|
+
marginTop: theme.spacing.margin.small,
|
|
69
|
+
marginBottom: theme.spacing.margin.small
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
orderDetails__summaryLabel: {
|
|
73
|
+
classes: '',
|
|
74
|
+
props: {},
|
|
75
|
+
style: __assign(__assign({ width: '35%' }, styles.textHeadline), { fontSize: theme.fontSizes.xxxsmall, textTransform: 'uppercase' })
|
|
76
|
+
},
|
|
77
|
+
orderDetails__summaryValuesContainer: {
|
|
78
|
+
classes: '',
|
|
79
|
+
props: {},
|
|
80
|
+
style: {
|
|
81
|
+
flexGrow: 1,
|
|
82
|
+
gap: 5
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
orderDetails__summaryValue: {
|
|
86
|
+
classes: '',
|
|
87
|
+
props: {},
|
|
88
|
+
style: __assign(__assign({}, styles.textBody), { fontSize: theme.fontSizes.xxsmall })
|
|
89
|
+
},
|
|
90
|
+
orderDetails__itemsContainer: {
|
|
91
|
+
classes: '',
|
|
92
|
+
props: {},
|
|
93
|
+
style: {
|
|
94
|
+
width: '100%',
|
|
95
|
+
gap: theme.spacing.margin.small
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
orderDetails__itemsTitle: {
|
|
99
|
+
classes: '',
|
|
100
|
+
props: {},
|
|
101
|
+
style: __assign(__assign({}, styles.textHeadline), { fontSize: theme.fontSizes.xxxsmall, textTransform: 'uppercase' })
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
export default orderDetails;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import styles from '../styles';
|
|
3
|
+
import { theme } from '../utils';
|
|
4
|
+
var orderDetailsItem = {
|
|
5
|
+
orderDetailsItem__container: {
|
|
6
|
+
classes: '',
|
|
7
|
+
props: {},
|
|
8
|
+
style: {
|
|
9
|
+
width: '100%',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
flexDirection: 'row',
|
|
12
|
+
gap: theme.spacing.padding.small
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
orderDetailsItem__image: {
|
|
16
|
+
classes: '',
|
|
17
|
+
props: {},
|
|
18
|
+
style: {
|
|
19
|
+
aspectRatio: 1,
|
|
20
|
+
backgroundPosition: 'center',
|
|
21
|
+
backgroundSize: 'cover',
|
|
22
|
+
flexBasis: 60,
|
|
23
|
+
flexGrow: 0,
|
|
24
|
+
flexShrink: 0
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
orderDetailsItem__content: {
|
|
28
|
+
classes: '',
|
|
29
|
+
props: {},
|
|
30
|
+
style: {
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
flexDirection: 'row',
|
|
33
|
+
gap: theme.spacing.margin.large,
|
|
34
|
+
flexGrow: 1,
|
|
35
|
+
flexShrink: 1
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
orderDetailsItem__header: {
|
|
39
|
+
classes: '',
|
|
40
|
+
props: {},
|
|
41
|
+
style: {
|
|
42
|
+
gap: 5,
|
|
43
|
+
flexGrow: 1
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
orderDetailsItem__title: {
|
|
47
|
+
classes: '',
|
|
48
|
+
props: {},
|
|
49
|
+
style: __assign(__assign({}, styles.textHeading), { fontSize: theme.fontSizes.xxxsmall })
|
|
50
|
+
},
|
|
51
|
+
orderDetailsItem__description: {
|
|
52
|
+
classes: '',
|
|
53
|
+
props: {},
|
|
54
|
+
style: __assign(__assign({}, styles.textBody), { fontSize: theme.fontSizes.xxxsmall })
|
|
55
|
+
},
|
|
56
|
+
orderDetailsItem__price: {
|
|
57
|
+
classes: '',
|
|
58
|
+
props: {},
|
|
59
|
+
style: __assign(__assign({}, styles.textHeading), { fontSize: theme.fontSizes.xxxsmall })
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
export default orderDetailsItem;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import styles from '../styles';
|
|
3
|
+
import { theme } from '../utils';
|
|
4
|
+
var page = {
|
|
5
|
+
page: {
|
|
6
|
+
classes: '',
|
|
7
|
+
props: {},
|
|
8
|
+
style: {
|
|
9
|
+
alignItems: 'stretch',
|
|
10
|
+
flexBasis: 'auto',
|
|
11
|
+
flexGrow: 1,
|
|
12
|
+
flexShrink: 1,
|
|
13
|
+
overflow: 'hidden'
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
page__header: {
|
|
17
|
+
classes: '',
|
|
18
|
+
props: {},
|
|
19
|
+
style: {
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
justifyContent: 'center',
|
|
22
|
+
marginBottom: theme.spacing.margin.medium,
|
|
23
|
+
marginTop: theme.spacing.margin.medium,
|
|
24
|
+
paddingLeft: theme.spacing.padding.medium,
|
|
25
|
+
paddingRight: theme.spacing.padding.medium,
|
|
26
|
+
paddingTop: theme.spacing.padding.large
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
page__title: {
|
|
30
|
+
classes: '',
|
|
31
|
+
props: {
|
|
32
|
+
as: 'h1',
|
|
33
|
+
text: 'Welcome back!'
|
|
34
|
+
},
|
|
35
|
+
style: __assign({}, styles.textHeadline)
|
|
36
|
+
},
|
|
37
|
+
page__content: {
|
|
38
|
+
classes: '',
|
|
39
|
+
props: {},
|
|
40
|
+
style: {
|
|
41
|
+
alignItems: 'stretch',
|
|
42
|
+
flexDirection: 'row',
|
|
43
|
+
flexWrap: 'wrap',
|
|
44
|
+
justifyContent: 'flex-start',
|
|
45
|
+
paddingBottom: theme.spacing.padding.large,
|
|
46
|
+
paddingLeft: theme.spacing.padding.medium,
|
|
47
|
+
paddingRight: theme.spacing.padding.medium,
|
|
48
|
+
paddingTop: theme.spacing.padding.large,
|
|
49
|
+
overflow: 'scroll'
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
page__content__item: {
|
|
53
|
+
classes: '',
|
|
54
|
+
props: {},
|
|
55
|
+
style: {
|
|
56
|
+
alignItems: 'stretch',
|
|
57
|
+
flexBasis: '33.333%',
|
|
58
|
+
flexGrow: 0,
|
|
59
|
+
flexShrink: 0,
|
|
60
|
+
padding: theme.spacing.padding.small
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
page__footer: {
|
|
64
|
+
classes: '',
|
|
65
|
+
props: {},
|
|
66
|
+
style: {
|
|
67
|
+
alignItems: 'center',
|
|
68
|
+
flexBasis: 200,
|
|
69
|
+
flexGrow: 0,
|
|
70
|
+
flexShrink: 1,
|
|
71
|
+
flexDirection: 'row',
|
|
72
|
+
gap: 100,
|
|
73
|
+
justifyContent: 'center'
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
export default page;
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getKeyboardValue: (key: string, value: string, maxLength?: number) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.24",
|
|
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",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@babel/core": "^7.23.6",
|
|
37
37
|
"@emotion/react": "^11.11.1",
|
|
38
38
|
"@open-tender/types": "^0.4.44",
|
|
39
|
-
"@open-tender/ui": "^0.3.
|
|
39
|
+
"@open-tender/ui": "^0.3.18",
|
|
40
40
|
"@open-tender/utils": "^0.4.23",
|
|
41
41
|
"@reduxjs/toolkit": "^2.0.1",
|
|
42
42
|
"@types/react": "^18.2.45",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@emotion/react": "^11.11.1",
|
|
67
67
|
"@open-tender/types": "^0.4.43",
|
|
68
|
-
"@open-tender/ui": "^0.3.
|
|
68
|
+
"@open-tender/ui": "^0.3.18",
|
|
69
69
|
"@open-tender/utils": "^0.4.23",
|
|
70
70
|
"@reduxjs/toolkit": "^2.0.1",
|
|
71
71
|
"date-fns": "2.30.0",
|