ordering-ui-admin-external 1.43.60 → 1.43.62
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.6b04c27eb04c4738167d.js → ordering-ui-admin.79f59e9bee862210166d.js} +2 -2
- package/_modules/components/Stores/SingleBusinessProduct/index.js +13 -12
- package/package.json +2 -2
- package/src/components/Stores/SingleBusinessProduct/index.js +2 -2
- /package/_bundles/{ordering-ui-admin.6b04c27eb04c4738167d.js.LICENSE.txt → ordering-ui-admin.79f59e9bee862210166d.js.LICENSE.txt} +0 -0
|
@@ -29,7 +29,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
29
29
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
30
30
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
31
|
var SingleBusinessProductUI = function SingleBusinessProductUI(props) {
|
|
32
|
-
var _productFormState$cha, _productFormState$cha2, _product$id, _theme$images$icons, _productFormState$
|
|
32
|
+
var _ref, _productFormState$cha, _productFormState$cha2, _productFormState$cha3, _product$id, _theme$images$icons, _productFormState$cha4, _productFormState$cha5, _productFormState$cha6, _productFormState$cha7, _productFormState$cha8, _productFormState$cha9, _productFormState$cha10, _productFormState$cha11, _productFormState$cha12, _ref2, _taxProduct$rate, _productFormState$cha13, _productFormState$cha14, _productFormState$cha15, _productFormState$cha16, _productFormState$cha17;
|
|
33
33
|
var isSkeleton = props.isSkeleton,
|
|
34
34
|
viewMethod = props.viewMethod,
|
|
35
35
|
product = props.product,
|
|
@@ -43,6 +43,7 @@ var SingleBusinessProductUI = function SingleBusinessProductUI(props) {
|
|
|
43
43
|
productDetailsId = props.productDetailsId,
|
|
44
44
|
dataSelected = props.dataSelected,
|
|
45
45
|
business = props.business,
|
|
46
|
+
taxes = props.taxes,
|
|
46
47
|
handleDragStart = props.handleDragStart,
|
|
47
48
|
handleDragOver = props.handleDragOver,
|
|
48
49
|
handleDrop = props.handleDrop,
|
|
@@ -130,7 +131,7 @@ var SingleBusinessProductUI = function SingleBusinessProductUI(props) {
|
|
|
130
131
|
return document.removeEventListener('click', closeProductEdit);
|
|
131
132
|
};
|
|
132
133
|
}, [productFormState]);
|
|
133
|
-
var taxProduct = (_productFormState$cha = productFormState === null || productFormState === void 0 || (_productFormState$cha2 = productFormState.changes) === null || _productFormState$cha2 === void 0 ? void 0 : _productFormState$cha2.tax) !== null && _productFormState$cha !== void 0 ? _productFormState$cha : business === null || business === void 0 ? void 0 : business.tax;
|
|
134
|
+
var taxProduct = (_ref = (_productFormState$cha = productFormState === null || productFormState === void 0 || (_productFormState$cha2 = productFormState.changes) === null || _productFormState$cha2 === void 0 ? void 0 : _productFormState$cha2.tax) !== null && _productFormState$cha !== void 0 ? _productFormState$cha : taxes === null || taxes === void 0 ? void 0 : taxes["id:".concat(productFormState === null || productFormState === void 0 || (_productFormState$cha3 = productFormState.changes) === null || _productFormState$cha3 === void 0 ? void 0 : _productFormState$cha3.tax_id)]) !== null && _ref !== void 0 ? _ref : business === null || business === void 0 ? void 0 : business.tax;
|
|
134
135
|
var taxProductType = (taxProduct === null || taxProduct === void 0 ? void 0 : taxProduct.type) || (business === null || business === void 0 ? void 0 : business.tax_type);
|
|
135
136
|
var taxProductTypeString = taxProductType === 1 ? t('INCLUDED_ON_PRICE', 'Included on price') : t('NOT_INCLUDED_ON_PRICE', 'Not included on price');
|
|
136
137
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, viewMethod === 'list' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isSkeleton ? /*#__PURE__*/_react.default.createElement(_styles.SingleListBusinessContainer, null, /*#__PURE__*/_react.default.createElement("tr", null, (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.products) && /*#__PURE__*/_react.default.createElement("td", {
|
|
@@ -207,27 +208,27 @@ var SingleBusinessProductUI = function SingleBusinessProductUI(props) {
|
|
|
207
208
|
},
|
|
208
209
|
accept: "image/png, image/jpeg, image/jpg",
|
|
209
210
|
disabled: productFormState === null || productFormState === void 0 ? void 0 : productFormState.loading
|
|
210
|
-
}, productFormState !== null && productFormState !== void 0 && (_productFormState$
|
|
211
|
-
src: optimizeImage(productFormState === null || productFormState === void 0 || (_productFormState$
|
|
211
|
+
}, productFormState !== null && productFormState !== void 0 && (_productFormState$cha4 = productFormState.changes) !== null && _productFormState$cha4 !== void 0 && _productFormState$cha4.images ? /*#__PURE__*/_react.default.createElement("img", {
|
|
212
|
+
src: optimizeImage(productFormState === null || productFormState === void 0 || (_productFormState$cha5 = productFormState.changes) === null || _productFormState$cha5 === void 0 ? void 0 : _productFormState$cha5.images, 'h_50,c_limit'),
|
|
212
213
|
alt: "product image",
|
|
213
214
|
loading: "lazy"
|
|
214
215
|
}) : /*#__PURE__*/_react.default.createElement(_styles.UploadWrapper, null, /*#__PURE__*/_react.default.createElement(_BiImage.default, null))))), (product === null || product === void 0 ? void 0 : product.name) && /*#__PURE__*/_react.default.createElement("div", {
|
|
215
216
|
className: "product_name"
|
|
216
|
-
}, (productFormState === null || productFormState === void 0 || (_productFormState$
|
|
217
|
+
}, (productFormState === null || productFormState === void 0 || (_productFormState$cha6 = productFormState.changes) === null || _productFormState$cha6 === void 0 ? void 0 : _productFormState$cha6.name) || '')))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.description) && /*#__PURE__*/_react.default.createElement("td", {
|
|
217
218
|
className: "description"
|
|
218
219
|
}, /*#__PURE__*/_react.default.createElement(_styles.InfoBlock, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
219
220
|
className: "product_description"
|
|
220
|
-
}, (productFormState === null || productFormState === void 0 || (_productFormState$
|
|
221
|
+
}, (productFormState === null || productFormState === void 0 || (_productFormState$cha7 = productFormState.changes) === null || _productFormState$cha7 === void 0 ? void 0 : _productFormState$cha7.description) || ''))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.price) && /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_styles.InfoBlock, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
221
222
|
className: "product_price"
|
|
222
|
-
}, parsePrice((productFormState === null || productFormState === void 0 || (_productFormState$
|
|
223
|
+
}, parsePrice((productFormState === null || productFormState === void 0 || (_productFormState$cha8 = productFormState.changes) === null || _productFormState$cha8 === void 0 ? void 0 : _productFormState$cha8.price) || 0)))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.offer_price) && /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_styles.InfoBlock, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
223
224
|
className: "product_price"
|
|
224
|
-
}, productFormState !== null && productFormState !== void 0 && (_productFormState$
|
|
225
|
+
}, productFormState !== null && productFormState !== void 0 && (_productFormState$cha9 = productFormState.changes) !== null && _productFormState$cha9 !== void 0 && _productFormState$cha9.offer_price ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, parsePrice(productFormState === null || productFormState === void 0 || (_productFormState$cha10 = productFormState.changes) === null || _productFormState$cha10 === void 0 ? void 0 : _productFormState$cha10.offer_price)) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, ' ')))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.cost_price) && /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_styles.InfoBlock, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
225
226
|
className: "product_price"
|
|
226
|
-
}, productFormState !== null && productFormState !== void 0 && (_productFormState$
|
|
227
|
+
}, productFormState !== null && productFormState !== void 0 && (_productFormState$cha11 = productFormState.changes) !== null && _productFormState$cha11 !== void 0 && _productFormState$cha11.cost_price ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, parsePrice(productFormState === null || productFormState === void 0 || (_productFormState$cha12 = productFormState.changes) === null || _productFormState$cha12 === void 0 ? void 0 : _productFormState$cha12.cost_price)) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, ' ')))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.tax) && /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_styles.InfoBlock, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
227
228
|
className: "product_tax"
|
|
228
|
-
}, (
|
|
229
|
+
}, (_ref2 = (_taxProduct$rate = taxProduct === null || taxProduct === void 0 ? void 0 : taxProduct.rate) !== null && _taxProduct$rate !== void 0 ? _taxProduct$rate : taxProduct) !== null && _ref2 !== void 0 ? _ref2 : 0, "% (", taxProductTypeString, ")"))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.fee) && /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_styles.InfoBlock, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
229
230
|
className: "product_fee"
|
|
230
|
-
}, parsePrice((_productFormState$
|
|
231
|
+
}, parsePrice((_productFormState$cha13 = productFormState === null || productFormState === void 0 || (_productFormState$cha14 = productFormState.changes) === null || _productFormState$cha14 === void 0 || (_productFormState$cha14 = _productFormState$cha14.fee) === null || _productFormState$cha14 === void 0 ? void 0 : _productFormState$cha14.fixed) !== null && _productFormState$cha13 !== void 0 ? _productFormState$cha13 : 0), " + ", (_productFormState$cha15 = productFormState === null || productFormState === void 0 || (_productFormState$cha16 = productFormState.changes) === null || _productFormState$cha16 === void 0 || (_productFormState$cha16 = _productFormState$cha16.fee) === null || _productFormState$cha16 === void 0 ? void 0 : _productFormState$cha16.percentage) !== null && _productFormState$cha15 !== void 0 ? _productFormState$cha15 : business === null || business === void 0 ? void 0 : business.service_fee, "%"))), /*#__PURE__*/_react.default.createElement("td", {
|
|
231
232
|
className: "actions"
|
|
232
233
|
}, /*#__PURE__*/_react.default.createElement(_styles.BusinessEnableWrapper, {
|
|
233
234
|
className: "product_enable_control"
|
|
@@ -254,7 +255,7 @@ var SingleBusinessProductUI = function SingleBusinessProductUI(props) {
|
|
|
254
255
|
})), /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
255
256
|
width: 80,
|
|
256
257
|
height: 15
|
|
257
|
-
})))) : /*#__PURE__*/_react.default.createElement(_styles.SingleListBusinessContainer, null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, (product === null || product === void 0 ? void 0 : product.id) && /*#__PURE__*/_react.default.createElement(_styles.InfoBlock, null, /*#__PURE__*/_react.default.createElement("p", null, product === null || product === void 0 ? void 0 : product.id))), /*#__PURE__*/_react.default.createElement("td", null, (product === null || product === void 0 ? void 0 : product.name) && /*#__PURE__*/_react.default.createElement(_styles.InfoBlock, null, /*#__PURE__*/_react.default.createElement("p", null, product === null || product === void 0 ? void 0 : product.name))), /*#__PURE__*/_react.default.createElement("td", null, (product === null || product === void 0 ? void 0 : product.description) && /*#__PURE__*/_react.default.createElement(_styles.InfoBlock, null, /*#__PURE__*/_react.default.createElement("p", null, product === null || product === void 0 ? void 0 : product.description))), /*#__PURE__*/_react.default.createElement("td", null, (product === null || product === void 0 ? void 0 : product.price) && /*#__PURE__*/_react.default.createElement(_styles.InfoBlock, null, /*#__PURE__*/_react.default.createElement("p", null, parsePrice(product === null || product === void 0 ? void 0 : product.price)))), /*#__PURE__*/_react.default.createElement("td", null, (product === null || product === void 0 ? void 0 : product.offer_price) && /*#__PURE__*/_react.default.createElement(_styles.InfoBlock, null, /*#__PURE__*/_react.default.createElement("p", null, parsePrice(productFormState === null || productFormState === void 0 || (_productFormState$
|
|
258
|
+
})))) : /*#__PURE__*/_react.default.createElement(_styles.SingleListBusinessContainer, null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, (product === null || product === void 0 ? void 0 : product.id) && /*#__PURE__*/_react.default.createElement(_styles.InfoBlock, null, /*#__PURE__*/_react.default.createElement("p", null, product === null || product === void 0 ? void 0 : product.id))), /*#__PURE__*/_react.default.createElement("td", null, (product === null || product === void 0 ? void 0 : product.name) && /*#__PURE__*/_react.default.createElement(_styles.InfoBlock, null, /*#__PURE__*/_react.default.createElement("p", null, product === null || product === void 0 ? void 0 : product.name))), /*#__PURE__*/_react.default.createElement("td", null, (product === null || product === void 0 ? void 0 : product.description) && /*#__PURE__*/_react.default.createElement(_styles.InfoBlock, null, /*#__PURE__*/_react.default.createElement("p", null, product === null || product === void 0 ? void 0 : product.description))), /*#__PURE__*/_react.default.createElement("td", null, (product === null || product === void 0 ? void 0 : product.price) && /*#__PURE__*/_react.default.createElement(_styles.InfoBlock, null, /*#__PURE__*/_react.default.createElement("p", null, parsePrice(product === null || product === void 0 ? void 0 : product.price)))), /*#__PURE__*/_react.default.createElement("td", null, (product === null || product === void 0 ? void 0 : product.offer_price) && /*#__PURE__*/_react.default.createElement(_styles.InfoBlock, null, /*#__PURE__*/_react.default.createElement("p", null, parsePrice(productFormState === null || productFormState === void 0 || (_productFormState$cha17 = productFormState.changes) === null || _productFormState$cha17 === void 0 ? void 0 : _productFormState$cha17.offer_price)))), /*#__PURE__*/_react.default.createElement("td", null, (product === null || product === void 0 ? void 0 : product.quantity) && /*#__PURE__*/_react.default.createElement(_styles.InfoBlock, null, /*#__PURE__*/_react.default.createElement("p", null, product === null || product === void 0 ? void 0 : product.quantity)))))), /*#__PURE__*/_react.default.createElement(_Shared.Alert, {
|
|
258
259
|
title: t('PRODUCT', 'Product'),
|
|
259
260
|
content: alertState.content,
|
|
260
261
|
acceptText: t('ACCEPT', 'Accept'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-admin-external",
|
|
3
|
-
"version": "1.43.
|
|
3
|
+
"version": "1.43.62",
|
|
4
4
|
"description": "Ordering UI Admin Components",
|
|
5
5
|
"main": "./_modules/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"lodash": "^4.17.20",
|
|
84
84
|
"moment": "^2.29.1",
|
|
85
85
|
"moment-range": "^4.0.2",
|
|
86
|
-
"ordering-components-admin-external": "1.43.
|
|
86
|
+
"ordering-components-admin-external": "1.43.39",
|
|
87
87
|
"polished": "^3.6.7",
|
|
88
88
|
"prop-types": "^15.7.2",
|
|
89
89
|
"react-big-calendar": "^1.4.2",
|
|
@@ -39,7 +39,7 @@ const SingleBusinessProductUI = (props) => {
|
|
|
39
39
|
productDetailsId,
|
|
40
40
|
dataSelected,
|
|
41
41
|
business,
|
|
42
|
-
|
|
42
|
+
taxes,
|
|
43
43
|
handleDragStart,
|
|
44
44
|
handleDragOver,
|
|
45
45
|
handleDrop,
|
|
@@ -122,7 +122,7 @@ const SingleBusinessProductUI = (props) => {
|
|
|
122
122
|
return () => document.removeEventListener('click', closeProductEdit)
|
|
123
123
|
}, [productFormState])
|
|
124
124
|
|
|
125
|
-
const taxProduct = productFormState?.changes?.tax ?? business?.tax
|
|
125
|
+
const taxProduct = productFormState?.changes?.tax ?? taxes?.[`id:${productFormState?.changes?.tax_id}`] ?? business?.tax
|
|
126
126
|
const taxProductType = taxProduct?.type || business?.tax_type
|
|
127
127
|
const taxProductTypeString = taxProductType === 1 ? t('INCLUDED_ON_PRICE', 'Included on price') : t('NOT_INCLUDED_ON_PRICE', 'Not included on price')
|
|
128
128
|
|