ordering-ui-external 14.1.69 → 14.1.70
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.112bb07bf92c44de3d24.js → 7.ordering-ui.79d1b04897948213ab70.js} +1 -1
- package/_bundles/ordering-ui.79d1b04897948213ab70.js +2 -0
- package/_modules/components/BusinessProductsCategories/layouts/groceries/index.js +3 -3
- package/_modules/components/ProductItemAccordion/index.js +6 -6
- package/_modules/themes/callcenterOriginal/src/components/AddressList/index.js +11 -3
- package/_modules/themes/callcenterOriginal/src/components/BusinessProductsCategories/layouts/groceries/index.js +3 -3
- package/_modules/themes/callcenterOriginal/src/components/ProductItemAccordion/index.js +6 -6
- package/_modules/themes/callcenterOriginal/src/components/Shared/SelectBusinessCategories/index.js +3 -3
- package/_modules/themes/callcenterOriginal/src/components/Shared/SelectBusinessProducts/index.js +6 -6
- package/_modules/themes/eight/src/components/ProductItemAccordion/index.js +10 -10
- package/_modules/themes/five/src/components/BusinessProductsCategories/layouts/groceries/index.js +3 -3
- package/_modules/themes/four/src/components/BusinessProductsCategories/layouts/groceries/index.js +3 -3
- package/_modules/themes/four/src/components/ProductItemAccordion/index.js +6 -6
- package/_modules/themes/franchise/src/components/ProductItemAccordion/index.js +6 -6
- package/_modules/themes/orderAndPay/src/components/ProductItemAccordion/index.js +6 -6
- package/_modules/themes/pwa/src/components/ProductItemAccordion/index.js +10 -10
- package/_modules/themes/seven/src/components/ProductForm/productForm.js +6 -6
- package/_modules/themes/seven/src/components/ProductItemAccordion/index.js +6 -6
- package/_modules/themes/six/src/components/ProductItemAccordion/index.js +6 -6
- package/_modules/themes/three/src/components/ProductItemAccordion/index.js +6 -6
- package/_modules/themes/two/src/components/ProductItemAccordion/index.js +6 -6
- package/_modules/themes/wow/src/components/ProductItemAccordion/index.js +6 -6
- package/_modules/utils/index.js +3 -3
- package/package.json +1 -1
- package/src/themes/callcenterOriginal/src/components/AddressList/index.js +9 -3
- package/_bundles/ordering-ui.112bb07bf92c44de3d24.js +0 -2
- /package/_bundles/{0.ordering-ui.112bb07bf92c44de3d24.js → 0.ordering-ui.79d1b04897948213ab70.js} +0 -0
- /package/_bundles/{1.ordering-ui.112bb07bf92c44de3d24.js → 1.ordering-ui.79d1b04897948213ab70.js} +0 -0
- /package/_bundles/{2.ordering-ui.112bb07bf92c44de3d24.js → 2.ordering-ui.79d1b04897948213ab70.js} +0 -0
- /package/_bundles/{4.ordering-ui.112bb07bf92c44de3d24.js → 4.ordering-ui.79d1b04897948213ab70.js} +0 -0
- /package/_bundles/{5.ordering-ui.112bb07bf92c44de3d24.js → 5.ordering-ui.79d1b04897948213ab70.js} +0 -0
- /package/_bundles/{6.ordering-ui.112bb07bf92c44de3d24.js → 6.ordering-ui.79d1b04897948213ab70.js} +0 -0
- /package/_bundles/{7.ordering-ui.112bb07bf92c44de3d24.js.LICENSE.txt → 7.ordering-ui.79d1b04897948213ab70.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.112bb07bf92c44de3d24.js → 8.ordering-ui.79d1b04897948213ab70.js} +0 -0
- /package/_bundles/{9.ordering-ui.112bb07bf92c44de3d24.js → 9.ordering-ui.79d1b04897948213ab70.js} +0 -0
- /package/_bundles/{ordering-ui.112bb07bf92c44de3d24.js.LICENSE.txt → ordering-ui.79d1b04897948213ab70.js.LICENSE.txt} +0 -0
|
@@ -68,7 +68,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
68
68
|
var productSelect = (0, _react.useRef)(null);
|
|
69
69
|
var productActionsEdit = (0, _react.useRef)(null);
|
|
70
70
|
var productActionsDelete = (0, _react.useRef)(null);
|
|
71
|
-
var
|
|
71
|
+
var _productInfo = function productInfo() {
|
|
72
72
|
if (isCartProduct) {
|
|
73
73
|
var _product$ingredients, _product$options;
|
|
74
74
|
var ingredients = JSON.parse(JSON.stringify(Object.values((_product$ingredients = product.ingredients) !== null && _product$ingredients !== void 0 ? _product$ingredients : {})));
|
|
@@ -78,7 +78,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
78
78
|
option.suboptions = Object.values((_option$suboptions = option.suboptions) !== null && _option$suboptions !== void 0 ? _option$suboptions : {});
|
|
79
79
|
return option;
|
|
80
80
|
});
|
|
81
|
-
return _objectSpread(_objectSpread({},
|
|
81
|
+
return _objectSpread(_objectSpread({}, _productInfo), {}, {
|
|
82
82
|
ingredients: ingredients,
|
|
83
83
|
options: options
|
|
84
84
|
});
|
|
@@ -143,13 +143,13 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
143
143
|
}, i === 0 ? t('REMOVE', 'Remove') : i);
|
|
144
144
|
})) : /*#__PURE__*/_react.default.createElement(_styles.ProductQuantity, null, product === null || product === void 0 ? void 0 : product.quantity), /*#__PURE__*/_react.default.createElement(_styles.ContentInfo, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
145
145
|
className: "options-list"
|
|
146
|
-
}, /*#__PURE__*/_react.default.createElement("h3", null, product.name),
|
|
146
|
+
}, /*#__PURE__*/_react.default.createElement("h3", null, product.name), _productInfo().ingredients.length > 0 && _productInfo().ingredients.some(function (ingredient) {
|
|
147
147
|
return !ingredient.selected;
|
|
148
|
-
}) &&
|
|
148
|
+
}) && _productInfo().ingredients.map(function (item, i) {
|
|
149
149
|
return /*#__PURE__*/_react.default.createElement("p", {
|
|
150
150
|
key: i
|
|
151
151
|
}, item.name);
|
|
152
|
-
}),
|
|
152
|
+
}), _productInfo().options.length > 0 && _productInfo().options.map(function (item, i) {
|
|
153
153
|
return /*#__PURE__*/_react.default.createElement("p", {
|
|
154
154
|
key: i
|
|
155
155
|
}, item.name);
|
|
@@ -169,7 +169,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
169
169
|
}
|
|
170
170
|
})))))), ((product === null || product === void 0 ? void 0 : product.valid) || !isCartProduct) && windowSize.width > 567 && /*#__PURE__*/_react.default.createElement(_styles.ProductPriceSection, null, /*#__PURE__*/_react.default.createElement(_styles.ProductPrice, {
|
|
171
171
|
className: "prod-price"
|
|
172
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, parsePrice(product.total || product.price)), (
|
|
172
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, parsePrice(product.total || product.price)), (_productInfo().ingredients.length > 0 || _productInfo().options.length > 0 || product.comment) && /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_IosArrowDown.default, {
|
|
173
173
|
className: "".concat(setRotate)
|
|
174
174
|
}))), isCartProduct && !isCartPending && /*#__PURE__*/_react.default.createElement(_styles.ProductActions, null, /*#__PURE__*/_react.default.createElement(_styles.ProductActionsEdit, {
|
|
175
175
|
ref: productActionsEdit,
|
|
@@ -216,16 +216,16 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
216
216
|
style: {
|
|
217
217
|
maxHeight: "".concat(setHeight)
|
|
218
218
|
}
|
|
219
|
-
},
|
|
219
|
+
}, _productInfo().ingredients.length > 0 && _productInfo().ingredients.some(function (ingredient) {
|
|
220
220
|
return !ingredient.selected;
|
|
221
|
-
}) && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, /*#__PURE__*/_react.default.createElement("p", null, t('INGREDIENTS', 'Ingredients')),
|
|
221
|
+
}) && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, /*#__PURE__*/_react.default.createElement("p", null, t('INGREDIENTS', 'Ingredients')), _productInfo().ingredients.map(function (ingredient) {
|
|
222
222
|
return !ingredient.selected && /*#__PURE__*/_react.default.createElement("li", {
|
|
223
223
|
className: "ingredient",
|
|
224
224
|
key: ingredient.id
|
|
225
225
|
}, /*#__PURE__*/_react.default.createElement("span", null, t('NO', 'No'), " ", ingredient.name));
|
|
226
|
-
})),
|
|
226
|
+
})), _productInfo().options.length > 0 && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, {
|
|
227
227
|
className: "product-option-lists"
|
|
228
|
-
},
|
|
228
|
+
}, _productInfo().options.map(function (option) {
|
|
229
229
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
230
230
|
key: option.id
|
|
231
231
|
}, /*#__PURE__*/_react.default.createElement("p", null, option.name), /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, {
|
|
@@ -277,7 +277,7 @@ var ProductForm = exports.ProductForm = function ProductForm(props) {
|
|
|
277
277
|
* @param {object} cart Current cart
|
|
278
278
|
* @param {number} suboptionId Suboption id
|
|
279
279
|
*/
|
|
280
|
-
var
|
|
280
|
+
var _removeRelatedOptions = function removeRelatedOptions(productCart, suboptionId) {
|
|
281
281
|
product.product.extras.forEach(function (_extra) {
|
|
282
282
|
_extra.options.forEach(function (_option) {
|
|
283
283
|
if (_option.respect_to === suboptionId) {
|
|
@@ -285,7 +285,7 @@ var ProductForm = exports.ProductForm = function ProductForm(props) {
|
|
|
285
285
|
var suboptions = (_productCart$options2 = productCart.options["id:".concat(_option.id)]) === null || _productCart$options2 === void 0 ? void 0 : _productCart$options2.suboptions;
|
|
286
286
|
if (suboptions) {
|
|
287
287
|
Object.keys(suboptions).map(function (suboptionKey) {
|
|
288
|
-
return
|
|
288
|
+
return _removeRelatedOptions(productCart, parseInt(suboptionKey.split(':')[1]));
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
291
|
if (productCart.options["id:".concat(_option.id)]) {
|
|
@@ -329,13 +329,13 @@ var ProductForm = exports.ProductForm = function ProductForm(props) {
|
|
|
329
329
|
}
|
|
330
330
|
if (!state.selected) {
|
|
331
331
|
delete newProductCart.options["id:".concat(option.id)].suboptions["id:".concat(suboption.id)];
|
|
332
|
-
|
|
332
|
+
_removeRelatedOptions(newProductCart, suboption.id);
|
|
333
333
|
} else {
|
|
334
334
|
if (option.min === option.max && option.min === 1) {
|
|
335
335
|
var suboptions = newProductCart.options["id:".concat(option.id)].suboptions;
|
|
336
336
|
if (suboptions) {
|
|
337
337
|
Object.keys(suboptions).map(function (suboptionKey) {
|
|
338
|
-
return
|
|
338
|
+
return _removeRelatedOptions(newProductCart, parseInt(suboptionKey.split(':')[1]));
|
|
339
339
|
});
|
|
340
340
|
}
|
|
341
341
|
if (newProductCart.options["id:".concat(option.id)]) {
|
|
@@ -375,13 +375,13 @@ var ProductForm = exports.ProductForm = function ProductForm(props) {
|
|
|
375
375
|
}
|
|
376
376
|
if (!state.selected) {
|
|
377
377
|
delete newProductCart.options["id:".concat(option.id)].suboptions["id:".concat(suboption.id)];
|
|
378
|
-
|
|
378
|
+
_removeRelatedOptions(newProductCart, suboption.id);
|
|
379
379
|
} else {
|
|
380
380
|
if (option.min === option.max && option.min === 1) {
|
|
381
381
|
var suboptions = newProductCart.options["id:".concat(option.id)].suboptions;
|
|
382
382
|
if (suboptions) {
|
|
383
383
|
Object.keys(suboptions).map(function (suboptionKey) {
|
|
384
|
-
return
|
|
384
|
+
return _removeRelatedOptions(newProductCart, parseInt(suboptionKey.split(':')[1]));
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
387
|
if (newProductCart.options["id:".concat(option.id)]) {
|
|
@@ -68,7 +68,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
68
68
|
var productSelect = (0, _react.useRef)(null);
|
|
69
69
|
var productActionsEdit = (0, _react.useRef)(null);
|
|
70
70
|
var productActionsDelete = (0, _react.useRef)(null);
|
|
71
|
-
var
|
|
71
|
+
var _productInfo = function productInfo() {
|
|
72
72
|
if (isCartProduct) {
|
|
73
73
|
var _product$ingredients, _product$options;
|
|
74
74
|
var ingredients = JSON.parse(JSON.stringify(Object.values((_product$ingredients = product.ingredients) !== null && _product$ingredients !== void 0 ? _product$ingredients : {})));
|
|
@@ -78,7 +78,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
78
78
|
option.suboptions = Object.values((_option$suboptions = option.suboptions) !== null && _option$suboptions !== void 0 ? _option$suboptions : {});
|
|
79
79
|
return option;
|
|
80
80
|
});
|
|
81
|
-
return _objectSpread(_objectSpread({},
|
|
81
|
+
return _objectSpread(_objectSpread({}, _productInfo), {}, {
|
|
82
82
|
ingredients: ingredients,
|
|
83
83
|
options: options
|
|
84
84
|
});
|
|
@@ -138,7 +138,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
138
138
|
}, i === 0 ? t('REMOVE', 'Remove') : i);
|
|
139
139
|
})) : /*#__PURE__*/_react.default.createElement(_styles.ProductQuantity, null, product === null || product === void 0 ? void 0 : product.quantity), /*#__PURE__*/_react.default.createElement(_styles.ContentInfo, null, /*#__PURE__*/_react.default.createElement("h3", null, product.name), /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("p", null, parsePrice(product.total || product.price))))), ((product === null || product === void 0 ? void 0 : product.valid) || !isCartProduct) && windowSize.width > 410 && /*#__PURE__*/_react.default.createElement(_styles.ProductPriceSection, null, /*#__PURE__*/_react.default.createElement(_styles.ProductPrice, {
|
|
140
140
|
className: "prod-price"
|
|
141
|
-
}, (
|
|
141
|
+
}, (_productInfo().ingredients.length > 0 || _productInfo().options.length > 0 || product.comment) && /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_IosArrowDown.default, {
|
|
142
142
|
className: "".concat(setRotate)
|
|
143
143
|
}))), isCartProduct && !isCartPending && /*#__PURE__*/_react.default.createElement(_styles.ProductActions, null, /*#__PURE__*/_react.default.createElement(_styles.ProductActionsEdit, {
|
|
144
144
|
ref: productActionsEdit,
|
|
@@ -176,14 +176,14 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
176
176
|
maxHeight: "".concat(setHeight)
|
|
177
177
|
},
|
|
178
178
|
isCheckout: isCheckout
|
|
179
|
-
},
|
|
179
|
+
}, _productInfo().ingredients.length > 0 && _productInfo().ingredients.some(function (ingredient) {
|
|
180
180
|
return !ingredient.selected;
|
|
181
|
-
}) && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, /*#__PURE__*/_react.default.createElement("p", null, t('INGREDIENTS', 'Ingredients')),
|
|
181
|
+
}) && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, /*#__PURE__*/_react.default.createElement("p", null, t('INGREDIENTS', 'Ingredients')), _productInfo().ingredients.map(function (ingredient) {
|
|
182
182
|
return !ingredient.selected && /*#__PURE__*/_react.default.createElement("li", {
|
|
183
183
|
className: "ingredient",
|
|
184
184
|
key: ingredient.id
|
|
185
185
|
}, /*#__PURE__*/_react.default.createElement("span", null, t('NO', 'No'), " ", ingredient.name));
|
|
186
|
-
})),
|
|
186
|
+
})), _productInfo().options.length > 0 && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, _productInfo().options.map(function (option) {
|
|
187
187
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
188
188
|
key: option.id
|
|
189
189
|
}, /*#__PURE__*/_react.default.createElement("p", null, option.name), /*#__PURE__*/_react.default.createElement(_styles.SubOption, null, option.suboptions.map(function (suboption) {
|
|
@@ -67,7 +67,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
67
67
|
var productSelect = (0, _react.useRef)(null);
|
|
68
68
|
var productActionsEdit = (0, _react.useRef)(null);
|
|
69
69
|
var productActionsDelete = (0, _react.useRef)(null);
|
|
70
|
-
var
|
|
70
|
+
var _productInfo = function productInfo() {
|
|
71
71
|
if (isCartProduct) {
|
|
72
72
|
var _product$ingredients, _product$options;
|
|
73
73
|
var ingredients = JSON.parse(JSON.stringify(Object.values((_product$ingredients = product.ingredients) !== null && _product$ingredients !== void 0 ? _product$ingredients : {})));
|
|
@@ -77,7 +77,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
77
77
|
option.suboptions = Object.values((_option$suboptions = option.suboptions) !== null && _option$suboptions !== void 0 ? _option$suboptions : {});
|
|
78
78
|
return option;
|
|
79
79
|
});
|
|
80
|
-
return _objectSpread(_objectSpread({},
|
|
80
|
+
return _objectSpread(_objectSpread({}, _productInfo), {}, {
|
|
81
81
|
ingredients: ingredients,
|
|
82
82
|
options: options
|
|
83
83
|
});
|
|
@@ -155,7 +155,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
155
155
|
isSidebar: isSidebar
|
|
156
156
|
}, /*#__PURE__*/_react.default.createElement("h3", null, !(isCartProduct && !isCartPending && getProductMax) && /*#__PURE__*/_react.default.createElement(_styles.ProductQuantity, null, product === null || product === void 0 ? void 0 : product.quantity), product.name), ((product === null || product === void 0 ? void 0 : product.valid) || !isCartProduct) && /*#__PURE__*/_react.default.createElement(_styles.ProductPrice, {
|
|
157
157
|
className: "prod-price"
|
|
158
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, parsePrice(product.total || product.price)), (
|
|
158
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, parsePrice(product.total || product.price)), (_productInfo().ingredients.length > 0 || _productInfo().options.length > 0 || product.comment) && /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_IosArrowDown.default, {
|
|
159
159
|
className: "".concat(setRotate)
|
|
160
160
|
}))))), isCartProduct && !isCartPending && (product === null || product === void 0 ? void 0 : product.valid_menu) && !(product !== null && product !== void 0 && product.valid_quantity) && /*#__PURE__*/_react.default.createElement(_styles.ProductError, null, /*#__PURE__*/_react.default.createElement(_styles.ProductActions, null, /*#__PURE__*/_react.default.createElement(_styles.ProductActionsEdit, {
|
|
161
161
|
ref: productActionsEdit,
|
|
@@ -186,14 +186,14 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
186
186
|
style: {
|
|
187
187
|
maxHeight: "".concat(setHeight)
|
|
188
188
|
}
|
|
189
|
-
},
|
|
189
|
+
}, _productInfo().ingredients.length > 0 && _productInfo().ingredients.some(function (ingredient) {
|
|
190
190
|
return !ingredient.selected;
|
|
191
|
-
}) && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, /*#__PURE__*/_react.default.createElement("p", null, t('INGREDIENTS', 'Ingredients')),
|
|
191
|
+
}) && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, /*#__PURE__*/_react.default.createElement("p", null, t('INGREDIENTS', 'Ingredients')), _productInfo().ingredients.map(function (ingredient) {
|
|
192
192
|
return !ingredient.selected && /*#__PURE__*/_react.default.createElement("li", {
|
|
193
193
|
className: "ingredient",
|
|
194
194
|
key: ingredient.id
|
|
195
195
|
}, /*#__PURE__*/_react.default.createElement("span", null, t('NO', 'No'), " ", ingredient.name));
|
|
196
|
-
})),
|
|
196
|
+
})), _productInfo().options.length > 0 && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, _productInfo().options.map(function (option) {
|
|
197
197
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
198
198
|
key: option.id
|
|
199
199
|
}, /*#__PURE__*/_react.default.createElement("p", null, option.name), /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, {
|
|
@@ -67,7 +67,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
67
67
|
var productSelect = (0, _react.useRef)(null);
|
|
68
68
|
var productActionsEdit = (0, _react.useRef)(null);
|
|
69
69
|
var productActionsDelete = (0, _react.useRef)(null);
|
|
70
|
-
var
|
|
70
|
+
var _productInfo = function productInfo() {
|
|
71
71
|
if (isCartProduct) {
|
|
72
72
|
var _product$ingredients, _product$options;
|
|
73
73
|
var ingredients = JSON.parse(JSON.stringify(Object.values((_product$ingredients = product.ingredients) !== null && _product$ingredients !== void 0 ? _product$ingredients : {})));
|
|
@@ -77,7 +77,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
77
77
|
option.suboptions = Object.values((_option$suboptions = option.suboptions) !== null && _option$suboptions !== void 0 ? _option$suboptions : {});
|
|
78
78
|
return option;
|
|
79
79
|
});
|
|
80
|
-
return _objectSpread(_objectSpread({},
|
|
80
|
+
return _objectSpread(_objectSpread({}, _productInfo), {}, {
|
|
81
81
|
ingredients: ingredients,
|
|
82
82
|
options: options
|
|
83
83
|
});
|
|
@@ -153,7 +153,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
153
153
|
}
|
|
154
154
|
})))))), ((product === null || product === void 0 ? void 0 : product.valid) || !isCartProduct) && windowSize.width > 410 && /*#__PURE__*/_react.default.createElement(_styles.ProductPriceSection, null, /*#__PURE__*/_react.default.createElement(_styles.ProductPrice, {
|
|
155
155
|
className: "prod-price"
|
|
156
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, parsePrice(product.total || product.price)), (
|
|
156
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, parsePrice(product.total || product.price)), (_productInfo().ingredients.length > 0 || _productInfo().options.length > 0 || product.comment) && /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_IosArrowDown.default, {
|
|
157
157
|
className: "".concat(setRotate)
|
|
158
158
|
}))), isCartProduct && !isCartPending && /*#__PURE__*/_react.default.createElement(_styles.ProductActions, null, /*#__PURE__*/_react.default.createElement(_styles.ProductActionsEdit, {
|
|
159
159
|
ref: productActionsEdit,
|
|
@@ -200,14 +200,14 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
200
200
|
style: {
|
|
201
201
|
maxHeight: "".concat(setHeight)
|
|
202
202
|
}
|
|
203
|
-
},
|
|
203
|
+
}, _productInfo().ingredients.length > 0 && _productInfo().ingredients.some(function (ingredient) {
|
|
204
204
|
return !ingredient.selected;
|
|
205
|
-
}) && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, /*#__PURE__*/_react.default.createElement("p", null, t('INGREDIENTS', 'Ingredients')),
|
|
205
|
+
}) && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, /*#__PURE__*/_react.default.createElement("p", null, t('INGREDIENTS', 'Ingredients')), _productInfo().ingredients.map(function (ingredient) {
|
|
206
206
|
return !ingredient.selected && /*#__PURE__*/_react.default.createElement("li", {
|
|
207
207
|
className: "ingredient",
|
|
208
208
|
key: ingredient.id
|
|
209
209
|
}, /*#__PURE__*/_react.default.createElement("span", null, t('NO', 'No'), " ", ingredient.name));
|
|
210
|
-
})),
|
|
210
|
+
})), _productInfo().options.length > 0 && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, _productInfo().options.map(function (option) {
|
|
211
211
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
212
212
|
key: option.id
|
|
213
213
|
}, /*#__PURE__*/_react.default.createElement("p", null, option.name), /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, {
|
|
@@ -68,7 +68,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
68
68
|
var productSelect = (0, _react.useRef)(null);
|
|
69
69
|
var productActionsEdit = (0, _react.useRef)(null);
|
|
70
70
|
var productActionsDelete = (0, _react.useRef)(null);
|
|
71
|
-
var
|
|
71
|
+
var _productInfo = function productInfo() {
|
|
72
72
|
if (isCartProduct) {
|
|
73
73
|
var _product$ingredients, _product$options;
|
|
74
74
|
var ingredients = JSON.parse(JSON.stringify(Object.values((_product$ingredients = product.ingredients) !== null && _product$ingredients !== void 0 ? _product$ingredients : {})));
|
|
@@ -78,7 +78,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
78
78
|
option.suboptions = Object.values((_option$suboptions = option.suboptions) !== null && _option$suboptions !== void 0 ? _option$suboptions : {});
|
|
79
79
|
return option;
|
|
80
80
|
});
|
|
81
|
-
return _objectSpread(_objectSpread({},
|
|
81
|
+
return _objectSpread(_objectSpread({}, _productInfo), {}, {
|
|
82
82
|
ingredients: ingredients,
|
|
83
83
|
options: options
|
|
84
84
|
});
|
|
@@ -159,7 +159,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
159
159
|
})))))), ((product === null || product === void 0 ? void 0 : product.valid) || !isCartProduct) && windowSize.width > 410 && /*#__PURE__*/_react.default.createElement(_styles.ProductPriceSection, null, /*#__PURE__*/_react.default.createElement(_styles.ProductPrice, {
|
|
160
160
|
className: "prod-price",
|
|
161
161
|
isOrderDetails: isOrderDetails
|
|
162
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, parsePrice(product.total || product.price)), (
|
|
162
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, parsePrice(product.total || product.price)), (_productInfo().ingredients.length > 0 || _productInfo().options.length > 0 || product.comment) && /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_IosArrowDown.default, {
|
|
163
163
|
className: "".concat(setRotate)
|
|
164
164
|
}))), isCartProduct && !isCartPending && /*#__PURE__*/_react.default.createElement(_styles.ProductActions, null, /*#__PURE__*/_react.default.createElement(_styles.ProductActionsEdit, {
|
|
165
165
|
ref: productActionsEdit,
|
|
@@ -206,14 +206,14 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
206
206
|
style: {
|
|
207
207
|
maxHeight: "".concat(setHeight)
|
|
208
208
|
}
|
|
209
|
-
},
|
|
209
|
+
}, _productInfo().ingredients.length > 0 && _productInfo().ingredients.some(function (ingredient) {
|
|
210
210
|
return !ingredient.selected;
|
|
211
|
-
}) && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, /*#__PURE__*/_react.default.createElement("p", null, t('INGREDIENTS', 'Ingredients')),
|
|
211
|
+
}) && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, /*#__PURE__*/_react.default.createElement("p", null, t('INGREDIENTS', 'Ingredients')), _productInfo().ingredients.map(function (ingredient) {
|
|
212
212
|
return !ingredient.selected && /*#__PURE__*/_react.default.createElement("li", {
|
|
213
213
|
className: "ingredient",
|
|
214
214
|
key: ingredient.id
|
|
215
215
|
}, /*#__PURE__*/_react.default.createElement("span", null, t('NO', 'No'), " ", ingredient.name));
|
|
216
|
-
})),
|
|
216
|
+
})), _productInfo().options.length > 0 && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, _productInfo().options.map(function (option) {
|
|
217
217
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
218
218
|
key: option.id
|
|
219
219
|
}, /*#__PURE__*/_react.default.createElement("p", null, option.name), /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, {
|
|
@@ -64,7 +64,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
64
64
|
var productSelect = (0, _react.useRef)(null);
|
|
65
65
|
var productActionsEdit = (0, _react.useRef)(null);
|
|
66
66
|
var productActionsDelete = (0, _react.useRef)(null);
|
|
67
|
-
var
|
|
67
|
+
var _productInfo = function productInfo() {
|
|
68
68
|
if (isCartProduct) {
|
|
69
69
|
var _product$ingredients, _product$options;
|
|
70
70
|
var ingredients = JSON.parse(JSON.stringify(Object.values((_product$ingredients = product.ingredients) !== null && _product$ingredients !== void 0 ? _product$ingredients : {})));
|
|
@@ -74,7 +74,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
74
74
|
option.suboptions = Object.values((_option$suboptions = option.suboptions) !== null && _option$suboptions !== void 0 ? _option$suboptions : {});
|
|
75
75
|
return option;
|
|
76
76
|
});
|
|
77
|
-
return _objectSpread(_objectSpread({},
|
|
77
|
+
return _objectSpread(_objectSpread({}, _productInfo), {}, {
|
|
78
78
|
ingredients: ingredients,
|
|
79
79
|
options: options
|
|
80
80
|
});
|
|
@@ -150,7 +150,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
150
150
|
disabled: orderState.loading
|
|
151
151
|
}, /*#__PURE__*/_react.default.createElement(_VscTrash.default, {
|
|
152
152
|
color: "#D81212"
|
|
153
|
-
}))), isOrderDetail && /*#__PURE__*/_react.default.createElement(_styles.OrderDetailShow, null, /*#__PURE__*/_react.default.createElement("span", null, parsePrice(product.total || product.price)), (
|
|
153
|
+
}))), isOrderDetail && /*#__PURE__*/_react.default.createElement(_styles.OrderDetailShow, null, /*#__PURE__*/_react.default.createElement("span", null, parsePrice(product.total || product.price)), (_productInfo().ingredients.length > 0 || _productInfo().options.length > 0 || product.comment) && /*#__PURE__*/_react.default.createElement(_styles.ArrowDown, null, /*#__PURE__*/_react.default.createElement(_IosArrowDown.default, {
|
|
154
154
|
className: "".concat(setRotate)
|
|
155
155
|
})))), isCartProduct && !isCartPending && (product === null || product === void 0 ? void 0 : product.valid_menu) && !(product !== null && product !== void 0 && product.valid_quantity) && /*#__PURE__*/_react.default.createElement(_styles.ProductError, null, /*#__PURE__*/_react.default.createElement(_styles.ProductActions, null, /*#__PURE__*/_react.default.createElement(_styles.ProductActionsDelete, {
|
|
156
156
|
ref: productActionsDelete,
|
|
@@ -173,14 +173,14 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
|
|
|
173
173
|
style: {
|
|
174
174
|
maxHeight: "".concat(setHeight)
|
|
175
175
|
}
|
|
176
|
-
},
|
|
176
|
+
}, _productInfo().ingredients.length > 0 && _productInfo().ingredients.some(function (ingredient) {
|
|
177
177
|
return !ingredient.selected;
|
|
178
|
-
}) && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, /*#__PURE__*/_react.default.createElement("p", null, t('INGREDIENTS', 'Ingredients')),
|
|
178
|
+
}) && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, /*#__PURE__*/_react.default.createElement("p", null, t('INGREDIENTS', 'Ingredients')), _productInfo().ingredients.map(function (ingredient) {
|
|
179
179
|
return !ingredient.selected && /*#__PURE__*/_react.default.createElement("li", {
|
|
180
180
|
className: "ingredient",
|
|
181
181
|
key: ingredient.id
|
|
182
182
|
}, /*#__PURE__*/_react.default.createElement("span", null, t('NO', 'No'), " ", ingredient.name));
|
|
183
|
-
})),
|
|
183
|
+
})), _productInfo().options.length > 0 && /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, null, _productInfo().options.map(function (option) {
|
|
184
184
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
185
185
|
key: option.id
|
|
186
186
|
}, /*#__PURE__*/_react.default.createElement("p", null, option.name), /*#__PURE__*/_react.default.createElement(_styles.ProductOptionsList, {
|
package/_modules/utils/index.js
CHANGED
|
@@ -51,15 +51,15 @@ var scrollTo = exports.scrollTo = function scrollTo(element, to, duration) {
|
|
|
51
51
|
var change = to - start;
|
|
52
52
|
var currentTime = 0;
|
|
53
53
|
var increment = 20;
|
|
54
|
-
var
|
|
54
|
+
var _animateScroll = function animateScroll() {
|
|
55
55
|
currentTime += increment;
|
|
56
56
|
var val = easeInOutQuad(currentTime, start, change, duration);
|
|
57
57
|
element.scrollTop = val;
|
|
58
58
|
if (currentTime < duration && val > 0) {
|
|
59
|
-
setTimeout(
|
|
59
|
+
setTimeout(_animateScroll, increment);
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
-
|
|
62
|
+
_animateScroll();
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
/**
|
package/package.json
CHANGED
|
@@ -112,6 +112,7 @@ const AddressListUI = (props) => {
|
|
|
112
112
|
const [addressSpreadForm, setAddressSpreadForm] = useState(null)
|
|
113
113
|
const [editSpreadAddress, setEditSpreadAddress] = useState(false)
|
|
114
114
|
const [tabSelected, setTabSelected] = useState('general')
|
|
115
|
+
const [isAddAddressFromButton, setAddAddressFromButton] = useState(false)
|
|
115
116
|
|
|
116
117
|
const addFormRestrictions = userCustomerSetup?.imported_address_text && addressList.addresses?.length === 0 && !addressList?.loading && !addressList?.error
|
|
117
118
|
const uniqueAddressesList = (addressList.addresses && addressList.addresses.filter(
|
|
@@ -135,7 +136,7 @@ const AddressListUI = (props) => {
|
|
|
135
136
|
container && scrollTo(container, 0, 500)
|
|
136
137
|
}
|
|
137
138
|
|
|
138
|
-
const
|
|
139
|
+
const _handleSaveAddress = (address) => {
|
|
139
140
|
let found = false
|
|
140
141
|
const addresses = addressList.addresses.map(_address => {
|
|
141
142
|
if (_address?.id === address?.id) {
|
|
@@ -161,6 +162,11 @@ const AddressListUI = (props) => {
|
|
|
161
162
|
handleCloseAddressForm()
|
|
162
163
|
}
|
|
163
164
|
|
|
165
|
+
const handleSaveAddress = (address) => {
|
|
166
|
+
setAddAddressFromButton(true)
|
|
167
|
+
_handleSaveAddress(address)
|
|
168
|
+
}
|
|
169
|
+
|
|
164
170
|
const handleSetAddress = (address, options) => {
|
|
165
171
|
if (
|
|
166
172
|
checkAddress(address) &&
|
|
@@ -260,7 +266,7 @@ const AddressListUI = (props) => {
|
|
|
260
266
|
}, [userCustomerSetup?.imported_address_text, addressList.addresses, addressList?.loading, addressList?.error, isOpenUserData])
|
|
261
267
|
|
|
262
268
|
useEffect(() => {
|
|
263
|
-
if (!addressList?.addedBySocket) return
|
|
269
|
+
if (!addressList?.addedBySocket || isAddAddressFromButton) return
|
|
264
270
|
setConfirm({
|
|
265
271
|
open: true,
|
|
266
272
|
title: t('NEW_ADDRESS_REGISTERED', 'New address registered'),
|
|
@@ -269,7 +275,7 @@ const AddressListUI = (props) => {
|
|
|
269
275
|
handleOnCancel: ''
|
|
270
276
|
})
|
|
271
277
|
handleSetAddress(addressList?.addresses[addressList?.addresses?.length - 1], { avoidRedirect: true })
|
|
272
|
-
}, [addressList?.addedBySocket])
|
|
278
|
+
}, [addressList?.addedBySocket, isAddAddressFromButton])
|
|
273
279
|
|
|
274
280
|
return (
|
|
275
281
|
<AddressListContainer id='address_control' isLoading={actionStatus?.loading || orderState?.loading}>
|