@alaarab/ogrid-angular-material 2.1.15 → 2.3.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/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { INLINE_CELL_EDITOR_STYLES, INLINE_CELL_EDITOR_TEMPLATE, POPOVER_CELL_EDITOR_OVERLAY_STYLES, POPOVER_CELL_EDITOR_TEMPLATE, OGRID_THEME_VARS_CSS, CHECKBOX_COLUMN_WIDTH, ROW_NUMBER_COLUMN_WIDTH, DataGridStateService, ColumnReorderService, VirtualScrollService, StatusBarComponent, GridContextMenuComponent, MarchingAntsOverlayComponent, EmptyStateComponent, OGridService, OGridLayoutComponent, BaseColumnHeaderFilterComponent, getColumnHeaderMenuItems, BaseInlineCellEditorComponent, BasePopoverCellEditorComponent, BaseDataGridTableComponent, BaseColumnChooserComponent, BasePaginationControlsComponent, BaseOGridComponent } from '@alaarab/ogrid-angular';
1
+ import { INLINE_CELL_EDITOR_STYLES, INLINE_CELL_EDITOR_TEMPLATE, POPOVER_CELL_EDITOR_OVERLAY_STYLES, POPOVER_CELL_EDITOR_TEMPLATE, OGRID_THEME_VARS_CSS, CHECKBOX_COLUMN_WIDTH, ROW_NUMBER_COLUMN_WIDTH, DataGridStateService, ColumnReorderService, VirtualScrollService, StatusBarComponent, GridContextMenuComponent, MarchingAntsOverlayComponent, EmptyStateComponent, OGridService, OGridLayoutComponent, BaseColumnHeaderFilterComponent, getColumnHeaderMenuItems, BaseInlineCellEditorComponent, BasePopoverCellEditorComponent, BaseDataGridTableComponent, formatCellReference, indexToColumnLetter, BaseColumnChooserComponent, BasePaginationControlsComponent, BaseOGridComponent } from '@alaarab/ogrid-angular';
2
2
  export { AUTOSIZE_EXTRA_PX, AUTOSIZE_MAX_PX, BaseColumnChooserComponent, BaseColumnHeaderFilterComponent, BaseDataGridTableComponent, BaseInlineCellEditorComponent, BaseOGridComponent, BasePaginationControlsComponent, BasePopoverCellEditorComponent, CELL_PADDING, CHECKBOX_COLUMN_WIDTH, COLUMN_HEADER_MENU_ITEMS, ColumnReorderService, DEFAULT_DEBOUNCE_MS, DEFAULT_MIN_COLUMN_WIDTH, DataGridEditingHelper, DataGridInteractionHelper, DataGridLayoutHelper, DataGridStateService, EmptyStateComponent, GRID_BORDER_RADIUS, GRID_CONTEXT_MENU_ITEMS, GridContextMenuComponent, INLINE_CELL_EDITOR_STYLES, INLINE_CELL_EDITOR_TEMPLATE, MAX_PAGE_BUTTONS, MarchingAntsOverlayComponent, OGRID_THEME_VARS_CSS, OGridLayoutComponent, OGridService, PAGE_SIZE_OPTIONS, PEOPLE_SEARCH_DEBOUNCE_MS, POPOVER_CELL_EDITOR_OVERLAY_STYLES, POPOVER_CELL_EDITOR_TEMPLATE, ROW_NUMBER_COLUMN_WIDTH, SIDEBAR_TRANSITION_MS, SideBarComponent, StatusBarComponent, UndoRedoStack, VirtualScrollService, Z_INDEX, applyCellDeletion, applyCutClear, applyFillValues, applyPastedValues, applyRangeRowSelection, areGridRowPropsEqual, booleanParser, buildCsvHeader, buildCsvRows, buildHeaderRows, buildInlineEditorProps, buildPopoverEditorProps, calculateDropTarget, clampSelectionToBounds, computeAggregations, computeArrowNavigation, computeAutoScrollSpeed, computeNextSortState, computeRowSelectionState, computeTabNavigation, computeTotalHeight, computeVisibleRange, createDebouncedCallback, createDebouncedSignal, createLatestCallback, currencyParser, dateParser, debounce, deriveFilterOptionsFromData, emailParser, escapeCsvValue, exportToCsv, findCtrlArrowTarget, flattenColumns, formatCellValueForTsv, formatSelectionAsTsv, formatShortcut, getCellRenderDescriptor, getCellValue, getColumnHeaderMenuItems, getContextMenuHandlers, getDataGridStatusBarConfig, getFilterField, getHeaderFilterConfig, getMultiSelectFilterFields, getPaginationViewModel, getPinStateForColumn, getScrollTopForRow, getStatusBarParts, injectGlobalStyles, isFilterConfig, isInSelectionRange, isRowInRange, measureColumnContentWidth, measureRange, mergeFilter, normalizeSelectionRange, numberParser, parseTsvClipboard, parseValue, processClientSideData, rangesEqual, reorderColumnArray, resolveCellDisplayContent, resolveCellStyle, toUserLike, triggerCsvDownload, validateColumns, validateRowIds } from '@alaarab/ogrid-angular';
3
- import { ViewChild, Component, ChangeDetectionStrategy, Input, ViewEncapsulation, signal, computed } from '@angular/core';
3
+ import { ViewChild, Component, ChangeDetectionStrategy, Input, ViewEncapsulation, signal, computed, effect } from '@angular/core';
4
4
  import { MatMenuTrigger, MatMenuModule } from '@angular/material/menu';
5
5
  import { MatDividerModule } from '@angular/material/divider';
6
6
 
@@ -506,7 +506,21 @@ var DataGridTableComponent = class extends BaseDataGridTableComponent {
506
506
  constructor() {
507
507
  super();
508
508
  this.propsSignal = signal(void 0);
509
+ this.showColumnLetters = computed(() => !!this.getProps()?.showColumnLetters);
509
510
  this.initBase();
511
+ effect(() => {
512
+ const props = this.getProps();
513
+ const onActiveCellChange = props?.onActiveCellChange;
514
+ if (!onActiveCellChange) return;
515
+ const ac = this.activeCell();
516
+ if (ac) {
517
+ const colIndex = ac.columnIndex - this.colOffset();
518
+ const rowNumber = ac.rowIndex + 1;
519
+ onActiveCellChange(formatCellReference(colIndex, rowNumber));
520
+ } else {
521
+ onActiveCellChange(null);
522
+ }
523
+ });
510
524
  }
511
525
  set propsInput(value) {
512
526
  this.propsSignal.set(value);
@@ -520,6 +534,9 @@ var DataGridTableComponent = class extends BaseDataGridTableComponent {
520
534
  getTableContainerRef() {
521
535
  return this.tableContainerRef;
522
536
  }
537
+ getColumnLetter(colIdx) {
538
+ return indexToColumnLetter(colIdx);
539
+ }
523
540
  };
524
541
  __decorateClass([
525
542
  Input({ required: true, alias: "props" })
@@ -561,8 +578,24 @@ DataGridTableComponent = __decorateClass([
561
578
  <div [style.minWidth.px]="allowOverflowX() ? minTableWidth() : undefined" style="overflow-x: clip">
562
579
  <div [class.ogrid-datagrid-table-wrapper--loading]="isLoading() && items().length > 0" #tableContainerElRef>
563
580
  <table class="ogrid-datagrid-table" role="grid" [style.minWidth.px]="minTableWidth()"
581
+ [attr.data-virtual-scroll]="vsEnabled() ? '' : null"
564
582
  >
565
583
  <thead [class]="stickyHeader() ? 'ogrid-datagrid-thead ogrid-sticky-header' : 'ogrid-datagrid-thead'">
584
+ @if (showColumnLetters()) {
585
+ <tr class="ogrid-column-letter-row">
586
+ @if (hasCheckboxCol()) {
587
+ <th class="ogrid-column-letter-cell"></th>
588
+ }
589
+ @if (hasRowNumbersCol()) {
590
+ <th class="ogrid-column-letter-cell"></th>
591
+ }
592
+ @for (col of visibleCols(); track col.columnId; let colIdx = $index) {
593
+ <th class="ogrid-column-letter-cell">
594
+ {{ getColumnLetter(colIdx) }}
595
+ </th>
596
+ }
597
+ </tr>
598
+ }
566
599
  @for (row of headerRows(); track $index; let rowIdx = $index) {
567
600
  <tr class="ogrid-datagrid-header-row">
568
601
  @if (rowIdx === headerRows().length - 1 && hasCheckboxCol()) {
@@ -697,7 +730,10 @@ DataGridTableComponent = __decorateClass([
697
730
  </div>
698
731
  </td>
699
732
  }
700
- @for (colLayout of columnLayouts(); track colLayout.col.columnId; let colIdx = $index) {
733
+ @if (vsColumnsEnabled() && vsLeftSpacerWidth() > 0) {
734
+ <td [style.width.px]="vsLeftSpacerWidth()" [style.minWidth.px]="vsLeftSpacerWidth()" [style.maxWidth.px]="vsLeftSpacerWidth()" [style.padding]="'0'"></td>
735
+ }
736
+ @for (colLayout of vsColumnLayouts(); track colLayout.col.columnId) {
701
737
  <td
702
738
  class="ogrid-datagrid-td"
703
739
  [attr.data-column-id]="colLayout.col.columnId"
@@ -709,7 +745,7 @@ DataGridTableComponent = __decorateClass([
709
745
  [style.left.px]="colLayout.pinnedLeft ? getPinnedLeftOffset(colLayout.col.columnId) : null"
710
746
  [style.right.px]="colLayout.pinnedRight ? getPinnedRightOffset(colLayout.col.columnId) : null"
711
747
  >
712
- @let descriptor = getCellDescriptor(item, colLayout.col, rowIndex, colIdx);
748
+ @let descriptor = getCellDescriptor(item, colLayout.col, rowIndex, getGlobalColIndex(colLayout.col));
713
749
  @if (descriptor.mode === 'editing-inline') {
714
750
  <div class="ogrid-editing-cell">
715
751
  <ogrid-mat-inline-cell-editor
@@ -735,10 +771,11 @@ DataGridTableComponent = __decorateClass([
735
771
  ></ogrid-mat-popover-cell-editor>
736
772
  } @else {
737
773
  @let content = resolveCellContent(colLayout.col, item, descriptor.displayValue);
738
- @let cellStyle = resolveCellStyleFn(colLayout.col, item);
774
+ @let cellStyle = resolveCellStyleFn(colLayout.col, item, descriptor.displayValue);
739
775
  <div
740
776
  class="ogrid-datagrid-cell"
741
777
  [class.ogrid-datagrid-cell--active]="descriptor.isActive"
778
+ [class.ogrid-datagrid-cell--active-in-range]="descriptor.isActive && descriptor.isInRange"
742
779
  [class.ogrid-datagrid-cell--in-range]="descriptor.isInRange && !descriptor.isActive"
743
780
  [class.ogrid-datagrid-cell--in-cut-range]="descriptor.isInCutRange"
744
781
  [class.ogrid-datagrid-cell--editable]="descriptor.canEditAny"
@@ -767,6 +804,9 @@ DataGridTableComponent = __decorateClass([
767
804
  }
768
805
  </td>
769
806
  }
807
+ @if (vsColumnsEnabled() && vsRightSpacerWidth() > 0) {
808
+ <td [style.width.px]="vsRightSpacerWidth()" [style.minWidth.px]="vsRightSpacerWidth()" [style.maxWidth.px]="vsRightSpacerWidth()" [style.padding]="'0'"></td>
809
+ }
770
810
  </tr>
771
811
  }
772
812
  @if (vsEnabled() && vsBottomSpacerHeight() > 0) {
@@ -948,6 +988,7 @@ DataGridTableComponent = __decorateClass([
948
988
  outline: 2px solid var(--ogrid-selection-color, #217346); outline-offset: -1px;
949
989
  z-index: 2; position: relative; overflow: visible;
950
990
  }
991
+ .ogrid-datagrid-cell--active-in-range { outline: none; background: var(--ogrid-bg, #fff); }
951
992
  .ogrid-datagrid-cell--in-range { background: var(--ogrid-range-bg, rgba(33, 115, 70, 0.12)); }
952
993
  .ogrid-datagrid-cell--in-cut-range { background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04)); opacity: 0.7; }
953
994
  .ogrid-datagrid-cell--editing { padding: 0; }
@@ -1019,6 +1060,17 @@ DataGridTableComponent = __decorateClass([
1019
1060
  .ogrid-datagrid-context-menu-overlay {
1020
1061
  position: fixed; inset: 0; z-index: 1000;
1021
1062
  }
1063
+ .ogrid-column-letter-cell {
1064
+ text-align: center;
1065
+ font-size: 11px;
1066
+ font-weight: 500;
1067
+ color: var(--ogrid-fg-muted, rgba(0, 0, 0, 0.4));
1068
+ padding: 2px 4px;
1069
+ background: var(--ogrid-column-letter-bg, var(--ogrid-header-bg, rgba(0, 0, 0, 0.04)));
1070
+ border-bottom: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
1071
+ user-select: none;
1072
+ font-variant-numeric: tabular-nums;
1073
+ }
1022
1074
 
1023
1075
  /* Angular Material Menu popup dark mode overrides.
1024
1076
  Double-class selector (0,2,0) beats MUI's single-class (0,1,0) defaults. */
@@ -1285,6 +1337,8 @@ OGridComponent = __decorateClass([
1285
1337
  [hasToolbarBelow]="false"
1286
1338
  [hasPagination]="true"
1287
1339
  [fullScreen]="ogridService.fullScreen()"
1340
+ [showNameBox]="!!ogridService.cellReferences()"
1341
+ [activeCellRef]="ogridService.activeCellRef()"
1288
1342
  >
1289
1343
  <ng-container toolbarEnd>
1290
1344
  @if (ogridService.columnChooserPlacement() === 'toolbar') {
@@ -10,8 +10,10 @@ export declare class DataGridTableComponent<T> extends BaseDataGridTableComponen
10
10
  set propsInput(value: IOGridDataGridProps<T>);
11
11
  private wrapperRef?;
12
12
  private tableContainerRef?;
13
+ readonly showColumnLetters: import("@angular/core").Signal<boolean>;
13
14
  constructor();
14
15
  protected getProps(): IOGridDataGridProps<T> | undefined;
15
16
  protected getWrapperRef(): ElementRef<HTMLElement> | undefined;
16
17
  protected getTableContainerRef(): ElementRef<HTMLElement> | undefined;
18
+ getColumnLetter(colIdx: number): string;
17
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alaarab/ogrid-angular-material",
3
- "version": "2.1.15",
3
+ "version": "2.3.0",
4
4
  "description": "OGrid Angular Material – MatTable-based data grid with sorting, filtering, pagination, column chooser, and CSV export.",
5
5
  "main": "dist/esm/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -37,7 +37,7 @@
37
37
  "node": ">=18"
38
38
  },
39
39
  "dependencies": {
40
- "@alaarab/ogrid-angular": "2.1.15"
40
+ "@alaarab/ogrid-angular": "2.3.0"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@angular/cdk": "^21.0.0",