ordering-ui-admin-external 1.29.3 → 1.30.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/{ordering-ui-admin.e0348521ef103574aa53.js → ordering-ui-admin.081514a6ad5ea7c07ff7.js} +2 -2
- package/_modules/components/Delivery/DriversGroupAutoassign/index.js +11 -2
- package/_modules/components/Delivery/DriversGroupAutoassign/styles.js +28 -25
- package/_modules/components/Delivery/DriversMarkAsBusy/index.js +24 -4
- package/_modules/components/Delivery/DriversMarkAsBusy/styles.js +1 -1
- package/_modules/components/Home/HomePage/index.js +4 -1
- package/_modules/components/Marketing/BannerDetails/AddBanner.js +15 -1
- package/_modules/components/Marketing/BannerDetails/Businesses/index.js +118 -0
- package/_modules/components/Marketing/BannerDetails/Businesses/styles.js +47 -0
- package/_modules/components/Marketing/BannerDetails/index.js +47 -14
- package/_modules/components/Marketing/BannerDetails/styles.js +5 -3
- package/_modules/components/MyProducts/OrderingWebsite/index.js +1 -1
- package/_modules/components/Orders/CreateCustomOrder/SelectCustomer/index.js +4 -0
- package/_modules/components/Orders/CreateCustomOrder/SelectProducts/index.js +68 -64
- package/_modules/components/Orders/CreateCustomOrder/SelectProducts/styles.js +22 -29
- package/_modules/components/Orders/OrdersContentHeader/index.js +1 -1
- package/_modules/components/Orders/OrdersFilterGroup/index.js +42 -2
- package/_modules/components/Orders/OrdersFilterGroup/styles.js +13 -3
- package/_modules/components/Shared/Schedule/index.js +2 -2
- package/_modules/components/SidebarMenu/index.js +6 -2
- package/_modules/components/Stores/BusinessProductsListing/index.js +17 -17
- package/_modules/components/Stores/BusinessQRCodeOption/index.js +2 -2
- package/_modules/components/Stores/BusinessSummary/index.js +8 -8
- package/_modules/components/Users/UsersList/index.js +7 -3
- package/_modules/components/Users/UsersList/styles.js +1 -1
- package/index-template.js +1 -1
- package/package.json +2 -2
- package/src/components/Delivery/DriversGroupAutoassign/index.js +7 -0
- package/src/components/Delivery/DriversGroupAutoassign/styles.js +4 -0
- package/src/components/Delivery/DriversMarkAsBusy/index.js +22 -1
- package/src/components/Delivery/DriversMarkAsBusy/styles.js +2 -0
- package/src/components/Home/HomePage/index.js +4 -2
- package/src/components/Marketing/BannerDetails/AddBanner.js +23 -2
- package/src/components/Marketing/BannerDetails/Businesses/index.js +117 -0
- package/src/components/Marketing/BannerDetails/Businesses/styles.js +96 -0
- package/src/components/Marketing/BannerDetails/index.js +42 -6
- package/src/components/Marketing/BannerDetails/styles.js +7 -0
- package/src/components/MyProducts/OrderingWebsite/index.js +2 -1
- package/src/components/Orders/CreateCustomOrder/SelectCustomer/index.js +6 -1
- package/src/components/Orders/CreateCustomOrder/SelectProducts/index.js +54 -73
- package/src/components/Orders/CreateCustomOrder/SelectProducts/styles.js +54 -53
- package/src/components/Orders/OrdersContentHeader/index.js +1 -1
- package/src/components/Orders/OrdersFilterGroup/index.js +24 -2
- package/src/components/Orders/OrdersFilterGroup/styles.js +41 -0
- package/src/components/Settings/SettingsList/index.js +89 -89
- package/src/components/Shared/Schedule/index.js +1 -1
- package/src/components/SidebarMenu/index.js +8 -2
- package/src/components/Stores/BusinessProductsListing/index.js +5 -3
- package/src/components/Stores/BusinessQRCodeOption/index.js +5 -3
- package/src/components/Stores/BusinessSummary/index.js +5 -3
- package/src/components/Users/UsersList/index.js +16 -1
- package/src/components/Users/UsersList/styles.js +6 -3
- /package/_bundles/{ordering-ui-admin.e0348521ef103574aa53.js.LICENSE.txt → ordering-ui-admin.081514a6ad5ea7c07ff7.js.LICENSE.txt} +0 -0
|
@@ -9,7 +9,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _orderingComponentsAdminExternal = require("ordering-components-admin-external");
|
|
10
10
|
var _styles = require("../../../../styles");
|
|
11
11
|
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
12
|
-
var _CgSpinnerTwoAlt = _interopRequireDefault(require("@meronex/icons/cg/CgSpinnerTwoAlt"));
|
|
13
12
|
var _BiImage = _interopRequireDefault(require("@meronex/icons/bi/BiImage"));
|
|
14
13
|
var _Shared = require("../../../Shared");
|
|
15
14
|
var _ProductForm = require("../ProductForm");
|
|
@@ -29,9 +28,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
29
28
|
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; } }
|
|
30
29
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
30
|
var SelectProducts = function SelectProducts(props) {
|
|
32
|
-
var
|
|
31
|
+
var _cart$products, _cart$products2;
|
|
33
32
|
var productList = props.productList,
|
|
34
|
-
getProducts = props.getProducts,
|
|
35
33
|
handeUpdateProductCart = props.handeUpdateProductCart,
|
|
36
34
|
cart = props.cart,
|
|
37
35
|
business = props.business;
|
|
@@ -44,42 +42,38 @@ var SelectProducts = function SelectProducts(props) {
|
|
|
44
42
|
var _useOrder = (0, _orderingComponentsAdminExternal.useOrder)(),
|
|
45
43
|
_useOrder2 = _slicedToArray(_useOrder, 2),
|
|
46
44
|
removeProduct = _useOrder2[1].removeProduct;
|
|
47
|
-
var
|
|
48
|
-
var _useState = (0, _react.useState)(false),
|
|
45
|
+
var _useState = (0, _react.useState)([]),
|
|
49
46
|
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var _useState3 = (0, _react.useState)(
|
|
47
|
+
productsOptions = _useState2[0],
|
|
48
|
+
setProductsOptions = _useState2[1];
|
|
49
|
+
var _useState3 = (0, _react.useState)(''),
|
|
53
50
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var _useState5 = (0, _react.useState)(
|
|
51
|
+
searchValue = _useState4[0],
|
|
52
|
+
setSearchValue = _useState4[1];
|
|
53
|
+
var _useState5 = (0, _react.useState)(false),
|
|
57
54
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
openProduct = _useState6[0],
|
|
56
|
+
setOpenProduct = _useState6[1];
|
|
60
57
|
var _useState7 = (0, _react.useState)(null),
|
|
61
58
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
var _useState9 = (0, _react.useState)(
|
|
59
|
+
curProduct = _useState8[0],
|
|
60
|
+
setCurProduct = _useState8[1];
|
|
61
|
+
var _useState9 = (0, _react.useState)(null),
|
|
65
62
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
var _useState11 = (0, _react.useState)(
|
|
63
|
+
selectedProductCart = _useState10[0],
|
|
64
|
+
setSelectedProductCart = _useState10[1];
|
|
65
|
+
var _useState11 = (0, _react.useState)(false),
|
|
66
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
67
|
+
isCartProduct = _useState12[0],
|
|
68
|
+
setIsCartProduct = _useState12[1];
|
|
69
|
+
var _useState13 = (0, _react.useState)({
|
|
69
70
|
open: false,
|
|
70
71
|
content: null,
|
|
71
72
|
handleOnAccept: null
|
|
72
73
|
}),
|
|
73
|
-
|
|
74
|
-
confirm =
|
|
75
|
-
setConfirm =
|
|
76
|
-
var timeout = null;
|
|
77
|
-
var onInputChange = function onInputChange(inputValue) {
|
|
78
|
-
clearTimeout(timeout);
|
|
79
|
-
timeout = setTimeout(function () {
|
|
80
|
-
getProducts(inputValue);
|
|
81
|
-
}, 750);
|
|
82
|
-
};
|
|
74
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
75
|
+
confirm = _useState14[0],
|
|
76
|
+
setConfirm = _useState14[1];
|
|
83
77
|
var handleSelectProduct = function handleSelectProduct(product) {
|
|
84
78
|
setIsCartProduct(false);
|
|
85
79
|
setSelectedProductCart(null);
|
|
@@ -108,14 +102,9 @@ var SelectProducts = function SelectProducts(props) {
|
|
|
108
102
|
}
|
|
109
103
|
});
|
|
110
104
|
};
|
|
111
|
-
(0, _react.useEffect)(function () {
|
|
112
|
-
if (business !== null && business !== void 0 && business.id) {
|
|
113
|
-
searchInputRef.current.value = '';
|
|
114
|
-
}
|
|
115
|
-
}, [business === null || business === void 0 ? void 0 : business.id]);
|
|
116
105
|
(0, _react.useEffect)(function () {
|
|
117
106
|
var _productList$products;
|
|
118
|
-
if (!
|
|
107
|
+
if (!(productList !== null && productList !== void 0 && (_productList$products = productList.products) !== null && _productList$products !== void 0 && _productList$products.length)) return;
|
|
119
108
|
var el = document.querySelector('.custom-order-content');
|
|
120
109
|
if (el) {
|
|
121
110
|
el.scrollTo({
|
|
@@ -123,36 +112,51 @@ var SelectProducts = function SelectProducts(props) {
|
|
|
123
112
|
behavior: 'smooth'
|
|
124
113
|
});
|
|
125
114
|
}
|
|
126
|
-
}, [
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
115
|
+
}, [productList === null || productList === void 0 ? void 0 : productList.products]);
|
|
116
|
+
var onChange = function onChange(val) {
|
|
117
|
+
var findProduct = productList === null || productList === void 0 ? void 0 : productList.products.find(function (product) {
|
|
118
|
+
return (product === null || product === void 0 ? void 0 : product.id) === val;
|
|
119
|
+
});
|
|
120
|
+
handleSelectProduct(findProduct);
|
|
121
|
+
setSearchValue('');
|
|
122
|
+
};
|
|
123
|
+
(0, _react.useEffect)(function () {
|
|
124
|
+
var _productsOptions = [];
|
|
125
|
+
if (productList !== null && productList !== void 0 && productList.loading) {
|
|
126
|
+
_productsOptions.push({
|
|
127
|
+
value: null,
|
|
128
|
+
content: /*#__PURE__*/_react.default.createElement(_styles2.Option, null, t('LOADING', 'Loading'), "...")
|
|
129
|
+
});
|
|
130
|
+
setProductsOptions(_productsOptions);
|
|
131
|
+
return;
|
|
140
132
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
133
|
+
if (!(productList !== null && productList !== void 0 && productList.products)) {
|
|
134
|
+
setProductsOptions(_productsOptions);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
productList.products.filter(function (product) {
|
|
138
|
+
return ((product === null || product === void 0 ? void 0 : product.name) || '').toLocaleLowerCase().includes(searchValue.toLocaleLowerCase());
|
|
139
|
+
}).map(function (product) {
|
|
140
|
+
_productsOptions.push({
|
|
141
|
+
value: product === null || product === void 0 ? void 0 : product.id,
|
|
142
|
+
content: /*#__PURE__*/_react.default.createElement(_styles2.Option, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
143
|
+
src: optimizeImage(product === null || product === void 0 ? void 0 : product.images, 'h_50,c_limit'),
|
|
144
|
+
alt: ""
|
|
145
|
+
}), /*#__PURE__*/_react.default.createElement("span", null, product === null || product === void 0 ? void 0 : product.name))
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
setProductsOptions(_productsOptions);
|
|
149
|
+
}, [productList, searchValue]);
|
|
150
|
+
return /*#__PURE__*/_react.default.createElement(_styles2.Container, null, /*#__PURE__*/_react.default.createElement("h3", null, t('WAHT_WANT_TO_BUY', 'What do you want us to buy?')), /*#__PURE__*/_react.default.createElement(_styles2.SelectWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.DefaultSelect, {
|
|
151
|
+
noSelected: true,
|
|
152
|
+
placeholder: /*#__PURE__*/_react.default.createElement(_styles2.Option, null, t('SELECT_PRODUCT', 'Select product')),
|
|
153
|
+
options: productsOptions,
|
|
154
|
+
onChange: onChange,
|
|
155
|
+
optionInnerMaxHeight: "300px",
|
|
156
|
+
isShowSearchBar: true,
|
|
157
|
+
searchValue: searchValue,
|
|
158
|
+
handleChangeSearch: setSearchValue
|
|
159
|
+
})), /*#__PURE__*/_react.default.createElement(_styles2.CartProductsConatiner, null, cart === null || cart === void 0 ? void 0 : (_cart$products = cart.products) === null || _cart$products === void 0 ? void 0 : _cart$products.map(function (product, index) {
|
|
156
160
|
return /*#__PURE__*/_react.default.createElement(_styles2.CartProductsWrapper, {
|
|
157
161
|
key: "".concat(product.id, "_").concat(index)
|
|
158
162
|
}, /*#__PURE__*/_react.default.createElement(_styles2.SelectOption, null, /*#__PURE__*/_react.default.createElement(_styles2.WrapperImage, null, product !== null && product !== void 0 && product.images ? /*#__PURE__*/_react.default.createElement("img", {
|
|
@@ -4,51 +4,44 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.WrapperImage = exports.
|
|
7
|
+
exports.WrapperImage = exports.SelectWrapper = exports.SelectOption = exports.ProductQuantityActionsContainer = exports.ProductEditDeleteActions = exports.Option = exports.Container = exports.CartProductsWrapper = exports.CartProductsConatiner = 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
|
|
9
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15;
|
|
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) } })); }
|
|
13
13
|
var Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-top: 50px;\n"])));
|
|
14
14
|
exports.Container = Container;
|
|
15
|
-
var
|
|
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 padding-left: 40px;\n "]))) : (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding-right: 40px;\n "])));
|
|
18
|
-
}, function (props) {
|
|
19
|
-
var _props$theme2;
|
|
20
|
-
return (_props$theme2 = props.theme) !== null && _props$theme2 !== void 0 && _props$theme2.rtl ? (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n left: 10px;\n "]))) : (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n right: 10px;\n "])));
|
|
21
|
-
}, function (props) {
|
|
22
|
-
return props.theme.colors.headingColor;
|
|
23
|
-
});
|
|
24
|
-
exports.SearchProductsWrapper = SearchProductsWrapper;
|
|
25
|
-
var OptionsToSelectContainer = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n z-index: 100;\n position: absolute;\n top: 50px;\n left: 0;\n width: 100%;\n max-height: 300px;\n overflow-x: hidden;\n border-radius: 8px;\n border: 1px solid ", ";\n background-color: ", ";\n padding: 9px 0;\n\n > p {\n font-size: 12px;\n margin: 0 16px;\n }\n"])), function (props) {
|
|
26
|
-
return props.theme.colors.borderColor;
|
|
27
|
-
}, function (props) {
|
|
28
|
-
return props.theme.colors.backgroundPage;
|
|
29
|
-
});
|
|
30
|
-
exports.OptionsToSelectContainer = OptionsToSelectContainer;
|
|
31
|
-
var SelectOption = _styledComponents.default.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n cursor: pointer;\n width: 100%;\n padding: 9px 16px;\n display: flex;\n align-items: center;\n\n &:hover {\n background-color: ", ";\n }\n span {\n font-size: 14px;\n &.name {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 180px;\n }\n }\n"])), function (props) {
|
|
15
|
+
var SelectOption = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: pointer;\n width: 100%;\n padding: 9px 16px;\n display: flex;\n align-items: center;\n\n &:hover {\n background-color: ", ";\n }\n span {\n font-size: 14px;\n &.name {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 180px;\n }\n }\n"])), function (props) {
|
|
32
16
|
return props.theme.colors.secundary;
|
|
33
17
|
});
|
|
34
18
|
exports.SelectOption = SelectOption;
|
|
35
|
-
var WrapperImage = _styledComponents.default.div(
|
|
36
|
-
var _props$
|
|
37
|
-
return (_props$
|
|
19
|
+
var WrapperImage = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n max-width: 38px;\n max-height: 38px;\n height: 38px;\n width: 38px;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n ", "\n\n svg {\n width: 100%;\n height: 100%;\n padding: 3px;\n box-sizing: border-box;\n }\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 8px;\n object-fit: cover;\n }\n"])), function (props) {
|
|
20
|
+
var _props$theme;
|
|
21
|
+
return (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.rtl ? (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-left: 20px;\n "]))) : (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-right: 20px;\n "])));
|
|
38
22
|
});
|
|
39
23
|
exports.WrapperImage = WrapperImage;
|
|
40
|
-
var CartProductsConatiner = _styledComponents.default.div(
|
|
24
|
+
var CartProductsConatiner = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-top: 25px;\n"])));
|
|
41
25
|
exports.CartProductsConatiner = CartProductsConatiner;
|
|
42
|
-
var CartProductsWrapper = _styledComponents.default.div(
|
|
26
|
+
var CartProductsWrapper = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-bottom: 1px solid ", ";\n margin-bottom: 5px;\n\n > div {\n &:first-child {\n cursor: initial;\n &:hover {\n background-color: ", ";\n }\n }\n }\n"])), function (props) {
|
|
43
27
|
return props.theme.colors.borderColor;
|
|
44
28
|
}, function (props) {
|
|
45
29
|
return props.theme.colors.backgroundPage;
|
|
46
30
|
});
|
|
47
31
|
exports.CartProductsWrapper = CartProductsWrapper;
|
|
48
|
-
var ProductQuantityActionsContainer = _styledComponents.default.div(
|
|
49
|
-
var _props$
|
|
50
|
-
return (_props$
|
|
32
|
+
var ProductQuantityActionsContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n input::-webkit-outer-spin-button,\n input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n input[type=number] {\n -moz-appearance: textfield;\n padding: 5px;\n width: 45px;\n text-align: center;\n border: none;\n }\n\n ", "\n"])), function (props) {
|
|
33
|
+
var _props$theme2;
|
|
34
|
+
return (_props$theme2 = props.theme) !== null && _props$theme2 !== void 0 && _props$theme2.rtl ? (0, _styledComponents.css)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n margin-left: 16px;\n "]))) : (0, _styledComponents.css)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n margin-right: 16px;\n "])));
|
|
51
35
|
});
|
|
52
36
|
exports.ProductQuantityActionsContainer = ProductQuantityActionsContainer;
|
|
53
|
-
var ProductEditDeleteActions = _styledComponents.default.div(
|
|
54
|
-
exports.ProductEditDeleteActions = ProductEditDeleteActions;
|
|
37
|
+
var ProductEditDeleteActions = _styledComponents.default.div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n button {\n > svg {\n width: 16px;\n height: 16px;\n }\n }\n"])));
|
|
38
|
+
exports.ProductEditDeleteActions = ProductEditDeleteActions;
|
|
39
|
+
var SelectWrapper = _styledComponents.default.div(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n margin-top: 11px;\n\n .select {\n width: 100%;\n background: ", ";\n border: none;\n font-size: 14px;\n\n > div:first-child {\n padding-top: 4px;\n padding-bottom: 4px;\n }\n .list {\n max-width: 100%;\n }\n }\n"])), function (props) {
|
|
40
|
+
return props.theme.colors.secundary;
|
|
41
|
+
});
|
|
42
|
+
exports.SelectWrapper = SelectWrapper;
|
|
43
|
+
var Option = _styledComponents.default.div(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n cursor: pointer;\n padding: 5px;\n border-radius: 7.6px;\n img {\n min-height: 38px;\n min-width: 38px;\n height: 38px;\n width: 38px;\n border-radius: 8px;\n object-fit: cover;\n box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\n ", "\n }\n > span {\n max-width: 200px;\n font-size: 14px;\n font-weight: 700;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n }\n\n @media (min-width: 768px) {\n > span {\n max-width: 560px;\n }\n }\n"])), function (props) {
|
|
44
|
+
var _props$theme3;
|
|
45
|
+
return (_props$theme3 = props.theme) !== null && _props$theme3 !== void 0 && _props$theme3.rtl ? (0, _styledComponents.css)(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n margin-left: 8px;\n "]))) : (0, _styledComponents.css)(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n margin-right: 8px;\n "])));
|
|
46
|
+
});
|
|
47
|
+
exports.Option = Option;
|
|
@@ -72,7 +72,7 @@ var OrdersContentHeader = function OrdersContentHeader(props) {
|
|
|
72
72
|
_filterApplied = false;
|
|
73
73
|
} else {
|
|
74
74
|
var _filterValues$groupTy, _filterValues$metafie;
|
|
75
|
-
_filterApplied = (filterValues === null || filterValues === void 0 ? void 0 : (_filterValues$groupTy = filterValues.groupTypes) === null || _filterValues$groupTy === void 0 ? void 0 : _filterValues$groupTy.length) || filterValues.businessIds.length > 0 || filterValues.cityIds.length > 0 || filterValues.deliveryEndDatetime !== null || filterValues.deliveryFromDatetime !== null || filterValues.deliveryTypes.length > 0 || filterValues.driverIds.length > 0 || filterValues.paymethodIds.length > 0 || filterValues.statuses.length > 0 || (filterValues === null || filterValues === void 0 ? void 0 : (_filterValues$metafie = filterValues.metafield) === null || _filterValues$metafie === void 0 ? void 0 : _filterValues$metafie.length) > 0 || (filterValues === null || filterValues === void 0 ? void 0 : filterValues.externalId);
|
|
75
|
+
_filterApplied = (filterValues === null || filterValues === void 0 ? void 0 : (_filterValues$groupTy = filterValues.groupTypes) === null || _filterValues$groupTy === void 0 ? void 0 : _filterValues$groupTy.length) || filterValues.businessIds.length > 0 || filterValues.cityIds.length > 0 || filterValues.deliveryEndDatetime !== null || filterValues.deliveryFromDatetime !== null || filterValues.deliveryTypes.length > 0 || filterValues.driverIds.length > 0 || filterValues.paymethodIds.length > 0 || filterValues.statuses.length > 0 || (filterValues === null || filterValues === void 0 ? void 0 : (_filterValues$metafie = filterValues.metafield) === null || _filterValues$metafie === void 0 ? void 0 : _filterValues$metafie.length) > 0 || (filterValues === null || filterValues === void 0 ? void 0 : filterValues.externalId) || (filterValues === null || filterValues === void 0 ? void 0 : filterValues.logisticStatus) !== null;
|
|
76
76
|
}
|
|
77
77
|
setFilterApplied(_filterApplied);
|
|
78
78
|
}, [filterValues]);
|
|
@@ -19,7 +19,9 @@ var _CountryFilter = require("../CountryFilter");
|
|
|
19
19
|
var _styles = require("../../../styles");
|
|
20
20
|
var _CurrencyFilter = require("../CurrencyFilter");
|
|
21
21
|
var _utils = require("../../../utils");
|
|
22
|
+
var _FirstSelect = require("../../../styles/Select/FirstSelect");
|
|
22
23
|
var _styles2 = require("./styles");
|
|
24
|
+
var _styles3 = require("../OrdersTable/styles");
|
|
23
25
|
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); }
|
|
24
26
|
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; }
|
|
25
27
|
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; }
|
|
@@ -34,6 +36,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
34
36
|
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
37
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import { OrderStatusTypeSelector } from '../OrderStatusTypeSelector'
|
|
36
38
|
var OrdersFilterGroupUI = function OrdersFilterGroupUI(props) {
|
|
39
|
+
var _filterValues$logisti;
|
|
37
40
|
var open = props.open,
|
|
38
41
|
handleCloseFilterModal = props.handleCloseFilterModal,
|
|
39
42
|
filterValues = props.filterValues,
|
|
@@ -59,7 +62,8 @@ var OrdersFilterGroupUI = function OrdersFilterGroupUI(props) {
|
|
|
59
62
|
handleChangeMetaFieldValue = props.handleChangeMetaFieldValue,
|
|
60
63
|
handleAddMetaField = props.handleAddMetaField,
|
|
61
64
|
handleDeleteMetafield = props.handleDeleteMetafield,
|
|
62
|
-
handleChangeExternalId = props.handleChangeExternalId
|
|
65
|
+
handleChangeExternalId = props.handleChangeExternalId,
|
|
66
|
+
handleChangeChildFilterValue = props.handleChangeChildFilterValue;
|
|
63
67
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
64
68
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
65
69
|
t = _useLanguage2[1];
|
|
@@ -75,6 +79,32 @@ var OrdersFilterGroupUI = function OrdersFilterGroupUI(props) {
|
|
|
75
79
|
isShow = _useState4[0],
|
|
76
80
|
setIsShow = _useState4[1];
|
|
77
81
|
var metafieldRef = (0, _react.useRef)();
|
|
82
|
+
var logisticStatusList = [{
|
|
83
|
+
value: 0,
|
|
84
|
+
content: /*#__PURE__*/_react.default.createElement(_styles2.Option, null, t('PENDING', 'Pending'), /*#__PURE__*/_react.default.createElement(_styles3.LogisticStatusDot, {
|
|
85
|
+
status: 0
|
|
86
|
+
}))
|
|
87
|
+
}, {
|
|
88
|
+
value: 1,
|
|
89
|
+
content: /*#__PURE__*/_react.default.createElement(_styles2.Option, null, t('IN_PROGRESS', 'In progress'), /*#__PURE__*/_react.default.createElement(_styles3.LogisticStatusDot, {
|
|
90
|
+
status: 1
|
|
91
|
+
}))
|
|
92
|
+
}, {
|
|
93
|
+
value: 2,
|
|
94
|
+
content: /*#__PURE__*/_react.default.createElement(_styles2.Option, null, t('IN_QUEUE', 'In queue'), /*#__PURE__*/_react.default.createElement(_styles3.LogisticStatusDot, {
|
|
95
|
+
status: 2
|
|
96
|
+
}))
|
|
97
|
+
}, {
|
|
98
|
+
value: 3,
|
|
99
|
+
content: /*#__PURE__*/_react.default.createElement(_styles2.Option, null, t('EXPIRED', 'Expired'), /*#__PURE__*/_react.default.createElement(_styles3.LogisticStatusDot, {
|
|
100
|
+
status: 3
|
|
101
|
+
}))
|
|
102
|
+
}, {
|
|
103
|
+
value: 4,
|
|
104
|
+
content: /*#__PURE__*/_react.default.createElement(_styles2.Option, null, t('RESOLVED', 'Resolved'), /*#__PURE__*/_react.default.createElement(_styles3.LogisticStatusDot, {
|
|
105
|
+
status: 4
|
|
106
|
+
}))
|
|
107
|
+
}];
|
|
78
108
|
var handleAcceptFilter = function handleAcceptFilter() {
|
|
79
109
|
handleChangeFilterValues(filterValues);
|
|
80
110
|
handleCloseFilterModal();
|
|
@@ -171,7 +201,17 @@ var OrdersFilterGroupUI = function OrdersFilterGroupUI(props) {
|
|
|
171
201
|
})), /*#__PURE__*/_react.default.createElement(_styles2.WrapperRow, null, /*#__PURE__*/_react.default.createElement(_CurrencyFilter.CurrencyFilter, {
|
|
172
202
|
filterValues: filterValues,
|
|
173
203
|
handleChangeCurrency: handleChangeCurrency
|
|
174
|
-
})
|
|
204
|
+
}), /*#__PURE__*/_react.default.createElement(_styles2.SelectWrapper, null, /*#__PURE__*/_react.default.createElement(_FirstSelect.Select, {
|
|
205
|
+
options: logisticStatusList,
|
|
206
|
+
className: "select",
|
|
207
|
+
defaultValue: (_filterValues$logisti = filterValues === null || filterValues === void 0 ? void 0 : filterValues.logisticStatus) !== null && _filterValues$logisti !== void 0 ? _filterValues$logisti : '',
|
|
208
|
+
placeholder: t('SELECT_LOGISTIC_STATUS', 'Select a logistic status'),
|
|
209
|
+
onChange: function onChange(value) {
|
|
210
|
+
return handleChangeChildFilterValue({
|
|
211
|
+
logisticStatus: value
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}))), filterValues === null || filterValues === void 0 ? void 0 : filterValues.metafield.map(function (item) {
|
|
175
215
|
return /*#__PURE__*/_react.default.createElement(_styles2.WrapperRow, {
|
|
176
216
|
key: item.id
|
|
177
217
|
}, /*#__PURE__*/_react.default.createElement(_styles.Input, {
|
|
@@ -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.WrapperRow = exports.MultiSelectContainer = exports.FilterGroupListContainer = exports.ButtonGroup = exports.AddMetaFiled = exports.AddInputWrapper = void 0;
|
|
7
|
+
exports.WrapperRow = exports.SelectWrapper = exports.Option = exports.MultiSelectContainer = exports.FilterGroupListContainer = exports.ButtonGroup = exports.AddMetaFiled = exports.AddInputWrapper = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
9
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
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) } })); }
|
|
@@ -32,4 +32,14 @@ exports.AddInputWrapper = AddInputWrapper;
|
|
|
32
32
|
var AddMetaFiled = _styledComponents.default.span(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n font-size: 14px;\n color: ", ";\n cursor: pointer;\n width: 100%;\n"])), function (props) {
|
|
33
33
|
return props.theme.colors.primary;
|
|
34
34
|
});
|
|
35
|
-
exports.AddMetaFiled = AddMetaFiled;
|
|
35
|
+
exports.AddMetaFiled = AddMetaFiled;
|
|
36
|
+
var SelectWrapper = _styledComponents.default.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n > div {\n width: 100%;\n border: none;\n height: 100%;\n\n > div:first-child {\n height: 100%;\n background-color: ", ";\n border: none;\n border-radius: 7.6px;\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n padding-left: 20px;\n }\n .list {\n background-color: ", ";\n border: none;\n \n .list-wrapper {\n > div {\n padding: 6px 10px;\n &:hover {\n background-color: #f2f5f7;\n }\n }\n }\n }\n }\n"])), function (props) {
|
|
37
|
+
return props.theme.colors.secundary;
|
|
38
|
+
}, function (props) {
|
|
39
|
+
return props.theme.colors.secundary;
|
|
40
|
+
});
|
|
41
|
+
exports.SelectWrapper = SelectWrapper;
|
|
42
|
+
var Option = _styledComponents.default.div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n color: ", ";\n display: flex;\n align-items: center;\n"])), function (props) {
|
|
43
|
+
return props.theme.colors.secundaryContrast;
|
|
44
|
+
});
|
|
45
|
+
exports.Option = Option;
|
|
@@ -26,7 +26,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
26
26
|
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; } }
|
|
27
27
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
28
28
|
var ScheduleUI = function ScheduleUI(props) {
|
|
29
|
-
var _configs$
|
|
29
|
+
var _configs$general_hour, _configs$general_hour2;
|
|
30
30
|
var scheduleState = props.scheduleState,
|
|
31
31
|
isConflict = props.isConflict,
|
|
32
32
|
setIsConflict = props.setIsConflict,
|
|
@@ -54,7 +54,7 @@ var ScheduleUI = function ScheduleUI(props) {
|
|
|
54
54
|
var _useUtils = (0, _orderingComponentsAdminExternal.useUtils)(),
|
|
55
55
|
_useUtils2 = _slicedToArray(_useUtils, 1),
|
|
56
56
|
parseDate = _useUtils2[0].parseDate;
|
|
57
|
-
var is12Hours = (
|
|
57
|
+
var is12Hours = configs === null || configs === void 0 ? void 0 : (_configs$general_hour = configs.general_hour_format) === null || _configs$general_hour === void 0 ? void 0 : (_configs$general_hour2 = _configs$general_hour.value) === null || _configs$general_hour2 === void 0 ? void 0 : _configs$general_hour2.includes('hh:mm');
|
|
58
58
|
var _useState = (0, _react.useState)({
|
|
59
59
|
open: false,
|
|
60
60
|
content: []
|
|
@@ -48,6 +48,9 @@ var SidebarMenuUI = function SidebarMenuUI(props) {
|
|
|
48
48
|
var _useSession = (0, _orderingComponentsAdminExternal.useSession)(),
|
|
49
49
|
_useSession2 = _slicedToArray(_useSession, 1),
|
|
50
50
|
sessionState = _useSession2[0];
|
|
51
|
+
var _useSite = (0, _orderingComponentsAdminExternal.useSite)(),
|
|
52
|
+
_useSite2 = _slicedToArray(_useSite, 1),
|
|
53
|
+
site = _useSite2[0].site;
|
|
51
54
|
var _useConfig = (0, _orderingComponentsAdminExternal.useConfig)(),
|
|
52
55
|
_useConfig2 = _slicedToArray(_useConfig, 1),
|
|
53
56
|
configs = _useConfig2[0].configs;
|
|
@@ -334,8 +337,9 @@ var SidebarMenuUI = function SidebarMenuUI(props) {
|
|
|
334
337
|
window.open(link, '_blank');
|
|
335
338
|
};
|
|
336
339
|
var handleOpenSite = function handleOpenSite() {
|
|
337
|
-
var _configs$site_url;
|
|
338
|
-
|
|
340
|
+
var _configs$site_url, _configs$site_url2;
|
|
341
|
+
var siteUrl = site !== null && site !== void 0 && site.domain && (site === null || site === void 0 ? void 0 : site.ssl_process_status) === 'ended' ? "https://".concat(site === null || site === void 0 ? void 0 : site.domain) : configs !== null && configs !== void 0 && (_configs$site_url = configs.site_url) !== null && _configs$site_url !== void 0 && _configs$site_url.value ? configs === null || configs === void 0 ? void 0 : (_configs$site_url2 = configs.site_url) === null || _configs$site_url2 === void 0 ? void 0 : _configs$site_url2.value : "https://".concat(ordering.project, ".tryordering.com");
|
|
342
|
+
handleGoToLink(siteUrl);
|
|
339
343
|
};
|
|
340
344
|
(0, _react.useEffect)(function () {
|
|
341
345
|
if (windowSize.width < 1024) {
|
|
@@ -49,7 +49,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
49
49
|
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; } }
|
|
50
50
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
51
51
|
var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
52
|
-
var _businessState$busine5, _businessState$
|
|
52
|
+
var _businessState$busine5, _businessState$busine17, _businessState$busine19, _businessState$busine20, _businessState$busine21, _businessState$busine22;
|
|
53
53
|
var categorySelected = props.categorySelected,
|
|
54
54
|
searchValue = props.searchValue,
|
|
55
55
|
handleChangeCategory = props.handleChangeCategory,
|
|
@@ -250,8 +250,8 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
250
250
|
setBatchImageFormOpen(true);
|
|
251
251
|
};
|
|
252
252
|
var handleOpenSite = function handleOpenSite() {
|
|
253
|
-
var _configs$site_url, _configs$site_url2, _businessState$
|
|
254
|
-
var storeUrl = configs !== null && configs !== void 0 && (_configs$site_url = configs.site_url) !== null && _configs$site_url !== void 0 && _configs$site_url.value ? "".concat((0, _utils.checkSiteUrl)(configs === null || configs === void 0 ? void 0 : (_configs$site_url2 = configs.site_url) === null || _configs$site_url2 === void 0 ? void 0 : _configs$site_url2.value), "store/").concat(businessState === null || businessState === void 0 ? void 0 : (_businessState$
|
|
253
|
+
var _siteState$site, _siteState$site2, _siteState$site3, _businessState$busine6, _configs$site_url, _configs$site_url2, _businessState$busine7, _businessState$busine8;
|
|
254
|
+
var storeUrl = siteState !== null && siteState !== void 0 && (_siteState$site = siteState.site) !== null && _siteState$site !== void 0 && _siteState$site.domain && (siteState === null || siteState === void 0 ? void 0 : (_siteState$site2 = siteState.site) === null || _siteState$site2 === void 0 ? void 0 : _siteState$site2.ssl_process_status) === 'ended' ? "https://".concat(siteState === null || siteState === void 0 ? void 0 : (_siteState$site3 = siteState.site) === null || _siteState$site3 === void 0 ? void 0 : _siteState$site3.domain, "/store/").concat(businessState === null || businessState === void 0 ? void 0 : (_businessState$busine6 = businessState.business) === null || _businessState$busine6 === void 0 ? void 0 : _businessState$busine6.slug) : configs !== null && configs !== void 0 && (_configs$site_url = configs.site_url) !== null && _configs$site_url !== void 0 && _configs$site_url.value ? "".concat((0, _utils.checkSiteUrl)(configs === null || configs === void 0 ? void 0 : (_configs$site_url2 = configs.site_url) === null || _configs$site_url2 === void 0 ? void 0 : _configs$site_url2.value), "store/").concat(businessState === null || businessState === void 0 ? void 0 : (_businessState$busine7 = businessState.business) === null || _businessState$busine7 === void 0 ? void 0 : _businessState$busine7.slug) : "https://".concat(ordering.project, ".tryordering.com/store/").concat(businessState === null || businessState === void 0 ? void 0 : (_businessState$busine8 = businessState.business) === null || _businessState$busine8 === void 0 ? void 0 : _businessState$busine8.slug);
|
|
255
255
|
window.open(storeUrl, '_blank');
|
|
256
256
|
};
|
|
257
257
|
var handleOpenAddBusiness = function handleOpenAddBusiness() {
|
|
@@ -275,8 +275,8 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
275
275
|
}
|
|
276
276
|
}, [slug]);
|
|
277
277
|
(0, _react.useEffect)(function () {
|
|
278
|
-
var _businessState$
|
|
279
|
-
if (businessState !== null && businessState !== void 0 && businessState.business && (businessState === null || businessState === void 0 ? void 0 : (_businessState$
|
|
278
|
+
var _businessState$busine9, _businessState$busine10;
|
|
279
|
+
if (businessState !== null && businessState !== void 0 && businessState.business && (businessState === null || businessState === void 0 ? void 0 : (_businessState$busine9 = businessState.business) === null || _businessState$busine9 === void 0 ? void 0 : (_businessState$busine10 = _businessState$busine9.categories) === null || _businessState$busine10 === void 0 ? void 0 : _businessState$busine10.length) === 0) {
|
|
280
280
|
setShowPopup(true);
|
|
281
281
|
}
|
|
282
282
|
}, [businessState === null || businessState === void 0 ? void 0 : businessState.business]);
|
|
@@ -285,8 +285,8 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
285
285
|
var categoryId = query.get('category');
|
|
286
286
|
var productId = query.get('product');
|
|
287
287
|
if (categoryId && productId) {
|
|
288
|
-
var _businessState$
|
|
289
|
-
var initCategory = (_businessState$
|
|
288
|
+
var _businessState$busine11, _businessState$busine12, _initCategory$product;
|
|
289
|
+
var initCategory = (_businessState$busine11 = businessState.business) === null || _businessState$busine11 === void 0 ? void 0 : (_businessState$busine12 = _businessState$busine11.categories) === null || _businessState$busine12 === void 0 ? void 0 : _businessState$busine12.find(function (category) {
|
|
290
290
|
return category.id === Number(categoryId);
|
|
291
291
|
});
|
|
292
292
|
var initProduct = initCategory === null || initCategory === void 0 ? void 0 : (_initCategory$product = initCategory.products) === null || _initCategory$product === void 0 ? void 0 : _initCategory$product.find(function (product) {
|
|
@@ -297,8 +297,8 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
297
297
|
handleOpenProductDetails(initProduct, true);
|
|
298
298
|
}
|
|
299
299
|
} else if (categoryId && !productId) {
|
|
300
|
-
var _businessState$
|
|
301
|
-
var _initCategory = (_businessState$
|
|
300
|
+
var _businessState$busine13, _businessState$busine14;
|
|
301
|
+
var _initCategory = (_businessState$busine13 = businessState.business) === null || _businessState$busine13 === void 0 ? void 0 : (_businessState$busine14 = _businessState$busine13.categories) === null || _businessState$busine14 === void 0 ? void 0 : _businessState$busine14.find(function (category) {
|
|
302
302
|
return category.id === Number(categoryId);
|
|
303
303
|
});
|
|
304
304
|
if (_initCategory) {
|
|
@@ -306,8 +306,8 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
306
306
|
handleOpenCategoryDetails(_initCategory, true);
|
|
307
307
|
}
|
|
308
308
|
} else {
|
|
309
|
-
var _businessState$
|
|
310
|
-
(businessState === null || businessState === void 0 ? void 0 : (_businessState$
|
|
309
|
+
var _businessState$busine15, _businessState$busine16;
|
|
310
|
+
(businessState === null || businessState === void 0 ? void 0 : (_businessState$busine15 = businessState.business) === null || _businessState$busine15 === void 0 ? void 0 : _businessState$busine15.categories) && setCategorySelected(businessState === null || businessState === void 0 ? void 0 : (_businessState$busine16 = businessState.business) === null || _businessState$busine16 === void 0 ? void 0 : _businessState$busine16.categories[0]);
|
|
311
311
|
}
|
|
312
312
|
}, [businessState.loading]);
|
|
313
313
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles2.CategoryProductsContainer, null, /*#__PURE__*/_react.default.createElement(_styles2.HeaderContainer, null, /*#__PURE__*/_react.default.createElement(_styles2.HeaderTitleContainer, null, isCollapse && /*#__PURE__*/_react.default.createElement(_styles.IconButton, {
|
|
@@ -322,7 +322,7 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
322
322
|
onClick: function onClick() {
|
|
323
323
|
return handleSelectHeader();
|
|
324
324
|
}
|
|
325
|
-
}, /*#__PURE__*/_react.default.createElement("h1", null, (selectedBusiness === null || selectedBusiness === void 0 ? void 0 : selectedBusiness.name) || (businessState === null || businessState === void 0 ? void 0 : (_businessState$
|
|
325
|
+
}, /*#__PURE__*/_react.default.createElement("h1", null, (selectedBusiness === null || selectedBusiness === void 0 ? void 0 : selectedBusiness.name) || (businessState === null || businessState === void 0 ? void 0 : (_businessState$busine17 = businessState.business) === null || _businessState$busine17 === void 0 ? void 0 : _businessState$busine17.name) || t('SELECT_BUSINESS', 'Select a business'), " \xA0 ", /*#__PURE__*/_react.default.createElement(_BisDownArrow.default, {
|
|
326
326
|
className: showSelectHeader ? 'rotate-arrow' : ''
|
|
327
327
|
}))), showSelectHeader && /*#__PURE__*/_react.default.createElement(_BusinessSelectHeader.BusinessSelectHeader, {
|
|
328
328
|
close: handleClose,
|
|
@@ -333,11 +333,11 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
333
333
|
})), slug && /*#__PURE__*/_react.default.createElement(_styles2.Breadcrumb, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
334
334
|
className: "business",
|
|
335
335
|
onClick: function onClick() {
|
|
336
|
-
var _businessState$
|
|
337
|
-
history.replace("".concat(location.pathname, "?id=").concat(businessState === null || businessState === void 0 ? void 0 : (_businessState$
|
|
336
|
+
var _businessState$busine18;
|
|
337
|
+
history.replace("".concat(location.pathname, "?id=").concat(businessState === null || businessState === void 0 ? void 0 : (_businessState$busine18 = businessState.business) === null || _businessState$busine18 === void 0 ? void 0 : _businessState$busine18.id));
|
|
338
338
|
setOpenSidebar('business_details');
|
|
339
339
|
}
|
|
340
|
-
}, (selectedBusiness === null || selectedBusiness === void 0 ? void 0 : selectedBusiness.name) || (businessState === null || businessState === void 0 ? void 0 : (_businessState$
|
|
340
|
+
}, (selectedBusiness === null || selectedBusiness === void 0 ? void 0 : selectedBusiness.name) || (businessState === null || businessState === void 0 ? void 0 : (_businessState$busine19 = businessState.business) === null || _businessState$busine19 === void 0 ? void 0 : _businessState$busine19.name)), /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.ChevronRight, null), /*#__PURE__*/_react.default.createElement("span", null, categorySelected === null || categorySelected === void 0 ? void 0 : categorySelected.name))))), slug && /*#__PURE__*/_react.default.createElement(_styles2.ActionsGroup, null, /*#__PURE__*/_react.default.createElement(_styles.Button, {
|
|
341
341
|
color: "lightPrimary",
|
|
342
342
|
borderRadius: "8px",
|
|
343
343
|
onClick: function onClick() {
|
|
@@ -364,7 +364,7 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
364
364
|
onClick: function onClick() {
|
|
365
365
|
return handleProductAdd(true);
|
|
366
366
|
},
|
|
367
|
-
disabled: (businessState === null || businessState === void 0 ? void 0 : (_businessState$
|
|
367
|
+
disabled: (businessState === null || businessState === void 0 ? void 0 : (_businessState$busine20 = businessState.business) === null || _businessState$busine20 === void 0 ? void 0 : (_businessState$busine21 = _businessState$busine20.categories) === null || _businessState$busine21 === void 0 ? void 0 : _businessState$busine21.length) === 0
|
|
368
368
|
}, t('ADD_PRODUCT', 'Add product')), /*#__PURE__*/_react.default.createElement(_Shared.SearchBar, {
|
|
369
369
|
isCustomLayout: true,
|
|
370
370
|
lazyLoad: true,
|
|
@@ -462,7 +462,7 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
462
462
|
setFees: setFees
|
|
463
463
|
}), openSidebar === 'business_details' && /*#__PURE__*/_react.default.createElement(_BusinessDetails.BusinessDetails, {
|
|
464
464
|
open: openSidebar === 'business_details',
|
|
465
|
-
businessId: (selectedBusiness === null || selectedBusiness === void 0 ? void 0 : selectedBusiness.id) || (businessState === null || businessState === void 0 ? void 0 : (_businessState$
|
|
465
|
+
businessId: (selectedBusiness === null || selectedBusiness === void 0 ? void 0 : selectedBusiness.id) || (businessState === null || businessState === void 0 ? void 0 : (_businessState$busine22 = businessState.business) === null || _businessState$busine22 === void 0 ? void 0 : _businessState$busine22.id),
|
|
466
466
|
handleSucessRemoveBusiness: function handleSucessRemoveBusiness() {
|
|
467
467
|
return handleStoresRedirect();
|
|
468
468
|
}
|
|
@@ -65,7 +65,7 @@ var BusinessQRCodeOption = function BusinessQRCodeOption(props) {
|
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
67
|
var generateQRCode = function generateQRCode() {
|
|
68
|
-
var _numberRef$current, _configs$site_url, _configs$site_url2, _numberRef$current2, _numberRef$current3;
|
|
68
|
+
var _numberRef$current, _siteState$site, _siteState$site2, _siteState$site3, _configs$site_url, _configs$site_url2, _numberRef$current2, _numberRef$current3;
|
|
69
69
|
var errors = [];
|
|
70
70
|
if ((item === null || item === void 0 ? void 0 : item.key) !== 'pick_up' && !(numberRef !== null && numberRef !== void 0 && (_numberRef$current = numberRef.current) !== null && _numberRef$current !== void 0 && _numberRef$current.value)) {
|
|
71
71
|
errors.push((item === null || item === void 0 ? void 0 : item.key) === 'eat_in' ? t('VALIDATION_ERROR_REQUIRED', 'Table number is required').replace('_attribute_', t('TABLE_NUMBER', 'Table number')) : t('VALIDATION_ERROR_REQUIRED', 'Spot number is required').replace('_attribute_', t('SPOT_NUMBER', 'Spot number')));
|
|
@@ -77,7 +77,7 @@ var BusinessQRCodeOption = function BusinessQRCodeOption(props) {
|
|
|
77
77
|
});
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
var storeUrl = configs !== null && configs !== void 0 && (_configs$site_url = configs.site_url) !== null && _configs$site_url !== void 0 && _configs$site_url.value ? "".concat((0, _utils.checkSiteUrl)(configs === null || configs === void 0 ? void 0 : (_configs$site_url2 = configs.site_url) === null || _configs$site_url2 === void 0 ? void 0 : _configs$site_url2.value), "store/").concat(business === null || business === void 0 ? void 0 : business.slug) : "https://".concat(ordering.project, ".tryordering.com/store/").concat(business === null || business === void 0 ? void 0 : business.slug);
|
|
80
|
+
var storeUrl = siteState !== null && siteState !== void 0 && (_siteState$site = siteState.site) !== null && _siteState$site !== void 0 && _siteState$site.domain && (siteState === null || siteState === void 0 ? void 0 : (_siteState$site2 = siteState.site) === null || _siteState$site2 === void 0 ? void 0 : _siteState$site2.ssl_process_status) === 'ended' ? "https://".concat(siteState === null || siteState === void 0 ? void 0 : (_siteState$site3 = siteState.site) === null || _siteState$site3 === void 0 ? void 0 : _siteState$site3.domain, "/store/").concat(business === null || business === void 0 ? void 0 : business.slug) : configs !== null && configs !== void 0 && (_configs$site_url = configs.site_url) !== null && _configs$site_url !== void 0 && _configs$site_url.value ? "".concat((0, _utils.checkSiteUrl)(configs === null || configs === void 0 ? void 0 : (_configs$site_url2 = configs.site_url) === null || _configs$site_url2 === void 0 ? void 0 : _configs$site_url2.value), "store/").concat(business === null || business === void 0 ? void 0 : business.slug) : "https://".concat(ordering.project, ".tryordering.com/store/").concat(business === null || business === void 0 ? void 0 : business.slug);
|
|
81
81
|
var tsNumber = (item === null || item === void 0 ? void 0 : item.key) !== 'pick_up' ? (item === null || item === void 0 ? void 0 : item.key) === 'eat_in' ? "&table_number=".concat(numberRef === null || numberRef === void 0 ? void 0 : (_numberRef$current2 = numberRef.current) === null || _numberRef$current2 === void 0 ? void 0 : _numberRef$current2.value) : "&spot_number=".concat(numberRef === null || numberRef === void 0 ? void 0 : (_numberRef$current3 = numberRef.current) === null || _numberRef$current3 === void 0 ? void 0 : _numberRef$current3.value) : '';
|
|
82
82
|
var compltedUrl = "".concat(storeUrl, "?order_type=").concat(item.value).concat(tsNumber);
|
|
83
83
|
setCode(compltedUrl);
|