@pdanpdan/virtual-scroll 0.5.0 → 0.6.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/index.d.ts CHANGED
@@ -178,7 +178,6 @@ export declare function calculateScrollTarget({ rowIndex, colIndex, options, dir
178
178
  * @param params.height - Virtual item height (VU).
179
179
  * @param params.stickyIndices - All sticky indices.
180
180
  * @param params.fixedSize - Fixed item size (VU).
181
- * @param params.fixedWidth - Fixed column width (VU).
182
181
  * @param params.gap - Item gap (VU).
183
182
  * @param params.columnGap - Column gap (VU).
184
183
  * @param params.getItemQueryY - Resolver for vertical offset (VU).
@@ -186,7 +185,9 @@ export declare function calculateScrollTarget({ rowIndex, colIndex, options, dir
186
185
  * @returns Sticky state and offset (VU).
187
186
  * @see StickyParams
188
187
  */
189
- export declare function calculateStickyItem({ index, isSticky, direction, relativeScrollX, relativeScrollY, originalX, originalY, width, height, stickyIndices, fixedSize, fixedWidth, gap, columnGap, getItemQueryY, getItemQueryX, }: StickyParams): {
188
+ export declare function calculateStickyItem({ index, isSticky, direction, relativeScrollX, relativeScrollY, originalX, originalY, width, height, stickyIndices, fixedSize, gap, columnGap, getItemQueryY, getItemQueryX, }: StickyParams): {
189
+ isStickyActiveX: boolean;
190
+ isStickyActiveY: boolean;
190
191
  isStickyActive: boolean;
191
192
  stickyOffset: {
192
193
  x: number;
@@ -252,10 +253,13 @@ export declare interface ColumnRangeParams {
252
253
  totalColsQuery: () => number;
253
254
  }
254
255
 
256
+ /** Default number of items to render outside the viewport. */
255
257
  export declare const DEFAULT_BUFFER = 5;
256
258
 
259
+ /** Default fallback width for columns (VU). */
257
260
  export declare const DEFAULT_COLUMN_WIDTH = 100;
258
261
 
262
+ /** Default fallback size for items (VU). */
259
263
  export declare const DEFAULT_ITEM_SIZE = 40;
260
264
 
261
265
  /**
@@ -268,6 +272,9 @@ export declare const DEFAULT_ITEM_SIZE = 40;
268
272
  */
269
273
  export declare function displayToVirtual(displayPos: number, hostOffset: number, scale: number): number;
270
274
 
275
+ /** Initial empty state for scroll details. */
276
+ export declare const EMPTY_SCROLL_DETAILS: ScrollDetails<unknown>;
277
+
271
278
  /**
272
279
  * Fenwick Tree (Binary Indexed Tree) implementation for efficient
273
280
  * prefix sum calculations and updates.
@@ -481,16 +488,7 @@ export declare interface ItemSlotProps<T = unknown> {
481
488
  /** The 0-based index of the item. */
482
489
  index: number;
483
490
  /** Information about the currently visible range of columns. */
484
- columnRange: {
485
- /** First rendered column. */
486
- start: number;
487
- /** Last rendered column (exclusive). */
488
- end: number;
489
- /** Pixel space before first column. */
490
- padStart: number;
491
- /** Pixel space after last column. */
492
- padEnd: number;
493
- };
491
+ columnRange: ColumnRange;
494
492
  /** Helper to get the current calculated width of any column index. */
495
493
  getColumnWidth: (index: number) => number;
496
494
  /** Vertical gap between items. */
@@ -501,6 +499,17 @@ export declare interface ItemSlotProps<T = unknown> {
501
499
  isSticky?: boolean | undefined;
502
500
  /** Whether this item is currently in a sticky state at the edge. */
503
501
  isStickyActive?: boolean | undefined;
502
+ /** Whether this item is currently in a sticky state at the horizontal edge. */
503
+ isStickyActiveX?: boolean | undefined;
504
+ /** Whether this item is currently in a sticky state at the vertical edge. */
505
+ isStickyActiveY?: boolean | undefined;
506
+ /** The calculated pixel offset relative to the items wrapper in display pixels (DU). */
507
+ offset: {
508
+ /** Horizontal offset (left) in DU. */
509
+ x: number;
510
+ /** Vertical offset (top) in DU. */
511
+ y: number;
512
+ };
504
513
  }
505
514
 
506
515
  /** Parameters for calculating an item's style object. */
@@ -523,6 +532,20 @@ export declare interface ItemStyleParams<T = unknown> {
523
532
  isRtl: boolean;
524
533
  }
525
534
 
535
+ /** Pixel padding configuration in display pixels (DU). */
536
+ export declare type PaddingValue = number | {
537
+ x?: number;
538
+ y?: number;
539
+ };
540
+
541
+ /** Represents a point in 2D space. */
542
+ export declare interface Point {
543
+ /** X coordinate. */
544
+ x: number;
545
+ /** Y coordinate. */
546
+ y: number;
547
+ }
548
+
526
549
  declare interface Props<T = unknown> extends VirtualScrollComponentProps<T> {
527
550
  }
528
551
 
@@ -570,19 +593,9 @@ export declare interface RenderedItem<T = unknown> {
570
593
  /** The 0-based index of the item in the original array. */
571
594
  index: number;
572
595
  /** The calculated pixel offset relative to the items wrapper in display pixels (DU). */
573
- offset: {
574
- /** Horizontal offset (left) in DU. */
575
- x: number;
576
- /** Vertical offset (top) in DU. */
577
- y: number;
578
- };
596
+ offset: Point;
579
597
  /** The current measured or estimated size of the item in virtual units (VU). */
580
- size: {
581
- /** Pixel width in VU. */
582
- width: number;
583
- /** Pixel height in VU. */
584
- height: number;
585
- };
598
+ size: Size;
586
599
  /** The original horizontal pixel offset before any sticky adjustments in VU. */
587
600
  originalX: number;
588
601
  /** The original vertical pixel offset before any sticky adjustments in VU. */
@@ -591,13 +604,12 @@ export declare interface RenderedItem<T = unknown> {
591
604
  isSticky?: boolean;
592
605
  /** Whether this item is currently in a stuck state at the viewport edge. */
593
606
  isStickyActive?: boolean;
607
+ /** Whether this item is currently in a stuck state at the horizontal viewport edge. */
608
+ isStickyActiveX?: boolean;
609
+ /** Whether this item is currently in a stuck state at the vertical viewport edge. */
610
+ isStickyActiveY?: boolean;
594
611
  /** The relative translation applied to the item for the sticky pushing effect in DU. */
595
- stickyOffset: {
596
- /** Horizontal translation in DU. */
597
- x: number;
598
- /** Vertical translation in DU. */
599
- y: number;
600
- };
612
+ stickyOffset: Point;
601
613
  }
602
614
 
603
615
  /**
@@ -622,6 +634,8 @@ export declare type ScrollAxis = 'vertical' | 'horizontal';
622
634
 
623
635
  /** Properties passed to the 'scrollbar' scoped slot. */
624
636
  export declare interface ScrollbarSlotProps {
637
+ /** The axis for this scrollbar. */
638
+ axis: ScrollAxis;
625
639
  /** Current scroll position as a percentage (0 to 1). */
626
640
  positionPercent: number;
627
641
  /** Viewport size as a percentage of total size (0 to 1). */
@@ -662,40 +676,15 @@ export declare interface ScrollDetails<T = unknown> {
662
676
  /** Index of the last column visible before any sticky end column in the viewport (grid mode). */
663
677
  currentEndColIndex: number;
664
678
  /** Current relative pixel scroll position from the content start in VU. */
665
- scrollOffset: {
666
- /** Horizontal position (X) in VU. */
667
- x: number;
668
- /** Vertical position (Y) in VU. */
669
- y: number;
670
- };
679
+ scrollOffset: Point;
671
680
  /** Current display pixel scroll position (before scaling) in DU. */
672
- displayScrollOffset: {
673
- /** Horizontal position (X) in DU. */
674
- x: number;
675
- /** Vertical position (Y) in DU. */
676
- y: number;
677
- };
681
+ displayScrollOffset: Point;
678
682
  /** Current dimensions of the visible viewport area in VU. */
679
- viewportSize: {
680
- /** Pixel width in VU. */
681
- width: number;
682
- /** Pixel height in VU. */
683
- height: number;
684
- };
683
+ viewportSize: Size;
685
684
  /** Current dimensions of the visible viewport area in display pixels (DU). */
686
- displayViewportSize: {
687
- /** Pixel width in DU. */
688
- width: number;
689
- /** Pixel height in DU. */
690
- height: number;
691
- };
685
+ displayViewportSize: Size;
692
686
  /** Total calculated or estimated size of all items and gaps in VU. */
693
- totalSize: {
694
- /** Total pixel width in VU. */
695
- width: number;
696
- /** Total pixel height in VU. */
697
- height: number;
698
- };
687
+ totalSize: Size;
699
688
  /** Whether the container is currently being scrolled by the user or an animation. */
700
689
  isScrolling: boolean;
701
690
  /** Whether the current scroll operation was initiated programmatically. */
@@ -783,10 +772,6 @@ export declare interface ScrollTargetParams {
783
772
  flowPaddingStartX?: number | undefined;
784
773
  /** Flow padding start on Y axis. */
785
774
  flowPaddingStartY?: number | undefined;
786
- /** Flow padding end on X axis. */
787
- flowPaddingEndX?: number | undefined;
788
- /** Flow padding end on Y axis. */
789
- flowPaddingEndY?: number | undefined;
790
775
  /** Scroll padding start on X axis. */
791
776
  paddingStartX?: number | undefined;
792
777
  /** Scroll padding start on Y axis. */
@@ -813,6 +798,15 @@ export declare interface ScrollTargetResult {
813
798
  effectiveAlignY: ScrollAlignment;
814
799
  }
815
800
 
801
+ /**
802
+ * Universal scroll function that handles both Window and HTMLElements.
803
+ *
804
+ * @param container - The container to scroll.
805
+ * @param options - Scroll options.
806
+ */
807
+ declare function scrollTo_2(container: HTMLElement | Window | null | undefined, options: ScrollToOptions): void;
808
+ export { scrollTo_2 as scrollTo }
809
+
816
810
  /** Options for the `scrollToIndex` method. */
817
811
  export declare interface ScrollToIndexOptions {
818
812
  /**
@@ -831,6 +825,29 @@ export declare interface ScrollToIndexOptions {
831
825
  /* Excluded from this release type: isCorrection */
832
826
  }
833
827
 
828
+ /** Represents dimensions in 2D space. */
829
+ export declare interface Size {
830
+ /** Width dimension. */
831
+ width: number;
832
+ /** Height dimension. */
833
+ height: number;
834
+ }
835
+
836
+ /**
837
+ * Configuration for Server-Side Rendering.
838
+ * Defines which items are rendered statically on the server.
839
+ */
840
+ export declare interface SSRRange {
841
+ /** First row index (for list or grid). */
842
+ start: number;
843
+ /** Exclusive last row index (for list or grid). */
844
+ end: number;
845
+ /** First column index (for grid mode). */
846
+ colStart?: number;
847
+ /** Exclusive last column index (for grid mode). */
848
+ colEnd?: number;
849
+ }
850
+
834
851
  /** Parameters for calculating sticky item offsets. */
835
852
  export declare interface StickyParams {
836
853
  /** Item index. */
@@ -1323,17 +1340,7 @@ export declare const VirtualScroll: <T>(__VLS_props: NonNullable<Awaited<typeof
1323
1340
  items: Ref<T[], T[]>;
1324
1341
  itemSize: Ref<number | ((item: T, index: number) => number) | null | undefined, number | ((item: T, index: number) => number) | null | undefined>;
1325
1342
  container: Ref<HTMLElement | Window | null | undefined, HTMLElement | Window | null | undefined>;
1326
- ssrRange: Ref< {
1327
- start: number;
1328
- end: number;
1329
- colStart?: number;
1330
- colEnd?: number;
1331
- } | undefined, {
1332
- start: number;
1333
- end: number;
1334
- colStart?: number;
1335
- colEnd?: number;
1336
- } | undefined>;
1343
+ ssrRange: Ref<SSRRange | undefined, SSRRange | undefined>;
1337
1344
  columnWidth: Ref<number | number[] | ((index: number) => number) | null | undefined, number | number[] | ((index: number) => number) | null | undefined>;
1338
1345
  initialScrollIndex: Ref<number | undefined, number | undefined>;
1339
1346
  initialScrollAlign: Ref<ScrollAlignment | ScrollAlignmentOptions | undefined, ScrollAlignment | ScrollAlignmentOptions | undefined>;
@@ -1346,20 +1353,8 @@ export declare const VirtualScroll: <T>(__VLS_props: NonNullable<Awaited<typeof
1346
1353
  containerTag: Ref<string, string>;
1347
1354
  wrapperTag: Ref<string, string>;
1348
1355
  itemTag: Ref<string, string>;
1349
- scrollPaddingStart: Ref<number | {
1350
- x?: number;
1351
- y?: number;
1352
- }, number | {
1353
- x?: number;
1354
- y?: number;
1355
- }>;
1356
- scrollPaddingEnd: Ref<number | {
1357
- x?: number;
1358
- y?: number;
1359
- }, number | {
1360
- x?: number;
1361
- y?: number;
1362
- }>;
1356
+ scrollPaddingStart: Ref<PaddingValue, PaddingValue>;
1357
+ scrollPaddingEnd: Ref<PaddingValue, PaddingValue>;
1363
1358
  stickyHeader: Ref<boolean, boolean>;
1364
1359
  stickyFooter: Ref<boolean, boolean>;
1365
1360
  gap: Ref<number, number>;
@@ -1381,39 +1376,7 @@ export declare const VirtualScroll: <T>(__VLS_props: NonNullable<Awaited<typeof
1381
1376
  /**
1382
1377
  * Scoped slot for rendering each individual item.
1383
1378
  */
1384
- item?: (props: {
1385
- /** The original data item from the `items` array. */
1386
- item: T;
1387
- /** The original index of the item in the `items` array. */
1388
- index: number;
1389
- /**
1390
- * Information about the current visible range of columns (for grid mode).
1391
- * @see ColumnRange
1392
- */
1393
- columnRange: {
1394
- /** Index of the first rendered column. */
1395
- start: number;
1396
- /** Index of the last rendered column (exclusive). */
1397
- end: number;
1398
- /** Pixel offset from the start of the row to the first rendered cell. */
1399
- padStart: number;
1400
- /** Pixel offset from the last rendered cell to the end of the row. */
1401
- padEnd: number;
1402
- };
1403
- /**
1404
- * Helper function to get the width of a specific column.
1405
- * Useful for setting consistent widths in grid mode.
1406
- */
1407
- getColumnWidth: (index: number) => number;
1408
- /** Vertical gap between items. */
1409
- gap: number;
1410
- /** Horizontal gap between columns. */
1411
- columnGap: number;
1412
- /** Whether this item is configured to be sticky via `stickyIndices`. */
1413
- isSticky?: boolean | undefined;
1414
- /** Whether this item is currently in a sticky state (stuck at the top/start). */
1415
- isStickyActive?: boolean | undefined;
1416
- }) => VNodeChild;
1379
+ item?: (props: ItemSlotProps<T>) => VNodeChild;
1417
1380
  /**
1418
1381
  * Content shown at the end of the list when the `loading` prop is true.
1419
1382
  * Also prevents additional 'load' events from triggering while visible.
@@ -1438,39 +1401,7 @@ export declare const VirtualScroll: <T>(__VLS_props: NonNullable<Awaited<typeof
1438
1401
  /**
1439
1402
  * Scoped slot for rendering each individual item.
1440
1403
  */
1441
- item?: (props: {
1442
- /** The original data item from the `items` array. */
1443
- item: T;
1444
- /** The original index of the item in the `items` array. */
1445
- index: number;
1446
- /**
1447
- * Information about the current visible range of columns (for grid mode).
1448
- * @see ColumnRange
1449
- */
1450
- columnRange: {
1451
- /** Index of the first rendered column. */
1452
- start: number;
1453
- /** Index of the last rendered column (exclusive). */
1454
- end: number;
1455
- /** Pixel offset from the start of the row to the first rendered cell. */
1456
- padStart: number;
1457
- /** Pixel offset from the last rendered cell to the end of the row. */
1458
- padEnd: number;
1459
- };
1460
- /**
1461
- * Helper function to get the width of a specific column.
1462
- * Useful for setting consistent widths in grid mode.
1463
- */
1464
- getColumnWidth: (index: number) => number;
1465
- /** Vertical gap between items. */
1466
- gap: number;
1467
- /** Horizontal gap between columns. */
1468
- columnGap: number;
1469
- /** Whether this item is configured to be sticky via `stickyIndices`. */
1470
- isSticky?: boolean | undefined;
1471
- /** Whether this item is currently in a sticky state (stuck at the top/start). */
1472
- isStickyActive?: boolean | undefined;
1473
- }) => VNodeChild;
1404
+ item?: (props: ItemSlotProps<T>) => VNodeChild;
1474
1405
  /**
1475
1406
  * Content shown at the end of the list when the `loading` prop is true.
1476
1407
  * Also prevents additional 'load' events from triggering while visible.
@@ -1547,145 +1478,15 @@ export declare interface VirtualScrollbarProps {
1547
1478
  isRtl?: boolean;
1548
1479
  }
1549
1480
 
1550
- /** Configuration properties for the `VirtualScroll` component. */
1551
- export declare interface VirtualScrollComponentProps<T = unknown> {
1552
- /** Array of items to be virtualized. */
1553
- items: T[];
1554
- /** Fixed size of each item (in pixels) or a function that returns the size of an item. */
1555
- itemSize?: number | ((item: T, index: number) => number) | null;
1556
- /** Direction of the scroll. */
1557
- direction?: ScrollDirection;
1558
- /** Number of items to render before the visible viewport. */
1559
- bufferBefore?: number;
1560
- /** Number of items to render after the visible viewport. */
1561
- bufferAfter?: number;
1562
- /** The scrollable container element or window. */
1563
- container?: HTMLElement | Window | null;
1564
- /** Range of items to render during Server-Side Rendering. */
1565
- ssrRange?: {
1566
- /** First row index to render. */
1567
- start: number;
1568
- /** Last row index to render (exclusive). */
1569
- end: number;
1570
- /** First column index to render (for grid mode). */
1571
- colStart?: number;
1572
- /** Last column index to render (exclusive, for grid mode). */
1573
- colEnd?: number;
1574
- };
1575
- /** Number of columns for bidirectional (grid) scroll. */
1576
- columnCount?: number;
1577
- /** Fixed width of columns (in pixels), an array of widths, or a function for column widths. */
1578
- columnWidth?: number | number[] | ((index: number) => number) | null;
1579
- /** The HTML tag to use for the root container. */
1580
- containerTag?: string;
1581
- /** The HTML tag to use for the items wrapper. */
1582
- wrapperTag?: string;
1583
- /** The HTML tag to use for each item. */
1584
- itemTag?: string;
1585
- /** Additional padding at the start of the scroll container (top or left). */
1586
- scrollPaddingStart?: number | {
1587
- x?: number;
1588
- y?: number;
1589
- };
1590
- /** Additional padding at the end of the scroll container (bottom or right). */
1591
- scrollPaddingEnd?: number | {
1592
- x?: number;
1593
- y?: number;
1594
- };
1595
- /** Whether the content in the 'header' slot is sticky. */
1596
- stickyHeader?: boolean;
1597
- /** Whether the content in the 'footer' slot is sticky. */
1598
- stickyFooter?: boolean;
1599
- /** Gap between items in pixels. */
1600
- gap?: number;
1601
- /** Gap between columns in pixels. */
1602
- columnGap?: number;
1603
- /** Indices of items that should stick to the top/start of the viewport. */
1604
- stickyIndices?: number[];
1605
- /** Distance from the end of the scrollable area (in pixels) to trigger the 'load' event. */
1606
- loadDistance?: number;
1607
- /** Whether items are currently being loaded. */
1608
- loading?: boolean;
1609
- /** Whether to automatically restore and maintain scroll position when items are prepended to the list. */
1610
- restoreScrollOnPrepend?: boolean;
1611
- /** Initial scroll index to jump to immediately after mount. */
1612
- initialScrollIndex?: number;
1613
- /** Alignment for the initial scroll index. */
1614
- initialScrollAlign?: ScrollAlignment | ScrollAlignmentOptions;
1615
- /** Default size for items before they are measured by ResizeObserver. */
1616
- defaultItemSize?: number;
1617
- /** Default width for columns before they are measured by ResizeObserver. */
1618
- defaultColumnWidth?: number;
1619
- /** Whether to show debug information (visible offsets and indices) over items. */
1620
- debug?: boolean;
1621
- /** Whether to use virtual scrollbars for styling purposes. */
1622
- virtualScrollbar?: boolean;
1623
- }
1624
-
1625
- /** Exposed methods and properties of the `VirtualScroll` component instance. */
1626
- export declare interface VirtualScrollInstance<T = unknown> extends VirtualScrollComponentProps<T> {
1627
- /** Detailed information about the current scroll state. */
1628
- scrollDetails: ScrollDetails<T>;
1629
- /** Information about the current visible range of columns. */
1630
- columnRange: ScrollDetails<T>['columnRange'];
1631
- /** Helper to get the width of a specific column. */
1632
- getColumnWidth: (index: number) => number;
1633
- /** Helper to get the height of a specific row. */
1634
- getRowHeight: (index: number) => number;
1635
- /** Helper to get the virtual offset of a specific row. */
1636
- getRowOffset: (index: number) => number;
1637
- /** Helper to get the virtual offset of a specific column. */
1638
- getColumnOffset: (index: number) => number;
1639
- /** Helper to get the virtual offset of a specific item. */
1640
- getItemOffset: (index: number) => number;
1641
- /** Helper to get the size of a specific item along the scroll axis. */
1642
- getItemSize: (index: number) => number;
1643
- /** Programmatically scroll to a specific row and/or column. */
1644
- scrollToIndex: (rowIndex: number | null | undefined, colIndex: number | null | undefined, options?: ScrollAlignment | ScrollAlignmentOptions | ScrollToIndexOptions) => void;
1645
- /** Programmatically scroll to a specific pixel offset. */
1646
- scrollToOffset: (x?: number | null, y?: number | null, options?: {
1647
- behavior?: 'auto' | 'smooth';
1648
- }) => void;
1649
- /** Resets all dynamic measurements and re-initializes from props. */
1650
- refresh: () => void;
1651
- /** Immediately stops any currently active smooth scroll animation and clears pending corrections. */
1652
- stopProgrammaticScroll: () => void;
1653
- /** Detects the current direction (LTR/RTL) of the scroll container. */
1654
- updateDirection: () => void;
1655
- /** Whether the scroll container is in Right-to-Left (RTL) mode. */
1656
- isRtl: boolean;
1657
- /** Whether the component has finished its first client - side mount and hydration. */
1658
- isHydrated: boolean;
1659
- /** Coordinate scaling factor for X axis. */
1660
- scaleX: number;
1661
- /** Coordinate scaling factor for Y axis. */
1662
- scaleY: number;
1663
- /** Physical width of the content in the DOM (clamped to browser limits). */
1664
- renderedWidth: number;
1665
- /** Physical height of the content in the DOM (clamped to browser limits). */
1666
- renderedHeight: number;
1667
- /** Absolute offset of the component within its container. */
1668
- componentOffset: {
1669
- x: number;
1670
- y: number;
1671
- };
1672
- /** Properties for the vertical scrollbar. */
1673
- scrollbarPropsVertical: ScrollbarSlotProps | null;
1674
- /** Properties for the horizontal scrollbar. */
1675
- scrollbarPropsHorizontal: ScrollbarSlotProps | null;
1676
- }
1677
-
1678
- /** Configuration properties for the `useVirtualScroll` composable. */
1679
- export declare interface VirtualScrollProps<T = unknown> {
1680
- /**
1681
- * Array of data items to virtualize.
1682
- */
1481
+ /** Base configuration properties shared between the component and the composable. */
1482
+ export declare interface VirtualScrollBaseProps<T = unknown> {
1483
+ /** Array of data items to virtualize. */
1683
1484
  items: T[];
1684
1485
  /**
1685
1486
  * Fixed size of each item in virtual units (VU) or a function that returns the size of an item.
1686
1487
  * Pass `0`, `null` or `undefined` for automatic dynamic size detection via `ResizeObserver`.
1687
1488
  */
1688
- itemSize?: number | ((item: T, index: number) => number) | undefined;
1489
+ itemSize?: number | ((item: T, index: number) => number) | null | undefined;
1689
1490
  /**
1690
1491
  * Direction of the virtual scroll.
1691
1492
  * @default 'vertical'
@@ -1706,30 +1507,11 @@ export declare interface VirtualScrollProps<T = unknown> {
1706
1507
  * If not provided, virtualization usually happens relative to the `hostRef`.
1707
1508
  */
1708
1509
  container?: HTMLElement | Window | null | undefined;
1709
- /**
1710
- * The host element that directly wraps the absolute-positioned items.
1711
- * Used for calculating relative offsets in display pixels (DU).
1712
- */
1713
- hostElement?: HTMLElement | null | undefined;
1714
- /**
1715
- * The root element of the VirtualScroll component.
1716
- * Used for calculating relative offsets in display pixels (DU).
1717
- */
1718
- hostRef?: HTMLElement | null | undefined;
1719
1510
  /**
1720
1511
  * Configuration for Server-Side Rendering.
1721
1512
  * Defines which items are rendered statically on the server.
1722
1513
  */
1723
- ssrRange?: {
1724
- /** First row index. */
1725
- start: number;
1726
- /** Exclusive last row index. */
1727
- end: number;
1728
- /** First column index (grid mode). */
1729
- colStart?: number;
1730
- /** Exclusive last column index (grid mode). */
1731
- colEnd?: number;
1732
- } | undefined;
1514
+ ssrRange?: SSRRange | undefined;
1733
1515
  /**
1734
1516
  * Number of columns for bidirectional grid scrolling.
1735
1517
  */
@@ -1738,37 +1520,15 @@ export declare interface VirtualScrollProps<T = unknown> {
1738
1520
  * Fixed width of columns in VU, an array of widths, or a function returning widths.
1739
1521
  * Pass `0`, `null` or `undefined` for dynamic column detection.
1740
1522
  */
1741
- columnWidth?: number | number[] | ((index: number) => number) | undefined;
1523
+ columnWidth?: number | number[] | ((index: number) => number) | null | undefined;
1742
1524
  /**
1743
1525
  * Pixel padding at the start of the scroll container in display pixels (DU).
1744
1526
  */
1745
- scrollPaddingStart?: number | {
1746
- x?: number;
1747
- y?: number;
1748
- } | undefined;
1527
+ scrollPaddingStart?: PaddingValue | undefined;
1749
1528
  /**
1750
1529
  * Pixel padding at the end of the scroll container in DU.
1751
1530
  */
1752
- scrollPaddingEnd?: number | {
1753
- x?: number;
1754
- y?: number;
1755
- } | undefined;
1756
- /**
1757
- * Size of sticky elements at the start of the viewport (top or left) in DU.
1758
- * Used to adjust the visible range and item positioning without increasing content size.
1759
- */
1760
- stickyStart?: number | {
1761
- x?: number;
1762
- y?: number;
1763
- } | undefined;
1764
- /**
1765
- * Size of sticky elements at the end of the viewport (bottom or right) in DU.
1766
- * Used to adjust the visible range without increasing content size.
1767
- */
1768
- stickyEnd?: number | {
1769
- x?: number;
1770
- y?: number;
1771
- } | undefined;
1531
+ scrollPaddingEnd?: PaddingValue | undefined;
1772
1532
  /**
1773
1533
  * Gap between items in virtual units (VU).
1774
1534
  * Applied vertically in list/grid mode, horizontally in horizontal list mode.
@@ -1783,20 +1543,6 @@ export declare interface VirtualScrollProps<T = unknown> {
1783
1543
  * List of indices that should stick to the viewport edge.
1784
1544
  */
1785
1545
  stickyIndices?: number[] | undefined;
1786
- /**
1787
- * Extra padding (display pixels - DU) at the start of the flow (e.g. non-sticky header).
1788
- */
1789
- flowPaddingStart?: number | {
1790
- x?: number;
1791
- y?: number;
1792
- } | undefined;
1793
- /**
1794
- * Extra padding (DU) at the end of the flow (e.g. non-sticky footer).
1795
- */
1796
- flowPaddingEnd?: number | {
1797
- x?: number;
1798
- y?: number;
1799
- } | undefined;
1800
1546
  /**
1801
1547
  * Threshold distance from the end in display pixels (DU) to emit the 'load' event.
1802
1548
  * @default 200
@@ -1833,6 +1579,104 @@ export declare interface VirtualScrollProps<T = unknown> {
1833
1579
  debug?: boolean | undefined;
1834
1580
  }
1835
1581
 
1582
+ /** Configuration properties for the `VirtualScroll` component. */
1583
+ export declare interface VirtualScrollComponentProps<T = unknown> extends VirtualScrollBaseProps<T> {
1584
+ /** The HTML tag to use for the root container. */
1585
+ containerTag?: string;
1586
+ /** The HTML tag to use for the items wrapper. */
1587
+ wrapperTag?: string;
1588
+ /** The HTML tag to use for each item. */
1589
+ itemTag?: string;
1590
+ /** Whether the content in the 'header' slot is sticky. */
1591
+ stickyHeader?: boolean;
1592
+ /** Whether the content in the 'footer' slot is sticky. */
1593
+ stickyFooter?: boolean;
1594
+ /** Whether to use virtual scrollbars for styling purposes. */
1595
+ virtualScrollbar?: boolean;
1596
+ }
1597
+
1598
+ /** Exposed methods and properties of the `VirtualScroll` component instance. */
1599
+ export declare interface VirtualScrollInstance<T = unknown> extends VirtualScrollComponentProps<T> {
1600
+ /** Detailed information about the current scroll state. */
1601
+ scrollDetails: ScrollDetails<T>;
1602
+ /** Information about the current visible range of columns. */
1603
+ columnRange: ScrollDetails<T>['columnRange'];
1604
+ /** Helper to get the width of a specific column. */
1605
+ getColumnWidth: (index: number) => number;
1606
+ /** Helper to get the height of a specific row. */
1607
+ getRowHeight: (index: number) => number;
1608
+ /** Helper to get the virtual offset of a specific row. */
1609
+ getRowOffset: (index: number) => number;
1610
+ /** Helper to get the virtual offset of a specific column. */
1611
+ getColumnOffset: (index: number) => number;
1612
+ /** Helper to get the virtual offset of a specific item. */
1613
+ getItemOffset: (index: number) => number;
1614
+ /** Helper to get the size of a specific item along the scroll axis. */
1615
+ getItemSize: (index: number) => number;
1616
+ /** Programmatically scroll to a specific row and/or column. */
1617
+ scrollToIndex: (rowIndex: number | null | undefined, colIndex: number | null | undefined, options?: ScrollAlignment | ScrollAlignmentOptions | ScrollToIndexOptions) => void;
1618
+ /** Programmatically scroll to a specific pixel offset. */
1619
+ scrollToOffset: (x?: number | null, y?: number | null, options?: {
1620
+ behavior?: 'auto' | 'smooth';
1621
+ }) => void;
1622
+ /** Resets all dynamic measurements and re-initializes from props. */
1623
+ refresh: () => void;
1624
+ /** Immediately stops any currently active smooth scroll animation and clears pending corrections. */
1625
+ stopProgrammaticScroll: () => void;
1626
+ /** Detects the current direction (LTR/RTL) of the scroll container. */
1627
+ updateDirection: () => void;
1628
+ /** Whether the scroll container is in Right-to-Left (RTL) mode. */
1629
+ isRtl: boolean;
1630
+ /** Whether the component has finished its first client - side mount and hydration. */
1631
+ isHydrated: boolean;
1632
+ /** Coordinate scaling factor for X axis. */
1633
+ scaleX: number;
1634
+ /** Coordinate scaling factor for Y axis. */
1635
+ scaleY: number;
1636
+ /** Physical width of the content in the DOM (clamped to browser limits). */
1637
+ renderedWidth: number;
1638
+ /** Physical height of the content in the DOM (clamped to browser limits). */
1639
+ renderedHeight: number;
1640
+ /** Absolute offset of the component within its container. */
1641
+ componentOffset: Point;
1642
+ /** Properties for the vertical scrollbar. */
1643
+ scrollbarPropsVertical: ScrollbarSlotProps | null;
1644
+ /** Properties for the horizontal scrollbar. */
1645
+ scrollbarPropsHorizontal: ScrollbarSlotProps | null;
1646
+ }
1647
+
1648
+ /** Configuration properties for the `useVirtualScroll` composable. */
1649
+ export declare interface VirtualScrollProps<T = unknown> extends VirtualScrollBaseProps<T> {
1650
+ /**
1651
+ * The host element that directly wraps the absolute-positioned items.
1652
+ * Used for calculating relative offsets in display pixels (DU).
1653
+ */
1654
+ hostElement?: HTMLElement | null | undefined;
1655
+ /**
1656
+ * The root element of the VirtualScroll component.
1657
+ * Used for calculating relative offsets in display pixels (DU).
1658
+ */
1659
+ hostRef?: HTMLElement | null | undefined;
1660
+ /**
1661
+ * Size of sticky elements at the start of the viewport (top or left) in DU.
1662
+ * Used to adjust the visible range and item positioning without increasing content size.
1663
+ */
1664
+ stickyStart?: PaddingValue | undefined;
1665
+ /**
1666
+ * Size of sticky elements at the end of the viewport (bottom or right) in DU.
1667
+ * Used to adjust the visible range without increasing content size.
1668
+ */
1669
+ stickyEnd?: PaddingValue | undefined;
1670
+ /**
1671
+ * Extra padding (display pixels - DU) at the start of the flow (e.g. non-sticky header).
1672
+ */
1673
+ flowPaddingStart?: PaddingValue | undefined;
1674
+ /**
1675
+ * Extra padding (DU) at the end of the flow (e.g. non-sticky footer).
1676
+ */
1677
+ flowPaddingEnd?: PaddingValue | undefined;
1678
+ }
1679
+
1836
1680
  /**
1837
1681
  * Maps a virtual content position to a display scroll position.
1838
1682
  *