ordering-ui-external 10.3.4 → 10.4.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.e4b344da6e70bac839ce.js → 7.ordering-ui.62d46eec3c210c5257aa.js} +1 -1
- package/_bundles/{ordering-ui.e4b344da6e70bac839ce.js → ordering-ui.62d46eec3c210c5257aa.js} +2 -2
- package/_modules/themes/five/index.js +7 -0
- package/_modules/themes/five/src/components/BusinessPreorder/styles.js +2 -2
- package/_modules/themes/five/src/components/BusinessProductsList/index.js +35 -13
- package/_modules/themes/five/src/components/BusinessProductsList/styles.js +7 -3
- package/_modules/themes/five/src/components/Cart/index.js +2 -2
- package/_modules/themes/five/src/components/GiftCard/SendGiftCard/index.js +2 -2
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +3 -2
- package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +2 -2
- package/_modules/themes/five/src/components/WebsocketStatus/index.js +123 -0
- package/_modules/themes/five/src/components/WebsocketStatus/styles.js +69 -0
- package/_modules/themes/five/src/styles/Buttons/index.js +118 -89
- package/package.json +2 -2
- package/src/themes/five/index.js +2 -1
- package/src/themes/five/src/components/BusinessPreorder/styles.js +4 -4
- package/src/themes/five/src/components/BusinessProductsList/index.js +36 -3
- package/src/themes/five/src/components/BusinessProductsList/styles.js +20 -0
- package/src/themes/five/src/components/Cart/index.js +2 -2
- package/src/themes/five/src/components/GiftCard/SendGiftCard/index.js +2 -2
- package/src/themes/five/src/components/RenderProductsLayout/index.js +1 -0
- package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +2 -2
- package/src/themes/five/src/components/WebsocketStatus/index.js +142 -0
- package/src/themes/five/src/components/WebsocketStatus/styles.js +184 -0
- package/src/themes/five/src/styles/Buttons/index.js +67 -0
- package/template/pages/BusinessProductsList/index.js +2 -1
- package/template/theme.json +2 -1
- /package/_bundles/{0.ordering-ui.e4b344da6e70bac839ce.js → 0.ordering-ui.62d46eec3c210c5257aa.js} +0 -0
- /package/_bundles/{1.ordering-ui.e4b344da6e70bac839ce.js → 1.ordering-ui.62d46eec3c210c5257aa.js} +0 -0
- /package/_bundles/{2.ordering-ui.e4b344da6e70bac839ce.js → 2.ordering-ui.62d46eec3c210c5257aa.js} +0 -0
- /package/_bundles/{4.ordering-ui.e4b344da6e70bac839ce.js → 4.ordering-ui.62d46eec3c210c5257aa.js} +0 -0
- /package/_bundles/{5.ordering-ui.e4b344da6e70bac839ce.js → 5.ordering-ui.62d46eec3c210c5257aa.js} +0 -0
- /package/_bundles/{6.ordering-ui.e4b344da6e70bac839ce.js → 6.ordering-ui.62d46eec3c210c5257aa.js} +0 -0
- /package/_bundles/{7.ordering-ui.e4b344da6e70bac839ce.js.LICENSE.txt → 7.ordering-ui.62d46eec3c210c5257aa.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.e4b344da6e70bac839ce.js → 8.ordering-ui.62d46eec3c210c5257aa.js} +0 -0
- /package/_bundles/{9.ordering-ui.e4b344da6e70bac839ce.js → 9.ordering-ui.62d46eec3c210c5257aa.js} +0 -0
- /package/_bundles/{ordering-ui.e4b344da6e70bac839ce.js.LICENSE.txt → ordering-ui.62d46eec3c210c5257aa.js.LICENSE.txt} +0 -0
|
@@ -777,6 +777,12 @@ Object.defineProperty(exports, "Wallets", {
|
|
|
777
777
|
return _Wallets.Wallets;
|
|
778
778
|
}
|
|
779
779
|
});
|
|
780
|
+
Object.defineProperty(exports, "WebsocketStatus", {
|
|
781
|
+
enumerable: true,
|
|
782
|
+
get: function get() {
|
|
783
|
+
return _WebsocketStatus.WebsocketStatus;
|
|
784
|
+
}
|
|
785
|
+
});
|
|
780
786
|
var _AccordionDropdown = require("./src/components/AccordionDropdown");
|
|
781
787
|
var _AddressDetails = require("./src/components/AddressDetails");
|
|
782
788
|
var _AddressForm = require("./src/components/AddressForm");
|
|
@@ -899,6 +905,7 @@ var _Confirm = require("./src/components/Confirm");
|
|
|
899
905
|
var _TaxInformation = require("./src/components/TaxInformation");
|
|
900
906
|
var _SendGiftCard = require("./src/components/GiftCard/SendGiftCard");
|
|
901
907
|
var _DatePicker = require("./src/components/DatePicker");
|
|
908
|
+
var _WebsocketStatus = require("./src/components/WebsocketStatus");
|
|
902
909
|
var _Buttons = require("./src/styles/Buttons");
|
|
903
910
|
var _Inputs = require("./src/styles/Inputs");
|
|
904
911
|
var _Select = require("./src/styles/Select");
|
|
@@ -59,7 +59,7 @@ var TimeItem = _styledComponents.default.div(_templateObject12 || (_templateObje
|
|
|
59
59
|
});
|
|
60
60
|
}, function (_ref2) {
|
|
61
61
|
var cateringPreorder = _ref2.cateringPreorder;
|
|
62
|
-
return cateringPreorder ? (0, _styledComponents.css)(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n background: ", ";\n width: 100%;\n min-width: 100%;\n height: 50px;\n\n span {\n font-size: 18px;\n display: flex;\n align-items: center;\n margin: 10px 0;\n margin-left: 15px;\n p{\n position: relative;\n bottom: 2px;\n }\n }\n ", "\n "])), function (props) {
|
|
62
|
+
return cateringPreorder ? (0, _styledComponents.css)(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n background: ", ";\n width: 100%;\n min-width: 100%;\n height: 50px;\n \n span {\n font-size: 18px;\n display: flex;\n align-items: center;\n margin: 10px 0;\n margin-left: 15px;\n p{\n position: relative;\n bottom: 2px;\n }\n }\n ", "\n "])), function (props) {
|
|
63
63
|
var _props$theme;
|
|
64
64
|
return (_props$theme = props.theme) === null || _props$theme === void 0 || (_props$theme = _props$theme.colors) === null || _props$theme === void 0 ? void 0 : _props$theme.backgroundPage;
|
|
65
65
|
}, function (_ref3) {
|
|
@@ -67,7 +67,7 @@ var TimeItem = _styledComponents.default.div(_templateObject12 || (_templateObje
|
|
|
67
67
|
return active && (0, _styledComponents.css)(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n background: #F5F9FF;\n color: ", ";\n span {\n p{\n bottom: 0;\n margin-left: 2px;\n }\n }\n "])), function (props) {
|
|
68
68
|
return props.theme.colors.primary;
|
|
69
69
|
});
|
|
70
|
-
}) : (0, _styledComponents.css)(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n justify-content: center;\n align-items: center;\n background: #E9ECEF;\n border-radius: 7.6px;\n padding: 5px 15px;\n margin: 12px;\n width: calc(50% - 24px);\n min-width: calc(50% - 24px);\n box-sizing: border-box;\n user-select: none;\n\n @media (min-width: 400px) {\n width: calc(33.33% - 24px);\n min-width: calc(33.33% - 24px);\n }\n\n @media (min-width: 576px) {\n width: calc(25% - 24px);\n min-width: calc(25% - 24px);\n }\n\n @media (min-width: 769px) {\n width: calc(33.33% - 24px);\n min-width: calc(33.33% - 24px);\n ", "\n }\n "])), function (_ref4) {
|
|
70
|
+
}) : (0, _styledComponents.css)(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n justify-content: center;\n align-items: center;\n background: #E9ECEF;\n border-radius: 7.6px;\n padding: 5px 15px;\n margin: 12px;\n width: calc(50% - 24px);\n min-width: calc(50% - 24px);\n box-sizing: border-box;\n user-select: none;\n \n @media (min-width: 400px) {\n width: calc(33.33% - 24px);\n min-width: calc(33.33% - 24px);\n }\n \n @media (min-width: 576px) {\n width: calc(25% - 24px);\n min-width: calc(25% - 24px);\n }\n \n @media (min-width: 769px) {\n width: calc(33.33% - 24px);\n min-width: calc(33.33% - 24px);\n ", "\n }\n "])), function (_ref4) {
|
|
71
71
|
var isAppoint = _ref4.isAppoint;
|
|
72
72
|
return isAppoint && (0, _styledComponents.css)(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n width: calc(33.33% - 24px);\n min-width: calc(33.33% - 24px);\n span {\n font-size: 12px;\n }\n "])));
|
|
73
73
|
});
|
|
@@ -34,7 +34,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
34
34
|
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; } }
|
|
35
35
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
36
36
|
var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
37
|
-
var _configs$use_parent_c, _configs$use_parent_c2, _categoryState$produc, _props$beforeElements, _props$beforeComponen, _category$subcategori2, _category$subcategori3, _category$subcategori4, _categoryState$produc2, _categoryState$produc3, _categoryState$produc4, _categoryState$produc9, _props$afterComponent, _props$afterElements;
|
|
37
|
+
var _configs$use_parent_c, _configs$use_parent_c2, _categoryState$produc, _props$beforeElements, _props$beforeComponen, _category$subcategori2, _category$subcategori3, _category$subcategori4, _headerRef$current, _categoryState$produc2, _categoryState$produc3, _categoryState$produc4, _categoryState$produc9, _props$afterComponent, _props$afterElements;
|
|
38
38
|
var errors = props.errors,
|
|
39
39
|
businessId = props.businessId,
|
|
40
40
|
isLazy = props.isLazy,
|
|
@@ -56,7 +56,8 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
56
56
|
onClickCategory = props.onClickCategory,
|
|
57
57
|
handleUpdateProducts = props.handleUpdateProducts,
|
|
58
58
|
isSearchMode = props.isSearchMode,
|
|
59
|
-
business = props.business
|
|
59
|
+
business = props.business,
|
|
60
|
+
previouslyProducts = props.previouslyProducts;
|
|
60
61
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
61
62
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
62
63
|
t = _useLanguage2[1];
|
|
@@ -180,12 +181,33 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
180
181
|
}, 0)
|
|
181
182
|
});
|
|
182
183
|
})));
|
|
183
|
-
}))), !(category !== null && category !== void 0 && category.id) &&
|
|
184
|
+
}))), !(category !== null && category !== void 0 && category.id) && (previouslyProducts === null || previouslyProducts === void 0 ? void 0 : previouslyProducts.length) > 0 && /*#__PURE__*/_react.default.createElement(_styles.WrapAllCategories, {
|
|
185
|
+
id: "previously_block"
|
|
186
|
+
}, /*#__PURE__*/_react.default.createElement("h3", null, t('ORDER_IT_AGAIN', 'Order it again')), /*#__PURE__*/_react.default.createElement(_styles.CategoryDescription, {
|
|
187
|
+
maxWidth: headerRef === null || headerRef === void 0 || (_headerRef$current = headerRef.current) === null || _headerRef$current === void 0 ? void 0 : _headerRef$current.clientWidth
|
|
188
|
+
}, /*#__PURE__*/_react.default.createElement("p", null, t('ORDER_IT_AGAIN_DESC', 'Quickly add items from your past orders.'))), /*#__PURE__*/_react.default.createElement(_styles.PreviouslyOrderedContainer, null, /*#__PURE__*/_react.default.createElement(_styles.PreviouslyOrderedWrapper, null, /*#__PURE__*/_react.default.createElement(_AutoScroll.AutoScroll, {
|
|
189
|
+
scrollId: "previously_ordered"
|
|
190
|
+
}, previouslyProducts === null || previouslyProducts === void 0 ? void 0 : previouslyProducts.map(function (product, i) {
|
|
191
|
+
var _currentCart$products3;
|
|
192
|
+
return /*#__PURE__*/_react.default.createElement(_SingleProductCard.SingleProductCard, {
|
|
193
|
+
key: i,
|
|
194
|
+
isSoldOut: product.inventoried && !product.quantity,
|
|
195
|
+
product: product,
|
|
196
|
+
useKioskApp: useKioskApp,
|
|
197
|
+
businessId: businessId,
|
|
198
|
+
onProductClick: onProductClick,
|
|
199
|
+
isCartOnProductsList: isCartOnProductsList,
|
|
200
|
+
handleUpdateProducts: handleUpdateProducts,
|
|
201
|
+
productAddedToCartLength: currentCart === null || currentCart === void 0 || (_currentCart$products3 = currentCart.products) === null || _currentCart$products3 === void 0 ? void 0 : _currentCart$products3.reduce(function (productsLength, Cproduct) {
|
|
202
|
+
return productsLength + ((Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.id) === (product === null || product === void 0 ? void 0 : product.id) ? Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.quantity : 0);
|
|
203
|
+
}, 0)
|
|
204
|
+
});
|
|
205
|
+
}))))), !(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) {
|
|
184
206
|
return product.featured;
|
|
185
207
|
})) && /*#__PURE__*/_react.default.createElement(_styles.WrapAllCategories, {
|
|
186
208
|
id: "categoryfeatured"
|
|
187
209
|
}, /*#__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.map(function (product, i) {
|
|
188
|
-
var _currentCart$
|
|
210
|
+
var _currentCart$products4;
|
|
189
211
|
return product.featured && /*#__PURE__*/_react.default.createElement(_SingleProductCard.SingleProductCard, {
|
|
190
212
|
key: i,
|
|
191
213
|
isSoldOut: product.inventoried && !product.quantity,
|
|
@@ -195,7 +217,7 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
195
217
|
onProductClick: onProductClick,
|
|
196
218
|
isCartOnProductsList: isCartOnProductsList,
|
|
197
219
|
handleUpdateProducts: handleUpdateProducts,
|
|
198
|
-
productAddedToCartLength: currentCart === null || currentCart === void 0 || (_currentCart$
|
|
220
|
+
productAddedToCartLength: currentCart === null || currentCart === void 0 || (_currentCart$products4 = currentCart.products) === null || _currentCart$products4 === void 0 ? void 0 : _currentCart$products4.reduce(function (productsLength, Cproduct) {
|
|
199
221
|
return productsLength + ((Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.id) === (product === null || product === void 0 ? void 0 : product.id) ? Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.quantity : 0);
|
|
200
222
|
}, 0)
|
|
201
223
|
});
|
|
@@ -214,7 +236,7 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
214
236
|
})))), !(category !== null && category !== void 0 && category.id) && categories.filter(function (category) {
|
|
215
237
|
return (category === null || category === void 0 ? void 0 : category.id) !== null;
|
|
216
238
|
}).map(function (category, i, _categories) {
|
|
217
|
-
var _categoryState$produc5, _categoryState$produc6, _categoryState$produc7, _categoryState$produc8, _category$description, _category$description2, _category$subcategori5, _category$subcategori6, _category$ribbon, _category$ribbon2, _category$ribbon3, _category$ribbon4, _category$ribbon5, _headerRef$
|
|
239
|
+
var _categoryState$produc5, _categoryState$produc6, _categoryState$produc7, _categoryState$produc8, _category$description, _category$description2, _category$subcategori5, _category$subcategori6, _category$ribbon, _category$ribbon2, _category$ribbon3, _category$ribbon4, _category$ribbon5, _headerRef$current2, _category$description3, _category$subcategori7, _category$subcategori8, _products$filter, _category$subcategori9, _category$subcategori10;
|
|
218
240
|
var _products = !isUseParentCategory ? (_categoryState$produc5 = categoryState === null || categoryState === void 0 || (_categoryState$produc6 = categoryState.products) === null || _categoryState$produc6 === void 0 ? void 0 : _categoryState$produc6.filter(function (product) {
|
|
219
241
|
return (product === null || product === void 0 ? void 0 : product.category_id) === (category === null || category === void 0 ? void 0 : category.id);
|
|
220
242
|
})) !== null && _categoryState$produc5 !== void 0 ? _categoryState$produc5 : [] : (_categoryState$produc7 = categoryState === null || categoryState === void 0 || (_categoryState$produc8 = categoryState.products) === null || _categoryState$produc8 === void 0 ? void 0 : _categoryState$produc8.filter(function (product) {
|
|
@@ -254,7 +276,7 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
254
276
|
isRoundRect: (category === null || category === void 0 || (_category$ribbon3 = category.ribbon) === null || _category$ribbon3 === void 0 ? void 0 : _category$ribbon3.shape) === (_utils.shape === null || _utils.shape === void 0 ? void 0 : _utils.shape.rectangleRound),
|
|
255
277
|
isCapsule: (category === null || category === void 0 || (_category$ribbon4 = category.ribbon) === null || _category$ribbon4 === void 0 ? void 0 : _category$ribbon4.shape) === (_utils.shape === null || _utils.shape === void 0 ? void 0 : _utils.shape.capsuleShape)
|
|
256
278
|
}, category === null || category === void 0 || (_category$ribbon5 = category.ribbon) === null || _category$ribbon5 === void 0 ? void 0 : _category$ribbon5.text)), (category === null || category === void 0 ? void 0 : category.description) && /*#__PURE__*/_react.default.createElement(_styles.CategoryDescription, {
|
|
257
|
-
maxWidth: headerRef === null || headerRef === void 0 || (_headerRef$
|
|
279
|
+
maxWidth: headerRef === null || headerRef === void 0 || (_headerRef$current2 = headerRef.current) === null || _headerRef$current2 === void 0 ? void 0 : _headerRef$current2.clientWidth
|
|
258
280
|
}, /*#__PURE__*/_react.default.createElement("p", null, shortCategoryDescription), (category === null || category === void 0 || (_category$description3 = category.description) === null || _category$description3 === void 0 ? void 0 : _category$description3.length) > 200 && /*#__PURE__*/_react.default.createElement("span", {
|
|
259
281
|
onClick: function onClick() {
|
|
260
282
|
return setOpenDescription(category);
|
|
@@ -266,7 +288,7 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
266
288
|
}, isSearchMode && (category === null || category === void 0 || (_category$subcategori8 = category.subcategories) === null || _category$subcategori8 === void 0 ? void 0 : _category$subcategori8.length) > 0 ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, products === null || products === void 0 || (_products$filter = products.filter(function (product, i) {
|
|
267
289
|
return i < 9 && (product === null || product === void 0 ? void 0 : product.category_id) === (category === null || category === void 0 ? void 0 : category.id) || (business === null || business === void 0 ? void 0 : business.food);
|
|
268
290
|
})) === null || _products$filter === void 0 ? void 0 : _products$filter.map(function (product, i) {
|
|
269
|
-
var _currentCart$
|
|
291
|
+
var _currentCart$products5;
|
|
270
292
|
return /*#__PURE__*/_react.default.createElement(_SingleProductCard.SingleProductCard, {
|
|
271
293
|
key: i,
|
|
272
294
|
isSoldOut: product.inventoried && !product.quantity,
|
|
@@ -276,7 +298,7 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
276
298
|
useKioskApp: useKioskApp,
|
|
277
299
|
isCartOnProductsList: isCartOnProductsList,
|
|
278
300
|
handleUpdateProducts: handleUpdateProducts,
|
|
279
|
-
productAddedToCartLength: currentCart === null || currentCart === void 0 || (_currentCart$
|
|
301
|
+
productAddedToCartLength: currentCart === null || currentCart === void 0 || (_currentCart$products5 = currentCart.products) === null || _currentCart$products5 === void 0 ? void 0 : _currentCart$products5.reduce(function (productsLength, Cproduct) {
|
|
280
302
|
return productsLength + ((Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.id) === (product === null || product === void 0 ? void 0 : product.id) ? Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.quantity : 0);
|
|
281
303
|
}, 0)
|
|
282
304
|
});
|
|
@@ -295,7 +317,7 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
295
317
|
})) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, products.filter(function (_, i) {
|
|
296
318
|
return i < 9 || (business === null || business === void 0 ? void 0 : business.food);
|
|
297
319
|
}).map(function (product, i) {
|
|
298
|
-
var _currentCart$
|
|
320
|
+
var _currentCart$products6;
|
|
299
321
|
return /*#__PURE__*/_react.default.createElement(_SingleProductCard.SingleProductCard, {
|
|
300
322
|
key: i,
|
|
301
323
|
isSoldOut: product.inventoried && !product.quantity,
|
|
@@ -305,7 +327,7 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
305
327
|
useKioskApp: useKioskApp,
|
|
306
328
|
isCartOnProductsList: isCartOnProductsList,
|
|
307
329
|
handleUpdateProducts: handleUpdateProducts,
|
|
308
|
-
productAddedToCartLength: currentCart === null || currentCart === void 0 || (_currentCart$
|
|
330
|
+
productAddedToCartLength: currentCart === null || currentCart === void 0 || (_currentCart$products6 = currentCart.products) === null || _currentCart$products6 === void 0 ? void 0 : _currentCart$products6.reduce(function (productsLength, Cproduct) {
|
|
309
331
|
return productsLength + ((Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.id) === (product === null || product === void 0 ? void 0 : product.id) ? Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.quantity : 0);
|
|
310
332
|
}, 0)
|
|
311
333
|
});
|
|
@@ -339,7 +361,7 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
339
361
|
}, products === null || products === void 0 || (_products$filter2 = products.filter(function (product) {
|
|
340
362
|
return (product === null || product === void 0 ? void 0 : product.category_id) === (subcategory === null || subcategory === void 0 ? void 0 : subcategory.id);
|
|
341
363
|
})) === null || _products$filter2 === void 0 ? void 0 : _products$filter2.map(function (product, i) {
|
|
342
|
-
var _currentCart$
|
|
364
|
+
var _currentCart$products7;
|
|
343
365
|
return /*#__PURE__*/_react.default.createElement(_SingleProductCard.SingleProductCard, {
|
|
344
366
|
key: i,
|
|
345
367
|
isSoldOut: product.inventoried && !product.quantity,
|
|
@@ -349,7 +371,7 @@ var BusinessProductsListUI = function BusinessProductsListUI(props) {
|
|
|
349
371
|
isCartOnProductsList: isCartOnProductsList,
|
|
350
372
|
handleUpdateProducts: handleUpdateProducts,
|
|
351
373
|
useKioskApp: useKioskApp,
|
|
352
|
-
productAddedToCartLength: currentCart === null || currentCart === void 0 || (_currentCart$
|
|
374
|
+
productAddedToCartLength: currentCart === null || currentCart === void 0 || (_currentCart$products7 = currentCart.products) === null || _currentCart$products7 === void 0 ? void 0 : _currentCart$products7.reduce(function (productsLength, Cproduct) {
|
|
353
375
|
return productsLength + ((Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.id) === (product === null || product === void 0 ? void 0 : product.id) ? Cproduct === null || Cproduct === void 0 ? void 0 : Cproduct.quantity : 0);
|
|
354
376
|
}, 0)
|
|
355
377
|
});
|
|
@@ -4,9 +4,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.WrapperNotFound = exports.WrapAllCategories = exports.SubcategorySearchContainer = exports.SubCategoriesInnerContainer = exports.SubCategoriesContainer = exports.RibbonBox = exports.ProductsListing = exports.ProductsContainer = exports.HeaderWrapper = exports.ErrorMessage = exports.DescriptionModalContainer = exports.DescriptionContainer = exports.ContainerButton = exports.CategoryDescription = void 0;
|
|
7
|
+
exports.WrapperNotFound = exports.WrapAllCategories = exports.SubcategorySearchContainer = exports.SubCategoriesInnerContainer = exports.SubCategoriesContainer = exports.RibbonBox = exports.ProductsListing = exports.ProductsContainer = exports.PreviouslyOrderedWrapper = exports.PreviouslyOrderedContainer = exports.HeaderWrapper = exports.ErrorMessage = exports.DescriptionModalContainer = exports.DescriptionContainer = exports.ContainerButton = exports.CategoryDescription = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22;
|
|
9
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24;
|
|
10
10
|
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); }
|
|
11
11
|
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; }
|
|
12
12
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
@@ -76,4 +76,8 @@ var ContainerButton = _styledComponents.default.div(_templateObject20 || (_templ
|
|
|
76
76
|
});
|
|
77
77
|
exports.ContainerButton = ContainerButton;
|
|
78
78
|
var SubcategorySearchContainer = _styledComponents.default.div(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n margin-left: 30px;\n"])));
|
|
79
|
-
exports.SubcategorySearchContainer = SubcategorySearchContainer;
|
|
79
|
+
exports.SubcategorySearchContainer = SubcategorySearchContainer;
|
|
80
|
+
var PreviouslyOrderedContainer = _styledComponents.default.div(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n display: flex;\n overflow: scroll hidden;\n ::-webkit-scrollbar {\n width: 0px;\n height: 0px;\n }\n"])));
|
|
81
|
+
exports.PreviouslyOrderedContainer = PreviouslyOrderedContainer;
|
|
82
|
+
var PreviouslyOrderedWrapper = _styledComponents.default.div(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n display: flex;\n box-sizing: border-box;\n\n .product-card {\n width: 270px;\n max-width: 270px;\n }\n\n"])));
|
|
83
|
+
exports.PreviouslyOrderedWrapper = PreviouslyOrderedWrapper;
|
|
@@ -207,7 +207,7 @@ var CartUI = function CartUI(props) {
|
|
|
207
207
|
var cartsAvailable = (_Object$values = Object.values(orderState === null || orderState === void 0 ? void 0 : orderState.carts)) === null || _Object$values === void 0 ? void 0 : _Object$values.filter(function (cart) {
|
|
208
208
|
return (cart === null || cart === void 0 ? void 0 : cart.valid) && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2;
|
|
209
209
|
});
|
|
210
|
-
if (cartsAvailable.length === 1 || !isMultiCheckout) {
|
|
210
|
+
if (cartsAvailable.length === 1 || !isMultiCheckout || !(cart !== null && cart !== void 0 && cart.business_id)) {
|
|
211
211
|
events.emit('go_to_page', {
|
|
212
212
|
page: 'checkout',
|
|
213
213
|
params: {
|
|
@@ -564,7 +564,7 @@ var CartUI = function CartUI(props) {
|
|
|
564
564
|
cateringPreorder: true,
|
|
565
565
|
isCart: true,
|
|
566
566
|
business: cart === null || cart === void 0 ? void 0 : cart.business
|
|
567
|
-
}, cateringValues))), (onClickCheckout || isForceOpenCart) && !isCheckout && (cart === null || cart === void 0 ? void 0 : cart.valid) && (!isMultiCheckout || isStore) && /*#__PURE__*/_react.default.createElement(_styles.CheckoutAction, null, /*#__PURE__*/_react.default.createElement("p", null, (cart === null || cart === void 0 ? void 0 : cart.total) >= 1 && parsePrice(cart === null || cart === void 0 ? void 0 : cart.total)), /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
567
|
+
}, cateringValues))), (onClickCheckout || isForceOpenCart) && !isCheckout && (cart === null || cart === void 0 ? void 0 : cart.valid) && (!isMultiCheckout || isStore || !(cart !== null && cart !== void 0 && cart.business_id)) && /*#__PURE__*/_react.default.createElement(_styles.CheckoutAction, null, /*#__PURE__*/_react.default.createElement("p", null, (cart === null || cart === void 0 ? void 0 : cart.total) >= 1 && parsePrice(cart === null || cart === void 0 ? void 0 : cart.total)), /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
568
568
|
color: !(cart !== null && cart !== void 0 && cart.valid_maximum) || subtotalWithTaxes < (cart === null || cart === void 0 ? void 0 : cart.minimum) || !(cart !== null && cart !== void 0 && cart.valid_address) ? 'secundary' : 'primary',
|
|
569
569
|
onClick: function onClick() {
|
|
570
570
|
return checkOutBtnClick(cart === null || cart === void 0 ? void 0 : cart.uuid);
|
|
@@ -64,10 +64,10 @@ var SendGiftCardUI = function SendGiftCardUI(props) {
|
|
|
64
64
|
required: t('VALIDATION_ERROR_REQUIRED', 'To email is required').replace('_attribute_', t('EMAIL', 'EMail'))
|
|
65
65
|
}),
|
|
66
66
|
autoComplete: "off"
|
|
67
|
-
})), /*#__PURE__*/_react.default.createElement(_styles.FormController, null, /*#__PURE__*/_react.default.createElement("label", null, t('
|
|
67
|
+
})), /*#__PURE__*/_react.default.createElement(_styles.FormController, null, /*#__PURE__*/_react.default.createElement("label", null, t('NAME', 'Name')), /*#__PURE__*/_react.default.createElement(_Inputs.Input, {
|
|
68
68
|
name: "user_name",
|
|
69
69
|
ref: register(),
|
|
70
|
-
placeholder: t('
|
|
70
|
+
placeholder: t('WRITE_A_NAME', 'Write a name'),
|
|
71
71
|
autoComplete: "off"
|
|
72
72
|
})), /*#__PURE__*/_react.default.createElement(_styles.FormController, null, /*#__PURE__*/_react.default.createElement("label", null, t('TITLE', 'Title')), /*#__PURE__*/_react.default.createElement(_Inputs.Input, {
|
|
73
73
|
name: "title",
|
|
@@ -49,7 +49,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
49
49
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
50
50
|
var layoutOne = 'groceries';
|
|
51
51
|
var RenderProductsLayout = function RenderProductsLayout(props) {
|
|
52
|
-
var _configs$use_parent_c, _configs$use_parent_c2, _theme$business_view, _theme$business_view2, _theme$business_view3, _theme$business_view4, _theme$business_view5, _theme$business_view6, _theme$business_view$, _theme$business_view7, _theme$business_view8, _businessState$busine, _businessState$busine2, _businessState$busine3, _businessState$busine4, _business$previously_, _business$professiona, _business$categories, _theme$defaultLanguag, _theme$defaultLanguag2, _business$professiona2, _business$categories2, _theme$defaultLanguag4, _theme$defaultLanguag5, _business$professiona3, _currentCart$products, _business$professiona4, _business$categories3, _theme$defaultLanguag6, _theme$defaultLanguag7, _business$previously_2, _theme$defaultLanguag8, _theme$defaultLanguag9, _currentCart$products2, _currentCart$products3;
|
|
52
|
+
var _configs$use_parent_c, _configs$use_parent_c2, _theme$business_view, _theme$business_view2, _theme$business_view3, _theme$business_view4, _theme$business_view5, _theme$business_view6, _theme$business_view$, _theme$business_view7, _theme$business_view8, _businessState$busine, _businessState$busine2, _businessState$busine3, _businessState$busine4, _business$previously_, _business$professiona, _business$categories, _theme$defaultLanguag, _theme$defaultLanguag2, _business$professiona2, _business$categories2, _theme$defaultLanguag4, _theme$defaultLanguag5, _businessState$busine5, _business$professiona3, _currentCart$products, _business$professiona4, _business$categories3, _theme$defaultLanguag6, _theme$defaultLanguag7, _business$previously_2, _theme$defaultLanguag8, _theme$defaultLanguag9, _currentCart$products2, _currentCart$products3;
|
|
53
53
|
var errors = props.errors,
|
|
54
54
|
isError = props.isError,
|
|
55
55
|
isLoading = props.isLoading,
|
|
@@ -294,7 +294,8 @@ var RenderProductsLayout = function RenderProductsLayout(props) {
|
|
|
294
294
|
onClickCategory: onClickCategory,
|
|
295
295
|
handleUpdateProducts: handleUpdateProducts,
|
|
296
296
|
professionalSelected: professionalSelected,
|
|
297
|
-
handleChangeProfessionalSelected: handleChangeProfessionalSelected
|
|
297
|
+
handleChangeProfessionalSelected: handleChangeProfessionalSelected,
|
|
298
|
+
previouslyProducts: businessState === null || businessState === void 0 || (_businessState$busine5 = businessState.business) === null || _businessState$busine5 === void 0 ? void 0 : _businessState$busine5.previously_products
|
|
298
299
|
}))), windowSize.width >= 1000 && windowSize.height >= 600 && showCartOnProductList && /*#__PURE__*/_react.default.createElement(_styles.BusinessCartContainer, {
|
|
299
300
|
isProfessional: (business === null || business === void 0 || (_business$professiona3 = business.professionals) === null || _business$professiona3 === void 0 ? void 0 : _business$professiona3.length) > 0 && !useKioskApp
|
|
300
301
|
}, /*#__PURE__*/_react.default.createElement(_styles.BusinessCartContent, {
|
|
@@ -29,7 +29,7 @@ var CardContainer = _styledComponents.default.div(_templateObject || (_templateO
|
|
|
29
29
|
var productsRows = _ref4.productsRows;
|
|
30
30
|
return productsRows ? (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n width: ", ";\n margin: 10px 0;\n "])), function () {
|
|
31
31
|
return productsRows === 3 ? 'calc(33% - 20px)' : 'calc(50% - 20px)';
|
|
32
|
-
}) : (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: 100%;\n margin: 10px 0;\n @media (min-width: 576px) {\n margin: 10px;\n width: calc(100% - 20px);\n }\n ", "\n
|
|
32
|
+
}) : (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: 100%;\n margin: 10px 0;\n @media (min-width: 576px) {\n margin: 10px;\n width: calc(100% - 20px);\n }\n ", "\n\n "])), function (_ref5) {
|
|
33
33
|
var isCartOnProductsList = _ref5.isCartOnProductsList;
|
|
34
34
|
return isCartOnProductsList ? (0, _styledComponents.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n @media (min-width: 993px) {\n width: calc(50% - 20px);\n margin: 10px 20px 10px 0px;\n ", "\n }\n "])), function (props) {
|
|
35
35
|
var _props$theme;
|
|
@@ -106,7 +106,7 @@ var PriceWrapper = _styledComponents.default.div(_templateObject27 || (_template
|
|
|
106
106
|
return isOffPrice && (0, _styledComponents.css)(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n min-width: 64px;\n "])));
|
|
107
107
|
});
|
|
108
108
|
exports.PriceWrapper = PriceWrapper;
|
|
109
|
-
var QuantityContainer = _styledComponents.default.div(_templateObject31 || (_templateObject31 = _taggedTemplateLiteral(["\n background: ", ";\n color: ", ";\n position: absolute;\n left: 100%;\n bottom:
|
|
109
|
+
var QuantityContainer = _styledComponents.default.div(_templateObject31 || (_templateObject31 = _taggedTemplateLiteral(["\n background: ", ";\n color: ", ";\n position: absolute;\n left: 100%;\n bottom: 98%;\n width: 25px;\n height: 25px;\n text-align: center;\n border-radius: 50%;\n transform: translate(-20px, 50%);\n @media (min-width: 768px) {\n transform: translate(-50%, 50%);\n }\n"])), function (_ref14) {
|
|
110
110
|
var theme = _ref14.theme;
|
|
111
111
|
return theme.colors.primary;
|
|
112
112
|
}, function (_ref15) {
|
|
@@ -0,0 +1,123 @@
|
|
|
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.WebsocketStatus = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _orderingComponentsExternal = require("ordering-components-external");
|
|
10
|
+
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
11
|
+
var _Confirm = require("../../../src/components/Confirm");
|
|
12
|
+
var _Modal = require("../Modal");
|
|
13
|
+
var _Buttons = require("../../styles/Buttons");
|
|
14
|
+
var _styles = require("./styles");
|
|
15
|
+
var _useWindowSize = require("../../../../../hooks/useWindowSize");
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
22
|
+
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); }
|
|
23
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
24
|
+
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."); }
|
|
25
|
+
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); }
|
|
26
|
+
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; }
|
|
27
|
+
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; } }
|
|
28
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
29
|
+
var SocketStatusUI = function SocketStatusUI(props) {
|
|
30
|
+
var socketStatus = props.socketStatus,
|
|
31
|
+
reconnectAttemptCount = props.reconnectAttemptCount,
|
|
32
|
+
connectedDate = props.connectedDate;
|
|
33
|
+
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
34
|
+
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
35
|
+
t = _useLanguage2[1];
|
|
36
|
+
var _useUtils = (0, _orderingComponentsExternal.useUtils)(),
|
|
37
|
+
_useUtils2 = _slicedToArray(_useUtils, 1),
|
|
38
|
+
parseDate = _useUtils2[0].parseDate;
|
|
39
|
+
var _useState = (0, _react.useState)({
|
|
40
|
+
open: false,
|
|
41
|
+
content: []
|
|
42
|
+
}),
|
|
43
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
44
|
+
alertState = _useState2[0],
|
|
45
|
+
setAlertState = _useState2[1];
|
|
46
|
+
var _useState3 = (0, _react.useState)(false),
|
|
47
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
48
|
+
openModal = _useState4[0],
|
|
49
|
+
setOpenModal = _useState4[1];
|
|
50
|
+
var windowSize = (0, _useWindowSize.useWindowSize)();
|
|
51
|
+
var closeAlert = function closeAlert() {
|
|
52
|
+
setAlertState({
|
|
53
|
+
open: false,
|
|
54
|
+
content: []
|
|
55
|
+
});
|
|
56
|
+
window.location.reload();
|
|
57
|
+
};
|
|
58
|
+
(0, _react.useEffect)(function () {
|
|
59
|
+
if (reconnectAttemptCount > 3) {
|
|
60
|
+
setAlertState({
|
|
61
|
+
open: true,
|
|
62
|
+
content: t('WEBSOCKET_CONNECT_ERROR', 'There appears to be an error in establishing the WebSocket connection. Please try reloading the page to resolve the issue.')
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}, [reconnectAttemptCount]);
|
|
66
|
+
return /*#__PURE__*/_react.default.createElement(_styles.Contatiner, null, /*#__PURE__*/_react.default.createElement(_styles.InfoWrapper, null, /*#__PURE__*/_react.default.createElement(_Buttons.IconButton, {
|
|
67
|
+
color: "primary"
|
|
68
|
+
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.InfoCircle, null)), /*#__PURE__*/_react.default.createElement(_styles.InfoContent, null, t('WEBSOCKET_STATUS_APP_INFO', 'Verify the server connection by date and time using the Connection status button. Press update to refresh your app and update the status as well. Need help? Contact our Customer support team here:'), /*#__PURE__*/_react.default.createElement("a", {
|
|
69
|
+
href: "https://www.ordering.co/contact-ordering",
|
|
70
|
+
target: "_blank",
|
|
71
|
+
rel: "noopener noreferrer"
|
|
72
|
+
}, t('CUSTOMER_SUPPORT', 'Customer support')))), /*#__PURE__*/_react.default.createElement(_styles.ButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
73
|
+
borderRadius: "8px",
|
|
74
|
+
color: "secundary",
|
|
75
|
+
onClick: function onClick() {
|
|
76
|
+
return setOpenModal(true);
|
|
77
|
+
}
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.StatusContainer, null, /*#__PURE__*/_react.default.createElement("span", null, t('CONNECTION_STATUS', 'Connection status')), /*#__PURE__*/_react.default.createElement(_styles.WebsocketStatusDot, {
|
|
79
|
+
status: socketStatus
|
|
80
|
+
})))), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
|
|
81
|
+
open: openModal,
|
|
82
|
+
onClose: function onClose() {
|
|
83
|
+
return setOpenModal(false);
|
|
84
|
+
},
|
|
85
|
+
width: "500px",
|
|
86
|
+
title: t('CONNECTION_STATUS', 'Connection status')
|
|
87
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.DetailContainer, null, /*#__PURE__*/_react.default.createElement("p", null, t('LAST_UPDATE', 'Last update'), ": ", parseDate(connectedDate)), /*#__PURE__*/_react.default.createElement(_styles.StatusItemWrapper, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_styles.WebsocketStatusDot, {
|
|
88
|
+
status: 1
|
|
89
|
+
}), /*#__PURE__*/_react.default.createElement("span", null, t('OK', 'Ok'))), /*#__PURE__*/_react.default.createElement("p", null, t('WEBSOCKET_OK', 'The websocket works normally.'))), /*#__PURE__*/_react.default.createElement(_styles.StatusItemWrapper, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_styles.WebsocketStatusDot, {
|
|
90
|
+
status: 0
|
|
91
|
+
}), /*#__PURE__*/_react.default.createElement("span", null, t('CONNECTING', 'Connecting'))), /*#__PURE__*/_react.default.createElement("p", null, t('WEBSOCKET_CONNECTING', 'The websocket is connecting.'))), /*#__PURE__*/_react.default.createElement(_styles.StatusItemWrapper, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_styles.WebsocketStatusDot, {
|
|
92
|
+
status: 2
|
|
93
|
+
}), /*#__PURE__*/_react.default.createElement("span", null, t('DISCONNECTED', 'Disconnected'))), /*#__PURE__*/_react.default.createElement("p", null, t('WEBSOCKET_DISCONNECTED', 'The server is slow, please reload.'))), /*#__PURE__*/_react.default.createElement(_styles.ButtonsContainer, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
94
|
+
color: "secundary",
|
|
95
|
+
onClick: function onClick() {
|
|
96
|
+
return setOpenModal(false);
|
|
97
|
+
}
|
|
98
|
+
}, t('CLOSE', 'Close')), /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
99
|
+
color: "primary",
|
|
100
|
+
onClick: function onClick() {
|
|
101
|
+
return window.location.reload();
|
|
102
|
+
}
|
|
103
|
+
}, t('UPDATE', 'Update'))))), /*#__PURE__*/_react.default.createElement(_Confirm.Alert, {
|
|
104
|
+
title: t('ERROR', 'Error'),
|
|
105
|
+
content: alertState.content,
|
|
106
|
+
acceptText: t('ACCEPT', 'Accept'),
|
|
107
|
+
open: alertState.open,
|
|
108
|
+
onClose: function onClose() {
|
|
109
|
+
return closeAlert();
|
|
110
|
+
},
|
|
111
|
+
onAccept: function onAccept() {
|
|
112
|
+
return closeAlert();
|
|
113
|
+
},
|
|
114
|
+
closeOnBackdrop: false
|
|
115
|
+
}));
|
|
116
|
+
};
|
|
117
|
+
var WebsocketStatus = function WebsocketStatus(props) {
|
|
118
|
+
var socketProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
119
|
+
UIComponent: SocketStatusUI
|
|
120
|
+
});
|
|
121
|
+
return /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.WebsocketStatus, socketProps);
|
|
122
|
+
};
|
|
123
|
+
exports.WebsocketStatus = WebsocketStatus;
|
|
@@ -0,0 +1,69 @@
|
|
|
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.WebsocketStatusDot = exports.StatusItemWrapper = exports.StatusContainer = exports.InfoWrapper = exports.InfoContent = exports.DetailContainer = exports.DateWrapper = exports.Contatiner = exports.ButtonsContainer = exports.ButtonWrapper = void 0;
|
|
8
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23;
|
|
10
|
+
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); }
|
|
11
|
+
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; }
|
|
12
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
13
|
+
var Contatiner = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n font-size: 14px;\n > button {\n height: 41px;\n }\n justify-content: flex-end;\n margin-right: 10px;\n margin-bottom: 10px;\n"])));
|
|
14
|
+
exports.Contatiner = Contatiner;
|
|
15
|
+
var StatusContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: 14px;\n > span:first-child {\n ", "\n }\n"])), function (props) {
|
|
16
|
+
var _props$theme;
|
|
17
|
+
return (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.rtl ? (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-left: 6px;\n "]))) : (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-right: 6px;\n "])));
|
|
18
|
+
});
|
|
19
|
+
exports.StatusContainer = StatusContainer;
|
|
20
|
+
var WebsocketStatusDot = _styledComponents.default.span(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n width: 8px;\n height: 8px;\n border-radius: 50%;\n display: inline-block;\n\n ", "\n ", "\n ", "\n"])), function (_ref) {
|
|
21
|
+
var status = _ref.status;
|
|
22
|
+
return status === 0 && (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n background-color: #FF9922;\n "])));
|
|
23
|
+
}, function (_ref2) {
|
|
24
|
+
var status = _ref2.status;
|
|
25
|
+
return status === 1 && (0, _styledComponents.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n background-color: #00D27A;\n "])));
|
|
26
|
+
}, function (_ref3) {
|
|
27
|
+
var status = _ref3.status;
|
|
28
|
+
return status === 2 && (0, _styledComponents.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n background-color: #E63757;\n "])));
|
|
29
|
+
});
|
|
30
|
+
exports.WebsocketStatusDot = WebsocketStatusDot;
|
|
31
|
+
var DateWrapper = _styledComponents.default.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n font-size: 12px;\n text-align: center;\n"])));
|
|
32
|
+
exports.DateWrapper = DateWrapper;
|
|
33
|
+
var InfoWrapper = _styledComponents.default.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: relative;\n ", "\n\n > button {\n height: 25px;\n svg {\n width: 16px;\n height: 16px;\n }\n }\n &:hover > div {\n visibility: visible;\n opacity: 1;\n }\n"])), function (props) {
|
|
34
|
+
var _props$theme2;
|
|
35
|
+
return (_props$theme2 = props.theme) !== null && _props$theme2 !== void 0 && _props$theme2.rtl ? (0, _styledComponents.css)(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n margin-left: 4px;\n "]))) : (0, _styledComponents.css)(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n margin-right: 4px;\n "])));
|
|
36
|
+
});
|
|
37
|
+
exports.InfoWrapper = InfoWrapper;
|
|
38
|
+
var InfoContent = _styledComponents.default.div(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n position: absolute;\n bottom: 100%;\n z-index: 999;\n background: ", ";\n border: 1px solid ", ";\n box-sizing: border-box;\n box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.12);\n border-radius: 7.6px;\n padding: 8px 12px;\n font-size: 12px;\n line-height: 18px;\n min-width: 150px;\n transition: all 0.3s linear;\n visibility: hidden;\n opacity: 0;\n /* display: none; */\n color: ", ";\n left: -100px;\n ", "\n\n a {\n color: ", ";\n transition: all 0.3s linear;\n cursor: pointer;\n margin-left: 5px;\n ", "\n &:hover {\n text-decoration: underline;\n }\n }\n\n @media (min-width: 576px) {\n min-width: 350px;\n padding: 12px 15px;\n left: -200px;\n ", "\n }\n\n @media (min-width: 993px) {\n min-width: 535px;\n left: -330px;\n ", "\n }\n\n"])), function (props) {
|
|
39
|
+
return props.theme.colors.backgroundInfo;
|
|
40
|
+
}, function (props) {
|
|
41
|
+
return props.theme.colors.primary;
|
|
42
|
+
}, function (props) {
|
|
43
|
+
var _props$theme3;
|
|
44
|
+
return (_props$theme3 = props.theme) === null || _props$theme3 === void 0 || (_props$theme3 = _props$theme3.colors) === null || _props$theme3 === void 0 ? void 0 : _props$theme3.darkTextColor;
|
|
45
|
+
}, function (props) {
|
|
46
|
+
return props.theme.rtl && (0, _styledComponents.css)(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n right: -100px;\n left: initial;\n "])));
|
|
47
|
+
}, function (props) {
|
|
48
|
+
return props.theme.colors.primary;
|
|
49
|
+
}, function (props) {
|
|
50
|
+
return props.theme.rtl && (0, _styledComponents.css)(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n margin-left: 0px;\n margin-right: 5px;\n "])));
|
|
51
|
+
}, function (props) {
|
|
52
|
+
return props.theme.rtl && (0, _styledComponents.css)(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n right: -200px;\n left: initial;\n "])));
|
|
53
|
+
}, function (props) {
|
|
54
|
+
return props.theme.rtl && (0, _styledComponents.css)(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n right: -330px;\n left: initial;\n "])));
|
|
55
|
+
});
|
|
56
|
+
exports.InfoContent = InfoContent;
|
|
57
|
+
var DetailContainer = _styledComponents.default.div(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n margin-top: 10px;\n h2 {\n font-weight: 700;\n font-size: 20px;\n line-height: 30px;\n }\n\n > p {\n font-size: 14px;\n }\n"])));
|
|
58
|
+
exports.DetailContainer = DetailContainer;
|
|
59
|
+
var StatusItemWrapper = _styledComponents.default.div(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n > div {\n display: flex;\n align-items: center;\n\n > span:first-child {\n margin: 0 16px;\n }\n }\n p {\n font-weight: 400;\n font-size: 12px;\n line-height: 18px;\n color: ", ";\n\n ", "\n }\n"])), function (props) {
|
|
60
|
+
return props.theme.colors.lightGray;
|
|
61
|
+
}, function (props) {
|
|
62
|
+
var _props$theme4;
|
|
63
|
+
return (_props$theme4 = props.theme) !== null && _props$theme4 !== void 0 && _props$theme4.rtl ? (0, _styledComponents.css)(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n margin-right: 40px;\n "]))) : (0, _styledComponents.css)(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n margin-left: 40px;\n "])));
|
|
64
|
+
});
|
|
65
|
+
exports.StatusItemWrapper = StatusItemWrapper;
|
|
66
|
+
var ButtonsContainer = _styledComponents.default.div(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin-top: 40px;\n\n > button {\n border-radius: 8px;\n height: 40px;\n &:last-child {\n margin: 0 10px;\n }\n }\n"])));
|
|
67
|
+
exports.ButtonsContainer = ButtonsContainer;
|
|
68
|
+
var ButtonWrapper = _styledComponents.default.div(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n button{\n height: 41px;\n width: 175px;\n width: 175px;\n width: 175px;\n }\n\n"])));
|
|
69
|
+
exports.ButtonWrapper = ButtonWrapper;
|