@alaarab/ogrid-angular-material 2.4.0 → 2.4.1

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,4 +1,4 @@
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, FormulaRefOverlayComponent, OGridService, OGridLayoutComponent, BaseColumnHeaderFilterComponent, BaseColumnHeaderMenuComponent, BaseInlineCellEditorComponent, BasePopoverCellEditorComponent, BaseDataGridTableComponent, formatCellReference, indexToColumnLetter, 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, DataGridStateService, ColumnReorderService, VirtualScrollService, StatusBarComponent, GridContextMenuComponent, MarchingAntsOverlayComponent, EmptyStateComponent, FormulaRefOverlayComponent, OGridService, OGridLayoutComponent, BaseColumnHeaderFilterComponent, BaseColumnHeaderMenuComponent, BaseInlineCellEditorComponent, BasePopoverCellEditorComponent, BaseDataGridTableComponent, formatCellReference, indexToColumnLetter, ROW_NUMBER_COLUMN_ID, 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
3
  import { ViewChild, Component, ChangeDetectionStrategy, Input, ViewEncapsulation, signal, computed, effect } from '@angular/core';
4
4
  import { MatMenuTrigger, MatMenuModule } from '@angular/material/menu';
@@ -458,6 +458,10 @@ var DataGridTableComponent = class extends BaseDataGridTableComponent {
458
458
  getColumnLetter(colIdx) {
459
459
  return indexToColumnLetter(colIdx);
460
460
  }
461
+ onResizeRowNumber(event) {
462
+ event.stopPropagation();
463
+ this.onResizeStart(event, { columnId: ROW_NUMBER_COLUMN_ID, name: "#" });
464
+ }
461
465
  };
462
466
  __decorateClass([
463
467
  Input({ required: true, alias: "props" })
@@ -536,12 +540,17 @@ DataGridTableComponent = __decorateClass([
536
540
  <th [attr.rowSpan]="headerRows().length - 1" class="ogrid-datagrid-th" style="width: 48px; min-width: 48px; padding: 0;"></th>
537
541
  }
538
542
  @if (rowIdx === headerRows().length - 1 && hasRowNumbersCol()) {
539
- <th class="ogrid-datagrid-th ogrid-row-number-header" [attr.rowSpan]="headerRows().length > 1 ? 1 : null">
543
+ <th class="ogrid-datagrid-th ogrid-row-number-header" [attr.rowSpan]="headerRows().length > 1 ? 1 : null"
544
+ [style.width.px]="getRowNumberWidth()"
545
+ [style.min-width.px]="getRowNumberWidth()"
546
+ [style.max-width.px]="getRowNumberWidth()"
547
+ >
540
548
  <div class="ogrid-row-number-header-content">#</div>
549
+ <div class="ogrid-datagrid-resize-handle" (mousedown)="onResizeRowNumber($event)" (dblclick)="$event.stopPropagation()"></div>
541
550
  </th>
542
551
  }
543
552
  @if (rowIdx === 0 && rowIdx < headerRows().length - 1 && hasRowNumbersCol()) {
544
- <th [attr.rowSpan]="headerRows().length - 1" class="ogrid-datagrid-th" [style.width.px]="50" [style.min-width.px]="50" style="padding: 0;"></th>
553
+ <th [attr.rowSpan]="headerRows().length - 1" class="ogrid-datagrid-th" [style.width.px]="getRowNumberWidth()" [style.min-width.px]="getRowNumberWidth()" style="padding: 0;"></th>
545
554
  }
546
555
  @for (cell of row; track cell.columnDef?.columnId ?? $index; let cellIdx = $index) {
547
556
  @if (cell.isGroup) {
@@ -645,7 +654,11 @@ DataGridTableComponent = __decorateClass([
645
654
  </td>
646
655
  }
647
656
  @if (hasRowNumbersCol()) {
648
- <td class="ogrid-datagrid-td ogrid-row-number-cell">
657
+ <td class="ogrid-datagrid-td ogrid-row-number-cell"
658
+ [style.width.px]="getRowNumberWidth()"
659
+ [style.min-width.px]="getRowNumberWidth()"
660
+ [style.max-width.px]="getRowNumberWidth()"
661
+ >
649
662
  <div class="ogrid-row-number-cell-content">
650
663
  {{ rowNumberOffset() + rowIndex + 1 }}
651
664
  </div>
@@ -713,7 +726,11 @@ DataGridTableComponent = __decorateClass([
713
726
  [attr.role]="descriptor.canEditAny ? 'button' : null"
714
727
  [style]="cellStyle ?? undefined"
715
728
  >
716
- {{ content }}
729
+ @if (colLayout.col.type === 'boolean') {
730
+ <input type="checkbox" [checked]="!!descriptor.displayValue" disabled style="margin:0;pointer-events:none" [attr.aria-label]="descriptor.displayValue ? 'True' : 'False'" />
731
+ } @else {
732
+ {{ content }}
733
+ }
717
734
  @if (descriptor.canEditAny && descriptor.isSelectionEndCell) {
718
735
  <div
719
736
  class="ogrid-datagrid-fill-handle"
@@ -877,8 +894,7 @@ DataGridTableComponent = __decorateClass([
877
894
  }
878
895
  .ogrid-datagrid-checkbox-wrapper { display: flex; align-items: center; justify-content: center; }
879
896
  .ogrid-row-number-header, .ogrid-row-number-cell {
880
- width: ${ROW_NUMBER_COLUMN_WIDTH}px; min-width: ${ROW_NUMBER_COLUMN_WIDTH}px;
881
- max-width: ${ROW_NUMBER_COLUMN_WIDTH}px; text-align: center;
897
+ text-align: center;
882
898
  background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04)); font-weight: 600;
883
899
  font-variant-numeric: tabular-nums; color: var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.6));
884
900
  position: sticky; left: 0; z-index: 3;
@@ -17,4 +17,5 @@ export declare class DataGridTableComponent<T> extends BaseDataGridTableComponen
17
17
  protected getWrapperRef(): ElementRef<HTMLElement> | undefined;
18
18
  protected getTableContainerRef(): ElementRef<HTMLElement> | undefined;
19
19
  getColumnLetter(colIdx: number): string;
20
+ onResizeRowNumber(event: MouseEvent): void;
20
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alaarab/ogrid-angular-material",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
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.4.0"
40
+ "@alaarab/ogrid-angular": "2.4.1"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@angular/cdk": "^21.0.0",