ordering-ui-admin-external 1.28.0 → 1.29.0
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/_bundles/main.css +294 -26
- package/_bundles/{ordering-ui-admin.88341b2ec95c8949082e.js → ordering-ui-admin.452c5996b9b7ebdf8016.js} +2 -2
- package/_bundles/{ordering-ui-admin.88341b2ec95c8949082e.js.LICENSE.txt → ordering-ui-admin.452c5996b9b7ebdf8016.js.LICENSE.txt} +8 -0
- package/_modules/components/Delivery/AddressForm/styles.js +2 -2
- package/_modules/components/Delivery/AddressList/index.js +9 -56
- package/_modules/components/Delivery/AddressList/styles.js +1 -1
- package/_modules/components/Delivery/DriversGroupLogs/index.js +5 -2
- package/_modules/components/Delivery/UserAddForm/index.js +16 -4
- package/_modules/components/Delivery/UserFormDetails/index.js +17 -5
- package/_modules/components/Home/HomePage/index.js +5 -1
- package/_modules/components/MyProducts/OrderingWebsite/index.js +5 -1
- package/_modules/components/OrderingProducts/SiteTheme/index.js +1 -1
- package/_modules/components/Orders/CreateCustomOrder/CardForm/index.js +96 -0
- package/_modules/components/Orders/CreateCustomOrder/CardForm/styles.js +35 -0
- package/_modules/components/Orders/CreateCustomOrder/CardFormCustom/cardUtils.js +102 -0
- package/_modules/components/Orders/CreateCustomOrder/CardFormCustom/index.js +148 -0
- package/_modules/components/Orders/CreateCustomOrder/CardFormCustom/styles.js +16 -0
- package/_modules/components/Orders/CreateCustomOrder/CartBill/index.js +275 -0
- package/_modules/components/Orders/CreateCustomOrder/CartBill/styles.js +23 -0
- package/_modules/components/Orders/CreateCustomOrder/Checkout/index.js +498 -0
- package/_modules/components/Orders/CreateCustomOrder/Checkout/styles.js +31 -0
- package/_modules/components/Orders/CreateCustomOrder/CouponControl/index.js +100 -0
- package/_modules/components/Orders/CreateCustomOrder/CouponControl/styles.js +17 -0
- package/_modules/components/Orders/CreateCustomOrder/CustomOrderDetails/index.js +139 -0
- package/_modules/components/Orders/CreateCustomOrder/CustomOrderDetails/styles.js +17 -0
- package/_modules/components/Orders/CreateCustomOrder/DriverTips/index.js +101 -0
- package/_modules/components/Orders/CreateCustomOrder/DriverTips/styles.js +37 -0
- package/_modules/components/Orders/CreateCustomOrder/Map/index.js +131 -0
- package/_modules/components/Orders/CreateCustomOrder/Map/styles.js +12 -0
- package/_modules/components/Orders/CreateCustomOrder/PaymentOptionCard/index.js +83 -0
- package/_modules/components/Orders/CreateCustomOrder/PaymentOptionCash/index.js +81 -0
- package/_modules/components/Orders/CreateCustomOrder/PaymentOptionCash/styles.js +23 -0
- package/_modules/components/Orders/CreateCustomOrder/PaymentOptionPaypal/index.js +45 -0
- package/_modules/components/Orders/CreateCustomOrder/PaymentOptionPaypal/styles.js +12 -0
- package/_modules/components/Orders/CreateCustomOrder/PaymentOptionSquare/index.js +112 -0
- package/_modules/components/Orders/CreateCustomOrder/PaymentOptionSquare/styles.js +21 -0
- package/_modules/components/Orders/CreateCustomOrder/PaymentOptionStripe/index.js +259 -0
- package/_modules/components/Orders/CreateCustomOrder/PaymentOptionStripe/styles.js +66 -0
- package/_modules/components/Orders/CreateCustomOrder/PaymentOptionWallet/index.js +173 -0
- package/_modules/components/Orders/CreateCustomOrder/PaymentOptionWallet/styles.js +26 -0
- package/_modules/components/Orders/CreateCustomOrder/PaymentOptions/index.js +400 -0
- package/_modules/components/Orders/CreateCustomOrder/PaymentOptions/styles.js +40 -0
- package/_modules/components/Orders/CreateCustomOrder/ProductForm/index.js +613 -0
- package/_modules/components/Orders/CreateCustomOrder/ProductForm/styles.js +109 -0
- package/_modules/components/Orders/CreateCustomOrder/ProductIngredient/index.js +39 -0
- package/_modules/components/Orders/CreateCustomOrder/ProductIngredient/styles.js +23 -0
- package/_modules/components/Orders/CreateCustomOrder/ProductOption/index.js +51 -0
- package/_modules/components/Orders/CreateCustomOrder/ProductOption/styles.js +29 -0
- package/_modules/components/Orders/CreateCustomOrder/ProductOptionSubOption/index.js +148 -0
- package/_modules/components/Orders/CreateCustomOrder/ProductOptionSubOption/styles.js +79 -0
- package/_modules/components/Orders/CreateCustomOrder/SelectBusinesses/index.js +82 -0
- package/_modules/components/Orders/CreateCustomOrder/SelectBusinesses/styles.js +21 -0
- package/_modules/components/Orders/CreateCustomOrder/SelectCustomer/index.js +191 -0
- package/_modules/components/Orders/CreateCustomOrder/SelectCustomer/styles.js +68 -0
- package/_modules/components/Orders/CreateCustomOrder/SelectProducts/index.js +234 -0
- package/_modules/components/Orders/CreateCustomOrder/SelectProducts/styles.js +54 -0
- package/_modules/components/Orders/CreateCustomOrder/SingleProductCard/index.js +99 -0
- package/_modules/components/Orders/CreateCustomOrder/SingleProductCard/styles.js +131 -0
- package/_modules/components/Orders/CreateCustomOrder/StripeElementsForm/index.js +73 -0
- package/_modules/components/Orders/CreateCustomOrder/StripeElementsForm/styles.js +17 -0
- package/_modules/components/Orders/CreateCustomOrder/StripeMethodForm/index.js +124 -0
- package/_modules/components/Orders/CreateCustomOrder/StripeMethodForm/styles.js +12 -0
- package/_modules/components/Orders/CreateCustomOrder/StripeRedirectForm/index.js +83 -0
- package/_modules/components/Orders/CreateCustomOrder/StripeRedirectForm/styles.js +21 -0
- package/_modules/components/Orders/CreateCustomOrder/TaxInformation/index.js +48 -0
- package/_modules/components/Orders/CreateCustomOrder/TaxInformation/styles.js +14 -0
- package/_modules/components/Orders/CreateCustomOrder/index.js +59 -0
- package/_modules/components/Orders/OrderToPrintTicket/index.js +2 -2
- package/_modules/components/Orders/OrdersDashboardControls/index.js +6 -2
- package/_modules/components/Orders/OrdersDashboardControls/styles.js +3 -3
- package/_modules/components/Orders/OrdersExportCSV/styles.js +14 -8
- package/_modules/components/Orders/OrdersManager/index.js +6 -4
- package/_modules/components/Orders/OrdersManager/styles.js +1 -1
- package/_modules/components/Shared/AutoScroll/index.js +1 -0
- package/_modules/components/Shared/LinkableText/index.js +22 -0
- package/_modules/components/Shared/Tabs/index.js +32 -0
- package/_modules/components/Shared/index.js +20 -0
- package/_modules/components/SidebarMenu/index.js +2 -1
- package/_modules/components/Stores/BusinessProductsListing/index.js +7 -3
- package/_modules/components/Stores/BusinessQRCodeOption/index.js +6 -2
- package/_modules/components/Stores/BusinessSummary/index.js +7 -3
- package/_modules/components/Users/UserAddForm/index.js +13 -5
- package/_modules/components/Users/UserAddForm/styles.js +1 -1
- package/_modules/styles/Selects/index.js +1 -1
- package/_modules/utils/index.js +9 -2
- package/index-template.js +1 -1
- package/package.json +6 -4
- package/src/components/Delivery/AddressForm/styles.js +3 -3
- package/src/components/Delivery/AddressList/index.js +6 -61
- package/src/components/Delivery/AddressList/styles.js +1 -1
- package/src/components/Delivery/DriversGroupLogs/index.js +8 -2
- package/src/components/Delivery/UserAddForm/index.js +32 -13
- package/src/components/Delivery/UserFormDetails/index.js +30 -13
- package/src/components/Home/HomePage/index.js +3 -2
- package/src/components/MyProducts/OrderingWebsite/index.js +9 -8
- package/src/components/OrderingProducts/SiteTheme/index.js +1 -1
- package/src/components/Orders/CreateCustomOrder/CardForm/index.js +135 -0
- package/src/components/Orders/CreateCustomOrder/CardForm/styles.js +135 -0
- package/src/components/Orders/CreateCustomOrder/CardFormCustom/cardUtils.js +111 -0
- package/src/components/Orders/CreateCustomOrder/CardFormCustom/index.js +161 -0
- package/src/components/Orders/CreateCustomOrder/CardFormCustom/styles.js +20 -0
- package/src/components/Orders/CreateCustomOrder/CartBill/index.js +267 -0
- package/src/components/Orders/CreateCustomOrder/CartBill/styles.js +67 -0
- package/src/components/Orders/CreateCustomOrder/Checkout/index.js +519 -0
- package/src/components/Orders/CreateCustomOrder/Checkout/styles.js +85 -0
- package/src/components/Orders/CreateCustomOrder/CouponControl/index.js +90 -0
- package/src/components/Orders/CreateCustomOrder/CouponControl/styles.js +22 -0
- package/src/components/Orders/CreateCustomOrder/CustomOrderDetails/index.js +132 -0
- package/src/components/Orders/CreateCustomOrder/CustomOrderDetails/styles.js +28 -0
- package/src/components/Orders/CreateCustomOrder/DriverTips/index.js +113 -0
- package/src/components/Orders/CreateCustomOrder/DriverTips/styles.js +91 -0
- package/src/components/Orders/CreateCustomOrder/Map/index.js +115 -0
- package/src/components/Orders/CreateCustomOrder/Map/styles.js +10 -0
- package/src/components/Orders/CreateCustomOrder/PaymentOptionCard/index.js +70 -0
- package/src/components/Orders/CreateCustomOrder/PaymentOptionCash/index.js +83 -0
- package/src/components/Orders/CreateCustomOrder/PaymentOptionCash/styles.js +50 -0
- package/src/components/Orders/CreateCustomOrder/PaymentOptionPaypal/index.js +43 -0
- package/src/components/Orders/CreateCustomOrder/PaymentOptionPaypal/styles.js +5 -0
- package/src/components/Orders/CreateCustomOrder/PaymentOptionSquare/index.js +105 -0
- package/src/components/Orders/CreateCustomOrder/PaymentOptionSquare/styles.js +27 -0
- package/src/components/Orders/CreateCustomOrder/PaymentOptionStripe/index.js +261 -0
- package/src/components/Orders/CreateCustomOrder/PaymentOptionStripe/styles.js +159 -0
- package/src/components/Orders/CreateCustomOrder/PaymentOptionWallet/index.js +172 -0
- package/src/components/Orders/CreateCustomOrder/PaymentOptionWallet/styles.js +33 -0
- package/src/components/Orders/CreateCustomOrder/PaymentOptions/index.js +440 -0
- package/src/components/Orders/CreateCustomOrder/PaymentOptions/styles.js +132 -0
- package/src/components/Orders/CreateCustomOrder/ProductForm/index.js +701 -0
- package/src/components/Orders/CreateCustomOrder/ProductForm/styles.js +540 -0
- package/src/components/Orders/CreateCustomOrder/ProductIngredient/index.js +43 -0
- package/src/components/Orders/CreateCustomOrder/ProductIngredient/styles.js +29 -0
- package/src/components/Orders/CreateCustomOrder/ProductOption/index.js +58 -0
- package/src/components/Orders/CreateCustomOrder/ProductOption/styles.js +76 -0
- package/src/components/Orders/CreateCustomOrder/ProductOptionSubOption/index.js +182 -0
- package/src/components/Orders/CreateCustomOrder/ProductOptionSubOption/styles.js +195 -0
- package/src/components/Orders/CreateCustomOrder/SelectBusinesses/index.js +67 -0
- package/src/components/Orders/CreateCustomOrder/SelectBusinesses/styles.js +63 -0
- package/src/components/Orders/CreateCustomOrder/SelectCustomer/index.js +241 -0
- package/src/components/Orders/CreateCustomOrder/SelectCustomer/styles.js +235 -0
- package/src/components/Orders/CreateCustomOrder/SelectProducts/index.js +237 -0
- package/src/components/Orders/CreateCustomOrder/SelectProducts/styles.js +161 -0
- package/src/components/Orders/CreateCustomOrder/SingleProductCard/index.js +105 -0
- package/src/components/Orders/CreateCustomOrder/SingleProductCard/styles.js +314 -0
- package/src/components/Orders/CreateCustomOrder/StripeElementsForm/index.js +71 -0
- package/src/components/Orders/CreateCustomOrder/StripeElementsForm/styles.js +13 -0
- package/src/components/Orders/CreateCustomOrder/StripeMethodForm/index.js +90 -0
- package/src/components/Orders/CreateCustomOrder/StripeMethodForm/styles.js +9 -0
- package/src/components/Orders/CreateCustomOrder/StripeRedirectForm/index.js +96 -0
- package/src/components/Orders/CreateCustomOrder/StripeRedirectForm/styles.js +73 -0
- package/src/components/Orders/CreateCustomOrder/TaxInformation/index.js +69 -0
- package/src/components/Orders/CreateCustomOrder/TaxInformation/styles.js +25 -0
- package/src/components/Orders/CreateCustomOrder/index.js +45 -0
- package/src/components/Orders/OrderToPrintTicket/index.js +1 -1
- package/src/components/Orders/OrdersDashboardControls/index.js +4 -1
- package/src/components/Orders/OrdersDashboardControls/styles.js +13 -11
- package/src/components/Orders/OrdersExportCSV/styles.js +16 -0
- package/src/components/Orders/OrdersManager/index.js +5 -1
- package/src/components/Orders/OrdersManager/styles.js +2 -0
- package/src/components/Shared/AutoScroll/index.js +1 -0
- package/src/components/Shared/LinkableText/index.js +17 -0
- package/src/components/Shared/Tabs/index.js +28 -0
- package/src/components/Shared/index.js +5 -0
- package/src/components/SidebarMenu/index.js +1 -1
- package/src/components/Stores/BusinessProductsListing/index.js +6 -3
- package/src/components/Stores/BusinessQRCodeOption/index.js +5 -3
- package/src/components/Stores/BusinessSummary/index.js +6 -4
- package/src/components/Users/UserAddForm/index.js +12 -3
- package/src/components/Users/UserAddForm/styles.js +2 -2
- package/src/styles/Selects/index.js +1 -1
- package/src/utils/index.js +5 -0
|
@@ -0,0 +1,613 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ProductForm = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _orderingComponentsAdminExternal = require("ordering-components-admin-external");
|
|
10
|
+
var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skeleton"));
|
|
11
|
+
var _styledComponents = require("styled-components");
|
|
12
|
+
var _FiMinusCircle = _interopRequireDefault(require("@meronex/icons/fi/FiMinusCircle"));
|
|
13
|
+
var _FiPlusCircle = _interopRequireDefault(require("@meronex/icons/fi/FiPlusCircle"));
|
|
14
|
+
var _MdcPlayCircleOutline = _interopRequireDefault(require("@meronex/icons/mdc/MdcPlayCircleOutline"));
|
|
15
|
+
var _Shared = require("../../../Shared");
|
|
16
|
+
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
17
|
+
var _utils = require("../../../../utils");
|
|
18
|
+
var _useWindowSize = require("../../../../hooks/useWindowSize");
|
|
19
|
+
var _ProductIngredient = require("../ProductIngredient");
|
|
20
|
+
var _ProductOption = require("../ProductOption");
|
|
21
|
+
var _ProductOptionSubOption = require("../ProductOptionSubOption");
|
|
22
|
+
var _styles = require("../../../../styles");
|
|
23
|
+
var _react2 = require("swiper/react");
|
|
24
|
+
var _swiper = _interopRequireWildcard(require("swiper"));
|
|
25
|
+
require("swiper/swiper-bundle.min.css");
|
|
26
|
+
require("swiper/swiper.min.css");
|
|
27
|
+
var _styles2 = require("./styles");
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
30
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
32
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
33
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
34
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
35
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
36
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
37
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
38
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
39
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
40
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
41
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
42
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
43
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
44
|
+
_swiper.default.use([_swiper.Navigation, _swiper.Thumbs]);
|
|
45
|
+
var ProductOptionsUI = function ProductOptionsUI(props) {
|
|
46
|
+
var _configs$unaddressed_, _theme$business_view, _theme$business_view$, _theme$business_view$2, _theme$business_view$3, _theme$business_view$4, _theme$business_view$5, _theme$business_view$6, _theme$defaultLanguag, _product$tags, _product$ingredients2, _product$extras, _product$ingredients3, _product$ingredients4, _product$ingredients5, _product$extras2, _theme$defaultLanguag2, _theme$defaultLanguag3, _props$afterMidElemen, _props$afterMidCompon, _orderState$options, _orderState$options2, _orderState$options3, _orderState$options4, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _error$;
|
|
47
|
+
var editMode = props.editMode,
|
|
48
|
+
isSoldOut = props.isSoldOut,
|
|
49
|
+
productObject = props.productObject,
|
|
50
|
+
productCart = props.productCart,
|
|
51
|
+
increment = props.increment,
|
|
52
|
+
decrement = props.decrement,
|
|
53
|
+
handleChangeProductCartQuantity = props.handleChangeProductCartQuantity,
|
|
54
|
+
showOption = props.showOption,
|
|
55
|
+
maxProductQuantity = props.maxProductQuantity,
|
|
56
|
+
errors = props.errors,
|
|
57
|
+
handleSave = props.handleSave,
|
|
58
|
+
handleChangeIngredientState = props.handleChangeIngredientState,
|
|
59
|
+
handleChangeSuboptionState = props.handleChangeSuboptionState,
|
|
60
|
+
handleChangeCommentState = props.handleChangeCommentState,
|
|
61
|
+
productAddedToCartLength = props.productAddedToCartLength,
|
|
62
|
+
handleFavoriteProduct = props.handleFavoriteProduct,
|
|
63
|
+
actionStatus = props.actionStatus,
|
|
64
|
+
isCustomerMode = props.isCustomerMode;
|
|
65
|
+
var product = productObject.product,
|
|
66
|
+
loading = productObject.loading,
|
|
67
|
+
error = productObject.error;
|
|
68
|
+
var windowSize = (0, _useWindowSize.useWindowSize)();
|
|
69
|
+
// const [{ auth }, { login }] = useSession()
|
|
70
|
+
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
71
|
+
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
72
|
+
t = _useLanguage2[1];
|
|
73
|
+
var _useOrder = (0, _orderingComponentsAdminExternal.useOrder)(),
|
|
74
|
+
_useOrder2 = _slicedToArray(_useOrder, 1),
|
|
75
|
+
orderState = _useOrder2[0];
|
|
76
|
+
var _useUtils = (0, _orderingComponentsAdminExternal.useUtils)(),
|
|
77
|
+
_useUtils2 = _slicedToArray(_useUtils, 1),
|
|
78
|
+
_useUtils2$ = _useUtils2[0],
|
|
79
|
+
optimizeImage = _useUtils2$.optimizeImage,
|
|
80
|
+
parsePrice = _useUtils2$.parsePrice;
|
|
81
|
+
var theme = (0, _styledComponents.useTheme)();
|
|
82
|
+
var _useState = (0, _react.useState)('all'),
|
|
83
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
84
|
+
tabValue = _useState2[0],
|
|
85
|
+
setTabValue = _useState2[1];
|
|
86
|
+
var productContainerRef = (0, _react.useRef)(null);
|
|
87
|
+
var _useState3 = (0, _react.useState)([]),
|
|
88
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
89
|
+
gallery = _useState4[0],
|
|
90
|
+
setGallery = _useState4[1];
|
|
91
|
+
var _useState5 = (0, _react.useState)(null),
|
|
92
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
93
|
+
videoGallery = _useState6[0],
|
|
94
|
+
setVideoGallery = _useState6[1];
|
|
95
|
+
var _useState7 = (0, _react.useState)(null),
|
|
96
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
97
|
+
thumbsSwiper = _useState8[0],
|
|
98
|
+
setThumbsSwiper = _useState8[1];
|
|
99
|
+
var _useState9 = (0, _react.useState)(false),
|
|
100
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
101
|
+
isHaveWeight = _useState10[0],
|
|
102
|
+
setIsHaveWeight = _useState10[1];
|
|
103
|
+
var _useState11 = (0, _react.useState)(false),
|
|
104
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
105
|
+
isScrollAvailable = _useState12[0],
|
|
106
|
+
setIsScrollAvailable = _useState12[1];
|
|
107
|
+
var _useState13 = (0, _react.useState)({
|
|
108
|
+
weight_unit: false,
|
|
109
|
+
pieces: true
|
|
110
|
+
}),
|
|
111
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
112
|
+
qtyBy = _useState14[0],
|
|
113
|
+
setQtyBy = _useState14[1];
|
|
114
|
+
var _useState15 = (0, _react.useState)(null),
|
|
115
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
116
|
+
pricePerWeightUnit = _useState16[0],
|
|
117
|
+
setPricePerWeightUnit = _useState16[1];
|
|
118
|
+
var _useState17 = (0, _react.useState)({
|
|
119
|
+
open: false,
|
|
120
|
+
content: []
|
|
121
|
+
}),
|
|
122
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
123
|
+
alertState = _useState18[0],
|
|
124
|
+
setAlertState = _useState18[1];
|
|
125
|
+
var galleryLength = (gallery === null || gallery === void 0 ? void 0 : gallery.length) + (videoGallery === null || videoGallery === void 0 ? void 0 : videoGallery.length);
|
|
126
|
+
var _useConfig = (0, _orderingComponentsAdminExternal.useConfig)(),
|
|
127
|
+
_useConfig2 = _slicedToArray(_useConfig, 1),
|
|
128
|
+
configs = _useConfig2[0].configs;
|
|
129
|
+
var unaddressedTypes = (configs === null || configs === void 0 ? void 0 : (_configs$unaddressed_ = configs.unaddressed_order_types_allowed) === null || _configs$unaddressed_ === void 0 ? void 0 : _configs$unaddressed_.value.split('|').map(function (value) {
|
|
130
|
+
return Number(value);
|
|
131
|
+
})) || [];
|
|
132
|
+
var hideProductDescription = theme === null || theme === void 0 ? void 0 : (_theme$business_view = theme.business_view) === null || _theme$business_view === void 0 ? void 0 : (_theme$business_view$ = _theme$business_view.components) === null || _theme$business_view$ === void 0 ? void 0 : (_theme$business_view$2 = _theme$business_view$.products) === null || _theme$business_view$2 === void 0 ? void 0 : (_theme$business_view$3 = _theme$business_view$2.components) === null || _theme$business_view$3 === void 0 ? void 0 : (_theme$business_view$4 = _theme$business_view$3.product) === null || _theme$business_view$4 === void 0 ? void 0 : (_theme$business_view$5 = _theme$business_view$4.components) === null || _theme$business_view$5 === void 0 ? void 0 : (_theme$business_view$6 = _theme$business_view$5.description) === null || _theme$business_view$6 === void 0 ? void 0 : _theme$business_view$6.hidden;
|
|
133
|
+
var handleChangeFavorite = function handleChangeFavorite() {
|
|
134
|
+
handleFavoriteProduct && handleFavoriteProduct(product, !(product !== null && product !== void 0 && product.favorite));
|
|
135
|
+
};
|
|
136
|
+
var handleSaveProduct = function handleSaveProduct() {
|
|
137
|
+
var _Object$values;
|
|
138
|
+
var isErrors = ((_Object$values = Object.values(errors)) === null || _Object$values === void 0 ? void 0 : _Object$values.length) > 0;
|
|
139
|
+
if (!isErrors) {
|
|
140
|
+
handleSave && handleSave();
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
var myElement = document.getElementsByClassName('error')[0];
|
|
144
|
+
var productContainer = document.getElementsByClassName('product-container')[0];
|
|
145
|
+
if (!myElement || !productContainer) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
var topPos = myElement.offsetTop - productContainer.offsetTop;
|
|
149
|
+
if (windowSize.width <= 768) {
|
|
150
|
+
var productImage = document.getElementById('product_image');
|
|
151
|
+
topPos = topPos + (myElement.offsetTop < (productImage === null || productImage === void 0 ? void 0 : productImage.clientHeight) ? productImage === null || productImage === void 0 ? void 0 : productImage.clientHeight : 0);
|
|
152
|
+
}
|
|
153
|
+
(0, _utils.scrollTo)(productContainer, topPos, 1250);
|
|
154
|
+
};
|
|
155
|
+
var isError = function isError(id) {
|
|
156
|
+
var classnames = '';
|
|
157
|
+
if (errors["id:".concat(id)]) {
|
|
158
|
+
classnames = 'error';
|
|
159
|
+
}
|
|
160
|
+
if (isSoldOut || maxProductQuantity <= 0) {
|
|
161
|
+
classnames += ' soldout';
|
|
162
|
+
}
|
|
163
|
+
return classnames;
|
|
164
|
+
};
|
|
165
|
+
var handleChangeTabValue = function handleChangeTabValue(value) {
|
|
166
|
+
if (document.getElementById("".concat(value))) {
|
|
167
|
+
var extraHeight = 55;
|
|
168
|
+
var top = document.getElementById("".concat(value)).offsetTop - extraHeight;
|
|
169
|
+
var scrollElement = document.querySelector('.dialog-inner');
|
|
170
|
+
scrollElement.scrollTo({
|
|
171
|
+
top: top,
|
|
172
|
+
behavior: 'smooth'
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
var handleSwitchQtyUnit = function handleSwitchQtyUnit(val) {
|
|
177
|
+
var _setQtyBy;
|
|
178
|
+
setQtyBy((_setQtyBy = {}, _defineProperty(_setQtyBy, val, true), _defineProperty(_setQtyBy, !val, false), _setQtyBy));
|
|
179
|
+
};
|
|
180
|
+
var getOverFlowImage = function getOverFlowImage(url) {
|
|
181
|
+
var keys = url.split('/');
|
|
182
|
+
var _videoId = keys[(keys === null || keys === void 0 ? void 0 : keys.length) - 1];
|
|
183
|
+
var overFlowImg = 'http://img.youtube.com/vi/' + _videoId + '/0.jpg';
|
|
184
|
+
return overFlowImg;
|
|
185
|
+
};
|
|
186
|
+
var onChangeProductCartQuantity = function onChangeProductCartQuantity(quantity) {
|
|
187
|
+
if (quantity > maxProductQuantity) {
|
|
188
|
+
setAlertState({
|
|
189
|
+
open: true,
|
|
190
|
+
content: [t('MAX_QUANTITY', 'The max quantity is _number_').replace('_number_', maxProductQuantity)]
|
|
191
|
+
});
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
handleChangeProductCartQuantity(quantity);
|
|
195
|
+
};
|
|
196
|
+
var scrollDown = function scrollDown() {
|
|
197
|
+
var _Object$values2, _document$getElements, _document$getElements2;
|
|
198
|
+
var adjustHeight = (windowSize === null || windowSize === void 0 ? void 0 : windowSize.width) > 768 ? 50 : 55;
|
|
199
|
+
var isErrors = ((_Object$values2 = Object.values(errors)) === null || _Object$values2 === void 0 ? void 0 : _Object$values2.length) > 0;
|
|
200
|
+
if (!isErrors) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
var productContainer = document.getElementsByClassName('popup-dialog')[0];
|
|
204
|
+
var unselectedFirstSubOption = (_document$getElements = document.getElementsByClassName('error')) === null || _document$getElements === void 0 ? void 0 : (_document$getElements2 = _document$getElements[0]) === null || _document$getElements2 === void 0 ? void 0 : _document$getElements2.parentNode;
|
|
205
|
+
if (unselectedFirstSubOption) {
|
|
206
|
+
var top = unselectedFirstSubOption.offsetTop;
|
|
207
|
+
productContainer.scrollTo({
|
|
208
|
+
top: top - adjustHeight,
|
|
209
|
+
behavior: 'smooth'
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
var handleSlideChange = function handleSlideChange() {
|
|
214
|
+
var videos = document.querySelectorAll('iframe, video');
|
|
215
|
+
Array.prototype.forEach.call(videos, function (video) {
|
|
216
|
+
if (video.tagName.toLowerCase() === 'video') {
|
|
217
|
+
video.pause();
|
|
218
|
+
} else {
|
|
219
|
+
var src = video.src;
|
|
220
|
+
video.src = src;
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
};
|
|
224
|
+
(0, _react.useEffect)(function () {
|
|
225
|
+
if (isScrollAvailable) {
|
|
226
|
+
setIsScrollAvailable(false);
|
|
227
|
+
scrollDown();
|
|
228
|
+
}
|
|
229
|
+
}, [errors]);
|
|
230
|
+
(0, _react.useEffect)(function () {
|
|
231
|
+
var scrollElement = document.querySelector('.dialog-inner');
|
|
232
|
+
var handleScroll = function handleScroll() {
|
|
233
|
+
var extraHeight = 60;
|
|
234
|
+
if ((product === null || product === void 0 ? void 0 : product.ingredients.length) > 0 || (product === null || product === void 0 ? void 0 : product.extras.length) > 0) {
|
|
235
|
+
var _product$ingredients;
|
|
236
|
+
var menuList = [];
|
|
237
|
+
if ((product === null || product === void 0 ? void 0 : (_product$ingredients = product.ingredients) === null || _product$ingredients === void 0 ? void 0 : _product$ingredients.length) > 0) {
|
|
238
|
+
menuList.push('ingredients');
|
|
239
|
+
}
|
|
240
|
+
((product === null || product === void 0 ? void 0 : product.extras.length) > 0 && (product === null || product === void 0 ? void 0 : product.extras) || []).sort(function (a, b) {
|
|
241
|
+
return a.rank - b.rank;
|
|
242
|
+
}).forEach(function (extra) {
|
|
243
|
+
((extra === null || extra === void 0 ? void 0 : extra.options.length) > 0 && (extra === null || extra === void 0 ? void 0 : extra.options) || []).sort(function (a, b) {
|
|
244
|
+
return a.rank - b.rank;
|
|
245
|
+
}).forEach(function (option) {
|
|
246
|
+
showOption(option) && menuList.push("id_".concat(option === null || option === void 0 ? void 0 : option.id));
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
menuList.length && menuList.forEach(function (menu) {
|
|
250
|
+
var elementTop = scrollElement.scrollTop;
|
|
251
|
+
if (document.getElementById(menu)) {
|
|
252
|
+
var topPos = document.getElementById(menu).offsetTop;
|
|
253
|
+
if (Math.abs(elementTop - topPos) < extraHeight) {
|
|
254
|
+
setTabValue(menu);
|
|
255
|
+
var elementLeft = document.getElementById("menu_".concat(menu)).offsetLeft;
|
|
256
|
+
var scrollLeft = document.getElementById('all').scrollLeft;
|
|
257
|
+
if (elementLeft < scrollLeft) {
|
|
258
|
+
document.getElementById('all').scrollTo({
|
|
259
|
+
left: elementLeft,
|
|
260
|
+
behavior: 'smooth'
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
if (elementLeft < scrollLeft + scrollElement.clientWidth) {
|
|
264
|
+
document.getElementById('all').scrollTo({
|
|
265
|
+
left: elementLeft - scrollElement.clientWidth / 2,
|
|
266
|
+
behavior: 'smooth'
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
scrollElement && scrollElement.addEventListener('scroll', handleScroll);
|
|
275
|
+
return function () {
|
|
276
|
+
return scrollElement && scrollElement.removeEventListener('scroll', handleScroll);
|
|
277
|
+
};
|
|
278
|
+
}, [showOption]);
|
|
279
|
+
(0, _react.useEffect)(function () {
|
|
280
|
+
var _theme$images, _theme$images$dummies, _product$gallery;
|
|
281
|
+
var imageList = [];
|
|
282
|
+
var videoList = [];
|
|
283
|
+
imageList.push((product === null || product === void 0 ? void 0 : product.images) || ((_theme$images = theme.images) === null || _theme$images === void 0 ? void 0 : (_theme$images$dummies = _theme$images.dummies) === null || _theme$images$dummies === void 0 ? void 0 : _theme$images$dummies.product));
|
|
284
|
+
if (product !== null && product !== void 0 && product.gallery && (product === null || product === void 0 ? void 0 : (_product$gallery = product.gallery) === null || _product$gallery === void 0 ? void 0 : _product$gallery.length) > 0) {
|
|
285
|
+
var _iterator = _createForOfIteratorHelper(product === null || product === void 0 ? void 0 : product.gallery),
|
|
286
|
+
_step;
|
|
287
|
+
try {
|
|
288
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
289
|
+
var galleryItem = _step.value;
|
|
290
|
+
if (galleryItem !== null && galleryItem !== void 0 && galleryItem.file) {
|
|
291
|
+
imageList.push(galleryItem === null || galleryItem === void 0 ? void 0 : galleryItem.file);
|
|
292
|
+
}
|
|
293
|
+
if (galleryItem !== null && galleryItem !== void 0 && galleryItem.video) {
|
|
294
|
+
var _url = galleryItem === null || galleryItem === void 0 ? void 0 : galleryItem.video.split('/');
|
|
295
|
+
var _videoId = _url[(_url === null || _url === void 0 ? void 0 : _url.length) - 1];
|
|
296
|
+
if (_videoId.includes('watch')) {
|
|
297
|
+
var __url = _videoId.split('=')[1];
|
|
298
|
+
_videoId = __url;
|
|
299
|
+
}
|
|
300
|
+
var embedURL = 'https://www.youtube.com/embed/' + _videoId;
|
|
301
|
+
videoList.push(embedURL);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
} catch (err) {
|
|
305
|
+
_iterator.e(err);
|
|
306
|
+
} finally {
|
|
307
|
+
_iterator.f();
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
setGallery(imageList);
|
|
311
|
+
setVideoGallery(videoList);
|
|
312
|
+
if (product !== null && product !== void 0 && product.weight && product !== null && product !== void 0 && product.weight_unit) {
|
|
313
|
+
setIsHaveWeight(true);
|
|
314
|
+
setPricePerWeightUnit((product === null || product === void 0 ? void 0 : product.price) / (product === null || product === void 0 ? void 0 : product.weight));
|
|
315
|
+
}
|
|
316
|
+
}, [product]);
|
|
317
|
+
return /*#__PURE__*/_react.default.createElement(_styles2.ProductContainer, {
|
|
318
|
+
className: "product-container",
|
|
319
|
+
ref: productContainerRef,
|
|
320
|
+
useKioskApp: props.useKioskApp
|
|
321
|
+
}, product && /*#__PURE__*/_react.default.createElement(_styles2.WrapperImage, null, /*#__PURE__*/_react.default.createElement(_styles2.SwiperWrapper, {
|
|
322
|
+
isSoldOut: isSoldOut
|
|
323
|
+
}, /*#__PURE__*/_react.default.createElement(_react2.Swiper, {
|
|
324
|
+
spaceBetween: 10,
|
|
325
|
+
navigation: true,
|
|
326
|
+
watchOverflow: true,
|
|
327
|
+
observer: true,
|
|
328
|
+
observeParents: true,
|
|
329
|
+
parallax: true,
|
|
330
|
+
thumbs: {
|
|
331
|
+
swiper: thumbsSwiper
|
|
332
|
+
},
|
|
333
|
+
className: "mySwiper2",
|
|
334
|
+
onSlideChange: function onSlideChange() {
|
|
335
|
+
return handleSlideChange();
|
|
336
|
+
}
|
|
337
|
+
}, gallery === null || gallery === void 0 ? void 0 : gallery.map(function (img, i) {
|
|
338
|
+
return /*#__PURE__*/_react.default.createElement(_react2.SwiperSlide, {
|
|
339
|
+
key: i
|
|
340
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
341
|
+
src: img,
|
|
342
|
+
alt: "",
|
|
343
|
+
className: "active-img"
|
|
344
|
+
}));
|
|
345
|
+
}), videoGallery && (videoGallery === null || videoGallery === void 0 ? void 0 : videoGallery.length) > 0 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, videoGallery === null || videoGallery === void 0 ? void 0 : videoGallery.map(function (video, j) {
|
|
346
|
+
return /*#__PURE__*/_react.default.createElement(_react2.SwiperSlide, {
|
|
347
|
+
key: j
|
|
348
|
+
}, /*#__PURE__*/_react.default.createElement("iframe", {
|
|
349
|
+
style: {
|
|
350
|
+
border: 'none',
|
|
351
|
+
width: '100%',
|
|
352
|
+
height: '100%'
|
|
353
|
+
},
|
|
354
|
+
src: video
|
|
355
|
+
}));
|
|
356
|
+
}))), galleryLength > 2 && /*#__PURE__*/_react.default.createElement(_react2.Swiper, {
|
|
357
|
+
onSwiper: setThumbsSwiper,
|
|
358
|
+
spaceBetween: 20,
|
|
359
|
+
slidesPerView: 5,
|
|
360
|
+
breakpoints: {
|
|
361
|
+
0: {
|
|
362
|
+
slidesPerView: 3,
|
|
363
|
+
spaceBetween: 20
|
|
364
|
+
},
|
|
365
|
+
300: {
|
|
366
|
+
slidesPerView: 4,
|
|
367
|
+
spaceBetween: 20
|
|
368
|
+
},
|
|
369
|
+
400: {
|
|
370
|
+
slidesPerView: 5,
|
|
371
|
+
spaceBetween: 20
|
|
372
|
+
},
|
|
373
|
+
550: {
|
|
374
|
+
slidesPerView: 6,
|
|
375
|
+
spaceBetween: 20
|
|
376
|
+
},
|
|
377
|
+
769: {
|
|
378
|
+
slidesPerView: 6,
|
|
379
|
+
spaceBetween: 20
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
freeMode: true,
|
|
383
|
+
watchSlidesProgress: true,
|
|
384
|
+
className: "product-thumb",
|
|
385
|
+
watchOverflow: true,
|
|
386
|
+
observer: true,
|
|
387
|
+
observeParents: true,
|
|
388
|
+
parallax: true
|
|
389
|
+
}, gallery === null || gallery === void 0 ? void 0 : gallery.map(function (img, i) {
|
|
390
|
+
return /*#__PURE__*/_react.default.createElement(_react2.SwiperSlide, {
|
|
391
|
+
key: i
|
|
392
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
393
|
+
src: img,
|
|
394
|
+
alt: ""
|
|
395
|
+
}));
|
|
396
|
+
}), videoGallery && (videoGallery === null || videoGallery === void 0 ? void 0 : videoGallery.length) > 0 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, videoGallery === null || videoGallery === void 0 ? void 0 : videoGallery.map(function (video, j) {
|
|
397
|
+
return /*#__PURE__*/_react.default.createElement(_react2.SwiperSlide, {
|
|
398
|
+
key: j
|
|
399
|
+
}, /*#__PURE__*/_react.default.createElement(_styles2.VideoGalleryWrapper, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
400
|
+
src: getOverFlowImage(video),
|
|
401
|
+
alt: ""
|
|
402
|
+
}), /*#__PURE__*/_react.default.createElement(_MdcPlayCircleOutline.default, null)));
|
|
403
|
+
}))))), loading && !error && /*#__PURE__*/_react.default.createElement(_styles2.SkeletonBlock, {
|
|
404
|
+
width: 90
|
|
405
|
+
}, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
406
|
+
variant: "rect",
|
|
407
|
+
height: 50
|
|
408
|
+
}), /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
409
|
+
variant: "rect",
|
|
410
|
+
height: 50
|
|
411
|
+
}), /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
412
|
+
variant: "rect",
|
|
413
|
+
height: 200
|
|
414
|
+
})), !loading && !error && product && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles2.ProductInfo, null, /*#__PURE__*/_react.default.createElement(_styles2.ProductFormTitle, null, /*#__PURE__*/_react.default.createElement(_styles2.TitleWrapper, null, /*#__PURE__*/_react.default.createElement(_styles2.ProductName, null, /*#__PURE__*/_react.default.createElement("span", null, product === null || product === void 0 ? void 0 : product.name)), !isCustomerMode && /*#__PURE__*/_react.default.createElement("span", {
|
|
415
|
+
className: "favorite",
|
|
416
|
+
onClick: function onClick() {
|
|
417
|
+
return handleChangeFavorite();
|
|
418
|
+
}
|
|
419
|
+
}, product !== null && product !== void 0 && product.favorite ? /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.HeartFill, null) : /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.Heart, null))), /*#__PURE__*/_react.default.createElement(_styles2.Properties, null, isHaveWeight ? /*#__PURE__*/_react.default.createElement(_styles2.PriceContent, null, parsePrice(pricePerWeightUnit), " / ", product === null || product === void 0 ? void 0 : product.weight_unit) : /*#__PURE__*/_react.default.createElement(_styles2.PriceContent, null, /*#__PURE__*/_react.default.createElement("p", null, product !== null && product !== void 0 && product.price ? parsePrice(product === null || product === void 0 ? void 0 : product.price) : ''), (product === null || product === void 0 ? void 0 : product.in_offer) && /*#__PURE__*/_react.default.createElement("span", {
|
|
420
|
+
className: "offer-price"
|
|
421
|
+
}, product !== null && product !== void 0 && product.offer_price ? parsePrice(product === null || product === void 0 ? void 0 : product.offer_price) : '')), /*#__PURE__*/_react.default.createElement(_styles2.ProductMeta, null, (product === null || product === void 0 ? void 0 : product.calories) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
422
|
+
className: "calories"
|
|
423
|
+
}, product === null || product === void 0 ? void 0 : product.calories, ' ', "cal"), /*#__PURE__*/_react.default.createElement("span", null, "\xA0\xB7\xA0")), (product === null || product === void 0 ? void 0 : product.sku) && (product === null || product === void 0 ? void 0 : product.sku) !== '-1' && (product === null || product === void 0 ? void 0 : product.sku) !== '1' && /*#__PURE__*/_react.default.createElement(_styles2.SkuContent, null, /*#__PURE__*/_react.default.createElement("span", null, t('SKU', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag = theme.defaultLanguages) === null || _theme$defaultLanguag === void 0 ? void 0 : _theme$defaultLanguag.SKU) || 'Sku'), "\xA0"), /*#__PURE__*/_react.default.createElement("span", null, product === null || product === void 0 ? void 0 : product.sku)), (product === null || product === void 0 ? void 0 : product.sku) && (product === null || product === void 0 ? void 0 : product.sku) !== '-1' && (product === null || product === void 0 ? void 0 : product.sku) !== '1' && (product === null || product === void 0 ? void 0 : product.estimated_person) && /*#__PURE__*/_react.default.createElement("span", null, "\xA0\xB7\xA0"), (product === null || product === void 0 ? void 0 : product.estimated_person) && /*#__PURE__*/_react.default.createElement(_styles2.EstimatedPersons, null, /*#__PURE__*/_react.default.createElement("span", null, product === null || product === void 0 ? void 0 : product.estimated_person, "\xA0"), /*#__PURE__*/_react.default.createElement("span", null, t('ESTIMATED_PERSONS', 'persons'))))), (product === null || product === void 0 ? void 0 : product.description) && !hideProductDescription && /*#__PURE__*/_react.default.createElement(_styles2.ProductDescription, null, /*#__PURE__*/_react.default.createElement(_Shared.LinkableText, {
|
|
424
|
+
text: product === null || product === void 0 ? void 0 : product.description
|
|
425
|
+
}))), (product === null || product === void 0 ? void 0 : (_product$tags = product.tags) === null || _product$tags === void 0 ? void 0 : _product$tags.length) > 0 && /*#__PURE__*/_react.default.createElement(_styles2.ProductTagsListContainer, null, product.tags.map(function (tag) {
|
|
426
|
+
var _theme$images2, _theme$images2$dummie;
|
|
427
|
+
return /*#__PURE__*/_react.default.createElement(_styles2.ProductTagWrapper, {
|
|
428
|
+
key: tag.id
|
|
429
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
430
|
+
src: optimizeImage((tag === null || tag === void 0 ? void 0 : tag.image) || ((_theme$images2 = theme.images) === null || _theme$images2 === void 0 ? void 0 : (_theme$images2$dummie = _theme$images2.dummies) === null || _theme$images2$dummie === void 0 ? void 0 : _theme$images2$dummie.product), 'h_40,c_limit'),
|
|
431
|
+
alt: ""
|
|
432
|
+
}), /*#__PURE__*/_react.default.createElement("span", null, tag.name));
|
|
433
|
+
})), /*#__PURE__*/_react.default.createElement(_styles2.Divider, null), /*#__PURE__*/_react.default.createElement(_styles2.ProductEdition, null, ((product === null || product === void 0 ? void 0 : (_product$ingredients2 = product.ingredients) === null || _product$ingredients2 === void 0 ? void 0 : _product$ingredients2.length) > 0 || (product === null || product === void 0 ? void 0 : (_product$extras = product.extras) === null || _product$extras === void 0 ? void 0 : _product$extras.length) > 0) && /*#__PURE__*/_react.default.createElement(_styles2.ProductTabContainer, {
|
|
434
|
+
id: "all"
|
|
435
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.Tabs, null, /*#__PURE__*/_react.default.createElement(_Shared.AutoScroll, {
|
|
436
|
+
scrollId: "optionList"
|
|
437
|
+
}, (product === null || product === void 0 ? void 0 : (_product$ingredients3 = product.ingredients) === null || _product$ingredients3 === void 0 ? void 0 : _product$ingredients3.length) > 0 && /*#__PURE__*/_react.default.createElement(_styles.Tab, {
|
|
438
|
+
key: "ingredients",
|
|
439
|
+
id: "menu_ingredients",
|
|
440
|
+
active: tabValue === 'ingredients',
|
|
441
|
+
onClick: function onClick() {
|
|
442
|
+
return handleChangeTabValue('ingredients');
|
|
443
|
+
},
|
|
444
|
+
borderBottom: true
|
|
445
|
+
}, t('INGREDIENTS', 'ingredients')), product === null || product === void 0 ? void 0 : product.extras.sort(function (a, b) {
|
|
446
|
+
return a.rank - b.rank;
|
|
447
|
+
}).map(function (extra) {
|
|
448
|
+
var _extra$options;
|
|
449
|
+
return (_extra$options = extra.options) === null || _extra$options === void 0 ? void 0 : _extra$options.sort(function (a, b) {
|
|
450
|
+
return a.rank - b.rank;
|
|
451
|
+
}).map(function (option) {
|
|
452
|
+
return showOption(option) && /*#__PURE__*/_react.default.createElement(_styles.Tab, {
|
|
453
|
+
key: option === null || option === void 0 ? void 0 : option.id,
|
|
454
|
+
id: "menu_id_".concat(option === null || option === void 0 ? void 0 : option.id),
|
|
455
|
+
active: tabValue === "id_".concat(option === null || option === void 0 ? void 0 : option.id),
|
|
456
|
+
onClick: function onClick() {
|
|
457
|
+
return handleChangeTabValue("id_".concat(option === null || option === void 0 ? void 0 : option.id));
|
|
458
|
+
},
|
|
459
|
+
borderBottom: true
|
|
460
|
+
}, option === null || option === void 0 ? void 0 : option.name);
|
|
461
|
+
});
|
|
462
|
+
})))), (product === null || product === void 0 ? void 0 : (_product$ingredients4 = product.ingredients) === null || _product$ingredients4 === void 0 ? void 0 : _product$ingredients4.length) > 0 && Object.keys(productCart.ingredients).length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
463
|
+
id: "ingredients"
|
|
464
|
+
}, (product === null || product === void 0 ? void 0 : (_product$ingredients5 = product.ingredients) === null || _product$ingredients5 === void 0 ? void 0 : _product$ingredients5.length) > 0 && /*#__PURE__*/_react.default.createElement(_styles2.SectionTitle, null, t('INGREDIENTS', (theme === null || theme === void 0 ? void 0 : theme.defaultLanguages.INGREDIENTS) || 'Ingredients')), /*#__PURE__*/_react.default.createElement(_styles2.WrapperIngredients, {
|
|
465
|
+
isProductSoldout: isSoldOut || maxProductQuantity <= 0
|
|
466
|
+
}, product === null || product === void 0 ? void 0 : product.ingredients.map(function (ingredient) {
|
|
467
|
+
return /*#__PURE__*/_react.default.createElement(_ProductIngredient.ProductIngredient, {
|
|
468
|
+
key: ingredient === null || ingredient === void 0 ? void 0 : ingredient.id,
|
|
469
|
+
ingredient: ingredient,
|
|
470
|
+
state: productCart.ingredients["id:".concat(ingredient === null || ingredient === void 0 ? void 0 : ingredient.id)],
|
|
471
|
+
onChange: handleChangeIngredientState,
|
|
472
|
+
isSoldOut: isSoldOut
|
|
473
|
+
});
|
|
474
|
+
}))), /*#__PURE__*/_react.default.createElement("div", null, product === null || product === void 0 ? void 0 : (_product$extras2 = product.extras) === null || _product$extras2 === void 0 ? void 0 : _product$extras2.sort(function (a, b) {
|
|
475
|
+
return a.rank - b.rank;
|
|
476
|
+
}).map(function (extra) {
|
|
477
|
+
return extra.options.sort(function (a, b) {
|
|
478
|
+
return a.rank - b.rank;
|
|
479
|
+
}).map(function (option) {
|
|
480
|
+
var currentState = productCart.options["id:".concat(option === null || option === void 0 ? void 0 : option.id)] || {};
|
|
481
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
482
|
+
key: option === null || option === void 0 ? void 0 : option.id
|
|
483
|
+
}, showOption(option) && /*#__PURE__*/_react.default.createElement(_ProductOption.ProductOption, {
|
|
484
|
+
option: option,
|
|
485
|
+
currentState: currentState,
|
|
486
|
+
error: errors["id:".concat(option === null || option === void 0 ? void 0 : option.id)]
|
|
487
|
+
}, /*#__PURE__*/_react.default.createElement(_styles2.WrapperSubOption, {
|
|
488
|
+
className: isError(option === null || option === void 0 ? void 0 : option.id)
|
|
489
|
+
}, option.suboptions.filter(function (suboptions) {
|
|
490
|
+
return suboptions.enabled;
|
|
491
|
+
}).sort(function (a, b) {
|
|
492
|
+
return a.rank - b.rank;
|
|
493
|
+
}).map(function (suboption) {
|
|
494
|
+
var _productCart$options, _productCart$options2;
|
|
495
|
+
var currentState = ((_productCart$options = productCart.options["id:".concat(option === null || option === void 0 ? void 0 : option.id)]) === null || _productCart$options === void 0 ? void 0 : _productCart$options.suboptions["id:".concat(suboption === null || suboption === void 0 ? void 0 : suboption.id)]) || {};
|
|
496
|
+
var balance = ((_productCart$options2 = productCart.options["id:".concat(option === null || option === void 0 ? void 0 : option.id)]) === null || _productCart$options2 === void 0 ? void 0 : _productCart$options2.balance) || 0;
|
|
497
|
+
return /*#__PURE__*/_react.default.createElement(_ProductOptionSubOption.ProductOptionSubOption, {
|
|
498
|
+
key: suboption === null || suboption === void 0 ? void 0 : suboption.id,
|
|
499
|
+
onChange: handleChangeSuboptionState,
|
|
500
|
+
balance: balance,
|
|
501
|
+
option: option,
|
|
502
|
+
suboption: suboption,
|
|
503
|
+
state: currentState,
|
|
504
|
+
isSoldOut: isSoldOut,
|
|
505
|
+
scrollDown: scrollDown,
|
|
506
|
+
setIsScrollAvailable: setIsScrollAvailable
|
|
507
|
+
});
|
|
508
|
+
}))));
|
|
509
|
+
});
|
|
510
|
+
})), !(product !== null && product !== void 0 && product.hide_special_instructions) && /*#__PURE__*/_react.default.createElement(_styles2.ProductComment, null, /*#__PURE__*/_react.default.createElement(_styles2.SectionTitle, null, t('COMMENTS', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag2 = theme.defaultLanguages) === null || _theme$defaultLanguag2 === void 0 ? void 0 : _theme$defaultLanguag2.SPECIAL_COMMENT) || 'COMMENTS')), /*#__PURE__*/_react.default.createElement(_styles.TextArea, {
|
|
511
|
+
rows: 4,
|
|
512
|
+
placeholder: t('SPECIAL_COMMENT', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag3 = theme.defaultLanguages) === null || _theme$defaultLanguag3 === void 0 ? void 0 : _theme$defaultLanguag3.SPECIAL_COMMENT) || 'Special comment'),
|
|
513
|
+
defaultValue: productCart.comment,
|
|
514
|
+
onChange: handleChangeCommentState,
|
|
515
|
+
disabled: !(productCart && !isSoldOut && maxProductQuantity)
|
|
516
|
+
})), (_props$afterMidElemen = props.afterMidElements) === null || _props$afterMidElemen === void 0 ? void 0 : _props$afterMidElemen.map(function (MidElement, i) {
|
|
517
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
518
|
+
key: i
|
|
519
|
+
}, MidElement);
|
|
520
|
+
}), (_props$afterMidCompon = props.afterMidComponents) === null || _props$afterMidCompon === void 0 ? void 0 : _props$afterMidCompon.map(function (MidComponent, i) {
|
|
521
|
+
return /*#__PURE__*/_react.default.createElement(MidComponent, _extends({
|
|
522
|
+
key: i
|
|
523
|
+
}, props));
|
|
524
|
+
})), /*#__PURE__*/_react.default.createElement(_styles2.ProductActions, {
|
|
525
|
+
isColumn: !((_orderState$options = orderState.options) !== null && _orderState$options !== void 0 && _orderState$options.address_id || unaddressedTypes.includes(orderState === null || orderState === void 0 ? void 0 : (_orderState$options2 = orderState.options) === null || _orderState$options2 === void 0 ? void 0 : _orderState$options2.type))
|
|
526
|
+
}, actionStatus !== null && actionStatus !== void 0 && actionStatus.loading || orderState.loading ? /*#__PURE__*/_react.default.createElement(_styles2.LoadingWrapper, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
527
|
+
height: 35,
|
|
528
|
+
width: 150
|
|
529
|
+
})) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
530
|
+
className: "price-amount-block"
|
|
531
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
532
|
+
className: "price"
|
|
533
|
+
}, /*#__PURE__*/_react.default.createElement("h4", null, productCart.total && parsePrice(productCart.total)), (product === null || product === void 0 ? void 0 : product.minimum_per_order) && (productCart === null || productCart === void 0 ? void 0 : productCart.quantity) + productAddedToCartLength <= (product === null || product === void 0 ? void 0 : product.minimum_per_order) && (productCart === null || productCart === void 0 ? void 0 : productCart.quantity) !== 1 && /*#__PURE__*/_react.default.createElement("span", null, t('MINIMUM_TO_ORDER', 'Minimum _number_ to order').replace('_number_', product === null || product === void 0 ? void 0 : product.minimum_per_order)), (product === null || product === void 0 ? void 0 : product.maximum_per_order) && (productCart === null || productCart === void 0 ? void 0 : productCart.quantity) + productAddedToCartLength >= (product === null || product === void 0 ? void 0 : product.maximum_per_order) && /*#__PURE__*/_react.default.createElement("span", null, t('MAXIMUM_TO_ORDER', 'Max. _number_ to order'.replace('_number_', product === null || product === void 0 ? void 0 : product.maximum_per_order)))), productCart && !isSoldOut && maxProductQuantity > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
534
|
+
className: isHaveWeight ? 'incdec-control show-weight-unit' : 'incdec-control'
|
|
535
|
+
}, /*#__PURE__*/_react.default.createElement(_FiMinusCircle.default, {
|
|
536
|
+
onClick: decrement,
|
|
537
|
+
className: "".concat(productCart.quantity === 1 || !productCart.quantity || isSoldOut || (productCart === null || productCart === void 0 ? void 0 : productCart.quantity) + productAddedToCartLength <= (product === null || product === void 0 ? void 0 : product.minimum_per_order) ? 'disabled' : '')
|
|
538
|
+
}), (qtyBy === null || qtyBy === void 0 ? void 0 : qtyBy.pieces) && /*#__PURE__*/_react.default.createElement(_styles.Input, {
|
|
539
|
+
className: "qty",
|
|
540
|
+
value: (productCart === null || productCart === void 0 ? void 0 : productCart.quantity) || '',
|
|
541
|
+
onChange: function onChange(e) {
|
|
542
|
+
return onChangeProductCartQuantity(parseInt(e.target.value));
|
|
543
|
+
},
|
|
544
|
+
onKeyPress: function onKeyPress(e) {
|
|
545
|
+
if (!/^[0-9.]$/.test(e.key)) {
|
|
546
|
+
e.preventDefault();
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}), (qtyBy === null || qtyBy === void 0 ? void 0 : qtyBy.weight_unit) && /*#__PURE__*/_react.default.createElement(_styles.Input, {
|
|
550
|
+
className: "qty",
|
|
551
|
+
value: (productCart.quantity * (product === null || product === void 0 ? void 0 : product.weight)).toFixed(2)
|
|
552
|
+
}), /*#__PURE__*/_react.default.createElement(_FiPlusCircle.default, {
|
|
553
|
+
onClick: increment,
|
|
554
|
+
className: "".concat(maxProductQuantity <= 0 || (productCart === null || productCart === void 0 ? void 0 : productCart.quantity) + productAddedToCartLength >= maxProductQuantity || (productCart === null || productCart === void 0 ? void 0 : productCart.quantity) + productAddedToCartLength >= (product === null || product === void 0 ? void 0 : product.maximum_per_order) && product !== null && product !== void 0 && product.maximum_per_order || isSoldOut ? 'disabled' : '')
|
|
555
|
+
}), isHaveWeight && /*#__PURE__*/_react.default.createElement(_styles2.WeightUnitSwitch, null, /*#__PURE__*/_react.default.createElement(_styles2.WeightUnitItem, {
|
|
556
|
+
onClick: function onClick() {
|
|
557
|
+
return handleSwitchQtyUnit('pieces');
|
|
558
|
+
},
|
|
559
|
+
active: qtyBy === null || qtyBy === void 0 ? void 0 : qtyBy.pieces
|
|
560
|
+
}, t('PIECES', 'pcs')), /*#__PURE__*/_react.default.createElement(_styles2.WeightUnitItem, {
|
|
561
|
+
onClick: function onClick() {
|
|
562
|
+
return handleSwitchQtyUnit('weight_unit');
|
|
563
|
+
},
|
|
564
|
+
active: qtyBy === null || qtyBy === void 0 ? void 0 : qtyBy.weight_unit
|
|
565
|
+
}, product === null || product === void 0 ? void 0 : product.weight_unit)))), productCart && !isSoldOut && maxProductQuantity > 0 && (((_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 ? void 0 : _orderState$options3.address_id) || unaddressedTypes.includes(orderState === null || orderState === void 0 ? void 0 : (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.type)) && /*#__PURE__*/_react.default.createElement(_styles.Button, {
|
|
566
|
+
borderRadius: "8px",
|
|
567
|
+
className: "add ".concat(maxProductQuantity === 0 || Object.keys(errors).length > 0 ? 'disabled' : ''),
|
|
568
|
+
color: "primary",
|
|
569
|
+
onClick: function onClick() {
|
|
570
|
+
return handleSaveProduct();
|
|
571
|
+
},
|
|
572
|
+
disabled: orderState.loading || (productCart === null || productCart === void 0 ? void 0 : productCart.quantity) === 0 || (product === null || product === void 0 ? void 0 : product.minimum_per_order) && (productCart === null || productCart === void 0 ? void 0 : productCart.quantity) + productAddedToCartLength < (product === null || product === void 0 ? void 0 : product.minimum_per_order) || (product === null || product === void 0 ? void 0 : product.maximum_per_order) && (productCart === null || productCart === void 0 ? void 0 : productCart.quantity) + productAddedToCartLength > (product === null || product === void 0 ? void 0 : product.maximum_per_order)
|
|
573
|
+
}, orderState.loading ? /*#__PURE__*/_react.default.createElement("span", null, t('LOADING', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag4 = theme.defaultLanguages) === null || _theme$defaultLanguag4 === void 0 ? void 0 : _theme$defaultLanguag4.LOADING) || 'Loading')) : /*#__PURE__*/_react.default.createElement("span", null, editMode ? t('UPDATE', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag5 = theme.defaultLanguages) === null || _theme$defaultLanguag5 === void 0 ? void 0 : _theme$defaultLanguag5.UPDATE) || 'Update') : t('ADD', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag6 = theme.defaultLanguages) === null || _theme$defaultLanguag6 === void 0 ? void 0 : _theme$defaultLanguag6.ADD) || 'Add'))), (isSoldOut || maxProductQuantity <= 0) && /*#__PURE__*/_react.default.createElement(_styles.Button, {
|
|
574
|
+
className: "add ".concat(!(productCart && !isSoldOut && maxProductQuantity > 0) ? 'soldout' : ''),
|
|
575
|
+
color: "primary",
|
|
576
|
+
outline: true,
|
|
577
|
+
disabled: isSoldOut || maxProductQuantity <= 0
|
|
578
|
+
}, t('SOLD_OUT', 'Sold out')))))), error && error.length > 0 && /*#__PURE__*/_react.default.createElement(_Shared.NotFoundSource, {
|
|
579
|
+
content: ((_error$ = error[0]) === null || _error$ === void 0 ? void 0 : _error$.message) || error[0]
|
|
580
|
+
}), /*#__PURE__*/_react.default.createElement(_Shared.Alert, {
|
|
581
|
+
title: t('SEARCH', 'Search'),
|
|
582
|
+
content: alertState.content,
|
|
583
|
+
acceptText: t('ACCEPT', 'Accept'),
|
|
584
|
+
open: alertState.open,
|
|
585
|
+
onClose: function onClose() {
|
|
586
|
+
return setAlertState({
|
|
587
|
+
open: false,
|
|
588
|
+
content: []
|
|
589
|
+
});
|
|
590
|
+
},
|
|
591
|
+
onAccept: function onAccept() {
|
|
592
|
+
return setAlertState({
|
|
593
|
+
open: false,
|
|
594
|
+
content: []
|
|
595
|
+
});
|
|
596
|
+
},
|
|
597
|
+
closeOnBackdrop: false
|
|
598
|
+
}));
|
|
599
|
+
};
|
|
600
|
+
var ProductForm = function ProductForm(props) {
|
|
601
|
+
var _props$productCart, _props$productCart2, _props$product;
|
|
602
|
+
var productOptionsProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
603
|
+
productCart: _objectSpread(_objectSpread({}, props.productCart), {}, {
|
|
604
|
+
quantity: (_props$productCart = props.productCart) !== null && _props$productCart !== void 0 && _props$productCart.code ? (_props$productCart2 = props.productCart) === null || _props$productCart2 === void 0 ? void 0 : _props$productCart2.quantity : (props === null || props === void 0 ? void 0 : (_props$product = props.product) === null || _props$product === void 0 ? void 0 : _props$product.minimum_per_order) || 1
|
|
605
|
+
}),
|
|
606
|
+
UIComponent: ProductOptionsUI
|
|
607
|
+
});
|
|
608
|
+
return /*#__PURE__*/_react.default.createElement(_orderingComponentsAdminExternal.ProductForm, productOptionsProps);
|
|
609
|
+
};
|
|
610
|
+
exports.ProductForm = ProductForm;
|
|
611
|
+
ProductForm.defaultProps = {
|
|
612
|
+
productAddedToCartLength: 0
|
|
613
|
+
};
|