ordering-ui-external 10.10.23 → 11.0.1
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/{7.ordering-ui.40e61237ed46b8c579a3.js → 7.ordering-ui.fa5f19340751cb2d73a3.js} +1 -1
- package/_bundles/{ordering-ui.40e61237ed46b8c579a3.js → ordering-ui.fa5f19340751cb2d73a3.js} +2 -2
- package/_modules/components/BusinessProductsList/index.js +15 -4
- package/_modules/themes/callcenterOriginal/src/components/CartPopover/styles.js +1 -1
- package/_modules/themes/callcenterOriginal/src/components/Header/index.js +0 -1
- package/_modules/themes/callcenterOriginal/src/components/Header/styles.js +2 -2
- package/_modules/themes/five/src/components/Cart/index.js +2 -2
- package/_modules/themes/five/src/components/HighestRated/index.js +40 -7
- package/_modules/themes/five/src/components/OrderDetails/OrderBillSection.js +2 -2
- package/_modules/themes/five/src/components/OrderDetails/OrderEta.js +4 -1
- package/_modules/themes/five/src/components/OrderDetails/index.js +2 -1
- package/_modules/themes/five/src/components/ProductForm/index.js +2 -2
- package/_modules/themes/five/src/components/ProductOptionSubOption/index.js +14 -13
- package/_modules/themes/five/src/components/ProductOptionSubOption/styles.js +1 -1
- package/_modules/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +3 -2
- package/_modules/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +3 -2
- package/package.json +2 -2
- package/src/components/BusinessProductsList/index.js +9 -1
- package/src/themes/callcenterOriginal/src/components/CartPopover/styles.js +1 -1
- package/src/themes/callcenterOriginal/src/components/Header/index.js +0 -1
- package/src/themes/callcenterOriginal/src/components/Header/styles.js +2 -2
- package/src/themes/five/src/components/Cart/index.js +7 -1
- package/src/themes/five/src/components/HighestRated/index.js +35 -1
- package/src/themes/five/src/components/OrderDetails/OrderBillSection.js +7 -1
- package/src/themes/five/src/components/OrderDetails/OrderEta.js +1 -1
- package/src/themes/five/src/components/OrderDetails/index.js +2 -1
- package/src/themes/five/src/components/ProductForm/index.js +2 -2
- package/src/themes/five/src/components/ProductOptionSubOption/index.js +11 -12
- package/src/themes/five/src/components/ProductOptionSubOption/styles.js +1 -1
- package/src/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +3 -2
- package/src/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +3 -2
- package/template/pages/SignUpDriver/index.js +5 -1
- /package/_bundles/{0.ordering-ui.40e61237ed46b8c579a3.js → 0.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
- /package/_bundles/{1.ordering-ui.40e61237ed46b8c579a3.js → 1.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
- /package/_bundles/{2.ordering-ui.40e61237ed46b8c579a3.js → 2.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
- /package/_bundles/{4.ordering-ui.40e61237ed46b8c579a3.js → 4.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
- /package/_bundles/{5.ordering-ui.40e61237ed46b8c579a3.js → 5.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
- /package/_bundles/{6.ordering-ui.40e61237ed46b8c579a3.js → 6.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
- /package/_bundles/{7.ordering-ui.40e61237ed46b8c579a3.js.LICENSE.txt → 7.ordering-ui.fa5f19340751cb2d73a3.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.40e61237ed46b8c579a3.js → 8.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
- /package/_bundles/{9.ordering-ui.40e61237ed46b8c579a3.js → 9.ordering-ui.fa5f19340751cb2d73a3.js} +0 -0
- /package/_bundles/{ordering-ui.40e61237ed46b8c579a3.js.LICENSE.txt → ordering-ui.fa5f19340751cb2d73a3.js.LICENSE.txt} +0 -0
- /package/template/{utils → Utils}/index.js +0 -0
|
@@ -16,11 +16,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
16
16
|
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; }
|
|
17
17
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
18
18
|
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); }
|
|
19
|
+
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); }
|
|
19
20
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
20
21
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
21
22
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
22
23
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
23
|
-
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); }
|
|
24
24
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
25
25
|
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."); }
|
|
26
26
|
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); }
|
|
@@ -28,7 +28,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
28
28
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
29
29
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
30
30
|
var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
31
|
-
var _props$beforeElements, _props$beforeComponen, _categoryState$produc, _categoryState$produc2, _categoryState$produc3, _props$afterComponent, _props$afterElements;
|
|
31
|
+
var _props$beforeElements, _props$beforeComponen, _categoryState$produc, _categoryState$produc2, _uniqueFeaturedProduc, _categoryState$produc3, _props$afterComponent, _props$afterElements;
|
|
32
32
|
var errors = props.errors,
|
|
33
33
|
businessId = props.businessId,
|
|
34
34
|
category = props.category,
|
|
@@ -47,6 +47,11 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
47
47
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
48
48
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
49
49
|
t = _useLanguage2[1];
|
|
50
|
+
var uniqueFeaturedProducts = function uniqueFeaturedProducts(data, key) {
|
|
51
|
+
return _toConsumableArray(new Map(data.map(function (p) {
|
|
52
|
+
return [key(p), p];
|
|
53
|
+
})).values());
|
|
54
|
+
};
|
|
50
55
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (_props$beforeElements = props.beforeElements) === null || _props$beforeElements === void 0 ? void 0 : _props$beforeElements.map(function (BeforeElement, i) {
|
|
51
56
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
52
57
|
key: i
|
|
@@ -73,11 +78,17 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
73
78
|
});
|
|
74
79
|
})), !(category !== null && category !== void 0 && category.id) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, featured && (categoryState === null || categoryState === void 0 || (_categoryState$produc2 = categoryState.products) === null || _categoryState$produc2 === void 0 ? void 0 : _categoryState$produc2.find(function (product) {
|
|
75
80
|
return product.featured;
|
|
76
|
-
})) && /*#__PURE__*/_react.default.createElement(_styles.WrapAllCategories, null, /*#__PURE__*/_react.default.createElement("h3", null, t('FEATURED', 'Featured')), /*#__PURE__*/_react.default.createElement(_styles.ProductsListing, null, (_categoryState$produc3 = categoryState.products) === null || _categoryState$produc3 === void 0 ? void 0 : _categoryState$produc3.sort(function (a, b) {
|
|
81
|
+
})) && /*#__PURE__*/_react.default.createElement(_styles.WrapAllCategories, null, /*#__PURE__*/_react.default.createElement("h3", null, t('FEATURED', 'Featured')), /*#__PURE__*/_react.default.createElement(_styles.ProductsListing, null, (_uniqueFeaturedProduc = uniqueFeaturedProducts((_categoryState$produc3 = categoryState.products) === null || _categoryState$produc3 === void 0 ? void 0 : _categoryState$produc3.sort(function (a, b) {
|
|
82
|
+
return a.rank - b.rank;
|
|
83
|
+
}).filter(function (p, i, hash) {
|
|
84
|
+
return p.featured;
|
|
85
|
+
}), function (product) {
|
|
86
|
+
return product.name;
|
|
87
|
+
})) === null || _uniqueFeaturedProduc === void 0 ? void 0 : _uniqueFeaturedProduc.sort(function (a, b) {
|
|
77
88
|
return a.rank - b.rank;
|
|
78
89
|
}).map(function (product) {
|
|
79
90
|
var _currentCart$products2;
|
|
80
|
-
return
|
|
91
|
+
return /*#__PURE__*/_react.default.createElement(_SingleProductCard.SingleProductCard, {
|
|
81
92
|
key: product === null || product === void 0 ? void 0 : product.id,
|
|
82
93
|
isSoldOut: product.inventoried && !product.quantity,
|
|
83
94
|
product: product,
|
|
@@ -10,7 +10,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
|
|
|
10
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
11
11
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
12
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
13
|
-
var HeaderItem = exports.HeaderItem = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n > span {\n padding: 10px;\n display: flex;\n align-items: center;\n background: ", ";\n color: #FFFFFF;\n border-radius: 7.6px;\n\n span {\n margin: 0;\n font-size: 14px;\n ", "\n }\n svg {\n font-size: 16px;\n }\n }\n"])), function (props) {
|
|
13
|
+
var HeaderItem = exports.HeaderItem = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n > span {\n padding: 10px;\n display: flex;\n align-items: center;\n background: ", ";\n color: #FFFFFF;\n border-radius: 7.6px;\n\n span {\n margin: 0;\n font-size: 14px;\n ", " \n }\n svg {\n font-size: 16px;\n }\n }\n"])), function (props) {
|
|
14
14
|
return props.theme.colors.primary;
|
|
15
15
|
}, function (props) {
|
|
16
16
|
var _props$theme;
|
|
@@ -29,7 +29,6 @@ var _HeaderOption = require("../HeaderOption");
|
|
|
29
29
|
var _SidebarMenu = require("../SidebarMenu");
|
|
30
30
|
var _UserDetails = require("../UserDetails");
|
|
31
31
|
var _Confirm = require("../Confirm");
|
|
32
|
-
var _utils = require("../../../../../utils");
|
|
33
32
|
var _BusinessPreorder = require("../BusinessPreorder");
|
|
34
33
|
var _AdminAreaPopover = require("../AdminAreaPopover");
|
|
35
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -24,7 +24,7 @@ var LeftHeader = exports.LeftHeader = _styledComponents.default.div(_templateObj
|
|
|
24
24
|
var RightHeader = exports.RightHeader = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n align-self: center;\n display: flex;\n\n #select-input {\n div {\n color: ", ";\n }\n }\n"])), function (props) {
|
|
25
25
|
return props.theme.colors.darkTextColor;
|
|
26
26
|
});
|
|
27
|
-
var Menu = exports.Menu = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n #select-input {\n border-radius: 7.6px;\n\n #list {\n border-radius: 7.6px;\n }\n }\n\n &.left-header {\n background: #F8F9FA;\n border: none;\n box-sizing: border-box;\n border-radius: 50px;\n margin: 0 20px;\n padding: 0 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n height: 44px;\n\n @media (min-width: 821px) {\n border: 1px solid #DEE2E6;\n justify-content: space-between;\n }\n\n @media (min-width: 1024px) {\n padding: 0 20px;\n margin-left: 35px;\n margin-right: 10px;\n }\n \n @media (min-width: 1200px) {\n padding: 0 30px;\n margin-left: 50px;\n margin-right: 15px;\n }\n\n @media (min-width: 1500px) {\n padding: 0 30px;\n margin-left: 75px;\n margin-right: 20px\n }\n }\n\n > *:not(:last-child) {\n margin: 0 5px;\n }\n\n > span {\n #select-input {\n background: transparent !important;\n }\n }\n\n .moment-popover {\n border-left: 1px solid #DEE2E6;\n border-right: 1px solid #DEE2E6;\n justify-content: center;\n width: 200px;\n display: none;\n\n @media (min-width: 1175px) {\n width: 250px;\n }\n \n @media (min-width: 1400px) {\n width: 400px;\n }\n\n > div:first-child {\n width: 100%;\n display: flex;\n justify-content: center;\n }\n }\n\n .address-popover {\n flex-grow: 1;\n display: none;\n > div:first-child {\n width: 100%;\n }\n }\n\n .order-type {\n padding: 0 5px;\n\n > div {\n min-width: auto;\n text-overflow: ellipsis;\n overflow: hidden;\n width: 40px;\n }\n\n @media (min-width: 1123px) {\n padding: 0 10px;\n > div {\n min-width: fit-content;\n }\n }\n @media (min-width: 1200px) {\n padding: 0 20px;\n }\n }\n\n\n @media (min-width: 821px) {\n .moment-popover,\n .address-popover {\n display: flex;\n }\n }\n"])));
|
|
27
|
+
var Menu = exports.Menu = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n #select-input {\n border-radius: 7.6px;\n\n #list {\n border-radius: 7.6px;\n }\n }\n\n &.left-header {\n background: #F8F9FA;\n border: none;\n box-sizing: border-box;\n border-radius: 50px;\n margin: 0 20px;\n padding: 0 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n height: 44px;\n\n @media (min-width: 821px) {\n border: 1px solid #DEE2E6;\n justify-content: space-between;\n }\n\n @media (min-width: 1024px) {\n padding: 0 20px;\n margin-left: 35px;\n margin-right: 10px;\n }\n \n @media (min-width: 1200px) {\n padding: 0 30px;\n margin-left: 50px;\n margin-right: 15px;\n }\n\n @media (min-width: 1500px) {\n padding: 0 30px;\n margin-left: 75px;\n margin-right: 20px\n }\n }\n\n > *:not(:last-child) {\n margin: 0 5px;\n }\n\n > span {\n #select-input {\n background: transparent !important;\n }\n }\n\n .moment-popover {\n border-left: 1px solid #DEE2E6;\n border-right: 1px solid #DEE2E6;\n justify-content: center;\n width: 200px;\n display: none;\n\n @media (min-width: 1175px) {\n width: 250px;\n }\n \n @media (min-width: 1400px) {\n width: 400px;\n }\n\n > div:first-child {\n width: 100%;\n display: flex;\n justify-content: center;\n }\n }\n\n .address-popover {\n flex-grow: 1;\n display: none;\n > div:first-child {\n width: 100%;\n }\n }\n\n .order-type {\n padding: 0 5px;\n\n > div {\n min-width: auto;\n text-overflow: ellipsis;\n overflow: hidden;\n min-width: 40px;\n }\n\n @media (min-width: 1123px) {\n padding: 0 10px;\n > div {\n min-width: fit-content;\n }\n }\n @media (min-width: 1200px) {\n padding: 0 20px;\n }\n }\n\n\n @media (min-width: 821px) {\n .moment-popover,\n .address-popover {\n display: flex;\n }\n }\n"])));
|
|
28
28
|
var MenuItem = exports.MenuItem = _styledComponents.default.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
29
29
|
var MenuLink = exports.MenuLink = _styledComponents.default.a(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n text-decoration: none;\n font-size: 14px;\n padding: 10px;\n color: #333;\n cursor: pointer;\n\n ", "\n"])), function (_ref2) {
|
|
30
30
|
var highlight = _ref2.highlight;
|
|
@@ -49,7 +49,7 @@ var AddressMenu = exports.AddressMenu = _styledComponents.default.div(_templateO
|
|
|
49
49
|
var _props$theme2;
|
|
50
50
|
return ((_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : _props$theme2.rtl) && (0, _styledComponents.css)(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n margin-left: 10px;\n margin-right: 0;\n "])));
|
|
51
51
|
});
|
|
52
|
-
var MomentMenu = exports.MomentMenu = _styledComponents.default.div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n border-left: 1px solid #DEE2E6;\n border-right: 1px solid #DEE2E6;\n height: 100%;\n justify-content: center;\n width: 200px;\n display: none;\n \n @media (min-width: 821px) {\n display: flex;\n }\n\n @media (min-width: 1175px) {\n width: 250px;\n }\n\n @media (min-width: 1400px) {\n width:
|
|
52
|
+
var MomentMenu = exports.MomentMenu = _styledComponents.default.div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n border-left: 1px solid #DEE2E6;\n border-right: 1px solid #DEE2E6;\n height: 100%;\n justify-content: center;\n width: 200px;\n display: none;\n \n @media (min-width: 821px) {\n display: flex;\n }\n\n @media (min-width: 1175px) {\n width: 250px;\n }\n\n @media (min-width: 1400px) {\n width: 300px;\n }\n\n > div {\n cursor: pointer;\n font-size: 14px;\n color: #909BA9;\n display: flex;\n align-items: center;\n text-align: center;\n white-space: nowrap;\n padding: 0 10px;\n }\n"])));
|
|
53
53
|
var FarAwayMessage = exports.FarAwayMessage = _styledComponents.default.div(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n pointer-events: none;\n position: absolute;\n display: flex;\n align-items: center;\n top: 100%;\n background: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.12);\n border-radius: 7.6px;\n padding: 6px 15px;\n box-sizing: border-box;\n z-index: 2000;\n margin: 10px 0px 0px 0px !important;\n\n left: 5px;\n ", "\n\n svg {\n font-size: 20px;\n color: ", ";\n margin-right: 10px;\n ", "\n }\n span {\n font-size: 12px;\n line-height: 18px;\n color: ", ";\n }\n\n @media (min-width: 400px) {\n padding: 8px 20px;\n font-size: 14px;\n line-height: 24px;\n left: 10px;\n ", "\n }\n"])), function (props) {
|
|
54
54
|
return props.theme.colors.warning100;
|
|
55
55
|
}, function (props) {
|
|
@@ -419,7 +419,7 @@ var CartUI = function CartUI(props) {
|
|
|
419
419
|
})), (cart === null || cart === void 0 || (_cart$offers4 = cart.offers) === null || _cart$offers4 === void 0 || (_cart$offers4 = _cart$offers4.filter(function (offer) {
|
|
420
420
|
return (offer === null || offer === void 0 ? void 0 : offer.target) === 1;
|
|
421
421
|
})) === null || _cart$offers4 === void 0 ? void 0 : _cart$offers4.length) > 0 && (cart === null || cart === void 0 ? void 0 : cart.subtotal_with_discount) > 0 && (cart === null || cart === void 0 ? void 0 : cart.discount) > 0 && (cart === null || cart === void 0 ? void 0 : cart.total) >= 0 && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')), (cart === null || cart === void 0 || (_cart$business = cart.business) === null || _cart$business === void 0 ? void 0 : _cart$business.tax_type) === 1 ? /*#__PURE__*/_react.default.createElement("td", null, parsePrice((_ref = (cart === null || cart === void 0 ? void 0 : cart.subtotal_with_discount) + getIncludedTaxesDiscounts()) !== null && _ref !== void 0 ? _ref : 0)) : /*#__PURE__*/_react.default.createElement("td", null, parsePrice((_cart$subtotal_with_d = cart === null || cart === void 0 ? void 0 : cart.subtotal_with_discount) !== null && _cart$subtotal_with_d !== void 0 ? _cart$subtotal_with_d : 0))), (cart === null || cart === void 0 || (_cart$taxes3 = cart.taxes) === null || _cart$taxes3 === void 0 ? void 0 : _cart$taxes3.length) > 0 && (cart === null || cart === void 0 || (_cart$taxes4 = cart.taxes) === null || _cart$taxes4 === void 0 ? void 0 : _cart$taxes4.filter(function (tax) {
|
|
422
|
-
return (tax === null || tax === void 0 ? void 0 : tax.type) === 2 && (tax === null || tax === void 0 ? void 0 : tax.rate) !== 0;
|
|
422
|
+
return (tax === null || tax === void 0 ? void 0 : tax.type) === 2 && (tax === null || tax === void 0 ? void 0 : tax.rate) !== 0 && (tax === null || tax === void 0 ? void 0 : tax.target) === 'product';
|
|
423
423
|
}).map(function (tax) {
|
|
424
424
|
var _ref2, _tax$summary$tax_afte2, _tax$summary4, _tax$summary5;
|
|
425
425
|
return /*#__PURE__*/_react.default.createElement("tr", {
|
|
@@ -483,7 +483,7 @@ var CartUI = function CartUI(props) {
|
|
|
483
483
|
return onRemoveOffer(offer === null || offer === void 0 ? void 0 : offer.id);
|
|
484
484
|
}
|
|
485
485
|
}))), /*#__PURE__*/_react.default.createElement("td", null, "- ", parsePrice(offer === null || offer === void 0 || (_offer$summary2 = offer.summary) === null || _offer$summary2 === void 0 ? void 0 : _offer$summary2.discount)));
|
|
486
|
-
})), (orderState === null || orderState === void 0 || (_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 ? void 0 : _orderState$options3.type) === 1 && !hideDeliveryFee && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('DELIVERY_FEE', 'Delivery Fee')), /*#__PURE__*/_react.default.createElement("td", null, parsePrice((cart === null || cart === void 0 ? void 0 : cart.delivery_price_with_discount) + getIncludedTaxes(true)))), (cart === null || cart === void 0 || (_cart$taxes5 = cart.taxes) === null || _cart$taxes5 === void 0 ? void 0 : _cart$taxes5.length) > 0 && (cart === null || cart === void 0 || (_cart$taxes6 = cart.taxes) === null || _cart$taxes6 === void 0 ? void 0 : _cart$taxes6.filter(function (tax) {
|
|
486
|
+
})), (orderState === null || orderState === void 0 || (_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 ? void 0 : _orderState$options3.type) === 1 && !hideDeliveryFee && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('DELIVERY_FEE', 'Delivery Fee')), /*#__PURE__*/_react.default.createElement("td", null, parsePrice((cart === null || cart === void 0 ? void 0 : cart.delivery_price_with_discount) + getIncludedTaxes(true)))), (cart === null || cart === void 0 ? void 0 : cart.extra_value_checkprice) && (cart === null || cart === void 0 ? void 0 : cart.extra_value_checkprice) > 0 && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('EXTRA_VALUE_CHECKPRICE', 'Extra value checkprice')), /*#__PURE__*/_react.default.createElement("td", null, parsePrice(cart === null || cart === void 0 ? void 0 : cart.extra_value_checkprice))), (cart === null || cart === void 0 || (_cart$taxes5 = cart.taxes) === null || _cart$taxes5 === void 0 ? void 0 : _cart$taxes5.length) > 0 && (cart === null || cart === void 0 || (_cart$taxes6 = cart.taxes) === null || _cart$taxes6 === void 0 ? void 0 : _cart$taxes6.filter(function (tax) {
|
|
487
487
|
return (tax === null || tax === void 0 ? void 0 : tax.type) === 2 && (tax === null || tax === void 0 ? void 0 : tax.rate) !== 0 && (tax === null || tax === void 0 ? void 0 : tax.target) === 'delivery_fee';
|
|
488
488
|
}).map(function (tax) {
|
|
489
489
|
var _ref4, _tax$summary$tax_afte3, _tax$summary6, _tax$summary7;
|
|
@@ -12,6 +12,10 @@ var _Buttons = require("../../styles/Buttons");
|
|
|
12
12
|
var _NotFoundSource = require("../NotFoundSource");
|
|
13
13
|
var _styles = require("./styles");
|
|
14
14
|
var _AutoScroll = require("../AutoScroll");
|
|
15
|
+
var _Modal = _interopRequireDefault(require("../Modal"));
|
|
16
|
+
var _BusinessPreorder = require("../BusinessPreorder");
|
|
17
|
+
var _utils = require("../../../../../utils");
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
21
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -31,7 +35,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
31
35
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
32
36
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
37
|
var HighestRatedUI = function HighestRatedUI(props) {
|
|
34
|
-
var _businessesList$busin, _businessesList$busin3, _props$beforeElements, _props$beforeComponen, _businessesList$busin4, _props$afterComponent, _props$afterElements;
|
|
38
|
+
var _businessesList$busin, _orderState$options, _orderState$options2, _businessesList$busin3, _props$beforeElements, _props$beforeComponen, _businessesList$busin4, _props$afterComponent, _props$afterElements;
|
|
35
39
|
var businessesList = props.businessesList,
|
|
36
40
|
handleBusinessClick = props.handleBusinessClick,
|
|
37
41
|
isCustomLayout = props.isCustomLayout,
|
|
@@ -46,10 +50,27 @@ var HighestRatedUI = function HighestRatedUI(props) {
|
|
|
46
50
|
var _useOrder = (0, _orderingComponentsExternal.useOrder)(),
|
|
47
51
|
_useOrder2 = _slicedToArray(_useOrder, 1),
|
|
48
52
|
orderState = _useOrder2[0];
|
|
53
|
+
var _useState = (0, _react.useState)(false),
|
|
54
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
55
|
+
isPreorder = _useState2[0],
|
|
56
|
+
setIsPreorder = _useState2[1];
|
|
57
|
+
var _useState3 = (0, _react.useState)(null),
|
|
58
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
59
|
+
preorderBusiness = _useState4[0],
|
|
60
|
+
setPreorderBusiness = _useState4[1];
|
|
49
61
|
var isBusinessWithReviews = businessesList === null || businessesList === void 0 || (_businessesList$busin = businessesList.businesses) === null || _businessesList$busin === void 0 ? void 0 : _businessesList$busin.every(function (business) {
|
|
50
62
|
var _business$reviews;
|
|
51
63
|
return (business === null || business === void 0 || (_business$reviews = business.reviews) === null || _business$reviews === void 0 ? void 0 : _business$reviews.total) === 0;
|
|
52
64
|
});
|
|
65
|
+
var cateringTypeString = (orderState === null || orderState === void 0 || (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.type) === 7 ? 'catering_delivery' : (orderState === null || orderState === void 0 || (_orderState$options2 = orderState.options) === null || _orderState$options2 === void 0 ? void 0 : _orderState$options2.type) === 8 ? 'catering_pickup' : null;
|
|
66
|
+
var cateringValues = (preorderBusiness === null || preorderBusiness === void 0 ? void 0 : preorderBusiness.configs) && (0, _utils.getCateringValues)(cateringTypeString, preorderBusiness === null || preorderBusiness === void 0 ? void 0 : preorderBusiness.configs);
|
|
67
|
+
var handleClosePreorder = function handleClosePreorder() {
|
|
68
|
+
setIsPreorder(false);
|
|
69
|
+
setPreorderBusiness(null);
|
|
70
|
+
};
|
|
71
|
+
(0, _react.useEffect)(function () {
|
|
72
|
+
if (preorderBusiness) setIsPreorder(true);
|
|
73
|
+
}, [preorderBusiness]);
|
|
53
74
|
(0, _react.useEffect)(function () {
|
|
54
75
|
if (!businessesList.loading) {
|
|
55
76
|
setHasHighRatedBusiness(!isBusinessWithReviews);
|
|
@@ -85,33 +106,45 @@ var HighestRatedUI = function HighestRatedUI(props) {
|
|
|
85
106
|
}, t('CHANGE_ADDRESS', 'Select other Address'))), /*#__PURE__*/_react.default.createElement(_AutoScroll.AutoScroll, {
|
|
86
107
|
scrollId: "highestRated"
|
|
87
108
|
}, !(businessesList !== null && businessesList !== void 0 && businessesList.loading) && (businessesList === null || businessesList === void 0 || (_businessesList$busin4 = businessesList.businesses) === null || _businessesList$busin4 === void 0 ? void 0 : _businessesList$busin4.map(function (business) {
|
|
88
|
-
var _business$reviews2, _orderState$
|
|
109
|
+
var _business$reviews2, _orderState$options3;
|
|
89
110
|
return (business === null || business === void 0 || (_business$reviews2 = business.reviews) === null || _business$reviews2 === void 0 ? void 0 : _business$reviews2.total) > 0 && /*#__PURE__*/_react.default.createElement(_BusinessController.BusinessController, {
|
|
90
111
|
key: business.id,
|
|
91
112
|
className: "card",
|
|
92
113
|
business: business,
|
|
93
114
|
isBusinessOpen: business.open,
|
|
94
115
|
handleCustomClick: handleBusinessClick,
|
|
95
|
-
orderType: orderState === null || orderState === void 0 || (_orderState$
|
|
116
|
+
orderType: orderState === null || orderState === void 0 || (_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 ? void 0 : _orderState$options3.type,
|
|
96
117
|
isCustomLayout: isCustomLayout,
|
|
97
118
|
isCustomerMode: isCustomerMode,
|
|
98
119
|
favoriteIds: favoriteIds,
|
|
99
|
-
setFavoriteIds: setFavoriteIds
|
|
120
|
+
setFavoriteIds: setFavoriteIds,
|
|
121
|
+
onPreorderBusiness: setPreorderBusiness
|
|
100
122
|
});
|
|
101
123
|
}))), businessesList.loading && _toConsumableArray(Array(8).keys()).map(function (i) {
|
|
102
|
-
var _orderState$
|
|
124
|
+
var _orderState$options4;
|
|
103
125
|
return /*#__PURE__*/_react.default.createElement(_BusinessController.BusinessController, {
|
|
104
126
|
key: i,
|
|
105
127
|
className: "card",
|
|
106
128
|
business: {},
|
|
107
129
|
isSkeleton: true,
|
|
108
|
-
orderType: orderState === null || orderState === void 0 || (_orderState$
|
|
130
|
+
orderType: orderState === null || orderState === void 0 || (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.type
|
|
109
131
|
});
|
|
110
132
|
}), businessesList.error && businessesList.error.length > 0 && businessesList.businesses.length === 0 && businessesList.error.map(function (e, i) {
|
|
111
133
|
return /*#__PURE__*/_react.default.createElement(_styles.ErrorMessage, {
|
|
112
134
|
key: i
|
|
113
135
|
}, t('ERROR', 'ERROR'), ": [", (e === null || e === void 0 ? void 0 : e.message) || e, "]");
|
|
114
|
-
})))),
|
|
136
|
+
})))), /*#__PURE__*/_react.default.createElement(_Modal.default, {
|
|
137
|
+
open: isPreorder,
|
|
138
|
+
width: "760px",
|
|
139
|
+
onClose: function onClose() {
|
|
140
|
+
return handleClosePreorder();
|
|
141
|
+
}
|
|
142
|
+
}, /*#__PURE__*/_react.default.createElement(_BusinessPreorder.BusinessPreorder, _extends({
|
|
143
|
+
business: preorderBusiness,
|
|
144
|
+
handleClick: handleBusinessClick,
|
|
145
|
+
showButton: true,
|
|
146
|
+
cateringPreorder: !!cateringTypeString
|
|
147
|
+
}, cateringValues))), (_props$afterComponent = props.afterComponents) === null || _props$afterComponent === void 0 ? void 0 : _props$afterComponent.map(function (AfterComponent, i) {
|
|
115
148
|
return /*#__PURE__*/_react.default.createElement(AfterComponent, _extends({
|
|
116
149
|
key: i
|
|
117
150
|
}, props));
|
|
@@ -81,7 +81,7 @@ var OrderBillSection = exports.OrderBillSection = function OrderBillSection(prop
|
|
|
81
81
|
color: theme.colors.primary
|
|
82
82
|
}))), /*#__PURE__*/_react.default.createElement("td", null, "- ", parsePrice(offer === null || offer === void 0 || (_offer$summary = offer.summary) === null || _offer$summary === void 0 ? void 0 : _offer$summary.discount)));
|
|
83
83
|
})), (order === null || order === void 0 || (_order$summary5 = order.summary) === null || _order$summary5 === void 0 ? void 0 : _order$summary5.subtotal_with_discount) > 0 && (order === null || order === void 0 || (_order$summary6 = order.summary) === null || _order$summary6 === void 0 ? void 0 : _order$summary6.discount) > 0 && (order === null || order === void 0 || (_order$summary7 = order.summary) === null || _order$summary7 === void 0 ? void 0 : _order$summary7.total) >= 0 && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')), (order === null || order === void 0 ? void 0 : order.tax_type) === 1 ? /*#__PURE__*/_react.default.createElement("td", null, parsePrice((_ref2 = (order === null || order === void 0 || (_order$summary8 = order.summary) === null || _order$summary8 === void 0 ? void 0 : _order$summary8.subtotal_with_discount) + getIncludedTaxesDiscounts()) !== null && _ref2 !== void 0 ? _ref2 : 0)) : /*#__PURE__*/_react.default.createElement("td", null, parsePrice((_order$summary$subtot2 = order === null || order === void 0 || (_order$summary9 = order.summary) === null || _order$summary9 === void 0 ? void 0 : _order$summary9.subtotal_with_discount) !== null && _order$summary$subtot2 !== void 0 ? _order$summary$subtot2 : 0))), (order === null || order === void 0 || (_order$taxes3 = order.taxes) === null || _order$taxes3 === void 0 ? void 0 : _order$taxes3.length) === 0 && (order === null || order === void 0 ? void 0 : order.tax_type) === 2 && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('TAX', 'Tax'), /*#__PURE__*/_react.default.createElement("span", null, "(".concat((0, _utils.verifyDecimals)(order === null || order === void 0 ? void 0 : order.tax, parseNumber), "%)"))), /*#__PURE__*/_react.default.createElement("td", null, parsePrice((_order$summary$tax2 = order === null || order === void 0 || (_order$summary10 = order.summary) === null || _order$summary10 === void 0 ? void 0 : _order$summary10.tax) !== null && _order$summary$tax2 !== void 0 ? _order$summary$tax2 : 0))), (order === null || order === void 0 || (_order$fees = order.fees) === null || _order$fees === void 0 ? void 0 : _order$fees.length) === 0 && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('SERVICE_FEE', 'Service fee'), /*#__PURE__*/_react.default.createElement("span", null, "(".concat((0, _utils.verifyDecimals)(order === null || order === void 0 ? void 0 : order.service_fee, parseNumber), "%)"))), /*#__PURE__*/_react.default.createElement("td", null, parsePrice((_order$summary$servic = order === null || order === void 0 || (_order$summary11 = order.summary) === null || _order$summary11 === void 0 ? void 0 : _order$summary11.service_fee) !== null && _order$summary$servic !== void 0 ? _order$summary$servic : 0))), (order === null || order === void 0 || (_order$taxes4 = order.taxes) === null || _order$taxes4 === void 0 ? void 0 : _order$taxes4.length) > 0 && (order === null || order === void 0 || (_order$taxes5 = order.taxes) === null || _order$taxes5 === void 0 ? void 0 : _order$taxes5.filter(function (tax) {
|
|
84
|
-
return (tax === null || tax === void 0 ? void 0 : tax.type) === 2 && (tax === null || tax === void 0 ? void 0 : tax.rate) !== 0;
|
|
84
|
+
return (tax === null || tax === void 0 ? void 0 : tax.type) === 2 && (tax === null || tax === void 0 ? void 0 : tax.rate) !== 0 && (tax === null || tax === void 0 ? void 0 : tax.target) === 'product';
|
|
85
85
|
}).map(function (tax) {
|
|
86
86
|
var _tax$name, _ref3, _tax$summary$tax_afte2, _tax$summary4, _tax$summary5;
|
|
87
87
|
return /*#__PURE__*/_react.default.createElement("tr", {
|
|
@@ -134,7 +134,7 @@ var OrderBillSection = exports.OrderBillSection = function OrderBillSection(prop
|
|
|
134
134
|
size: "20",
|
|
135
135
|
color: theme.colors.primary
|
|
136
136
|
}))), /*#__PURE__*/_react.default.createElement("td", null, "- ", parsePrice(offer === null || offer === void 0 || (_offer$summary2 = offer.summary) === null || _offer$summary2 === void 0 ? void 0 : _offer$summary2.discount)));
|
|
137
|
-
})), typeof (order === null || order === void 0 || (_order$summary12 = order.summary) === null || _order$summary12 === void 0 ? void 0 : _order$summary12.delivery_price) === 'number' && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('DELIVERY_FEE', (theme === null || theme === void 0 || (_theme$defaultLanguag4 = theme.defaultLanguages) === null || _theme$defaultLanguag4 === void 0 ? void 0 : _theme$defaultLanguag4.DELIVERY_FEE) || 'Delivery Fee')), /*#__PURE__*/_react.default.createElement("td", null, parsePrice((order === null || order === void 0 || (_order$summary13 = order.summary) === null || _order$summary13 === void 0 ? void 0 : _order$summary13.delivery_price) + getIncludedTaxes(true)))), (order === null || order === void 0 || (_order$taxes6 = order.taxes) === null || _order$taxes6 === void 0 ? void 0 : _order$taxes6.length) > 0 && (order === null || order === void 0 || (_order$taxes7 = order.taxes) === null || _order$taxes7 === void 0 ? void 0 : _order$taxes7.filter(function (tax) {
|
|
137
|
+
})), typeof (order === null || order === void 0 || (_order$summary12 = order.summary) === null || _order$summary12 === void 0 ? void 0 : _order$summary12.delivery_price) === 'number' && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('DELIVERY_FEE', (theme === null || theme === void 0 || (_theme$defaultLanguag4 = theme.defaultLanguages) === null || _theme$defaultLanguag4 === void 0 ? void 0 : _theme$defaultLanguag4.DELIVERY_FEE) || 'Delivery Fee')), /*#__PURE__*/_react.default.createElement("td", null, parsePrice((order === null || order === void 0 || (_order$summary13 = order.summary) === null || _order$summary13 === void 0 ? void 0 : _order$summary13.delivery_price) + getIncludedTaxes(true)))), (order === null || order === void 0 ? void 0 : order.extra_value_checkprice) && (order === null || order === void 0 ? void 0 : order.extra_value_checkprice) > 0 && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('EXTRA_VALUE_CHECKPRICE', 'Extra value checkprice')), /*#__PURE__*/_react.default.createElement("td", null, parsePrice(order === null || order === void 0 ? void 0 : order.extra_value_checkprice))), (order === null || order === void 0 || (_order$taxes6 = order.taxes) === null || _order$taxes6 === void 0 ? void 0 : _order$taxes6.length) > 0 && (order === null || order === void 0 || (_order$taxes7 = order.taxes) === null || _order$taxes7 === void 0 ? void 0 : _order$taxes7.filter(function (tax) {
|
|
138
138
|
return (tax === null || tax === void 0 ? void 0 : tax.type) === 2 && (tax === null || tax === void 0 ? void 0 : tax.rate) !== 0 && (tax === null || tax === void 0 ? void 0 : tax.target) === 'delivery_fee';
|
|
139
139
|
}).map(function (tax) {
|
|
140
140
|
var _tax$name2, _ref5, _tax$summary$tax_afte3, _tax$summary6, _tax$summary7;
|
|
@@ -70,7 +70,10 @@ var OrderEta = exports.OrderEta = function OrderEta(props) {
|
|
|
70
70
|
var _estimatedTime = outputFormat ? (0, _moment.default)(estimatedUtcTime).local().format(outputFormat) : parseDate(estimatedUtcTime, {
|
|
71
71
|
utc: false
|
|
72
72
|
});
|
|
73
|
-
setEstimatedDeliveryTime(
|
|
73
|
+
setEstimatedDeliveryTime((order === null || order === void 0 ? void 0 : order.status) === 13 ? parseDate(_delivery, {
|
|
74
|
+
utc: !!(order !== null && order !== void 0 && order.delivery_datetime_utc),
|
|
75
|
+
outputFormat: outputFormat
|
|
76
|
+
}) : _estimatedTime);
|
|
74
77
|
};
|
|
75
78
|
(0, _react.useEffect)(function () {
|
|
76
79
|
getEstimatedDeliveryTime();
|
|
@@ -183,6 +183,7 @@ var OrderDetailsUI = function OrderDetailsUI(props) {
|
|
|
183
183
|
var completedStatus = [1, 2, 5, 6, 10, 11, 12, 15, 16, 17];
|
|
184
184
|
var placeSpotTypes = [3, 4, 5];
|
|
185
185
|
var activeStatus = [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23];
|
|
186
|
+
var preorderStatus = [0, 13];
|
|
186
187
|
var googleMapsApiKey = configs === null || configs === void 0 || (_configs$google_maps_ = configs.google_maps_api_key) === null || _configs$google_maps_ === void 0 ? void 0 : _configs$google_maps_.value;
|
|
187
188
|
var enabledPoweredByOrdering = configs === null || configs === void 0 || (_configs$powered_by_o = configs.powered_by_ordering_module) === null || _configs$powered_by_o === void 0 ? void 0 : _configs$powered_by_o.value;
|
|
188
189
|
var hideOrderActions = (order === null || order === void 0 ? void 0 : order.delivery_type) === 1;
|
|
@@ -585,7 +586,7 @@ var OrderDetailsUI = function OrderDetailsUI(props) {
|
|
|
585
586
|
var _order$business11;
|
|
586
587
|
return window.open("http://maps.google.com/?q=".concat(order === null || order === void 0 || (_order$business11 = order.business) === null || _order$business11 === void 0 ? void 0 : _order$business11.address));
|
|
587
588
|
}
|
|
588
|
-
}, t('GET_DIRECTIONS', 'Get Directions')))), !hideOrderActions && /*#__PURE__*/_react.default.createElement(_styles.BtsOrderStatus, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
589
|
+
}, t('GET_DIRECTIONS', 'Get Directions')))), !hideOrderActions && !preorderStatus.includes(order === null || order === void 0 ? void 0 : order.status) && /*#__PURE__*/_react.default.createElement(_styles.BtsOrderStatus, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
589
590
|
style: {
|
|
590
591
|
fontSize: 14
|
|
591
592
|
},
|
|
@@ -72,7 +72,7 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
|
|
|
72
72
|
handleChangeSuboptionState = props.handleChangeSuboptionState,
|
|
73
73
|
handleChangeCommentState = props.handleChangeCommentState,
|
|
74
74
|
productAddedToCartLength = props.productAddedToCartLength,
|
|
75
|
-
|
|
75
|
+
pizzaState = props.pizzaState,
|
|
76
76
|
handleFavoriteProduct = props.handleFavoriteProduct,
|
|
77
77
|
handleCreateGuestUser = props.handleCreateGuestUser,
|
|
78
78
|
actionStatus = props.actionStatus,
|
|
@@ -619,7 +619,7 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
|
|
|
619
619
|
isSoldOut: isSoldOut,
|
|
620
620
|
scrollDown: scrollDown,
|
|
621
621
|
setIsScrollAvailable: setIsScrollAvailable,
|
|
622
|
-
|
|
622
|
+
pizzaState: pizzaState,
|
|
623
623
|
productCart: productCart
|
|
624
624
|
});
|
|
625
625
|
}))));
|
|
@@ -32,10 +32,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
32
32
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
33
33
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
34
34
|
var ProductOptionSubOptionPropsAreEqual = function ProductOptionSubOptionPropsAreEqual(prevProps, nextProps) {
|
|
35
|
-
return JSON.stringify(prevProps.state) === JSON.stringify(nextProps.state) && prevProps.
|
|
35
|
+
return JSON.stringify(prevProps.state) === JSON.stringify(nextProps.state) && JSON.stringify(prevProps.pizzaState) === JSON.stringify(nextProps.pizzaState) && prevProps.balance === nextProps.balance && JSON.stringify(prevProps.productCart) === JSON.stringify(nextProps.productCart);
|
|
36
36
|
};
|
|
37
37
|
var ProductOptionSubOptionUI = /*#__PURE__*/_react.default.memo(function (props) {
|
|
38
|
-
var _props$beforeElements, _props$beforeComponen, _props$afterComponent, _props$afterElements;
|
|
38
|
+
var _pizzaState, _props$beforeElements, _props$beforeComponen, _pizzaState2, _props$afterComponent, _props$afterElements;
|
|
39
39
|
var state = props.state,
|
|
40
40
|
increment = props.increment,
|
|
41
41
|
decrement = props.decrement,
|
|
@@ -46,9 +46,8 @@ var ProductOptionSubOptionUI = /*#__PURE__*/_react.default.memo(function (props)
|
|
|
46
46
|
changePosition = props.changePosition,
|
|
47
47
|
isSoldOut = props.isSoldOut,
|
|
48
48
|
setIsScrollAvailable = props.setIsScrollAvailable,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
productCart = props.productCart;
|
|
49
|
+
usePizzaValidation = props.usePizzaValidation,
|
|
50
|
+
pizzaState = props.pizzaState;
|
|
52
51
|
var disableIncrement = option !== null && option !== void 0 && option.limit_suboptions_by_max ? balance === (option === null || option === void 0 ? void 0 : option.max) || state.quantity === suboption.max : state.quantity === (suboption === null || suboption === void 0 ? void 0 : suboption.max) || !state.selected && balance === (option === null || option === void 0 ? void 0 : option.max);
|
|
53
52
|
var price = option !== null && option !== void 0 && option.with_half_option && suboption !== null && suboption !== void 0 && suboption.half_price && state.position !== 'whole' ? suboption === null || suboption === void 0 ? void 0 : suboption.half_price : suboption === null || suboption === void 0 ? void 0 : suboption.price;
|
|
54
53
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
@@ -78,16 +77,18 @@ var ProductOptionSubOptionUI = /*#__PURE__*/_react.default.memo(function (props)
|
|
|
78
77
|
var _option$suboptions;
|
|
79
78
|
dirtyRef.current = true;
|
|
80
79
|
toggleSelect();
|
|
81
|
-
|
|
80
|
+
var minMaxValidation = option !== null && option !== void 0 && option.with_half_option ? usePizzaValidation : balance === (option === null || option === void 0 ? void 0 : option.max) && (option === null || option === void 0 || (_option$suboptions = option.suboptions) === null || _option$suboptions === void 0 ? void 0 : _option$suboptions.length) > balance && !((option === null || option === void 0 ? void 0 : option.min) === 1 && (option === null || option === void 0 ? void 0 : option.max) === 1);
|
|
81
|
+
if (!state.selected && minMaxValidation) {
|
|
82
82
|
setShowMessage(true);
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
85
|
(0, _react.useEffect)(function () {
|
|
86
86
|
var _option$suboptions2;
|
|
87
|
-
|
|
87
|
+
var minMaxValidation = option !== null && option !== void 0 && option.with_half_option ? usePizzaValidation : !state.selected && balance === (option === null || option === void 0 ? void 0 : option.max) && (option === null || option === void 0 || (_option$suboptions2 = option.suboptions) === null || _option$suboptions2 === void 0 ? void 0 : _option$suboptions2.length) > balance && !((option === null || option === void 0 ? void 0 : option.min) === 1 && (option === null || option === void 0 ? void 0 : option.max) === 1);
|
|
88
|
+
if (!minMaxValidation) {
|
|
88
89
|
setShowMessage(false);
|
|
89
90
|
}
|
|
90
|
-
}, [balance]);
|
|
91
|
+
}, [balance, pizzaState === null || pizzaState === void 0 || (_pizzaState = pizzaState["option:".concat(option === null || option === void 0 ? void 0 : option.id)]) === null || _pizzaState === void 0 ? void 0 : _pizzaState.value]);
|
|
91
92
|
(0, _react.useEffect)(function () {
|
|
92
93
|
if (balance === (option === null || option === void 0 ? void 0 : option.max) && state !== null && state !== void 0 && state.selected && dirtyRef) {
|
|
93
94
|
if ((dirtyRef === null || dirtyRef === void 0 ? void 0 : dirtyRef.current) !== null) {
|
|
@@ -97,10 +98,10 @@ var ProductOptionSubOptionUI = /*#__PURE__*/_react.default.memo(function (props)
|
|
|
97
98
|
}
|
|
98
99
|
}, [state === null || state === void 0 ? void 0 : state.selected]);
|
|
99
100
|
(0, _react.useEffect)(function () {
|
|
100
|
-
if (
|
|
101
|
+
if (option !== null && option !== void 0 && option.with_half_option) {
|
|
101
102
|
handlePosition({}, 'left');
|
|
102
103
|
}
|
|
103
|
-
}, [
|
|
104
|
+
}, [state === null || state === void 0 ? void 0 : state.selected, suboption === null || suboption === void 0 ? void 0 : suboption.id]);
|
|
104
105
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (_props$beforeElements = props.beforeElements) === null || _props$beforeElements === void 0 ? void 0 : _props$beforeElements.map(function (BeforeElement, i) {
|
|
105
106
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
106
107
|
key: i
|
|
@@ -126,21 +127,21 @@ var ProductOptionSubOptionUI = /*#__PURE__*/_react.default.memo(function (props)
|
|
|
126
127
|
disabled: disableIncrement || isSoldOut,
|
|
127
128
|
onClick: handleIncrement
|
|
128
129
|
}))), /*#__PURE__*/_react.default.createElement(_styles.PositionControl, null, (option === null || option === void 0 ? void 0 : option.with_half_option) && (state === null || state === void 0 ? void 0 : state.selected) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_BsCircleHalf.default, {
|
|
129
|
-
className: [
|
|
130
|
+
className: ['reverse', state.selected && state.position === 'left' ? 'selected' : null].filter(function (classname) {
|
|
130
131
|
return classname;
|
|
131
132
|
}).join(' '),
|
|
132
133
|
onClick: function onClick(e) {
|
|
133
134
|
return handlePosition(e, 'left');
|
|
134
135
|
}
|
|
135
136
|
}), /*#__PURE__*/_react.default.createElement(_BsCircleFill.default, {
|
|
136
|
-
className: [
|
|
137
|
+
className: [(pizzaState === null || pizzaState === void 0 || (_pizzaState2 = pizzaState["option:".concat(option === null || option === void 0 ? void 0 : option.id)]) === null || _pizzaState2 === void 0 ? void 0 : _pizzaState2.value) === (option === null || option === void 0 ? void 0 : option.max) ? 'disabled' : '', state.selected && state.position === 'whole' ? 'selected' : null].filter(function (classname) {
|
|
137
138
|
return classname;
|
|
138
139
|
}).join(' '),
|
|
139
140
|
onClick: function onClick(e) {
|
|
140
141
|
return handlePosition(e, 'whole');
|
|
141
142
|
}
|
|
142
143
|
}), /*#__PURE__*/_react.default.createElement(_BsCircleHalf.default, {
|
|
143
|
-
className: [
|
|
144
|
+
className: [state.selected && state.position === 'right' ? 'selected' : null].filter(function (classname) {
|
|
144
145
|
return classname;
|
|
145
146
|
}).join(' '),
|
|
146
147
|
onClick: function onClick(e) {
|
|
@@ -25,7 +25,7 @@ var Text = exports.Text = _styledComponents.default.div(_templateObject4 || (_te
|
|
|
25
25
|
return props.theme.colors.primary;
|
|
26
26
|
}, function (props) {
|
|
27
27
|
var _props$theme2;
|
|
28
|
-
return ((_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : _props$theme2.rtl) && (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-left: 0;\n margin-right: 10px
|
|
28
|
+
return ((_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : _props$theme2.rtl) && (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-left: 0;\n margin-right: 10px; \n "])));
|
|
29
29
|
}, function (_ref) {
|
|
30
30
|
var noMargin = _ref.noMargin;
|
|
31
31
|
return noMargin && (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n span {\n margin: 0;\n }\n "])));
|
|
@@ -57,7 +57,8 @@ var SignUpDriverUI = function SignUpDriverUI(props) {
|
|
|
57
57
|
saveCustomerUser = props.saveCustomerUser,
|
|
58
58
|
fieldsNotValid = props.fieldsNotValid,
|
|
59
59
|
signupData = props.signupData,
|
|
60
|
-
enableReCaptcha = props.enableReCaptcha
|
|
60
|
+
enableReCaptcha = props.enableReCaptcha,
|
|
61
|
+
isDriverSignup = props.isDriverSignup;
|
|
61
62
|
var theme = (0, _styledComponents.useTheme)();
|
|
62
63
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
63
64
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
@@ -358,7 +359,7 @@ var SignUpDriverUI = function SignUpDriverUI(props) {
|
|
|
358
359
|
className: "formButton",
|
|
359
360
|
disabled: formState.loading || (validationFields === null || validationFields === void 0 ? void 0 : validationFields.loading)
|
|
360
361
|
}, formState.loading ? "".concat(t('LOADING', 'Loading'), "...") : t('SUBMIT', 'Submit')))), /*#__PURE__*/_react.default.createElement(_Confirm.Alert, {
|
|
361
|
-
title: t('SIGN_UP_FOR_BUSINESS', 'Sign up for business'),
|
|
362
|
+
title: isDriverSignup ? t('SIGN_UP_FOR_DRIVER', 'Sign up for driver') : t('SIGN_UP_FOR_BUSINESS', 'Sign up for business'),
|
|
362
363
|
content: alertState.content,
|
|
363
364
|
acceptText: t('ACCEPT', 'Accept'),
|
|
364
365
|
open: alertState.open,
|
|
@@ -57,7 +57,8 @@ var SignUpDriverUI = function SignUpDriverUI(props) {
|
|
|
57
57
|
saveCustomerUser = props.saveCustomerUser,
|
|
58
58
|
fieldsNotValid = props.fieldsNotValid,
|
|
59
59
|
signupData = props.signupData,
|
|
60
|
-
enableReCaptcha = props.enableReCaptcha
|
|
60
|
+
enableReCaptcha = props.enableReCaptcha,
|
|
61
|
+
isDriverSignup = props.isDriverSignup;
|
|
61
62
|
var theme = (0, _styledComponents.useTheme)();
|
|
62
63
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
63
64
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
@@ -353,7 +354,7 @@ var SignUpDriverUI = function SignUpDriverUI(props) {
|
|
|
353
354
|
type: "submit",
|
|
354
355
|
disabled: formState.loading || (validationFields === null || validationFields === void 0 ? void 0 : validationFields.loading)
|
|
355
356
|
}, formState.loading ? "".concat(t('LOADING', 'Loading'), "...") : t('SUBMIT', 'Submit')))), /*#__PURE__*/_react.default.createElement(_Confirm.Alert, {
|
|
356
|
-
title: t('SIGN_UP_FOR_BUSINESS', 'Sign up for business'),
|
|
357
|
+
title: isDriverSignup ? t('SIGN_UP_FOR_DRIVER', 'Sign up for driver') : t('SIGN_UP_FOR_BUSINESS', 'Sign up for business'),
|
|
357
358
|
content: alertState.content,
|
|
358
359
|
acceptText: t('ACCEPT', 'Accept'),
|
|
359
360
|
open: alertState.open,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-external",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.1",
|
|
4
4
|
"description": "Ordering UI Components",
|
|
5
5
|
"main": "./_modules/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"lodash": "^4.17.19",
|
|
89
89
|
"moment": "^2.29.4",
|
|
90
90
|
"nanoid": "^4.0.0",
|
|
91
|
-
"ordering-components-external": "
|
|
91
|
+
"ordering-components-external": "10.0.0",
|
|
92
92
|
"payment": "^2.4.6",
|
|
93
93
|
"polished": "^3.6.6",
|
|
94
94
|
"react-bootstrap-icons": "^1.7.2",
|
|
@@ -33,6 +33,14 @@ const BusinessProductsListUI = (props) => {
|
|
|
33
33
|
|
|
34
34
|
const [, t] = useLanguage()
|
|
35
35
|
|
|
36
|
+
const uniqueFeaturedProducts = (data, key) => {
|
|
37
|
+
return [
|
|
38
|
+
...new Map(
|
|
39
|
+
data.map(p => [key(p), p])
|
|
40
|
+
).values()
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
|
|
36
44
|
return (
|
|
37
45
|
<>
|
|
38
46
|
{props.beforeElements?.map((BeforeElement, i) => (
|
|
@@ -69,7 +77,7 @@ const BusinessProductsListUI = (props) => {
|
|
|
69
77
|
<WrapAllCategories>
|
|
70
78
|
<h3>{t('FEATURED', 'Featured')}</h3>
|
|
71
79
|
<ProductsListing>
|
|
72
|
-
{categoryState.products?.sort((a, b) => a.rank - b.rank).
|
|
80
|
+
{uniqueFeaturedProducts(categoryState.products?.sort((a, b) => a.rank - b.rank).filter((p, i, hash) => p.featured), (product) => product.name)?.sort((a, b) => a.rank - b.rank).map(product => (
|
|
73
81
|
<SingleProductCard
|
|
74
82
|
key={product?.id}
|
|
75
83
|
isSoldOut={(product.inventoried && !product.quantity)}
|
|
@@ -40,7 +40,6 @@ import { HeaderOption } from '../HeaderOption'
|
|
|
40
40
|
import { SidebarMenu } from '../SidebarMenu'
|
|
41
41
|
import { UserDetails } from '../UserDetails'
|
|
42
42
|
import { Confirm } from '../Confirm'
|
|
43
|
-
import { getDistance } from '../../../../../utils'
|
|
44
43
|
import { BusinessPreorder } from '../BusinessPreorder'
|
|
45
44
|
import { AdminAreaPopover } from '../AdminAreaPopover'
|
|
46
45
|
|
|
@@ -184,7 +184,7 @@ export const Menu = styled.div`
|
|
|
184
184
|
min-width: auto;
|
|
185
185
|
text-overflow: ellipsis;
|
|
186
186
|
overflow: hidden;
|
|
187
|
-
width: 40px;
|
|
187
|
+
min-width: 40px;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
@media (min-width: 1123px) {
|
|
@@ -336,7 +336,7 @@ export const MomentMenu = styled.div`
|
|
|
336
336
|
}
|
|
337
337
|
|
|
338
338
|
@media (min-width: 1400px) {
|
|
339
|
-
width:
|
|
339
|
+
width: 300px;
|
|
340
340
|
}
|
|
341
341
|
|
|
342
342
|
> div {
|
|
@@ -399,7 +399,7 @@ const CartUI = (props) => {
|
|
|
399
399
|
)
|
|
400
400
|
}
|
|
401
401
|
{
|
|
402
|
-
cart?.taxes?.length > 0 && cart?.taxes?.filter(tax => tax?.type === 2 && tax?.rate !== 0).map(tax => (
|
|
402
|
+
cart?.taxes?.length > 0 && cart?.taxes?.filter(tax => tax?.type === 2 && tax?.rate !== 0 && tax?.target === 'product').map(tax => (
|
|
403
403
|
<tr key={tax?.id}>
|
|
404
404
|
<td className='icon'>
|
|
405
405
|
{tax.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
@@ -453,6 +453,12 @@ const CartUI = (props) => {
|
|
|
453
453
|
<td>{parsePrice(cart?.delivery_price_with_discount + getIncludedTaxes(true))}</td>
|
|
454
454
|
</tr>
|
|
455
455
|
)}
|
|
456
|
+
{cart?.extra_value_checkprice && cart?.extra_value_checkprice > 0 && (
|
|
457
|
+
<tr>
|
|
458
|
+
<td>{t('EXTRA_VALUE_CHECKPRICE', 'Extra value checkprice')}</td>
|
|
459
|
+
<td>{parsePrice(cart?.extra_value_checkprice)}</td>
|
|
460
|
+
</tr>
|
|
461
|
+
)}
|
|
456
462
|
{
|
|
457
463
|
cart?.taxes?.length > 0 && cart?.taxes?.filter(tax => tax?.type === 2 && tax?.rate !== 0 && tax?.target === 'delivery_fee').map(tax => (
|
|
458
464
|
<tr key={tax?.id}>
|