eru-grid 0.0.2 → 0.0.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
@@ -49,20 +49,21 @@ interface GridFeatures {
49
49
  subtotalPosition?: 'before' | 'after';
50
50
  subtotalLabel?: string;
51
51
  freezeField?: string;
52
- gridLineColor?: string;
53
- gridLineWidth?: number;
52
+ replaceZeroValue?: string;
54
53
  }
55
54
  interface GridStyles {
56
- gridLineColor?: string;
57
- gridLineWidth?: number;
58
55
  subTotalStyle?: 'bold' | 'italic' | 'highlighted';
59
56
  grandTotalStyle?: 'bold' | 'italic' | 'highlighted';
60
57
  }
58
+ interface GridTokens {
59
+ [key: string]: string;
60
+ }
61
61
  interface GridConfiguration {
62
62
  mode: GridMode;
63
63
  config: GridFeatures;
64
64
  fields: Field[];
65
65
  styles?: GridStyles;
66
+ tokens?: GridTokens;
66
67
  pivot?: PivotConfiguration;
67
68
  data?: any[];
68
69
  columnConstraints?: {
@@ -87,6 +88,7 @@ interface Field {
87
88
  rowspan?: number;
88
89
  showSubtotals?: boolean;
89
90
  aggregationFunction?: AggregationFunction;
91
+ enableDrilldown?: boolean;
90
92
  }
91
93
  type DataTypes = 'number' | 'textbox' | 'currency' | 'date' | 'dropdown_single_select' | 'dropdown_multi_select' | 'location' | 'email' | 'people' | 'checkbox' | 'phone' | 'priority' | 'status' | 'progress' | 'attachment' | 'tags';
92
94
  type AggregationFunction = 'sum' | 'count' | 'avg' | 'min' | 'max';
@@ -151,6 +153,12 @@ interface PivotResult {
151
153
  headerStructure?: PivotHeaderStructure;
152
154
  columnGroupState?: PivotColumnGroupState;
153
155
  }
156
+ interface PivotDrilldown {
157
+ columnName: string;
158
+ rowId: string;
159
+ rowData?: any;
160
+ columnValue: any;
161
+ }
154
162
 
155
163
  declare class PivotTransformService {
156
164
  private columnGroupState;
@@ -329,7 +337,7 @@ declare class PivotTransformService {
329
337
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<PivotTransformService>;
330
338
  }
331
339
 
332
- declare class GridStore {
340
+ declare class EruGridStore {
333
341
  private readonly gridConfigService;
334
342
  private readonly pivotTransformService;
335
343
  private readonly _columns;
@@ -342,6 +350,7 @@ declare class GridStore {
342
350
  private readonly _activeCell;
343
351
  private readonly _pivotConfiguration;
344
352
  private readonly _pivotResult;
353
+ private readonly _pivotDrilldown;
345
354
  readonly columns: _angular_core.Signal<Field[]>;
346
355
  readonly groups: _angular_core.Signal<RowGroup[]>;
347
356
  readonly rows: _angular_core.Signal<Row[]>;
@@ -352,6 +361,7 @@ declare class GridStore {
352
361
  readonly activeCell: _angular_core.Signal<any>;
353
362
  readonly pivotConfiguration: _angular_core.Signal<PivotConfiguration | null>;
354
363
  readonly pivotResult: _angular_core.Signal<PivotResult | null>;
364
+ readonly pivotDrilldown: _angular_core.Signal<PivotDrilldown | null>;
355
365
  readonly selectedRows: _angular_core.Signal<Row[]>;
356
366
  readonly totalSelectedCount: _angular_core.Signal<number>;
357
367
  readonly hasSelection: _angular_core.Signal<boolean>;
@@ -366,6 +376,7 @@ declare class GridStore {
366
376
  readonly pivotDisplayData: _angular_core.Signal<eru_grid.PivotRow[]>;
367
377
  readonly tableDisplayData: _angular_core.Signal<Row[]>;
368
378
  setColumns(columns: Field[]): void;
379
+ getConfiguration(): GridConfiguration;
369
380
  reorderColumns(fromIndex: number, toIndex: number): void;
370
381
  updateColumnWidth(columnName: string, field_size: number): void;
371
382
  setGroups(groups: RowGroup[]): void;
@@ -382,6 +393,20 @@ declare class GridStore {
382
393
  deselectAllRowsInGroup(groupId: string): void;
383
394
  clearSelection(): void;
384
395
  setConfiguration(configuration: GridConfiguration): void;
396
+ /**
397
+ * Validates and enforces rules for grid configuration
398
+ */
399
+ validateAndEnforceConfiguration(config: GridConfiguration): GridConfiguration;
400
+ /**
401
+ * Update specific configuration properties
402
+ * This method ensures proper signal updates for nested properties
403
+ */
404
+ updateConfigurationProperties(updates: Partial<GridConfiguration['config']>): void;
405
+ /**
406
+ * Update grid lines configuration
407
+ * This method specifically handles grid lines updates
408
+ */
409
+ updateGridLines(showColumnLines?: boolean, showRowLines?: boolean): void;
385
410
  gridConfiguration(): GridConfiguration;
386
411
  setActiveCell(activeCell: any): void;
387
412
  setLoading(isLoading: boolean): void;
@@ -427,8 +452,10 @@ declare class GridStore {
427
452
  * Get the freeze field name
428
453
  */
429
454
  getFreezeField(): string | null;
430
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<GridStore, never>;
431
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<GridStore>;
455
+ setPivotDrilldown(drilldown: PivotDrilldown, columnValues: string): void;
456
+ clearPivotDrilldown(): void;
457
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<EruGridStore, never>;
458
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<EruGridStore>;
432
459
  }
433
460
 
434
461
  type Theme = 'light' | 'dark' | 'high-contrast' | 'auto';
@@ -478,10 +505,10 @@ declare class ColumnConstraintsService {
478
505
  }
479
506
 
480
507
  declare class EruGridService {
481
- private gridStore;
508
+ private eruGridStore;
482
509
  private themeService;
483
510
  private columnConstraintsService;
484
- constructor(gridStore: GridStore, themeService: ThemeService, columnConstraintsService: ColumnConstraintsService);
511
+ constructor(eruGridStore: EruGridStore, themeService: ThemeService, columnConstraintsService: ColumnConstraintsService);
485
512
  set_table_configuration(data: GridConfiguration): void;
486
513
  set_table_group(data: RowGroup[]): void;
487
514
  get columns(): _angular_core.Signal<Field[]>;
@@ -541,14 +568,14 @@ declare class EruGridService {
541
568
  /**
542
569
  * Get direct access to grid store (for debugging purposes)
543
570
  */
544
- getGridStore(): GridStore;
571
+ getGridStore(): EruGridStore;
545
572
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EruGridService, never>;
546
573
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<EruGridService>;
547
574
  }
548
575
 
549
576
  declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
550
577
  private changeDetectorRef;
551
- gridStore: GridStore;
578
+ gridStore: EruGridStore;
552
579
  private resizeObserver;
553
580
  isColumnReordering: _angular_core.WritableSignal<boolean>;
554
581
  viewport?: CdkVirtualScrollViewport;
@@ -561,10 +588,11 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
561
588
  currentPivotScrollIndex: _angular_core.WritableSignal<number>;
562
589
  firstDataRowIndex: _angular_core.WritableSignal<number>;
563
590
  private _virtualRowspanCache;
591
+ mode: _angular_core.Signal<eru_grid.GridMode>;
592
+ isResizable: _angular_core.Signal<boolean>;
593
+ isEditable: _angular_core.Signal<boolean>;
564
594
  showColumnLines: _angular_core.Signal<boolean>;
565
595
  showRowLines: _angular_core.Signal<boolean>;
566
- gridLineColor: _angular_core.Signal<string>;
567
- gridLineWidth: _angular_core.Signal<number>;
568
596
  maxDepth: _angular_core.Signal<number>;
569
597
  subTotalStyle: _angular_core.Signal<"bold" | "italic" | "highlighted">;
570
598
  grandTotalStyle: _angular_core.Signal<"bold" | "italic" | "highlighted">;
@@ -634,11 +662,11 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
634
662
  dataLength: number;
635
663
  viewportHeight: number;
636
664
  };
637
- private updateGridLineStyles;
638
665
  private readonly ROWS_PER_PAGE;
639
666
  private readonly SCROLL_THRESHOLD;
640
667
  private lastLoadedGroupIds;
641
668
  constructor(changeDetectorRef: ChangeDetectorRef);
669
+ applyTokens(): void;
642
670
  ngOnInit(): void;
643
671
  ngAfterViewInit(): void;
644
672
  ngOnDestroy(): void;
@@ -712,14 +740,6 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
712
740
  * This method ensures proper rowspan continuity when scrolling
713
741
  */
714
742
  getEffectiveRowspan(visibleRowIndex: number, columnName: string): number | null;
715
- /**
716
- * Find virtual parent information for cells that inherit rowspan from a parent row
717
- */
718
- private findVirtualParent;
719
- /**
720
- * Find the first visible row index that should show the value for a given column
721
- */
722
- private findFirstVisibleRowForColumn;
723
743
  /**
724
744
  * Check if a cell should be skipped (hidden due to rowspan) - ENHANCED FOR VIRTUAL SCROLLING
725
745
  */
@@ -761,7 +781,6 @@ declare class EruGridComponent implements OnInit, AfterViewInit, OnDestroy {
761
781
  * Check if a column is a row dimension column
762
782
  */
763
783
  isRowDimensionColumn(columnName: string): boolean;
764
- private setupScrollSync;
765
784
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EruGridComponent, never>;
766
785
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<EruGridComponent, "eru-grid", never, {}, {}, never, never, true, never>;
767
786
  }
@@ -786,5 +805,5 @@ declare class ThemeToggleComponent {
786
805
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThemeToggleComponent, "eru-theme-toggle", never, {}, {}, never, never, true, never>;
787
806
  }
788
807
 
789
- export { ColumnConstraintsService, EruGridComponent, EruGridService, GridStore, ThemeService, ThemeToggleComponent };
790
- export type { AggregationFunction, ColumnWidthConstraints, DataTypes, Field, GridConfiguration, GridFeatures, GridMode, GridStyles, GroupItem$1 as GroupItem, PivotColumnGroupState, PivotColumnHeader, PivotConfiguration, PivotHeaderStructure, PivotMetadata, PivotResult, PivotRow, Row, RowGroup, Theme };
808
+ export { ColumnConstraintsService, EruGridComponent, EruGridService, EruGridStore, ThemeService, ThemeToggleComponent };
809
+ export type { AggregationFunction, ColumnWidthConstraints, DataTypes, Field, GridConfiguration, GridFeatures, GridMode, GridStyles, GridTokens, GroupItem$1 as GroupItem, PivotColumnGroupState, PivotColumnHeader, PivotConfiguration, PivotDrilldown, PivotHeaderStructure, PivotMetadata, PivotResult, PivotRow, Row, RowGroup, Theme };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eru-grid",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.1.3",
6
6
  "@angular/core": "^20.1.3"