@salesgenterp/ui-components 0.4.555 → 0.4.556

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 CHANGED
@@ -3254,11 +3254,13 @@ var Dashboard = function Dashboard(_ref) {
3254
3254
  var _useState8 = React.useState(0),
3255
3255
  value = _useState8[0],
3256
3256
  setValue = _useState8[1];
3257
+ var showSalesOrderTable = !hideSalesOrderTab;
3258
+ var showInvoiceTable = !hideInvoiceTab;
3259
+ var showTableSection = showSalesOrderTable || showInvoiceTable;
3257
3260
  React.useEffect(function () {
3258
- if (hideSalesOrderTab) {
3261
+ if (hideSalesOrderTab && !hideInvoiceTab) {
3259
3262
  setValue(1);
3260
- }
3261
- if (hideInvoiceTab) {
3263
+ } else if (hideInvoiceTab && !hideSalesOrderTab) {
3262
3264
  setValue(0);
3263
3265
  }
3264
3266
  }, [hideSalesOrderTab, hideInvoiceTab]);
@@ -3699,7 +3701,7 @@ var Dashboard = function Dashboard(_ref) {
3699
3701
  style: {
3700
3702
  marginTop: '1rem'
3701
3703
  }
3702
- })))))), /*#__PURE__*/React__default.createElement(TableContainer, null, /*#__PURE__*/React__default.createElement(APITable, {
3704
+ })))))), showTableSection && /*#__PURE__*/React__default.createElement(TableContainer, null, /*#__PURE__*/React__default.createElement(APITable, {
3703
3705
  key: value,
3704
3706
  cacheFilters: true,
3705
3707
  extraFilterParams: value === 0 ? selectDates.recentInvoices : selectDates.salesOrders,
@@ -3710,7 +3712,7 @@ var Dashboard = function Dashboard(_ref) {
3710
3712
  }, /*#__PURE__*/React__default.createElement(material.Grid, {
3711
3713
  item: true,
3712
3714
  xs: 12
3713
- }, /*#__PURE__*/React__default.createElement(material.Box, {
3715
+ }, showSalesOrderTable && showInvoiceTable && /*#__PURE__*/React__default.createElement(material.Box, {
3714
3716
  sx: {
3715
3717
  borderBottom: 1,
3716
3718
  borderColor: 'divider'
@@ -3721,9 +3723,9 @@ var Dashboard = function Dashboard(_ref) {
3721
3723
  "aria-label": "basic tabs example",
3722
3724
  primaryColor: primaryColor,
3723
3725
  fontColor: fontColor
3724
- }, !hideSalesOrderTab && /*#__PURE__*/React__default.createElement(material.Tab, _extends({
3726
+ }, /*#__PURE__*/React__default.createElement(material.Tab, _extends({
3725
3727
  label: "Sales Orders"
3726
- }, a11yProps(0))), !hideInvoiceTab && /*#__PURE__*/React__default.createElement(material.Tab, _extends({
3728
+ }, a11yProps(0))), /*#__PURE__*/React__default.createElement(material.Tab, _extends({
3727
3729
  label: "Recent Invoices"
3728
3730
  }, a11yProps(1)))))), /*#__PURE__*/React__default.createElement(TypographyContainer$2, {
3729
3731
  variant: "h4",