@salesgenterp/ui-components 0.4.563 → 0.4.566
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 +1837 -224
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1858 -246
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Skeleton as Skeleton$1, CircularProgress, TextField, Button, IconButton, Stack, Typography, Grid, InputAdornment, Popover, TableHead, TableRow, TableSortLabel, Paper, TableContainer as TableContainer$4, Table, TableBody, TableCell, TablePagination, Dialog, DialogTitle as DialogTitle$1, DialogContent, DialogActions, RadioGroup, Radio, FormControlLabel, FormLabel, FormControl, FormHelperText, Select as Select$1, InputLabel, MenuItem, CardMedia, Divider, Tabs, Box, Tab, CardContent, ListItemIcon, ListItem, Collapse, List, ListItemText,
|
|
2
|
-
import { styled as styled$1 } from '@mui/material/styles';
|
|
1
|
+
import { Skeleton as Skeleton$1, CircularProgress, TextField, Button, IconButton, Stack, Typography, Grid, InputAdornment, Popover, TableHead, TableRow, TableSortLabel, Paper, TableContainer as TableContainer$4, Table, TableBody, TableCell, TablePagination, Dialog, DialogTitle as DialogTitle$1, DialogContent, DialogActions, RadioGroup, Radio, FormControlLabel, FormLabel, FormControl, FormHelperText, Select as Select$1, InputLabel, MenuItem, Checkbox, CardMedia, Divider, Tabs, Box, Tab, CardContent, ListItemIcon, ListItem, Collapse, List, ListItemText, Card as Card$1, CardHeader as CardHeader$1, CssBaseline, Toolbar, Drawer, useMediaQuery as useMediaQuery$1, Tooltip, Pagination, ClickAwayListener, CardActionArea, Avatar as Avatar$1, alpha, Stepper, Step, StepLabel, StepContent, Container as Container$4, Slider as Slider$1 } from '@mui/material';
|
|
2
|
+
import { styled as styled$1, alpha as alpha$1 } from '@mui/material/styles';
|
|
3
3
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
4
|
-
import React__default, { useState, useEffect, forwardRef, useRef, memo, useMemo, createElement, useCallback, Fragment as Fragment$1 } from 'react';
|
|
4
|
+
import React__default, { useState, useEffect, forwardRef, useRef, memo, useMemo, createElement, useCallback, Fragment as Fragment$1, useContext } from 'react';
|
|
5
5
|
import { MdVisibilityOff, MdVisibility, MdPrint, MdClose, MdMonetizationOn, MdOutlineStorefront, MdRemoveRedEye, MdOutlineFileDownload, MdPersonOutline, MdOutlineCall, MdMailOutline, MdExpandMore, MdExpandLess, MdStore, MdOutlineMenuOpen, MdMenu, MdDarkMode, MdOutlineDarkMode, MdLocalOffer, MdDelete, MdCheckCircle, MdArrowBack, MdOutlineCircle, MdOutlineStickyNote2, MdOutlineNumbers, MdDateRange, MdOutlineWarehouse } from 'react-icons/md';
|
|
6
|
-
import styled, { css, ThemeProvider, keyframes } from 'styled-components';
|
|
7
|
-
import { isEmpty, isString, toNumber, reduce, concat, omit, replace, template, isArray, some, toLower, isPlainObject,
|
|
6
|
+
import styled, { css, ThemeProvider, keyframes, ThemeContext } from 'styled-components';
|
|
7
|
+
import { isEmpty, isString, toNumber, includes, reduce, concat, omit, replace, template, isArray, some, toLower, isPlainObject, values, cloneDeep, filter, sortBy, isObject, sumBy, get, isNumber } from 'lodash';
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
import moment from 'moment';
|
|
10
10
|
import qs from 'qs';
|
|
@@ -12,7 +12,7 @@ import Cookies from 'js-cookie';
|
|
|
12
12
|
import Alert from '@mui/material/Alert';
|
|
13
13
|
import AlertTitle from '@mui/material/AlertTitle';
|
|
14
14
|
import { Controller, useForm } from 'react-hook-form';
|
|
15
|
-
import { AiOutlinePlus, AiOutlineRise, AiOutlineShoppingCart, AiOutlineCreditCard, AiOutlineLeft, AiOutlineRight, AiOutlineMinus, AiOutlineDelete, AiOutlineHome, AiOutlineShop, AiOutlineCheckCircle, AiOutlineCheck, AiFillEyeInvisible, AiFillEye } from 'react-icons/ai';
|
|
15
|
+
import { AiOutlinePlus, AiOutlineRise, AiOutlineShoppingCart, AiOutlineCreditCard, AiOutlineLeft, AiOutlineRight, AiOutlineMinus, AiOutlineDelete, AiOutlineInfoCircle, AiOutlineHome, AiOutlineShop, AiOutlineCheckCircle, AiOutlineCheck, AiFillEyeInvisible, AiFillEye } from 'react-icons/ai';
|
|
16
16
|
import { FaRegUser, FaFacebookF, FaInstagram, FaTwitter, FaLinkedinIn, FaYoutube, FaCalendarCheck, FaUserAlt, FaLock, FaTools } from 'react-icons/fa';
|
|
17
17
|
import { GiCardboardBoxClosed } from 'react-icons/gi';
|
|
18
18
|
import { GrStackOverflow, GrClose, GrRadialSelected } from 'react-icons/gr';
|
|
@@ -31,7 +31,7 @@ import { BsFileEarmarkImage, BsFileEarmarkPdf, BsCartX } from 'react-icons/bs';
|
|
|
31
31
|
import { TfiMenuAlt } from 'react-icons/tfi';
|
|
32
32
|
import { GoNumber } from 'react-icons/go';
|
|
33
33
|
import { RiAccountBoxLine, RiHome7Line, RiFileTextLine, RiDiscountPercentLine, RiDeleteBin5Line } from 'react-icons/ri';
|
|
34
|
-
import Checkbox from '@mui/material/Checkbox';
|
|
34
|
+
import Checkbox$1 from '@mui/material/Checkbox';
|
|
35
35
|
import FormControl$1 from '@mui/material/FormControl';
|
|
36
36
|
import InputLabel$1 from '@mui/material/InputLabel';
|
|
37
37
|
import MenuItem$1 from '@mui/material/MenuItem';
|
|
@@ -469,6 +469,11 @@ var jsonParse = function jsonParse(value) {
|
|
|
469
469
|
var convertToBoolean = function convertToBoolean(value) {
|
|
470
470
|
return toNumber(value) === 1;
|
|
471
471
|
};
|
|
472
|
+
var inDevelopment = function inDevelopment() {
|
|
473
|
+
if (typeof window === 'undefined') return false;
|
|
474
|
+
var list = ['localhost', 'calikulture-git-develop-salesgent-techgrow.vercel.app', 'calikulture-git-staging-salesgent-techgrow.vercel.app', 'aa-cell-sc-git-develop-salesgent-techgrow.vercel.app', 'aa-cell-sc-git-staging-salesgent-techgrow.vercel.app'];
|
|
475
|
+
return includes(list, window.location.hostname);
|
|
476
|
+
};
|
|
472
477
|
|
|
473
478
|
function useSystemFeatureList(_ref) {
|
|
474
479
|
var apiEndPoint = _ref.apiEndPoint,
|
|
@@ -3258,6 +3263,123 @@ var ExcessPaymentDialog = function ExcessPaymentDialog(_ref2) {
|
|
|
3258
3263
|
})));
|
|
3259
3264
|
};
|
|
3260
3265
|
|
|
3266
|
+
var CloneOrderDialog = function CloneOrderDialog(_ref) {
|
|
3267
|
+
var visible = _ref.visible,
|
|
3268
|
+
onClose = _ref.onClose,
|
|
3269
|
+
onSubmit = _ref.onSubmit,
|
|
3270
|
+
loading = _ref.loading,
|
|
3271
|
+
styles = _ref.styles;
|
|
3272
|
+
var _useState = useState(null),
|
|
3273
|
+
combineProduct = _useState[0],
|
|
3274
|
+
setCombineProduct = _useState[1];
|
|
3275
|
+
useEffect(function () {
|
|
3276
|
+
if (!visible) {
|
|
3277
|
+
setCombineProduct(null);
|
|
3278
|
+
}
|
|
3279
|
+
}, [visible]);
|
|
3280
|
+
var checkboxSx = {
|
|
3281
|
+
'&.Mui-checked': {
|
|
3282
|
+
color: styles === null || styles === void 0 ? void 0 : styles.primaryColor
|
|
3283
|
+
}
|
|
3284
|
+
};
|
|
3285
|
+
return /*#__PURE__*/React__default.createElement(Dialog, {
|
|
3286
|
+
open: !!visible,
|
|
3287
|
+
onClose: loading ? undefined : function () {
|
|
3288
|
+
return onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
3289
|
+
},
|
|
3290
|
+
fullWidth: true,
|
|
3291
|
+
maxWidth: "xs"
|
|
3292
|
+
}, /*#__PURE__*/React__default.createElement(DialogTitle$1, null, "Clone Order"), /*#__PURE__*/React__default.createElement(DialogContent, null, /*#__PURE__*/React__default.createElement(Typography, {
|
|
3293
|
+
sx: {
|
|
3294
|
+
fontWeight: 600,
|
|
3295
|
+
mb: 1
|
|
3296
|
+
}
|
|
3297
|
+
}, "Do you want to combine the products?"), /*#__PURE__*/React__default.createElement(Typography, {
|
|
3298
|
+
variant: "body2",
|
|
3299
|
+
sx: {
|
|
3300
|
+
mb: 1
|
|
3301
|
+
}
|
|
3302
|
+
}, "Some products in this order may already be in your cart. Choose how their quantities should be handled:"), /*#__PURE__*/React__default.createElement(Typography, {
|
|
3303
|
+
component: "ul",
|
|
3304
|
+
variant: "body2",
|
|
3305
|
+
sx: {
|
|
3306
|
+
pl: 2.5,
|
|
3307
|
+
mb: 1
|
|
3308
|
+
}
|
|
3309
|
+
}, /*#__PURE__*/React__default.createElement("li", null, /*#__PURE__*/React__default.createElement("b", null, "Yes"), " - add the order quantity to what is already in your cart."), /*#__PURE__*/React__default.createElement("li", null, /*#__PURE__*/React__default.createElement("b", null, "No"), " - replace the cart quantity with the order quantity.")), /*#__PURE__*/React__default.createElement(Typography, {
|
|
3310
|
+
variant: "body2",
|
|
3311
|
+
sx: {
|
|
3312
|
+
mb: 1,
|
|
3313
|
+
p: 1.5,
|
|
3314
|
+
borderRadius: 1,
|
|
3315
|
+
bgcolor: 'action.hover'
|
|
3316
|
+
}
|
|
3317
|
+
}, /*#__PURE__*/React__default.createElement("b", null, "Example:"), " Your cart has 5 of Product X and this order has 10 of Product X.", /*#__PURE__*/React__default.createElement("br", null), "Yes \u2192 your cart will have ", /*#__PURE__*/React__default.createElement("b", null, "15"), " (5 + 10).", /*#__PURE__*/React__default.createElement("br", null), "No \u2192 your cart will have ", /*#__PURE__*/React__default.createElement("b", null, "10"), "."), /*#__PURE__*/React__default.createElement(Grid, {
|
|
3318
|
+
container: true,
|
|
3319
|
+
spacing: 2
|
|
3320
|
+
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
3321
|
+
item: true
|
|
3322
|
+
}, /*#__PURE__*/React__default.createElement(FormControlLabel, {
|
|
3323
|
+
label: "Yes",
|
|
3324
|
+
control: /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
3325
|
+
checked: combineProduct === true,
|
|
3326
|
+
onChange: function onChange() {
|
|
3327
|
+
return setCombineProduct(true);
|
|
3328
|
+
},
|
|
3329
|
+
disabled: loading,
|
|
3330
|
+
sx: checkboxSx
|
|
3331
|
+
})
|
|
3332
|
+
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
3333
|
+
item: true
|
|
3334
|
+
}, /*#__PURE__*/React__default.createElement(FormControlLabel, {
|
|
3335
|
+
label: "No",
|
|
3336
|
+
control: /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
3337
|
+
checked: combineProduct === false,
|
|
3338
|
+
onChange: function onChange() {
|
|
3339
|
+
return setCombineProduct(false);
|
|
3340
|
+
},
|
|
3341
|
+
disabled: loading,
|
|
3342
|
+
sx: checkboxSx
|
|
3343
|
+
})
|
|
3344
|
+
}))), /*#__PURE__*/React__default.createElement(DialogActions, {
|
|
3345
|
+
sx: {
|
|
3346
|
+
justifyContent: 'center',
|
|
3347
|
+
px: 0,
|
|
3348
|
+
pt: 2
|
|
3349
|
+
}
|
|
3350
|
+
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
3351
|
+
container: true,
|
|
3352
|
+
spacing: 4,
|
|
3353
|
+
alignItems: "center",
|
|
3354
|
+
justifyContent: "center"
|
|
3355
|
+
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
3356
|
+
item: true
|
|
3357
|
+
}, /*#__PURE__*/React__default.createElement(MuiButton, {
|
|
3358
|
+
primaryColor: combineProduct !== null && (styles === null || styles === void 0 ? void 0 : styles.primaryColor),
|
|
3359
|
+
sx: {
|
|
3360
|
+
fontSize: '1.3rem'
|
|
3361
|
+
},
|
|
3362
|
+
onClick: function onClick() {
|
|
3363
|
+
return onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(combineProduct);
|
|
3364
|
+
},
|
|
3365
|
+
loading: loading,
|
|
3366
|
+
disabled: combineProduct === null,
|
|
3367
|
+
size: "small"
|
|
3368
|
+
}, "Submit")), /*#__PURE__*/React__default.createElement(Grid, {
|
|
3369
|
+
item: true
|
|
3370
|
+
}, /*#__PURE__*/React__default.createElement(MuiButton, {
|
|
3371
|
+
primaryColor: styles === null || styles === void 0 ? void 0 : styles.primaryColor,
|
|
3372
|
+
sx: {
|
|
3373
|
+
fontSize: '1.3rem'
|
|
3374
|
+
},
|
|
3375
|
+
onClick: function onClick() {
|
|
3376
|
+
return onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
3377
|
+
},
|
|
3378
|
+
disabled: loading,
|
|
3379
|
+
size: "small"
|
|
3380
|
+
}, "Cancel"))))));
|
|
3381
|
+
};
|
|
3382
|
+
|
|
3261
3383
|
var _templateObject$b, _templateObject2$6, _templateObject3$4, _templateObject4$2, _templateObject5$1, _templateObject6$1, _templateObject7$1, _templateObject8$1, _templateObject9$1, _templateObject10$1, _templateObject11$1, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19;
|
|
3262
3384
|
var totalIcons = [{
|
|
3263
3385
|
name: '',
|
|
@@ -3337,6 +3459,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3337
3459
|
showOnlyRecentOrder = _ref$showOnlyRecentOr === void 0 ? false : _ref$showOnlyRecentOr,
|
|
3338
3460
|
hidePayActionButton = _ref.hidePayActionButton,
|
|
3339
3461
|
paymentProvider = _ref.paymentProvider;
|
|
3462
|
+
var showCloneOrderButton = inDevelopment();
|
|
3340
3463
|
var _useState = useState({}),
|
|
3341
3464
|
customerData = _useState[0],
|
|
3342
3465
|
setCustomerData = _useState[1];
|
|
@@ -3385,6 +3508,14 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3385
3508
|
}),
|
|
3386
3509
|
invoicePreview = _useState8[0],
|
|
3387
3510
|
setInvoicePreview = _useState8[1];
|
|
3511
|
+
var _useState9 = useState({
|
|
3512
|
+
open: false
|
|
3513
|
+
}),
|
|
3514
|
+
cloneOrderDialog = _useState9[0],
|
|
3515
|
+
setCloneOrderDialog = _useState9[1];
|
|
3516
|
+
var _useState10 = useState(false),
|
|
3517
|
+
cloneOrderLoading = _useState10[0],
|
|
3518
|
+
setCloneOrderLoading = _useState10[1];
|
|
3388
3519
|
var _ref2 = useSystemFeatureByFieldName({
|
|
3389
3520
|
apiEndPoint: apiEndPoint,
|
|
3390
3521
|
token: token,
|
|
@@ -3412,9 +3543,9 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3412
3543
|
return featureName ? DASHBOARD_ORDER_LIST_BY_NAME === null || DASHBOARD_ORDER_LIST_BY_NAME === void 0 ? void 0 : DASHBOARD_ORDER_LIST_BY_NAME[featureName] : null;
|
|
3413
3544
|
}).filter(Boolean);
|
|
3414
3545
|
}, [selectedDashboardOrderIds, featureValueListById]);
|
|
3415
|
-
var
|
|
3416
|
-
value =
|
|
3417
|
-
setValue =
|
|
3546
|
+
var _useState11 = useState(null),
|
|
3547
|
+
value = _useState11[0],
|
|
3548
|
+
setValue = _useState11[1];
|
|
3418
3549
|
useEffect(function () {
|
|
3419
3550
|
if (!(visibleTabs !== null && visibleTabs !== void 0 && visibleTabs.length)) return;
|
|
3420
3551
|
var isCurrentVisible = value != null && visibleTabs.some(function (tab) {
|
|
@@ -3497,6 +3628,74 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3497
3628
|
return Promise.reject(e);
|
|
3498
3629
|
}
|
|
3499
3630
|
};
|
|
3631
|
+
var closeCloneOrderDialog = function closeCloneOrderDialog() {
|
|
3632
|
+
if (cloneOrderLoading) return;
|
|
3633
|
+
setCloneOrderDialog({
|
|
3634
|
+
open: false
|
|
3635
|
+
});
|
|
3636
|
+
};
|
|
3637
|
+
var handleCloneOrder = function handleCloneOrder(combineProduct) {
|
|
3638
|
+
try {
|
|
3639
|
+
var documentType = cloneOrderDialog.documentType,
|
|
3640
|
+
documentId = cloneOrderDialog.documentId;
|
|
3641
|
+
if (documentId == null || cloneOrderLoading) return Promise.resolve();
|
|
3642
|
+
setCloneOrderLoading(true);
|
|
3643
|
+
var _temp = _finallyRethrows(function () {
|
|
3644
|
+
return _catch(function () {
|
|
3645
|
+
return Promise.resolve(API({
|
|
3646
|
+
url: "/ecommerce/addToCart",
|
|
3647
|
+
method: 'post',
|
|
3648
|
+
apiEndPoint: apiEndPoint,
|
|
3649
|
+
token: token,
|
|
3650
|
+
body: {
|
|
3651
|
+
documentType: documentType,
|
|
3652
|
+
combineProduct: !!combineProduct,
|
|
3653
|
+
documentId: String(documentId),
|
|
3654
|
+
storeId: defaultStoreId != null ? String(defaultStoreId) : undefined
|
|
3655
|
+
}
|
|
3656
|
+
})).then(function () {
|
|
3657
|
+
setCloneOrderDialog({
|
|
3658
|
+
open: false
|
|
3659
|
+
});
|
|
3660
|
+
alert('Order items added to cart successfully.');
|
|
3661
|
+
window.location.reload();
|
|
3662
|
+
});
|
|
3663
|
+
}, function () {});
|
|
3664
|
+
}, function (_wasThrown, _result) {
|
|
3665
|
+
setCloneOrderLoading(false);
|
|
3666
|
+
if (_wasThrown) throw _result;
|
|
3667
|
+
return _result;
|
|
3668
|
+
});
|
|
3669
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
3670
|
+
} catch (e) {
|
|
3671
|
+
return Promise.reject(e);
|
|
3672
|
+
}
|
|
3673
|
+
};
|
|
3674
|
+
var getCloneOrderColumn = function getCloneOrderColumn(_ref3) {
|
|
3675
|
+
var documentType = _ref3.documentType,
|
|
3676
|
+
idKey = _ref3.idKey;
|
|
3677
|
+
return {
|
|
3678
|
+
id: 'cloneOrder',
|
|
3679
|
+
label: 'Clone Order',
|
|
3680
|
+
align: 'center',
|
|
3681
|
+
format: function format(_value, record) {
|
|
3682
|
+
return /*#__PURE__*/React__default.createElement(MuiButton, {
|
|
3683
|
+
primaryColor: (record === null || record === void 0 ? void 0 : record[idKey]) != null && primaryColor,
|
|
3684
|
+
disabled: (record === null || record === void 0 ? void 0 : record[idKey]) == null,
|
|
3685
|
+
onClick: function onClick() {
|
|
3686
|
+
return setCloneOrderDialog({
|
|
3687
|
+
open: true,
|
|
3688
|
+
documentType: documentType,
|
|
3689
|
+
documentId: record === null || record === void 0 ? void 0 : record[idKey]
|
|
3690
|
+
});
|
|
3691
|
+
},
|
|
3692
|
+
style: {
|
|
3693
|
+
whiteSpace: 'nowrap'
|
|
3694
|
+
}
|
|
3695
|
+
}, "Clone Order");
|
|
3696
|
+
}
|
|
3697
|
+
};
|
|
3698
|
+
};
|
|
3500
3699
|
var columns = [{
|
|
3501
3700
|
id: 'orderId',
|
|
3502
3701
|
label: 'Invoice #'
|
|
@@ -3586,7 +3785,10 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3586
3785
|
disabled: (record === null || record === void 0 ? void 0 : record.dueBalance) <= 0
|
|
3587
3786
|
}, "Pay"));
|
|
3588
3787
|
}
|
|
3589
|
-
}]
|
|
3788
|
+
}].concat(showCloneOrderButton ? [getCloneOrderColumn({
|
|
3789
|
+
documentType: 'ORDER',
|
|
3790
|
+
idKey: 'orderId'
|
|
3791
|
+
})] : []);
|
|
3590
3792
|
var salesOrderColumns = [{
|
|
3591
3793
|
id: 'salesOrderId',
|
|
3592
3794
|
label: 'SO #'
|
|
@@ -3640,7 +3842,10 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3640
3842
|
}
|
|
3641
3843
|
})));
|
|
3642
3844
|
}
|
|
3643
|
-
}]
|
|
3845
|
+
}].concat(showCloneOrderButton ? [getCloneOrderColumn({
|
|
3846
|
+
documentType: 'SALES_ORDER',
|
|
3847
|
+
idKey: 'salesOrderId'
|
|
3848
|
+
})] : []);
|
|
3644
3849
|
var quotaionColumns = [{
|
|
3645
3850
|
id: 'quotationId',
|
|
3646
3851
|
label: 'ID'
|
|
@@ -3688,7 +3893,10 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3688
3893
|
}
|
|
3689
3894
|
})));
|
|
3690
3895
|
}
|
|
3691
|
-
}]
|
|
3896
|
+
}].concat(showCloneOrderButton ? [getCloneOrderColumn({
|
|
3897
|
+
documentType: 'QUOTATION',
|
|
3898
|
+
idKey: 'quotationId'
|
|
3899
|
+
})] : []);
|
|
3692
3900
|
var returnOrderColumns = [{
|
|
3693
3901
|
id: 'returnOrderId',
|
|
3694
3902
|
label: 'ID'
|
|
@@ -3739,7 +3947,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3739
3947
|
useEffect(function () {
|
|
3740
3948
|
(function () {
|
|
3741
3949
|
try {
|
|
3742
|
-
var
|
|
3950
|
+
var _temp2 = _catch(function () {
|
|
3743
3951
|
return Promise.resolve(API({
|
|
3744
3952
|
url: "/ecommerce/customer",
|
|
3745
3953
|
apiEndPoint: apiEndPoint,
|
|
@@ -3756,7 +3964,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3756
3964
|
});
|
|
3757
3965
|
});
|
|
3758
3966
|
}, function () {});
|
|
3759
|
-
return
|
|
3967
|
+
return _temp2 && _temp2.then ? _temp2.then(function () {}) : void 0;
|
|
3760
3968
|
} catch (e) {
|
|
3761
3969
|
Promise.reject(e);
|
|
3762
3970
|
}
|
|
@@ -3841,6 +4049,12 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3841
4049
|
orderId: isPaymentModal === null || isPaymentModal === void 0 ? void 0 : isPaymentModal.orderId,
|
|
3842
4050
|
setTriggerTableData: setTriggerTableData,
|
|
3843
4051
|
styles: styles
|
|
4052
|
+
}), /*#__PURE__*/React__default.createElement(CloneOrderDialog, {
|
|
4053
|
+
visible: !!(cloneOrderDialog !== null && cloneOrderDialog !== void 0 && cloneOrderDialog.open),
|
|
4054
|
+
onClose: closeCloneOrderDialog,
|
|
4055
|
+
onSubmit: handleCloneOrder,
|
|
4056
|
+
loading: cloneOrderLoading,
|
|
4057
|
+
styles: styles
|
|
3844
4058
|
}), (isExcessPaymentModal === null || isExcessPaymentModal === void 0 ? void 0 : isExcessPaymentModal.open) && /*#__PURE__*/React__default.createElement(ExcessPaymentDialog, {
|
|
3845
4059
|
excessPaymentToken: (_queryParams$excessPa = queryParams === null || queryParams === void 0 ? void 0 : queryParams.excessPayment) != null ? _queryParams$excessPa : '',
|
|
3846
4060
|
customerData: customerData,
|
|
@@ -4776,14 +4990,14 @@ function MuiSelect(_ref) {
|
|
|
4776
4990
|
value: ""
|
|
4777
4991
|
}, /*#__PURE__*/createElement("em", null, "None")), checkAllOption && multiple && /*#__PURE__*/createElement(MenuItem$1, {
|
|
4778
4992
|
value: 'all'
|
|
4779
|
-
}, /*#__PURE__*/createElement(Checkbox, {
|
|
4993
|
+
}, /*#__PURE__*/createElement(Checkbox$1, {
|
|
4780
4994
|
checked: checkAll,
|
|
4781
4995
|
indeterminate: indeterminate
|
|
4782
4996
|
}), "All"), options === null || options === void 0 ? void 0 : options.map(function (data) {
|
|
4783
4997
|
return /*#__PURE__*/createElement(MenuItem$1, {
|
|
4784
4998
|
value: valueKey ? data[valueKey] : data,
|
|
4785
4999
|
disabled: data === null || data === void 0 ? void 0 : data.disabled
|
|
4786
|
-
}, checkAllOption && multiple && /*#__PURE__*/createElement(Checkbox, {
|
|
5000
|
+
}, checkAllOption && multiple && /*#__PURE__*/createElement(Checkbox$1, {
|
|
4787
5001
|
checked: value.indexOf(valueKey ? data[valueKey] : data) > -1
|
|
4788
5002
|
}), getLabelValue({
|
|
4789
5003
|
labelKey: labelKey,
|
|
@@ -5086,7 +5300,7 @@ var FormCheckbox = function FormCheckbox(props) {
|
|
|
5086
5300
|
}
|
|
5087
5301
|
});
|
|
5088
5302
|
};
|
|
5089
|
-
var CheckboxField = styled(Checkbox
|
|
5303
|
+
var CheckboxField = styled(Checkbox)(_templateObject$g || (_templateObject$g = _taggedTemplateLiteralLoose(["\n svg {\n color: ", " !important;\n }\n"])), function (props) {
|
|
5090
5304
|
return props.primaryColor;
|
|
5091
5305
|
});
|
|
5092
5306
|
var FormControlLabelContainer$1 = styled(FormControlLabel)(_templateObject2$a || (_templateObject2$a = _taggedTemplateLiteralLoose(["\n .MuiTypography-root {\n color: ", " !important;\n }\n"])), function (props) {
|
|
@@ -9714,7 +9928,7 @@ var CardRow = function CardRow(_ref3) {
|
|
|
9714
9928
|
}
|
|
9715
9929
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
9716
9930
|
className: "borderLeft"
|
|
9717
|
-
}), /*#__PURE__*/React__default.createElement(Checkbox
|
|
9931
|
+
}), /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
9718
9932
|
size: "small",
|
|
9719
9933
|
color: "primary",
|
|
9720
9934
|
checked: isItemSelected,
|
|
@@ -9920,7 +10134,7 @@ function EnhancedTableHead(props) {
|
|
|
9920
10134
|
},
|
|
9921
10135
|
padding: "checkbox",
|
|
9922
10136
|
bg: styles === null || styles === void 0 ? void 0 : styles.bg
|
|
9923
|
-
}, /*#__PURE__*/createElement(Checkbox
|
|
10137
|
+
}, /*#__PURE__*/createElement(Checkbox, {
|
|
9924
10138
|
size: "small",
|
|
9925
10139
|
color: "primary",
|
|
9926
10140
|
indeterminate: numSelected > 0 && numSelected < rowCount,
|
|
@@ -11431,7 +11645,7 @@ var OutOfStock = function OutOfStock(_ref) {
|
|
|
11431
11645
|
}), /*#__PURE__*/React__default.createElement("span", null, subscribed ? 'Subscribed Successfully' : 'Subscribe')))))));
|
|
11432
11646
|
};
|
|
11433
11647
|
var VariantsContainer = styled.div(_templateObject$D || (_templateObject$D = _taggedTemplateLiteralLoose(["\n ::-webkit-scrollbar {\n -webkit-appearance: none;\n width: 5px;\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(178, 169, 169, 1);\n box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n }\n"])));
|
|
11434
|
-
var MainCheckbox = styled(Checkbox)(_templateObject2$t || (_templateObject2$t = _taggedTemplateLiteralLoose(["\n &.Mui-checked,\n &.MuiCheckbox-indeterminate {\n color: ", ";\n }\n"])), function (props) {
|
|
11648
|
+
var MainCheckbox = styled(Checkbox$1)(_templateObject2$t || (_templateObject2$t = _taggedTemplateLiteralLoose(["\n &.Mui-checked,\n &.MuiCheckbox-indeterminate {\n color: ", ";\n }\n"])), function (props) {
|
|
11435
11649
|
return props.theme.primaryColor;
|
|
11436
11650
|
});
|
|
11437
11651
|
var EmailInput = styled(InputBase)(_templateObject3$n || (_templateObject3$n = _taggedTemplateLiteralLoose(["\n border: 1px solid #a9a9a9;\n padding: 3px 10px;\n fontsize: 12px;\n width: 100%;\n border-radius: 3px;\n"])));
|
|
@@ -11939,36 +12153,69 @@ var AsyncSelect = function AsyncSelect(_ref3) {
|
|
|
11939
12153
|
return /*#__PURE__*/React__default.createElement(AsyncSelectField, props);
|
|
11940
12154
|
};
|
|
11941
12155
|
|
|
11942
|
-
var _templateObject$F;
|
|
12156
|
+
var _templateObject$F, _templateObject2$u, _templateObject3$o, _templateObject4$j, _templateObject5$f, _templateObject6$d, _templateObject7$a, _templateObject8$8;
|
|
12157
|
+
var DEFAULT_PRIMARY = '#424242';
|
|
12158
|
+
var getPrimary = function getPrimary(props) {
|
|
12159
|
+
var _props$theme;
|
|
12160
|
+
return (props === null || props === void 0 ? void 0 : (_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.primaryColor) || DEFAULT_PRIMARY;
|
|
12161
|
+
};
|
|
11943
12162
|
var Container$2 = styled.div(_templateObject$F || (_templateObject$F = _taggedTemplateLiteralLoose([""])));
|
|
12163
|
+
var TopBar = styled.div(_templateObject2$u || (_templateObject2$u = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 12px;\n margin-bottom: 12px;\n .search {\n flex: 1;\n min-width: 0;\n }\n @media only screen and (max-width: 600px) {\n flex-wrap: wrap;\n .search {\n flex-basis: 100%;\n }\n }\n"])));
|
|
12164
|
+
var LastOrderedWrapper = styled.div(_templateObject3$o || (_templateObject3$o = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 6px;\n margin-left: auto;\n flex-shrink: 0;\n"])));
|
|
12165
|
+
var LastOrderedButton = styled.button(_templateObject4$j || (_templateObject4$j = _taggedTemplateLiteralLoose(["\n height: 38px;\n padding: 0 16px;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n white-space: nowrap;\n font-weight: 500;\n color: #fff;\n background: ", ";\n transition: opacity 0.2s;\n &:hover {\n opacity: 0.9;\n }\n"])), function (props) {
|
|
12166
|
+
var _props$theme2;
|
|
12167
|
+
return ((_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : _props$theme2.primaryColor) || '#424242';
|
|
12168
|
+
});
|
|
12169
|
+
var InfoIcon = styled.span(_templateObject5$f || (_templateObject5$f = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n font-size: 1.25em;\n color: #6b6b6b;\n cursor: pointer;\n"])));
|
|
12170
|
+
var DialogFooterButton = styled.button(_templateObject6$d || (_templateObject6$d = _taggedTemplateLiteralLoose(["\n height: 38px;\n min-width: 100px;\n padding: 0 18px;\n border-radius: 4px;\n cursor: pointer;\n font-weight: 500;\n white-space: nowrap;\n border: 1px solid ", ";\n color: ", ";\n background: ", ";\n transition: opacity 0.2s;\n &:hover:not(:disabled) {\n opacity: 0.9;\n }\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n"])), function (props) {
|
|
12171
|
+
var _props$theme3;
|
|
12172
|
+
return ((_props$theme3 = props.theme) === null || _props$theme3 === void 0 ? void 0 : _props$theme3.primaryColor) || '#424242';
|
|
12173
|
+
}, function (props) {
|
|
12174
|
+
var _props$theme4;
|
|
12175
|
+
return props.variant === 'outlined' ? ((_props$theme4 = props.theme) === null || _props$theme4 === void 0 ? void 0 : _props$theme4.primaryColor) || '#424242' : '#fff';
|
|
12176
|
+
}, function (props) {
|
|
12177
|
+
var _props$theme5;
|
|
12178
|
+
return props.variant === 'outlined' ? '#fff' : ((_props$theme5 = props.theme) === null || _props$theme5 === void 0 ? void 0 : _props$theme5.primaryColor) || '#424242';
|
|
12179
|
+
});
|
|
12180
|
+
var DialogLoadMore = styled.div(_templateObject7$a || (_templateObject7$a = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n padding: 16px 0 4px;\n color: #6b6b6b;\n"])));
|
|
12181
|
+
var DialogFooter = styled.div(_templateObject8$8 || (_templateObject8$8 = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n flex-wrap: wrap;\n .pagination {\n display: flex;\n align-items: center;\n gap: 12px;\n flex-wrap: wrap;\n }\n .count {\n font-size: 0.85em;\n color: #6b6b6b;\n white-space: nowrap;\n }\n .buttons {\n display: flex;\n gap: 8px;\n margin-left: auto;\n }\n"])));
|
|
11944
12182
|
|
|
11945
|
-
var _templateObject$G, _templateObject2$
|
|
12183
|
+
var _templateObject$G, _templateObject2$v, _templateObject3$p, _templateObject4$k, _templateObject5$g, _templateObject6$e;
|
|
11946
12184
|
var ProductImage$1 = styled.img.attrs(function (props) {
|
|
11947
12185
|
return {
|
|
11948
12186
|
loading: props.loading || 'lazy',
|
|
11949
12187
|
decoding: 'async'
|
|
11950
12188
|
};
|
|
11951
|
-
})(_templateObject$G || (_templateObject$G = _taggedTemplateLiteralLoose(["\n min-width: 50px;\n min-height: 50px;\n object-fit: contain;\n
|
|
11952
|
-
var ProductName$1 = styled.h6(_templateObject2$
|
|
12189
|
+
})(_templateObject$G || (_templateObject$G = _taggedTemplateLiteralLoose(["\n min-width: 50px;\n min-height: 50px;\n object-fit: contain;\n"])));
|
|
12190
|
+
var ProductName$1 = styled.h6(_templateObject2$v || (_templateObject2$v = _taggedTemplateLiteralLoose(["\n font-size: ", ";\n padding: 0;\n line-height: 1.3em;\n max-height: ", ";\n height: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n height: fit-content;\n"])), function (props) {
|
|
11953
12191
|
return props.size || '1em';
|
|
11954
12192
|
}, function (props) {
|
|
11955
12193
|
return props.maxHeight ? props.maxHeight + "em" : '2.75em';
|
|
11956
12194
|
}, function (props) {
|
|
11957
12195
|
return props.maxHeight ? props.maxHeight + "em" : '2.80em';
|
|
11958
12196
|
});
|
|
11959
|
-
var CartTableRow$1 = styled(TableRow)(_templateObject3$
|
|
12197
|
+
var CartTableRow$1 = styled(TableRow)(_templateObject3$p || (_templateObject3$p = _taggedTemplateLiteralLoose(["\n position: relative;\n transition: 0.3s;\n background: ", ";\n cursor: pointer;\n /* &:hover {\n td:first-child,\n td:last-child {\n border-left-style: solid;\n border-top-style: solid;\n border-top-right-radius: 10px;\n }\n } */\n .outOfStock {\n font-size: 0.75em;\n color: red;\n text-transform: uppercase;\n font-weight: 500;\n }\n .price {\n font-size: ", ";\n font-weight: bold;\n color: #323232;\n /* font-size: 1.15em; */\n }\n .borderLeft {\n height: 100%;\n background: ", ";\n transition: 0.2s;\n width: ", ";\n position: absolute;\n left: 0;\n top: 0;\n border-top-left-radius: 10px;\n display: ", ";\n border-bottom-left-radius: 10px;\n }\n .cartCheckBox {\n &.Mui-checked {\n svg {\n color: ", ";\n }\n }\n }\n &:hover {\n background: ", " !important;\n box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);\n border-radius: 10px;\n /* opacity: 1;\n box-shadow: 1px 2px 6px 2px rgba(0, 0, 0, 0.2); */\n z-index: 2;\n /* border-radius: 20px; */\n .borderLeft {\n width: 12px;\n display: inline-block;\n }\n }\n .mobileLabel {\n display: none;\n }\n .stock {\n font-size: 0.95em;\n font-weight: 600;\n color: #2e7d32;\n }\n .stock-out {\n color: #d32f2f;\n }\n /* Small screens: each row becomes a card.\n [check] [img] name ............ [delete]\n $price each\n [- qty +] Subtotal $x */\n @media only screen and (max-width: 768px) {\n display: grid;\n grid-template-columns: 32px 56px minmax(0, 1fr) auto;\n grid-template-areas:\n 'check img name delete'\n 'check img price stock'\n 'check qty qty subtotal';\n column-gap: 10px;\n row-gap: 6px;\n align-items: center;\n padding: 12px 10px;\n margin: 0 0 10px;\n border: 1px solid #ececec;\n border-radius: 10px;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);\n &:hover {\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);\n .borderLeft {\n display: none;\n }\n }\n > td,\n > th {\n display: block;\n width: auto;\n padding: 0 !important;\n text-align: left;\n }\n .cell-check {\n grid-area: check;\n align-self: start;\n }\n .cell-img {\n grid-area: img;\n align-self: start;\n img {\n width: 56px;\n height: 56px;\n margin: 0;\n padding: 0;\n }\n }\n .cell-name {\n grid-area: name;\n align-self: start;\n h6 {\n font-size: 0.9em;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n p {\n font-size: 0.8em;\n margin-top: 2px;\n }\n }\n .cell-price {\n grid-area: price;\n .price {\n font-size: 0.85em;\n font-weight: 500;\n color: #6b6b6b;\n }\n }\n .cell-stock {\n grid-area: stock;\n text-align: right;\n .stock {\n font-size: 0.8em;\n }\n }\n .cell-qty {\n grid-area: qty;\n justify-self: start;\n }\n .cell-subtotal {\n grid-area: subtotal;\n text-align: right;\n .price {\n font-size: 0.95em;\n }\n }\n .cell-delete {\n grid-area: delete;\n align-self: start;\n }\n .mobileLabel {\n display: inline;\n font-weight: 400;\n color: #6b6b6b;\n font-size: 0.85em;\n }\n .cartCheckBox {\n padding: 0;\n }\n }\n"])), function (props) {
|
|
12198
|
+
return props.$selected ? '#f7f8fa' : 'white';
|
|
12199
|
+
}, function (props) {
|
|
11960
12200
|
return props.size || '1.19em';
|
|
11961
12201
|
}, function (prop) {
|
|
11962
|
-
return prop.bg;
|
|
12202
|
+
return prop.bg || getPrimary(prop);
|
|
12203
|
+
}, function (props) {
|
|
12204
|
+
return props.$selected ? '4px' : '0px';
|
|
12205
|
+
}, function (props) {
|
|
12206
|
+
return props.$selected ? 'inline-block' : 'none';
|
|
11963
12207
|
}, function (prop) {
|
|
11964
|
-
return prop.bg;
|
|
12208
|
+
return prop.bg || getPrimary(prop);
|
|
12209
|
+
}, function (props) {
|
|
12210
|
+
return props.$selected ? '#f7f8fa' : 'white';
|
|
11965
12211
|
});
|
|
11966
|
-
var CartTableCell$2 = styled(TableCell)(_templateObject4$
|
|
11967
|
-
var QuantityBox$1 = styled.div(_templateObject5$
|
|
11968
|
-
var DeleteBtn$1 = styled.
|
|
12212
|
+
var CartTableCell$2 = styled(TableCell)(_templateObject4$k || (_templateObject4$k = _taggedTemplateLiteralLoose(["\n && {\n border: none !important;\n font-size: 1em;\n }\n"])));
|
|
12213
|
+
var QuantityBox$1 = styled.div(_templateObject5$g || (_templateObject5$g = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: stretch;\n height: 36px;\n border: 1px solid #dcdfe4;\n border-radius: 8px;\n overflow: hidden;\n background: #fff;\n transition: border-color 0.2s, box-shadow 0.2s;\n &:focus-within {\n border-color: ", ";\n box-shadow: 0 0 0 1px ", ";\n }\n .stepBtn {\n position: relative;\n isolation: isolate;\n width: 34px;\n display: grid;\n place-items: center;\n padding: 0;\n border: none;\n background: #fff;\n color: ", ";\n font-size: 14px;\n cursor: pointer;\n transition: color 0.15s;\n /* Light tint: the primary color at low opacity, behind the icon. */\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n z-index: -1;\n background: ", ";\n opacity: 0.1;\n transition: opacity 0.15s;\n }\n &:hover:not(:disabled) {\n color: #fff;\n &::before {\n opacity: 1;\n }\n }\n &:active:not(:disabled) {\n transform: scale(0.94);\n }\n &:disabled {\n cursor: not-allowed;\n color: #b8bcc4;\n background: #f4f5f7;\n &::before {\n display: none;\n }\n }\n &:focus-visible {\n outline: 2px solid ", ";\n outline-offset: -2px;\n }\n }\n input {\n width: 48px;\n border: none;\n border-left: 1px solid #dcdfe4;\n border-right: 1px solid #dcdfe4;\n outline: none;\n text-align: center;\n font-size: 14px;\n font-weight: 600;\n color: #2b2b2b;\n background: #fff;\n -moz-appearance: textfield;\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:disabled {\n color: #9aa0a6;\n }\n }\n @media only screen and (max-width: 768px) {\n height: 38px;\n .stepBtn {\n width: 38px;\n }\n }\n"])), getPrimary, getPrimary, getPrimary, getPrimary, getPrimary);
|
|
12214
|
+
var DeleteBtn$1 = styled.button(_templateObject6$e || (_templateObject6$e = _taggedTemplateLiteralLoose(["\n display: grid;\n place-items: center;\n cursor: pointer;\n border: none;\n border-radius: 8px;\n width: 32px;\n height: 32px;\n padding: 0;\n background: #f4f5f7;\n color: #6b7280;\n font-size: 16px;\n transition: background 0.2s, color 0.2s;\n &:hover {\n background: #fdecec;\n color: #d32f2f;\n }\n &:focus-visible {\n outline: 2px solid #d32f2f;\n outline-offset: 2px;\n }\n"])));
|
|
11969
12215
|
var CardRow$1 = function CardRow(_ref) {
|
|
11970
|
-
var _styles$price,
|
|
12216
|
+
var _styles$price, _row$availableQuantit;
|
|
11971
12217
|
var row = _ref.row,
|
|
12218
|
+
index = _ref.index,
|
|
11972
12219
|
isItemSelected = _ref.isItemSelected,
|
|
11973
12220
|
handleClick = _ref.handleClick,
|
|
11974
12221
|
imgnotfoundUrl = _ref.imgnotfoundUrl,
|
|
@@ -11978,9 +12225,60 @@ var CardRow$1 = function CardRow(_ref) {
|
|
|
11978
12225
|
imgSize = _ref.imgSize,
|
|
11979
12226
|
styles = _ref.styles,
|
|
11980
12227
|
_ref$allowToProcessIn = _ref.allowToProcessInvoiceForOutOfStockProductsEcommerce,
|
|
11981
|
-
allowToProcessInvoiceForOutOfStockProductsEcommerce = _ref$allowToProcessIn === void 0 ? false : _ref$allowToProcessIn
|
|
12228
|
+
allowToProcessInvoiceForOutOfStockProductsEcommerce = _ref$allowToProcessIn === void 0 ? false : _ref$allowToProcessIn,
|
|
12229
|
+
_ref$hideDelete = _ref.hideDelete,
|
|
12230
|
+
hideDelete = _ref$hideDelete === void 0 ? false : _ref$hideDelete,
|
|
12231
|
+
_ref$hideStock = _ref.hideStock,
|
|
12232
|
+
hideStock = _ref$hideStock === void 0 ? false : _ref$hideStock;
|
|
11982
12233
|
var imgnotfoundUrlcommon = noImgAvailable;
|
|
11983
12234
|
if (imgnotfoundUrl && imgnotfoundUrl !== 'null') imgnotfoundUrlcommon = imgnotfoundUrl;
|
|
12235
|
+
var onChangeQuantity = function onChangeQuantity(product) {
|
|
12236
|
+
if ((product === null || product === void 0 ? void 0 : product.quantity) <= 0 || !allowToProcessInvoiceForOutOfStockProductsEcommerce && (product === null || product === void 0 ? void 0 : product.availableQuantity) <= 0) {
|
|
12237
|
+
return handleRemoveProduct(product, index);
|
|
12238
|
+
}
|
|
12239
|
+
handleIncrementDecrement(product);
|
|
12240
|
+
};
|
|
12241
|
+
var timer = useRef();
|
|
12242
|
+
var _useState = useState(row === null || row === void 0 ? void 0 : row.quantity),
|
|
12243
|
+
quantity = _useState[0],
|
|
12244
|
+
setQuantity = _useState[1];
|
|
12245
|
+
useEffect(function () {
|
|
12246
|
+
setQuantity(row === null || row === void 0 ? void 0 : row.quantity);
|
|
12247
|
+
}, [row === null || row === void 0 ? void 0 : row.quantity]);
|
|
12248
|
+
useEffect(function () {
|
|
12249
|
+
return function () {
|
|
12250
|
+
return clearTimeout(timer.current);
|
|
12251
|
+
};
|
|
12252
|
+
}, []);
|
|
12253
|
+
var onChangeInput = function onChangeInput(e) {
|
|
12254
|
+
var value = e.target.value;
|
|
12255
|
+
setQuantity(value);
|
|
12256
|
+
clearTimeout(timer.current);
|
|
12257
|
+
if (value === '') return;
|
|
12258
|
+
timer.current = setTimeout(function () {
|
|
12259
|
+
var typedQty = parseInt(value, 10);
|
|
12260
|
+
if (!(typedQty > 0)) {
|
|
12261
|
+
handleRemoveProduct(row, index);
|
|
12262
|
+
setQuantity(row === null || row === void 0 ? void 0 : row.quantity);
|
|
12263
|
+
return;
|
|
12264
|
+
}
|
|
12265
|
+
var validQty = checkMinMaxQty({
|
|
12266
|
+
quantity: typedQty,
|
|
12267
|
+
product: row,
|
|
12268
|
+
allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce
|
|
12269
|
+
});
|
|
12270
|
+
setQuantity(validQty);
|
|
12271
|
+
onChangeQuantity(_extends({}, row, {
|
|
12272
|
+
quantity: validQty
|
|
12273
|
+
}));
|
|
12274
|
+
}, 500);
|
|
12275
|
+
};
|
|
12276
|
+
var onBlurInput = function onBlurInput() {
|
|
12277
|
+
if (quantity === '' || quantity === undefined) {
|
|
12278
|
+
clearTimeout(timer.current);
|
|
12279
|
+
setQuantity(row === null || row === void 0 ? void 0 : row.quantity);
|
|
12280
|
+
}
|
|
12281
|
+
};
|
|
11984
12282
|
return /*#__PURE__*/React__default.createElement(CartTableRow$1, {
|
|
11985
12283
|
onClick: function onClick(event) {
|
|
11986
12284
|
return handleClick(event, row);
|
|
@@ -11988,17 +12286,19 @@ var CardRow$1 = function CardRow(_ref) {
|
|
|
11988
12286
|
role: "checkbox",
|
|
11989
12287
|
"aria-checked": isItemSelected,
|
|
11990
12288
|
tabIndex: -1,
|
|
11991
|
-
key: row.
|
|
12289
|
+
key: row === null || row === void 0 ? void 0 : row.rowId,
|
|
11992
12290
|
size: styles === null || styles === void 0 ? void 0 : (_styles$price = styles.price) === null || _styles$price === void 0 ? void 0 : _styles$price.size,
|
|
11993
|
-
bg:
|
|
12291
|
+
bg: styles === null || styles === void 0 ? void 0 : styles.borderLeft,
|
|
12292
|
+
$selected: isItemSelected
|
|
11994
12293
|
}, /*#__PURE__*/React__default.createElement(CartTableCell$2, {
|
|
11995
12294
|
padding: "checkbox",
|
|
12295
|
+
className: "cell-check",
|
|
11996
12296
|
style: {
|
|
11997
12297
|
position: 'relative'
|
|
11998
12298
|
}
|
|
11999
12299
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
12000
12300
|
className: "borderLeft"
|
|
12001
|
-
}), /*#__PURE__*/React__default.createElement(Checkbox
|
|
12301
|
+
}), /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
12002
12302
|
size: "small",
|
|
12003
12303
|
color: "primary",
|
|
12004
12304
|
checked: isItemSelected,
|
|
@@ -12007,9 +12307,9 @@ var CardRow$1 = function CardRow(_ref) {
|
|
|
12007
12307
|
},
|
|
12008
12308
|
className: "cartCheckBox"
|
|
12009
12309
|
})), /*#__PURE__*/React__default.createElement(CartTableCell$2, {
|
|
12010
|
-
className: "
|
|
12310
|
+
className: "cell-img"
|
|
12011
12311
|
}, /*#__PURE__*/React__default.createElement(ProductImage$1, {
|
|
12012
|
-
src: row.imageUrl && row.imageUrl !== 'null' ? row.imageUrl : imgnotfoundUrlcommon,
|
|
12312
|
+
src: row !== null && row !== void 0 && row.imageUrl && (row === null || row === void 0 ? void 0 : row.imageUrl) !== 'null' ? row === null || row === void 0 ? void 0 : row.imageUrl : imgnotfoundUrlcommon,
|
|
12013
12313
|
alt: 'img',
|
|
12014
12314
|
width: (imgSize === null || imgSize === void 0 ? void 0 : imgSize.width) || 50,
|
|
12015
12315
|
height: (imgSize === null || imgSize === void 0 ? void 0 : imgSize.height) || 50
|
|
@@ -12017,60 +12317,93 @@ var CardRow$1 = function CardRow(_ref) {
|
|
|
12017
12317
|
component: "th",
|
|
12018
12318
|
id: row === null || row === void 0 ? void 0 : row.labelId,
|
|
12019
12319
|
scope: "row",
|
|
12020
|
-
padding: "none"
|
|
12021
|
-
|
|
12320
|
+
padding: "none",
|
|
12321
|
+
className: "cell-name"
|
|
12322
|
+
}, /*#__PURE__*/React__default.createElement(ProductName$1, null, row === null || row === void 0 ? void 0 : row.productName), !allowToProcessInvoiceForOutOfStockProductsEcommerce ? ((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) <= 0) && /*#__PURE__*/React__default.createElement("p", {
|
|
12022
12323
|
style: {
|
|
12023
12324
|
color: 'red',
|
|
12024
12325
|
fontWeight: 500
|
|
12025
12326
|
}
|
|
12026
|
-
}, "Maximum available quantity is ", row.availableQuantity) : /*#__PURE__*/React__default.createElement("div", null)), /*#__PURE__*/React__default.createElement(CartTableCell$2, {
|
|
12327
|
+
}, "Maximum available quantity is ", row === null || row === void 0 ? void 0 : row.availableQuantity) : /*#__PURE__*/React__default.createElement("div", null)), /*#__PURE__*/React__default.createElement(CartTableCell$2, {
|
|
12027
12328
|
align: "center",
|
|
12028
|
-
className: "
|
|
12329
|
+
className: "cell-price"
|
|
12029
12330
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
12030
12331
|
className: "price"
|
|
12031
|
-
}, "$", row === null || row === void 0 ? void 0 :
|
|
12032
|
-
|
|
12033
|
-
},
|
|
12332
|
+
}, "$", (Number(row === null || row === void 0 ? void 0 : row.standardPrice) || 0).toFixed(2), /*#__PURE__*/React__default.createElement("span", {
|
|
12333
|
+
className: "mobileLabel"
|
|
12334
|
+
}, " each"))), !hideStock && /*#__PURE__*/React__default.createElement(CartTableCell$2, {
|
|
12335
|
+
align: "center",
|
|
12336
|
+
className: "cell-stock"
|
|
12337
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
12338
|
+
className: "stock " + (Number(row === null || row === void 0 ? void 0 : row.availableQuantity) > 0 ? '' : 'stock-out')
|
|
12339
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
12340
|
+
className: "mobileLabel"
|
|
12341
|
+
}, "Stock: "), (_row$availableQuantit = row === null || row === void 0 ? void 0 : row.availableQuantity) != null ? _row$availableQuantit : '-')), /*#__PURE__*/React__default.createElement(CartTableCell$2, {
|
|
12342
|
+
align: "center",
|
|
12343
|
+
className: "cell-qty"
|
|
12344
|
+
}, /*#__PURE__*/React__default.createElement(QuantityBox$1, {
|
|
12345
|
+
onClick: function onClick(e) {
|
|
12346
|
+
return e.stopPropagation();
|
|
12347
|
+
}
|
|
12348
|
+
}, /*#__PURE__*/React__default.createElement("button", {
|
|
12349
|
+
type: "button",
|
|
12350
|
+
className: "stepBtn",
|
|
12351
|
+
"aria-label": "Decrease quantity",
|
|
12352
|
+
disabled: loading || hideDelete && (row === null || row === void 0 ? void 0 : row.quantity) <= 1,
|
|
12034
12353
|
onClick: function onClick(e) {
|
|
12035
12354
|
e.stopPropagation();
|
|
12036
12355
|
if (loading) return;
|
|
12037
|
-
if (!allowToProcessInvoiceForOutOfStockProductsEcommerce && (row === null || row === void 0 ? void 0 : row.availableQuantity) <= 0) {
|
|
12356
|
+
if (!allowToProcessInvoiceForOutOfStockProductsEcommerce && (row === null || row === void 0 ? void 0 : row.availableQuantity) <= 0 || (row === null || row === void 0 ? void 0 : row.quantity) === 1) {
|
|
12038
12357
|
return handleRemoveProduct(row, index);
|
|
12039
12358
|
}
|
|
12040
|
-
|
|
12041
|
-
quantity: (
|
|
12359
|
+
onChangeQuantity(_extends({}, row, {
|
|
12360
|
+
quantity: checkMinMaxQty({
|
|
12361
|
+
quantity: (row === null || row === void 0 ? void 0 : row.quantity) - 1,
|
|
12362
|
+
product: row,
|
|
12363
|
+
allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce
|
|
12364
|
+
})
|
|
12042
12365
|
}));
|
|
12043
12366
|
}
|
|
12044
|
-
}, /*#__PURE__*/React__default.createElement(AiOutlineMinus, {
|
|
12045
|
-
|
|
12046
|
-
|
|
12047
|
-
|
|
12048
|
-
|
|
12049
|
-
|
|
12050
|
-
|
|
12051
|
-
|
|
12367
|
+
}, /*#__PURE__*/React__default.createElement(AiOutlineMinus, null)), /*#__PURE__*/React__default.createElement("input", {
|
|
12368
|
+
type: "number",
|
|
12369
|
+
min: 1,
|
|
12370
|
+
inputMode: "numeric",
|
|
12371
|
+
value: quantity,
|
|
12372
|
+
disabled: loading,
|
|
12373
|
+
onChange: onChangeInput,
|
|
12374
|
+
onBlur: onBlurInput,
|
|
12375
|
+
onFocus: function onFocus(e) {
|
|
12376
|
+
return e.target.select();
|
|
12377
|
+
},
|
|
12378
|
+
"aria-label": "Quantity"
|
|
12379
|
+
}), /*#__PURE__*/React__default.createElement("button", {
|
|
12380
|
+
type: "button",
|
|
12381
|
+
className: "stepBtn",
|
|
12382
|
+
"aria-label": "Increase quantity",
|
|
12383
|
+
disabled: loading,
|
|
12052
12384
|
onClick: function onClick(e) {
|
|
12053
12385
|
e.stopPropagation();
|
|
12054
12386
|
if (loading) return;
|
|
12055
|
-
|
|
12056
|
-
|
|
12057
|
-
|
|
12058
|
-
|
|
12059
|
-
|
|
12387
|
+
onChangeQuantity(_extends({}, row, {
|
|
12388
|
+
quantity: checkMinMaxQty({
|
|
12389
|
+
quantity: (row === null || row === void 0 ? void 0 : row.quantity) + 1,
|
|
12390
|
+
product: row,
|
|
12391
|
+
allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce
|
|
12392
|
+
})
|
|
12060
12393
|
}));
|
|
12061
12394
|
}
|
|
12062
|
-
}, /*#__PURE__*/React__default.createElement(AiOutlinePlus, {
|
|
12063
|
-
|
|
12064
|
-
fontSize: 'inherit'
|
|
12065
|
-
}
|
|
12066
|
-
})))), /*#__PURE__*/React__default.createElement(CartTableCell$2, {
|
|
12067
|
-
alig: "center",
|
|
12068
|
-
className: "CartnoPaddingSm"
|
|
12395
|
+
}, /*#__PURE__*/React__default.createElement(AiOutlinePlus, null)))), /*#__PURE__*/React__default.createElement(CartTableCell$2, {
|
|
12396
|
+
className: "cell-subtotal"
|
|
12069
12397
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
12070
12398
|
className: "price"
|
|
12071
|
-
},
|
|
12072
|
-
|
|
12399
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
12400
|
+
className: "mobileLabel"
|
|
12401
|
+
}, "Subtotal "), "$", (Number(row === null || row === void 0 ? void 0 : row.subtotal) || 0).toFixed(2))), !hideDelete && /*#__PURE__*/React__default.createElement(CartTableCell$2, {
|
|
12402
|
+
className: "cell-delete"
|
|
12073
12403
|
}, /*#__PURE__*/React__default.createElement(DeleteBtn$1, {
|
|
12404
|
+
type: "button",
|
|
12405
|
+
"aria-label": "Remove product",
|
|
12406
|
+
title: "Remove",
|
|
12074
12407
|
onClick: function onClick(e) {
|
|
12075
12408
|
e.stopPropagation();
|
|
12076
12409
|
if (loading) return;
|
|
@@ -12083,13 +12416,13 @@ var CardRow$1 = function CardRow(_ref) {
|
|
|
12083
12416
|
}))));
|
|
12084
12417
|
};
|
|
12085
12418
|
|
|
12086
|
-
var _templateObject$H, _templateObject2$
|
|
12419
|
+
var _templateObject$H, _templateObject2$w, _templateObject3$q, _templateObject4$l, _templateObject5$h, _templateObject6$f, _templateObject7$b, _templateObject8$9, _templateObject9$6, _templateObject10$5;
|
|
12087
12420
|
var CartPageSection$1 = styled.section(_templateObject$H || (_templateObject$H = _taggedTemplateLiteralLoose(["\n background: ", ";\n max-width: 100%;\n width: fit-content;\n background: ", ";\n overflow: hidden;\n border-radius: 28px;\n\n @media screen and (max-width: 1200px) {\n padding: 0 1em;\n }\n @media screen and (max-width: 600px) {\n padding: 0 1em;\n }\n"])), function (props) {
|
|
12088
12421
|
return props.bg;
|
|
12089
12422
|
}, function (props) {
|
|
12090
12423
|
return props.bg || '#FAE8E5';
|
|
12091
12424
|
});
|
|
12092
|
-
var CartPageContainer$1 = styled.div(_templateObject2$
|
|
12425
|
+
var CartPageContainer$1 = styled.div(_templateObject2$w || (_templateObject2$w = _taggedTemplateLiteralLoose(["\n max-width: ", ";\n width: ", ";\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n border-radius: 28px 28px 28px 14px;\n padding: 2em 2.5em;\n padding-bottom: 3em;\n border-radius: 28px;\n opacity: ", ";\n .scrollDiv {\n width: 68%;\n max-height: 630px;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n\n margin-right: 0.3em;\n &::-webkit-scrollbar {\n width: 10px;\n }\n\n /* Track */\n &::-webkit-scrollbar-track {\n background: ", ";\n\n border-radius: 16px;\n }\n\n /* Handle */\n &::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 16px;\n border: 2px solid;\n }\n /* box-shadow: 0px 20px 35px rgba(0, 0, 0, 0.05); */\n }\n table {\n border-collapse: separate;\n border-spacing: 0 4px;\n row-gap: 4px;\n }\n\n td {\n /* border: solid 1px #000; */\n border-style: none solid solid none;\n /* padding: 10px; */\n /* margin-bottom:5px; */\n }\n\n tr:first-child td:first-child {\n border-top-left-radius: 10px;\n }\n tr td:last-child {\n border-top-right-radius: 10px;\n border-bottom-right-radius: 10px;\n }\n\n tr td:first-child {\n border-bottom-left-radius: 10px;\n border-top-left-radius: 10px;\n }\n tr td:last-child {\n border-bottom-right-radius: 10px;\n }\n\n tr td {\n border-top-style: solid;\n }\n tr td:first-child {\n border-left-style: solid;\n }\n\n @media only screen and (max-width: 1200px) {\n flex-direction: column;\n align-items: center;\n padding: 0.5em;\n .scrollDiv {\n width: 100%;\n margin: 0;\n margin-bottom: 2em;\n padding: 0 0.4em;\n }\n }\n"])), function (props) {
|
|
12093
12426
|
return props.maxWidth || '1600px';
|
|
12094
12427
|
}, function (props) {
|
|
12095
12428
|
return "min(" + (props.maxWidth || '1600px') + ",100%)";
|
|
@@ -12100,35 +12433,34 @@ var CartPageContainer$1 = styled.div(_templateObject2$v || (_templateObject2$v =
|
|
|
12100
12433
|
}, function (props) {
|
|
12101
12434
|
return props.color || '#BFC3CA';
|
|
12102
12435
|
});
|
|
12103
|
-
var CardsBox$1 = styled.div(_templateObject3$
|
|
12436
|
+
var CardsBox$1 = styled.div(_templateObject3$q || (_templateObject3$q = _taggedTemplateLiteralLoose(["\n width: 100%;\n /* min-height: 1000px; */\n position: relative;\n max-width: 860px;\n margin-right: auto;\n padding: 1em 2em;\n display: ", ";\n grid-template-columns: 1fr 1fr;\n flex-direction: column;\n align-items: flex-start;\n grid-gap: 1em;\n justify-content: flex-start;\n align-items: center;\n border-radius: 20px;\n @media only screen and (max-width: 900px) {\n display: flex;\n }\n @media only screen and (max-width: 600px) {\n padding: 1em 0.2em;\n }\n"])), function (props) {
|
|
12104
12437
|
return props.retail ? 'grid' : 'flex';
|
|
12105
12438
|
});
|
|
12106
|
-
var CartHeading$1 = styled.div(_templateObject4$
|
|
12439
|
+
var CartHeading$1 = styled.div(_templateObject4$l || (_templateObject4$l = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n /* margin-bottom: 2em; */\n margin-left: 2.3em;\n margin-top: 2em;\n\n color: ", ";\n h1 {\n font-weight: 600;\n font-size: 2.0375em;\n text-transform: capitalize;\n color: ", ";\n /* margin-bottom: 1em; */\n }\n p {\n font-size: 0.875em;\n color: inherit;\n margin-top: 0.5em;\n }\n"])), function (props) {
|
|
12107
12440
|
return props.color || 'black';
|
|
12108
12441
|
}, function (props) {
|
|
12109
12442
|
return props.h1 || 'inherit';
|
|
12110
12443
|
});
|
|
12111
|
-
var Loader$2 = styled.div(_templateObject5$
|
|
12112
|
-
var CartTableCell$3 = styled(TableCell)(_templateObject6$
|
|
12444
|
+
var Loader$2 = styled.div(_templateObject5$h || (_templateObject5$h = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 40%;\n left: 47%;\n display: grid;\n place-items: center;\n z-index: 3;\n"])));
|
|
12445
|
+
var CartTableCell$3 = styled(TableCell)(_templateObject6$f || (_templateObject6$f = _taggedTemplateLiteralLoose(["\n && {\n padding-bottom: 1em !important;\n // border: none !important;\n /* font-size: 0.75em; */\n font-size: 1em;\n color: rgba(98, 95, 95, 1);\n // background: ", ";\n color: ", ";\n }\n &.bg-transparent {\n // background-color: transparent !important;\n text-transform: uppercase;\n letter-spacing: 0.4px;\n span {\n font-size: 0.75em;\n font-weight: 600;\n color: ", ";\n }\n .MuiTableSortLabel-root:hover,\n .MuiTableSortLabel-root:hover svg {\n color: ", " !important;\n }\n svg {\n color: ", ";\n }\n .MuiTableSortLabel-root {\n color: ", "!important;\n }\n }\n"])), function (props) {
|
|
12113
12446
|
return "" + props.bg;
|
|
12114
12447
|
}, function (props) {
|
|
12115
12448
|
return "" + props.color || 'inherit';
|
|
12116
12449
|
}, function (props) {
|
|
12450
|
+
return props.color || '#6b7280';
|
|
12451
|
+
}, getPrimary, function (props) {
|
|
12117
12452
|
return "" + props.color || 'inherit';
|
|
12118
12453
|
}, function (props) {
|
|
12119
12454
|
return "" + props.color || 'inherit';
|
|
12120
12455
|
});
|
|
12121
|
-
var CartTableContainer$1 = styled(TableContainer$4)(_templateObject7$
|
|
12456
|
+
var CartTableContainer$1 = styled(TableContainer$4)(_templateObject7$b || (_templateObject7$b = _taggedTemplateLiteralLoose(["\n max-height: 580px;\n padding-right: 1.5em;\n overflow: inherit !important;\n &::-webkit-scrollbar {\n width: 10px;\n }\n\n /* Track */\n &::-webkit-scrollbar-track {\n background: ", ";\n border-radius: 16px;\n width: 100%;\n }\n\n /* Handle */\n &::-webkit-scrollbar-thumb {\n border-radius: 16px;\n margin: 5px 2px;\n background: ", ";\n }\n @media screen and (max-width: 768px) {\n padding: 0;\n }\n"])), function (props) {
|
|
12122
12457
|
return props.bg || '#fdccc480';
|
|
12123
12458
|
}, function (props) {
|
|
12124
12459
|
return props.color || 'red';
|
|
12125
12460
|
});
|
|
12126
|
-
var CartButtonsRow$1 = styled.div(_templateObject8$
|
|
12127
|
-
|
|
12128
|
-
|
|
12129
|
-
return props.color || 'white';
|
|
12130
|
-
});
|
|
12131
|
-
var CartPageBox$1 = styled.div(_templateObject9$6 || (_templateObject9$6 = _taggedTemplateLiteralLoose(["\n max-width: 100%;\n @media only screen and (max-width: 768px) {\n margin-right: 0;\n .CartnoBelowSm {\n display: none;\n }\n }\n"])));
|
|
12461
|
+
var CartButtonsRow$1 = styled.div(_templateObject8$9 || (_templateObject8$9 = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n padding-right: 1.5em;\n button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n height: 42px;\n padding: 0 20px;\n border-radius: 8px;\n border: 1.5px solid ", ";\n font-size: 0.95rem;\n font-weight: 600;\n letter-spacing: 0.2px;\n white-space: nowrap;\n cursor: pointer;\n transition: background 0.2s, color 0.2s, box-shadow 0.2s, opacity 0.2s;\n svg {\n font-size: 1.1em;\n }\n &:focus-visible {\n outline: 2px solid ", ";\n outline-offset: 2px;\n }\n &:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n }\n }\n .outlined {\n position: relative;\n isolation: isolate;\n background: #fff;\n color: ", ";\n /* Hover tint: the primary color at low opacity, behind the label. */\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n z-index: -1;\n border-radius: inherit;\n background: ", ";\n opacity: 0;\n transition: opacity 0.2s;\n }\n &:hover:not(:disabled)::before {\n opacity: 0.08;\n }\n }\n .filled {\n background: ", ";\n color: #fff;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);\n &:hover:not(:disabled) {\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);\n opacity: 0.92;\n }\n }\n @media only screen and (max-width: 768px) {\n padding-right: 0;\n }\n @media only screen and (max-width: 600px) {\n button {\n flex: 1;\n height: 44px;\n padding: 0 12px;\n font-size: 0.875rem;\n }\n }\n"])), getPrimary, getPrimary, getPrimary, getPrimary, getPrimary);
|
|
12462
|
+
var CartPageBox$1 = styled.div(_templateObject9$6 || (_templateObject9$6 = _taggedTemplateLiteralLoose(["\n max-width: 100%;\n @media only screen and (max-width: 768px) {\n margin-right: 0;\n .CartnoBelowSm {\n display: none;\n }\n /* Rows become stacked cards (see CardRow), so the table/body are blocks. */\n table,\n tbody {\n display: block;\n width: 100%;\n }\n }\n"])));
|
|
12463
|
+
var MobileSelectBar = styled.div(_templateObject10$5 || (_templateObject10$5 = _taggedTemplateLiteralLoose(["\n display: none;\n @media only screen and (max-width: 768px) {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 2px 8px;\n font-size: 0.9em;\n color: #555;\n label {\n display: flex;\n align-items: center;\n cursor: pointer;\n font-weight: 500;\n }\n .count {\n font-size: 0.9em;\n color: #888;\n }\n }\n"])));
|
|
12132
12464
|
|
|
12133
12465
|
var headCells$1 = [{
|
|
12134
12466
|
id: 'image',
|
|
@@ -12149,6 +12481,13 @@ var headCells$1 = [{
|
|
|
12149
12481
|
label: 'price',
|
|
12150
12482
|
filter: true,
|
|
12151
12483
|
noBelowSm: true
|
|
12484
|
+
}, {
|
|
12485
|
+
id: 'availableQuantity',
|
|
12486
|
+
numeric: true,
|
|
12487
|
+
disablePadding: false,
|
|
12488
|
+
label: 'stock',
|
|
12489
|
+
filter: true,
|
|
12490
|
+
noBelowSm: true
|
|
12152
12491
|
}, {
|
|
12153
12492
|
id: 'quantity',
|
|
12154
12493
|
numeric: true,
|
|
@@ -12170,14 +12509,17 @@ var headCells$1 = [{
|
|
|
12170
12509
|
noBelowSm: true
|
|
12171
12510
|
}];
|
|
12172
12511
|
function EnhancedTableHead$1(props) {
|
|
12173
|
-
var _styles$cartSummary, _styles$cartSummary2;
|
|
12512
|
+
var _React$useContext, _styles$cartSummary, _styles$cartSummary2;
|
|
12174
12513
|
var onSelectAllClick = props.onSelectAllClick,
|
|
12175
12514
|
order = props.order,
|
|
12176
12515
|
orderBy = props.orderBy,
|
|
12177
12516
|
numSelected = props.numSelected,
|
|
12178
12517
|
rowCount = props.rowCount,
|
|
12179
12518
|
onRequestSort = props.onRequestSort,
|
|
12180
|
-
styles = props.styles
|
|
12519
|
+
styles = props.styles,
|
|
12520
|
+
hideDelete = props.hideDelete,
|
|
12521
|
+
hideStock = props.hideStock;
|
|
12522
|
+
var primaryColor = ((_React$useContext = useContext(ThemeContext)) === null || _React$useContext === void 0 ? void 0 : _React$useContext.primaryColor) || DEFAULT_PRIMARY;
|
|
12181
12523
|
var createSortHandler = function createSortHandler(property) {
|
|
12182
12524
|
return function (event) {
|
|
12183
12525
|
onRequestSort(event, property);
|
|
@@ -12191,7 +12533,7 @@ function EnhancedTableHead$1(props) {
|
|
|
12191
12533
|
},
|
|
12192
12534
|
padding: "checkbox",
|
|
12193
12535
|
bg: styles === null || styles === void 0 ? void 0 : styles.bg
|
|
12194
|
-
}, /*#__PURE__*/createElement(Checkbox
|
|
12536
|
+
}, /*#__PURE__*/createElement(Checkbox, {
|
|
12195
12537
|
size: "small",
|
|
12196
12538
|
color: "primary",
|
|
12197
12539
|
indeterminate: numSelected > 0 && numSelected < rowCount,
|
|
@@ -12204,8 +12546,14 @@ function EnhancedTableHead$1(props) {
|
|
|
12204
12546
|
svg: {
|
|
12205
12547
|
color: styles === null || styles === void 0 ? void 0 : (_styles$cartSummary2 = styles.cartSummary) === null || _styles$cartSummary2 === void 0 ? void 0 : _styles$cartSummary2.color
|
|
12206
12548
|
}
|
|
12549
|
+
}, {
|
|
12550
|
+
'&.Mui-checked, &.MuiCheckbox-indeterminate': {
|
|
12551
|
+
color: primaryColor
|
|
12552
|
+
}
|
|
12207
12553
|
})
|
|
12208
|
-
})), headCells$1.
|
|
12554
|
+
})), headCells$1.filter(function (headCell) {
|
|
12555
|
+
return !(hideDelete && headCell.id === 'delete') && !(hideStock && headCell.id === 'availableQuantity');
|
|
12556
|
+
}).map(function (headCell) {
|
|
12209
12557
|
var _styles$cartSummary3;
|
|
12210
12558
|
return /*#__PURE__*/createElement(CartTableCell$3, {
|
|
12211
12559
|
key: headCell.id,
|
|
@@ -12235,19 +12583,31 @@ EnhancedTableHead$1.propTypes = {
|
|
|
12235
12583
|
rowCount: propTypes.number.isRequired
|
|
12236
12584
|
};
|
|
12237
12585
|
function ProductTable(_ref) {
|
|
12238
|
-
var _styles$scroll, _styles$scroll2, _sortBy
|
|
12586
|
+
var _React$useContext2, _styles$scroll, _styles$scroll2, _sortBy;
|
|
12239
12587
|
var cartData = _ref.cartData,
|
|
12240
12588
|
loading = _ref.loading,
|
|
12241
12589
|
imgnotfoundUrl = _ref.imgnotfoundUrl,
|
|
12242
12590
|
handleIncrementDecrement = _ref.handleIncrementDecrement,
|
|
12243
12591
|
handleRemoveProduct = _ref.handleRemoveProduct,
|
|
12244
12592
|
handleRemoveAll = _ref.handleRemoveAll,
|
|
12245
|
-
|
|
12246
|
-
|
|
12593
|
+
handleAddToCart = _ref.handleAddToCart,
|
|
12594
|
+
styles = _ref.styles,
|
|
12595
|
+
_ref$allowToProcessIn = _ref.allowToProcessInvoiceForOutOfStockProductsEcommerce,
|
|
12596
|
+
allowToProcessInvoiceForOutOfStockProductsEcommerce = _ref$allowToProcessIn === void 0 ? false : _ref$allowToProcessIn,
|
|
12597
|
+
selectedIds = _ref.selectedIds,
|
|
12598
|
+
onSelectedIdsChange = _ref.onSelectedIdsChange,
|
|
12599
|
+
_ref$hideActions = _ref.hideActions,
|
|
12600
|
+
hideActions = _ref$hideActions === void 0 ? false : _ref$hideActions,
|
|
12601
|
+
_ref$hideDelete = _ref.hideDelete,
|
|
12602
|
+
hideDelete = _ref$hideDelete === void 0 ? false : _ref$hideDelete,
|
|
12603
|
+
_ref$hideStock = _ref.hideStock,
|
|
12604
|
+
hideStock = _ref$hideStock === void 0 ? false : _ref$hideStock;
|
|
12605
|
+
var cartList = (Array.isArray(cartData) ? cartData : []).filter(Boolean).map(function (li) {
|
|
12247
12606
|
return _extends({}, li, {
|
|
12248
|
-
subtotal: li.standardPrice * li.quantity
|
|
12607
|
+
subtotal: (Number(li === null || li === void 0 ? void 0 : li.standardPrice) || 0) * (Number(li === null || li === void 0 ? void 0 : li.quantity) || 0)
|
|
12249
12608
|
});
|
|
12250
12609
|
});
|
|
12610
|
+
var primaryColor = ((_React$useContext2 = useContext(ThemeContext)) === null || _React$useContext2 === void 0 ? void 0 : _React$useContext2.primaryColor) || DEFAULT_PRIMARY;
|
|
12251
12611
|
var _React$useState = useState('asc'),
|
|
12252
12612
|
order = _React$useState[0],
|
|
12253
12613
|
setOrder = _React$useState[1];
|
|
@@ -12255,8 +12615,14 @@ function ProductTable(_ref) {
|
|
|
12255
12615
|
orderBy = _React$useState2[0],
|
|
12256
12616
|
setOrderBy = _React$useState2[1];
|
|
12257
12617
|
var _React$useState3 = useState([]),
|
|
12258
|
-
|
|
12259
|
-
|
|
12618
|
+
internalSelected = _React$useState3[0],
|
|
12619
|
+
setInternalSelected = _React$useState3[1];
|
|
12620
|
+
var selected = selectedIds != null ? selectedIds : internalSelected;
|
|
12621
|
+
var setSelected = function setSelected(updater) {
|
|
12622
|
+
var next = typeof updater === 'function' ? updater(selected) : updater;
|
|
12623
|
+
if (next === selected) return;
|
|
12624
|
+
if (onSelectedIdsChange) onSelectedIdsChange(next);else setInternalSelected(next);
|
|
12625
|
+
};
|
|
12260
12626
|
var _React$useState4 = useState(cartList || []),
|
|
12261
12627
|
cartArray = _React$useState4[0],
|
|
12262
12628
|
setCartArray = _React$useState4[1];
|
|
@@ -12282,44 +12648,71 @@ function ProductTable(_ref) {
|
|
|
12282
12648
|
setOrder(isAsc ? 'desc' : 'asc');
|
|
12283
12649
|
setOrderBy(property);
|
|
12284
12650
|
};
|
|
12285
|
-
var handleSelectAllClick = function handleSelectAllClick(
|
|
12286
|
-
|
|
12287
|
-
|
|
12288
|
-
|
|
12289
|
-
|
|
12290
|
-
|
|
12291
|
-
|
|
12292
|
-
return;
|
|
12293
|
-
}
|
|
12294
|
-
setSelected([]);
|
|
12651
|
+
var handleSelectAllClick = function handleSelectAllClick() {
|
|
12652
|
+
var allIds = cartList.map(function (p) {
|
|
12653
|
+
return p === null || p === void 0 ? void 0 : p.rowId;
|
|
12654
|
+
});
|
|
12655
|
+
setSelected(function (prev) {
|
|
12656
|
+
return prev.length < allIds.length ? allIds : [];
|
|
12657
|
+
});
|
|
12295
12658
|
};
|
|
12296
12659
|
var handleClick = function handleClick(event, product) {
|
|
12297
|
-
var
|
|
12298
|
-
|
|
12299
|
-
|
|
12300
|
-
return
|
|
12301
|
-
});
|
|
12302
|
-
|
|
12303
|
-
} else {
|
|
12304
|
-
setSelected([].concat(selected, [product]));
|
|
12305
|
-
}
|
|
12660
|
+
var id = product === null || product === void 0 ? void 0 : product.rowId;
|
|
12661
|
+
setSelected(function (prev) {
|
|
12662
|
+
return prev.includes(id) ? prev.filter(function (x) {
|
|
12663
|
+
return x !== id;
|
|
12664
|
+
}) : [].concat(prev, [id]);
|
|
12665
|
+
});
|
|
12306
12666
|
};
|
|
12307
|
-
var isSelected = function isSelected(
|
|
12308
|
-
return selected.includes(
|
|
12667
|
+
var isSelected = function isSelected(product) {
|
|
12668
|
+
return selected.includes(product === null || product === void 0 ? void 0 : product.rowId);
|
|
12669
|
+
};
|
|
12670
|
+
var handleRemoveSelected = function handleRemoveSelected() {
|
|
12671
|
+
if (loading) return;
|
|
12672
|
+
if (!selected.length) {
|
|
12673
|
+
alert('Please select at least one product to remove.');
|
|
12674
|
+
return;
|
|
12675
|
+
}
|
|
12676
|
+
handleRemoveAll(selected);
|
|
12309
12677
|
};
|
|
12310
12678
|
useEffect(function () {
|
|
12311
12679
|
setCartArray(cartList);
|
|
12680
|
+
var ids = new Set(cartList.map(function (p) {
|
|
12681
|
+
return p === null || p === void 0 ? void 0 : p.rowId;
|
|
12682
|
+
}));
|
|
12683
|
+
setSelected(function (prev) {
|
|
12684
|
+
var next = prev.filter(function (id) {
|
|
12685
|
+
return ids.has(id);
|
|
12686
|
+
});
|
|
12687
|
+
return next.length === prev.length ? prev : next;
|
|
12688
|
+
});
|
|
12312
12689
|
}, [cartData]);
|
|
12313
12690
|
return /*#__PURE__*/createElement(CartPageBox$1, null, loading && /*#__PURE__*/createElement(Loader$2, null, /*#__PURE__*/createElement(BounceLoader, {
|
|
12314
12691
|
size: 40,
|
|
12315
|
-
color:
|
|
12692
|
+
color: primaryColor,
|
|
12316
12693
|
loading: true
|
|
12317
12694
|
})), /*#__PURE__*/createElement(Box$1, {
|
|
12318
12695
|
sx: {
|
|
12319
12696
|
width: '100%'
|
|
12320
12697
|
},
|
|
12321
12698
|
paddingBottom: "2em"
|
|
12322
|
-
}, /*#__PURE__*/createElement(
|
|
12699
|
+
}, /*#__PURE__*/createElement(MobileSelectBar, null, /*#__PURE__*/createElement("label", null, /*#__PURE__*/createElement(Checkbox, {
|
|
12700
|
+
size: "small",
|
|
12701
|
+
indeterminate: (selected === null || selected === void 0 ? void 0 : selected.length) > 0 && (selected === null || selected === void 0 ? void 0 : selected.length) < (cartArray === null || cartArray === void 0 ? void 0 : cartArray.length),
|
|
12702
|
+
checked: (cartArray === null || cartArray === void 0 ? void 0 : cartArray.length) > 0 && (selected === null || selected === void 0 ? void 0 : selected.length) === (cartArray === null || cartArray === void 0 ? void 0 : cartArray.length),
|
|
12703
|
+
onChange: handleSelectAllClick,
|
|
12704
|
+
inputProps: {
|
|
12705
|
+
'aria-label': 'select all products'
|
|
12706
|
+
},
|
|
12707
|
+
sx: {
|
|
12708
|
+
pl: 0,
|
|
12709
|
+
'&.Mui-checked, &.MuiCheckbox-indeterminate': {
|
|
12710
|
+
color: primaryColor
|
|
12711
|
+
}
|
|
12712
|
+
}
|
|
12713
|
+
}), "Select all"), (selected === null || selected === void 0 ? void 0 : selected.length) > 0 && /*#__PURE__*/createElement("span", {
|
|
12714
|
+
className: "count"
|
|
12715
|
+
}, selected.length, " selected")), /*#__PURE__*/createElement(CartTableContainer$1, {
|
|
12323
12716
|
bg: styles === null || styles === void 0 ? void 0 : (_styles$scroll = styles.scroll) === null || _styles$scroll === void 0 ? void 0 : _styles$scroll.bg,
|
|
12324
12717
|
color: styles === null || styles === void 0 ? void 0 : (_styles$scroll2 = styles.scroll) === null || _styles$scroll2 === void 0 ? void 0 : _styles$scroll2.color
|
|
12325
12718
|
}, /*#__PURE__*/createElement(Table$1, {
|
|
@@ -12333,12 +12726,15 @@ function ProductTable(_ref) {
|
|
|
12333
12726
|
onSelectAllClick: handleSelectAllClick,
|
|
12334
12727
|
onRequestSort: handleRequestSort,
|
|
12335
12728
|
rowCount: cartArray === null || cartArray === void 0 ? void 0 : cartArray.length,
|
|
12336
|
-
styles: styles
|
|
12729
|
+
styles: styles,
|
|
12730
|
+
hideDelete: hideDelete,
|
|
12731
|
+
hideStock: hideStock
|
|
12337
12732
|
}), /*#__PURE__*/createElement(TableBody$1, null, (_sortBy = sortBy(cartArray, function (o) {
|
|
12338
12733
|
return !((o === null || o === void 0 ? void 0 : o.quantity) > (o === null || o === void 0 ? void 0 : o.availableQuantity));
|
|
12339
12734
|
})) === null || _sortBy === void 0 ? void 0 : _sortBy.map(function (row, index) {
|
|
12340
12735
|
var isItemSelected = isSelected(row);
|
|
12341
12736
|
return /*#__PURE__*/createElement(CardRow$1, {
|
|
12737
|
+
key: (row === null || row === void 0 ? void 0 : row.rowId) || index,
|
|
12342
12738
|
row: row,
|
|
12343
12739
|
index: index,
|
|
12344
12740
|
isItemSelected: isItemSelected,
|
|
@@ -12347,66 +12743,365 @@ function ProductTable(_ref) {
|
|
|
12347
12743
|
cartData: cartData,
|
|
12348
12744
|
loading: loading,
|
|
12349
12745
|
styles: styles,
|
|
12746
|
+
hideDelete: hideDelete,
|
|
12747
|
+
hideStock: hideStock,
|
|
12350
12748
|
handleIncrementDecrement: handleIncrementDecrement,
|
|
12351
|
-
handleRemoveProduct: handleRemoveProduct
|
|
12749
|
+
handleRemoveProduct: handleRemoveProduct,
|
|
12750
|
+
allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce
|
|
12352
12751
|
});
|
|
12353
|
-
}))))), /*#__PURE__*/createElement(CartButtonsRow$1, {
|
|
12354
|
-
|
|
12355
|
-
|
|
12356
|
-
|
|
12752
|
+
}))))), !hideActions && /*#__PURE__*/createElement(CartButtonsRow$1, null, /*#__PURE__*/createElement("button", {
|
|
12753
|
+
type: "button",
|
|
12754
|
+
className: "outlined",
|
|
12755
|
+
onClick: handleRemoveSelected,
|
|
12756
|
+
disabled: loading || !(selected !== null && selected !== void 0 && selected.length)
|
|
12757
|
+
}, /*#__PURE__*/createElement(AiOutlineDelete, null), "Remove selected", selected !== null && selected !== void 0 && selected.length ? " (" + selected.length + ")" : ''), /*#__PURE__*/createElement("button", {
|
|
12758
|
+
type: "button",
|
|
12759
|
+
className: "filled",
|
|
12760
|
+
disabled: loading || !(cartArray !== null && cartArray !== void 0 && cartArray.length),
|
|
12357
12761
|
onClick: function onClick() {
|
|
12358
|
-
|
|
12359
|
-
|
|
12360
|
-
handleRemoveAll(selected);
|
|
12361
|
-
resolve();
|
|
12362
|
-
});
|
|
12363
|
-
setSelected([]);
|
|
12762
|
+
if (loading) return;
|
|
12763
|
+
handleAddToCart && handleAddToCart(selected);
|
|
12364
12764
|
}
|
|
12365
|
-
}, /*#__PURE__*/createElement(
|
|
12765
|
+
}, /*#__PURE__*/createElement(AiOutlinePlus, null), loading ? 'Adding...' : selected !== null && selected !== void 0 && selected.length ? "Add selected to cart (" + selected.length + ")" : 'Add all to cart')));
|
|
12366
12766
|
}
|
|
12367
12767
|
|
|
12368
|
-
var
|
|
12369
|
-
|
|
12370
|
-
|
|
12371
|
-
|
|
12372
|
-
|
|
12768
|
+
var PAGE_SIZE = 20;
|
|
12769
|
+
var getInitialQuantity = function getInitialQuantity(product) {
|
|
12770
|
+
return (product === null || product === void 0 ? void 0 : product.minQuantityToSale) > 1 ? product.minQuantityToSale : 1;
|
|
12771
|
+
};
|
|
12772
|
+
var getRowId = function getRowId(product) {
|
|
12773
|
+
return "recent-" + (product === null || product === void 0 ? void 0 : product.productId);
|
|
12774
|
+
};
|
|
12775
|
+
var LastOrderedProductsDialog = function LastOrderedProductsDialog(_ref) {
|
|
12776
|
+
var open = _ref.open,
|
|
12777
|
+
onClose = _ref.onClose,
|
|
12778
|
+
onAdd = _ref.onAdd,
|
|
12373
12779
|
apiEndPoint = _ref.apiEndPoint,
|
|
12374
12780
|
token = _ref.token,
|
|
12375
12781
|
imgnotfoundUrl = _ref.imgnotfoundUrl,
|
|
12376
|
-
styles = _ref.styles
|
|
12377
|
-
|
|
12378
|
-
|
|
12379
|
-
|
|
12380
|
-
var
|
|
12782
|
+
styles = _ref.styles,
|
|
12783
|
+
allowToProcessInvoiceForOutOfStockProductsEcommerce = _ref.allowToProcessInvoiceForOutOfStockProductsEcommerce,
|
|
12784
|
+
_ref$hideStock = _ref.hideStock,
|
|
12785
|
+
hideStock = _ref$hideStock === void 0 ? false : _ref$hideStock;
|
|
12786
|
+
var theme = useContext(ThemeContext);
|
|
12787
|
+
var primaryColor = (theme === null || theme === void 0 ? void 0 : theme.primaryColor) || '#424242';
|
|
12788
|
+
var isSmallScreen = useMediaQuery$1('(max-width:600px)');
|
|
12789
|
+
var _useState = useState({}),
|
|
12790
|
+
rowsById = _useState[0],
|
|
12791
|
+
setRowsById = _useState[1];
|
|
12381
12792
|
var _useState2 = useState([]),
|
|
12382
|
-
|
|
12383
|
-
|
|
12384
|
-
|
|
12385
|
-
|
|
12386
|
-
|
|
12387
|
-
|
|
12793
|
+
pageRowIds = _useState2[0],
|
|
12794
|
+
setPageRowIds = _useState2[1];
|
|
12795
|
+
var _useState3 = useState([]),
|
|
12796
|
+
selectedIds = _useState3[0],
|
|
12797
|
+
setSelectedIds = _useState3[1];
|
|
12798
|
+
var _useState4 = useState(false),
|
|
12799
|
+
loading = _useState4[0],
|
|
12800
|
+
setLoading = _useState4[1];
|
|
12801
|
+
var _useState5 = useState(0),
|
|
12802
|
+
page = _useState5[0],
|
|
12803
|
+
setPage = _useState5[1];
|
|
12804
|
+
var _useState6 = useState(0),
|
|
12805
|
+
totalPages = _useState6[0],
|
|
12806
|
+
setTotalPages = _useState6[1];
|
|
12807
|
+
var _useState7 = useState(0),
|
|
12808
|
+
totalElements = _useState7[0],
|
|
12809
|
+
setTotalElements = _useState7[1];
|
|
12810
|
+
var requestId = useRef(0);
|
|
12811
|
+
var contentRef = useRef();
|
|
12812
|
+
var loadPage = function loadPage(pageToLoad) {
|
|
12813
|
+
try {
|
|
12814
|
+
var currentRequest = ++requestId.current;
|
|
12815
|
+
setLoading(true);
|
|
12816
|
+
return Promise.resolve(_finallyRethrows(function () {
|
|
12817
|
+
return _catch(function () {
|
|
12388
12818
|
return Promise.resolve(API({
|
|
12389
12819
|
apiEndPoint: apiEndPoint,
|
|
12390
12820
|
token: token,
|
|
12391
|
-
url:
|
|
12392
|
-
|
|
12393
|
-
|
|
12821
|
+
url: '/ecommerce/product/recently-ordered',
|
|
12822
|
+
queryParams: {
|
|
12823
|
+
page: pageToLoad,
|
|
12824
|
+
size: PAGE_SIZE
|
|
12825
|
+
}
|
|
12826
|
+
})).then(function (result) {
|
|
12827
|
+
if (currentRequest !== requestId.current) return;
|
|
12828
|
+
var content = (Array.isArray(result === null || result === void 0 ? void 0 : result.content) ? result.content : []).filter(function (p) {
|
|
12829
|
+
return p && (p === null || p === void 0 ? void 0 : p.productId) != null;
|
|
12830
|
+
});
|
|
12831
|
+
setRowsById(function (prev) {
|
|
12832
|
+
var next = _extends({}, prev);
|
|
12833
|
+
content.forEach(function (p) {
|
|
12834
|
+
var rowId = getRowId(p);
|
|
12835
|
+
next[rowId] = prev[rowId] ? _extends({}, p, {
|
|
12836
|
+
quantity: prev[rowId].quantity,
|
|
12837
|
+
rowId: rowId
|
|
12838
|
+
}) : _extends({}, p, {
|
|
12839
|
+
quantity: getInitialQuantity(p),
|
|
12840
|
+
rowId: rowId
|
|
12841
|
+
});
|
|
12842
|
+
});
|
|
12843
|
+
return next;
|
|
12844
|
+
});
|
|
12845
|
+
setPageRowIds(content.map(getRowId));
|
|
12846
|
+
setPage(pageToLoad);
|
|
12847
|
+
setTotalPages((result === null || result === void 0 ? void 0 : result.totalPages) || 0);
|
|
12848
|
+
setTotalElements((result === null || result === void 0 ? void 0 : result.totalElements) || 0);
|
|
12849
|
+
if (contentRef.current) contentRef.current.scrollTop = 0;
|
|
12394
12850
|
});
|
|
12395
12851
|
}, function () {});
|
|
12396
|
-
|
|
12397
|
-
|
|
12398
|
-
|
|
12852
|
+
}, function (_wasThrown, _result) {
|
|
12853
|
+
if (currentRequest === requestId.current) setLoading(false);
|
|
12854
|
+
if (_wasThrown) throw _result;
|
|
12855
|
+
return _result;
|
|
12856
|
+
}));
|
|
12857
|
+
} catch (e) {
|
|
12858
|
+
return Promise.reject(e);
|
|
12859
|
+
}
|
|
12860
|
+
};
|
|
12861
|
+
useEffect(function () {
|
|
12862
|
+
if (!open) return;
|
|
12863
|
+
setRowsById({});
|
|
12864
|
+
setPageRowIds([]);
|
|
12865
|
+
setSelectedIds([]);
|
|
12866
|
+
setPage(0);
|
|
12867
|
+
setTotalPages(0);
|
|
12868
|
+
setTotalElements(0);
|
|
12869
|
+
loadPage(0);
|
|
12870
|
+
}, [open]);
|
|
12871
|
+
var pageRows = pageRowIds.map(function (id) {
|
|
12872
|
+
return rowsById[id];
|
|
12873
|
+
}).filter(Boolean);
|
|
12874
|
+
var pageIdSet = new Set(pageRows.map(function (p) {
|
|
12875
|
+
return p.rowId;
|
|
12876
|
+
}));
|
|
12877
|
+
var pageSelectedIds = selectedIds.filter(function (id) {
|
|
12878
|
+
return pageIdSet.has(id);
|
|
12879
|
+
});
|
|
12880
|
+
var handlePageSelectionChange = function handlePageSelectionChange(nextPageSelected) {
|
|
12881
|
+
setSelectedIds(function (prev) {
|
|
12882
|
+
return [].concat(prev.filter(function (id) {
|
|
12883
|
+
return !pageIdSet.has(id);
|
|
12884
|
+
}), nextPageSelected);
|
|
12885
|
+
});
|
|
12886
|
+
};
|
|
12887
|
+
var handleIncrementDecrement = function handleIncrementDecrement(data) {
|
|
12888
|
+
if (!(data !== null && data !== void 0 && data.rowId)) return;
|
|
12889
|
+
setRowsById(function (prev) {
|
|
12890
|
+
var _extends2;
|
|
12891
|
+
return prev[data.rowId] ? _extends({}, prev, (_extends2 = {}, _extends2[data.rowId] = _extends({}, prev[data.rowId], {
|
|
12892
|
+
quantity: data.quantity
|
|
12893
|
+
}), _extends2)) : prev;
|
|
12894
|
+
});
|
|
12895
|
+
setSelectedIds(function (prev) {
|
|
12896
|
+
return prev.includes(data.rowId) ? prev : [].concat(prev, [data.rowId]);
|
|
12897
|
+
});
|
|
12898
|
+
};
|
|
12899
|
+
var handleRemoveProduct = function handleRemoveProduct() {};
|
|
12900
|
+
var handlePageChange = function handlePageChange(event, value) {
|
|
12901
|
+
var nextPage = value - 1;
|
|
12902
|
+
if (nextPage === page || loading) return;
|
|
12903
|
+
loadPage(nextPage);
|
|
12904
|
+
};
|
|
12905
|
+
var handleAdd = function handleAdd() {
|
|
12906
|
+
if (!selectedIds.length) {
|
|
12907
|
+
alert('Please select at least one product to add.');
|
|
12908
|
+
return;
|
|
12909
|
+
}
|
|
12910
|
+
onAdd(selectedIds.map(function (id) {
|
|
12911
|
+
return rowsById[id];
|
|
12912
|
+
}).filter(Boolean));
|
|
12913
|
+
onClose();
|
|
12914
|
+
};
|
|
12915
|
+
return /*#__PURE__*/React__default.createElement(Dialog, {
|
|
12916
|
+
open: open,
|
|
12917
|
+
onClose: onClose,
|
|
12918
|
+
fullWidth: true,
|
|
12919
|
+
fullScreen: isSmallScreen,
|
|
12920
|
+
maxWidth: "lg",
|
|
12921
|
+
scroll: "paper"
|
|
12922
|
+
}, /*#__PURE__*/React__default.createElement(DialogTitle$1, {
|
|
12923
|
+
sx: {
|
|
12924
|
+
m: 0,
|
|
12925
|
+
p: 2,
|
|
12926
|
+
pr: 6
|
|
12927
|
+
}
|
|
12928
|
+
}, "Last Ordered Products", /*#__PURE__*/React__default.createElement(IconButton, {
|
|
12929
|
+
"aria-label": "close",
|
|
12930
|
+
onClick: onClose,
|
|
12931
|
+
sx: {
|
|
12932
|
+
position: 'absolute',
|
|
12933
|
+
right: 8,
|
|
12934
|
+
top: 8,
|
|
12935
|
+
'& svg': {
|
|
12936
|
+
fontSize: 20
|
|
12399
12937
|
}
|
|
12400
|
-
}
|
|
12401
|
-
},
|
|
12938
|
+
}
|
|
12939
|
+
}, /*#__PURE__*/React__default.createElement(MdClose, null))), /*#__PURE__*/React__default.createElement(DialogContent, {
|
|
12940
|
+
dividers: true,
|
|
12941
|
+
ref: contentRef,
|
|
12942
|
+
sx: {
|
|
12943
|
+
px: {
|
|
12944
|
+
xs: 1.5,
|
|
12945
|
+
sm: 3
|
|
12946
|
+
}
|
|
12947
|
+
}
|
|
12948
|
+
}, pageRows.length > 0 ? /*#__PURE__*/React__default.createElement(ProductTable, {
|
|
12949
|
+
cartData: pageRows,
|
|
12950
|
+
loading: loading,
|
|
12951
|
+
imgnotfoundUrl: imgnotfoundUrl,
|
|
12952
|
+
styles: styles,
|
|
12953
|
+
handleRemoveProduct: handleRemoveProduct,
|
|
12954
|
+
handleIncrementDecrement: handleIncrementDecrement,
|
|
12955
|
+
allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce,
|
|
12956
|
+
hideStock: hideStock,
|
|
12957
|
+
selectedIds: pageSelectedIds,
|
|
12958
|
+
onSelectedIdsChange: handlePageSelectionChange,
|
|
12959
|
+
hideActions: true,
|
|
12960
|
+
hideDelete: true
|
|
12961
|
+
}) : loading ? /*#__PURE__*/React__default.createElement(DialogLoadMore, null, "Loading products...") : /*#__PURE__*/React__default.createElement(NoData, null)), /*#__PURE__*/React__default.createElement(DialogActions, {
|
|
12962
|
+
sx: {
|
|
12963
|
+
p: 2
|
|
12964
|
+
}
|
|
12965
|
+
}, /*#__PURE__*/React__default.createElement(DialogFooter, null, /*#__PURE__*/React__default.createElement("div", {
|
|
12966
|
+
className: "pagination"
|
|
12967
|
+
}, totalPages > 1 && /*#__PURE__*/React__default.createElement(Pagination, {
|
|
12968
|
+
count: totalPages,
|
|
12969
|
+
page: page + 1,
|
|
12970
|
+
onChange: handlePageChange,
|
|
12971
|
+
disabled: loading,
|
|
12972
|
+
shape: "rounded",
|
|
12973
|
+
size: "small",
|
|
12974
|
+
sx: {
|
|
12975
|
+
'& .MuiPaginationItem-root.Mui-selected': {
|
|
12976
|
+
backgroundColor: primaryColor,
|
|
12977
|
+
color: '#fff'
|
|
12978
|
+
},
|
|
12979
|
+
'& .MuiPaginationItem-root.Mui-selected:hover': {
|
|
12980
|
+
backgroundColor: primaryColor,
|
|
12981
|
+
opacity: 0.9
|
|
12982
|
+
}
|
|
12983
|
+
}
|
|
12984
|
+
}), totalElements > 0 && /*#__PURE__*/React__default.createElement("span", {
|
|
12985
|
+
className: "count"
|
|
12986
|
+
}, page * PAGE_SIZE + 1, "\u2013", Math.min((page + 1) * PAGE_SIZE, totalElements), " of", ' ', totalElements)), /*#__PURE__*/React__default.createElement("div", {
|
|
12987
|
+
className: "buttons"
|
|
12988
|
+
}, /*#__PURE__*/React__default.createElement(DialogFooterButton, {
|
|
12989
|
+
type: "button",
|
|
12990
|
+
variant: "outlined",
|
|
12991
|
+
onClick: onClose
|
|
12992
|
+
}, "Cancel"), /*#__PURE__*/React__default.createElement(DialogFooterButton, {
|
|
12993
|
+
type: "button",
|
|
12994
|
+
onClick: handleAdd,
|
|
12995
|
+
disabled: !selectedIds.length
|
|
12996
|
+
}, "Add", selectedIds.length ? " (" + selectedIds.length + ")" : '')))));
|
|
12997
|
+
};
|
|
12998
|
+
|
|
12999
|
+
var _excluded$7 = ["rowId"];
|
|
13000
|
+
var QuickOrder = function QuickOrder(_ref) {
|
|
13001
|
+
var _erCookieStorage$getI;
|
|
13002
|
+
var _ref$colors = _ref.colors,
|
|
13003
|
+
colors = _ref$colors === void 0 ? {
|
|
13004
|
+
primaryColor: '#424242'
|
|
13005
|
+
} : _ref$colors,
|
|
13006
|
+
apiEndPoint = _ref.apiEndPoint,
|
|
13007
|
+
token = _ref.token,
|
|
13008
|
+
imgnotfoundUrl = _ref.imgnotfoundUrl,
|
|
13009
|
+
styles = _ref.styles,
|
|
13010
|
+
onAddToCart = _ref.onAddToCart,
|
|
13011
|
+
_ref$doNotShowStock = _ref.doNotShowStock,
|
|
13012
|
+
doNotShowStock = _ref$doNotShowStock === void 0 ? false : _ref$doNotShowStock;
|
|
13013
|
+
var _useAllSystemFeatureV = useAllSystemFeatureValues({
|
|
13014
|
+
apiEndPoint: apiEndPoint,
|
|
13015
|
+
token: token
|
|
13016
|
+
}),
|
|
13017
|
+
_useAllSystemFeatureV2 = _useAllSystemFeatureV.allowToProcessInvoiceForOutOfStockProductsEcommerce,
|
|
13018
|
+
allowToProcessInvoiceForOutOfStockProductsEcommerce = _useAllSystemFeatureV2 === void 0 ? false : _useAllSystemFeatureV2;
|
|
13019
|
+
var hideStock = !!allowToProcessInvoiceForOutOfStockProductsEcommerce || !!doNotShowStock;
|
|
13020
|
+
var storeId = (erCookieStorage === null || erCookieStorage === void 0 ? void 0 : (_erCookieStorage$getI = erCookieStorage.getItem) === null || _erCookieStorage$getI === void 0 ? void 0 : _erCookieStorage$getI.call(erCookieStorage, 'storeId')) || 2;
|
|
13021
|
+
var _useState = useState([]),
|
|
13022
|
+
products = _useState[0],
|
|
13023
|
+
setProducts = _useState[1];
|
|
13024
|
+
var _useState2 = useState(false),
|
|
13025
|
+
infoOpen = _useState2[0],
|
|
13026
|
+
setInfoOpen = _useState2[1];
|
|
13027
|
+
var _useState3 = useState(false),
|
|
13028
|
+
lastOrderedOpen = _useState3[0],
|
|
13029
|
+
setLastOrderedOpen = _useState3[1];
|
|
13030
|
+
var _useState4 = useState(false),
|
|
13031
|
+
addingToCart = _useState4[0],
|
|
13032
|
+
setAddingToCart = _useState4[1];
|
|
13033
|
+
var handleLastOrderedProducts = function handleLastOrderedProducts() {
|
|
13034
|
+
setLastOrderedOpen(true);
|
|
13035
|
+
};
|
|
13036
|
+
var isOutOfStock = function isOutOfStock(product) {
|
|
13037
|
+
var availableQuantity = product === null || product === void 0 ? void 0 : product.availableQuantity;
|
|
13038
|
+
return !allowToProcessInvoiceForOutOfStockProductsEcommerce && (1 > availableQuantity || availableQuantity <= 0);
|
|
13039
|
+
};
|
|
13040
|
+
var getProductKey = function getProductKey(product) {
|
|
13041
|
+
var _product$productId;
|
|
13042
|
+
return (_product$productId = product === null || product === void 0 ? void 0 : product.productId) != null ? _product$productId : product === null || product === void 0 ? void 0 : product.id;
|
|
13043
|
+
};
|
|
13044
|
+
var makeRowId = function makeRowId(product) {
|
|
13045
|
+
var _getProductKey;
|
|
13046
|
+
return ((_getProductKey = getProductKey(product)) != null ? _getProductKey : 'p') + "-" + Date.now() + "-" + Math.random();
|
|
13047
|
+
};
|
|
13048
|
+
var addProductsToList = function addProductsToList(newProducts) {
|
|
13049
|
+
if (newProducts === void 0) {
|
|
13050
|
+
newProducts = [];
|
|
13051
|
+
}
|
|
13052
|
+
if (!Array.isArray(newProducts)) return;
|
|
13053
|
+
var outOfStockNames = [];
|
|
13054
|
+
var next = [].concat(products || []);
|
|
13055
|
+
var added = [];
|
|
13056
|
+
newProducts.forEach(function (product) {
|
|
13057
|
+
if (!product) return;
|
|
13058
|
+
if (isOutOfStock(product)) {
|
|
13059
|
+
outOfStockNames.push((product === null || product === void 0 ? void 0 : product.productName) || '');
|
|
13060
|
+
return;
|
|
13061
|
+
}
|
|
13062
|
+
var key = getProductKey(product);
|
|
13063
|
+
var addQty = (product === null || product === void 0 ? void 0 : product.quantity) > 0 ? product.quantity : 1;
|
|
13064
|
+
var existing = key !== undefined && key !== null ? next.find(function (p) {
|
|
13065
|
+
return getProductKey(p) === key;
|
|
13066
|
+
}) : undefined;
|
|
13067
|
+
if (existing) {
|
|
13068
|
+
var quantity = checkMinMaxQty({
|
|
13069
|
+
quantity: (Number(existing === null || existing === void 0 ? void 0 : existing.quantity) || 0) + addQty,
|
|
13070
|
+
product: existing,
|
|
13071
|
+
allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce
|
|
13072
|
+
});
|
|
13073
|
+
next = next.map(function (p) {
|
|
13074
|
+
return (p === null || p === void 0 ? void 0 : p.rowId) === (existing === null || existing === void 0 ? void 0 : existing.rowId) ? _extends({}, p, {
|
|
13075
|
+
quantity: quantity
|
|
13076
|
+
}) : p;
|
|
13077
|
+
});
|
|
13078
|
+
} else {
|
|
13079
|
+
var row = _extends({}, product, {
|
|
13080
|
+
quantity: addQty,
|
|
13081
|
+
rowId: makeRowId(product)
|
|
13082
|
+
});
|
|
13083
|
+
added.push(row);
|
|
13084
|
+
next.push(row);
|
|
13085
|
+
}
|
|
13086
|
+
});
|
|
13087
|
+
if (outOfStockNames.length) {
|
|
13088
|
+
alert(outOfStockNames.length === 1 ? "This product is out of stock: " + outOfStockNames[0] : "These products are out of stock:\n" + outOfStockNames.join('\n'));
|
|
13089
|
+
}
|
|
13090
|
+
var addedIds = new Set(added.map(function (p) {
|
|
13091
|
+
return p === null || p === void 0 ? void 0 : p.rowId;
|
|
13092
|
+
}));
|
|
13093
|
+
setProducts([].concat(added.slice().reverse(), next.filter(function (p) {
|
|
13094
|
+
return p && !addedIds.has(p === null || p === void 0 ? void 0 : p.rowId);
|
|
13095
|
+
})));
|
|
13096
|
+
};
|
|
12402
13097
|
var searchProductAPIData = function searchProductAPIData() {
|
|
12403
13098
|
return Object.freeze({
|
|
12404
13099
|
apiEndPoint: apiEndPoint,
|
|
12405
13100
|
token: token,
|
|
12406
|
-
url: "/ecommerce/product/searchByProductOrCategory",
|
|
12407
|
-
scanUrl: "/product/scan?storeIds=" +
|
|
13101
|
+
url: "/ecommerce/product/searchByProductOrCategory?storeIds=" + storeId,
|
|
13102
|
+
scanUrl: "/product/scan?storeIds=" + storeId,
|
|
12408
13103
|
labelKey: function labelKey(option) {
|
|
12409
|
-
return option.productName + " " + (option.upc ? "(" + option.upc + ")" : '');
|
|
13104
|
+
return ((option === null || option === void 0 ? void 0 : option.productName) || '') + " " + (option !== null && option !== void 0 && option.upc ? "(" + (option === null || option === void 0 ? void 0 : option.upc) + ")" : '');
|
|
12410
13105
|
},
|
|
12411
13106
|
getQueryParams: function getQueryParams(value) {
|
|
12412
13107
|
var queryParams = {
|
|
@@ -12429,46 +13124,157 @@ var QuickOrder = function QuickOrder(_ref) {
|
|
|
12429
13124
|
};
|
|
12430
13125
|
var onUpdate = function onUpdate(searchedProduct, clearInput) {
|
|
12431
13126
|
try {
|
|
12432
|
-
clearInput();
|
|
12433
|
-
|
|
13127
|
+
clearInput === null || clearInput === void 0 ? void 0 : clearInput();
|
|
13128
|
+
if (!searchedProduct) return Promise.resolve();
|
|
13129
|
+
addProductsToList([_extends({}, searchedProduct, {
|
|
12434
13130
|
quantity: 1
|
|
12435
|
-
})]
|
|
13131
|
+
})]);
|
|
12436
13132
|
return Promise.resolve();
|
|
12437
13133
|
} catch (e) {
|
|
12438
13134
|
return Promise.reject(e);
|
|
12439
13135
|
}
|
|
12440
13136
|
};
|
|
12441
|
-
var handleRemoveProduct = function handleRemoveProduct(data
|
|
13137
|
+
var handleRemoveProduct = function handleRemoveProduct(data) {
|
|
12442
13138
|
var response = confirm('Are you sure, do you want to delete this items?');
|
|
12443
13139
|
if (response) {
|
|
12444
|
-
|
|
12445
|
-
return
|
|
13140
|
+
setProducts(function (prev) {
|
|
13141
|
+
return (prev || []).filter(function (p) {
|
|
13142
|
+
return (p === null || p === void 0 ? void 0 : p.rowId) !== (data === null || data === void 0 ? void 0 : data.rowId);
|
|
13143
|
+
});
|
|
12446
13144
|
});
|
|
12447
|
-
setProducts([].concat(filterProduct));
|
|
12448
13145
|
}
|
|
12449
13146
|
};
|
|
12450
|
-
var handleIncrementDecrement = function handleIncrementDecrement(data) {
|
|
12451
|
-
|
|
12452
|
-
|
|
12453
|
-
|
|
13147
|
+
var handleIncrementDecrement = function handleIncrementDecrement(data) {
|
|
13148
|
+
if (!(data !== null && data !== void 0 && data.rowId)) return;
|
|
13149
|
+
setProducts(function (prev) {
|
|
13150
|
+
return (prev || []).map(function (p) {
|
|
13151
|
+
return (p === null || p === void 0 ? void 0 : p.rowId) === (data === null || data === void 0 ? void 0 : data.rowId) ? _extends({}, p, {
|
|
13152
|
+
quantity: data === null || data === void 0 ? void 0 : data.quantity
|
|
13153
|
+
}) : p;
|
|
13154
|
+
});
|
|
13155
|
+
});
|
|
13156
|
+
};
|
|
13157
|
+
var handleAddToCart = function handleAddToCart(selectedIds) {
|
|
13158
|
+
if (selectedIds === void 0) {
|
|
13159
|
+
selectedIds = [];
|
|
13160
|
+
}
|
|
13161
|
+
try {
|
|
13162
|
+
if (typeof onAddToCart !== 'function' || addingToCart) return Promise.resolve();
|
|
13163
|
+
var safeSelectedIds = Array.isArray(selectedIds) ? selectedIds : [];
|
|
13164
|
+
var ids = new Set(safeSelectedIds);
|
|
13165
|
+
var allRows = (products || []).filter(Boolean);
|
|
13166
|
+
var rowsToAdd = safeSelectedIds.length ? allRows.filter(function (p) {
|
|
13167
|
+
return ids.has(p === null || p === void 0 ? void 0 : p.rowId);
|
|
13168
|
+
}) : allRows;
|
|
13169
|
+
var items = rowsToAdd.map(function (_ref2) {
|
|
13170
|
+
var rowId = _ref2.rowId,
|
|
13171
|
+
product = _objectWithoutPropertiesLoose(_ref2, _excluded$7);
|
|
13172
|
+
return product;
|
|
13173
|
+
});
|
|
13174
|
+
if (!items.length) return Promise.resolve();
|
|
13175
|
+
setAddingToCart(true);
|
|
13176
|
+
var _temp = _finallyRethrows(function () {
|
|
13177
|
+
return _catch(function () {
|
|
13178
|
+
return Promise.resolve(onAddToCart(items)).then(function (isAdded) {
|
|
13179
|
+
if (isAdded) {
|
|
13180
|
+
var addedIds = new Set(rowsToAdd.map(function (p) {
|
|
13181
|
+
return p === null || p === void 0 ? void 0 : p.rowId;
|
|
13182
|
+
}));
|
|
13183
|
+
setProducts(function (prev) {
|
|
13184
|
+
return (prev || []).filter(function (p) {
|
|
13185
|
+
return !addedIds.has(p === null || p === void 0 ? void 0 : p.rowId);
|
|
13186
|
+
});
|
|
13187
|
+
});
|
|
13188
|
+
}
|
|
13189
|
+
});
|
|
13190
|
+
}, function () {});
|
|
13191
|
+
}, function (_wasThrown, _result) {
|
|
13192
|
+
setAddingToCart(false);
|
|
13193
|
+
if (_wasThrown) throw _result;
|
|
13194
|
+
return _result;
|
|
13195
|
+
});
|
|
13196
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
13197
|
+
} catch (e) {
|
|
13198
|
+
return Promise.reject(e);
|
|
13199
|
+
}
|
|
13200
|
+
};
|
|
13201
|
+
var handleRemoveAll = function handleRemoveAll(selectedIds) {
|
|
13202
|
+
if (selectedIds === void 0) {
|
|
13203
|
+
selectedIds = [];
|
|
13204
|
+
}
|
|
13205
|
+
if (!Array.isArray(selectedIds) || !selectedIds.length) return;
|
|
13206
|
+
if (confirm("Are you sure you want to remove " + selectedIds.length + " selected item(s)?")) {
|
|
13207
|
+
var ids = new Set(selectedIds);
|
|
13208
|
+
setProducts(function (prev) {
|
|
13209
|
+
return (prev || []).filter(function (p) {
|
|
13210
|
+
return !ids.has(p === null || p === void 0 ? void 0 : p.rowId);
|
|
13211
|
+
});
|
|
13212
|
+
});
|
|
12454
13213
|
}
|
|
12455
13214
|
};
|
|
12456
13215
|
return /*#__PURE__*/React__default.createElement(ThemeProvider, {
|
|
12457
|
-
theme: colors
|
|
12458
|
-
|
|
13216
|
+
theme: colors || {
|
|
13217
|
+
primaryColor: '#424242'
|
|
13218
|
+
}
|
|
13219
|
+
}, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(CssBaseline, null), /*#__PURE__*/React__default.createElement(Container$2, null, /*#__PURE__*/React__default.createElement(TopBar, null, /*#__PURE__*/React__default.createElement("div", {
|
|
13220
|
+
className: "search"
|
|
13221
|
+
}, /*#__PURE__*/React__default.createElement(AsyncSelect, {
|
|
12459
13222
|
placeholder: 'Search Product',
|
|
12460
13223
|
minSearchChar: 3,
|
|
12461
13224
|
apiData: searchProductAPIData(),
|
|
12462
13225
|
onUpdate: onUpdate,
|
|
12463
13226
|
autoFocus: true
|
|
12464
|
-
}),
|
|
13227
|
+
})), /*#__PURE__*/React__default.createElement(LastOrderedWrapper, null, /*#__PURE__*/React__default.createElement(LastOrderedButton, {
|
|
13228
|
+
type: "button",
|
|
13229
|
+
onClick: handleLastOrderedProducts
|
|
13230
|
+
}, "Last Ordered Products"), /*#__PURE__*/React__default.createElement(ClickAwayListener, {
|
|
13231
|
+
onClickAway: function onClickAway() {
|
|
13232
|
+
return setInfoOpen(false);
|
|
13233
|
+
}
|
|
13234
|
+
}, /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
13235
|
+
title: "It will show the products from invoices from the last three months.",
|
|
13236
|
+
placement: "top",
|
|
13237
|
+
arrow: true,
|
|
13238
|
+
open: infoOpen,
|
|
13239
|
+
onOpen: function onOpen() {
|
|
13240
|
+
return setInfoOpen(true);
|
|
13241
|
+
},
|
|
13242
|
+
onClose: function onClose() {
|
|
13243
|
+
return setInfoOpen(false);
|
|
13244
|
+
}
|
|
13245
|
+
}, /*#__PURE__*/React__default.createElement(InfoIcon, {
|
|
13246
|
+
role: "button",
|
|
13247
|
+
tabIndex: 0,
|
|
13248
|
+
"aria-label": "Last ordered products info",
|
|
13249
|
+
onClick: function onClick() {
|
|
13250
|
+
return setInfoOpen(function (prev) {
|
|
13251
|
+
return !prev;
|
|
13252
|
+
});
|
|
13253
|
+
}
|
|
13254
|
+
}, /*#__PURE__*/React__default.createElement(AiOutlineInfoCircle, null)))))), (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ProductTable, {
|
|
13255
|
+
handleAddToCart: handleAddToCart,
|
|
13256
|
+
loading: addingToCart,
|
|
12465
13257
|
cartData: products,
|
|
12466
13258
|
imgnotfoundUrl: imgnotfoundUrl,
|
|
12467
13259
|
styles: styles,
|
|
12468
13260
|
handleRemoveProduct: handleRemoveProduct,
|
|
12469
13261
|
handleIncrementDecrement: handleIncrementDecrement,
|
|
12470
|
-
handleRemoveAll: handleRemoveAll
|
|
12471
|
-
|
|
13262
|
+
handleRemoveAll: handleRemoveAll,
|
|
13263
|
+
allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce,
|
|
13264
|
+
hideStock: hideStock
|
|
13265
|
+
})) : /*#__PURE__*/React__default.createElement(NoData, null), /*#__PURE__*/React__default.createElement(LastOrderedProductsDialog, {
|
|
13266
|
+
open: lastOrderedOpen,
|
|
13267
|
+
onClose: function onClose() {
|
|
13268
|
+
return setLastOrderedOpen(false);
|
|
13269
|
+
},
|
|
13270
|
+
onAdd: addProductsToList,
|
|
13271
|
+
apiEndPoint: apiEndPoint,
|
|
13272
|
+
token: token,
|
|
13273
|
+
imgnotfoundUrl: imgnotfoundUrl,
|
|
13274
|
+
styles: styles,
|
|
13275
|
+
allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce,
|
|
13276
|
+
hideStock: hideStock
|
|
13277
|
+
}))));
|
|
12472
13278
|
};
|
|
12473
13279
|
|
|
12474
13280
|
var RenderTawk = function RenderTawk(_ref) {
|
|
@@ -12533,7 +13339,7 @@ var SnowfallComponent = function SnowfallComponent(_ref) {
|
|
|
12533
13339
|
}) : null;
|
|
12534
13340
|
};
|
|
12535
13341
|
|
|
12536
|
-
var _templateObject$I, _templateObject2$
|
|
13342
|
+
var _templateObject$I, _templateObject2$x;
|
|
12537
13343
|
var ContactUsForm = function ContactUsForm(_ref) {
|
|
12538
13344
|
var apiEndPoint = _ref.apiEndPoint,
|
|
12539
13345
|
serviceApiEndPoint = _ref.serviceApiEndPoint,
|
|
@@ -12661,7 +13467,7 @@ var ContactUsForm = function ContactUsForm(_ref) {
|
|
|
12661
13467
|
var TypographyContainer$8 = styled(Typography)(_templateObject$I || (_templateObject$I = _taggedTemplateLiteralLoose(["\n color: ", ";\n display: flex;\n font-size: 1.2rem !important;\n align-items: center;\n"])), function (props) {
|
|
12662
13468
|
return props.fontColor;
|
|
12663
13469
|
});
|
|
12664
|
-
var RootContainer$3 = styled(Stack)(_templateObject2$
|
|
13470
|
+
var RootContainer$3 = styled(Stack)(_templateObject2$x || (_templateObject2$x = _taggedTemplateLiteralLoose(["\n background-color: ", " !important;\n border-radius: 14px !important;\n padding: 1.3rem;\n margin-bottom: 1rem;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px 0px;\n p {\n margin: 0 !important;\n }\n"])), function (props) {
|
|
12665
13471
|
return props.secondaryColor;
|
|
12666
13472
|
});
|
|
12667
13473
|
|
|
@@ -13063,7 +13869,7 @@ var StaticPageList = function StaticPageList(_ref) {
|
|
|
13063
13869
|
};
|
|
13064
13870
|
var TitleContainer$2 = styled.div(_templateObject$N || (_templateObject$N = _taggedTemplateLiteralLoose(["\n padding: 1.2rem;\n cursor: pointer;\n color: #323232;\n img {\n max-width: 100%;\n }\n &:hover {\n img {\n transform: scale(1.01);\n }\n }\n"])));
|
|
13065
13871
|
|
|
13066
|
-
var _excluded$
|
|
13872
|
+
var _excluded$8 = ["userName", "children", "style"];
|
|
13067
13873
|
var colors$1 = ['#FFB900', '#D83B01', '#B50E0E', '#E81123', '#B4009E', '#5C2D91', '#0078D7', '#00B4FF', '#008272', '#107C10'];
|
|
13068
13874
|
var getRandomColor = function getRandomColor(userName) {
|
|
13069
13875
|
return colors$1[(userName === null || userName === void 0 ? void 0 : userName.length) % (colors$1 === null || colors$1 === void 0 ? void 0 : colors$1.length)];
|
|
@@ -13082,7 +13888,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
13082
13888
|
var userName = _ref.userName,
|
|
13083
13889
|
children = _ref.children,
|
|
13084
13890
|
style = _ref.style,
|
|
13085
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
13891
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
|
13086
13892
|
var backgroundColor = '#1f62ff';
|
|
13087
13893
|
if (userName) {
|
|
13088
13894
|
backgroundColor = getRandomColor(userName);
|
|
@@ -13097,7 +13903,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
13097
13903
|
}));
|
|
13098
13904
|
};
|
|
13099
13905
|
|
|
13100
|
-
var _templateObject$O, _templateObject2$
|
|
13906
|
+
var _templateObject$O, _templateObject2$y;
|
|
13101
13907
|
var SwitchUser = function SwitchUser(_ref) {
|
|
13102
13908
|
var _customerData$filter, _customerData$filter$;
|
|
13103
13909
|
var apiEndPoint = _ref.apiEndPoint,
|
|
@@ -13185,13 +13991,13 @@ var SwitchUser = function SwitchUser(_ref) {
|
|
|
13185
13991
|
}))));
|
|
13186
13992
|
};
|
|
13187
13993
|
var RootContainer$4 = styled.div(_templateObject$O || (_templateObject$O = _taggedTemplateLiteralLoose(["\n margin: auto;\n padding: 2.4rem;\n max-width: 1920px;\n"])));
|
|
13188
|
-
var CustomerContainer = styled.div(_templateObject2$
|
|
13994
|
+
var CustomerContainer = styled.div(_templateObject2$y || (_templateObject2$y = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n transition: all 0.5s;\n padding: 1.1rem;\n border-radius: 1rem;\n box-shadow: 2px 2px 6px 0px #00000020;\n &:hover {\n transform: scale(1.05);\n }\n .name {\n color: ", ";\n font-size: 2.5rem;\n font-weight: 700;\n }\n .infoDetails {\n font-size: 1.1rem;\n color: #46464680;\n margin: 1rem 0;\n display: flex;\n align-items: center;\n svg {\n color: ", ";\n font-size: 1.5rem;\n margin-right: 0.5rem;\n }\n }\n"])), function (props) {
|
|
13189
13995
|
return props.theme.primaryColor || '#000000d9';
|
|
13190
13996
|
}, function (props) {
|
|
13191
13997
|
return props.theme.primaryColor || '#000000d9';
|
|
13192
13998
|
});
|
|
13193
13999
|
|
|
13194
|
-
var _templateObject$P, _templateObject2$
|
|
14000
|
+
var _templateObject$P, _templateObject2$z;
|
|
13195
14001
|
var ThankYou = function ThankYou(_ref) {
|
|
13196
14002
|
var _ref$id = _ref.id,
|
|
13197
14003
|
id = _ref$id === void 0 ? 0 : _ref$id,
|
|
@@ -13251,7 +14057,7 @@ var ThankYou = function ThankYou(_ref) {
|
|
|
13251
14057
|
}, /*#__PURE__*/React__default.createElement("p", null, "Continue Shopping"))))))));
|
|
13252
14058
|
};
|
|
13253
14059
|
var Root$d = styled(Box)(_templateObject$P || (_templateObject$P = _taggedTemplateLiteralLoose([""])));
|
|
13254
|
-
var StyledButton = styled.button(_templateObject2$
|
|
14060
|
+
var StyledButton = styled.button(_templateObject2$z || (_templateObject2$z = _taggedTemplateLiteralLoose(["\n outline: none;\n border: 1px solid;\n border-color: ", ";\n background: none;\n border-radius: 14px;\n padding: 10px 20px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n transition: background 0.5s ease;\n width: 200px;\n color: ", ";\n text-transform: uppercase;\n &:hover {\n cursor: pointer;\n background: ", ";\n color: #fff;\n }\n"])), function (props) {
|
|
13255
14061
|
return props.theme.primaryColor;
|
|
13256
14062
|
}, function (props) {
|
|
13257
14063
|
return props.theme.primaryColor;
|
|
@@ -13405,38 +14211,38 @@ var DiscountSummaryModal = function DiscountSummaryModal(_ref) {
|
|
|
13405
14211
|
}, "Okay"))));
|
|
13406
14212
|
};
|
|
13407
14213
|
|
|
13408
|
-
var _templateObject$Q, _templateObject2$
|
|
14214
|
+
var _templateObject$Q, _templateObject2$A, _templateObject3$r, _templateObject4$m, _templateObject5$i, _templateObject6$g, _templateObject7$c, _templateObject8$a;
|
|
13409
14215
|
var CheckoutRootContainer = styled.div(_templateObject$Q || (_templateObject$Q = _taggedTemplateLiteralLoose(["\n width: 100%;\n padding: 2rem;\n background-color: ", ";\n font-size: 16px;\n\n div,\n button,\n span {\n font-size: 16px;\n }\n @media only screen and (max-width: 1600px) {\n padding: 3em 0.5em;\n }\n @media screen and (max-width: 900px) {\n div,\n button,\n span {\n font-size: 12px;\n }\n padding: 2rem 0.5rem;\n }\n"])), function (props) {
|
|
13410
14216
|
return props.bg;
|
|
13411
14217
|
});
|
|
13412
|
-
var CheckoutPageContainer = styled.div(_templateObject2$
|
|
14218
|
+
var CheckoutPageContainer = styled.div(_templateObject2$A || (_templateObject2$A = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: ", ";\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n background-color: ", ";\n margin: 0 auto;\n padding: 2em;\n padding-left: min(4.5em, 2.5vw);\n color: rgba(50, 50, 50, 1);\n /* max-height: 90vh; */\n overflow: hidden;\n /* background: gainsboro; */\n border-radius: 28px;\n /* background-color: #fff8f6; */\n @media only screen and (max-width: 1200px) {\n flex-direction: column;\n align-items: center;\n max-height: max-content;\n }\n @media only screen and (max-width: 768px) {\n padding: 1em 0.5em;\n }\n .icon {\n font-size: 12px;\n }\n ////////////checkout and cart fonts\n /////////////////\n /* /////remove arrows from number input */\n /* Chrome, Safari, Edge, Opera */\n input::-webkit-outer-spin-button,\n input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n /* Firefox */\n input[type='number'] {\n -moz-appearance: textfield;\n }\n\n /* //////mui inputs */\n\n .Mui-checked {\n color: ", ";\n }\n\n .MuiOutlinedInput-notchedOutline {\n border: none;\n outline: none;\n }\n\n .MuiInputBase-root .MuiOutlinedInput-root,\n .MuiInputBase-colorPrimary,\n .MuiInputBase-fullWidth,\n .MuiInputBase-formControl {\n border-radius: 10px;\n }\n // /* /////stepper length */\n .MuiStepConnector-line,\n .MuiStepConnector-lineVertical {\n min-height: 60px !important;\n }\n\n @media only screen and (max-width: 900px) {\n .MuiStepConnector-line,\n .MuiStepConnector-lineVertical {\n min-height: 40px !important;\n }\n }\n"])), function (props) {
|
|
13413
14219
|
return props.maxWidth || '1605px';
|
|
13414
14220
|
}, function (props) {
|
|
13415
14221
|
return props.bg || '#fff8f6';
|
|
13416
14222
|
}, function (props) {
|
|
13417
14223
|
return props.primaryColor || 'rgba(50, 50, 50, 1)';
|
|
13418
14224
|
});
|
|
13419
|
-
var Row = styled.div(_templateObject3$
|
|
13420
|
-
var CheckoutMainWithHeader = styled(Stack)(_templateObject4$
|
|
13421
|
-
var CheckoutMain = styled.div(_templateObject5$
|
|
14225
|
+
var Row = styled.div(_templateObject3$r || (_templateObject3$r = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
14226
|
+
var CheckoutMainWithHeader = styled(Stack)(_templateObject4$m || (_templateObject4$m = _taggedTemplateLiteralLoose(["\n width: 100%;\n"])));
|
|
14227
|
+
var CheckoutMain = styled.div(_templateObject5$i || (_templateObject5$i = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: 1008px;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n margin-right: 2em;\n max-height: 65vh;\n padding-right: 2em;\n overflow-y: auto;\n position: relative;\n padding-top: 2em;\n padding-bottom: 3em;\n /* width */\n ::-webkit-scrollbar {\n width: 10px;\n background: ", ";\n border-radius: 16px;\n }\n\n /* Track */\n ::-webkit-scrollbar-track {\n background: ", ";\n border-radius: 16px;\n }\n\n /* Handle */\n ::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 16px;\n }\n @media only screen and (max-width: 1200px) {\n margin-bottom: 3em;\n min-height: max-content;\n max-height: max-content;\n margin-right: 0;\n overflow: visible;\n }\n @media only screen and (max-width: 768px) {\n // max-width: 100vw;\n padding-right: 0;\n // width: 98vw;\n // min-width: 90vw;\n padding-top: 1em;\n }\n /* overflow: hidden; */\n"])), function (props) {
|
|
13422
14228
|
return props.bg || 'rgba(102,112,128,0.5)';
|
|
13423
14229
|
}, function (props) {
|
|
13424
14230
|
return props.bg || 'rgba(102,112,128,0.5)';
|
|
13425
14231
|
}, function (props) {
|
|
13426
14232
|
return props.color;
|
|
13427
14233
|
});
|
|
13428
|
-
var CheckoutHeading = styled.div(_templateObject6$
|
|
13429
|
-
var CheckoutHeader = styled(Row)(_templateObject7$
|
|
13430
|
-
var CheckoutStepIcon = styled.div(_templateObject8$
|
|
14234
|
+
var CheckoutHeading = styled.div(_templateObject6$g || (_templateObject6$g = _taggedTemplateLiteralLoose(["\n margin-left: 2.5em;\n margin-bottom: 2em;\n h5 {\n font-size: 2.3em;\n font-weight: 600;\n text-transform: capitalize;\n }\n p {\n font-size: 0.875em;\n margin-top: 0.5em;\n }\n @media only screen and (max-width: 768px) {\n margin-left: 0;\n padding-left: 1em;\n }\n"])));
|
|
14235
|
+
var CheckoutHeader = styled(Row)(_templateObject7$c || (_templateObject7$c = _taggedTemplateLiteralLoose(["\n width: 100%;\n overflow: auto;\n justify-content: space-around;\n display: flex;\n flex-direction: row;\n align-items: center;\n position: sticky;\n top: 0;\n background-color: white;\n z-index: 1;\n justify-content: flex-start;\n min-height: 4em;\n max-height: 4em;\n max-width: 60em;\n background: #ffffff;\n border-radius: 20px;\n color: #7d7b7b;\n padding: 0 2em;\n margin: 0 2em 1em 1em;\n .row {\n display: flex;\n color: inherit;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n text-transform: capitalize;\n margin-right: 2.4%;\n .icon {\n font-size: 14px;\n font-weight: 400;\n display: grid;\n place-items: center;\n margin-right: 6px;\n color: inherit;\n }\n p,\n span {\n font-size: 0.95em;\n color: inherit;\n }\n }\n .checked {\n p,\n span {\n color: #323232;\n }\n .icon {\n color: #249937;\n }\n }\n @media only screen and (max-width: 1200px) {\n margin-right: 0em;\n }\n @media only screen and (max-width: 768px) {\n width: 100%;\n padding: 2em 1em;\n margin: 1.4em 0;\n .row {\n margin-right: 4.5%;\n p {\n font-size: 12px;\n }\n span {\n display: none;\n }\n }\n }\n"])));
|
|
14236
|
+
var CheckoutStepIcon = styled.div(_templateObject8$a || (_templateObject8$a = _taggedTemplateLiteralLoose(["\n width: 20px;\n height: 20px;\n border-radius: 50%;\n font-size: 5px;\n display: grid;\n place-items: center;\n margin: auto;\n padding: 0;\n margin-left: 2px;\n .circle {\n width: 16px;\n height: 16px;\n border-radius: 50%;\n font-size: 5px;\n display: grid;\n place-items: center;\n margin: auto;\n padding: 0;\n }\n .ic {\n font-size: 8px;\n }\n"])));
|
|
13431
14237
|
|
|
13432
|
-
var _templateObject$R, _templateObject2$
|
|
14238
|
+
var _templateObject$R, _templateObject2$B, _templateObject3$s;
|
|
13433
14239
|
var CheckoutSummaryContainer = styled.div(_templateObject$R || (_templateObject$R = _taggedTemplateLiteralLoose(["\n background: ", ";\n color: ", ";\n border-radius: 20px;\n padding: max(1.5em, 30px);\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n max-width: 25rem;\n min-width: min(25rem, 95%);\n font-size: 16px;\n margin-top: 6.15em;\n @media only screen and (max-width: 1200px) {\n margin-top: 0;\n }\n"])), function (props) {
|
|
13434
14240
|
return props.bg || 'rgba(255, 240, 236, 1)';
|
|
13435
14241
|
}, function (props) {
|
|
13436
14242
|
return props.color || ' rgba(50, 50, 50, 1)';
|
|
13437
14243
|
});
|
|
13438
|
-
var TextRow = styled.div(_templateObject2$
|
|
13439
|
-
var FilledInfo = styled.div(_templateObject3$
|
|
14244
|
+
var TextRow = styled.div(_templateObject2$B || (_templateObject2$B = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n max-width: 90%;\n margin-bottom: 0.8rem;\n padding-bottom: 0.8rem;\n width: 90%;\n border-bottom: 1px solid #f7f7f7;\n .text {\n font-size: 1.1em;\n text-transform: capitalize;\n }\n .total {\n font-size: 1.65em;\n font-weight: 800;\n }\n"])));
|
|
14245
|
+
var FilledInfo = styled.div(_templateObject3$s || (_templateObject3$s = _taggedTemplateLiteralLoose(["\n margin-bottom: 2em;\n .heading {\n font-size: 1.25em;\n font-weight: 800;\n margin-bottom: 0.8em;\n }\n\n p {\n font-size: 0.875em;\n text-transform: capitalize;\n max-width: 60%;\n }\n .bold {\n font-weight: 700;\n margin-bottom: 0.8em;\n max-width: 300px;\n width: fit-content;\n }\n .payment {\n width: 70px;\n height: 48px;\n background: #ffffff;\n border-radius: 15.875px;\n display: grid;\n place-items: center;\n overflow: hidden;\n }\n .blank {\n opacity: 0;\n }\n"])));
|
|
13440
14246
|
|
|
13441
14247
|
var CheckoutSummary = function CheckoutSummary(_ref) {
|
|
13442
14248
|
var billingInformation = _ref.billingInformation,
|
|
@@ -13508,14 +14314,14 @@ var CheckoutSummary = function CheckoutSummary(_ref) {
|
|
|
13508
14314
|
}, renderMoney(orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.adjustmentValue))));
|
|
13509
14315
|
};
|
|
13510
14316
|
|
|
13511
|
-
var _templateObject$S, _templateObject2$
|
|
14317
|
+
var _templateObject$S, _templateObject2$C, _templateObject3$t, _templateObject4$n, _templateObject5$j, _templateObject6$h, _templateObject7$d, _templateObject8$b, _templateObject9$7, _templateObject10$6, _templateObject11$4, _templateObject12$3, _templateObject13$3, _templateObject14$3, _templateObject15$3, _templateObject16$3, _templateObject17$3, _templateObject18$3;
|
|
13512
14318
|
var StepContainer = styled.div(_templateObject$S || (_templateObject$S = _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"])));
|
|
13513
|
-
var StepsContent = styled.div(_templateObject2$
|
|
14319
|
+
var StepsContent = styled.div(_templateObject2$C || (_templateObject2$C = _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) {
|
|
13514
14320
|
return 'transparent' + '!important';
|
|
13515
14321
|
}, function (props) {
|
|
13516
14322
|
return props.bg || 'red';
|
|
13517
14323
|
});
|
|
13518
|
-
var StepsHeaderContainer = styled.div(_templateObject3$
|
|
14324
|
+
var StepsHeaderContainer = styled.div(_templateObject3$t || (_templateObject3$t = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n color: #323232;\n /* padding: ", "; */\n margin-bottom: ", ";\n margin-top: ", ";\n margin-left: ", ";\n /* color: grey; */\n border-bottom: 1px solid #f6f6f6;\n background: #ffffff;\n border-radius: 20px;\n // max-width: 900px;\n min-height: 4.35em;\n max-height: 4.35em;\n padding: ", ";\n h5 {\n font-size: 16px;\n font-weight: 600;\n text-transform: capitalize;\n margin-left: 0.6em;\n }\n .icon {\n font-size: 1.3em;\n margin-right: 8px;\n }\n .dropIcon {\n font-size: 1.4em;\n cursor: pointer;\n transform: rotate(-90deg);\n transition: 0.3s;\n color: rgba(50, 50, 50, 0.75);\n cursor: ", ";\n }\n .red {\n font-weight: 600;\n color: #fd0015;\n font-size: inherit;\n }\n @media screen and (max-width: 768px) {\n max-width: 97%;\n margin-left: 0.5em;\n padding-right: 1em;\n h5 {\n font-size: 12px;\n }\n }\n"])), function (props) {
|
|
13519
14325
|
return props.single ? '1.8em 2em' : '1em 0';
|
|
13520
14326
|
}, function (props) {
|
|
13521
14327
|
return props.single ? '-1.56em' : '1em';
|
|
@@ -13528,11 +14334,11 @@ var StepsHeaderContainer = styled.div(_templateObject3$s || (_templateObject3$s
|
|
|
13528
14334
|
}, function (props) {
|
|
13529
14335
|
return props.username ? 'not-allowed' : 'pointer';
|
|
13530
14336
|
});
|
|
13531
|
-
var TextFeildContainer = styled.div(_templateObject4$
|
|
14337
|
+
var TextFeildContainer = styled.div(_templateObject4$n || (_templateObject4$n = _taggedTemplateLiteralLoose(["\n label {\n color: rgba(107, 106, 106, 0.6) !important;\n }\n background: ", ";\n border-radius: 10px;\n && {\n input {\n font-size: 0.875em !important;\n color: black;\n &::placeholder {\n font-size: 0.975em !important;\n }\n }\n .icon {\n color: black;\n font-size: 1em;\n }\n }\n"])), function (props) {
|
|
13532
14338
|
var _props$theme, _props$theme$input;
|
|
13533
14339
|
return ((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : (_props$theme$input = _props$theme.input) === null || _props$theme$input === void 0 ? void 0 : _props$theme$input.bg) || 'transparent';
|
|
13534
14340
|
});
|
|
13535
|
-
var CommonCheckoutBtn = styled.button(_templateObject5$
|
|
14341
|
+
var CommonCheckoutBtn = styled.button(_templateObject5$j || (_templateObject5$j = _taggedTemplateLiteralLoose(["\n border: none;\n outline: none;\n width: ", ";\n height: ", ";\n background: ", ";\n display: grid;\n place-items: center;\n color: white;\n margin: 0 1em;\n font-weight: 500;\n letter-spacing: 1px;\n text-transform: ", ";\n transition: 0.4s;\n cursor: ", ";\n &:hover,\n &:focus {\n opacity: 0.7;\n }\n"])), function (props) {
|
|
13536
14342
|
return props.width || '8.05em';
|
|
13537
14343
|
}, function (props) {
|
|
13538
14344
|
return props.height || '2.25em';
|
|
@@ -13545,7 +14351,7 @@ var CommonCheckoutBtn = styled.button(_templateObject5$i || (_templateObject5$i
|
|
|
13545
14351
|
});
|
|
13546
14352
|
var Select = styled.div.attrs({
|
|
13547
14353
|
className: 'checkout-input'
|
|
13548
|
-
})(_templateObject6$
|
|
14354
|
+
})(_templateObject6$h || (_templateObject6$h = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: 54px;\n border-radius: 10px;\n background: ", ";\n outline: none;\n border: none;\n padding: 0 1em;\n cursor: pointer;\n select {\n width: 100%;\n height: 100%;\n border: none;\n outline: none;\n padding: 0.5em 0;\n color: rgba(107, 106, 106, 0.6);\n background: ", ";\n }\n"])), function (props) {
|
|
13549
14355
|
var _props$theme2, _props$theme2$input;
|
|
13550
14356
|
return ((_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : (_props$theme2$input = _props$theme2.input) === null || _props$theme2$input === void 0 ? void 0 : _props$theme2$input.bg) || 'transparent';
|
|
13551
14357
|
}, function (props) {
|
|
@@ -13553,12 +14359,12 @@ var Select = styled.div.attrs({
|
|
|
13553
14359
|
});
|
|
13554
14360
|
var SaveButton = styled.button.attrs({
|
|
13555
14361
|
className: 'checkout-btn'
|
|
13556
|
-
})(_templateObject7$
|
|
14362
|
+
})(_templateObject7$d || (_templateObject7$d = _taggedTemplateLiteralLoose(["\n border: none;\n outline: none;\n font-size: 0.8125em;\n text-transform: uppercase;\n font-weight: 600;\n border-radius: 7px;\n padding: 0.55em 1em;\n background: ", ";\n display: grid;\n place-items: center;\n color: white;\n margin: 1em 0;\n letter-spacing: 1px;\n transition: 0.4s;\n cursor: ", ";\n &:hover,\n &:focus {\n opacity: 0.7;\n }\n"])), function (props) {
|
|
13557
14363
|
return props.color || '#FD0015';
|
|
13558
14364
|
}, function (props) {
|
|
13559
14365
|
return props.disabled ? 'not-allowed' : 'pointer';
|
|
13560
14366
|
});
|
|
13561
|
-
var ButtonRowContainer = styled.div(_templateObject8$
|
|
14367
|
+
var ButtonRowContainer = styled.div(_templateObject8$b || (_templateObject8$b = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-items: center;\n button {\n width: 4.862em;\n height: 1.96em;\n border-radius: 0.43em;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n letter-spacing: 1px;\n color: white;\n opacity: ", ";\n background-color: ", ";\n border: 2px solid\n ", ";\n cursor: ", ";\n }\n .back {\n font-size: 0.875em;\n font-weight: 500;\n justify-content: flex-start;\n margin-right: 0.2em;\n color: #323232;\n background: transparent;\n border: none;\n cursor: ", ";\n font-size: 0.8em;\n transition: 0.4s;\n opacity: 1;\n .icon {\n font-size: 1.2em;\n margin-right: 2px;\n }\n &:hover,\n &:focus {\n letter-spacing: 1px;\n outline: none;\n }\n }\n"])), function (props) {
|
|
13562
14368
|
return props.disabledNext && '0.5';
|
|
13563
14369
|
}, function (props) {
|
|
13564
14370
|
return props.color || '#fd0015';
|
|
@@ -13580,7 +14386,7 @@ var CheckBoxRow = styled.div(_templateObject9$7 || (_templateObject9$7 = _tagged
|
|
|
13580
14386
|
}, function (prop) {
|
|
13581
14387
|
return prop.colorText || 'red';
|
|
13582
14388
|
});
|
|
13583
|
-
var CreditCardFextField = styled.div(_templateObject10$
|
|
14389
|
+
var CreditCardFextField = styled.div(_templateObject10$6 || (_templateObject10$6 = _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) {
|
|
13584
14390
|
return prop.bgInput + '!important' || '';
|
|
13585
14391
|
}, function (prop) {
|
|
13586
14392
|
return prop.btnBg + '!important' || '';
|
|
@@ -13809,7 +14615,7 @@ var Step0 = function Step0(_ref) {
|
|
|
13809
14615
|
sm: 4
|
|
13810
14616
|
}), /*#__PURE__*/React__default.createElement(CheckBoxRow, {
|
|
13811
14617
|
padding: ".8em 0 0 0"
|
|
13812
|
-
}, /*#__PURE__*/React__default.createElement(Checkbox
|
|
14618
|
+
}, /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
13813
14619
|
size: "small"
|
|
13814
14620
|
}), /*#__PURE__*/React__default.createElement("p", null, "Remember me")), /*#__PURE__*/React__default.createElement(Grid, {
|
|
13815
14621
|
item: true,
|
|
@@ -14076,7 +14882,7 @@ var Step1 = function Step1(_ref) {
|
|
|
14076
14882
|
setShowShipping(false);
|
|
14077
14883
|
},
|
|
14078
14884
|
bg: styles === null || styles === void 0 ? void 0 : (_styles$button2 = styles.button) === null || _styles$button2 === void 0 ? void 0 : _styles$button2.bg
|
|
14079
|
-
}, /*#__PURE__*/React__default.createElement(Checkbox
|
|
14885
|
+
}, /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
14080
14886
|
checked: !showShipping,
|
|
14081
14887
|
icon: /*#__PURE__*/React__default.createElement(MdOutlineCircle, null),
|
|
14082
14888
|
checkedIcon: /*#__PURE__*/React__default.createElement(GrRadialSelected, null)
|
|
@@ -14086,7 +14892,7 @@ var Step1 = function Step1(_ref) {
|
|
|
14086
14892
|
setShowShipping(true);
|
|
14087
14893
|
},
|
|
14088
14894
|
bg: styles === null || styles === void 0 ? void 0 : (_styles$button3 = styles.button) === null || _styles$button3 === void 0 ? void 0 : _styles$button3.bg
|
|
14089
|
-
}, /*#__PURE__*/React__default.createElement(Checkbox
|
|
14895
|
+
}, /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
14090
14896
|
checked: showShipping,
|
|
14091
14897
|
icon: /*#__PURE__*/React__default.createElement(MdOutlineCircle, null),
|
|
14092
14898
|
checkedIcon: /*#__PURE__*/React__default.createElement(GrRadialSelected, null)
|
|
@@ -14927,7 +15733,7 @@ var Step3 = function Step3(_ref) {
|
|
|
14927
15733
|
paddingBottom: '1.5em',
|
|
14928
15734
|
marginTop: '-1em'
|
|
14929
15735
|
}
|
|
14930
|
-
}, /*#__PURE__*/React__default.createElement(Checkbox
|
|
15736
|
+
}, /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
14931
15737
|
size: "small",
|
|
14932
15738
|
onChange: function onChange(e) {
|
|
14933
15739
|
setUseStoreCr(e.target.checked);
|
|
@@ -15021,7 +15827,7 @@ var Step3 = function Step3(_ref) {
|
|
|
15021
15827
|
states: states,
|
|
15022
15828
|
countries: countries,
|
|
15023
15829
|
setSelectedCountry: setSelectedCountry
|
|
15024
|
-
}), addNewCard && beforeAddNewCardText && /*#__PURE__*/React__default.createElement(CheckBoxRow, null, /*#__PURE__*/React__default.createElement(Checkbox
|
|
15830
|
+
}), addNewCard && beforeAddNewCardText && /*#__PURE__*/React__default.createElement(CheckBoxRow, null, /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
15025
15831
|
size: "small",
|
|
15026
15832
|
onChange: function onChange(e) {
|
|
15027
15833
|
return setBeforeCreditCardChecked(e.target.checked);
|
|
@@ -15082,7 +15888,7 @@ var erSessionStorage = {
|
|
|
15082
15888
|
}
|
|
15083
15889
|
};
|
|
15084
15890
|
|
|
15085
|
-
var _templateObject$T, _templateObject2$
|
|
15891
|
+
var _templateObject$T, _templateObject2$D;
|
|
15086
15892
|
var ConsentForm = function ConsentForm(_ref) {
|
|
15087
15893
|
var apiEndPoint = _ref.apiEndPoint,
|
|
15088
15894
|
token = _ref.token,
|
|
@@ -15261,7 +16067,7 @@ var InfoItem = function InfoItem(_ref3) {
|
|
|
15261
16067
|
item: true
|
|
15262
16068
|
}, /*#__PURE__*/React__default.createElement("p", null, value))));
|
|
15263
16069
|
};
|
|
15264
|
-
var InfoItemContainer = styled.div(_templateObject2$
|
|
16070
|
+
var InfoItemContainer = styled.div(_templateObject2$D || (_templateObject2$D = _taggedTemplateLiteralLoose(["\n background: #00000010;\n padding: 0.5rem;\n"])));
|
|
15265
16071
|
|
|
15266
16072
|
var PaypalComponent = function PaypalComponent(_ref) {
|
|
15267
16073
|
var apiEndPoint = _ref.apiEndPoint,
|
|
@@ -15681,7 +16487,7 @@ var Step4 = function Step4(_ref) {
|
|
|
15681
16487
|
}))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
15682
16488
|
item: true,
|
|
15683
16489
|
xs: 12
|
|
15684
|
-
}, /*#__PURE__*/React__default.createElement(CheckBoxRow, null, /*#__PURE__*/React__default.createElement(Checkbox
|
|
16490
|
+
}, /*#__PURE__*/React__default.createElement(CheckBoxRow, null, /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
15685
16491
|
size: "small",
|
|
15686
16492
|
value: checked,
|
|
15687
16493
|
onChange: function onChange() {
|
|
@@ -16650,7 +17456,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref9) {
|
|
|
16650
17456
|
}, props)));
|
|
16651
17457
|
};
|
|
16652
17458
|
|
|
16653
|
-
var _templateObject$U, _templateObject2$
|
|
17459
|
+
var _templateObject$U, _templateObject2$E, _templateObject3$u;
|
|
16654
17460
|
var columns$1 = [{
|
|
16655
17461
|
id: 'id',
|
|
16656
17462
|
label: 'Id',
|
|
@@ -16766,10 +17572,10 @@ var PurchaseOrderList = function PurchaseOrderList(_ref) {
|
|
|
16766
17572
|
})));
|
|
16767
17573
|
};
|
|
16768
17574
|
var TableContainer$3 = styled.div(_templateObject$U || (_templateObject$U = _taggedTemplateLiteralLoose(["\n margin: 0.5rem;\n border-radius: 14px;\n"])));
|
|
16769
|
-
var TypographyContainer$9 = styled(Typography)(_templateObject2$
|
|
17575
|
+
var TypographyContainer$9 = styled(Typography)(_templateObject2$E || (_templateObject2$E = _taggedTemplateLiteralLoose(["\n color: ", ";\n display: flex;\n align-items: center;\n"])), function (props) {
|
|
16770
17576
|
return props.fontColor;
|
|
16771
17577
|
});
|
|
16772
|
-
var TitleContainer$3 = styled.h4(_templateObject3$
|
|
17578
|
+
var TitleContainer$3 = styled.h4(_templateObject3$u || (_templateObject3$u = _taggedTemplateLiteralLoose(["\n font-size: 2.7rem;\n span {\n color: '#000';\n font-weight: 500;\n }\n b {\n color: ", ";\n }\n @media only screen and (max-width: 608px) {\n font-size: 2.2rem;\n }\n"])), function (props) {
|
|
16773
17579
|
return props.primaryColor;
|
|
16774
17580
|
});
|
|
16775
17581
|
|
|
@@ -17340,7 +18146,7 @@ var VendorInventory = function VendorInventory(_ref) {
|
|
|
17340
18146
|
})));
|
|
17341
18147
|
};
|
|
17342
18148
|
|
|
17343
|
-
var _templateObject$V, _templateObject2$
|
|
18149
|
+
var _templateObject$V, _templateObject2$F, _templateObject3$v, _templateObject4$o, _templateObject5$k, _templateObject6$i, _templateObject7$e, _templateObject8$c;
|
|
17344
18150
|
var VendorLogin = function VendorLogin(_ref) {
|
|
17345
18151
|
var primaryColor = _ref.primaryColor,
|
|
17346
18152
|
API_BASE_URL = _ref.API_BASE_URL;
|
|
@@ -17447,15 +18253,15 @@ var VendorLogin = function VendorLogin(_ref) {
|
|
|
17447
18253
|
}) : 'sign in'))))));
|
|
17448
18254
|
};
|
|
17449
18255
|
var Container$3 = styled.div(_templateObject$V || (_templateObject$V = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n background: rgb(255, 255, 255);\n font-size: 16px !important;\n padding: 1rem;\n @media only screen and (max-width: 640px) {\n font-size: 14px !important;\n }\n"])));
|
|
17450
|
-
var StyledLogin = styled.div(_templateObject2$
|
|
17451
|
-
var StyledCard = styled(Card$1)(_templateObject3$
|
|
17452
|
-
var H1 = styled(Typography)(_templateObject4$
|
|
17453
|
-
var StyleInputBx = styled.div(_templateObject5$
|
|
17454
|
-
var ShowPassBtn = styled.span(_templateObject6$
|
|
17455
|
-
var ButtonContianer = styled.span(_templateObject7$
|
|
17456
|
-
var StyledButton$1 = styled(Button)(_templateObject8$
|
|
18256
|
+
var StyledLogin = styled.div(_templateObject2$F || (_templateObject2$F = _taggedTemplateLiteralLoose(["\n height: 70%;\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: 1em;\n align-items: center;\n"])));
|
|
18257
|
+
var StyledCard = styled(Card$1)(_templateObject3$v || (_templateObject3$v = _taggedTemplateLiteralLoose(["\n width: min(100%, 489px);\n height: 100%;\n max-height: 450px;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 1px solid #cac8c8;\n flex-direction: column;\n background: white;\n // min-height: 500px;\n h4 {\n font-size: 1.5em;\n margin-bottom: 1em;\n margin-top: -2em;\n text-transform: uppercase;\n font-weight: 500;\n }\n button {\n text-transform: capitalize;\n letter-spacing: 1px;\n font-size: 1em;\n font-weight: 500;\n }\n"])));
|
|
18258
|
+
var H1 = styled(Typography)(_templateObject4$o || (_templateObject4$o = _taggedTemplateLiteralLoose(["\n margin-top: 1rem;\n"])));
|
|
18259
|
+
var StyleInputBx = styled.div(_templateObject5$k || (_templateObject5$k = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n align-items: center;\n border: 1px solid rgb(202, 200, 200);\n // padding:.5em;\n min-width: min(80vw, 360px);\n // border-radius: 20px;\n overflow: hidden;\n margin: 0.6em 0;\n // padding:.2em 0;\n .icon {\n border-right: 1px solid rgb(202, 200, 200);\n height: 100%;\n padding: 1em;\n display: grid;\n place-items: center;\n width: 15%;\n box-sizing: border-box;\n color: grey;\n }\n input {\n width: 85%;\n height: 100%;\n outline: none;\n padding: 0 1em;\n font-size: 1.1em;\n border: none;\n &:focus,\n &:hover {\n outline: none !important;\n }\n }\n"])));
|
|
18260
|
+
var ShowPassBtn = styled.span(_templateObject6$i || (_templateObject6$i = _taggedTemplateLiteralLoose(["\n padding-right: 0.4em;\n display: grid;\n place-items: center;\n font-size: 25px;\n color: grey;\n cursor: pointer;\n"])));
|
|
18261
|
+
var ButtonContianer = styled.span(_templateObject7$e || (_templateObject7$e = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: 360px;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n // @include flexRow(space-between);\n margin-top: 1em;\n @media only screen and (max-width: 640px) {\n padding: 0 1em;\n }\n"])));
|
|
18262
|
+
var StyledButton$1 = styled(Button)(_templateObject8$c || (_templateObject8$c = _taggedTemplateLiteralLoose(["\n width: 100px;\n height: 46px;\n box-sizing: border-box;\n\n span {\n padding: 0.5em;\n }\n @media only screen and (max-width: 640px) {\n height: 35px;\n }\n"])));
|
|
17457
18263
|
|
|
17458
|
-
var _templateObject$W, _templateObject2$
|
|
18264
|
+
var _templateObject$W, _templateObject2$G, _templateObject3$w, _templateObject4$p;
|
|
17459
18265
|
var menuItems = [{
|
|
17460
18266
|
name: 'My Account',
|
|
17461
18267
|
Icon: RiAccountBoxLine,
|
|
@@ -17664,7 +18470,7 @@ var VendorAccountDetails = function VendorAccountDetails(_ref) {
|
|
|
17664
18470
|
}) : /*#__PURE__*/React__default.createElement(Fragment$1, null, API_BASE_URL && token && renderListItemComponent(tabValue)))))));
|
|
17665
18471
|
};
|
|
17666
18472
|
var Root$e = styled(Box)(_templateObject$W || (_templateObject$W = _taggedTemplateLiteralLoose(["\n padding: 1.4rem;\n background-color: #fff;\n @media only screen and (max-width: 608px) {\n padding: 0.5rem;\n }\n"])));
|
|
17667
|
-
var MainContainer$4 = styled.div(_templateObject2$
|
|
18473
|
+
var MainContainer$4 = styled.div(_templateObject2$G || (_templateObject2$G = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n margin: auto;\n min-height: 100vh;\n background-color: #fff;\n max-width: ", ";\n padding: 2rem;\n border-radius: 14px;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px 0px;\n @media only screen and (max-width: 608px) {\n padding: 0.5rem;\n }\n"])), function (props) {
|
|
17668
18474
|
return props.open ? '1800px' : '1600px';
|
|
17669
18475
|
});
|
|
17670
18476
|
var Main$1 = styled$1('main', {
|
|
@@ -17697,12 +18503,12 @@ var Main$1 = styled$1('main', {
|
|
|
17697
18503
|
overflow: 'auto'
|
|
17698
18504
|
});
|
|
17699
18505
|
});
|
|
17700
|
-
var ContainerDrawer$1 = styled(Drawer)(_templateObject3$
|
|
18506
|
+
var ContainerDrawer$1 = styled(Drawer)(_templateObject3$w || (_templateObject3$w = _taggedTemplateLiteralLoose(["\n // height: 100%;\n margin-right: ", ";\n .MuiDrawer-paper {\n padding: 1rem;\n position: relative;\n z-index: 1;\n background: ", ";\n border-radius: 14px;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px 0px;\n }\n"])), function (props) {
|
|
17701
18507
|
return props.open && '2rem';
|
|
17702
18508
|
}, function (props) {
|
|
17703
18509
|
return props.primaryColor || transparent;
|
|
17704
18510
|
});
|
|
17705
|
-
var TypographyContainer$a = styled(Typography)(_templateObject4$
|
|
18511
|
+
var TypographyContainer$a = styled(Typography)(_templateObject4$p || (_templateObject4$p = _taggedTemplateLiteralLoose(["\n color: ", ";\n display: flex;\n align-items: center;\n"])), function (props) {
|
|
17706
18512
|
return props.fontColor;
|
|
17707
18513
|
});
|
|
17708
18514
|
|
|
@@ -18068,7 +18874,7 @@ var ReStockedItem = function ReStockedItem(_ref) {
|
|
|
18068
18874
|
})))))));
|
|
18069
18875
|
};
|
|
18070
18876
|
|
|
18071
|
-
var _excluded$
|
|
18877
|
+
var _excluded$9 = ["children", "value", "index"];
|
|
18072
18878
|
var NewArrivalPage = function NewArrivalPage(_ref) {
|
|
18073
18879
|
var apiEndPoint = _ref.apiEndPoint,
|
|
18074
18880
|
token = _ref.token,
|
|
@@ -18176,7 +18982,7 @@ function CustomTabPanel(props) {
|
|
|
18176
18982
|
var children = props.children,
|
|
18177
18983
|
value = props.value,
|
|
18178
18984
|
index = props.index,
|
|
18179
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
18985
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$9);
|
|
18180
18986
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
18181
18987
|
role: "tabpanel",
|
|
18182
18988
|
hidden: value !== index,
|
|
@@ -18318,17 +19124,17 @@ var moveToCart = function moveToCart(_ref3) {
|
|
|
18318
19124
|
}
|
|
18319
19125
|
};
|
|
18320
19126
|
|
|
18321
|
-
var _templateObject$Y, _templateObject2$
|
|
19127
|
+
var _templateObject$Y, _templateObject2$H, _templateObject3$x, _templateObject4$q, _templateObject5$l, _templateObject6$j, _templateObject7$f, _templateObject8$d, _templateObject9$8, _templateObject10$7, _templateObject11$5;
|
|
18322
19128
|
var EmptyStateText = styled.p(_templateObject$Y || (_templateObject$Y = _taggedTemplateLiteralLoose(["\n font-size: 16px;\n color: #4b4b4b;\n margin: 16px 0;\n"])));
|
|
18323
|
-
var ProductCardWrapper = styled.div(_templateObject2$
|
|
18324
|
-
var TopBar = styled.div(_templateObject3$
|
|
18325
|
-
var SearchWrapper = styled(Box)(_templateObject4$
|
|
18326
|
-
var TotalItemsText = styled.div(_templateObject5$
|
|
18327
|
-
var DeleteButton = styled.button(_templateObject6$
|
|
18328
|
-
var PriceContainer = styled.div(_templateObject7$
|
|
18329
|
-
var DiscountPriceRow = styled.div(_templateObject8$
|
|
19129
|
+
var ProductCardWrapper = styled.div(_templateObject2$H || (_templateObject2$H = _taggedTemplateLiteralLoose(["\n position: relative;\n background-color: #ffffff;\n border: 1px solid #d3d3d3;\n border-radius: 10px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n padding: 10px;\n gap: 10px;\n cursor: pointer;\n"])));
|
|
19130
|
+
var TopBar$1 = styled.div(_templateObject3$x || (_templateObject3$x = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n"])));
|
|
19131
|
+
var SearchWrapper = styled(Box)(_templateObject4$q || (_templateObject4$q = _taggedTemplateLiteralLoose(["\n && {\n margin-bottom: 24px;\n max-width: 400px;\n width: 100%;\n }\n"])));
|
|
19132
|
+
var TotalItemsText = styled.div(_templateObject5$l || (_templateObject5$l = _taggedTemplateLiteralLoose(["\n font-size: 14px;\n font-weight: 500;\n color: #4b4b4b;\n margin-bottom: 24px;\n white-space: nowrap;\n"])));
|
|
19133
|
+
var DeleteButton = styled.button(_templateObject6$j || (_templateObject6$j = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 8px;\n right: 8px;\n opacity: 1;\n pointer-events: auto;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: 50%;\n background-color: #ffffff;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);\n cursor: pointer;\n color: #ff0000;\n"])));
|
|
19134
|
+
var PriceContainer = styled.div(_templateObject7$f || (_templateObject7$f = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"])));
|
|
19135
|
+
var DiscountPriceRow = styled.div(_templateObject8$d || (_templateObject8$d = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n"])));
|
|
18330
19136
|
var ProductName$2 = styled.div(_templateObject9$8 || (_templateObject9$8 = _taggedTemplateLiteralLoose(["\n font-size: 16px;\n font-weight: 500;\n color: #000000;\n text-align: center;\n height: 40px;\n overflow: hidden;\n width: 100%;\n text-overflow: ellipsis;\n white-space: pre-wrap;\n"])));
|
|
18331
|
-
var ProductActionButton = styled(Button)(_templateObject10$
|
|
19137
|
+
var ProductActionButton = styled(Button)(_templateObject10$7 || (_templateObject10$7 = _taggedTemplateLiteralLoose(["\n && {\n background-color: ", ";\n color: #ffffff;\n border-radius: 10px;\n font-weight: 500;\n }\n"])), function (_ref) {
|
|
18332
19138
|
var primaryColor = _ref.primaryColor;
|
|
18333
19139
|
return primaryColor != null ? primaryColor : '#000000';
|
|
18334
19140
|
});
|
|
@@ -18398,7 +19204,7 @@ var WishlistContent = function WishlistContent(_ref) {
|
|
|
18398
19204
|
width: '100%',
|
|
18399
19205
|
height: '100%'
|
|
18400
19206
|
}
|
|
18401
|
-
}, /*#__PURE__*/React__default.createElement(TopBar, {
|
|
19207
|
+
}, /*#__PURE__*/React__default.createElement(TopBar$1, {
|
|
18402
19208
|
style: getStyleOverride(styleOverrides, 'topBar', 'TopBar')
|
|
18403
19209
|
}, /*#__PURE__*/React__default.createElement(SearchWrapper, {
|
|
18404
19210
|
style: getStyleOverride(styleOverrides, 'searchWrapper', 'SearchWrapper')
|
|
@@ -18808,17 +19614,17 @@ var moveToCartFromFavoriteItems = function moveToCartFromFavoriteItems(_ref3) {
|
|
|
18808
19614
|
}
|
|
18809
19615
|
};
|
|
18810
19616
|
|
|
18811
|
-
var _templateObject$Z, _templateObject2$
|
|
19617
|
+
var _templateObject$Z, _templateObject2$I, _templateObject3$y, _templateObject4$r, _templateObject5$m, _templateObject6$k, _templateObject7$g, _templateObject8$e, _templateObject9$9, _templateObject10$8, _templateObject11$6;
|
|
18812
19618
|
var EmptyStateText$1 = styled.p(_templateObject$Z || (_templateObject$Z = _taggedTemplateLiteralLoose(["\n font-size: 16px;\n color: #4b4b4b;\n margin: 16px 0;\n"])));
|
|
18813
|
-
var ProductCardWrapper$1 = styled.div(_templateObject2$
|
|
18814
|
-
var TopBar$
|
|
18815
|
-
var SearchWrapper$1 = styled(Box)(_templateObject4$
|
|
18816
|
-
var TotalItemsText$1 = styled.div(_templateObject5$
|
|
18817
|
-
var DeleteButton$1 = styled.button(_templateObject6$
|
|
18818
|
-
var PriceContainer$1 = styled.div(_templateObject7$
|
|
18819
|
-
var DiscountPriceRow$1 = styled.div(_templateObject8$
|
|
19619
|
+
var ProductCardWrapper$1 = styled.div(_templateObject2$I || (_templateObject2$I = _taggedTemplateLiteralLoose(["\n position: relative;\n background-color: #ffffff;\n border: 1px solid #d3d3d3;\n border-radius: 10px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n padding: 10px;\n gap: 10px;\n cursor: pointer;\n"])));
|
|
19620
|
+
var TopBar$2 = styled.div(_templateObject3$y || (_templateObject3$y = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n"])));
|
|
19621
|
+
var SearchWrapper$1 = styled(Box)(_templateObject4$r || (_templateObject4$r = _taggedTemplateLiteralLoose(["\n && {\n margin-bottom: 24px;\n max-width: 400px;\n width: 100%;\n }\n"])));
|
|
19622
|
+
var TotalItemsText$1 = styled.div(_templateObject5$m || (_templateObject5$m = _taggedTemplateLiteralLoose(["\n font-size: 14px;\n font-weight: 500;\n color: #4b4b4b;\n margin-bottom: 24px;\n white-space: nowrap;\n"])));
|
|
19623
|
+
var DeleteButton$1 = styled.button(_templateObject6$k || (_templateObject6$k = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 8px;\n right: 8px;\n opacity: 1;\n pointer-events: auto;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: 50%;\n background-color: #ffffff;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);\n cursor: pointer;\n color: #ff0000;\n"])));
|
|
19624
|
+
var PriceContainer$1 = styled.div(_templateObject7$g || (_templateObject7$g = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"])));
|
|
19625
|
+
var DiscountPriceRow$1 = styled.div(_templateObject8$e || (_templateObject8$e = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n"])));
|
|
18820
19626
|
var ProductName$3 = styled.div(_templateObject9$9 || (_templateObject9$9 = _taggedTemplateLiteralLoose(["\n font-size: 16px;\n font-weight: 500;\n color: #000000;\n text-align: center;\n height: 40px;\n overflow: hidden;\n width: 100%;\n text-overflow: ellipsis;\n white-space: pre-wrap;\n"])));
|
|
18821
|
-
var ProductActionButton$1 = styled(Button)(_templateObject10$
|
|
19627
|
+
var ProductActionButton$1 = styled(Button)(_templateObject10$8 || (_templateObject10$8 = _taggedTemplateLiteralLoose(["\n && {\n background-color: ", ";\n color: #ffffff;\n border-radius: 10px;\n font-weight: 500;\n }\n"])), function (_ref) {
|
|
18822
19628
|
var primaryColor = _ref.primaryColor;
|
|
18823
19629
|
return primaryColor != null ? primaryColor : '#000000';
|
|
18824
19630
|
});
|
|
@@ -18882,7 +19688,7 @@ var FavoriteItemsContent = function FavoriteItemsContent(_ref) {
|
|
|
18882
19688
|
width: '100%',
|
|
18883
19689
|
height: '100%'
|
|
18884
19690
|
}
|
|
18885
|
-
}, /*#__PURE__*/React__default.createElement(TopBar$
|
|
19691
|
+
}, /*#__PURE__*/React__default.createElement(TopBar$2, {
|
|
18886
19692
|
style: getStyleOverride$1(styleOverrides, 'topBar', 'TopBar')
|
|
18887
19693
|
}, /*#__PURE__*/React__default.createElement(SearchWrapper$1, {
|
|
18888
19694
|
style: getStyleOverride$1(styleOverrides, 'searchWrapper', 'SearchWrapper')
|
|
@@ -19163,5 +19969,811 @@ var ProductCard$1 = function ProductCard(_ref4) {
|
|
|
19163
19969
|
}, "Out Of stock")));
|
|
19164
19970
|
};
|
|
19165
19971
|
|
|
19166
|
-
|
|
19972
|
+
var getFilters = function getFilters(_ref) {
|
|
19973
|
+
var apiEndPoint = _ref.apiEndPoint,
|
|
19974
|
+
token = _ref.token,
|
|
19975
|
+
queryParams = _ref.queryParams;
|
|
19976
|
+
try {
|
|
19977
|
+
return Promise.resolve(API({
|
|
19978
|
+
apiEndPoint: apiEndPoint,
|
|
19979
|
+
token: token,
|
|
19980
|
+
method: 'GET',
|
|
19981
|
+
queryParams: queryParams,
|
|
19982
|
+
url: "/ecommerce/product/filter-data",
|
|
19983
|
+
hideErrorMessage: true
|
|
19984
|
+
}));
|
|
19985
|
+
} catch (e) {
|
|
19986
|
+
return Promise.reject(e);
|
|
19987
|
+
}
|
|
19988
|
+
};
|
|
19989
|
+
var getBrandList = function getBrandList(_ref2) {
|
|
19990
|
+
var apiEndPoint = _ref2.apiEndPoint,
|
|
19991
|
+
token = _ref2.token,
|
|
19992
|
+
businessTypeId = _ref2.businessTypeId;
|
|
19993
|
+
try {
|
|
19994
|
+
return Promise.resolve(API({
|
|
19995
|
+
apiEndPoint: apiEndPoint,
|
|
19996
|
+
token: token,
|
|
19997
|
+
method: 'GET',
|
|
19998
|
+
queryParams: _extends({
|
|
19999
|
+
size: 999
|
|
20000
|
+
}, businessTypeId != null && {
|
|
20001
|
+
businessTypeId: businessTypeId
|
|
20002
|
+
}),
|
|
20003
|
+
url: "/ecommerce/brand/list",
|
|
20004
|
+
hideErrorMessage: true
|
|
20005
|
+
})).then(function (data) {
|
|
20006
|
+
return (data === null || data === void 0 ? void 0 : data.content) || [];
|
|
20007
|
+
});
|
|
20008
|
+
} catch (e) {
|
|
20009
|
+
return Promise.reject(e);
|
|
20010
|
+
}
|
|
20011
|
+
};
|
|
20012
|
+
|
|
20013
|
+
var _templateObject$_, _templateObject2$J, _templateObject3$z, _templateObject4$s, _templateObject5$n, _templateObject6$l, _templateObject7$h, _templateObject8$f, _templateObject9$a, _templateObject10$9, _templateObject11$7, _templateObject12$4, _templateObject13$4, _templateObject14$4, _templateObject15$4, _templateObject16$4, _templateObject17$4, _templateObject18$4, _templateObject19$3, _templateObject20$2, _templateObject21$2, _templateObject22$2, _templateObject23$2, _templateObject24$2, _templateObject25$2, _templateObject26$2, _templateObject27$2;
|
|
20014
|
+
var DEFAULT_PRIMARY$1 = '#424242';
|
|
20015
|
+
var primary = function primary(p) {
|
|
20016
|
+
var _p$theme;
|
|
20017
|
+
return (p === null || p === void 0 ? void 0 : (_p$theme = p.theme) === null || _p$theme === void 0 ? void 0 : _p$theme.dfPrimary) || DEFAULT_PRIMARY$1;
|
|
20018
|
+
};
|
|
20019
|
+
var tint = function tint(color, amount) {
|
|
20020
|
+
try {
|
|
20021
|
+
return alpha$1(color, amount);
|
|
20022
|
+
} catch (e) {
|
|
20023
|
+
return "color-mix(in srgb, " + color + " " + Math.round(amount * 100) + "%, transparent)";
|
|
20024
|
+
}
|
|
20025
|
+
};
|
|
20026
|
+
var primaryTint = function primaryTint(amount) {
|
|
20027
|
+
return function (p) {
|
|
20028
|
+
return tint(primary(p), amount);
|
|
20029
|
+
};
|
|
20030
|
+
};
|
|
20031
|
+
var TEXT = '#1f2329';
|
|
20032
|
+
var MUTED = '#6b7280';
|
|
20033
|
+
var BORDER = '#e8eaee';
|
|
20034
|
+
var FiltersWrapper = styled.div(_templateObject$_ || (_templateObject$_ = _taggedTemplateLiteralLoose(["\n position: relative;\n width: 100%;\n box-sizing: border-box;\n background: #fff;\n border: 1px solid ", ";\n border-radius: 14px;\n box-shadow: 0 4px 18px rgba(17, 24, 39, 0.05);\n font-size: 14px;\n color: ", ";\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n /* Inside the mobile dialog the dialog itself is the card. */\n ", "\n"])), BORDER, TEXT, function (p) {
|
|
20035
|
+
return p.inDialog && css(_templateObject2$J || (_templateObject2$J = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n min-height: 100%;\n border: none;\n border-radius: 0;\n box-shadow: none;\n ", " {\n flex: 1;\n }\n ", " {\n position: sticky;\n top: 0;\n z-index: 1;\n background: #fff;\n }\n ", " {\n border-radius: 0;\n padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));\n }\n ", " {\n border-radius: 0;\n }\n "])), SectionsArea, PanelHeader, ActionBar, LoadingOverlay);
|
|
20036
|
+
});
|
|
20037
|
+
var HeaderActions = styled.div(_templateObject3$z || (_templateObject3$z = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 4px;\n"])));
|
|
20038
|
+
var CloseButton$1 = styled.button(_templateObject4$s || (_templateObject4$s = _taggedTemplateLiteralLoose(["\n all: unset;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n cursor: pointer;\n color: ", ";\n &:hover {\n background: ", ";\n color: ", ";\n }\n &:focus-visible {\n outline: 2px solid ", ";\n }\n"])), MUTED, primaryTint(0.08), primary, primaryTint(0.4));
|
|
20039
|
+
var MobileFilterButton = styled.button(_templateObject5$n || (_templateObject5$n = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n gap: 8px;\n height: 40px;\n padding: 0 16px;\n border: 1.5px solid\n ", ";\n border-radius: 20px;\n background: ", ";\n color: ", ";\n font-size: 14px;\n font-weight: 600;\n cursor: pointer;\n transition: background 0.15s ease, border-color 0.15s ease;\n &:hover {\n background: ", ";\n border-color: ", ";\n }\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 3px ", ";\n }\n"])), function (p) {
|
|
20040
|
+
return p.active ? primary(p) : primaryTint(0.35)(p);
|
|
20041
|
+
}, function (p) {
|
|
20042
|
+
return p.active ? primaryTint(0.06)(p) : '#fff';
|
|
20043
|
+
}, primary, primaryTint(0.08), primary, primaryTint(0.3));
|
|
20044
|
+
var PanelHeader = styled.div(_templateObject6$l || (_templateObject6$l = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 16px 18px;\n border-bottom: 1px solid ", ";\n"])), BORDER);
|
|
20045
|
+
var PanelTitle = styled.div(_templateObject7$h || (_templateObject7$h = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 16px;\n font-weight: 700;\n color: ", ";\n svg {\n color: ", ";\n }\n"])), TEXT, primary);
|
|
20046
|
+
var CountBadge = styled.span(_templateObject8$f || (_templateObject8$f = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 20px;\n height: 20px;\n padding: 0 6px;\n border-radius: 10px;\n font-size: 11px;\n font-weight: 700;\n line-height: 1;\n ", "\n"])), function (p) {
|
|
20047
|
+
return p.soft ? css(_templateObject9$a || (_templateObject9$a = _taggedTemplateLiteralLoose(["\n background: ", ";\n color: ", ";\n "])), primaryTint(0.12), primary) : css(_templateObject10$9 || (_templateObject10$9 = _taggedTemplateLiteralLoose(["\n background: ", ";\n color: #fff;\n "])), primary);
|
|
20048
|
+
});
|
|
20049
|
+
var ClearAllButton = styled.button(_templateObject11$7 || (_templateObject11$7 = _taggedTemplateLiteralLoose(["\n all: unset;\n cursor: pointer;\n font-size: 13px;\n font-weight: 600;\n color: ", ";\n padding: 4px 6px;\n border-radius: 6px;\n &:hover {\n background: ", ";\n }\n &:focus-visible {\n outline: 2px solid ", ";\n }\n"])), primary, primaryTint(0.08), primaryTint(0.4));
|
|
20050
|
+
var SectionsArea = styled.div(_templateObject12$4 || (_templateObject12$4 = _taggedTemplateLiteralLoose(["\n padding: 0 18px;\n"])));
|
|
20051
|
+
var Section = styled.div(_templateObject13$4 || (_templateObject13$4 = _taggedTemplateLiteralLoose(["\n padding: 14px 0;\n border-bottom: 1px solid ", ";\n &:last-child {\n border-bottom: none;\n }\n"])), BORDER);
|
|
20052
|
+
var SectionHeader$1 = styled.button(_templateObject14$4 || (_templateObject14$4 = _taggedTemplateLiteralLoose(["\n all: unset;\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n cursor: pointer;\n font-size: 12.5px;\n font-weight: 700;\n letter-spacing: 0.6px;\n text-transform: uppercase;\n color: ", ";\n .title {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .chevron {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n color: ", ";\n transition: background 0.15s ease, color 0.15s ease;\n svg {\n transition: transform 0.2s ease;\n transform: rotate(", ");\n }\n }\n &:hover .chevron {\n background: ", ";\n color: ", ";\n }\n &:focus-visible {\n outline: 2px solid ", ";\n outline-offset: 4px;\n border-radius: 4px;\n }\n"])), TEXT, MUTED, function (p) {
|
|
20053
|
+
return p.open ? '0deg' : '180deg';
|
|
20054
|
+
}, primaryTint(0.08), primary, primaryTint(0.4));
|
|
20055
|
+
var SectionBody = styled.div(_templateObject15$4 || (_templateObject15$4 = _taggedTemplateLiteralLoose(["\n margin-top: 12px;\n"])));
|
|
20056
|
+
var SearchBox = styled.div(_templateObject16$4 || (_templateObject16$4 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 8px;\n height: 36px;\n padding: 0 12px;\n margin-bottom: 10px;\n border: 1px solid ", ";\n border-radius: 18px;\n background: #f7f8fa;\n color: #9aa1ab;\n transition: border-color 0.15s ease, box-shadow 0.15s ease,\n background 0.15s ease;\n &:focus-within {\n background: #fff;\n border-color: ", ";\n box-shadow: 0 0 0 3px ", ";\n color: ", ";\n }\n input {\n flex: 1;\n min-width: 0;\n border: none;\n outline: none;\n background: transparent;\n font-size: 13.5px;\n color: ", ";\n &::placeholder {\n color: #9aa1ab;\n }\n }\n"])), BORDER, primary, primaryTint(0.12), primary, TEXT);
|
|
20057
|
+
var OptionList = styled.div(_templateObject17$4 || (_templateObject17$4 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 2px;\n max-height: 252px;\n overflow-y: auto;\n margin: 0 -8px;\n padding: 0 2px;\n scrollbar-width: thin;\n scrollbar-color: #d5d9df transparent;\n &::-webkit-scrollbar {\n width: 6px;\n }\n &::-webkit-scrollbar-thumb {\n background: #d5d9df;\n border-radius: 3px;\n }\n"])));
|
|
20058
|
+
var OptionRow = styled.label(_templateObject18$4 || (_templateObject18$4 = _taggedTemplateLiteralLoose(["\n position: relative;\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 7px 8px;\n border-radius: 8px;\n cursor: pointer;\n user-select: none;\n color: ", ";\n font-weight: ", ";\n background: ", ";\n transition: background 0.15s ease;\n &:hover {\n background: ", ";\n }\n\n /* Native input kept for accessibility, visually hidden. */\n input {\n position: absolute;\n opacity: 0;\n width: 1px;\n height: 1px;\n margin: 0;\n pointer-events: none;\n }\n input:focus-visible + .control {\n box-shadow: 0 0 0 3px ", ";\n }\n\n .control {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 18px;\n height: 18px;\n border: 1.5px solid ", ";\n border-radius: ", ";\n background: ", ";\n color: #fff;\n transition: all 0.15s ease;\n }\n &:hover .control {\n border-color: ", ";\n }\n .dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: ", ";\n }\n\n .label {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 14px;\n }\n"])), function (p) {
|
|
20059
|
+
return p.checked ? TEXT : '#3f4650';
|
|
20060
|
+
}, function (p) {
|
|
20061
|
+
return p.checked ? 600 : 400;
|
|
20062
|
+
}, function (p) {
|
|
20063
|
+
return p.checked ? primaryTint(0.06)(p) : 'transparent';
|
|
20064
|
+
}, primaryTint(0.08), primaryTint(0.25), function (p) {
|
|
20065
|
+
return p.checked ? primary(p) : '#c5cbd3';
|
|
20066
|
+
}, function (p) {
|
|
20067
|
+
return p.radio ? '50%' : '5px';
|
|
20068
|
+
}, function (p) {
|
|
20069
|
+
return p.checked && !p.radio ? primary(p) : '#fff';
|
|
20070
|
+
}, primary, primary);
|
|
20071
|
+
var EmptyText = styled.div(_templateObject19$3 || (_templateObject19$3 = _taggedTemplateLiteralLoose(["\n padding: 6px 8px;\n color: #9aa1ab;\n font-size: 13px;\n"])));
|
|
20072
|
+
var SliderWrapper = styled.div(_templateObject20$2 || (_templateObject20$2 = _taggedTemplateLiteralLoose(["\n padding: 4px 10px 0;\n"])));
|
|
20073
|
+
var PriceRow = styled.div(_templateObject21$2 || (_templateObject21$2 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 10px;\n margin-top: 4px;\n .dash {\n color: #9aa1ab;\n }\n"])));
|
|
20074
|
+
var PriceBox = styled.div(_templateObject22$2 || (_templateObject22$2 = _taggedTemplateLiteralLoose(["\n flex: 1;\n padding: 7px 10px;\n border: 1px solid ", ";\n border-radius: 8px;\n background: #f7f8fa;\n .caption {\n display: block;\n font-size: 11px;\n color: ", ";\n margin-bottom: 2px;\n }\n .amount {\n font-size: 14px;\n font-weight: 600;\n color: ", ";\n }\n"])), BORDER, MUTED, TEXT);
|
|
20075
|
+
var ActionBar = styled.div(_templateObject23$2 || (_templateObject23$2 = _taggedTemplateLiteralLoose(["\n position: sticky;\n bottom: 0;\n z-index: 1;\n display: flex;\n gap: 10px;\n padding: 14px 18px;\n background: #fff;\n border-top: 1px solid ", ";\n border-radius: 0 0 14px 14px;\n"])), BORDER);
|
|
20076
|
+
var BaseButton = styled.button(_templateObject24$2 || (_templateObject24$2 = _taggedTemplateLiteralLoose(["\n flex: 1;\n height: 42px;\n padding: 0 16px;\n border-radius: 10px;\n font-size: 14px;\n font-weight: 600;\n cursor: pointer;\n transition: background 0.15s ease, box-shadow 0.15s ease,\n transform 0.05s ease;\n &:active:not(:disabled) {\n transform: translateY(1px);\n }\n &:disabled {\n opacity: 0.55;\n cursor: not-allowed;\n }\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 3px ", ";\n }\n"])), primaryTint(0.3));
|
|
20077
|
+
var ResetButton = styled(BaseButton)(_templateObject25$2 || (_templateObject25$2 = _taggedTemplateLiteralLoose(["\n background: #fff;\n color: ", ";\n border: 1.5px solid ", ";\n &:hover:not(:disabled) {\n background: ", ";\n border-color: ", ";\n }\n"])), primary, primaryTint(0.35), primaryTint(0.06), primary);
|
|
20078
|
+
var ApplyButton = styled(BaseButton)(_templateObject26$2 || (_templateObject26$2 = _taggedTemplateLiteralLoose(["\n background: ", ";\n color: #fff;\n border: 1.5px solid ", ";\n box-shadow: 0 4px 12px ", ";\n &:hover:not(:disabled) {\n box-shadow: 0 6px 16px ", ";\n }\n"])), primary, primary, primaryTint(0.25), primaryTint(0.35));
|
|
20079
|
+
var LoadingOverlay = styled.div(_templateObject27$2 || (_templateObject27$2 = _taggedTemplateLiteralLoose(["\n position: absolute;\n inset: 0;\n z-index: 2;\n display: flex;\n justify-content: center;\n padding-top: 90px;\n border-radius: 14px;\n background: rgba(255, 255, 255, 0.55);\n backdrop-filter: blur(1px);\n opacity: ", ";\n pointer-events: ", ";\n transition: opacity 0.2s ease;\n"])), function (p) {
|
|
20080
|
+
return p.visible ? 1 : 0;
|
|
20081
|
+
}, function (p) {
|
|
20082
|
+
return p.visible ? 'auto' : 'none';
|
|
20083
|
+
});
|
|
20084
|
+
|
|
20085
|
+
var _excluded$a = ["inStock"];
|
|
20086
|
+
var STOCK_OPTIONS = [{
|
|
20087
|
+
id: 'true',
|
|
20088
|
+
name: 'In Stock'
|
|
20089
|
+
}, {
|
|
20090
|
+
id: 'false',
|
|
20091
|
+
name: 'Out of Stock'
|
|
20092
|
+
}];
|
|
20093
|
+
var toSubmitPayload = function toSubmitPayload(_temp) {
|
|
20094
|
+
var _ref = _temp === void 0 ? {} : _temp,
|
|
20095
|
+
inStock = _ref.inStock,
|
|
20096
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
20097
|
+
var payload = {};
|
|
20098
|
+
Object.entries(rest || {}).forEach(function (_ref2) {
|
|
20099
|
+
var key = _ref2[0],
|
|
20100
|
+
value = _ref2[1];
|
|
20101
|
+
if (value !== '' && value != null) payload[key] = value;
|
|
20102
|
+
});
|
|
20103
|
+
if (inStock !== '') payload.inStock = inStock === 'true';
|
|
20104
|
+
return payload;
|
|
20105
|
+
};
|
|
20106
|
+
var INITIAL_FILTER_STATE = {
|
|
20107
|
+
inStock: '',
|
|
20108
|
+
brandIdList: '',
|
|
20109
|
+
tagIds: '',
|
|
20110
|
+
variantLabelId: '',
|
|
20111
|
+
variantValueIds: '',
|
|
20112
|
+
minPrice: '',
|
|
20113
|
+
maxPrice: ''
|
|
20114
|
+
};
|
|
20115
|
+
var toFilterState = function toFilterState(initialFilters) {
|
|
20116
|
+
var _toList;
|
|
20117
|
+
var state = _extends({}, INITIAL_FILTER_STATE);
|
|
20118
|
+
if (!initialFilters) return state;
|
|
20119
|
+
var asList = function asList(value) {
|
|
20120
|
+
return Array.isArray(value) ? value.join(',') : value != null ? String(value) : '';
|
|
20121
|
+
};
|
|
20122
|
+
var asNumber = function asNumber(value) {
|
|
20123
|
+
var num = Number(value);
|
|
20124
|
+
return value === '' || value == null || !Number.isFinite(num) ? '' : num;
|
|
20125
|
+
};
|
|
20126
|
+
['brandIdList', 'tagIds', 'variantValueIds'].forEach(function (key) {
|
|
20127
|
+
state[key] = asList(initialFilters === null || initialFilters === void 0 ? void 0 : initialFilters[key]);
|
|
20128
|
+
});
|
|
20129
|
+
state.variantLabelId = ((_toList = toList(asList(initialFilters === null || initialFilters === void 0 ? void 0 : initialFilters.variantLabelId))) === null || _toList === void 0 ? void 0 : _toList[0]) || '';
|
|
20130
|
+
state.minPrice = asNumber(initialFilters === null || initialFilters === void 0 ? void 0 : initialFilters.minPrice);
|
|
20131
|
+
state.maxPrice = asNumber(initialFilters === null || initialFilters === void 0 ? void 0 : initialFilters.maxPrice);
|
|
20132
|
+
var inStock = initialFilters === null || initialFilters === void 0 ? void 0 : initialFilters.inStock;
|
|
20133
|
+
if (inStock === true || inStock === 'true') state.inStock = 'true';
|
|
20134
|
+
if (inStock === false || inStock === 'false') state.inStock = 'false';
|
|
20135
|
+
return state;
|
|
20136
|
+
};
|
|
20137
|
+
var SINGLE_SELECT_KEYS = ['variantLabelId', 'inStock'];
|
|
20138
|
+
var toList = function toList(value) {
|
|
20139
|
+
return value ? String(value).split(',').filter(Boolean) : [];
|
|
20140
|
+
};
|
|
20141
|
+
var toggleInList = function toggleInList(value, id) {
|
|
20142
|
+
if (value === void 0) {
|
|
20143
|
+
value = '';
|
|
20144
|
+
}
|
|
20145
|
+
var list = toList(value);
|
|
20146
|
+
var key = String(id);
|
|
20147
|
+
var next = list.includes(key) ? list.filter(function (item) {
|
|
20148
|
+
return item !== key;
|
|
20149
|
+
}) : [].concat(list, [key]);
|
|
20150
|
+
return next.join(',');
|
|
20151
|
+
};
|
|
20152
|
+
var countActiveFilters = function countActiveFilters(state) {
|
|
20153
|
+
var _state$minPrice, _state$maxPrice;
|
|
20154
|
+
return (state !== null && state !== void 0 && state.inStock ? 1 : 0) + toList(state === null || state === void 0 ? void 0 : state.brandIdList).length + toList(state === null || state === void 0 ? void 0 : state.tagIds).length + toList(state === null || state === void 0 ? void 0 : state.variantValueIds).length + (((_state$minPrice = state === null || state === void 0 ? void 0 : state.minPrice) != null ? _state$minPrice : '') !== '' || ((_state$maxPrice = state === null || state === void 0 ? void 0 : state.maxPrice) != null ? _state$maxPrice : '') !== '' ? 1 : 0);
|
|
20155
|
+
};
|
|
20156
|
+
var asArray = function asArray(value) {
|
|
20157
|
+
return Array.isArray(value) ? value.filter(Boolean) : [];
|
|
20158
|
+
};
|
|
20159
|
+
var ChevronIcon = function ChevronIcon() {
|
|
20160
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
20161
|
+
width: "14",
|
|
20162
|
+
height: "14",
|
|
20163
|
+
viewBox: "0 0 24 24",
|
|
20164
|
+
fill: "none"
|
|
20165
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
20166
|
+
d: "M6 15l6-6 6 6",
|
|
20167
|
+
stroke: "currentColor",
|
|
20168
|
+
strokeWidth: "2.2",
|
|
20169
|
+
strokeLinecap: "round",
|
|
20170
|
+
strokeLinejoin: "round"
|
|
20171
|
+
}));
|
|
20172
|
+
};
|
|
20173
|
+
var SearchIcon = function SearchIcon() {
|
|
20174
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
20175
|
+
width: "15",
|
|
20176
|
+
height: "15",
|
|
20177
|
+
viewBox: "0 0 24 24",
|
|
20178
|
+
fill: "none"
|
|
20179
|
+
}, /*#__PURE__*/React__default.createElement("circle", {
|
|
20180
|
+
cx: "11",
|
|
20181
|
+
cy: "11",
|
|
20182
|
+
r: "7",
|
|
20183
|
+
stroke: "currentColor",
|
|
20184
|
+
strokeWidth: "2"
|
|
20185
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
20186
|
+
d: "M20 20l-3.5-3.5",
|
|
20187
|
+
stroke: "currentColor",
|
|
20188
|
+
strokeWidth: "2",
|
|
20189
|
+
strokeLinecap: "round"
|
|
20190
|
+
}));
|
|
20191
|
+
};
|
|
20192
|
+
var FilterIcon = function FilterIcon() {
|
|
20193
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
20194
|
+
width: "18",
|
|
20195
|
+
height: "18",
|
|
20196
|
+
viewBox: "0 0 24 24",
|
|
20197
|
+
fill: "none"
|
|
20198
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
20199
|
+
d: "M4 6h16M7 12h10M10 18h4",
|
|
20200
|
+
stroke: "currentColor",
|
|
20201
|
+
strokeWidth: "2.2",
|
|
20202
|
+
strokeLinecap: "round"
|
|
20203
|
+
}));
|
|
20204
|
+
};
|
|
20205
|
+
var CloseIcon = function CloseIcon() {
|
|
20206
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
20207
|
+
width: "18",
|
|
20208
|
+
height: "18",
|
|
20209
|
+
viewBox: "0 0 24 24",
|
|
20210
|
+
fill: "none"
|
|
20211
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
20212
|
+
d: "M6 6l12 12M18 6L6 18",
|
|
20213
|
+
stroke: "currentColor",
|
|
20214
|
+
strokeWidth: "2.2",
|
|
20215
|
+
strokeLinecap: "round"
|
|
20216
|
+
}));
|
|
20217
|
+
};
|
|
20218
|
+
var CheckIcon = function CheckIcon() {
|
|
20219
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
20220
|
+
width: "12",
|
|
20221
|
+
height: "12",
|
|
20222
|
+
viewBox: "0 0 24 24",
|
|
20223
|
+
fill: "none"
|
|
20224
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
20225
|
+
d: "M5 12.5l4.5 4.5L19 7.5",
|
|
20226
|
+
stroke: "currentColor",
|
|
20227
|
+
strokeWidth: "3",
|
|
20228
|
+
strokeLinecap: "round",
|
|
20229
|
+
strokeLinejoin: "round"
|
|
20230
|
+
}));
|
|
20231
|
+
};
|
|
20232
|
+
var FilterSection = function FilterSection(_ref3) {
|
|
20233
|
+
var title = _ref3.title,
|
|
20234
|
+
count = _ref3.count,
|
|
20235
|
+
children = _ref3.children,
|
|
20236
|
+
_ref3$defaultOpen = _ref3.defaultOpen,
|
|
20237
|
+
defaultOpen = _ref3$defaultOpen === void 0 ? true : _ref3$defaultOpen;
|
|
20238
|
+
var _useState = useState(defaultOpen),
|
|
20239
|
+
open = _useState[0],
|
|
20240
|
+
setOpen = _useState[1];
|
|
20241
|
+
return /*#__PURE__*/React__default.createElement(Section, null, /*#__PURE__*/React__default.createElement(SectionHeader$1, {
|
|
20242
|
+
type: "button",
|
|
20243
|
+
open: open,
|
|
20244
|
+
onClick: function onClick() {
|
|
20245
|
+
return setOpen(function (prev) {
|
|
20246
|
+
return !prev;
|
|
20247
|
+
});
|
|
20248
|
+
},
|
|
20249
|
+
"aria-expanded": open
|
|
20250
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
20251
|
+
className: "title"
|
|
20252
|
+
}, title), count > 0 && /*#__PURE__*/React__default.createElement(CountBadge, {
|
|
20253
|
+
soft: true
|
|
20254
|
+
}, count), /*#__PURE__*/React__default.createElement("span", {
|
|
20255
|
+
className: "chevron"
|
|
20256
|
+
}, /*#__PURE__*/React__default.createElement(ChevronIcon, null))), open && /*#__PURE__*/React__default.createElement(SectionBody, null, children));
|
|
20257
|
+
};
|
|
20258
|
+
var SearchInput = function SearchInput(_ref4) {
|
|
20259
|
+
var value = _ref4.value,
|
|
20260
|
+
_onChange = _ref4.onChange,
|
|
20261
|
+
placeholder = _ref4.placeholder;
|
|
20262
|
+
return /*#__PURE__*/React__default.createElement(SearchBox, null, /*#__PURE__*/React__default.createElement(SearchIcon, null), /*#__PURE__*/React__default.createElement("input", {
|
|
20263
|
+
type: "text",
|
|
20264
|
+
placeholder: placeholder || 'Search',
|
|
20265
|
+
value: value,
|
|
20266
|
+
onChange: function onChange(e) {
|
|
20267
|
+
var _e$target$value, _e$target;
|
|
20268
|
+
return _onChange === null || _onChange === void 0 ? void 0 : _onChange((_e$target$value = e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value) != null ? _e$target$value : '');
|
|
20269
|
+
}
|
|
20270
|
+
}));
|
|
20271
|
+
};
|
|
20272
|
+
var filterByName = function filterByName(items, search) {
|
|
20273
|
+
return search ? items.filter(function (item) {
|
|
20274
|
+
var _item$name;
|
|
20275
|
+
return String((_item$name = item === null || item === void 0 ? void 0 : item.name) != null ? _item$name : '').toLowerCase().includes(String(search).toLowerCase());
|
|
20276
|
+
}) : items;
|
|
20277
|
+
};
|
|
20278
|
+
var OptionFilter = function OptionFilter(_ref5) {
|
|
20279
|
+
var title = _ref5.title,
|
|
20280
|
+
rawItems = _ref5.items,
|
|
20281
|
+
selected = _ref5.selected,
|
|
20282
|
+
onToggle = _ref5.onToggle,
|
|
20283
|
+
searchable = _ref5.searchable,
|
|
20284
|
+
single = _ref5.single;
|
|
20285
|
+
var _useState2 = useState(''),
|
|
20286
|
+
search = _useState2[0],
|
|
20287
|
+
setSearch = _useState2[1];
|
|
20288
|
+
var items = asArray(rawItems).filter(function (item) {
|
|
20289
|
+
return (item === null || item === void 0 ? void 0 : item.id) != null;
|
|
20290
|
+
});
|
|
20291
|
+
if (!items.length) return null;
|
|
20292
|
+
var selectedList = toList(selected);
|
|
20293
|
+
var visibleItems = filterByName(items, search);
|
|
20294
|
+
var showSearch = searchable && items.length > 6;
|
|
20295
|
+
return /*#__PURE__*/React__default.createElement(FilterSection, {
|
|
20296
|
+
title: title,
|
|
20297
|
+
count: selectedList.length
|
|
20298
|
+
}, showSearch && /*#__PURE__*/React__default.createElement(SearchInput, {
|
|
20299
|
+
value: search,
|
|
20300
|
+
onChange: setSearch,
|
|
20301
|
+
placeholder: "Search " + String(title != null ? title : '').toLowerCase()
|
|
20302
|
+
}), /*#__PURE__*/React__default.createElement(OptionList, {
|
|
20303
|
+
role: single ? 'radiogroup' : 'group'
|
|
20304
|
+
}, visibleItems.map(function (item) {
|
|
20305
|
+
var _item$name2, _item$name3;
|
|
20306
|
+
var checked = selectedList.includes(String(item === null || item === void 0 ? void 0 : item.id));
|
|
20307
|
+
return /*#__PURE__*/React__default.createElement(OptionRow, {
|
|
20308
|
+
key: item === null || item === void 0 ? void 0 : item.id,
|
|
20309
|
+
checked: checked,
|
|
20310
|
+
radio: single
|
|
20311
|
+
}, /*#__PURE__*/React__default.createElement("input", {
|
|
20312
|
+
type: "checkbox",
|
|
20313
|
+
role: single ? 'radio' : undefined,
|
|
20314
|
+
checked: checked,
|
|
20315
|
+
onChange: function onChange() {
|
|
20316
|
+
return onToggle === null || onToggle === void 0 ? void 0 : onToggle(item === null || item === void 0 ? void 0 : item.id);
|
|
20317
|
+
}
|
|
20318
|
+
}), /*#__PURE__*/React__default.createElement("span", {
|
|
20319
|
+
className: "control",
|
|
20320
|
+
"aria-hidden": "true"
|
|
20321
|
+
}, checked && (single ? /*#__PURE__*/React__default.createElement("span", {
|
|
20322
|
+
className: "dot"
|
|
20323
|
+
}) : /*#__PURE__*/React__default.createElement(CheckIcon, null))), /*#__PURE__*/React__default.createElement("span", {
|
|
20324
|
+
className: "label",
|
|
20325
|
+
title: (_item$name2 = item === null || item === void 0 ? void 0 : item.name) != null ? _item$name2 : ''
|
|
20326
|
+
}, (_item$name3 = item === null || item === void 0 ? void 0 : item.name) != null ? _item$name3 : ''));
|
|
20327
|
+
}), !visibleItems.length && /*#__PURE__*/React__default.createElement(EmptyText, null, "No results found")));
|
|
20328
|
+
};
|
|
20329
|
+
var formatPrice$1 = function formatPrice(value) {
|
|
20330
|
+
return "$" + Number(value || 0).toLocaleString(undefined, {
|
|
20331
|
+
maximumFractionDigits: 2
|
|
20332
|
+
});
|
|
20333
|
+
};
|
|
20334
|
+
var PriceFilter = function PriceFilter(_ref6) {
|
|
20335
|
+
var min = _ref6.min,
|
|
20336
|
+
max = _ref6.max,
|
|
20337
|
+
selectedMin = _ref6.selectedMin,
|
|
20338
|
+
selectedMax = _ref6.selectedMax,
|
|
20339
|
+
onCommit = _ref6.onCommit,
|
|
20340
|
+
primaryColor = _ref6.primaryColor;
|
|
20341
|
+
var _useState3 = useState([selectedMin === '' ? min : selectedMin, selectedMax === '' ? max : selectedMax]),
|
|
20342
|
+
range = _useState3[0],
|
|
20343
|
+
setRange = _useState3[1];
|
|
20344
|
+
var hasRange = Number.isFinite(min) && Number.isFinite(max) && max > min;
|
|
20345
|
+
if (!hasRange) return null;
|
|
20346
|
+
var isSet = selectedMin !== '' || selectedMax !== '';
|
|
20347
|
+
return /*#__PURE__*/React__default.createElement(FilterSection, {
|
|
20348
|
+
title: "Price",
|
|
20349
|
+
count: isSet ? 1 : 0
|
|
20350
|
+
}, /*#__PURE__*/React__default.createElement(SliderWrapper, null, /*#__PURE__*/React__default.createElement(Slider$1, {
|
|
20351
|
+
value: range,
|
|
20352
|
+
min: min,
|
|
20353
|
+
max: max,
|
|
20354
|
+
step: max - min > 1000 ? 10 : 1,
|
|
20355
|
+
onChange: function onChange(_, value) {
|
|
20356
|
+
return setRange(value);
|
|
20357
|
+
},
|
|
20358
|
+
onChangeCommitted: function onChangeCommitted(_, value) {
|
|
20359
|
+
return onCommit === null || onCommit === void 0 ? void 0 : onCommit(value);
|
|
20360
|
+
},
|
|
20361
|
+
valueLabelDisplay: "auto",
|
|
20362
|
+
valueLabelFormat: formatPrice$1,
|
|
20363
|
+
disableSwap: true,
|
|
20364
|
+
getAriaLabel: function getAriaLabel(index) {
|
|
20365
|
+
return index === 0 ? 'Minimum price' : 'Maximum price';
|
|
20366
|
+
},
|
|
20367
|
+
sx: {
|
|
20368
|
+
color: primaryColor,
|
|
20369
|
+
height: 4,
|
|
20370
|
+
'& .MuiSlider-rail': {
|
|
20371
|
+
backgroundColor: '#e5e7eb',
|
|
20372
|
+
opacity: 1
|
|
20373
|
+
},
|
|
20374
|
+
'& .MuiSlider-track': {
|
|
20375
|
+
border: 'none'
|
|
20376
|
+
},
|
|
20377
|
+
'& .MuiSlider-thumb': {
|
|
20378
|
+
width: 18,
|
|
20379
|
+
height: 18,
|
|
20380
|
+
backgroundColor: '#fff',
|
|
20381
|
+
border: "2px solid " + primaryColor,
|
|
20382
|
+
'&:hover, &.Mui-focusVisible, &.Mui-active': {
|
|
20383
|
+
boxShadow: "0 0 0 6px " + tint(primaryColor, 0.16)
|
|
20384
|
+
}
|
|
20385
|
+
},
|
|
20386
|
+
'& .MuiSlider-valueLabel': {
|
|
20387
|
+
backgroundColor: primaryColor,
|
|
20388
|
+
borderRadius: '6px',
|
|
20389
|
+
fontSize: 12,
|
|
20390
|
+
fontWeight: 600
|
|
20391
|
+
}
|
|
20392
|
+
}
|
|
20393
|
+
})), /*#__PURE__*/React__default.createElement(PriceRow, null, /*#__PURE__*/React__default.createElement(PriceBox, null, /*#__PURE__*/React__default.createElement("span", {
|
|
20394
|
+
className: "caption"
|
|
20395
|
+
}, "Min"), /*#__PURE__*/React__default.createElement("span", {
|
|
20396
|
+
className: "amount"
|
|
20397
|
+
}, formatPrice$1(range === null || range === void 0 ? void 0 : range[0]))), /*#__PURE__*/React__default.createElement("span", {
|
|
20398
|
+
className: "dash"
|
|
20399
|
+
}, "\u2013"), /*#__PURE__*/React__default.createElement(PriceBox, null, /*#__PURE__*/React__default.createElement("span", {
|
|
20400
|
+
className: "caption"
|
|
20401
|
+
}, "Max"), /*#__PURE__*/React__default.createElement("span", {
|
|
20402
|
+
className: "amount"
|
|
20403
|
+
}, formatPrice$1(range === null || range === void 0 ? void 0 : range[1])))));
|
|
20404
|
+
};
|
|
20405
|
+
var normalizeVariantValues = function normalizeVariantValues(variantValues) {
|
|
20406
|
+
return asArray(variantValues).map(function (item) {
|
|
20407
|
+
var _ref7, _item$value, _item$labelId;
|
|
20408
|
+
return {
|
|
20409
|
+
id: item === null || item === void 0 ? void 0 : item.id,
|
|
20410
|
+
name: String((_ref7 = (_item$value = item === null || item === void 0 ? void 0 : item.value) != null ? _item$value : item === null || item === void 0 ? void 0 : item.name) != null ? _ref7 : '').trim(),
|
|
20411
|
+
variantLabelId: (_item$labelId = item === null || item === void 0 ? void 0 : item.labelId) != null ? _item$labelId : item === null || item === void 0 ? void 0 : item.variantLabelId
|
|
20412
|
+
};
|
|
20413
|
+
});
|
|
20414
|
+
};
|
|
20415
|
+
var groupVariantValues = function groupVariantValues(variantLabels, rawVariantValues) {
|
|
20416
|
+
var variantValues = normalizeVariantValues(rawVariantValues);
|
|
20417
|
+
var groups = asArray(variantLabels).map(function (label) {
|
|
20418
|
+
return {
|
|
20419
|
+
id: label === null || label === void 0 ? void 0 : label.id,
|
|
20420
|
+
name: label === null || label === void 0 ? void 0 : label.name,
|
|
20421
|
+
values: variantValues.filter(function (value) {
|
|
20422
|
+
return String(value === null || value === void 0 ? void 0 : value.variantLabelId) === String(label === null || label === void 0 ? void 0 : label.id);
|
|
20423
|
+
})
|
|
20424
|
+
};
|
|
20425
|
+
}).filter(function (group) {
|
|
20426
|
+
var _group$values;
|
|
20427
|
+
return group === null || group === void 0 ? void 0 : (_group$values = group.values) === null || _group$values === void 0 ? void 0 : _group$values.length;
|
|
20428
|
+
});
|
|
20429
|
+
var groupedIds = new Set(groups.flatMap(function (group) {
|
|
20430
|
+
return ((group === null || group === void 0 ? void 0 : group.values) || []).map(function (value) {
|
|
20431
|
+
return String(value === null || value === void 0 ? void 0 : value.id);
|
|
20432
|
+
});
|
|
20433
|
+
}));
|
|
20434
|
+
var ungrouped = variantValues.filter(function (value) {
|
|
20435
|
+
return !groupedIds.has(String(value === null || value === void 0 ? void 0 : value.id));
|
|
20436
|
+
});
|
|
20437
|
+
if (ungrouped.length) {
|
|
20438
|
+
groups.push({
|
|
20439
|
+
id: 'ungrouped',
|
|
20440
|
+
name: 'Variant Values',
|
|
20441
|
+
values: ungrouped
|
|
20442
|
+
});
|
|
20443
|
+
}
|
|
20444
|
+
return groups;
|
|
20445
|
+
};
|
|
20446
|
+
var FiltersContent = function FiltersContent(_ref8) {
|
|
20447
|
+
var _filterState$minPrice, _filterState$maxPrice;
|
|
20448
|
+
var data = _ref8.data,
|
|
20449
|
+
_ref8$brands = _ref8.brands,
|
|
20450
|
+
brands = _ref8$brands === void 0 ? [] : _ref8$brands,
|
|
20451
|
+
filterState = _ref8.filterState,
|
|
20452
|
+
primaryColor = _ref8.primaryColor,
|
|
20453
|
+
toggleFilter = _ref8.toggleFilter,
|
|
20454
|
+
updatePrice = _ref8.updatePrice,
|
|
20455
|
+
loading = _ref8.loading,
|
|
20456
|
+
resetCount = _ref8.resetCount,
|
|
20457
|
+
onApply = _ref8.onApply,
|
|
20458
|
+
onReset = _ref8.onReset,
|
|
20459
|
+
inDialog = _ref8.inDialog,
|
|
20460
|
+
onClose = _ref8.onClose;
|
|
20461
|
+
var productTags = asArray(data === null || data === void 0 ? void 0 : data.productTags);
|
|
20462
|
+
var variantLabels = asArray(data === null || data === void 0 ? void 0 : data.variantLabels);
|
|
20463
|
+
var minPrice = data === null || data === void 0 ? void 0 : data.minPrice;
|
|
20464
|
+
var maxPrice = data === null || data === void 0 ? void 0 : data.maxPrice;
|
|
20465
|
+
var variantGroups = groupVariantValues(variantLabels, data === null || data === void 0 ? void 0 : data.variantValues);
|
|
20466
|
+
var activeCount = countActiveFilters(filterState);
|
|
20467
|
+
return /*#__PURE__*/React__default.createElement(FiltersWrapper, {
|
|
20468
|
+
"aria-busy": loading,
|
|
20469
|
+
inDialog: inDialog
|
|
20470
|
+
}, /*#__PURE__*/React__default.createElement(LoadingOverlay, {
|
|
20471
|
+
visible: loading
|
|
20472
|
+
}, loading && /*#__PURE__*/React__default.createElement(CircularProgress, {
|
|
20473
|
+
size: 28,
|
|
20474
|
+
sx: {
|
|
20475
|
+
color: primaryColor
|
|
20476
|
+
}
|
|
20477
|
+
})), /*#__PURE__*/React__default.createElement(PanelHeader, null, /*#__PURE__*/React__default.createElement(PanelTitle, {
|
|
20478
|
+
id: inDialog ? 'dynamic-filters-title' : undefined
|
|
20479
|
+
}, /*#__PURE__*/React__default.createElement(FilterIcon, null), "Filters", activeCount > 0 && /*#__PURE__*/React__default.createElement(CountBadge, null, activeCount)), /*#__PURE__*/React__default.createElement(HeaderActions, null, activeCount > 0 && /*#__PURE__*/React__default.createElement(ClearAllButton, {
|
|
20480
|
+
type: "button",
|
|
20481
|
+
onClick: onReset,
|
|
20482
|
+
disabled: loading
|
|
20483
|
+
}, "Clear all"), inDialog && /*#__PURE__*/React__default.createElement(CloseButton$1, {
|
|
20484
|
+
type: "button",
|
|
20485
|
+
onClick: function onClick() {
|
|
20486
|
+
return onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
20487
|
+
},
|
|
20488
|
+
"aria-label": "Close filters"
|
|
20489
|
+
}, /*#__PURE__*/React__default.createElement(CloseIcon, null)))), /*#__PURE__*/React__default.createElement(SectionsArea, null, /*#__PURE__*/React__default.createElement(OptionFilter, {
|
|
20490
|
+
title: "Availability",
|
|
20491
|
+
items: STOCK_OPTIONS,
|
|
20492
|
+
selected: filterState === null || filterState === void 0 ? void 0 : filterState.inStock,
|
|
20493
|
+
onToggle: function onToggle(id) {
|
|
20494
|
+
return toggleFilter('inStock', id);
|
|
20495
|
+
},
|
|
20496
|
+
single: true
|
|
20497
|
+
}), /*#__PURE__*/React__default.createElement(OptionFilter, {
|
|
20498
|
+
title: "Brands",
|
|
20499
|
+
items: brands,
|
|
20500
|
+
selected: filterState === null || filterState === void 0 ? void 0 : filterState.brandIdList,
|
|
20501
|
+
onToggle: function onToggle(id) {
|
|
20502
|
+
return toggleFilter('brandIdList', id);
|
|
20503
|
+
},
|
|
20504
|
+
searchable: true
|
|
20505
|
+
}), /*#__PURE__*/React__default.createElement(OptionFilter, {
|
|
20506
|
+
title: "Product Tags",
|
|
20507
|
+
items: productTags,
|
|
20508
|
+
selected: filterState === null || filterState === void 0 ? void 0 : filterState.tagIds,
|
|
20509
|
+
onToggle: function onToggle(id) {
|
|
20510
|
+
return toggleFilter('tagIds', id);
|
|
20511
|
+
},
|
|
20512
|
+
searchable: true
|
|
20513
|
+
}), /*#__PURE__*/React__default.createElement(OptionFilter, {
|
|
20514
|
+
title: "Variants",
|
|
20515
|
+
items: variantLabels,
|
|
20516
|
+
selected: filterState === null || filterState === void 0 ? void 0 : filterState.variantLabelId,
|
|
20517
|
+
onToggle: function onToggle(id) {
|
|
20518
|
+
return toggleFilter('variantLabelId', id);
|
|
20519
|
+
},
|
|
20520
|
+
searchable: true,
|
|
20521
|
+
single: true
|
|
20522
|
+
}), variantGroups.map(function (group) {
|
|
20523
|
+
return /*#__PURE__*/React__default.createElement(OptionFilter, {
|
|
20524
|
+
key: group === null || group === void 0 ? void 0 : group.id,
|
|
20525
|
+
title: group === null || group === void 0 ? void 0 : group.name,
|
|
20526
|
+
items: group === null || group === void 0 ? void 0 : group.values,
|
|
20527
|
+
selected: filterState === null || filterState === void 0 ? void 0 : filterState.variantValueIds,
|
|
20528
|
+
onToggle: function onToggle(id) {
|
|
20529
|
+
return toggleFilter('variantValueIds', id);
|
|
20530
|
+
},
|
|
20531
|
+
searchable: true
|
|
20532
|
+
});
|
|
20533
|
+
}), /*#__PURE__*/React__default.createElement(PriceFilter, {
|
|
20534
|
+
key: minPrice + "-" + maxPrice + "-" + resetCount,
|
|
20535
|
+
min: minPrice,
|
|
20536
|
+
max: maxPrice,
|
|
20537
|
+
selectedMin: (_filterState$minPrice = filterState === null || filterState === void 0 ? void 0 : filterState.minPrice) != null ? _filterState$minPrice : '',
|
|
20538
|
+
selectedMax: (_filterState$maxPrice = filterState === null || filterState === void 0 ? void 0 : filterState.maxPrice) != null ? _filterState$maxPrice : '',
|
|
20539
|
+
onCommit: updatePrice,
|
|
20540
|
+
primaryColor: primaryColor
|
|
20541
|
+
})), /*#__PURE__*/React__default.createElement(ActionBar, null, /*#__PURE__*/React__default.createElement(ResetButton, {
|
|
20542
|
+
type: "button",
|
|
20543
|
+
onClick: onReset,
|
|
20544
|
+
disabled: loading
|
|
20545
|
+
}, "Reset"), /*#__PURE__*/React__default.createElement(ApplyButton, {
|
|
20546
|
+
type: "button",
|
|
20547
|
+
onClick: onApply,
|
|
20548
|
+
disabled: loading
|
|
20549
|
+
}, "Apply", activeCount > 0 ? " (" + activeCount + ")" : '')));
|
|
20550
|
+
};
|
|
20551
|
+
var DynamicFilters = function DynamicFilters(_ref9) {
|
|
20552
|
+
var token = _ref9.token,
|
|
20553
|
+
apiEndPoint = _ref9.apiEndPoint,
|
|
20554
|
+
primaryColor = _ref9.primaryColor,
|
|
20555
|
+
onFilterSubmit = _ref9.onFilterSubmit,
|
|
20556
|
+
brandId = _ref9.brandId,
|
|
20557
|
+
categoryId = _ref9.categoryId,
|
|
20558
|
+
businessTypeId = _ref9.businessTypeId,
|
|
20559
|
+
initialFilters = _ref9.initialFilters,
|
|
20560
|
+
_ref9$mobileBreakpoin = _ref9.mobileBreakpoint,
|
|
20561
|
+
mobileBreakpoint = _ref9$mobileBreakpoin === void 0 ? 1280 : _ref9$mobileBreakpoin;
|
|
20562
|
+
var color = primaryColor || DEFAULT_PRIMARY$1;
|
|
20563
|
+
var breakpoint = Number(mobileBreakpoint) || 1280;
|
|
20564
|
+
var isMobile = useMediaQuery$1("(max-width:" + (breakpoint - 0.02) + "px)", {
|
|
20565
|
+
noSsr: true
|
|
20566
|
+
});
|
|
20567
|
+
var isPhone = useMediaQuery$1('(max-width:599.98px)', {
|
|
20568
|
+
noSsr: true
|
|
20569
|
+
});
|
|
20570
|
+
var _useState4 = useState(false),
|
|
20571
|
+
dialogOpen = _useState4[0],
|
|
20572
|
+
setDialogOpen = _useState4[1];
|
|
20573
|
+
var _useState5 = useState([]),
|
|
20574
|
+
brands = _useState5[0],
|
|
20575
|
+
setBrands = _useState5[1];
|
|
20576
|
+
useEffect(function () {
|
|
20577
|
+
var cancelled = false;
|
|
20578
|
+
(function () {
|
|
20579
|
+
try {
|
|
20580
|
+
var _temp2 = _catch(function () {
|
|
20581
|
+
return Promise.resolve(getBrandList({
|
|
20582
|
+
apiEndPoint: apiEndPoint,
|
|
20583
|
+
token: token,
|
|
20584
|
+
businessTypeId: businessTypeId
|
|
20585
|
+
})).then(function (list) {
|
|
20586
|
+
if (!cancelled) setBrands(asArray(list));
|
|
20587
|
+
});
|
|
20588
|
+
}, function () {
|
|
20589
|
+
if (!cancelled) setBrands([]);
|
|
20590
|
+
});
|
|
20591
|
+
return _temp2 && _temp2.then ? _temp2.then(function () {}) : void 0;
|
|
20592
|
+
} catch (e) {
|
|
20593
|
+
Promise.reject(e);
|
|
20594
|
+
}
|
|
20595
|
+
})();
|
|
20596
|
+
return function () {
|
|
20597
|
+
cancelled = true;
|
|
20598
|
+
};
|
|
20599
|
+
}, [apiEndPoint, token, businessTypeId]);
|
|
20600
|
+
var _useState6 = useState(function () {
|
|
20601
|
+
return toFilterState(initialFilters);
|
|
20602
|
+
}),
|
|
20603
|
+
filterState = _useState6[0],
|
|
20604
|
+
setFilterState = _useState6[1];
|
|
20605
|
+
var _useState7 = useState(function () {
|
|
20606
|
+
return toFilterState(initialFilters);
|
|
20607
|
+
}),
|
|
20608
|
+
appliedState = _useState7[0],
|
|
20609
|
+
setAppliedState = _useState7[1];
|
|
20610
|
+
var _useState8 = useState(null),
|
|
20611
|
+
data = _useState8[0],
|
|
20612
|
+
setData = _useState8[1];
|
|
20613
|
+
var _useState9 = useState('loading'),
|
|
20614
|
+
status = _useState9[0],
|
|
20615
|
+
setStatus = _useState9[1];
|
|
20616
|
+
var _useState10 = useState(0),
|
|
20617
|
+
resetCount = _useState10[0],
|
|
20618
|
+
setResetCount = _useState10[1];
|
|
20619
|
+
var initialFiltersKey = JSON.stringify(toFilterState(initialFilters));
|
|
20620
|
+
var lastInitialKey = useRef(initialFiltersKey);
|
|
20621
|
+
useEffect(function () {
|
|
20622
|
+
if ((lastInitialKey === null || lastInitialKey === void 0 ? void 0 : lastInitialKey.current) === initialFiltersKey) return;
|
|
20623
|
+
lastInitialKey.current = initialFiltersKey;
|
|
20624
|
+
var restored = toFilterState(initialFilters);
|
|
20625
|
+
setFilterState(restored);
|
|
20626
|
+
setAppliedState(restored);
|
|
20627
|
+
setResetCount(function (count) {
|
|
20628
|
+
return count + 1;
|
|
20629
|
+
});
|
|
20630
|
+
}, [initialFiltersKey]);
|
|
20631
|
+
var filterStateRef = useRef(filterState);
|
|
20632
|
+
filterStateRef.current = filterState;
|
|
20633
|
+
var handleApply = function handleApply() {
|
|
20634
|
+
var current = filterState || INITIAL_FILTER_STATE;
|
|
20635
|
+
setAppliedState(current);
|
|
20636
|
+
setDialogOpen(false);
|
|
20637
|
+
onFilterSubmit === null || onFilterSubmit === void 0 ? void 0 : onFilterSubmit(toSubmitPayload(current));
|
|
20638
|
+
};
|
|
20639
|
+
var handleReset = function handleReset() {
|
|
20640
|
+
setFilterState(INITIAL_FILTER_STATE);
|
|
20641
|
+
setAppliedState(INITIAL_FILTER_STATE);
|
|
20642
|
+
setResetCount(function (count) {
|
|
20643
|
+
return count + 1;
|
|
20644
|
+
});
|
|
20645
|
+
setDialogOpen(false);
|
|
20646
|
+
onFilterSubmit === null || onFilterSubmit === void 0 ? void 0 : onFilterSubmit(toSubmitPayload(INITIAL_FILTER_STATE));
|
|
20647
|
+
};
|
|
20648
|
+
var handleDialogDismiss = function handleDialogDismiss() {
|
|
20649
|
+
setDialogOpen(false);
|
|
20650
|
+
var applied = appliedState || INITIAL_FILTER_STATE;
|
|
20651
|
+
if (JSON.stringify(filterState != null ? filterState : {}) !== JSON.stringify(applied)) {
|
|
20652
|
+
setFilterState(applied);
|
|
20653
|
+
setResetCount(function (count) {
|
|
20654
|
+
return count + 1;
|
|
20655
|
+
});
|
|
20656
|
+
}
|
|
20657
|
+
};
|
|
20658
|
+
useEffect(function () {
|
|
20659
|
+
if (!isMobile && dialogOpen) setDialogOpen(false);
|
|
20660
|
+
}, [isMobile, dialogOpen]);
|
|
20661
|
+
var toggleFilter = function toggleFilter(key, id) {
|
|
20662
|
+
var _extends2;
|
|
20663
|
+
if (id == null) return;
|
|
20664
|
+
var isSingle = SINGLE_SELECT_KEYS.includes(key);
|
|
20665
|
+
var nextValue = isSingle ? String(filterState === null || filterState === void 0 ? void 0 : filterState[key]) === String(id) ? '' : String(id) : toggleInList(filterState === null || filterState === void 0 ? void 0 : filterState[key], id);
|
|
20666
|
+
setFilterState(_extends({}, filterState || INITIAL_FILTER_STATE, (_extends2 = {}, _extends2[key] = nextValue, _extends2)));
|
|
20667
|
+
};
|
|
20668
|
+
var updatePrice = function updatePrice(range) {
|
|
20669
|
+
if (!Array.isArray(range)) return;
|
|
20670
|
+
var min = range[0],
|
|
20671
|
+
max = range[1];
|
|
20672
|
+
setFilterState(_extends({}, filterState || INITIAL_FILTER_STATE, {
|
|
20673
|
+
minPrice: min != null ? min : '',
|
|
20674
|
+
maxPrice: max != null ? max : ''
|
|
20675
|
+
}));
|
|
20676
|
+
};
|
|
20677
|
+
var variantLabelId = filterState === null || filterState === void 0 ? void 0 : filterState.variantLabelId;
|
|
20678
|
+
useEffect(function () {
|
|
20679
|
+
var cancelled = false;
|
|
20680
|
+
var queryParams = _extends({}, categoryId != null && {
|
|
20681
|
+
categoryId: categoryId
|
|
20682
|
+
}, brandId != null && {
|
|
20683
|
+
brandId: brandId
|
|
20684
|
+
}, variantLabelId && {
|
|
20685
|
+
variantLabelId: variantLabelId
|
|
20686
|
+
});
|
|
20687
|
+
(function () {
|
|
20688
|
+
try {
|
|
20689
|
+
return _catch(function () {
|
|
20690
|
+
setStatus('loading');
|
|
20691
|
+
return Promise.resolve(getFilters({
|
|
20692
|
+
apiEndPoint: apiEndPoint,
|
|
20693
|
+
token: token,
|
|
20694
|
+
queryParams: queryParams
|
|
20695
|
+
})).then(function (result) {
|
|
20696
|
+
var _current$variantValue;
|
|
20697
|
+
if (cancelled) return;
|
|
20698
|
+
setData(result || {});
|
|
20699
|
+
setStatus('success');
|
|
20700
|
+
var current = filterStateRef.current || INITIAL_FILTER_STATE;
|
|
20701
|
+
var availableIds = new Set(asArray(result === null || result === void 0 ? void 0 : result.variantValues).map(function (value) {
|
|
20702
|
+
return String(value === null || value === void 0 ? void 0 : value.id);
|
|
20703
|
+
}));
|
|
20704
|
+
var keptIds = toList(current === null || current === void 0 ? void 0 : current.variantValueIds).filter(function (id) {
|
|
20705
|
+
return availableIds.has(id);
|
|
20706
|
+
}).join(',');
|
|
20707
|
+
if (keptIds !== ((_current$variantValue = current === null || current === void 0 ? void 0 : current.variantValueIds) != null ? _current$variantValue : '')) {
|
|
20708
|
+
setFilterState(_extends({}, current, {
|
|
20709
|
+
variantValueIds: keptIds
|
|
20710
|
+
}));
|
|
20711
|
+
}
|
|
20712
|
+
});
|
|
20713
|
+
}, function () {
|
|
20714
|
+
if (!cancelled) setStatus('error');
|
|
20715
|
+
});
|
|
20716
|
+
} catch (e) {
|
|
20717
|
+
Promise.reject(e);
|
|
20718
|
+
}
|
|
20719
|
+
})();
|
|
20720
|
+
return function () {
|
|
20721
|
+
cancelled = true;
|
|
20722
|
+
};
|
|
20723
|
+
}, [apiEndPoint, token, categoryId, brandId, variantLabelId]);
|
|
20724
|
+
var renderPanel = function renderPanel(inDialog) {
|
|
20725
|
+
if (!data) {
|
|
20726
|
+
if (status === 'error') return /*#__PURE__*/React__default.createElement(EmptyText, null, "Unable to load filters");
|
|
20727
|
+
return /*#__PURE__*/React__default.createElement(Loader, {
|
|
20728
|
+
skeleton: 300,
|
|
20729
|
+
height: 300
|
|
20730
|
+
});
|
|
20731
|
+
}
|
|
20732
|
+
return /*#__PURE__*/React__default.createElement(FiltersContent, {
|
|
20733
|
+
data: data,
|
|
20734
|
+
brands: brandId != null ? [] : brands,
|
|
20735
|
+
filterState: filterState,
|
|
20736
|
+
primaryColor: color,
|
|
20737
|
+
toggleFilter: toggleFilter,
|
|
20738
|
+
updatePrice: updatePrice,
|
|
20739
|
+
loading: status === 'loading',
|
|
20740
|
+
resetCount: resetCount,
|
|
20741
|
+
onApply: handleApply,
|
|
20742
|
+
onReset: handleReset,
|
|
20743
|
+
inDialog: inDialog,
|
|
20744
|
+
onClose: handleDialogDismiss
|
|
20745
|
+
});
|
|
20746
|
+
};
|
|
20747
|
+
var appliedCount = countActiveFilters(appliedState);
|
|
20748
|
+
return /*#__PURE__*/React__default.createElement(ThemeProvider, {
|
|
20749
|
+
theme: {
|
|
20750
|
+
dfPrimary: color
|
|
20751
|
+
}
|
|
20752
|
+
}, isMobile ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(MobileFilterButton, {
|
|
20753
|
+
type: "button",
|
|
20754
|
+
active: appliedCount > 0,
|
|
20755
|
+
onClick: function onClick() {
|
|
20756
|
+
return setDialogOpen(true);
|
|
20757
|
+
},
|
|
20758
|
+
"aria-haspopup": "dialog",
|
|
20759
|
+
"aria-label": appliedCount > 0 ? "Filters, " + appliedCount + " applied" : 'Filters'
|
|
20760
|
+
}, /*#__PURE__*/React__default.createElement(FilterIcon, null), "Filters", appliedCount > 0 && /*#__PURE__*/React__default.createElement(CountBadge, null, appliedCount)), /*#__PURE__*/React__default.createElement(Dialog, {
|
|
20761
|
+
open: dialogOpen,
|
|
20762
|
+
onClose: handleDialogDismiss,
|
|
20763
|
+
fullScreen: isPhone,
|
|
20764
|
+
fullWidth: true,
|
|
20765
|
+
maxWidth: "xs",
|
|
20766
|
+
scroll: "paper",
|
|
20767
|
+
"aria-labelledby": "dynamic-filters-title",
|
|
20768
|
+
PaperProps: {
|
|
20769
|
+
sx: {
|
|
20770
|
+
borderRadius: isPhone ? 0 : '14px',
|
|
20771
|
+
overflowY: 'auto',
|
|
20772
|
+
maxHeight: isPhone ? '100%' : 'calc(100% - 64px)'
|
|
20773
|
+
}
|
|
20774
|
+
}
|
|
20775
|
+
}, renderPanel(true))) : renderPanel(false));
|
|
20776
|
+
};
|
|
20777
|
+
|
|
20778
|
+
export { APIStaticPage, AccountDetails, BrandList, BrandStock, Breakpoint, CartDrawer, CartPageComponent, CheckoutPageComponent, ContactUsForm, DynamicFilters, FavoriteItemsComponent as FavoriteItems, GTagManager, HomeBanner, MaintenancePage, NewArrivalPage, OutOfStock, QuickOrder, RenderTawk, SingleBanner, SnowfallComponent as Snowfall, StaticPage, StaticPageList, SwitchUser, ThankYou, Variant, VendorAccountDetails as VendorAccount, WishlistComponent as Wishlist, useGridSize, useWindowSize };
|
|
19167
20779
|
//# sourceMappingURL=index.modern.js.map
|