@infinite-table/infinite-react 10.1.3 → 10.1.4

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/index.d.ts CHANGED
@@ -574,6 +574,18 @@ declare class MatrixBrain extends Logger implements IBrain {
574
574
  protected verticalRenderRange: RenderRangeType;
575
575
  protected extraSpanCells: [number, number][];
576
576
  private scrollPosition;
577
+ /**
578
+ * Content larger than the browser can lay out - see largeContent.ts.
579
+ * Recomputed when sizes change (updateRenderCount), not on scroll.
580
+ */
581
+ private largeContent;
582
+ private scrollRatio;
583
+ /**
584
+ * DOM offsets are written relative to this (content px) - see
585
+ * "scroll origin" in largeContent.ts. Always 0 unless the content is large.
586
+ */
587
+ private scrollOrigin;
588
+ private onScrollOriginChangeFns;
577
589
  private onScrollFns;
578
590
  private onRenderRangeChangeFns;
579
591
  private onVerticalRenderRangeChangeFns;
@@ -624,6 +636,55 @@ declare class MatrixBrain extends Logger implements IBrain {
624
636
  direction: 'horizontal' | 'vertical';
625
637
  }): () => void;
626
638
  updateRenderCount(which?: WhichDirection): void;
639
+ /**
640
+ * The axes on which this brain handles content larger than the browser
641
+ * can lay out. The normal layout: vertical (horizontal offsets come from
642
+ * column CSS vars computed by the table, not from the brain).
643
+ */
644
+ protected supportsLargeContent(direction: 'horizontal' | 'vertical'): boolean;
645
+ /**
646
+ * Where the origin can be placed - see HorizontalLayoutMatrixBrain, which
647
+ * needs whole pages
648
+ */
649
+ protected alignScrollOrigin(_direction: 'horizontal' | 'vertical', value: number): number;
650
+ private updateLargeContent;
651
+ isLargeContent(direction: 'horizontal' | 'vertical'): boolean;
652
+ /**
653
+ * native scroll px -> content px (1 when the content fits)
654
+ */
655
+ getScrollRatio(direction: 'horizontal' | 'vertical'): number;
656
+ /**
657
+ * The size for the scroll spacer - the content size, capped at what the
658
+ * browser supports on large axes.
659
+ */
660
+ getNativeScrollSize(): Size;
661
+ /**
662
+ * The native scroll position of the scroll container -> the content scroll
663
+ * position (what the brain and the API work with)
664
+ */
665
+ toContentScrollPosition(nativeScrollPosition: ScrollPosition): ScrollPosition;
666
+ /**
667
+ * Content scroll position -> what to set on the scroll container
668
+ */
669
+ toNativeScrollPosition(contentScrollPosition: ScrollPosition): ScrollPosition;
670
+ /**
671
+ * DOM offsets (transforms, CSS vars) are relative to this. Always 0,0
672
+ * unless the content is large.
673
+ */
674
+ getScrollOrigin(): ScrollPosition;
675
+ /**
676
+ * The scroll position relative to the scroll origin - this is what
677
+ * transforms that follow the scroll position should use.
678
+ */
679
+ getDOMScrollPosition(scrollPosition?: ScrollPosition): ScrollPosition;
680
+ /**
681
+ * Called (synchronously) when the scroll origin moves - every DOM offset
682
+ * relative to it has to be written again (in the same frame).
683
+ */
684
+ onScrollOriginChange: (fn: (origin: ScrollPosition) => void) => () => void;
685
+ protected onScrollOriginChangeForBrain(fn: (origin: ScrollPosition) => void): () => void;
686
+ protected updateScrollOrigin(): void;
687
+ protected notifyScrollOriginChange(): void;
627
688
  protected doUpdateRenderCount(which?: WhichDirection): void;
628
689
  get scrollTopMax(): number;
629
690
  get scrollLeftMax(): number;
@@ -1937,6 +1998,13 @@ declare class GridRenderer extends Logger {
1937
1998
  scrollTop?: boolean;
1938
1999
  }, zIndex: number | "auto" | undefined | null) => void;
1939
2000
  constructor(brain: MatrixBrain, debugId: string | undefined, pools: GridRendererPools);
2001
+ /**
2002
+ * The scroll origin moved (huge content only - see largeContent.ts): every
2003
+ * rendered cell / detail row is positioned relative to it, so they all
2004
+ * need to be repositioned now - synchronously, so it's in the same frame
2005
+ * as the scroll layer transform, which uses the new origin too.
2006
+ */
2007
+ private onScrollOriginChange;
1940
2008
  private onCellAttached;
1941
2009
  private onCellDetached;
1942
2010
  private onRowAttached;
@@ -2003,6 +2071,8 @@ declare class GridRenderer extends Logger {
2003
2071
  hidden: boolean;
2004
2072
  rowspan: number;
2005
2073
  colspan: number;
2074
+ }, config?: {
2075
+ immediate?: boolean;
2006
2076
  }) => void;
2007
2077
  private updateDetailElementPosition;
2008
2078
  private onScrollStart;