@salesgenterp/ui-components 0.4.556 → 0.4.557
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 +269 -43
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +270 -44
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
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, DialogContent, DialogActions, DialogTitle as DialogTitle$1, RadioGroup, Radio, FormControlLabel, FormLabel, FormControl, FormHelperText, Select as Select$1, InputLabel, MenuItem, CardMedia, Divider, Tabs, Box, Tab, CardContent, ListItemIcon, ListItem, Collapse, List, ListItemText, Checkbox as Checkbox$1, Card as Card$1, CardHeader as CardHeader$1, CssBaseline, Toolbar, Drawer, useMediaQuery as useMediaQuery$1, Tooltip, Pagination, CardActionArea, Avatar as Avatar$1, alpha, Stepper, Step, StepLabel, StepContent, Container as Container$4 } from '@mui/material';
|
|
2
2
|
import { styled as styled$1 } from '@mui/material/styles';
|
|
3
3
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
4
|
-
import React__default, { useState, useEffect, forwardRef, memo, createElement, useCallback, Fragment as Fragment$1, useRef
|
|
4
|
+
import React__default, { useState, useEffect, forwardRef, memo, useMemo, createElement, useCallback, Fragment as Fragment$1, useRef } from 'react';
|
|
5
5
|
import { MdVisibilityOff, MdVisibility, 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
6
|
import styled, { css, ThemeProvider, keyframes } from 'styled-components';
|
|
7
7
|
import { isEmpty, isString, toNumber, reduce, concat, omit, replace, template, isArray, some, toLower, isPlainObject, includes, values, cloneDeep, filter, sortBy, isObject, sumBy, get, isNumber, remove } from 'lodash';
|
|
@@ -679,6 +679,63 @@ function useSystemFeatureList(_ref) {
|
|
|
679
679
|
status: status
|
|
680
680
|
};
|
|
681
681
|
}
|
|
682
|
+
function useSystemFeatureByFieldName(_ref2) {
|
|
683
|
+
var apiEndPoint = _ref2.apiEndPoint,
|
|
684
|
+
token = _ref2.token,
|
|
685
|
+
moduleName = _ref2.moduleName,
|
|
686
|
+
featureName = _ref2.featureName,
|
|
687
|
+
listUpdate = _ref2.listUpdate;
|
|
688
|
+
var _useState5 = useState(),
|
|
689
|
+
data = _useState5[0],
|
|
690
|
+
setData = _useState5[1];
|
|
691
|
+
var _useState6 = useState(false),
|
|
692
|
+
loading = _useState6[0],
|
|
693
|
+
setLoading = _useState6[1];
|
|
694
|
+
var _useState7 = useState(false),
|
|
695
|
+
error = _useState7[0],
|
|
696
|
+
setError = _useState7[1];
|
|
697
|
+
var _useState8 = useState(false),
|
|
698
|
+
status = _useState8[0],
|
|
699
|
+
setStatus = _useState8[1];
|
|
700
|
+
var _useSystemFeatureList = useSystemFeatureList({
|
|
701
|
+
apiEndPoint: apiEndPoint,
|
|
702
|
+
token: token,
|
|
703
|
+
moduleName: moduleName,
|
|
704
|
+
listUpdate: listUpdate
|
|
705
|
+
}),
|
|
706
|
+
systemFeatureList = _useSystemFeatureList.systemFeatureList;
|
|
707
|
+
useEffect(function () {
|
|
708
|
+
try {
|
|
709
|
+
if (apiEndPoint && token && moduleName && systemFeatureList) {
|
|
710
|
+
setError(false);
|
|
711
|
+
setStatus(null);
|
|
712
|
+
setLoading(true);
|
|
713
|
+
try {
|
|
714
|
+
var _systemFeatureList$fi, _systemFeatureList$fi2;
|
|
715
|
+
var modifyData = systemFeatureList === null || systemFeatureList === void 0 ? void 0 : (_systemFeatureList$fi = systemFeatureList.find(function (item) {
|
|
716
|
+
return (item === null || item === void 0 ? void 0 : item.moduleName) === moduleName;
|
|
717
|
+
})) === null || _systemFeatureList$fi === void 0 ? void 0 : (_systemFeatureList$fi2 = _systemFeatureList$fi.systemFeatureList) === null || _systemFeatureList$fi2 === void 0 ? void 0 : _systemFeatureList$fi2.find(function (item) {
|
|
718
|
+
return (item === null || item === void 0 ? void 0 : item.featureName) === featureName;
|
|
719
|
+
});
|
|
720
|
+
setData(modifyData);
|
|
721
|
+
setLoading(false);
|
|
722
|
+
} catch (e) {
|
|
723
|
+
setLoading(false);
|
|
724
|
+
setError(true);
|
|
725
|
+
setStatus(403);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
} catch (e) {
|
|
729
|
+
Promise.reject(e);
|
|
730
|
+
}
|
|
731
|
+
}, [moduleName, listUpdate, systemFeatureList]);
|
|
732
|
+
return {
|
|
733
|
+
systemFeatureData: data,
|
|
734
|
+
systemFeatureDataLoading: loading,
|
|
735
|
+
error: error,
|
|
736
|
+
status: status
|
|
737
|
+
};
|
|
738
|
+
}
|
|
682
739
|
function useAllSystemFeatureValues(_ref4) {
|
|
683
740
|
var apiEndPoint = _ref4.apiEndPoint,
|
|
684
741
|
token = _ref4.token,
|
|
@@ -3134,7 +3191,7 @@ var ExcessPaymentDialog = function ExcessPaymentDialog(_ref2) {
|
|
|
3134
3191
|
textAlign: 'center',
|
|
3135
3192
|
padding: '16px 8px'
|
|
3136
3193
|
}
|
|
3137
|
-
}, "This
|
|
3194
|
+
}, "This payment link has expired because it has already been used. The payment may have been completed by you or another recipient.");
|
|
3138
3195
|
}
|
|
3139
3196
|
return /*#__PURE__*/React__default.createElement(AsyncDataLoadComponent, {
|
|
3140
3197
|
apiEndPoint: apiEndPoint,
|
|
@@ -3183,8 +3240,41 @@ var totalIcons = [{
|
|
|
3183
3240
|
name: 'Excess Payment',
|
|
3184
3241
|
icon: /*#__PURE__*/React__default.createElement(TbFileDollar, null)
|
|
3185
3242
|
}];
|
|
3243
|
+
var DASHBOARD_ORDER_LIST_BY_NAME = {
|
|
3244
|
+
'Sales Order List': {
|
|
3245
|
+
tabValue: 0,
|
|
3246
|
+
label: 'Sales Orders'
|
|
3247
|
+
},
|
|
3248
|
+
'Invoice List': {
|
|
3249
|
+
tabValue: 1,
|
|
3250
|
+
label: 'Recent Invoices'
|
|
3251
|
+
},
|
|
3252
|
+
'Quotation List': {
|
|
3253
|
+
tabValue: 2,
|
|
3254
|
+
label: 'Quotations'
|
|
3255
|
+
},
|
|
3256
|
+
'Credit Memo RMA List': {
|
|
3257
|
+
tabValue: 3,
|
|
3258
|
+
label: 'Return Orders'
|
|
3259
|
+
}
|
|
3260
|
+
};
|
|
3261
|
+
var parseDashboardOrderListIds = function parseDashboardOrderListIds(value) {
|
|
3262
|
+
if (value == null || value === '' || value === false) return [];
|
|
3263
|
+
if (Array.isArray(value)) {
|
|
3264
|
+
return value.map(function (id) {
|
|
3265
|
+
return Number(id);
|
|
3266
|
+
}).filter(function (id) {
|
|
3267
|
+
return !Number.isNaN(id);
|
|
3268
|
+
});
|
|
3269
|
+
}
|
|
3270
|
+
return String(value).split(',').map(function (id) {
|
|
3271
|
+
return Number(String(id).trim());
|
|
3272
|
+
}).filter(function (id) {
|
|
3273
|
+
return !Number.isNaN(id);
|
|
3274
|
+
});
|
|
3275
|
+
};
|
|
3186
3276
|
var Dashboard = function Dashboard(_ref) {
|
|
3187
|
-
var _queryParams$excessPa, _customerData$custome, _selectDates$
|
|
3277
|
+
var _queryParams$excessPa, _customerData$custome, _selectDates$getDateK, _selectDates$getDateK2, _customerData$custome2, _customerData$custome3, _customerData$custome4;
|
|
3188
3278
|
var apiEndPoint = _ref.apiEndPoint,
|
|
3189
3279
|
serviceApiEndPoint = _ref.serviceApiEndPoint,
|
|
3190
3280
|
token = _ref.token,
|
|
@@ -3210,9 +3300,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3210
3300
|
hideTotalCardInDashboardSummary = _ref.hideTotalCardInDashboardSummary,
|
|
3211
3301
|
_ref$showOnlyRecentOr = _ref.showOnlyRecentOrder,
|
|
3212
3302
|
showOnlyRecentOrder = _ref$showOnlyRecentOr === void 0 ? false : _ref$showOnlyRecentOr,
|
|
3213
|
-
hidePayActionButton = _ref.hidePayActionButton
|
|
3214
|
-
hideInvoiceTab = _ref.hideInvoiceTab,
|
|
3215
|
-
hideSalesOrderTab = _ref.hideSalesOrderTab;
|
|
3303
|
+
hidePayActionButton = _ref.hidePayActionButton;
|
|
3216
3304
|
var _useState = useState({}),
|
|
3217
3305
|
customerData = _useState[0],
|
|
3218
3306
|
setCustomerData = _useState[1];
|
|
@@ -3230,6 +3318,14 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3230
3318
|
salesOrders: {
|
|
3231
3319
|
startDate: null,
|
|
3232
3320
|
endDate: null
|
|
3321
|
+
},
|
|
3322
|
+
quotations: {
|
|
3323
|
+
startDate: null,
|
|
3324
|
+
endDate: null
|
|
3325
|
+
},
|
|
3326
|
+
returnOrders: {
|
|
3327
|
+
startDate: null,
|
|
3328
|
+
endDate: null
|
|
3233
3329
|
}
|
|
3234
3330
|
}),
|
|
3235
3331
|
selectDates = _useState4[0],
|
|
@@ -3247,19 +3343,47 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3247
3343
|
}),
|
|
3248
3344
|
isExcessPaymentModal = _useState7[0],
|
|
3249
3345
|
setIsExcessPaymentModal = _useState7[1];
|
|
3250
|
-
var
|
|
3346
|
+
var _ref2 = useSystemFeatureByFieldName({
|
|
3347
|
+
apiEndPoint: apiEndPoint,
|
|
3348
|
+
token: token,
|
|
3349
|
+
moduleName: 'Ecommerce',
|
|
3350
|
+
featureName: 'dashboardOrderList'
|
|
3351
|
+
}) || {},
|
|
3352
|
+
dashboardOrderListFeature = _ref2.systemFeatureData;
|
|
3353
|
+
var selectedDashboardOrderIds = useMemo(function () {
|
|
3354
|
+
return parseDashboardOrderListIds(dashboardOrderListFeature === null || dashboardOrderListFeature === void 0 ? void 0 : dashboardOrderListFeature.featureValue);
|
|
3355
|
+
}, [dashboardOrderListFeature === null || dashboardOrderListFeature === void 0 ? void 0 : dashboardOrderListFeature.featureValue]);
|
|
3356
|
+
var featureValueListById = useMemo(function () {
|
|
3357
|
+
var list = dashboardOrderListFeature === null || dashboardOrderListFeature === void 0 ? void 0 : dashboardOrderListFeature.featureValueList;
|
|
3358
|
+
if (!Array.isArray(list)) return {};
|
|
3359
|
+
return list.reduce(function (acc, item) {
|
|
3360
|
+
if ((item === null || item === void 0 ? void 0 : item.id) != null && item !== null && item !== void 0 && item.name) {
|
|
3361
|
+
acc[Number(item.id)] = item.name;
|
|
3362
|
+
}
|
|
3363
|
+
return acc;
|
|
3364
|
+
}, {});
|
|
3365
|
+
}, [dashboardOrderListFeature === null || dashboardOrderListFeature === void 0 ? void 0 : dashboardOrderListFeature.featureValueList]);
|
|
3366
|
+
var visibleTabs = useMemo(function () {
|
|
3367
|
+
if (!(selectedDashboardOrderIds !== null && selectedDashboardOrderIds !== void 0 && selectedDashboardOrderIds.length)) return [];
|
|
3368
|
+
return selectedDashboardOrderIds.map(function (id) {
|
|
3369
|
+
var featureName = featureValueListById === null || featureValueListById === void 0 ? void 0 : featureValueListById[id];
|
|
3370
|
+
return featureName ? DASHBOARD_ORDER_LIST_BY_NAME === null || DASHBOARD_ORDER_LIST_BY_NAME === void 0 ? void 0 : DASHBOARD_ORDER_LIST_BY_NAME[featureName] : null;
|
|
3371
|
+
}).filter(Boolean);
|
|
3372
|
+
}, [selectedDashboardOrderIds, featureValueListById]);
|
|
3373
|
+
var _useState8 = useState(null),
|
|
3251
3374
|
value = _useState8[0],
|
|
3252
3375
|
setValue = _useState8[1];
|
|
3253
|
-
var showSalesOrderTable = !hideSalesOrderTab;
|
|
3254
|
-
var showInvoiceTable = !hideInvoiceTab;
|
|
3255
|
-
var showTableSection = showSalesOrderTable || showInvoiceTable;
|
|
3256
3376
|
useEffect(function () {
|
|
3257
|
-
if (
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3377
|
+
if (!(visibleTabs !== null && visibleTabs !== void 0 && visibleTabs.length)) return;
|
|
3378
|
+
var isCurrentVisible = value != null && visibleTabs.some(function (tab) {
|
|
3379
|
+
return (tab === null || tab === void 0 ? void 0 : tab.tabValue) === value;
|
|
3380
|
+
});
|
|
3381
|
+
if (!isCurrentVisible) {
|
|
3382
|
+
var _visibleTabs$0$tabVal, _visibleTabs$;
|
|
3383
|
+
setValue((_visibleTabs$0$tabVal = visibleTabs === null || visibleTabs === void 0 ? void 0 : (_visibleTabs$ = visibleTabs[0]) === null || _visibleTabs$ === void 0 ? void 0 : _visibleTabs$.tabValue) != null ? _visibleTabs$0$tabVal : null);
|
|
3384
|
+
setTriggerTableData(getRandomString());
|
|
3261
3385
|
}
|
|
3262
|
-
}, [
|
|
3386
|
+
}, [visibleTabs, value]);
|
|
3263
3387
|
var handleChange = function handleChange(event, newValue) {
|
|
3264
3388
|
setValue(newValue);
|
|
3265
3389
|
setTriggerTableData(getRandomString());
|
|
@@ -3270,11 +3394,23 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3270
3394
|
'aria-controls': "simple-tabpanel-" + index
|
|
3271
3395
|
};
|
|
3272
3396
|
}
|
|
3397
|
+
var getInvoicePathByTab = function getInvoicePathByTab(tabValue) {
|
|
3398
|
+
if (tabValue === 0) return 'salesOrder';
|
|
3399
|
+
if (tabValue === 1) return 'sales-order';
|
|
3400
|
+
if (tabValue === 2) return 'quotation';
|
|
3401
|
+
if (tabValue === 3) return 'rma/product';
|
|
3402
|
+
};
|
|
3273
3403
|
var openInvoiceData = function openInvoiceData(orderId) {
|
|
3274
3404
|
if (serviceApiEndPoint) {
|
|
3275
|
-
window.open(serviceApiEndPoint + "/" + (value
|
|
3405
|
+
window.open(serviceApiEndPoint + "/" + getInvoicePathByTab(value) + "/invoice/" + orderId + "?token=" + token + "&defaultStoreId=" + defaultStoreId + "&storeIdList=" + storeIdList + "&isEcommerce=true", '_blank', 'noopener,noreferrer');
|
|
3276
3406
|
}
|
|
3277
3407
|
};
|
|
3408
|
+
var getDateKey = function getDateKey(tabValue) {
|
|
3409
|
+
if (tabValue === 0) return 'salesOrders';
|
|
3410
|
+
if (tabValue === 1) return 'recentInvoices';
|
|
3411
|
+
if (tabValue === 2) return 'quotations';
|
|
3412
|
+
if (tabValue === 3) return 'returnOrders';
|
|
3413
|
+
};
|
|
3278
3414
|
var onDateChange = function onDateChange(data) {
|
|
3279
3415
|
var startDate = moment(data === null || data === void 0 ? void 0 : data.startDate).startOf('day');
|
|
3280
3416
|
var endDate = moment(data === null || data === void 0 ? void 0 : data.endDate).endOf('day');
|
|
@@ -3288,7 +3424,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3288
3424
|
};
|
|
3289
3425
|
setSelectDates(function (prev) {
|
|
3290
3426
|
var _extends2;
|
|
3291
|
-
return _extends({}, prev, (_extends2 = {}, _extends2[value
|
|
3427
|
+
return _extends({}, prev, (_extends2 = {}, _extends2[getDateKey(value)] = newDates, _extends2));
|
|
3292
3428
|
});
|
|
3293
3429
|
setTriggerTableData(getRandomString());
|
|
3294
3430
|
};
|
|
@@ -3301,6 +3437,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3301
3437
|
token: token
|
|
3302
3438
|
})).then(function (data) {
|
|
3303
3439
|
if (data) {
|
|
3440
|
+
var _link$parentNode;
|
|
3304
3441
|
var blob = new Blob([data]);
|
|
3305
3442
|
var url1 = window.URL.createObjectURL(blob);
|
|
3306
3443
|
var link = document.createElement('a');
|
|
@@ -3308,7 +3445,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3308
3445
|
link.setAttribute('download', "invoice-" + orderId + ".xls");
|
|
3309
3446
|
document.body.appendChild(link);
|
|
3310
3447
|
link.click();
|
|
3311
|
-
link.parentNode.removeChild(link);
|
|
3448
|
+
(_link$parentNode = link.parentNode) === null || _link$parentNode === void 0 ? void 0 : _link$parentNode.removeChild(link);
|
|
3312
3449
|
}
|
|
3313
3450
|
});
|
|
3314
3451
|
} catch (e) {
|
|
@@ -3358,13 +3495,11 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3358
3495
|
}, {
|
|
3359
3496
|
id: 'trackingNumber',
|
|
3360
3497
|
label: 'Tracking No.',
|
|
3361
|
-
format: function format(value,
|
|
3362
|
-
var trackingNumber = _ref2.trackingNumber,
|
|
3363
|
-
trackingNumberUrl = _ref2.trackingNumberUrl;
|
|
3498
|
+
format: function format(value, record) {
|
|
3364
3499
|
return /*#__PURE__*/React__default.createElement("a", {
|
|
3365
|
-
href: trackingNumberUrl,
|
|
3500
|
+
href: record === null || record === void 0 ? void 0 : record.trackingNumberUrl,
|
|
3366
3501
|
target: '_blank'
|
|
3367
|
-
}, trackingNumber);
|
|
3502
|
+
}, record === null || record === void 0 ? void 0 : record.trackingNumber);
|
|
3368
3503
|
}
|
|
3369
3504
|
}, !hideInvoiceAction && {
|
|
3370
3505
|
id: 'orderId',
|
|
@@ -3461,6 +3596,101 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3461
3596
|
})));
|
|
3462
3597
|
}
|
|
3463
3598
|
}];
|
|
3599
|
+
var quotaionColumns = [{
|
|
3600
|
+
id: 'quotationId',
|
|
3601
|
+
label: 'ID'
|
|
3602
|
+
}, {
|
|
3603
|
+
id: 'insertedTimestamp',
|
|
3604
|
+
label: 'Date',
|
|
3605
|
+
format: function format(value) {
|
|
3606
|
+
return getLocalTime({
|
|
3607
|
+
time: value
|
|
3608
|
+
});
|
|
3609
|
+
}
|
|
3610
|
+
}, {
|
|
3611
|
+
id: 'totalAmount',
|
|
3612
|
+
label: 'Total Amount',
|
|
3613
|
+
format: function format(value) {
|
|
3614
|
+
return renderMoney(value);
|
|
3615
|
+
}
|
|
3616
|
+
}, {
|
|
3617
|
+
id: 'status',
|
|
3618
|
+
label: 'Status',
|
|
3619
|
+
format: function format(value) {
|
|
3620
|
+
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
3621
|
+
container: true
|
|
3622
|
+
}, /*#__PURE__*/React__default.createElement(StatusContainer, {
|
|
3623
|
+
item: true,
|
|
3624
|
+
primaryColor: primaryColor
|
|
3625
|
+
}, value));
|
|
3626
|
+
}
|
|
3627
|
+
}, !hideInvoiceAction && {
|
|
3628
|
+
id: 'quotationId',
|
|
3629
|
+
label: 'Action',
|
|
3630
|
+
align: 'center',
|
|
3631
|
+
format: function format(value, record) {
|
|
3632
|
+
return /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(IconButton, {
|
|
3633
|
+
onClick: function onClick() {
|
|
3634
|
+
return openInvoiceData(value);
|
|
3635
|
+
},
|
|
3636
|
+
style: {
|
|
3637
|
+
color: primaryColor,
|
|
3638
|
+
padding: 2
|
|
3639
|
+
}
|
|
3640
|
+
}, /*#__PURE__*/React__default.createElement(MdRemoveRedEye, {
|
|
3641
|
+
style: {
|
|
3642
|
+
fontSize: '1.6rem'
|
|
3643
|
+
}
|
|
3644
|
+
})));
|
|
3645
|
+
}
|
|
3646
|
+
}];
|
|
3647
|
+
var returnOrderColumns = [{
|
|
3648
|
+
id: 'returnOrderId',
|
|
3649
|
+
label: 'ID'
|
|
3650
|
+
}, {
|
|
3651
|
+
id: 'insertedTimestamp',
|
|
3652
|
+
label: 'Date',
|
|
3653
|
+
format: function format(value) {
|
|
3654
|
+
return getLocalTime({
|
|
3655
|
+
time: value
|
|
3656
|
+
});
|
|
3657
|
+
}
|
|
3658
|
+
}, {
|
|
3659
|
+
id: 'totalAmount',
|
|
3660
|
+
label: 'Total Amount',
|
|
3661
|
+
format: function format(value) {
|
|
3662
|
+
return renderMoney(value);
|
|
3663
|
+
}
|
|
3664
|
+
}, {
|
|
3665
|
+
id: 'status',
|
|
3666
|
+
label: 'Status',
|
|
3667
|
+
format: function format(value) {
|
|
3668
|
+
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
3669
|
+
container: true
|
|
3670
|
+
}, /*#__PURE__*/React__default.createElement(StatusContainer, {
|
|
3671
|
+
item: true,
|
|
3672
|
+
primaryColor: primaryColor
|
|
3673
|
+
}, value));
|
|
3674
|
+
}
|
|
3675
|
+
}];
|
|
3676
|
+
var tableColumnsByTab = {
|
|
3677
|
+
0: salesOrderColumns,
|
|
3678
|
+
1: columns,
|
|
3679
|
+
2: quotaionColumns,
|
|
3680
|
+
3: returnOrderColumns
|
|
3681
|
+
};
|
|
3682
|
+
var tableApiPathByTab = {
|
|
3683
|
+
0: 'salesOrderTable',
|
|
3684
|
+
1: 'orderTable',
|
|
3685
|
+
2: 'quotationTable',
|
|
3686
|
+
3: 'returnOrderTable'
|
|
3687
|
+
};
|
|
3688
|
+
var tableTitleByTab = {
|
|
3689
|
+
0: 'Sales orders',
|
|
3690
|
+
1: 'Recent Invoices',
|
|
3691
|
+
2: 'Quotations',
|
|
3692
|
+
3: 'Return Orders'
|
|
3693
|
+
};
|
|
3464
3694
|
useEffect(function () {
|
|
3465
3695
|
(function () {
|
|
3466
3696
|
try {
|
|
@@ -3697,10 +3927,10 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3697
3927
|
style: {
|
|
3698
3928
|
marginTop: '1rem'
|
|
3699
3929
|
}
|
|
3700
|
-
})))))),
|
|
3930
|
+
})))))), (visibleTabs === null || visibleTabs === void 0 ? void 0 : visibleTabs.length) > 0 && value != null && /*#__PURE__*/React__default.createElement(TableContainer, null, /*#__PURE__*/React__default.createElement(APITable, {
|
|
3701
3931
|
key: value,
|
|
3702
3932
|
cacheFilters: true,
|
|
3703
|
-
extraFilterParams:
|
|
3933
|
+
extraFilterParams: selectDates === null || selectDates === void 0 ? void 0 : selectDates[getDateKey(value)],
|
|
3704
3934
|
tableHeaderContent: /*#__PURE__*/React__default.createElement(Grid, {
|
|
3705
3935
|
container: true,
|
|
3706
3936
|
justifyContent: "space-between",
|
|
@@ -3708,7 +3938,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3708
3938
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
3709
3939
|
item: true,
|
|
3710
3940
|
xs: 12
|
|
3711
|
-
},
|
|
3941
|
+
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
3712
3942
|
sx: {
|
|
3713
3943
|
borderBottom: 1,
|
|
3714
3944
|
borderColor: 'divider'
|
|
@@ -3719,11 +3949,13 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3719
3949
|
"aria-label": "basic tabs example",
|
|
3720
3950
|
primaryColor: primaryColor,
|
|
3721
3951
|
fontColor: fontColor
|
|
3722
|
-
},
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3952
|
+
}, visibleTabs === null || visibleTabs === void 0 ? void 0 : visibleTabs.map(function (tab) {
|
|
3953
|
+
return /*#__PURE__*/React__default.createElement(Tab, _extends({
|
|
3954
|
+
key: tab === null || tab === void 0 ? void 0 : tab.tabValue,
|
|
3955
|
+
label: tab === null || tab === void 0 ? void 0 : tab.label,
|
|
3956
|
+
value: tab === null || tab === void 0 ? void 0 : tab.tabValue
|
|
3957
|
+
}, a11yProps(tab === null || tab === void 0 ? void 0 : tab.tabValue)));
|
|
3958
|
+
})))), /*#__PURE__*/React__default.createElement(TypographyContainer$2, {
|
|
3727
3959
|
variant: "h4",
|
|
3728
3960
|
gutterBottom: true,
|
|
3729
3961
|
fontColor: fontColor,
|
|
@@ -3733,14 +3965,14 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3733
3965
|
padding: '1rem 0',
|
|
3734
3966
|
margin: 0
|
|
3735
3967
|
}
|
|
3736
|
-
},
|
|
3968
|
+
}, tableTitleByTab === null || tableTitleByTab === void 0 ? void 0 : tableTitleByTab[value]), /*#__PURE__*/React__default.createElement(Grid, {
|
|
3737
3969
|
item: true
|
|
3738
3970
|
}, /*#__PURE__*/React__default.createElement(DateRangePicker, {
|
|
3739
3971
|
fontColor: fontColor,
|
|
3740
3972
|
primaryColor: primaryColor,
|
|
3741
3973
|
onChange: onDateChange,
|
|
3742
|
-
initialStartDate:
|
|
3743
|
-
initialEndDate:
|
|
3974
|
+
initialStartDate: selectDates === null || selectDates === void 0 ? void 0 : (_selectDates$getDateK = selectDates[getDateKey(value)]) === null || _selectDates$getDateK === void 0 ? void 0 : _selectDates$getDateK.startDate,
|
|
3975
|
+
initialEndDate: selectDates === null || selectDates === void 0 ? void 0 : (_selectDates$getDateK2 = selectDates[getDateKey(value)]) === null || _selectDates$getDateK2 === void 0 ? void 0 : _selectDates$getDateK2.endDate
|
|
3744
3976
|
}))),
|
|
3745
3977
|
listUpdate: triggerTableData,
|
|
3746
3978
|
pagination: false,
|
|
@@ -3748,9 +3980,9 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3748
3980
|
x: 1000
|
|
3749
3981
|
},
|
|
3750
3982
|
tableId: "master-child-map",
|
|
3751
|
-
columns:
|
|
3983
|
+
columns: (tableColumnsByTab === null || tableColumnsByTab === void 0 ? void 0 : tableColumnsByTab[value]) || salesOrderColumns,
|
|
3752
3984
|
apiData: {
|
|
3753
|
-
url: "/ecommerce/dashboard/" + (
|
|
3985
|
+
url: "/ecommerce/dashboard/" + ((tableApiPathByTab === null || tableApiPathByTab === void 0 ? void 0 : tableApiPathByTab[value]) || 'salesOrderTable'),
|
|
3754
3986
|
apiEndPoint: apiEndPoint,
|
|
3755
3987
|
token: token
|
|
3756
3988
|
},
|
|
@@ -5722,7 +5954,7 @@ var UpcomingACHPayments = function UpcomingACHPayments(_ref) {
|
|
|
5722
5954
|
var TableContainer$2 = styled.div(_templateObject$l || (_templateObject$l = _taggedTemplateLiteralLoose(["\n margin: 1.2rem 0;\n border-radius: 14px;\n"])));
|
|
5723
5955
|
|
|
5724
5956
|
var _templateObject$m, _templateObject2$d, _templateObject3$9, _templateObject4$7;
|
|
5725
|
-
var _excluded$5 = ["apiEndPoint", "serviceApiEndPoint", "token", "primaryColor", "secondaryColor", "backgroundColor", "fontColor", "darkMode", "onChangeColors", "path", "onChangePath", "maxWidth", "logoUrl", "sectionLeftImageSection", "exploreCategoryImage", "sectionRightImageSection", "discountImageSection", "disabledUpdateProfileFromDashboard", "hideTotalCardInDashboardSummary", "showOnlyRecentOrder", "hidePayActionButton", "
|
|
5957
|
+
var _excluded$5 = ["apiEndPoint", "serviceApiEndPoint", "token", "primaryColor", "secondaryColor", "backgroundColor", "fontColor", "darkMode", "onChangeColors", "path", "onChangePath", "maxWidth", "logoUrl", "sectionLeftImageSection", "exploreCategoryImage", "sectionRightImageSection", "discountImageSection", "disabledUpdateProfileFromDashboard", "hideTotalCardInDashboardSummary", "showOnlyRecentOrder", "hidePayActionButton", "hideAddAccessPaymentButton"];
|
|
5726
5958
|
var AccountDetails = function AccountDetails(_ref) {
|
|
5727
5959
|
var _storeData$map, _storeData$find, _storeData$;
|
|
5728
5960
|
var apiEndPoint = _ref.apiEndPoint,
|
|
@@ -5752,10 +5984,6 @@ var AccountDetails = function AccountDetails(_ref) {
|
|
|
5752
5984
|
showOnlyRecentOrder = _ref$showOnlyRecentOr === void 0 ? false : _ref$showOnlyRecentOr,
|
|
5753
5985
|
_ref$hidePayActionBut = _ref.hidePayActionButton,
|
|
5754
5986
|
hidePayActionButton = _ref$hidePayActionBut === void 0 ? false : _ref$hidePayActionBut,
|
|
5755
|
-
_ref$hideSalesOrderTa = _ref.hideSalesOrderTab,
|
|
5756
|
-
hideSalesOrderTab = _ref$hideSalesOrderTa === void 0 ? false : _ref$hideSalesOrderTa,
|
|
5757
|
-
_ref$hideInvoiceTab = _ref.hideInvoiceTab,
|
|
5758
|
-
hideInvoiceTab = _ref$hideInvoiceTab === void 0 ? false : _ref$hideInvoiceTab,
|
|
5759
5987
|
_ref$hideAddAccessPay = _ref.hideAddAccessPaymentButton,
|
|
5760
5988
|
hideAddAccessPaymentButton = _ref$hideAddAccessPay === void 0 ? false : _ref$hideAddAccessPay,
|
|
5761
5989
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
@@ -5930,8 +6158,6 @@ var AccountDetails = function AccountDetails(_ref) {
|
|
|
5930
6158
|
hideTotalCardInDashboardSummary: hideTotalCardInDashboardSummary,
|
|
5931
6159
|
showOnlyRecentOrder: showOnlyRecentOrder,
|
|
5932
6160
|
hidePayActionButton: hidePayActionButton,
|
|
5933
|
-
hideSalesOrderTab: hideSalesOrderTab,
|
|
5934
|
-
hideInvoiceTab: hideInvoiceTab,
|
|
5935
6161
|
hideAddAccessPaymentButton: hideAddAccessPaymentButton
|
|
5936
6162
|
});
|
|
5937
6163
|
case 'myProfile':
|
|
@@ -10516,7 +10742,7 @@ var checkMinMaxQty = function checkMinMaxQty(_ref2) {
|
|
|
10516
10742
|
};
|
|
10517
10743
|
|
|
10518
10744
|
var _templateObject$B, _templateObject2$r, _templateObject3$l;
|
|
10519
|
-
var CartDrawerProduct = styled.div(_templateObject$B || (_templateObject$B = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: 100%;\n display: flex;\n flex-direction: row;\n height:
|
|
10745
|
+
var CartDrawerProduct = styled.div(_templateObject$B || (_templateObject$B = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: 100%;\n display: flex;\n flex-direction: row;\n height: 113px;\n justify-content: space-around;\n align-items: center;\n overflow: hidden;\n margin-bottom: 1rem;\n user-select: none;\n background: #f2f2f290;\n border: 1px solid #f2f2f290;\n padding: 0.5rem;\n border-radius: 12px;\n box-sizing: border-box;\n\n img {\n width: 20%;\n max-height: 100%;\n /* aspect-ratio: 1; */\n object-fit: contain;\n }\n .middleSection {\n width: 60%;\n padding-left: 0.8rem;\n height: 100%;\n h6 {\n font-size: 1.1rem;\n font-weight: bold;\n margin: 0;\n }\n .name {\n font-size: 0.9rem;\n line-height: 1.2rem;\n width: 100%;\n word-wrap: break-word;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: 0.3s;\n cursor: pointer;\n &:hover {\n color: ", ";\n }\n }\n }\n .endSection {\n // width: 20%;\n height: 95%;\n .icon {\n cursor: pointer;\n transition: 0.4s;\n &:hover {\n color: red;\n }\n }\n }\n @media only screen and (max-width: 768px) {\n .closeIcon {\n font-size: 1rem;\n }\n }\n @media only screen and (max-width: 340px) {\n .middleSection {\n h6 {\n font-size: 0.9rem;\n }\n }\n }\n"])), function (props) {
|
|
10520
10746
|
return props.color || 'grey';
|
|
10521
10747
|
});
|
|
10522
10748
|
var CartDrawerQtBox = styled.div(_templateObject2$r || (_templateObject2$r = _taggedTemplateLiteralLoose(["\n height: 30px;\n width: 86px;\n border: 1px solid rgb(211, 210, 210);\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: 13.5px;\n color: #323232;\n padding: 0 0.5rem;\n border-radius: 5px;\n max-width: 100%;\n span {\n cursor: pointer;\n height: 100%;\n display: grid;\n place-items: center;\n }\n .qt {\n font-size: 12px;\n color: black;\n font-weight: 500;\n cursor: auto;\n input {\n width: 40px;\n height: 100%;\n text-align: center;\n border: none;\n }\n }\n @media only screen and (max-width: 600px) {\n min-width: 55px;\n aspect-ratio: 1/2;\n font-size: 10px;\n }\n @media only screen and (max-width: 340px) {\n min-width: 50px;\n aspect-ratio: 1/2;\n height: 22px;\n font-size: 8px;\n }\n"])));
|