@salesgenterp/ui-components 0.4.530 → 0.4.532
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 +189 -38
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +190 -39
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Skeleton as Skeleton$1, CircularProgress, TextField, Button, IconButton, Stack, Typography, Grid, InputAdornment, Popover, TableHead, TableRow, TableSortLabel, Paper, TableContainer as TableContainer$3, Table, TableBody, TableCell, TablePagination, Dialog, DialogContent, DialogActions, DialogTitle, RadioGroup, Radio, FormControlLabel, FormLabel, FormControl, FormHelperText, Select as Select$1, InputLabel, MenuItem, CardMedia, Divider, Tabs, Box, Tab, CardContent, ListItemIcon, ListItem, Collapse, List, ListItemText, Checkbox as Checkbox$1, Card, CardHeader, CssBaseline, Toolbar, Drawer, useMediaQuery as useMediaQuery$1, Tooltip, CardActionArea, Avatar as Avatar$1, alpha, Stepper, Step, StepLabel, StepContent, Container as Container$3 } from '@mui/material';
|
|
1
|
+
import { Skeleton as Skeleton$1, CircularProgress, TextField, Button, IconButton, Stack, Typography, Grid, InputAdornment, Popover, TableHead, TableRow, TableSortLabel, Paper, TableContainer as TableContainer$3, Table, TableBody, TableCell, TablePagination, Dialog, DialogContent, DialogActions, DialogTitle, RadioGroup, Radio, FormControlLabel, FormLabel, FormControl, FormHelperText, Select as Select$1, InputLabel, MenuItem, CardMedia, Divider, Tabs, Box, Tab, CardContent, ListItemIcon, ListItem, Collapse, List, ListItemText, Checkbox as Checkbox$1, Card, CardHeader, CssBaseline, Toolbar, Drawer, useMediaQuery as useMediaQuery$1, Pagination, Tooltip, CardActionArea, Avatar as Avatar$1, alpha, Stepper, Step, StepLabel, StepContent, Container as Container$3 } from '@mui/material';
|
|
2
2
|
import { styled as styled$1 } from '@mui/material/styles';
|
|
3
3
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
4
4
|
import React__default, { useState, useEffect, forwardRef, createElement, memo, useCallback, Fragment as Fragment$1, useRef, useMemo } from 'react';
|
|
@@ -6230,7 +6230,7 @@ function useGridSize() {
|
|
|
6230
6230
|
return layout;
|
|
6231
6231
|
}
|
|
6232
6232
|
|
|
6233
|
-
var _templateObject$s, _templateObject2$k, _templateObject3$e, _templateObject4$b, _templateObject5$7, _templateObject6$5, _templateObject7$4, _templateObject8$3, _templateObject9$3;
|
|
6233
|
+
var _templateObject$s, _templateObject2$k, _templateObject3$e, _templateObject4$b, _templateObject5$7, _templateObject6$5, _templateObject7$4, _templateObject8$3, _templateObject9$3, _templateObject10$2;
|
|
6234
6234
|
var CartPageSection = styled.section(_templateObject$s || (_templateObject$s = _taggedTemplateLiteralLoose(["\n background: ", ";\n max-width: 100%;\n width: fit-content;\n background: ", ";\n overflow: hidden;\n border-radius: 20px;\n max-width: 1600px;\n width: min(1600px, 100%);\n margin: auto;\n @media screen and (max-width: 1200px) {\n padding: 0 1em;\n }\n"])), function (props) {
|
|
6235
6235
|
return props.bg;
|
|
6236
6236
|
}, function (props) {
|
|
@@ -6270,12 +6270,13 @@ var CartTableContainer = styled(TableContainer$3)(_templateObject7$4 || (_templa
|
|
|
6270
6270
|
}, function (props) {
|
|
6271
6271
|
return props.color;
|
|
6272
6272
|
});
|
|
6273
|
-
var CartButtonsRow = styled.div(_templateObject8$3 || (_templateObject8$3 = _taggedTemplateLiteralLoose(["\n
|
|
6273
|
+
var CartButtonsRow = styled.div(_templateObject8$3 || (_templateObject8$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: start;\n align-items: center;\n padding-right: 1.85em;\n button {\n background: ", ";\n color: ", ";\n padding: 0.5em 1em;\n margin-left: 1em;\n font-size: 0.85em;\n text-transform: uppercase;\n border: none;\n cursor: pointer;\n transition: 0.4s;\n &:hover {\n transform: scale(0.9);\n }\n }\n"])), function (props) {
|
|
6274
6274
|
return props.bg || 'rgba(107, 106, 106, 1)';
|
|
6275
6275
|
}, function (props) {
|
|
6276
6276
|
return props.color || 'white';
|
|
6277
6277
|
});
|
|
6278
|
-
var
|
|
6278
|
+
var PaginationRow = styled.div(_templateObject9$3 || (_templateObject9$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-items: center;\n padding: 1em 0;\n gap: 1em;\n flex-wrap: wrap;\n .MuiPagination-root {\n .MuiPagination-ul {\n flex-wrap: wrap;\n }\n }\n @media screen and (max-width: 768px) {\n justify-content: center;\n padding: 1em 0.5em;\n }\n"])));
|
|
6279
|
+
var CartPageBox = styled.div(_templateObject10$2 || (_templateObject10$2 = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: 100%;\n margin-right: 1rem;\n min-height: 30em;\n position: relative;\n @media only screen and (max-width: 768px) {\n margin-right: 0;\n .CartnoBelowSm {\n display: none;\n }\n }\n"])));
|
|
6279
6280
|
|
|
6280
6281
|
function createCommonjsModule(fn, module) {
|
|
6281
6282
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
@@ -7605,6 +7606,8 @@ var CardRow = function CardRow(_ref) {
|
|
|
7605
7606
|
}))));
|
|
7606
7607
|
};
|
|
7607
7608
|
|
|
7609
|
+
var DEFAULT_PAGE_SIZE = 50;
|
|
7610
|
+
var PAGE_SIZE_OPTIONS = [50, 100, 300, 500];
|
|
7608
7611
|
var headCells = function headCells(_ref) {
|
|
7609
7612
|
var doNotShowPrice = _ref.doNotShowPrice;
|
|
7610
7613
|
return [{
|
|
@@ -7720,7 +7723,7 @@ EnhancedTableHead.propTypes = {
|
|
|
7720
7723
|
rowCount: propTypes.number.isRequired
|
|
7721
7724
|
};
|
|
7722
7725
|
function EnhancedTable(_ref2) {
|
|
7723
|
-
var _cartData$cartLineIte, _styles$Btn, _styles$scroll, _styles$scroll2,
|
|
7726
|
+
var _cartData$cartLineIte, _styles$Btn, _styles$scroll, _styles$scroll2, _styles$Btn2, _styles$Btn3, _styles$Btn4, _styles$Btn5, _styles$Btn6, _styles$Btn7, _styles$Btn8, _styles$Btn9, _styles$Btn10;
|
|
7724
7727
|
var cartData = _ref2.cartData,
|
|
7725
7728
|
loading = _ref2.loading,
|
|
7726
7729
|
imgnotfoundUrl = _ref2.imgnotfoundUrl,
|
|
@@ -7749,27 +7752,24 @@ function EnhancedTable(_ref2) {
|
|
|
7749
7752
|
var _React$useState4 = useState(cartList),
|
|
7750
7753
|
cartArray = _React$useState4[0],
|
|
7751
7754
|
setCartArray = _React$useState4[1];
|
|
7752
|
-
var
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7755
|
+
var _React$useState5 = useState(1),
|
|
7756
|
+
page = _React$useState5[0],
|
|
7757
|
+
setPage = _React$useState5[1];
|
|
7758
|
+
var _React$useState6 = useState(DEFAULT_PAGE_SIZE),
|
|
7759
|
+
rowsPerPage = _React$useState6[0],
|
|
7760
|
+
setRowsPerPage = _React$useState6[1];
|
|
7761
|
+
var tableContainerRef = useRef(null);
|
|
7762
|
+
var NUMERIC_SORT_COLUMNS = ['quantity', 'standardPrice', 'subtotal'];
|
|
7763
|
+
var handleRequestSort = function handleRequestSort(event, property) {
|
|
7764
|
+
var isSameColumn = orderBy === property;
|
|
7765
|
+
if (isSameColumn) {
|
|
7766
|
+
setOrder(function (prev) {
|
|
7767
|
+
return prev === 'asc' ? 'desc' : 'asc';
|
|
7758
7768
|
});
|
|
7759
|
-
|
|
7769
|
+
} else {
|
|
7770
|
+
setOrderBy(property);
|
|
7771
|
+
setOrder(NUMERIC_SORT_COLUMNS.includes(property) ? 'desc' : 'asc');
|
|
7760
7772
|
}
|
|
7761
|
-
newArray.sort(function (a, b) {
|
|
7762
|
-
return b[li] - a[li];
|
|
7763
|
-
});
|
|
7764
|
-
return setCartArray(newArray);
|
|
7765
|
-
};
|
|
7766
|
-
useEffect(function () {
|
|
7767
|
-
Sort();
|
|
7768
|
-
}, [order, orderBy]);
|
|
7769
|
-
var handleRequestSort = function handleRequestSort(event, property) {
|
|
7770
|
-
var isAsc = orderBy === property && order === 'asc';
|
|
7771
|
-
setOrder(isAsc ? 'desc' : 'asc');
|
|
7772
|
-
setOrderBy(property);
|
|
7773
7773
|
};
|
|
7774
7774
|
var handleSelectAllClick = function handleSelectAllClick(event) {
|
|
7775
7775
|
if ((selected === null || selected === void 0 ? void 0 : selected.length) < (cartArray === null || cartArray === void 0 ? void 0 : cartArray.length)) {
|
|
@@ -7795,6 +7795,45 @@ function EnhancedTable(_ref2) {
|
|
|
7795
7795
|
useEffect(function () {
|
|
7796
7796
|
setCartArray(cartList);
|
|
7797
7797
|
}, [cartData]);
|
|
7798
|
+
var getSortValue = function getSortValue(row, key) {
|
|
7799
|
+
var _row$key;
|
|
7800
|
+
if (key === 'subtotal') {
|
|
7801
|
+
var _row$discountAmount, _row$quantity, _row$couponDiscount;
|
|
7802
|
+
return ((row === null || row === void 0 ? void 0 : row.standardPrice) - ((_row$discountAmount = row === null || row === void 0 ? void 0 : row.discountAmount) != null ? _row$discountAmount : 0)) * ((_row$quantity = row === null || row === void 0 ? void 0 : row.quantity) != null ? _row$quantity : 0) - ((_row$couponDiscount = row === null || row === void 0 ? void 0 : row.couponDiscount) != null ? _row$couponDiscount : 0);
|
|
7803
|
+
}
|
|
7804
|
+
return (_row$key = row[key]) != null ? _row$key : 0;
|
|
7805
|
+
};
|
|
7806
|
+
var columnSortedArray = useMemo(function () {
|
|
7807
|
+
var arr = [].concat(cartArray || []);
|
|
7808
|
+
var key = orderBy;
|
|
7809
|
+
if (order === 'asc') {
|
|
7810
|
+
arr.sort(function (a, b) {
|
|
7811
|
+
return getSortValue(a, key) - getSortValue(b, key);
|
|
7812
|
+
});
|
|
7813
|
+
} else {
|
|
7814
|
+
arr.sort(function (a, b) {
|
|
7815
|
+
return getSortValue(b, key) - getSortValue(a, key);
|
|
7816
|
+
});
|
|
7817
|
+
}
|
|
7818
|
+
return arr;
|
|
7819
|
+
}, [cartArray, order, orderBy]);
|
|
7820
|
+
var sortedCartArray = sortBy(columnSortedArray, function (o) {
|
|
7821
|
+
return !((o === null || o === void 0 ? void 0 : o.quantity) <= 0 || (o === null || o === void 0 ? void 0 : o.availableQuantity) <= 0 || (o === null || o === void 0 ? void 0 : o.quantity) > (o === null || o === void 0 ? void 0 : o.availableQuantity));
|
|
7822
|
+
}) || [];
|
|
7823
|
+
var totalPages = Math.max(1, Math.ceil(sortedCartArray.length / rowsPerPage));
|
|
7824
|
+
var paginatedCartArray = sortedCartArray.slice((page - 1) * rowsPerPage, page * rowsPerPage);
|
|
7825
|
+
useEffect(function () {
|
|
7826
|
+
if (page > totalPages) {
|
|
7827
|
+
setPage(1);
|
|
7828
|
+
}
|
|
7829
|
+
}, [totalPages, page]);
|
|
7830
|
+
useEffect(function () {
|
|
7831
|
+
var _tableContainerRef$cu, _tableContainerRef$cu2;
|
|
7832
|
+
(_tableContainerRef$cu = tableContainerRef.current) === null || _tableContainerRef$cu === void 0 ? void 0 : (_tableContainerRef$cu2 = _tableContainerRef$cu.scrollTo) === null || _tableContainerRef$cu2 === void 0 ? void 0 : _tableContainerRef$cu2.call(_tableContainerRef$cu, {
|
|
7833
|
+
top: 0,
|
|
7834
|
+
behavior: 'smooth'
|
|
7835
|
+
});
|
|
7836
|
+
}, [page, rowsPerPage]);
|
|
7798
7837
|
return /*#__PURE__*/createElement(CartPageBox, null, loading && /*#__PURE__*/createElement(Loader$1, null, /*#__PURE__*/createElement(BounceLoader, {
|
|
7799
7838
|
size: 40,
|
|
7800
7839
|
color: styles === null || styles === void 0 ? void 0 : (_styles$Btn = styles.Btn) === null || _styles$Btn === void 0 ? void 0 : _styles$Btn.background,
|
|
@@ -7802,9 +7841,9 @@ function EnhancedTable(_ref2) {
|
|
|
7802
7841
|
})), /*#__PURE__*/createElement(Box$1, {
|
|
7803
7842
|
sx: {
|
|
7804
7843
|
width: '100%'
|
|
7805
|
-
}
|
|
7806
|
-
paddingBottom: "2em"
|
|
7844
|
+
}
|
|
7807
7845
|
}, /*#__PURE__*/createElement(CartTableContainer, {
|
|
7846
|
+
ref: tableContainerRef,
|
|
7808
7847
|
bg: styles === null || styles === void 0 ? void 0 : (_styles$scroll = styles.scroll) === null || _styles$scroll === void 0 ? void 0 : _styles$scroll.bg,
|
|
7809
7848
|
color: styles === null || styles === void 0 ? void 0 : (_styles$scroll2 = styles.scroll) === null || _styles$scroll2 === void 0 ? void 0 : _styles$scroll2.color
|
|
7810
7849
|
}, /*#__PURE__*/createElement(Table$1, {
|
|
@@ -7822,9 +7861,7 @@ function EnhancedTable(_ref2) {
|
|
|
7822
7861
|
disabledSelectAllProductCheckbox: disabledSelectAllProductCheckbox,
|
|
7823
7862
|
allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce,
|
|
7824
7863
|
doNotShowPrice: doNotShowPrice
|
|
7825
|
-
}), /*#__PURE__*/createElement(TableBody$1, null, (
|
|
7826
|
-
return !((o === null || o === void 0 ? void 0 : o.quantity) <= 0 || (o === null || o === void 0 ? void 0 : o.availableQuantity) <= 0 || (o === null || o === void 0 ? void 0 : o.quantity) > (o === null || o === void 0 ? void 0 : o.availableQuantity));
|
|
7827
|
-
})) === null || _sortBy === void 0 ? void 0 : _sortBy.map(function (row, index) {
|
|
7864
|
+
}), /*#__PURE__*/createElement(TableBody$1, null, paginatedCartArray.map(function (row, index) {
|
|
7828
7865
|
var isItemSelected = isSelected(row);
|
|
7829
7866
|
return /*#__PURE__*/createElement(CardRow, {
|
|
7830
7867
|
row: row,
|
|
@@ -7839,7 +7876,14 @@ function EnhancedTable(_ref2) {
|
|
|
7839
7876
|
allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce,
|
|
7840
7877
|
doNotShowPrice: doNotShowPrice
|
|
7841
7878
|
});
|
|
7842
|
-
}))))),
|
|
7879
|
+
}))))), /*#__PURE__*/createElement("div", {
|
|
7880
|
+
style: {
|
|
7881
|
+
display: 'flex',
|
|
7882
|
+
justifyContent: 'space-between',
|
|
7883
|
+
flexWrap: 'wrap',
|
|
7884
|
+
width: '100%'
|
|
7885
|
+
}
|
|
7886
|
+
}, (cartArray === null || cartArray === void 0 ? void 0 : cartArray.length) > 0 && /*#__PURE__*/createElement(CartButtonsRow, {
|
|
7843
7887
|
bg: styles === null || styles === void 0 ? void 0 : (_styles$Btn2 = styles.Btn) === null || _styles$Btn2 === void 0 ? void 0 : _styles$Btn2.background,
|
|
7844
7888
|
color: styles === null || styles === void 0 ? void 0 : (_styles$Btn3 = styles.Btn) === null || _styles$Btn3 === void 0 ? void 0 : _styles$Btn3.color
|
|
7845
7889
|
}, /*#__PURE__*/createElement("button", {
|
|
@@ -7853,7 +7897,51 @@ function EnhancedTable(_ref2) {
|
|
|
7853
7897
|
});
|
|
7854
7898
|
setSelected([]);
|
|
7855
7899
|
}
|
|
7856
|
-
}, "remove selected"))
|
|
7900
|
+
}, "remove selected")), sortedCartArray.length > 0 && /*#__PURE__*/createElement(PaginationRow, null, totalPages > 1 && /*#__PURE__*/createElement(Pagination, {
|
|
7901
|
+
count: totalPages,
|
|
7902
|
+
page: page,
|
|
7903
|
+
onChange: function onChange(_, value) {
|
|
7904
|
+
return setPage(value);
|
|
7905
|
+
},
|
|
7906
|
+
color: "primary",
|
|
7907
|
+
sx: {
|
|
7908
|
+
'& .MuiPaginationItem-root.Mui-selected': {
|
|
7909
|
+
backgroundColor: styles === null || styles === void 0 ? void 0 : (_styles$Btn4 = styles.Btn) === null || _styles$Btn4 === void 0 ? void 0 : _styles$Btn4.background,
|
|
7910
|
+
color: (styles === null || styles === void 0 ? void 0 : (_styles$Btn5 = styles.Btn) === null || _styles$Btn5 === void 0 ? void 0 : _styles$Btn5.color) || '#fff',
|
|
7911
|
+
borderColor: styles === null || styles === void 0 ? void 0 : (_styles$Btn6 = styles.Btn) === null || _styles$Btn6 === void 0 ? void 0 : _styles$Btn6.background
|
|
7912
|
+
},
|
|
7913
|
+
'& .MuiPaginationItem-root.Mui-selected:hover': {
|
|
7914
|
+
backgroundColor: (styles === null || styles === void 0 ? void 0 : (_styles$Btn7 = styles.Btn) === null || _styles$Btn7 === void 0 ? void 0 : _styles$Btn7.background) + '80',
|
|
7915
|
+
color: (styles === null || styles === void 0 ? void 0 : (_styles$Btn8 = styles.Btn) === null || _styles$Btn8 === void 0 ? void 0 : _styles$Btn8.color) || '#fff',
|
|
7916
|
+
borderColor: styles === null || styles === void 0 ? void 0 : (_styles$Btn9 = styles.Btn) === null || _styles$Btn9 === void 0 ? void 0 : _styles$Btn9.background
|
|
7917
|
+
}
|
|
7918
|
+
},
|
|
7919
|
+
showFirstButton: true,
|
|
7920
|
+
showLastButton: true
|
|
7921
|
+
}), /*#__PURE__*/createElement(FormControl, {
|
|
7922
|
+
size: "small",
|
|
7923
|
+
sx: {
|
|
7924
|
+
minWidth: 120
|
|
7925
|
+
}
|
|
7926
|
+
}, /*#__PURE__*/createElement(Select$1, {
|
|
7927
|
+
value: rowsPerPage,
|
|
7928
|
+
onChange: function onChange(e) {
|
|
7929
|
+
setRowsPerPage(Number(e.target.value));
|
|
7930
|
+
setPage(1);
|
|
7931
|
+
},
|
|
7932
|
+
sx: {
|
|
7933
|
+
'& .MuiSelect-select': {
|
|
7934
|
+
backgroundColor: '#ffffff',
|
|
7935
|
+
borderRadius: '5px',
|
|
7936
|
+
borderColor: (styles === null || styles === void 0 ? void 0 : (_styles$Btn10 = styles.Btn) === null || _styles$Btn10 === void 0 ? void 0 : _styles$Btn10.background) || '#d3d3d3'
|
|
7937
|
+
}
|
|
7938
|
+
}
|
|
7939
|
+
}, PAGE_SIZE_OPTIONS.map(function (size) {
|
|
7940
|
+
return /*#__PURE__*/createElement(MenuItem, {
|
|
7941
|
+
key: size,
|
|
7942
|
+
value: size
|
|
7943
|
+
}, size, " per page");
|
|
7944
|
+
}))))));
|
|
7857
7945
|
}
|
|
7858
7946
|
|
|
7859
7947
|
var _templateObject$u, _templateObject2$m, _templateObject3$g, _templateObject4$d, _templateObject5$9, _templateObject6$7, _templateObject7$5;
|
|
@@ -7985,8 +8073,10 @@ var CartPageProductCard = function CartPageProductCard(_ref) {
|
|
|
7985
8073
|
}, /*#__PURE__*/React__default.createElement(RiDeleteBin5Line, null)));
|
|
7986
8074
|
};
|
|
7987
8075
|
|
|
8076
|
+
var DEFAULT_PAGE_SIZE$1 = 50;
|
|
8077
|
+
var PAGE_SIZE_OPTIONS$1 = [50, 100, 300, 500];
|
|
7988
8078
|
var CartPageMainRetail = function CartPageMainRetail(_ref) {
|
|
7989
|
-
var _styles$Btn,
|
|
8079
|
+
var _styles$Btn, _styles$Btn2, _styles$Btn3, _styles$Btn4, _styles$Btn5, _styles$Btn6, _styles$Btn7, _styles$Btn8;
|
|
7990
8080
|
var retail = _ref.retail,
|
|
7991
8081
|
cartData = _ref.cartData,
|
|
7992
8082
|
loading = _ref.loading,
|
|
@@ -7997,7 +8087,25 @@ var CartPageMainRetail = function CartPageMainRetail(_ref) {
|
|
|
7997
8087
|
clickRedirect = _ref.clickRedirect,
|
|
7998
8088
|
allowToProcessInvoiceForOutOfStockProductsEcommerce = _ref.allowToProcessInvoiceForOutOfStockProductsEcommerce,
|
|
7999
8089
|
doNotShowPrice = _ref.doNotShowPrice;
|
|
8090
|
+
var _useState = useState(1),
|
|
8091
|
+
page = _useState[0],
|
|
8092
|
+
setPage = _useState[1];
|
|
8093
|
+
var _useState2 = useState(DEFAULT_PAGE_SIZE$1),
|
|
8094
|
+
rowsPerPage = _useState2[0],
|
|
8095
|
+
setRowsPerPage = _useState2[1];
|
|
8096
|
+
var sortedCartArray = useMemo(function () {
|
|
8097
|
+
return sortBy((cartData === null || cartData === void 0 ? void 0 : cartData.cartLineItemDtoList) || [], function (o) {
|
|
8098
|
+
return !((o === null || o === void 0 ? void 0 : o.quantity) <= 0 || (o === null || o === void 0 ? void 0 : o.availableQuantity) <= 0 || (o === null || o === void 0 ? void 0 : o.quantity) > (o === null || o === void 0 ? void 0 : o.availableQuantity));
|
|
8099
|
+
});
|
|
8100
|
+
}, [cartData === null || cartData === void 0 ? void 0 : cartData.cartLineItemDtoList]);
|
|
8101
|
+
var totalPages = Math.max(1, Math.ceil(sortedCartArray.length / rowsPerPage));
|
|
8102
|
+
var paginatedCartArray = sortedCartArray.slice((page - 1) * rowsPerPage, page * rowsPerPage);
|
|
8103
|
+
React__default.useEffect(function () {
|
|
8104
|
+
if (page > totalPages) setPage(1);
|
|
8105
|
+
}, [totalPages, page]);
|
|
8000
8106
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
8107
|
+
className: ""
|
|
8108
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
8001
8109
|
className: "scrollDiv"
|
|
8002
8110
|
}, /*#__PURE__*/React__default.createElement(CardsBox, {
|
|
8003
8111
|
retail: retail
|
|
@@ -8005,10 +8113,9 @@ var CartPageMainRetail = function CartPageMainRetail(_ref) {
|
|
|
8005
8113
|
size: 40,
|
|
8006
8114
|
color: styles === null || styles === void 0 ? void 0 : (_styles$Btn = styles.Btn) === null || _styles$Btn === void 0 ? void 0 : _styles$Btn.background,
|
|
8007
8115
|
loading: true
|
|
8008
|
-
})), (
|
|
8009
|
-
return !((o === null || o === void 0 ? void 0 : o.quantity) <= 0 || (o === null || o === void 0 ? void 0 : o.availableQuantity) <= 0 || (o === null || o === void 0 ? void 0 : o.quantity) > (o === null || o === void 0 ? void 0 : o.availableQuantity));
|
|
8010
|
-
})) === null || _sortBy === void 0 ? void 0 : _sortBy.map(function (item) {
|
|
8116
|
+
})), paginatedCartArray.map(function (item) {
|
|
8011
8117
|
return /*#__PURE__*/React__default.createElement(CartPageProductCard, {
|
|
8118
|
+
key: item === null || item === void 0 ? void 0 : item.productId,
|
|
8012
8119
|
item: item,
|
|
8013
8120
|
loading: loading,
|
|
8014
8121
|
imgnotfoundUrl: imgnotfoundUrl,
|
|
@@ -8019,7 +8126,51 @@ var CartPageMainRetail = function CartPageMainRetail(_ref) {
|
|
|
8019
8126
|
allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce,
|
|
8020
8127
|
doNotShowPrice: doNotShowPrice
|
|
8021
8128
|
});
|
|
8022
|
-
})))
|
|
8129
|
+
}))), sortedCartArray.length > 0 && /*#__PURE__*/React__default.createElement(PaginationRow, null, totalPages > 1 && /*#__PURE__*/React__default.createElement(Pagination, {
|
|
8130
|
+
count: totalPages,
|
|
8131
|
+
page: page,
|
|
8132
|
+
onChange: function onChange(_, value) {
|
|
8133
|
+
return setPage(value);
|
|
8134
|
+
},
|
|
8135
|
+
color: "primary",
|
|
8136
|
+
sx: {
|
|
8137
|
+
'& .MuiPaginationItem-root.Mui-selected': {
|
|
8138
|
+
backgroundColor: styles === null || styles === void 0 ? void 0 : (_styles$Btn2 = styles.Btn) === null || _styles$Btn2 === void 0 ? void 0 : _styles$Btn2.background,
|
|
8139
|
+
color: (styles === null || styles === void 0 ? void 0 : (_styles$Btn3 = styles.Btn) === null || _styles$Btn3 === void 0 ? void 0 : _styles$Btn3.color) || '#fff',
|
|
8140
|
+
borderColor: styles === null || styles === void 0 ? void 0 : (_styles$Btn4 = styles.Btn) === null || _styles$Btn4 === void 0 ? void 0 : _styles$Btn4.background
|
|
8141
|
+
},
|
|
8142
|
+
'& .MuiPaginationItem-root.Mui-selected:hover': {
|
|
8143
|
+
backgroundColor: (styles === null || styles === void 0 ? void 0 : (_styles$Btn5 = styles.Btn) === null || _styles$Btn5 === void 0 ? void 0 : _styles$Btn5.background) + '80',
|
|
8144
|
+
color: (styles === null || styles === void 0 ? void 0 : (_styles$Btn6 = styles.Btn) === null || _styles$Btn6 === void 0 ? void 0 : _styles$Btn6.color) || '#fff',
|
|
8145
|
+
borderColor: styles === null || styles === void 0 ? void 0 : (_styles$Btn7 = styles.Btn) === null || _styles$Btn7 === void 0 ? void 0 : _styles$Btn7.background
|
|
8146
|
+
}
|
|
8147
|
+
},
|
|
8148
|
+
showFirstButton: true,
|
|
8149
|
+
showLastButton: true
|
|
8150
|
+
}), /*#__PURE__*/React__default.createElement(FormControl, {
|
|
8151
|
+
size: "small",
|
|
8152
|
+
sx: {
|
|
8153
|
+
minWidth: 120
|
|
8154
|
+
}
|
|
8155
|
+
}, /*#__PURE__*/React__default.createElement(Select$1, {
|
|
8156
|
+
value: rowsPerPage,
|
|
8157
|
+
onChange: function onChange(e) {
|
|
8158
|
+
setRowsPerPage(Number(e.target.value));
|
|
8159
|
+
setPage(1);
|
|
8160
|
+
},
|
|
8161
|
+
sx: {
|
|
8162
|
+
'& .MuiSelect-select': {
|
|
8163
|
+
backgroundColor: '#ffffff',
|
|
8164
|
+
borderRadius: '5px',
|
|
8165
|
+
borderColor: (styles === null || styles === void 0 ? void 0 : (_styles$Btn8 = styles.Btn) === null || _styles$Btn8 === void 0 ? void 0 : _styles$Btn8.background) || '#d3d3d3'
|
|
8166
|
+
}
|
|
8167
|
+
}
|
|
8168
|
+
}, PAGE_SIZE_OPTIONS$1.map(function (size) {
|
|
8169
|
+
return /*#__PURE__*/React__default.createElement(MenuItem, {
|
|
8170
|
+
key: size,
|
|
8171
|
+
value: size
|
|
8172
|
+
}, size, " per page");
|
|
8173
|
+
})))));
|
|
8023
8174
|
};
|
|
8024
8175
|
|
|
8025
8176
|
var _templateObject$v, _templateObject2$n, _templateObject3$h, _templateObject4$e, _templateObject5$a, _templateObject6$8, _templateObject7$6, _templateObject8$4;
|
|
@@ -8661,7 +8812,7 @@ var CartDrawer = function CartDrawer(_ref) {
|
|
|
8661
8812
|
width: '100%',
|
|
8662
8813
|
boxSizing: 'border-box'
|
|
8663
8814
|
}
|
|
8664
|
-
}, (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, {
|
|
8815
|
+
}, loading || (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, {
|
|
8665
8816
|
opacity: loading ? '.4' : '1'
|
|
8666
8817
|
}, loading && /*#__PURE__*/React__default.createElement(CartDrawerLoader, null, /*#__PURE__*/React__default.createElement(PuffLoader, {
|
|
8667
8818
|
color: "black"
|
|
@@ -11029,7 +11180,7 @@ var CheckoutSummary = function CheckoutSummary(_ref) {
|
|
|
11029
11180
|
}, renderMoney(orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.adjustmentValue))));
|
|
11030
11181
|
};
|
|
11031
11182
|
|
|
11032
|
-
var _templateObject$M, _templateObject2$x, _templateObject3$o, _templateObject4$j, _templateObject5$f, _templateObject6$d, _templateObject7$9, _templateObject8$7, _templateObject9$5, _templateObject10$
|
|
11183
|
+
var _templateObject$M, _templateObject2$x, _templateObject3$o, _templateObject4$j, _templateObject5$f, _templateObject6$d, _templateObject7$9, _templateObject8$7, _templateObject9$5, _templateObject10$3, _templateObject11$2, _templateObject12$1, _templateObject13$1, _templateObject14$1, _templateObject15$1, _templateObject16$1, _templateObject17$1, _templateObject18$1;
|
|
11033
11184
|
var StepContainer = styled.div(_templateObject$M || (_templateObject$M = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: 60em;\n background: white;\n padding: 1em 2em;\n background: #ffffff;\n border-radius: 20px;\n margin-left: 2em;\n margin-top: -2em;\n margin-bottom: 1em;\n // @media screen and (max-width: 1200px) {\n // width: 80vw;\n // min-width: 0;\n // }\n @media screen and (max-width: 768px) {\n // width: 96%;\n margin-left: 1em;\n padding: 0.8em;\n }\n @media screen and (max-width: 600px) {\n // width: 94%;\n margin-left: 1.2em;\n }\n"])));
|
|
11034
11185
|
var StepsContent = styled.div(_templateObject2$x || (_templateObject2$x = _taggedTemplateLiteralLoose(["\n padding-left: 1.565em;\n min-height: max-content;\n .MuiOutlinedInput-root {\n background: ", ";\n }\n\n p {\n font-size: 0.75em;\n }\n .bold {\n text-transform: uppercase;\n word-spacing: 5px;\n margin-top: 0.95em;\n span {\n font-weight: 600;\n cursor: pointer;\n font-size: 0.94rem;\n }\n .red {\n color: ", ";\n }\n }\n @media screen and (max-width: 768px) {\n padding: 0;\n width: 100%;\n }\n"])), function (props) {
|
|
11035
11186
|
return 'transparent' + '!important';
|
|
@@ -11101,7 +11252,7 @@ var CheckBoxRow = styled.div(_templateObject9$5 || (_templateObject9$5 = _tagged
|
|
|
11101
11252
|
}, function (prop) {
|
|
11102
11253
|
return prop.colorText || 'red';
|
|
11103
11254
|
});
|
|
11104
|
-
var CreditCardFextField = styled.div(_templateObject10$
|
|
11255
|
+
var CreditCardFextField = styled.div(_templateObject10$3 || (_templateObject10$3 = _taggedTemplateLiteralLoose(["\n label {\n color: rgba(107, 106, 106, 0.6) !important;\n }\n .MuiOutlinedInput-root {\n background: ", ";\n }\n .save-btn {\n background: ", ";\n }\n"])), function (prop) {
|
|
11105
11256
|
return prop.bgInput + '!important' || '';
|
|
11106
11257
|
}, function (prop) {
|
|
11107
11258
|
return prop.btnBg + '!important' || '';
|