@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.js
CHANGED
|
@@ -3129,7 +3129,7 @@ var ExcessPaymentDialog = function ExcessPaymentDialog(_ref2) {
|
|
|
3129
3129
|
})));
|
|
3130
3130
|
};
|
|
3131
3131
|
|
|
3132
|
-
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
|
|
3132
|
+
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;
|
|
3133
3133
|
var totalIcons = [{
|
|
3134
3134
|
name: '',
|
|
3135
3135
|
icon: /*#__PURE__*/React__default.createElement(ai.AiOutlineShoppingCart, null)
|
|
@@ -3175,8 +3175,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3175
3175
|
showOnlyRecentOrder = _ref$showOnlyRecentOr === void 0 ? false : _ref$showOnlyRecentOr,
|
|
3176
3176
|
hidePayActionButton = _ref.hidePayActionButton,
|
|
3177
3177
|
hideInvoiceTab = _ref.hideInvoiceTab,
|
|
3178
|
-
hideSalesOrderTab = _ref.hideSalesOrderTab
|
|
3179
|
-
hideAddAccessPaymentButton = _ref.hideAddAccessPaymentButton;
|
|
3178
|
+
hideSalesOrderTab = _ref.hideSalesOrderTab;
|
|
3180
3179
|
var _useState = React.useState({}),
|
|
3181
3180
|
customerData = _useState[0],
|
|
3182
3181
|
setCustomerData = _useState[1];
|
|
@@ -3202,24 +3201,18 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3202
3201
|
triggerTableData = _useState5[0],
|
|
3203
3202
|
setTriggerTableData = _useState5[1];
|
|
3204
3203
|
var _useState6 = React.useState({
|
|
3205
|
-
open: false,
|
|
3206
|
-
url: ''
|
|
3207
|
-
}),
|
|
3208
|
-
invoiceModal = _useState6[0],
|
|
3209
|
-
setInvoiceModal = _useState6[1];
|
|
3210
|
-
var _useState7 = React.useState({
|
|
3211
3204
|
open: false
|
|
3212
3205
|
}),
|
|
3213
|
-
isPaymentModal =
|
|
3214
|
-
setIsPaymentModal =
|
|
3215
|
-
var
|
|
3206
|
+
isPaymentModal = _useState6[0],
|
|
3207
|
+
setIsPaymentModal = _useState6[1];
|
|
3208
|
+
var _useState7 = React.useState({
|
|
3216
3209
|
open: false
|
|
3217
3210
|
}),
|
|
3218
|
-
isExcessPaymentModal =
|
|
3219
|
-
setIsExcessPaymentModal =
|
|
3220
|
-
var
|
|
3221
|
-
value =
|
|
3222
|
-
setValue =
|
|
3211
|
+
isExcessPaymentModal = _useState7[0],
|
|
3212
|
+
setIsExcessPaymentModal = _useState7[1];
|
|
3213
|
+
var _useState8 = React.useState(0),
|
|
3214
|
+
value = _useState8[0],
|
|
3215
|
+
setValue = _useState8[1];
|
|
3223
3216
|
React.useEffect(function () {
|
|
3224
3217
|
if (hideSalesOrderTab) {
|
|
3225
3218
|
setValue(1);
|
|
@@ -3239,10 +3232,9 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3239
3232
|
};
|
|
3240
3233
|
}
|
|
3241
3234
|
var openInvoiceData = function openInvoiceData(orderId) {
|
|
3242
|
-
serviceApiEndPoint
|
|
3243
|
-
open: true,
|
|
3244
|
-
|
|
3245
|
-
});
|
|
3235
|
+
if (serviceApiEndPoint) {
|
|
3236
|
+
window.open(serviceApiEndPoint + "/" + (value === 0 ? 'salesOrder' : 'sales-order') + "/invoice/" + orderId + "?token=" + token + "&defaultStoreId=" + defaultStoreId + "&storeIdList=" + storeIdList + "&isEcommerce=true", '_blank', 'noopener,noreferrer');
|
|
3237
|
+
}
|
|
3246
3238
|
};
|
|
3247
3239
|
var onDateChange = function onDateChange(data) {
|
|
3248
3240
|
var startDate = moment(data === null || data === void 0 ? void 0 : data.startDate).startOf('day');
|
|
@@ -3470,6 +3462,19 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3470
3462
|
Promise.reject(e);
|
|
3471
3463
|
}
|
|
3472
3464
|
}, [queryParams]);
|
|
3465
|
+
React.useEffect(function () {
|
|
3466
|
+
try {
|
|
3467
|
+
try {
|
|
3468
|
+
if (queryParams !== null && queryParams !== void 0 && queryParams.excessModal) {
|
|
3469
|
+
setIsExcessPaymentModal({
|
|
3470
|
+
open: true
|
|
3471
|
+
});
|
|
3472
|
+
}
|
|
3473
|
+
} catch (error) {}
|
|
3474
|
+
} catch (e) {
|
|
3475
|
+
Promise.reject(e);
|
|
3476
|
+
}
|
|
3477
|
+
}, [queryParams]);
|
|
3473
3478
|
var totalDataSource = lodash.filter(convertCamCaseToSnake(dashboardData) || [], function (data) {
|
|
3474
3479
|
var list = ['totalNumberOfOrders', 'totalAmountSpend'];
|
|
3475
3480
|
return hideTotalCardInDashboardSummary ? !includesCaseInsensitive(list, data === null || data === void 0 ? void 0 : data.name) : data;
|
|
@@ -3550,7 +3555,6 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3550
3555
|
}, totalDataSource === null || totalDataSource === void 0 ? void 0 : totalDataSource.map(function (data) {
|
|
3551
3556
|
var _data$name, _data$name2, _data$name3, _totalIcons$find;
|
|
3552
3557
|
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';
|
|
3553
|
-
var isExcessPayment = (data === null || data === void 0 ? void 0 : data.name) === 'Excess Payment';
|
|
3554
3558
|
return /*#__PURE__*/React__default.createElement(material.Grid, {
|
|
3555
3559
|
item: true,
|
|
3556
3560
|
xs: 12,
|
|
@@ -3574,19 +3578,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3574
3578
|
style: {
|
|
3575
3579
|
flex: 1
|
|
3576
3580
|
}
|
|
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)))
|
|
3578
|
-
title: "Add Excess Payment",
|
|
3579
|
-
arrow: true
|
|
3580
|
-
}, /*#__PURE__*/React__default.createElement(AddExcessPaymentButton, {
|
|
3581
|
-
className: "add-excess-payment-btn",
|
|
3582
|
-
primaryColor: primaryColor,
|
|
3583
|
-
onClick: function onClick() {
|
|
3584
|
-
return setIsExcessPaymentModal({
|
|
3585
|
-
open: true
|
|
3586
|
-
});
|
|
3587
|
-
},
|
|
3588
|
-
"aria-label": "Add excess payment"
|
|
3589
|
-
}, /*#__PURE__*/React__default.createElement(md.MdAdd, null), /*#__PURE__*/React__default.createElement("span", null, "Add")))));
|
|
3581
|
+
}, /*#__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)))));
|
|
3590
3582
|
}))), !hideBannerSection && /*#__PURE__*/React__default.createElement(BannerContainer, null, /*#__PURE__*/React__default.createElement(material.Grid, {
|
|
3591
3583
|
container: true,
|
|
3592
3584
|
spacing: 3,
|
|
@@ -3665,20 +3657,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
3665
3657
|
style: {
|
|
3666
3658
|
marginTop: '1rem'
|
|
3667
3659
|
}
|
|
3668
|
-
})))))), /*#__PURE__*/React__default.createElement(TableContainer, null, /*#__PURE__*/React__default.createElement(
|
|
3669
|
-
onClose: function onClose() {
|
|
3670
|
-
return setInvoiceModal({
|
|
3671
|
-
open: false
|
|
3672
|
-
});
|
|
3673
|
-
},
|
|
3674
|
-
"aria-labelledby": "customized-dialog-title",
|
|
3675
|
-
open: invoiceModal === null || invoiceModal === void 0 ? void 0 : invoiceModal.open,
|
|
3676
|
-
maxWidth: "lg"
|
|
3677
|
-
}, /*#__PURE__*/React__default.createElement(material.DialogContent, {
|
|
3678
|
-
dividers: true
|
|
3679
|
-
}, /*#__PURE__*/React__default.createElement("iframe", {
|
|
3680
|
-
src: invoiceModal.url
|
|
3681
|
-
}))), /*#__PURE__*/React__default.createElement(APITable, {
|
|
3660
|
+
})))))), /*#__PURE__*/React__default.createElement(TableContainer, null, /*#__PURE__*/React__default.createElement(APITable, {
|
|
3682
3661
|
key: value,
|
|
3683
3662
|
cacheFilters: true,
|
|
3684
3663
|
extraFilterParams: value === 0 ? selectDates.recentInvoices : selectDates.salesOrders,
|
|
@@ -3949,8 +3928,7 @@ var StatusContainer = styled__default(material.Stack)(_templateObject17 || (_tem
|
|
|
3949
3928
|
return props.primaryColor;
|
|
3950
3929
|
});
|
|
3951
3930
|
var TableContainer = styled__default.div(_templateObject18 || (_templateObject18 = _taggedTemplateLiteralLoose(["\n margin-top: 2rem;\n border-radius: 14px;\n"])));
|
|
3952
|
-
var
|
|
3953
|
-
var TabsContainer = styled__default(material.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) {
|
|
3931
|
+
var TabsContainer = styled__default(material.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) {
|
|
3954
3932
|
return props.fontColor;
|
|
3955
3933
|
}, function (props) {
|
|
3956
3934
|
return props.primaryColor;
|
|
@@ -5285,7 +5263,7 @@ var getDropzoneRejectionError = function getDropzoneRejectionError(fileRejection
|
|
|
5285
5263
|
return (error === null || error === void 0 ? void 0 : error.message) || 'Invalid file';
|
|
5286
5264
|
};
|
|
5287
5265
|
|
|
5288
|
-
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
|
|
5266
|
+
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;
|
|
5289
5267
|
var DEFAULT_PRIMARY_COLOR = "#437c0f";
|
|
5290
5268
|
var Container = styled__default.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"])));
|
|
5291
5269
|
var Card = styled__default.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"])));
|
|
@@ -5325,7 +5303,7 @@ var DropzoneBtn = styled__default.span(_templateObject16$1 || (_templateObject16
|
|
|
5325
5303
|
var DropzoneText = styled__default.span(_templateObject17$1 || (_templateObject17$1 = _taggedTemplateLiteralLoose(["\n font-size: 0.875rem;\n color: #666;\n"])));
|
|
5326
5304
|
var DropzoneError = styled__default.p(_templateObject18$1 || (_templateObject18$1 = _taggedTemplateLiteralLoose(["\n margin: 0.5rem 0 0;\n font-size: 0.8rem;\n color: #c62828;\n"])));
|
|
5327
5305
|
var SelectedFileRow = styled__default.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"])));
|
|
5328
|
-
var SelectedFileInfo = styled__default.div(_templateObject20
|
|
5306
|
+
var SelectedFileInfo = styled__default.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 0.5rem;\n min-width: 0;\n flex: 1;\n"])));
|
|
5329
5307
|
var SelectedFileName = styled__default.span(_templateObject21 || (_templateObject21 = _taggedTemplateLiteralLoose(["\n font-size: 0.875rem;\n color: #333;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));
|
|
5330
5308
|
var ClearFileBtn = styled__default.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"])));
|
|
5331
5309
|
var UploadedFiles = styled__default.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"])));
|
|
@@ -8175,7 +8153,7 @@ var TotalAfterDiscount = function TotalAfterDiscount(_ref2) {
|
|
|
8175
8153
|
}, renderMoney(totalAmount)) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement("b", null, renderMoney(total))));
|
|
8176
8154
|
};
|
|
8177
8155
|
|
|
8178
|
-
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$
|
|
8156
|
+
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;
|
|
8179
8157
|
var DEFAULT_PRIMARY_COLOR$1 = '#437C0F';
|
|
8180
8158
|
var formatCurrency = function formatCurrency(amount) {
|
|
8181
8159
|
return Number(amount).toLocaleString('en-US', {
|
|
@@ -8785,7 +8763,7 @@ var HeaderIconWrap = styled__default.div(_templateObject19$2 || (_templateObject
|
|
|
8785
8763
|
var $accentColor = _ref21.$accentColor;
|
|
8786
8764
|
return $accentColor + "cc";
|
|
8787
8765
|
});
|
|
8788
|
-
var HeaderCopy = styled__default.div(_templateObject20$
|
|
8766
|
+
var HeaderCopy = styled__default.div(_templateObject20$1 || (_templateObject20$1 = _taggedTemplateLiteralLoose(["\n flex: 1;\n min-width: 0;\n z-index: 1;\n"])));
|
|
8789
8767
|
var Eyebrow = styled__default.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) {
|
|
8790
8768
|
var $accentColor = _ref22.$accentColor;
|
|
8791
8769
|
return $accentColor;
|