@salesgenterp/ui-components 0.4.531 → 0.4.532

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.
@@ -7758,6 +7758,7 @@ function EnhancedTable(_ref2) {
7758
7758
  var _React$useState6 = useState(DEFAULT_PAGE_SIZE),
7759
7759
  rowsPerPage = _React$useState6[0],
7760
7760
  setRowsPerPage = _React$useState6[1];
7761
+ var tableContainerRef = useRef(null);
7761
7762
  var NUMERIC_SORT_COLUMNS = ['quantity', 'standardPrice', 'subtotal'];
7762
7763
  var handleRequestSort = function handleRequestSort(event, property) {
7763
7764
  var isSameColumn = orderBy === property;
@@ -7826,6 +7827,13 @@ function EnhancedTable(_ref2) {
7826
7827
  setPage(1);
7827
7828
  }
7828
7829
  }, [totalPages, page]);
7830
+ useEffect(function () {
7831
+ var _tableContainerRef$cu, _tableContainerRef$cu2;
7832
+ (_tableContainerRef$cu = tableContainerRef.current) === null || _tableContainerRef$cu === void 0 ? void 0 : (_tableContainerRef$cu2 = _tableContainerRef$cu.scrollTo) === null || _tableContainerRef$cu2 === void 0 ? void 0 : _tableContainerRef$cu2.call(_tableContainerRef$cu, {
7833
+ top: 0,
7834
+ behavior: 'smooth'
7835
+ });
7836
+ }, [page, rowsPerPage]);
7829
7837
  return /*#__PURE__*/createElement(CartPageBox, null, loading && /*#__PURE__*/createElement(Loader$1, null, /*#__PURE__*/createElement(BounceLoader, {
7830
7838
  size: 40,
7831
7839
  color: styles === null || styles === void 0 ? void 0 : (_styles$Btn = styles.Btn) === null || _styles$Btn === void 0 ? void 0 : _styles$Btn.background,
@@ -7835,6 +7843,7 @@ function EnhancedTable(_ref2) {
7835
7843
  width: '100%'
7836
7844
  }
7837
7845
  }, /*#__PURE__*/createElement(CartTableContainer, {
7846
+ ref: tableContainerRef,
7838
7847
  bg: styles === null || styles === void 0 ? void 0 : (_styles$scroll = styles.scroll) === null || _styles$scroll === void 0 ? void 0 : _styles$scroll.bg,
7839
7848
  color: styles === null || styles === void 0 ? void 0 : (_styles$scroll2 = styles.scroll) === null || _styles$scroll2 === void 0 ? void 0 : _styles$scroll2.color
7840
7849
  }, /*#__PURE__*/createElement(Table$1, {