@salesgenterp/ui-components 0.4.552 → 0.4.554
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 +33 -55
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +35 -57
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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,
|
|
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
4
|
import React__default, { useState, useEffect, forwardRef, memo, createElement, useCallback, Fragment as Fragment$1, useRef, useMemo } from 'react';
|
|
5
|
-
import { MdVisibilityOff, MdVisibility, MdClose, MdMonetizationOn,
|
|
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';
|
|
8
8
|
import axios from 'axios';
|
|
@@ -3125,7 +3125,7 @@ var ExcessPaymentDialog = function ExcessPaymentDialog(_ref2) {
|
|
|
3125
3125
|
})));
|
|
3126
3126
|
};
|
|
3127
3127
|
|
|
3128
|
-
var _templateObject$a, _templateObject2$5, _templateObject3$3, _templateObject4$2, _templateObject5$1, _templateObject6$1, _templateObject7$1, _templateObject8$1, _templateObject9$1, _templateObject10$1, _templateObject11$1, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19
|
|
3128
|
+
var _templateObject$a, _templateObject2$5, _templateObject3$3, _templateObject4$2, _templateObject5$1, _templateObject6$1, _templateObject7$1, _templateObject8$1, _templateObject9$1, _templateObject10$1, _templateObject11$1, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19;
|
|
3129
3129
|
var totalIcons = [{
|
|
3130
3130
|
name: '',
|
|
3131
3131
|
icon: /*#__PURE__*/React__default.createElement(AiOutlineShoppingCart, null)
|
|
@@ -3171,8 +3171,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3171
3171
|
showOnlyRecentOrder = _ref$showOnlyRecentOr === void 0 ? false : _ref$showOnlyRecentOr,
|
|
3172
3172
|
hidePayActionButton = _ref.hidePayActionButton,
|
|
3173
3173
|
hideInvoiceTab = _ref.hideInvoiceTab,
|
|
3174
|
-
hideSalesOrderTab = _ref.hideSalesOrderTab
|
|
3175
|
-
hideAddAccessPaymentButton = _ref.hideAddAccessPaymentButton;
|
|
3174
|
+
hideSalesOrderTab = _ref.hideSalesOrderTab;
|
|
3176
3175
|
var _useState = useState({}),
|
|
3177
3176
|
customerData = _useState[0],
|
|
3178
3177
|
setCustomerData = _useState[1];
|
|
@@ -3198,24 +3197,18 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3198
3197
|
triggerTableData = _useState5[0],
|
|
3199
3198
|
setTriggerTableData = _useState5[1];
|
|
3200
3199
|
var _useState6 = useState({
|
|
3201
|
-
open: false,
|
|
3202
|
-
url: ''
|
|
3203
|
-
}),
|
|
3204
|
-
invoiceModal = _useState6[0],
|
|
3205
|
-
setInvoiceModal = _useState6[1];
|
|
3206
|
-
var _useState7 = useState({
|
|
3207
3200
|
open: false
|
|
3208
3201
|
}),
|
|
3209
|
-
isPaymentModal =
|
|
3210
|
-
setIsPaymentModal =
|
|
3211
|
-
var
|
|
3202
|
+
isPaymentModal = _useState6[0],
|
|
3203
|
+
setIsPaymentModal = _useState6[1];
|
|
3204
|
+
var _useState7 = useState({
|
|
3212
3205
|
open: false
|
|
3213
3206
|
}),
|
|
3214
|
-
isExcessPaymentModal =
|
|
3215
|
-
setIsExcessPaymentModal =
|
|
3216
|
-
var
|
|
3217
|
-
value =
|
|
3218
|
-
setValue =
|
|
3207
|
+
isExcessPaymentModal = _useState7[0],
|
|
3208
|
+
setIsExcessPaymentModal = _useState7[1];
|
|
3209
|
+
var _useState8 = useState(0),
|
|
3210
|
+
value = _useState8[0],
|
|
3211
|
+
setValue = _useState8[1];
|
|
3219
3212
|
useEffect(function () {
|
|
3220
3213
|
if (hideSalesOrderTab) {
|
|
3221
3214
|
setValue(1);
|
|
@@ -3235,10 +3228,9 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3235
3228
|
};
|
|
3236
3229
|
}
|
|
3237
3230
|
var openInvoiceData = function openInvoiceData(orderId) {
|
|
3238
|
-
serviceApiEndPoint
|
|
3239
|
-
open: true,
|
|
3240
|
-
|
|
3241
|
-
});
|
|
3231
|
+
if (serviceApiEndPoint) {
|
|
3232
|
+
window.open(serviceApiEndPoint + "/" + (value === 0 ? 'salesOrder' : 'sales-order') + "/invoice/" + orderId + "?token=" + token + "&defaultStoreId=" + defaultStoreId + "&storeIdList=" + storeIdList + "&isEcommerce=true", '_blank', 'noopener,noreferrer');
|
|
3233
|
+
}
|
|
3242
3234
|
};
|
|
3243
3235
|
var onDateChange = function onDateChange(data) {
|
|
3244
3236
|
var startDate = moment(data === null || data === void 0 ? void 0 : data.startDate).startOf('day');
|
|
@@ -3466,6 +3458,19 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3466
3458
|
Promise.reject(e);
|
|
3467
3459
|
}
|
|
3468
3460
|
}, [queryParams]);
|
|
3461
|
+
useEffect(function () {
|
|
3462
|
+
try {
|
|
3463
|
+
try {
|
|
3464
|
+
if (queryParams !== null && queryParams !== void 0 && queryParams.excessModal) {
|
|
3465
|
+
setIsExcessPaymentModal({
|
|
3466
|
+
open: true
|
|
3467
|
+
});
|
|
3468
|
+
}
|
|
3469
|
+
} catch (error) {}
|
|
3470
|
+
} catch (e) {
|
|
3471
|
+
Promise.reject(e);
|
|
3472
|
+
}
|
|
3473
|
+
}, [queryParams]);
|
|
3469
3474
|
var totalDataSource = filter(convertCamCaseToSnake(dashboardData) || [], function (data) {
|
|
3470
3475
|
var list = ['totalNumberOfOrders', 'totalAmountSpend'];
|
|
3471
3476
|
return hideTotalCardInDashboardSummary ? !includesCaseInsensitive(list, data === null || data === void 0 ? void 0 : data.name) : data;
|
|
@@ -3546,7 +3551,6 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3546
3551
|
}, totalDataSource === null || totalDataSource === void 0 ? void 0 : totalDataSource.map(function (data) {
|
|
3547
3552
|
var _data$name, _data$name2, _data$name3, _totalIcons$find;
|
|
3548
3553
|
var isAmount = (data === null || data === void 0 ? void 0 : (_data$name = data.name) === null || _data$name === void 0 ? void 0 : _data$name.indexOf('Amount')) > 1 || (data === null || data === void 0 ? void 0 : (_data$name2 = data.name) === null || _data$name2 === void 0 ? void 0 : _data$name2.indexOf('Credit')) > 1 || (data === null || data === void 0 ? void 0 : (_data$name3 = data.name) === null || _data$name3 === void 0 ? void 0 : _data$name3.indexOf('Price')) > 1 || (data === null || data === void 0 ? void 0 : data.name) === 'Excess Payment';
|
|
3549
|
-
var isExcessPayment = (data === null || data === void 0 ? void 0 : data.name) === 'Excess Payment';
|
|
3550
3554
|
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
3551
3555
|
item: true,
|
|
3552
3556
|
xs: 12,
|
|
@@ -3570,19 +3574,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3570
3574
|
style: {
|
|
3571
3575
|
flex: 1
|
|
3572
3576
|
}
|
|
3573
|
-
}, /*#__PURE__*/React__default.createElement("p", null, data === null || data === void 0 ? void 0 : data.name), /*#__PURE__*/React__default.createElement("h3", null, "" + (isAmount ? renderMoney(data === null || data === void 0 ? void 0 : data.value) : data === null || data === void 0 ? void 0 : data.value)))
|
|
3574
|
-
title: "Add Excess Payment",
|
|
3575
|
-
arrow: true
|
|
3576
|
-
}, /*#__PURE__*/React__default.createElement(AddExcessPaymentButton, {
|
|
3577
|
-
className: "add-excess-payment-btn",
|
|
3578
|
-
primaryColor: primaryColor,
|
|
3579
|
-
onClick: function onClick() {
|
|
3580
|
-
return setIsExcessPaymentModal({
|
|
3581
|
-
open: true
|
|
3582
|
-
});
|
|
3583
|
-
},
|
|
3584
|
-
"aria-label": "Add excess payment"
|
|
3585
|
-
}, /*#__PURE__*/React__default.createElement(MdAdd, null), /*#__PURE__*/React__default.createElement("span", null, "Add")))));
|
|
3577
|
+
}, /*#__PURE__*/React__default.createElement("p", null, data === null || data === void 0 ? void 0 : data.name), /*#__PURE__*/React__default.createElement("h3", null, "" + (isAmount ? renderMoney(data === null || data === void 0 ? void 0 : data.value) : data === null || data === void 0 ? void 0 : data.value)))));
|
|
3586
3578
|
}))), !hideBannerSection && /*#__PURE__*/React__default.createElement(BannerContainer, null, /*#__PURE__*/React__default.createElement(Grid, {
|
|
3587
3579
|
container: true,
|
|
3588
3580
|
spacing: 3,
|
|
@@ -3661,20 +3653,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3661
3653
|
style: {
|
|
3662
3654
|
marginTop: '1rem'
|
|
3663
3655
|
}
|
|
3664
|
-
})))))), /*#__PURE__*/React__default.createElement(TableContainer, null, /*#__PURE__*/React__default.createElement(
|
|
3665
|
-
onClose: function onClose() {
|
|
3666
|
-
return setInvoiceModal({
|
|
3667
|
-
open: false
|
|
3668
|
-
});
|
|
3669
|
-
},
|
|
3670
|
-
"aria-labelledby": "customized-dialog-title",
|
|
3671
|
-
open: invoiceModal === null || invoiceModal === void 0 ? void 0 : invoiceModal.open,
|
|
3672
|
-
maxWidth: "lg"
|
|
3673
|
-
}, /*#__PURE__*/React__default.createElement(DialogContent, {
|
|
3674
|
-
dividers: true
|
|
3675
|
-
}, /*#__PURE__*/React__default.createElement("iframe", {
|
|
3676
|
-
src: invoiceModal.url
|
|
3677
|
-
}))), /*#__PURE__*/React__default.createElement(APITable, {
|
|
3656
|
+
})))))), /*#__PURE__*/React__default.createElement(TableContainer, null, /*#__PURE__*/React__default.createElement(APITable, {
|
|
3678
3657
|
key: value,
|
|
3679
3658
|
cacheFilters: true,
|
|
3680
3659
|
extraFilterParams: value === 0 ? selectDates.recentInvoices : selectDates.salesOrders,
|
|
@@ -3945,8 +3924,7 @@ var StatusContainer = styled(Stack)(_templateObject17 || (_templateObject17 = _t
|
|
|
3945
3924
|
return props.primaryColor;
|
|
3946
3925
|
});
|
|
3947
3926
|
var TableContainer = styled.div(_templateObject18 || (_templateObject18 = _taggedTemplateLiteralLoose(["\n margin-top: 2rem;\n border-radius: 14px;\n"])));
|
|
3948
|
-
var
|
|
3949
|
-
var TabsContainer = styled(Tabs)(_templateObject20 || (_templateObject20 = _taggedTemplateLiteralLoose(["\n button {\n color: ", " !important;\n font-size: 1.1rem;\n font-weight: 600;\n }\n .Mui-selected {\n color: ", " !important;\n }\n .MuiTabs-indicator {\n background-color: ", " !important;\n }\n"])), function (props) {
|
|
3927
|
+
var TabsContainer = styled(Tabs)(_templateObject19 || (_templateObject19 = _taggedTemplateLiteralLoose(["\n button {\n color: ", " !important;\n font-size: 1.1rem;\n font-weight: 600;\n }\n .Mui-selected {\n color: ", " !important;\n }\n .MuiTabs-indicator {\n background-color: ", " !important;\n }\n"])), function (props) {
|
|
3950
3928
|
return props.fontColor;
|
|
3951
3929
|
}, function (props) {
|
|
3952
3930
|
return props.primaryColor;
|
|
@@ -5281,7 +5259,7 @@ var getDropzoneRejectionError = function getDropzoneRejectionError(fileRejection
|
|
|
5281
5259
|
return (error === null || error === void 0 ? void 0 : error.message) || 'Invalid file';
|
|
5282
5260
|
};
|
|
5283
5261
|
|
|
5284
|
-
var _templateObject$k, _templateObject2$c, _templateObject3$8, _templateObject4$6, _templateObject5$4, _templateObject6$3, _templateObject7$2, _templateObject8$2, _templateObject9$2, _templateObject10$2, _templateObject11$2, _templateObject12$1, _templateObject13$1, _templateObject14$1, _templateObject15$1, _templateObject16$1, _templateObject17$1, _templateObject18$1, _templateObject19$1, _templateObject20
|
|
5262
|
+
var _templateObject$k, _templateObject2$c, _templateObject3$8, _templateObject4$6, _templateObject5$4, _templateObject6$3, _templateObject7$2, _templateObject8$2, _templateObject9$2, _templateObject10$2, _templateObject11$2, _templateObject12$1, _templateObject13$1, _templateObject14$1, _templateObject15$1, _templateObject16$1, _templateObject17$1, _templateObject18$1, _templateObject19$1, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34;
|
|
5285
5263
|
var DEFAULT_PRIMARY_COLOR = "#437c0f";
|
|
5286
5264
|
var Container = styled.div(_templateObject$k || (_templateObject$k = _taggedTemplateLiteralLoose(["\n width: 100%;\n min-height: 80vh;\n display: flex;\n justify-content: center;\n align-items: center;\n background: #f6f6f6;\n padding: 2rem 1rem;\n"])));
|
|
5287
5265
|
var Card = styled.div(_templateObject2$c || (_templateObject2$c = _taggedTemplateLiteralLoose(["\n width: min(100%, 720px);\n background: #fff;\n border: 1px solid #cac8c8;\n border-radius: 8px;\n padding: 1.5rem;\n"])));
|
|
@@ -5321,7 +5299,7 @@ var DropzoneBtn = styled.span(_templateObject16$1 || (_templateObject16$1 = _tag
|
|
|
5321
5299
|
var DropzoneText = styled.span(_templateObject17$1 || (_templateObject17$1 = _taggedTemplateLiteralLoose(["\n font-size: 0.875rem;\n color: #666;\n"])));
|
|
5322
5300
|
var DropzoneError = styled.p(_templateObject18$1 || (_templateObject18$1 = _taggedTemplateLiteralLoose(["\n margin: 0.5rem 0 0;\n font-size: 0.8rem;\n color: #c62828;\n"])));
|
|
5323
5301
|
var SelectedFileRow = styled.div(_templateObject19$1 || (_templateObject19$1 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n padding: 0.6rem 0.75rem;\n border: 1px solid #e0e0e0;\n border-radius: 6px;\n background: #fafafa;\n"])));
|
|
5324
|
-
var SelectedFileInfo = styled.div(_templateObject20
|
|
5302
|
+
var SelectedFileInfo = styled.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 0.5rem;\n min-width: 0;\n flex: 1;\n"])));
|
|
5325
5303
|
var SelectedFileName = styled.span(_templateObject21 || (_templateObject21 = _taggedTemplateLiteralLoose(["\n font-size: 0.875rem;\n color: #333;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));
|
|
5326
5304
|
var ClearFileBtn = styled.button(_templateObject22 || (_templateObject22 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n background: none;\n color: #c62828;\n font-size: 1.1rem;\n cursor: pointer;\n flex-shrink: 0;\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n"])));
|
|
5327
5305
|
var UploadedFiles = styled.ul(_templateObject23 || (_templateObject23 = _taggedTemplateLiteralLoose(["\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n\n li {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n font-size: 0.875rem;\n color: #555;\n padding: 0.65rem 0.75rem;\n background: #fff;\n border: 1px solid #eee;\n border-radius: 4px;\n }\n"])));
|
|
@@ -8171,7 +8149,7 @@ var TotalAfterDiscount = function TotalAfterDiscount(_ref2) {
|
|
|
8171
8149
|
}, renderMoney(totalAmount)) : /*#__PURE__*/createElement(Fragment$1, null), /*#__PURE__*/createElement("b", null, renderMoney(total))));
|
|
8172
8150
|
};
|
|
8173
8151
|
|
|
8174
|
-
var _templateObject$v, _templateObject2$m, _templateObject3$g, _templateObject4$d, _templateObject5$9, _templateObject6$7, _templateObject7$6, _templateObject8$5, _templateObject9$5, _templateObject10$4, _templateObject11$3, _templateObject12$2, _templateObject13$2, _templateObject14$2, _templateObject15$2, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$2, _templateObject20$
|
|
8152
|
+
var _templateObject$v, _templateObject2$m, _templateObject3$g, _templateObject4$d, _templateObject5$9, _templateObject6$7, _templateObject7$6, _templateObject8$5, _templateObject9$5, _templateObject10$4, _templateObject11$3, _templateObject12$2, _templateObject13$2, _templateObject14$2, _templateObject15$2, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$2, _templateObject20$1, _templateObject21$1, _templateObject22$1, _templateObject23$1, _templateObject24$1, _templateObject25$1, _templateObject26$1, _templateObject27$1, _templateObject28$1, _templateObject29$1, _templateObject30$1, _templateObject31$1, _templateObject32$1, _templateObject33$1, _templateObject34$1, _templateObject35, _templateObject36, _templateObject37, _templateObject38, _templateObject39, _templateObject40, _templateObject41, _templateObject42, _templateObject43, _templateObject44, _templateObject45, _templateObject46, _templateObject47, _templateObject48, _templateObject49, _templateObject50, _templateObject51, _templateObject52, _templateObject53, _templateObject54, _templateObject55, _templateObject56, _templateObject57, _templateObject58, _templateObject59;
|
|
8175
8153
|
var DEFAULT_PRIMARY_COLOR$1 = '#437C0F';
|
|
8176
8154
|
var formatCurrency = function formatCurrency(amount) {
|
|
8177
8155
|
return Number(amount).toLocaleString('en-US', {
|
|
@@ -8781,7 +8759,7 @@ var HeaderIconWrap = styled.div(_templateObject19$2 || (_templateObject19$2 = _t
|
|
|
8781
8759
|
var $accentColor = _ref21.$accentColor;
|
|
8782
8760
|
return $accentColor + "cc";
|
|
8783
8761
|
});
|
|
8784
|
-
var HeaderCopy = styled.div(_templateObject20$
|
|
8762
|
+
var HeaderCopy = styled.div(_templateObject20$1 || (_templateObject20$1 = _taggedTemplateLiteralLoose(["\n flex: 1;\n min-width: 0;\n z-index: 1;\n"])));
|
|
8785
8763
|
var Eyebrow = styled.span(_templateObject21$1 || (_templateObject21$1 = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n font-size: 0.6rem;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.08em;\n color: ", ";\n\n svg {\n font-size: 0.65rem;\n }\n"])), function (_ref22) {
|
|
8786
8764
|
var $accentColor = _ref22.$accentColor;
|
|
8787
8765
|
return $accentColor;
|