eru-grid 0.0.6 → 0.0.7

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
@@ -47,8 +47,11 @@ interface GridFeatures {
47
47
  enableColumnSubtotals?: boolean;
48
48
  enableGrandTotal?: boolean;
49
49
  subtotalPosition?: 'before' | 'after';
50
+ grandTotalPosition?: 'before' | 'after';
50
51
  subtotalLabel?: string;
51
52
  freezeField?: string;
53
+ freezeHeader?: boolean;
54
+ freezeGrandTotal?: boolean;
52
55
  replaceZeroValue?: string;
53
56
  }
54
57
  interface GridStyles {
@@ -372,8 +375,9 @@ declare class EruGridStore {
372
375
  readonly isPivotMode: _angular_core.Signal<boolean>;
373
376
  readonly isEditingEnabled: _angular_core.Signal<boolean>;
374
377
  readonly displayColumns: _angular_core.Signal<Field[]>;
375
- readonly displayData: _angular_core.Signal<Row[] | eru_grid.PivotRow[]>;
376
- readonly pivotDisplayData: _angular_core.Signal<eru_grid.PivotRow[]>;
378
+ readonly displayData: _angular_core.Signal<Row[] | PivotRow[]>;
379
+ readonly pivotGrandTotalData: _angular_core.Signal<PivotRow[]>;
380
+ readonly pivotDisplayData: _angular_core.Signal<PivotRow[]>;
377
381
  readonly tableDisplayData: _angular_core.Signal<Row[]>;
378
382
  setColumns(columns: Field[]): void;
379
383
  getConfiguration(): GridConfiguration;
@@ -452,6 +456,14 @@ declare class EruGridStore {
452
456
  * Get the freeze field name
453
457
  */
454
458
  getFreezeField(): string | null;
459
+ /**
460
+ * Check if freeze header is enabled
461
+ */
462
+ isFreezeHeaderEnabled(): boolean;
463
+ /**
464
+ * Check if freeze grand total is enabled
465
+ */
466
+ isFreezeGrandTotalEnabled(): boolean;
455
467
  setPivotDrilldown(drilldown: PivotDrilldown, columnValues: string): void;
456
468
  clearPivotDrilldown(): void;
457
469
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EruGridStore, never>;
@@ -578,8 +590,12 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
578
590
  gridStore: EruGridStore;
579
591
  private resizeObserver;
580
592
  isColumnReordering: _angular_core.WritableSignal<boolean>;
593
+ firstTr: number | null;
581
594
  viewport?: CdkVirtualScrollViewport;
582
595
  rowContainer?: ElementRef;
596
+ headerScroller: ElementRef<HTMLDivElement>;
597
+ gtScroller: ElementRef<HTMLDivElement>;
598
+ vp: CdkVirtualScrollViewport;
583
599
  private rowLoadQueue;
584
600
  private isProcessingQueue;
585
601
  groupedRows: _angular_core.Signal<GroupItem[]>;
@@ -596,42 +612,21 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
596
612
  maxDepth: _angular_core.Signal<number>;
597
613
  subTotalStyle: _angular_core.Signal<"bold" | "italic" | "highlighted">;
598
614
  grandTotalStyle: _angular_core.Signal<"bold" | "italic" | "highlighted">;
615
+ freezeHeader: _angular_core.Signal<boolean>;
616
+ freezeGrandTotal: _angular_core.Signal<boolean>;
617
+ grandTotalPosition: _angular_core.Signal<"before" | "after">;
599
618
  /**
600
619
  * Check if a row is the first visible row in the pivot viewport
601
620
  * @param rowIndex The index of the row in the virtual scroll
602
621
  * @returns true if this is the first visible row
603
622
  */
604
623
  isFirstVisiblePivotRow(rowIndex: number): boolean;
605
- /**
606
- * Check if a specific row is the first visible row by comparing with scroll index
607
- * @param rowIndex The index of the row to check
608
- * @returns true if this row is the first visible row
609
- */
610
- isRowFirstVisible(rowIndex: number): boolean;
611
624
  /**
612
625
  * Handle scroll events for pivot mode
613
626
  * @param scrollIndex The current scroll index
614
627
  */
615
628
  onPivotScroll(scrollIndex: number): void;
616
- /**
617
- * Get the actual data index of the first visible row in the pivot data array
618
- * @returns The actual index in the pivot data array, or -1 if not available
619
- */
620
- getFirstVisiblePivotDataIndex(): number;
621
- /**
622
- * Get the truly visible range (what's actually visible on screen)
623
- * @returns Object with start, end, and count of visible items
624
- */
625
- getVisibleRange(): {
626
- start: number;
627
- end: number;
628
- count: number;
629
- };
630
- /**
631
- * Calculate the actual number of items visible in the viewport
632
- * This accounts for headers, padding, and actual viewport dimensions
633
- */
634
- private getActualVisibleItemCount;
629
+ getTotalTableWidth(): number;
635
630
  /**
636
631
  * Get the rendered range (what's in the DOM including buffer)
637
632
  * @returns Object with start, end, and count of rendered items
@@ -641,27 +636,6 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
641
636
  end: number;
642
637
  count: number;
643
638
  };
644
- /**
645
- * Get current scroll and visibility information for debugging
646
- * @returns Object with current scroll state and ranges
647
- */
648
- getCurrentScrollInfo(): {
649
- scrollIndex: number;
650
- visibleRange: {
651
- start: number;
652
- end: number;
653
- count: number;
654
- };
655
- renderedRange: {
656
- start: number;
657
- end: number;
658
- count: number;
659
- };
660
- cdkViewportSize: number;
661
- actualVisibleCount: number;
662
- dataLength: number;
663
- viewportHeight: number;
664
- };
665
639
  private readonly ROWS_PER_PAGE;
666
640
  private readonly SCROLL_THRESHOLD;
667
641
  private lastLoadedGroupIds;
@@ -671,12 +645,9 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
671
645
  ngAfterViewInit(): void;
672
646
  ngOnDestroy(): void;
673
647
  private createGroupedRows;
674
- private recalculateViewport;
675
648
  initializeGroups(): void;
676
649
  private fetchInitialRows;
677
650
  fetchRowsForGroup(groupId: string, page: number, pageSize?: number): Promise<void>;
678
- private updateGroupLoadingState;
679
- private updateGroupAfterLoading;
680
651
  onScroll(scrollIndex: number): void;
681
652
  private getVisibleGroups;
682
653
  private getGroupItemAtIndex;
@@ -684,8 +655,6 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
684
655
  private intelligentRowLoading;
685
656
  private checkGroupRowLoading;
686
657
  private queueRowLoading;
687
- private adjustColumnWidths;
688
- private ensureHorizontalScroll;
689
658
  trackByColumnFn(index: number, column: Field): string;
690
659
  trackByGroupItemFn(index: number, groupItem: GroupItem): string;
691
660
  trackByPivotRowFn(index: number, pivotRow: PivotRow): string;
@@ -696,7 +665,6 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
696
665
  isRowDimensionHeader(header: any): boolean;
697
666
  getPivotGridColumns(): string;
698
667
  private initializeColumnWidths;
699
- private measureAndSetContainerDimensions;
700
668
  private normalizeRowData;
701
669
  private getDisplayValue;
702
670
  private getGenericRowDisplay;
@@ -731,10 +699,6 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
731
699
  skip: boolean;
732
700
  parentSpan: number;
733
701
  }>;
734
- /**
735
- * Clear rowspan cache when pivot data changes
736
- */
737
- clearRowspanCache(): void;
738
702
  /**
739
703
  * Get the effective rowspan for a cell in virtual scrolling context
740
704
  * This method ensures proper rowspan continuity when scrolling
@@ -781,6 +745,23 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
781
745
  * Check if a column is a row dimension column
782
746
  */
783
747
  isRowDimensionColumn(columnName: string): boolean;
748
+ /**
749
+ * Handle body scroll to synchronize header and grand total horizontal scroll
750
+ */
751
+ onBodyScroll(event: Event): void;
752
+ /**
753
+ * Handle header scroll to synchronize body horizontal scroll
754
+ */
755
+ onHeaderScroll(event: Event): void;
756
+ /**
757
+ * Manually trigger scrollbar compensation recalculation (for testing)
758
+ */
759
+ recalculateScrollbarCompensation(): void;
760
+ /**
761
+ * Adjust header padding to compensate for body table scrollbar width
762
+ * This ensures perfect column alignment between header and body tables
763
+ */
764
+ private adjustHeaderScrollbarCompensation;
784
765
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EruGridComponent, never>;
785
766
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<EruGridComponent, "eru-grid", never, {}, {}, never, never, true, never>;
786
767
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eru-grid",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.1.3",
6
6
  "@angular/core": "^20.1.3"