@salesgenterp/ui-components 0.4.252 → 0.4.254
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/dist/index.js +24 -20
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +24 -20
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -644,9 +644,7 @@ var erLocalStorage = {
|
|
|
644
644
|
var returnValue = {};
|
|
645
645
|
try {
|
|
646
646
|
returnValue = localStorage.getItem(key) ? JSON.parse(localStorage.getItem(key)) : {};
|
|
647
|
-
} catch (e) {
|
|
648
|
-
console.error(e);
|
|
649
|
-
}
|
|
647
|
+
} catch (e) {}
|
|
650
648
|
return returnValue;
|
|
651
649
|
}
|
|
652
650
|
};
|
|
@@ -679,9 +677,7 @@ var ErCache = /*#__PURE__*/function () {
|
|
|
679
677
|
value = _ref2.value;
|
|
680
678
|
try {
|
|
681
679
|
return this.sessionStorage.setItem(key, JSON.stringify(value));
|
|
682
|
-
} catch (e) {
|
|
683
|
-
console.error(e);
|
|
684
|
-
}
|
|
680
|
+
} catch (e) {}
|
|
685
681
|
};
|
|
686
682
|
return ErCache;
|
|
687
683
|
}();
|
|
@@ -806,7 +802,6 @@ var API$1 = function API(apiData) {
|
|
|
806
802
|
function _temp4(_result3) {
|
|
807
803
|
return _exit ? _result3 : function () {
|
|
808
804
|
if (axios.isCancel(exception)) {} else {
|
|
809
|
-
console.log('Exception on API call', url, exception);
|
|
810
805
|
return Promise.resolve(handleError({
|
|
811
806
|
exception: exception,
|
|
812
807
|
url: url,
|
|
@@ -4278,7 +4273,6 @@ var AsyncDataLoad = function AsyncDataLoad(_ref) {
|
|
|
4278
4273
|
}();
|
|
4279
4274
|
return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
|
|
4280
4275
|
}, function (e) {
|
|
4281
|
-
console.error('Async data load error', e);
|
|
4282
4276
|
setApiState({
|
|
4283
4277
|
status: API_STATUSES.ERROR,
|
|
4284
4278
|
data: {}
|
|
@@ -4398,15 +4392,15 @@ var BrandStock = function BrandStock(_ref) {
|
|
|
4398
4392
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
4399
4393
|
style: {
|
|
4400
4394
|
margin: '1.2rem 0'
|
|
4401
|
-
}
|
|
4395
|
+
},
|
|
4396
|
+
key: i
|
|
4402
4397
|
}, /*#__PURE__*/React__default.createElement(AsyncDataLoadComponent, {
|
|
4403
4398
|
apiEndPoint: apiEndPoint,
|
|
4404
4399
|
asyncService: function asyncService() {
|
|
4405
4400
|
return getBrandProducts({
|
|
4406
4401
|
brand: brand
|
|
4407
4402
|
});
|
|
4408
|
-
}
|
|
4409
|
-
key: i
|
|
4403
|
+
}
|
|
4410
4404
|
}, function (products) {
|
|
4411
4405
|
var _brand$brandAttachmen, _brand$brandAttachmen2;
|
|
4412
4406
|
return /*#__PURE__*/React__default.createElement(BrandContainer, null, brand === null || brand === void 0 ? void 0 : (_brand$brandAttachmen = brand.brandAttachmentMap) === null || _brand$brandAttachmen === void 0 ? void 0 : (_brand$brandAttachmen2 = _brand$brandAttachmen['Brand Banner']) === null || _brand$brandAttachmen2 === void 0 ? void 0 : _brand$brandAttachmen2.map(function (brand, i) {
|
|
@@ -5842,7 +5836,7 @@ var CardRow = function CardRow(_ref) {
|
|
|
5842
5836
|
id: row === null || row === void 0 ? void 0 : row.labelId,
|
|
5843
5837
|
scope: "row",
|
|
5844
5838
|
padding: "none"
|
|
5845
|
-
}, /*#__PURE__*/React__default.createElement(ProductName, null, row.productName), row.quantity > row.availableQuantity && /*#__PURE__*/React__default.createElement("p", {
|
|
5839
|
+
}, /*#__PURE__*/React__default.createElement(ProductName, null, row.productName), (row.quantity > row.availableQuantity || row.availableQuantity === 0) && /*#__PURE__*/React__default.createElement("p", {
|
|
5846
5840
|
style: {
|
|
5847
5841
|
color: 'red',
|
|
5848
5842
|
fontWeight: 500
|
|
@@ -5858,6 +5852,9 @@ var CardRow = function CardRow(_ref) {
|
|
|
5858
5852
|
onClick: function onClick(e) {
|
|
5859
5853
|
e.stopPropagation();
|
|
5860
5854
|
if (loading) return;
|
|
5855
|
+
if ((row === null || row === void 0 ? void 0 : row.availableQuantity) === 0) {
|
|
5856
|
+
return handleRemoveProduct(row);
|
|
5857
|
+
}
|
|
5861
5858
|
handleIncrementDecrement('decrement', _extends({}, row, {
|
|
5862
5859
|
quantity: (row === null || row === void 0 ? void 0 : row.quantity) > (row === null || row === void 0 ? void 0 : row.availableQuantity) ? row === null || row === void 0 ? void 0 : row.availableQuantity : row === null || row === void 0 ? void 0 : row.quantity
|
|
5863
5860
|
}));
|
|
@@ -5873,6 +5870,9 @@ var CardRow = function CardRow(_ref) {
|
|
|
5873
5870
|
onClick: function onClick(e) {
|
|
5874
5871
|
e.stopPropagation();
|
|
5875
5872
|
if (loading) return;
|
|
5873
|
+
if ((row === null || row === void 0 ? void 0 : row.availableQuantity) === 0) {
|
|
5874
|
+
return handleRemoveProduct(row);
|
|
5875
|
+
}
|
|
5876
5876
|
handleIncrementDecrement('increment', _extends({}, row, {
|
|
5877
5877
|
quantity: (row === null || row === void 0 ? void 0 : row.quantity) > (row === null || row === void 0 ? void 0 : row.availableQuantity) ? row === null || row === void 0 ? void 0 : row.availableQuantity : row === null || row === void 0 ? void 0 : row.quantity
|
|
5878
5878
|
}));
|
|
@@ -7107,7 +7107,7 @@ var CardRow$1 = function CardRow(_ref) {
|
|
|
7107
7107
|
id: row === null || row === void 0 ? void 0 : row.labelId,
|
|
7108
7108
|
scope: "row",
|
|
7109
7109
|
padding: "none"
|
|
7110
|
-
}, /*#__PURE__*/React__default.createElement(ProductName$1, null, row.productName), row.quantity > row.availableQuantity && /*#__PURE__*/React__default.createElement("p", {
|
|
7110
|
+
}, /*#__PURE__*/React__default.createElement(ProductName$1, null, row.productName), (row.quantity > row.availableQuantity || row.availableQuantity === 0) && /*#__PURE__*/React__default.createElement("p", {
|
|
7111
7111
|
style: {
|
|
7112
7112
|
color: 'red',
|
|
7113
7113
|
fontWeight: 500
|
|
@@ -7123,6 +7123,9 @@ var CardRow$1 = function CardRow(_ref) {
|
|
|
7123
7123
|
onClick: function onClick(e) {
|
|
7124
7124
|
e.stopPropagation();
|
|
7125
7125
|
if (loading) return;
|
|
7126
|
+
if ((row === null || row === void 0 ? void 0 : row.availableQuantity) === 0) {
|
|
7127
|
+
return handleRemoveProduct(row, index);
|
|
7128
|
+
}
|
|
7126
7129
|
handleIncrementDecrement('decrement', _extends({}, row, {
|
|
7127
7130
|
quantity: (row === null || row === void 0 ? void 0 : row.quantity) > (row === null || row === void 0 ? void 0 : row.availableQuantity) ? row === null || row === void 0 ? void 0 : row.availableQuantity : row === null || row === void 0 ? void 0 : row.quantity
|
|
7128
7131
|
}), index);
|
|
@@ -7138,6 +7141,9 @@ var CardRow$1 = function CardRow(_ref) {
|
|
|
7138
7141
|
onClick: function onClick(e) {
|
|
7139
7142
|
e.stopPropagation();
|
|
7140
7143
|
if (loading) return;
|
|
7144
|
+
if ((row === null || row === void 0 ? void 0 : row.availableQuantity) === 0) {
|
|
7145
|
+
return handleRemoveProduct(row, index);
|
|
7146
|
+
}
|
|
7141
7147
|
handleIncrementDecrement('increment', _extends({}, row, {
|
|
7142
7148
|
quantity: (row === null || row === void 0 ? void 0 : row.quantity) > (row === null || row === void 0 ? void 0 : row.availableQuantity) ? row === null || row === void 0 ? void 0 : row.availableQuantity : row === null || row === void 0 ? void 0 : row.quantity
|
|
7143
7149
|
}));
|
|
@@ -7395,7 +7401,6 @@ function ProductTable(_ref) {
|
|
|
7395
7401
|
var isSelected = function isSelected(name) {
|
|
7396
7402
|
return selected.includes(name);
|
|
7397
7403
|
};
|
|
7398
|
-
console.log('isSelected: ', isSelected);
|
|
7399
7404
|
React.useEffect(function () {
|
|
7400
7405
|
setCartArray(cartList);
|
|
7401
7406
|
}, [cartData]);
|
|
@@ -7539,11 +7544,8 @@ var QuickOrder = function QuickOrder(_ref) {
|
|
|
7539
7544
|
setProducts([].concat(filterProduct));
|
|
7540
7545
|
}
|
|
7541
7546
|
};
|
|
7542
|
-
var handleIncrementDecrement = function handleIncrementDecrement(data) {
|
|
7543
|
-
console.log('data: ', data);
|
|
7544
|
-
};
|
|
7547
|
+
var handleIncrementDecrement = function handleIncrementDecrement(data) {};
|
|
7545
7548
|
var handleRemoveAll = function handleRemoveAll(data) {
|
|
7546
|
-
console.log('data: ', data);
|
|
7547
7549
|
if (confirm('Are you sure, do you wan to delete items?')) {
|
|
7548
7550
|
var _data = lodash.remove(products, function (n) {});
|
|
7549
7551
|
}
|
|
@@ -8740,7 +8742,9 @@ var Step2 = function Step2(_ref) {
|
|
|
8740
8742
|
(option === null || option === void 0 ? void 0 : option.id) === (expandCarrier === null || expandCarrier === void 0 ? void 0 : expandCarrier.id) ? setExpandCarrier(null) : setExpandCarrier(option);
|
|
8741
8743
|
} else {
|
|
8742
8744
|
!(option !== null && option !== void 0 && option.shippingId) && setExpandCarrier(null);
|
|
8743
|
-
setMethod(option
|
|
8745
|
+
setMethod(_extends({}, option, {
|
|
8746
|
+
amount: (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice) > (option === null || option === void 0 ? void 0 : option.freeShippingLimit) ? 0 : option === null || option === void 0 ? void 0 : option.amount
|
|
8747
|
+
}));
|
|
8744
8748
|
}
|
|
8745
8749
|
},
|
|
8746
8750
|
key: i,
|
|
@@ -8879,7 +8883,7 @@ var Step2 = function Step2(_ref) {
|
|
|
8879
8883
|
paddingBottom: '1rem'
|
|
8880
8884
|
}, modifyOptions === null || modifyOptions === void 0 ? void 0 : modifyOptions.map(function (option, i) {
|
|
8881
8885
|
return deliveryOption(option, i);
|
|
8882
|
-
})), showShippingPriceRangeLimit && (method === null || method === void 0 ? void 0 : method.shippingPriceRange) && /*#__PURE__*/React__default.createElement(material.Stack, {
|
|
8886
|
+
})), method !== null && method !== void 0 && method.freeShippingLimit ? /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("span", null, "Free shipping on orders over", ' ', /*#__PURE__*/React__default.createElement("b", null, renderMoney(method === null || method === void 0 ? void 0 : method.freeShippingLimit)))) : null, showShippingPriceRangeLimit && (method === null || method === void 0 ? void 0 : method.shippingPriceRange) && /*#__PURE__*/React__default.createElement(material.Stack, {
|
|
8883
8887
|
flexDirection: "column",
|
|
8884
8888
|
width: "100%",
|
|
8885
8889
|
alignItems: 'flex-start',
|