@economic/taco 2.64.1-alpha.0 → 2.64.1-dataloader2-infinite-loop.0

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/taco.cjs CHANGED
@@ -37836,9 +37836,6 @@ function useTableRenderer(renderers, table, tableRef, length, defaultRowActiveIn
37836
37836
  virtualiser.measure();
37837
37837
  }
37838
37838
  }, [expandedState]);
37839
- React.useEffect(() => {
37840
- virtualiser.measure();
37841
- }, [tableMeta.fontSize.size, tableMeta.rowHeight.height, JSON.stringify(table.getState().sorting), rows.length]);
37842
37839
  const totalSize = virtualiser.getTotalSize();
37843
37840
  const virtualItems = virtualiser.getVirtualItems();
37844
37841
  const scrollToIndex = React.useCallback(
@@ -38449,21 +38446,6 @@ function Cell$2(props) {
38449
38446
  }
38450
38447
  return /* @__PURE__ */ React.createElement(CellRenderer, { ...cellProps });
38451
38448
  }
38452
- const useResizeObserver$1 = (ref, enabled = true) => {
38453
- const [size2, setSize] = React.useState();
38454
- React.useEffect(() => {
38455
- if (!ref.current || !enabled) {
38456
- return () => void 0;
38457
- }
38458
- const observer = new ResizeObserver((entries) => {
38459
- const entry = entries[0];
38460
- setSize({ height: entry.contentRect.height, width: entry.contentRect.width });
38461
- });
38462
- observer.observe(ref.current);
38463
- return () => observer.disconnect();
38464
- }, [enabled]);
38465
- return size2;
38466
- };
38467
38449
  const DisplayRow = React.memo(function DisplayRow2(props) {
38468
38450
  var _a, _b, _c;
38469
38451
  const { children, cellRenderer: CellRenderer, index: index2, measureRow, row, table, ...otherAttributes } = props;
@@ -38558,13 +38540,12 @@ const DisplayRow = React.memo(function DisplayRow2(props) {
38558
38540
  }
38559
38541
  const ref = React.useRef(null);
38560
38542
  const expansionRef = React.useRef(null);
38561
- const expandedRowSize = useResizeObserver$1(expansionRef, !!expandedRow);
38562
38543
  React.useEffect(() => {
38563
38544
  var _a2, _b2;
38564
38545
  const rowHeight = ((_a2 = ref.current) == null ? void 0 : _a2.getBoundingClientRect().height) ?? 0;
38565
38546
  const expansionHeight = ((_b2 = expansionRef.current) == null ? void 0 : _b2.getBoundingClientRect().height) ?? 0;
38566
38547
  measureRow(rowHeight + expansionHeight);
38567
- }, [expansionRef.current, expandedRowSize == null ? void 0 : expandedRowSize.height]);
38548
+ }, [expansionRef.current]);
38568
38549
  const className = clsx("group/row", otherAttributes.className, {
38569
38550
  "hover:cursor-grab": tableMeta.rowDrag.isEnabled && typeof attributes.onClick !== "function",
38570
38551
  "hover:cursor-pointer": typeof attributes.onClick === "function"
@@ -88609,7 +88590,7 @@ function getDirection(pageIndex, currentPages) {
88609
88590
  return void 0;
88610
88591
  }
88611
88592
  function getPages(pageIndex, lastUsedPageIndex, currentPages, direction) {
88612
- if (currentPages.length && (pageIndex === lastUsedPageIndex || currentPages.includes(pageIndex))) {
88593
+ if (currentPages.length && (pageIndex === lastUsedPageIndex || currentPages.includes(pageIndex) && !!direction)) {
88613
88594
  return currentPages;
88614
88595
  }
88615
88596
  if (direction === "forward") {