@alaarab/ogrid-angular-material 2.2.0 → 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" })
@@ -564,6 +581,21 @@ DataGridTableComponent = __decorateClass([
564
581
  [attr.data-virtual-scroll]="vsEnabled() ? '' : null"
565
582
  >
566
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
+ }
567
599
  @for (row of headerRows(); track $index; let rowIdx = $index) {
568
600
  <tr class="ogrid-datagrid-header-row">
569
601
  @if (rowIdx === headerRows().length - 1 && hasCheckboxCol()) {
@@ -739,10 +771,11 @@ DataGridTableComponent = __decorateClass([
739
771
  ></ogrid-mat-popover-cell-editor>
740
772
  } @else {
741
773
  @let content = resolveCellContent(colLayout.col, item, descriptor.displayValue);
742
- @let cellStyle = resolveCellStyleFn(colLayout.col, item);
774
+ @let cellStyle = resolveCellStyleFn(colLayout.col, item, descriptor.displayValue);
743
775
  <div
744
776
  class="ogrid-datagrid-cell"
745
777
  [class.ogrid-datagrid-cell--active]="descriptor.isActive"
778
+ [class.ogrid-datagrid-cell--active-in-range]="descriptor.isActive && descriptor.isInRange"
746
779
  [class.ogrid-datagrid-cell--in-range]="descriptor.isInRange && !descriptor.isActive"
747
780
  [class.ogrid-datagrid-cell--in-cut-range]="descriptor.isInCutRange"
748
781
  [class.ogrid-datagrid-cell--editable]="descriptor.canEditAny"
@@ -955,6 +988,7 @@ DataGridTableComponent = __decorateClass([
955
988
  outline: 2px solid var(--ogrid-selection-color, #217346); outline-offset: -1px;
956
989
  z-index: 2; position: relative; overflow: visible;
957
990
  }
991
+ .ogrid-datagrid-cell--active-in-range { outline: none; background: var(--ogrid-bg, #fff); }
958
992
  .ogrid-datagrid-cell--in-range { background: var(--ogrid-range-bg, rgba(33, 115, 70, 0.12)); }
959
993
  .ogrid-datagrid-cell--in-cut-range { background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04)); opacity: 0.7; }
960
994
  .ogrid-datagrid-cell--editing { padding: 0; }
@@ -1026,6 +1060,17 @@ DataGridTableComponent = __decorateClass([
1026
1060
  .ogrid-datagrid-context-menu-overlay {
1027
1061
  position: fixed; inset: 0; z-index: 1000;
1028
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
+ }
1029
1074
 
1030
1075
  /* Angular Material Menu popup dark mode overrides.
1031
1076
  Double-class selector (0,2,0) beats MUI's single-class (0,1,0) defaults. */
@@ -1292,6 +1337,8 @@ OGridComponent = __decorateClass([
1292
1337
  [hasToolbarBelow]="false"
1293
1338
  [hasPagination]="true"
1294
1339
  [fullScreen]="ogridService.fullScreen()"
1340
+ [showNameBox]="!!ogridService.cellReferences()"
1341
+ [activeCellRef]="ogridService.activeCellRef()"
1295
1342
  >
1296
1343
  <ng-container toolbarEnd>
1297
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.2.0",
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.2.0"
40
+ "@alaarab/ogrid-angular": "2.3.0"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@angular/cdk": "^21.0.0",