@salesgenterp/ui-components 0.4.528 → 0.4.530
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 +75 -23
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +75 -23
- package/dist/index.modern.js.map +1 -1
- package/package.json +9 -2
package/dist/index.js
CHANGED
|
@@ -49,6 +49,7 @@ var TableContainer$3 = _interopDefault(require('@mui/material/TableContainer'));
|
|
|
49
49
|
var TableHead = _interopDefault(require('@mui/material/TableHead'));
|
|
50
50
|
var TableRow = _interopDefault(require('@mui/material/TableRow'));
|
|
51
51
|
var reactSpinners = require('react-spinners');
|
|
52
|
+
var reactVirtuoso = require('react-virtuoso');
|
|
52
53
|
var Box = _interopDefault(require('@mui/material/Box'));
|
|
53
54
|
var TableSortLabel = _interopDefault(require('@mui/material/TableSortLabel'));
|
|
54
55
|
var hi2 = require('react-icons/hi2');
|
|
@@ -302,6 +303,7 @@ var DATE_FORMATS = {
|
|
|
302
303
|
TIMESTAMP_FORMAT: 'DD MMM YY hh:mm A',
|
|
303
304
|
LIST_DATE_TIME_FORMAT: 'YYYY-MM-DD hh:mm A',
|
|
304
305
|
DEFAULT_DATE_FORMAT: 'YYYY-MM-DD',
|
|
306
|
+
LOCAL_DATE_FORMAT: 'DD MMM YY',
|
|
305
307
|
TIME: 'hh:mm:ss A'
|
|
306
308
|
};
|
|
307
309
|
var DEFAULT_PAYMENT_PROVIDER = {
|
|
@@ -6124,14 +6126,14 @@ var TableCellContainer$1 = styled__default(TableCell)(_templateObject9$2 || (_te
|
|
|
6124
6126
|
});
|
|
6125
6127
|
|
|
6126
6128
|
var _templateObject$r, _templateObject2$j, _templateObject3$d, _templateObject4$a, _templateObject5$6, _templateObject6$4, _templateObject7$3;
|
|
6127
|
-
var CartDrawerContainer = styled__default.div(_templateObject$r || (_templateObject$r = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: ", ";\n height: 100%;\n /* padding: 1em;\n padding-top: 0rem; */\n position: relative;\n /* min-width: 100%; */\n min-height: 100vh;\n max-height: 100vh;\n overflow-
|
|
6129
|
+
var CartDrawerContainer = styled__default.div(_templateObject$r || (_templateObject$r = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: ", ";\n height: 100%;\n /* padding: 1em;\n padding-top: 0rem; */\n position: relative;\n /* min-width: 100%; */\n min-height: 100vh;\n max-height: 100vh;\n overflow: hidden;\n box-sizing: border-box;\n\n display: flex;\n flex-direction: column;\n /* border: 1px solid; */\n"])), function (props) {
|
|
6128
6130
|
return props.maxWidth || '650px';
|
|
6129
6131
|
});
|
|
6130
|
-
var CartDrawerBar = styled__default.div(_templateObject2$j || (_templateObject2$j = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n position: sticky;\n box-sizing: border-box;\n top: 0;\n left:
|
|
6131
|
-
var CartDrawerProductContainer = styled__default.div(_templateObject3$d || (_templateObject3$d = _taggedTemplateLiteralLoose(["\n width: 100%;\n
|
|
6132
|
+
var CartDrawerBar = styled__default.div(_templateObject2$j || (_templateObject2$j = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n position: sticky;\n box-sizing: border-box;\n top: 0;\n left: 0;\n padding: 1em;\n height: 4.6rem;\n font-size: 1.6rem;\n background-color: white;\n font-weight: bold;\n padding-left: 1rem;\n z-index: 2;\n h2 {\n font-size: 1.5em;\n }\n .icon {\n cursor: pointer;\n font-size: 1em;\n }\n @media only screen and (max-width: 600px) {\n font-size: 1rem;\n height: 4rem;\n }\n"])));
|
|
6133
|
+
var CartDrawerProductContainer = styled__default.div(_templateObject3$d || (_templateObject3$d = _taggedTemplateLiteralLoose(["\n width: 100%;\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n position: relative;\n padding-top: 1rem;\n min-height: 0;\n height: 100%;\n overflow: hidden;\n box-sizing: border-box;\n opacity: ", ";\n /* background-color: red; */\n"])), function (props) {
|
|
6132
6134
|
return props.opacity;
|
|
6133
6135
|
});
|
|
6134
|
-
var CartDrawerBottomSection = styled__default.div(_templateObject4$a || (_templateObject4$a = _taggedTemplateLiteralLoose(["\n width: 100%;\n /* height: 8rem; */\n background-color: white;\n box-shadow: 3px -2px 10px #b1b1b1;\n display: flex;\n flex-direction: column;\n // min-height: 7rem;\n position: sticky;\n bottom: 0;\n margin-top: auto;\n /* padding-bottom: 0.5rem; */\n\n /* left: 0; */\n align-items: center;\n .row {\n width: 100%;\n padding: 0rem 1rem;\n padding-top: 1rem;\n /* padding-left: 1rem; */\n h5 {\n font-weight: bold;\n font-size: 1.1rem;\n span {\n font-weight: 400;\n padding-left: 0.5rem;\n }\n }\n }\n @media only screen and (max-width: 340px) {\n min-height: 6rem;\n .row h5 {\n font-size: 0.8rem;\n }\n }\n"])));
|
|
6136
|
+
var CartDrawerBottomSection = styled__default.div(_templateObject4$a || (_templateObject4$a = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: 100%;\n box-sizing: border-box;\n /* height: 8rem; */\n background-color: white;\n box-shadow: 3px -2px 10px #b1b1b1;\n display: flex;\n flex-direction: column;\n // min-height: 7rem;\n position: sticky;\n bottom: 0;\n margin-top: auto;\n /* padding-bottom: 0.5rem; */\n\n /* left: 0; */\n align-items: center;\n .row {\n width: 100%;\n padding: 0rem 1rem;\n padding-top: 1rem;\n /* padding-left: 1rem; */\n h5 {\n font-weight: bold;\n font-size: 1.1rem;\n span {\n font-weight: 400;\n padding-left: 0.5rem;\n }\n }\n }\n @media only screen and (max-width: 340px) {\n min-height: 6rem;\n .row h5 {\n font-size: 0.8rem;\n }\n }\n"])));
|
|
6135
6137
|
var CartDrawerOutlinedButton = styled__default.button(_templateObject5$6 || (_templateObject5$6 = _taggedTemplateLiteralLoose(["\n width: 90%;\n height: 3.55rem;\n border: 2px solid;\n border-radius: 1rem;\n display: grid;\n place-items: center;\n font-weight: 500;\n font-size: 1rem;\n transition: 0.5s;\n outline: none;\n text-transform: capitalize;\n border-color: ", ";\n color: ", ";\n text-transform: capitalize;\n margin: 0.6rem 0;\n cursor: pointer;\n background: white;\n &:hover,\n &:focus {\n opacity: 0.8;\n letter-spacing: 1px;\n outline: none;\n }\n @media only screen and (max-width: 600px) {\n height: 2.9rem;\n }\n @media only screen and (max-width: 340px) {\n height: 2.2rem;\n margin: 0.3rem 0;\n }\n"])), function (props) {
|
|
6136
6138
|
return props.color || 'black';
|
|
6137
6139
|
}, function (props) {
|
|
@@ -8472,7 +8474,7 @@ var checkMinMaxQty = function checkMinMaxQty(_ref2) {
|
|
|
8472
8474
|
};
|
|
8473
8475
|
|
|
8474
8476
|
var _templateObject$w, _templateObject2$o, _templateObject3$i;
|
|
8475
|
-
var CartDrawerProduct = styled__default.div(_templateObject$w || (_templateObject$w = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n height: 100px;\n justify-content: space-around;\n align-items: center;\n overflow: hidden;\n margin-bottom: 1rem;\n user-select: none;\n background: #f2f2f290;\n border: 1px solid #f2f2f290;\n padding: 0.5rem;\n border-radius: 12px;\n\n img {\n width: 20%;\n max-height: 100%;\n /* aspect-ratio: 1; */\n object-fit: contain;\n }\n .middleSection {\n width: 60%;\n padding-left: 0.8rem;\n height: 100%;\n h6 {\n font-size: 1.1rem;\n font-weight: bold;\n margin: 0;\n }\n .name {\n font-size: 0.9rem;\n line-height: 1.2rem;\n width: 100%;\n word-wrap: break-word;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: 0.3s;\n cursor: pointer;\n &:hover {\n color: ", ";\n }\n }\n }\n .endSection {\n // width: 20%;\n height: 95%;\n .icon {\n cursor: pointer;\n transition: 0.4s;\n &:hover {\n color: red;\n }\n }\n }\n @media only screen and (max-width: 768px) {\n .closeIcon {\n font-size: 1rem;\n }\n }\n @media only screen and (max-width: 340px) {\n .middleSection {\n h6 {\n font-size: 0.9rem;\n }\n }\n }\n"])), function (props) {
|
|
8477
|
+
var CartDrawerProduct = styled__default.div(_templateObject$w || (_templateObject$w = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: 100%;\n display: flex;\n flex-direction: row;\n height: 100px;\n justify-content: space-around;\n align-items: center;\n overflow: hidden;\n margin-bottom: 1rem;\n user-select: none;\n background: #f2f2f290;\n border: 1px solid #f2f2f290;\n padding: 0.5rem;\n border-radius: 12px;\n box-sizing: border-box;\n\n img {\n width: 20%;\n max-height: 100%;\n /* aspect-ratio: 1; */\n object-fit: contain;\n }\n .middleSection {\n width: 60%;\n padding-left: 0.8rem;\n height: 100%;\n h6 {\n font-size: 1.1rem;\n font-weight: bold;\n margin: 0;\n }\n .name {\n font-size: 0.9rem;\n line-height: 1.2rem;\n width: 100%;\n word-wrap: break-word;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: 0.3s;\n cursor: pointer;\n &:hover {\n color: ", ";\n }\n }\n }\n .endSection {\n // width: 20%;\n height: 95%;\n .icon {\n cursor: pointer;\n transition: 0.4s;\n &:hover {\n color: red;\n }\n }\n }\n @media only screen and (max-width: 768px) {\n .closeIcon {\n font-size: 1rem;\n }\n }\n @media only screen and (max-width: 340px) {\n .middleSection {\n h6 {\n font-size: 0.9rem;\n }\n }\n }\n"])), function (props) {
|
|
8476
8478
|
return props.color || 'grey';
|
|
8477
8479
|
});
|
|
8478
8480
|
var CartDrawerQtBox = styled__default.div(_templateObject2$o || (_templateObject2$o = _taggedTemplateLiteralLoose(["\n height: 30px;\n width: 86px;\n border: 1px solid rgb(211, 210, 210);\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: 13.5px;\n color: #323232;\n padding: 0 0.5rem;\n border-radius: 5px;\n max-width: 100%;\n span {\n cursor: pointer;\n height: 100%;\n display: grid;\n place-items: center;\n }\n .qt {\n font-size: 12px;\n color: black;\n font-weight: 500;\n cursor: auto;\n input {\n width: 40px;\n height: 100%;\n text-align: center;\n border: none;\n }\n }\n @media only screen and (max-width: 600px) {\n min-width: 55px;\n aspect-ratio: 1/2;\n font-size: 10px;\n }\n @media only screen and (max-width: 340px) {\n min-width: 50px;\n aspect-ratio: 1/2;\n height: 22px;\n font-size: 8px;\n }\n"])));
|
|
@@ -8604,7 +8606,7 @@ var CartDrawerProductCard = function CartDrawerProductCard(_ref) {
|
|
|
8604
8606
|
};
|
|
8605
8607
|
|
|
8606
8608
|
var CartDrawer = function CartDrawer(_ref) {
|
|
8607
|
-
var _cartData$cartLineIte, _cartData$
|
|
8609
|
+
var _cartData$cartLineIte, _cartData$cartLineIte3, _cartData$totalCartPr;
|
|
8608
8610
|
var cartData = _ref.cartData,
|
|
8609
8611
|
maxWidth = _ref.maxWidth,
|
|
8610
8612
|
color = _ref.color,
|
|
@@ -8619,6 +8621,30 @@ var CartDrawer = function CartDrawer(_ref) {
|
|
|
8619
8621
|
doNotShowPrice = _ref$doNotShowPrice === void 0 ? false : _ref$doNotShowPrice,
|
|
8620
8622
|
_ref$allowToProcessIn = _ref.allowToProcessInvoiceForOutOfStockProductsEcommerce,
|
|
8621
8623
|
allowToProcessInvoiceForOutOfStockProductsEcommerce = _ref$allowToProcessIn === void 0 ? false : _ref$allowToProcessIn;
|
|
8624
|
+
var containerRef = React.useRef(null);
|
|
8625
|
+
var _useState = React.useState(400),
|
|
8626
|
+
listHeight = _useState[0],
|
|
8627
|
+
setListHeight = _useState[1];
|
|
8628
|
+
React.useEffect(function () {
|
|
8629
|
+
var updateHeight = function updateHeight() {
|
|
8630
|
+
if (containerRef.current) {
|
|
8631
|
+
requestAnimationFrame(function () {
|
|
8632
|
+
var _containerRef$current;
|
|
8633
|
+
var height = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.clientHeight;
|
|
8634
|
+
if (height && height > 0) {
|
|
8635
|
+
setListHeight(height);
|
|
8636
|
+
}
|
|
8637
|
+
});
|
|
8638
|
+
}
|
|
8639
|
+
};
|
|
8640
|
+
updateHeight();
|
|
8641
|
+
window.addEventListener('resize', updateHeight);
|
|
8642
|
+
var timeoutId = setTimeout(updateHeight, 100);
|
|
8643
|
+
return function () {
|
|
8644
|
+
window.removeEventListener('resize', updateHeight);
|
|
8645
|
+
clearTimeout(timeoutId);
|
|
8646
|
+
};
|
|
8647
|
+
}, [cartData]);
|
|
8622
8648
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(CartDrawerContainer, {
|
|
8623
8649
|
className: "cartDrawer-container",
|
|
8624
8650
|
maxWidth: maxWidth
|
|
@@ -8627,23 +8653,49 @@ var CartDrawer = function CartDrawer(_ref) {
|
|
|
8627
8653
|
onClick: function onClick() {
|
|
8628
8654
|
handleClose();
|
|
8629
8655
|
}
|
|
8630
|
-
})), cartHeadingText && cartHeadingText, /*#__PURE__*/React__default.createElement(material.Box,
|
|
8656
|
+
})), cartHeadingText && cartHeadingText, /*#__PURE__*/React__default.createElement(material.Box, {
|
|
8657
|
+
ref: containerRef,
|
|
8658
|
+
sx: {
|
|
8659
|
+
flex: 1,
|
|
8660
|
+
position: 'relative',
|
|
8661
|
+
minHeight: 0,
|
|
8662
|
+
display: 'flex',
|
|
8663
|
+
flexDirection: 'column',
|
|
8664
|
+
overflow: 'hidden',
|
|
8665
|
+
width: '100%',
|
|
8666
|
+
boxSizing: 'border-box'
|
|
8667
|
+
}
|
|
8668
|
+
}, (cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte === void 0 ? void 0 : _cartData$cartLineIte.length) > 0 ? /*#__PURE__*/React__default.createElement(CartDrawerProductContainer, {
|
|
8631
8669
|
opacity: loading ? '.4' : '1'
|
|
8632
|
-
},
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8670
|
+
}, loading && /*#__PURE__*/React__default.createElement(CartDrawerLoader, null, /*#__PURE__*/React__default.createElement(reactSpinners.PuffLoader, {
|
|
8671
|
+
color: "black"
|
|
8672
|
+
})), /*#__PURE__*/React__default.createElement(reactVirtuoso.Virtuoso, {
|
|
8673
|
+
data: cartData === null || cartData === void 0 ? void 0 : cartData.cartLineItemDtoList,
|
|
8674
|
+
style: {
|
|
8675
|
+
height: listHeight,
|
|
8676
|
+
width: '100%',
|
|
8677
|
+
boxSizing: 'border-box'
|
|
8678
|
+
},
|
|
8679
|
+
itemContent: function itemContent(index, product) {
|
|
8680
|
+
var _cartData$cartLineIte2;
|
|
8681
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
8682
|
+
style: {
|
|
8683
|
+
padding: '0 1rem',
|
|
8684
|
+
paddingBottom: index === (cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte2 = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte2 === void 0 ? void 0 : _cartData$cartLineIte2.length) - 1 ? '1rem' : '0',
|
|
8685
|
+
boxSizing: 'border-box'
|
|
8686
|
+
}
|
|
8687
|
+
}, /*#__PURE__*/React__default.createElement(CartDrawerProductCard, {
|
|
8688
|
+
product: product,
|
|
8689
|
+
handleRedirect: handleRedirect,
|
|
8690
|
+
handleIncrementDecrement: handleIncrementDecrement,
|
|
8691
|
+
handleRemoveProduct: handleRemoveProduct,
|
|
8692
|
+
color: color,
|
|
8693
|
+
imgnotfoundUrl: imgnotfoundUrl,
|
|
8694
|
+
loading: loading,
|
|
8695
|
+
allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce,
|
|
8696
|
+
doNotShowPrice: doNotShowPrice
|
|
8697
|
+
}));
|
|
8698
|
+
}
|
|
8647
8699
|
})) : /*#__PURE__*/React__default.createElement(CartDrawerEmptyCart, {
|
|
8648
8700
|
color: color
|
|
8649
8701
|
}, /*#__PURE__*/React__default.createElement(bs.BsCartX, {
|
|
@@ -10519,7 +10571,7 @@ var StaticPageList = function StaticPageList(_ref) {
|
|
|
10519
10571
|
item: true
|
|
10520
10572
|
}, getLocalTime({
|
|
10521
10573
|
time: item === null || item === void 0 ? void 0 : item.insertedTimestamp,
|
|
10522
|
-
format: DATE_FORMATS.
|
|
10574
|
+
format: DATE_FORMATS.LOCAL_DATE_FORMAT
|
|
10523
10575
|
})), /*#__PURE__*/React__default.createElement(material.Grid, {
|
|
10524
10576
|
item: true
|
|
10525
10577
|
}, (item === null || item === void 0 ? void 0 : item.createdByName) || (item === null || item === void 0 ? void 0 : item.createdBy)))))))));
|