@stella-source/stellasource-dsl 1.4.2 → 1.5.3

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/cjs/index.js CHANGED
@@ -21540,6 +21540,8 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
21540
21540
  });
21541
21541
  setLocalColumns(columns);
21542
21542
  setLocalData(data);
21543
+ if (paginationDetails && paginationDetails.startingPage !== pageIndex)
21544
+ setPageIndex(paginationDetails?.startingPage);
21543
21545
  }, [paginationDetails, data, columns]);
21544
21546
  a$l.useLayoutEffect(() => {
21545
21547
  const el = scrollRef.current;
@@ -21678,7 +21680,7 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
21678
21680
  .rows.map((row) => row.original);
21679
21681
  onRowSelect?.(selectedData);
21680
21682
  }
21681
- }, [onRowSelect, table, rowSelection]);
21683
+ }, [rowSelection]);
21682
21684
  a$l.useEffect(() => {
21683
21685
  resetTable();
21684
21686
  }, [resetTrigger]);
@@ -21691,6 +21693,7 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
21691
21693
  pageIndex: paginationDetails?.startingPage - 1,
21692
21694
  pageSize: paginationDetails?.rowsPerPage || 10,
21693
21695
  });
21696
+ table.toggleAllRowsSelected(false);
21694
21697
  };
21695
21698
  return (a$l.createElement(TableWrapper, { className: className, id: id, "data-testid": dataTestId, "data-auto": dataAuto },
21696
21699
  a$l.createElement(TableWrapperScroll, { "$stopScroll": Object.values(filterMenuOpen).some((value) => value), ref: scrollRef }, isLoading ? (a$l.createElement("div", null,
@@ -21773,6 +21776,7 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
21773
21776
  table.getRowModel().rows.length - 1 }, value));
21774
21777
  })))))))),
21775
21778
  showPagination && paginationDetails?.totalRows > 0 && (a$l.createElement(CustomPagination, { totalRows: serverSide ? totalData : table.getFilteredRowModel().rows.length, isLoading: isLoading, rowsPerPage: paginationDetails?.rowsPerPage, startingPage: pageIndex, onPageChange: (page, pageSize) => {
21779
+ table.toggleAllRowsSelected(false);
21776
21780
  setPageIndex(page);
21777
21781
  setPagination((prev) => ({
21778
21782
  ...prev,
@@ -21941,6 +21945,19 @@ const PaymentStatus = ({ variant, id, className }) => {
21941
21945
  a$l.createElement(PaymentStatusLabel, null, label)));
21942
21946
  };
21943
21947
 
21948
+ const Tab = ({ id, className, onClick, htmlProps, label }) => {
21949
+ return (a$l.createElement("button", { id: id, className: className, onClick: () => onClick?.(label), ...htmlProps }, label));
21950
+ };
21951
+
21952
+ const TabsBar = styled.nav `
21953
+ display: flex;
21954
+ gap: 2px;
21955
+ `;
21956
+
21957
+ const Tabs = ({ id, className, tabs, activeTab, htmlProps, onTabClick, }) => {
21958
+ return (a$l.createElement(TabsBar, { id: id, className: className, ...htmlProps }, tabs.map((tab) => (a$l.createElement(Tab, { key: `${id}-${tab}`, id: `${id}-${tab}`, label: tab, onClick: () => onTabClick(tab) })))));
21959
+ };
21960
+
21944
21961
  exports.HelperText = HelperText;
21945
21962
  exports.IconButton = IconButton;
21946
21963
  exports.Label = Label;
@@ -21955,6 +21972,7 @@ exports.Styles = Styles;
21955
21972
  exports.Sync = Sync;
21956
21973
  exports.Table = Table;
21957
21974
  exports.TableUnitsAndTotals = TableUnitsAndTotals;
21975
+ exports.Tabs = Tabs;
21958
21976
  exports.TextInput = TextInput;
21959
21977
  exports.Tooltip = Tooltip;
21960
21978
  //# sourceMappingURL=index.js.map