@open-tender/store 1.1.3 → 1.1.5
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/LICENSE.md +21 -21
- package/README.md +3 -3
- package/dist/cjs/components/Allergen.d.ts +8 -0
- package/dist/cjs/components/Allergen.js +10 -0
- package/dist/cjs/components/Applied.d.ts +6 -0
- package/dist/cjs/components/Applied.js +10 -0
- package/dist/cjs/components/ButtonLink.d.ts +9 -0
- package/dist/cjs/components/ButtonLink.js +10 -0
- package/dist/cjs/components/Card.d.ts +7 -0
- package/dist/cjs/components/Card.js +10 -0
- package/dist/cjs/components/Cart.d.ts +7 -0
- package/dist/cjs/components/Cart.js +41 -0
- package/dist/cjs/components/CartItem.d.ts +11 -0
- package/dist/cjs/components/CartItem.js +31 -0
- package/dist/cjs/components/CartUpsellItem.d.ts +10 -0
- package/dist/cjs/components/CartUpsellItem.js +24 -0
- package/dist/cjs/components/CartUpsells.d.ts +6 -0
- package/dist/cjs/components/CartUpsells.js +25 -0
- package/dist/cjs/components/CategoryItem.d.ts +11 -0
- package/dist/cjs/components/CategoryItem.js +27 -0
- package/dist/cjs/components/CategoryNav.d.ts +7 -0
- package/dist/cjs/components/CategoryNav.js +26 -0
- package/dist/cjs/components/CategoryNavItem.d.ts +9 -0
- package/dist/cjs/components/CategoryNavItem.js +27 -0
- package/dist/cjs/components/CategoryNavOther.d.ts +9 -0
- package/dist/cjs/components/CategoryNavOther.js +19 -0
- package/dist/cjs/components/CheckTotals.d.ts +8 -0
- package/dist/cjs/components/CheckTotals.js +10 -0
- package/dist/cjs/components/Discount.d.ts +8 -0
- package/dist/cjs/components/Discount.js +12 -0
- package/dist/cjs/components/ErrorMessage.d.ts +9 -0
- package/dist/cjs/components/ErrorMessage.js +10 -0
- package/dist/cjs/components/Header.d.ts +9 -0
- package/dist/cjs/components/Header.js +26 -0
- package/dist/cjs/components/Ingredients.d.ts +10 -0
- package/dist/cjs/components/Ingredients.js +11 -0
- package/dist/cjs/components/Input.d.ts +11 -0
- package/dist/cjs/components/Input.js +22 -0
- package/dist/cjs/components/ItemGroup.d.ts +9 -0
- package/dist/cjs/components/ItemGroup.js +18 -0
- package/dist/cjs/components/ItemGroups.d.ts +11 -0
- package/dist/cjs/components/ItemGroups.js +25 -0
- package/dist/cjs/components/ItemOption.d.ts +11 -0
- package/dist/cjs/components/ItemOption.js +30 -0
- package/dist/cjs/components/ItemSelections.d.ts +11 -0
- package/dist/cjs/components/ItemSelections.js +23 -0
- package/dist/cjs/components/Label.d.ts +10 -0
- package/dist/cjs/components/Label.js +10 -0
- package/dist/cjs/components/Loader.d.ts +8 -0
- package/dist/cjs/components/Loader.js +10 -0
- package/dist/cjs/components/MadeForNotes.d.ts +14 -0
- package/dist/cjs/components/MadeForNotes.js +29 -0
- package/dist/cjs/components/MenuCategory.d.ts +3 -3
- package/dist/cjs/components/MenuCategory.js +5 -5
- package/dist/cjs/components/MenuOther.d.ts +12 -0
- package/dist/cjs/components/MenuOther.js +16 -0
- package/dist/cjs/components/Modal.d.ts +9 -0
- package/dist/cjs/components/Modal.js +16 -0
- package/dist/cjs/components/ModalContent.d.ts +14 -0
- package/dist/cjs/components/ModalContent.js +20 -0
- package/dist/cjs/components/ModalHeader.d.ts +8 -0
- package/dist/cjs/components/ModalHeader.js +10 -0
- package/dist/cjs/components/NutritionalInfo.d.ts +11 -0
- package/dist/cjs/components/NutritionalInfo.js +18 -0
- package/dist/cjs/components/Option.d.ts +11 -0
- package/dist/cjs/components/Option.js +24 -0
- package/dist/cjs/components/OrderCard.d.ts +9 -0
- package/dist/cjs/components/OrderCard.js +56 -0
- package/dist/cjs/components/PointsReward.d.ts +10 -0
- package/dist/cjs/components/PointsReward.js +62 -0
- package/dist/cjs/components/PointsRewards.d.ts +6 -0
- package/dist/cjs/components/PointsRewards.js +24 -0
- package/dist/cjs/components/PromoCode.d.ts +7 -0
- package/dist/cjs/components/PromoCode.js +52 -0
- package/dist/cjs/components/Quantity.d.ts +13 -0
- package/dist/cjs/components/Quantity.js +19 -0
- package/dist/cjs/components/Reward.d.ts +10 -0
- package/dist/cjs/components/Reward.js +39 -0
- package/dist/cjs/components/Rewards.d.ts +10 -0
- package/dist/cjs/components/Rewards.js +15 -0
- package/dist/cjs/components/SignIn.d.ts +11 -0
- package/dist/cjs/components/SignIn.js +37 -0
- package/dist/cjs/components/SignInButton.d.ts +8 -0
- package/dist/cjs/components/SignInButton.js +41 -0
- package/dist/cjs/components/SignInCheckout.d.ts +9 -0
- package/dist/cjs/components/SignInCheckout.js +38 -0
- package/dist/cjs/components/SignInOptions.d.ts +7 -0
- package/dist/cjs/components/SignInOptions.js +28 -0
- package/dist/cjs/components/SignInPhone.d.ts +7 -0
- package/dist/cjs/components/SignInPhone.js +59 -0
- package/dist/cjs/components/SignInQr.d.ts +7 -0
- package/dist/cjs/components/SignInQr.js +61 -0
- package/dist/cjs/components/SuccessMessage.d.ts +9 -0
- package/dist/cjs/components/SuccessMessage.js +10 -0
- package/dist/cjs/components/Tag.d.ts +8 -0
- package/dist/cjs/components/Tag.js +10 -0
- package/dist/cjs/components/TextArea.d.ts +11 -0
- package/dist/cjs/components/TextArea.js +22 -0
- package/dist/cjs/components/UpsellItem.d.ts +10 -0
- package/dist/cjs/components/UpsellItem.js +24 -0
- package/dist/cjs/components/Upsells.d.ts +8 -0
- package/dist/cjs/components/Upsells.js +25 -0
- package/dist/cjs/components/index.d.ts +47 -1
- package/dist/cjs/components/index.js +93 -1
- package/dist/cjs/config/index.js +1 -1
- package/dist/cjs/hooks/useBarcode.js +1 -1
- package/dist/cjs/hooks/useChipDNATender/useChipDNATender.js +1 -1
- package/dist/cjs/hooks/useEmployee.js +8 -4
- package/dist/cjs/hooks/useGiftCardBalance.js +1 -1
- package/dist/cjs/hooks/useOrderValidate.js +1 -1
- package/dist/cjs/hooks/usePunch.js +1 -1
- package/dist/cjs/slices/alerts.js +1 -1
- package/dist/cjs/slices/arrivals.js +32 -36
- package/dist/cjs/slices/checkout.d.ts +1 -1
- package/dist/cjs/slices/checkout.js +329 -351
- package/dist/cjs/slices/config.js +79 -81
- package/dist/cjs/slices/customer.js +17 -19
- package/dist/cjs/slices/customerIdentify.js +16 -18
- package/dist/cjs/slices/deals.js +16 -18
- package/dist/cjs/slices/discounts.js +19 -21
- package/dist/cjs/slices/errorAlerts.d.ts +1 -1
- package/dist/cjs/slices/errorAlerts.js +34 -38
- package/dist/cjs/slices/kds.js +253 -275
- package/dist/cjs/slices/kiosk.d.ts +113 -1
- package/dist/cjs/slices/kiosk.js +74 -53
- package/dist/cjs/slices/menu.js +24 -26
- package/dist/cjs/slices/menuPages.js +16 -18
- package/dist/cjs/slices/notifications.js +1 -1
- package/dist/cjs/slices/offlineAuths.js +32 -36
- package/dist/cjs/slices/order.js +25 -27
- package/dist/cjs/slices/pos.js +59 -65
- package/dist/cjs/slices/punches.d.ts +1 -1
- package/dist/cjs/slices/punches.js +16 -18
- package/dist/cjs/slices/refund.js +54 -60
- package/dist/cjs/slices/settings.js +56 -62
- package/dist/cjs/slices/surcharges.js +19 -21
- package/dist/cjs/slices/taxes.js +19 -21
- package/dist/cjs/utils/punches.js +1 -1
- package/dist/esm/components/Allergen.d.ts +8 -0
- package/dist/esm/components/Allergen.js +8 -0
- package/dist/esm/components/Applied.d.ts +6 -0
- package/dist/esm/components/Applied.js +8 -0
- package/dist/esm/components/ButtonLink.d.ts +9 -0
- package/dist/esm/components/ButtonLink.js +8 -0
- package/dist/esm/components/Card.d.ts +7 -0
- package/dist/esm/components/Card.js +8 -0
- package/dist/esm/components/Cart.d.ts +7 -0
- package/dist/esm/components/Cart.js +38 -0
- package/dist/esm/components/CartItem.d.ts +11 -0
- package/dist/esm/components/CartItem.js +28 -0
- package/dist/esm/components/CartUpsellItem.d.ts +10 -0
- package/dist/esm/components/CartUpsellItem.js +22 -0
- package/dist/esm/components/CartUpsells.d.ts +6 -0
- package/dist/esm/components/CartUpsells.js +22 -0
- package/dist/esm/components/CategoryItem.d.ts +11 -0
- package/dist/esm/components/CategoryItem.js +25 -0
- package/dist/esm/components/CategoryNav.d.ts +7 -0
- package/dist/esm/components/CategoryNav.js +23 -0
- package/dist/esm/components/CategoryNavItem.d.ts +9 -0
- package/dist/esm/components/CategoryNavItem.js +25 -0
- package/dist/esm/components/CategoryNavOther.d.ts +9 -0
- package/dist/esm/components/CategoryNavOther.js +17 -0
- package/dist/esm/components/CheckTotals.d.ts +8 -0
- package/dist/esm/components/CheckTotals.js +8 -0
- package/dist/esm/components/Discount.d.ts +8 -0
- package/dist/esm/components/Discount.js +10 -0
- package/dist/esm/components/ErrorMessage.d.ts +9 -0
- package/dist/esm/components/ErrorMessage.js +8 -0
- package/dist/esm/components/Header.d.ts +9 -0
- package/dist/esm/components/Header.js +23 -0
- package/dist/esm/components/Ingredients.d.ts +10 -0
- package/dist/esm/components/Ingredients.js +9 -0
- package/dist/esm/components/Input.d.ts +11 -0
- package/dist/esm/components/Input.js +20 -0
- package/dist/esm/components/ItemGroup.d.ts +9 -0
- package/dist/esm/components/ItemGroup.js +16 -0
- package/dist/esm/components/ItemGroups.d.ts +11 -0
- package/dist/esm/components/ItemGroups.js +22 -0
- package/dist/esm/components/ItemOption.d.ts +11 -0
- package/dist/esm/components/ItemOption.js +28 -0
- package/dist/esm/components/ItemSelections.d.ts +11 -0
- package/dist/esm/components/ItemSelections.js +20 -0
- package/dist/esm/components/Label.d.ts +10 -0
- package/dist/esm/components/Label.js +8 -0
- package/dist/esm/components/Loader.d.ts +8 -0
- package/dist/esm/components/Loader.js +8 -0
- package/dist/esm/components/MadeForNotes.d.ts +14 -0
- package/dist/esm/components/MadeForNotes.js +26 -0
- package/dist/esm/components/MenuCategory.d.ts +3 -3
- package/dist/esm/components/MenuCategory.js +1 -1
- package/dist/esm/components/MenuOther.d.ts +12 -0
- package/dist/esm/components/MenuOther.js +14 -0
- package/dist/esm/components/Modal.d.ts +9 -0
- package/dist/esm/components/Modal.js +13 -0
- package/dist/esm/components/ModalContent.d.ts +14 -0
- package/dist/esm/components/ModalContent.js +18 -0
- package/dist/esm/components/ModalHeader.d.ts +8 -0
- package/dist/esm/components/ModalHeader.js +8 -0
- package/dist/esm/components/NutritionalInfo.d.ts +11 -0
- package/dist/esm/components/NutritionalInfo.js +16 -0
- package/dist/esm/components/Option.d.ts +11 -0
- package/dist/esm/components/Option.js +22 -0
- package/dist/esm/components/OrderCard.d.ts +9 -0
- package/dist/esm/components/OrderCard.js +53 -0
- package/dist/esm/components/PointsReward.d.ts +10 -0
- package/dist/esm/components/PointsReward.js +60 -0
- package/dist/esm/components/PointsRewards.d.ts +6 -0
- package/dist/esm/components/PointsRewards.js +21 -0
- package/dist/esm/components/PromoCode.d.ts +7 -0
- package/dist/esm/components/PromoCode.js +49 -0
- package/dist/esm/components/Quantity.d.ts +13 -0
- package/dist/esm/components/Quantity.js +17 -0
- package/dist/esm/components/Reward.d.ts +10 -0
- package/dist/esm/components/Reward.js +36 -0
- package/dist/esm/components/Rewards.d.ts +10 -0
- package/dist/esm/components/Rewards.js +12 -0
- package/dist/esm/components/SignIn.d.ts +11 -0
- package/dist/esm/components/SignIn.js +35 -0
- package/dist/esm/components/SignInButton.d.ts +8 -0
- package/dist/esm/components/SignInButton.js +39 -0
- package/dist/esm/components/SignInCheckout.d.ts +9 -0
- package/dist/esm/components/SignInCheckout.js +36 -0
- package/dist/esm/components/SignInOptions.d.ts +7 -0
- package/dist/esm/components/SignInOptions.js +25 -0
- package/dist/esm/components/SignInPhone.d.ts +7 -0
- package/dist/esm/components/SignInPhone.js +56 -0
- package/dist/esm/components/SignInQr.d.ts +7 -0
- package/dist/esm/components/SignInQr.js +59 -0
- package/dist/esm/components/SuccessMessage.d.ts +9 -0
- package/dist/esm/components/SuccessMessage.js +8 -0
- package/dist/esm/components/Tag.d.ts +8 -0
- package/dist/esm/components/Tag.js +8 -0
- package/dist/esm/components/TextArea.d.ts +11 -0
- package/dist/esm/components/TextArea.js +20 -0
- package/dist/esm/components/UpsellItem.d.ts +10 -0
- package/dist/esm/components/UpsellItem.js +22 -0
- package/dist/esm/components/Upsells.d.ts +8 -0
- package/dist/esm/components/Upsells.js +22 -0
- package/dist/esm/components/index.d.ts +47 -1
- package/dist/esm/components/index.js +47 -1
- package/dist/esm/config/index.js +1 -1
- package/dist/esm/hooks/useBarcode.js +1 -1
- package/dist/esm/hooks/useChipDNATender/useChipDNATender.js +1 -1
- package/dist/esm/hooks/useEmployee.js +9 -5
- package/dist/esm/hooks/useGiftCardBalance.js +1 -1
- package/dist/esm/hooks/useOrderValidate.js +1 -1
- package/dist/esm/hooks/usePunch.js +1 -1
- package/dist/esm/slices/alerts.js +1 -1
- package/dist/esm/slices/arrivals.js +32 -36
- package/dist/esm/slices/checkout.d.ts +1 -1
- package/dist/esm/slices/checkout.js +329 -351
- package/dist/esm/slices/config.js +79 -81
- package/dist/esm/slices/customer.js +17 -19
- package/dist/esm/slices/customerIdentify.js +16 -18
- package/dist/esm/slices/deals.js +16 -18
- package/dist/esm/slices/discounts.js +19 -21
- package/dist/esm/slices/errorAlerts.d.ts +1 -1
- package/dist/esm/slices/errorAlerts.js +34 -38
- package/dist/esm/slices/kds.js +253 -275
- package/dist/esm/slices/kiosk.d.ts +113 -1
- package/dist/esm/slices/kiosk.js +73 -52
- package/dist/esm/slices/menu.js +24 -26
- package/dist/esm/slices/menuPages.js +16 -18
- package/dist/esm/slices/notifications.js +1 -1
- package/dist/esm/slices/offlineAuths.js +32 -36
- package/dist/esm/slices/order.js +25 -27
- package/dist/esm/slices/pos.js +59 -65
- package/dist/esm/slices/punches.d.ts +1 -1
- package/dist/esm/slices/punches.js +16 -18
- package/dist/esm/slices/refund.js +54 -60
- package/dist/esm/slices/settings.js +56 -62
- package/dist/esm/slices/surcharges.js +19 -21
- package/dist/esm/slices/taxes.js +19 -21
- package/dist/esm/utils/punches.js +1 -1
- package/package.json +82 -75
package/LICENSE.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 Open Tender Inc.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Open Tender Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# Open Tender Store
|
|
2
|
-
|
|
3
|
-
A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API.
|
|
1
|
+
# Open Tender Store
|
|
2
|
+
|
|
3
|
+
A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Allergen as AllergenType } from '@open-tender/types';
|
|
2
|
+
import { AllergenProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const Allergen: ({ allergen, children }: {
|
|
5
|
+
allergen: AllergenType;
|
|
6
|
+
children: (props: AllergenProps) => ReactNode;
|
|
7
|
+
}) => ReactNode;
|
|
8
|
+
export default Allergen;
|
|
@@ -0,0 +1,10 @@
|
|
|
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 Allergen = function (_a) {
|
|
6
|
+
var allergen = _a.allergen, children = _a.children;
|
|
7
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).allergen;
|
|
8
|
+
return children({ config: config, allergen: allergen });
|
|
9
|
+
};
|
|
10
|
+
exports.default = Allergen;
|
|
@@ -0,0 +1,10 @@
|
|
|
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 Applied = function (_a) {
|
|
6
|
+
var children = _a.children;
|
|
7
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).applied;
|
|
8
|
+
return children({ config: config });
|
|
9
|
+
};
|
|
10
|
+
exports.default = Applied;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ButtonLinkProps, Styles } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const ButtonLink: ({ onClick, label, children, style }: {
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
label: string;
|
|
6
|
+
children: (props: ButtonLinkProps) => ReactNode;
|
|
7
|
+
style?: Styles;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
export default ButtonLink;
|
|
@@ -0,0 +1,10 @@
|
|
|
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 ButtonLink = function (_a) {
|
|
6
|
+
var onClick = _a.onClick, label = _a.label, children = _a.children, style = _a.style;
|
|
7
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).buttonLink;
|
|
8
|
+
return children({ config: config, style: style, children: label, onClick: onClick });
|
|
9
|
+
};
|
|
10
|
+
exports.default = ButtonLink;
|
|
@@ -0,0 +1,10 @@
|
|
|
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 Card = function (_a) {
|
|
6
|
+
var children = _a.children, content = _a.content;
|
|
7
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).card;
|
|
8
|
+
return children({ config: config, children: content });
|
|
9
|
+
};
|
|
10
|
+
exports.default = Card;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var ui_1 = require("@open-tender/ui");
|
|
5
|
+
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
var hooks_1 = require("../app/hooks");
|
|
7
|
+
var slices_1 = require("../slices");
|
|
8
|
+
var CartItem_1 = tslib_1.__importDefault(require("./CartItem"));
|
|
9
|
+
var CartUpsells_1 = tslib_1.__importDefault(require("./CartUpsells"));
|
|
10
|
+
var Cart = function (_a) {
|
|
11
|
+
var navigate = _a.navigate, children = _a.children;
|
|
12
|
+
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
13
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).cart;
|
|
14
|
+
var cart = (0, hooks_1.useAppSelector)(slices_1.selectOrder).cart;
|
|
15
|
+
var _b = (0, hooks_1.useAppSelector)(slices_1.selectCartTotals), count = _b.count, total = _b.total;
|
|
16
|
+
var isOpen = (0, hooks_1.useAppSelector)(slices_1.selectCartSummary).isOpen;
|
|
17
|
+
var isEmpty = !cart.length;
|
|
18
|
+
var toggleCart = function () { return dispatch((0, slices_1.toggleCartSummary)()); };
|
|
19
|
+
var checkout = function () { return navigate('/checkout'); };
|
|
20
|
+
var handlers = { checkout: checkout, toggleCart: toggleCart };
|
|
21
|
+
(0, react_1.useEffect)(function () {
|
|
22
|
+
if (!isOpen || !isEmpty)
|
|
23
|
+
return;
|
|
24
|
+
dispatch((0, slices_1.closeCartSummary)());
|
|
25
|
+
}, [dispatch, isOpen, isEmpty]);
|
|
26
|
+
var renderCartItem = function (item, isLast) { return (react_1.default.createElement(CartItem_1.default, { navigate: navigate, item: item, isLast: isLast, children: ui_1.CartItem })); };
|
|
27
|
+
var renderCartUpsells = function () { return (react_1.default.createElement(CartUpsells_1.default, { children: ui_1.CartUpsells })); };
|
|
28
|
+
if (!config)
|
|
29
|
+
return null;
|
|
30
|
+
return children({
|
|
31
|
+
config: config,
|
|
32
|
+
handlers: handlers,
|
|
33
|
+
cart: cart,
|
|
34
|
+
count: count,
|
|
35
|
+
total: total,
|
|
36
|
+
isOpen: isOpen,
|
|
37
|
+
renderCartItem: renderCartItem,
|
|
38
|
+
renderCartUpsells: renderCartUpsells
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
exports.default = Cart;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CartItem as CartItemType } from '@open-tender/types';
|
|
2
|
+
import { CartItemProps } from '@open-tender/ui';
|
|
3
|
+
import React, { ReactNode } from 'react';
|
|
4
|
+
declare const CartItem: ({ item, isLast, isEditable, navigate, children }: {
|
|
5
|
+
item: CartItemType;
|
|
6
|
+
isLast?: boolean;
|
|
7
|
+
isEditable?: boolean;
|
|
8
|
+
navigate: (route: string) => void;
|
|
9
|
+
children: (props: CartItemProps) => ReactNode;
|
|
10
|
+
}) => React.ReactNode;
|
|
11
|
+
export default CartItem;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var ui_1 = require("@open-tender/ui");
|
|
5
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
var hooks_1 = require("../app/hooks");
|
|
7
|
+
var slices_1 = require("../slices");
|
|
8
|
+
var Quantity_1 = tslib_1.__importDefault(require("./Quantity"));
|
|
9
|
+
var CartItem = function (_a) {
|
|
10
|
+
var item = _a.item, _b = _a.isLast, isLast = _b === void 0 ? false : _b, _c = _a.isEditable, isEditable = _c === void 0 ? true : _c, navigate = _a.navigate, children = _a.children;
|
|
11
|
+
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
12
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).cartItem;
|
|
13
|
+
var increment = function () { return dispatch((0, slices_1.incrementItemInCart)(item)); };
|
|
14
|
+
var decrement = function () { return dispatch((0, slices_1.decrementItemInCart)(item)); };
|
|
15
|
+
var remove = function () { return dispatch((0, slices_1.removeItemFromCart)(item)); };
|
|
16
|
+
var edit = function () {
|
|
17
|
+
dispatch((0, slices_1.setCurrentItem)(item));
|
|
18
|
+
navigate('/menu/item');
|
|
19
|
+
};
|
|
20
|
+
var handlers = { increment: increment, decrement: decrement, edit: edit, remove: remove };
|
|
21
|
+
var renderQuantity = function (quantity) { return (react_1.default.createElement(Quantity_1.default, { fontSize: 24, iconSize: 28, quantity: quantity, increment: increment, decrement: decrement, children: ui_1.Quantity })); };
|
|
22
|
+
return children({
|
|
23
|
+
item: item,
|
|
24
|
+
config: config,
|
|
25
|
+
handlers: handlers,
|
|
26
|
+
isLast: isLast,
|
|
27
|
+
isEditable: isEditable,
|
|
28
|
+
renderQuantity: renderQuantity
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
exports.default = CartItem;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CartItem } from '@open-tender/types';
|
|
2
|
+
import { CartUpsellItemProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const CartUpsellItem: ({ item, callback, isLast, children }: {
|
|
5
|
+
item: CartItem;
|
|
6
|
+
callback?: () => void;
|
|
7
|
+
isLast?: boolean;
|
|
8
|
+
children: (props: CartUpsellItemProps) => ReactNode;
|
|
9
|
+
}) => ReactNode;
|
|
10
|
+
export default CartUpsellItem;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var utils_1 = require("@open-tender/utils");
|
|
4
|
+
var hooks_1 = require("../app/hooks");
|
|
5
|
+
var slices_1 = require("../slices");
|
|
6
|
+
var CartUpsellItem = function (_a) {
|
|
7
|
+
var item = _a.item, callback = _a.callback, isLast = _a.isLast, children = _a.children;
|
|
8
|
+
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
9
|
+
var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), config = _b.cartUpsellItem, cardConfig = _b.card;
|
|
10
|
+
var builtItem = (0, utils_1.useBuilder)(item).item;
|
|
11
|
+
var quantity = builtItem.quantity, groups = builtItem.groups;
|
|
12
|
+
var groupsBelowMin = (0, utils_1.hasGroupsBelowMin)(null, groups);
|
|
13
|
+
var isIncomplete = "".concat(quantity) === '' || quantity === 0 || groupsBelowMin;
|
|
14
|
+
var add = function () {
|
|
15
|
+
if (!isIncomplete) {
|
|
16
|
+
dispatch((0, slices_1.addItemToCart)(builtItem));
|
|
17
|
+
if (callback)
|
|
18
|
+
callback();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var handlers = { add: add };
|
|
22
|
+
return children({ config: config, handlers: handlers, item: item, isLast: isLast, cardConfig: cardConfig });
|
|
23
|
+
};
|
|
24
|
+
exports.default = CartUpsellItem;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var ui_1 = require("@open-tender/ui");
|
|
5
|
+
var utils_1 = require("@open-tender/utils");
|
|
6
|
+
var react_1 = tslib_1.__importStar(require("react"));
|
|
7
|
+
var hooks_1 = require("../app/hooks");
|
|
8
|
+
var slices_1 = require("../slices");
|
|
9
|
+
var CartUpsellItem_1 = tslib_1.__importDefault(require("./CartUpsellItem"));
|
|
10
|
+
var CartUpsells = function (_a) {
|
|
11
|
+
var children = _a.children;
|
|
12
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).cartUpsells;
|
|
13
|
+
var cartIds = (0, hooks_1.useAppSelector)(slices_1.selectCartIds);
|
|
14
|
+
var _b = (0, hooks_1.useAppSelector)(slices_1.selectMenu), categories = _b.categories, soldOut = _b.soldOut;
|
|
15
|
+
var upsellItems = (0, react_1.useMemo)(function () { return (0, utils_1.makeUpsellItemsForCart)(categories, cartIds, soldOut); }, [categories, cartIds, soldOut]);
|
|
16
|
+
var renderCartUpsellItem = function (item, isLast) { return (react_1.default.createElement(CartUpsellItem_1.default, { item: item, isLast: isLast, children: ui_1.CartUpsellItem })); };
|
|
17
|
+
if (!upsellItems.length)
|
|
18
|
+
return null;
|
|
19
|
+
return children({
|
|
20
|
+
config: config,
|
|
21
|
+
upsellItems: upsellItems.slice(0, 5),
|
|
22
|
+
renderCartUpsellItem: renderCartUpsellItem
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
exports.default = CartUpsells;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MenuItem, MenuItemFavorite } from '@open-tender/types';
|
|
2
|
+
import { CategoryItemProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const CategoryItem: ({ item, favorite, allergenAlerts, navigate, children }: {
|
|
5
|
+
item: MenuItem;
|
|
6
|
+
favorite?: MenuItemFavorite;
|
|
7
|
+
allergenAlerts?: string[];
|
|
8
|
+
navigate: (route: string) => void;
|
|
9
|
+
children: (props: CategoryItemProps) => ReactNode;
|
|
10
|
+
}) => ReactNode;
|
|
11
|
+
export default CategoryItem;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var utils_1 = require("@open-tender/utils");
|
|
5
|
+
var hooks_1 = require("../app/hooks");
|
|
6
|
+
var slices_1 = require("../slices");
|
|
7
|
+
var CategoryItem = function (_a) {
|
|
8
|
+
var item = _a.item, favorite = _a.favorite, allergenAlerts = _a.allergenAlerts, navigate = _a.navigate, children = _a.children;
|
|
9
|
+
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
10
|
+
var categoryItem = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).categoryItem;
|
|
11
|
+
var soldOut = (0, hooks_1.useAppSelector)(slices_1.selectMenu).soldOut;
|
|
12
|
+
var cartCounts = (0, hooks_1.useAppSelector)(slices_1.selectCartCounts);
|
|
13
|
+
var hasPoints = false;
|
|
14
|
+
var displaySettings = {};
|
|
15
|
+
var _b = displaySettings || {}, _c = _b.calories, showCals = _c === void 0 ? false : _c, _d = _b.tags, showTags = _d === void 0 ? false : _d, _e = _b.allergens, showAllergens = _e === void 0 ? false : _e;
|
|
16
|
+
var showDesc = 'SHOW';
|
|
17
|
+
var orderItem = favorite
|
|
18
|
+
? tslib_1.__assign(tslib_1.__assign({}, (0, utils_1.rehydrateOrderItem)(item, favorite.item)), { index: -1 }) : (0, utils_1.makeOrderItem)(item, undefined, soldOut, undefined, hasPoints);
|
|
19
|
+
var cartItem = (0, utils_1.useOrderItem)(orderItem, favorite, allergenAlerts, cartCounts, showCals, showTags, showAllergens, showDesc);
|
|
20
|
+
var browse = function () {
|
|
21
|
+
dispatch((0, slices_1.setCurrentItem)(cartItem));
|
|
22
|
+
navigate('/menu/item');
|
|
23
|
+
};
|
|
24
|
+
var handlers = { browse: browse };
|
|
25
|
+
return children({ item: cartItem, config: categoryItem, handlers: handlers });
|
|
26
|
+
};
|
|
27
|
+
exports.default = CategoryItem;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CategoryNavProps } from '@open-tender/ui';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
declare const CategoryNav: ({ children, navigate }: {
|
|
4
|
+
children: (props: CategoryNavProps) => ReactNode;
|
|
5
|
+
navigate: (route: string) => void;
|
|
6
|
+
}) => React.ReactNode;
|
|
7
|
+
export default CategoryNav;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var ui_1 = require("@open-tender/ui");
|
|
5
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
var hooks_1 = require("../app/hooks");
|
|
7
|
+
var slices_1 = require("../slices");
|
|
8
|
+
var CategoryNavItem_1 = tslib_1.__importDefault(require("./CategoryNavItem"));
|
|
9
|
+
var CategoryNavOther_1 = tslib_1.__importDefault(require("./CategoryNavOther"));
|
|
10
|
+
var CategoryNav = function (_a) {
|
|
11
|
+
var children = _a.children, navigate = _a.navigate;
|
|
12
|
+
var categoryNav = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).categoryNav;
|
|
13
|
+
var _b = (0, hooks_1.useAppSelector)(slices_1.selectMenu), categories = _b.categories, featured = _b.featured, favorites = _b.favorites, recents = _b.recents;
|
|
14
|
+
var renderCategoryNavOther = function (title, path) { return (react_1.default.createElement(CategoryNavOther_1.default, { navigate: navigate, title: title, path: path, children: ui_1.CategoryNavOther })); };
|
|
15
|
+
var renderCategoryNavItem = function (item) { return (react_1.default.createElement(CategoryNavItem_1.default, { navigate: navigate, category: item, children: ui_1.CategoryNavItem })); };
|
|
16
|
+
return children({
|
|
17
|
+
config: categoryNav,
|
|
18
|
+
categories: categories,
|
|
19
|
+
featured: featured,
|
|
20
|
+
favorites: favorites,
|
|
21
|
+
recents: recents,
|
|
22
|
+
renderCategoryNavOther: renderCategoryNavOther,
|
|
23
|
+
renderCategoryNavItem: renderCategoryNavItem
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
exports.default = CategoryNav;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MenuCategory } from '@open-tender/types';
|
|
2
|
+
import { CategoryNavItemProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const CategoryNavItem: ({ category, children, navigate }: {
|
|
5
|
+
category: MenuCategory;
|
|
6
|
+
navigate: (route: string) => void;
|
|
7
|
+
children: (props: CategoryNavItemProps) => ReactNode;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
export default CategoryNavItem;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var ui_1 = require("@open-tender/ui");
|
|
4
|
+
var hooks_1 = require("../app/hooks");
|
|
5
|
+
var slices_1 = require("../slices");
|
|
6
|
+
var CategoryNavItem = function (_a) {
|
|
7
|
+
var category = _a.category, children = _a.children, navigate = _a.navigate;
|
|
8
|
+
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
9
|
+
var current = (0, hooks_1.useAppSelector)(slices_1.selectCurrentCategory);
|
|
10
|
+
var isCurrent = (current === null || current === void 0 ? void 0 : current.id) === category.id;
|
|
11
|
+
var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), categoryNavItem = _b.categoryNavItem, categoryNavItemSelected = _b.categoryNavItemSelected;
|
|
12
|
+
var config = isCurrent ? categoryNavItemSelected : categoryNavItem;
|
|
13
|
+
var name = category.name;
|
|
14
|
+
var imageUrl = (0, ui_1.makeImageUrl)(category);
|
|
15
|
+
var browse = function () {
|
|
16
|
+
dispatch((0, slices_1.setCurrentCategory)(category));
|
|
17
|
+
navigate('/menu/category');
|
|
18
|
+
};
|
|
19
|
+
var handlers = { browse: browse };
|
|
20
|
+
return children({
|
|
21
|
+
config: config,
|
|
22
|
+
handlers: handlers,
|
|
23
|
+
title: name,
|
|
24
|
+
imageUrl: imageUrl
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
exports.default = CategoryNavItem;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CategoryNavOtherProps } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const CategoryNavOther: ({ title, path, navigate, children }: {
|
|
4
|
+
title: string;
|
|
5
|
+
path: string;
|
|
6
|
+
navigate: (route: string) => void;
|
|
7
|
+
children: (props: CategoryNavOtherProps) => ReactNode;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
export default CategoryNavOther;
|
|
@@ -0,0 +1,19 @@
|
|
|
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 CategoryNavOther = function (_a) {
|
|
6
|
+
var title = _a.title, path = _a.path, navigate = _a.navigate, children = _a.children;
|
|
7
|
+
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
8
|
+
var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), categoryNavItem = _b.categoryNavItem, categoryNavItemSelected = _b.categoryNavItemSelected;
|
|
9
|
+
var currentSection = (0, hooks_1.useAppSelector)(slices_1.selectCurrentSection);
|
|
10
|
+
var isCurrent = path === currentSection;
|
|
11
|
+
var config = isCurrent ? categoryNavItemSelected : categoryNavItem;
|
|
12
|
+
var browse = function () {
|
|
13
|
+
dispatch((0, slices_1.setCurrentCategory)(null));
|
|
14
|
+
navigate(path);
|
|
15
|
+
};
|
|
16
|
+
var handlers = { browse: browse };
|
|
17
|
+
return children({ config: config, handlers: handlers, title: title, imageUrl: null });
|
|
18
|
+
};
|
|
19
|
+
exports.default = CategoryNavOther;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Order } from '@open-tender/types';
|
|
2
|
+
import { CheckTotalsProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const CheckTotals: ({ check, children }: {
|
|
5
|
+
check: Order;
|
|
6
|
+
children: (props: CheckTotalsProps) => ReactNode;
|
|
7
|
+
}) => ReactNode;
|
|
8
|
+
export default CheckTotals;
|
|
@@ -0,0 +1,10 @@
|
|
|
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 CheckTotals = function (_a) {
|
|
6
|
+
var check = _a.check, children = _a.children;
|
|
7
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).checkTotals;
|
|
8
|
+
return children({ config: config, check: check });
|
|
9
|
+
};
|
|
10
|
+
exports.default = CheckTotals;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Discount as DiscountType } from '@open-tender/types';
|
|
2
|
+
import { DiscountProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const Discount: ({ discount, children }: {
|
|
5
|
+
discount: DiscountType;
|
|
6
|
+
children: (props: DiscountProps) => ReactNode;
|
|
7
|
+
}) => ReactNode;
|
|
8
|
+
export default Discount;
|
|
@@ -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 Discount = function (_a) {
|
|
6
|
+
var discount = _a.discount, children = _a.children;
|
|
7
|
+
var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), config = _b.discount, cardConfig = _b.card;
|
|
8
|
+
if (!config)
|
|
9
|
+
return null;
|
|
10
|
+
return children({ config: config, discount: discount, cardConfig: cardConfig });
|
|
11
|
+
};
|
|
12
|
+
exports.default = Discount;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ErrorMessageProps, Styles } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const ErrorMessage: ({ content, icon, style, children }: {
|
|
4
|
+
content: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
style?: Styles;
|
|
7
|
+
children: (props: ErrorMessageProps) => ReactNode;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
export default ErrorMessage;
|
|
@@ -0,0 +1,10 @@
|
|
|
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 ErrorMessage = function (_a) {
|
|
6
|
+
var content = _a.content, icon = _a.icon, style = _a.style, children = _a.children;
|
|
7
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).errorMessage;
|
|
8
|
+
return children({ config: config, icon: icon, style: style, children: content });
|
|
9
|
+
};
|
|
10
|
+
exports.default = ErrorMessage;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HeaderProps } from '@open-tender/ui';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
declare const Header: ({ to, pathname, navigate, children }: {
|
|
4
|
+
to?: string;
|
|
5
|
+
pathname: string;
|
|
6
|
+
navigate: (route: string) => void;
|
|
7
|
+
children: (props: HeaderProps) => ReactNode;
|
|
8
|
+
}) => React.ReactNode;
|
|
9
|
+
export default Header;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var ui_1 = require("@open-tender/ui");
|
|
5
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
var hooks_1 = require("../app/hooks");
|
|
7
|
+
var slices_1 = require("../slices");
|
|
8
|
+
var SignInButton_1 = tslib_1.__importDefault(require("./SignInButton"));
|
|
9
|
+
var Header = function (_a) {
|
|
10
|
+
var to = _a.to, pathname = _a.pathname, navigate = _a.navigate, children = _a.children;
|
|
11
|
+
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
12
|
+
var header = ((0, hooks_1.useAppSelector)(slices_1.selectKioskConfig) || {}).header;
|
|
13
|
+
var back = function () {
|
|
14
|
+
if (to)
|
|
15
|
+
navigate(to);
|
|
16
|
+
};
|
|
17
|
+
var open = function () {
|
|
18
|
+
dispatch((0, slices_1.toggleSidebar)());
|
|
19
|
+
};
|
|
20
|
+
var handlers = to ? { back: back, open: open } : null;
|
|
21
|
+
var renderSignInButton = function () { return (react_1.default.createElement(SignInButton_1.default, { pathname: pathname, navigate: navigate, children: ui_1.SignInButton })); };
|
|
22
|
+
if (!header)
|
|
23
|
+
return null;
|
|
24
|
+
return children({ config: header, handlers: handlers, renderSignInButton: renderSignInButton });
|
|
25
|
+
};
|
|
26
|
+
exports.default = Header;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IngredientsProps } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const Ingredients: ({ title, subtitle, ingredients, close, children }: {
|
|
4
|
+
title: string;
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
ingredients: string;
|
|
7
|
+
close: () => void;
|
|
8
|
+
children: (props: IngredientsProps) => ReactNode;
|
|
9
|
+
}) => ReactNode;
|
|
10
|
+
export default Ingredients;
|
|
@@ -0,0 +1,11 @@
|
|
|
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 Ingredients = function (_a) {
|
|
6
|
+
var title = _a.title, subtitle = _a.subtitle, ingredients = _a.ingredients, close = _a.close, children = _a.children;
|
|
7
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).ingredients;
|
|
8
|
+
var handlers = { close: close };
|
|
9
|
+
return children({ config: config, handlers: handlers, title: title, subtitle: subtitle, ingredients: ingredients });
|
|
10
|
+
};
|
|
11
|
+
exports.default = Ingredients;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InputProps, Styles } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const Input: ({ label, value, setValue, isRequired, style, children }: {
|
|
4
|
+
label?: string;
|
|
5
|
+
value: string;
|
|
6
|
+
setValue: (value: string) => void;
|
|
7
|
+
isRequired?: boolean;
|
|
8
|
+
style?: Styles;
|
|
9
|
+
children: (props: InputProps) => ReactNode;
|
|
10
|
+
}) => ReactNode;
|
|
11
|
+
export default Input;
|
|
@@ -0,0 +1,22 @@
|
|
|
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 Input = function (_a) {
|
|
6
|
+
var label = _a.label, value = _a.value, setValue = _a.setValue, isRequired = _a.isRequired, style = _a.style, children = _a.children;
|
|
7
|
+
var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), config = _b.input, labelConfig = _b.label;
|
|
8
|
+
var update = function (evt) {
|
|
9
|
+
setValue(evt.target.value);
|
|
10
|
+
};
|
|
11
|
+
var handlers = { update: update };
|
|
12
|
+
return children({
|
|
13
|
+
config: config,
|
|
14
|
+
handlers: handlers,
|
|
15
|
+
label: label,
|
|
16
|
+
value: value,
|
|
17
|
+
isRequired: isRequired,
|
|
18
|
+
style: style,
|
|
19
|
+
labelConfig: labelConfig
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
exports.default = Input;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CartItemGroup } from '@open-tender/types';
|
|
2
|
+
import { ItemGroupProps } from '@open-tender/ui';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare const ItemGroup: ({ group, content, children }: {
|
|
5
|
+
group: CartItemGroup;
|
|
6
|
+
content: ReactNode;
|
|
7
|
+
children: (props: ItemGroupProps) => ReactNode;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
export default ItemGroup;
|