@alaarab/ogrid-angular-primeng 2.4.0 → 2.4.2

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, DataGridStateService, ColumnReorderService, VirtualScrollService, StatusBarComponent, GridContextMenuComponent, MarchingAntsOverlayComponent, EmptyStateComponent, FormulaRefOverlayComponent, OGridService, OGridLayoutComponent, BaseColumnHeaderFilterComponent, BaseColumnHeaderMenuComponent, BaseInlineCellEditorComponent, BasePopoverCellEditorComponent, BaseDataGridTableComponent, DEFAULT_MIN_COLUMN_WIDTH, formatCellReference, indexToColumnLetter, BaseColumnChooserComponent, BasePaginationControlsComponent } 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, DataGridStateService, ColumnReorderService, VirtualScrollService, StatusBarComponent, GridContextMenuComponent, MarchingAntsOverlayComponent, EmptyStateComponent, FormulaRefOverlayComponent, OGridService, OGridLayoutComponent, BaseColumnHeaderFilterComponent, BaseColumnHeaderMenuComponent, BaseInlineCellEditorComponent, BasePopoverCellEditorComponent, BaseDataGridTableComponent, DEFAULT_MIN_COLUMN_WIDTH, formatCellReference, ROW_NUMBER_COLUMN_ID, indexToColumnLetter, BaseColumnChooserComponent, BasePaginationControlsComponent, ROW_NUMBER_COLUMN_MIN_WIDTH } 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, inject, DestroyRef, effect, computed, signal } from '@angular/core';
4
4
  import { ButtonModule } from 'primeng/button';
@@ -515,10 +515,10 @@ var DataGridTableComponent = class extends BaseDataGridTableComponent {
515
515
  this.getWrapperRef()?.nativeElement.focus({ preventScroll: true });
516
516
  this.resizeStartX = e.clientX;
517
517
  this.resizeColumnId = col.columnId;
518
- this.resizeStartWidth = this.getColumnWidth(col);
518
+ this.resizeStartWidth = col.columnId === ROW_NUMBER_COLUMN_ID ? this.getRowNumberWidth() : this.getColumnWidth(col);
519
519
  const onMove = (me) => {
520
520
  const delta = me.clientX - this.resizeStartX;
521
- const minW = col.minWidth ?? DEFAULT_MIN_COLUMN_WIDTH;
521
+ const minW = col.columnId === ROW_NUMBER_COLUMN_ID ? ROW_NUMBER_COLUMN_MIN_WIDTH : col.minWidth ?? DEFAULT_MIN_COLUMN_WIDTH;
522
522
  const newWidth = Math.max(minW, this.resizeStartWidth + delta);
523
523
  this.primengColumnSizingOverrides.update((prev) => ({ ...prev, [this.resizeColumnId]: newWidth }));
524
524
  this.columnSizingVersion.update((v) => v + 1);
@@ -539,6 +539,15 @@ var DataGridTableComponent = class extends BaseDataGridTableComponent {
539
539
  window.addEventListener("mousemove", onMove, true);
540
540
  window.addEventListener("mouseup", onUp, true);
541
541
  }
542
+ onResizeRowNumber(event) {
543
+ event.stopPropagation();
544
+ this.onResizeStartPrimeng(event, { columnId: ROW_NUMBER_COLUMN_ID, name: "#" });
545
+ }
546
+ getRowNumberWidth() {
547
+ const override = this.primengColumnSizingOverrides()[ROW_NUMBER_COLUMN_ID];
548
+ if (override) return override;
549
+ return super.getRowNumberWidth();
550
+ }
542
551
  // --- Build props ---
543
552
  buildProps() {
544
553
  return {
@@ -818,8 +827,17 @@ DataGridTableComponent = __decorateClass([
818
827
  <th [attr.rowSpan]="headerRows().length - 1"></th>
819
828
  }
820
829
  @if (rowIdx === headerRows().length - 1 && hasRowNumbersCol()) {
821
- <th scope="col" rowSpan="1" class="ogrid-row-number-header">
830
+ <th scope="col" rowSpan="1" class="ogrid-row-number-header"
831
+ [style.width.px]="getRowNumberWidth()"
832
+ [style.min-width.px]="getRowNumberWidth()"
833
+ [style.max-width.px]="getRowNumberWidth()"
834
+ >
822
835
  #
836
+ <div
837
+ class="ogrid-resize-handle"
838
+ (mousedown)="onResizeRowNumber($event)"
839
+ (dblclick)="$event.stopPropagation()"
840
+ ></div>
823
841
  </th>
824
842
  }
825
843
  @if (rowIdx === 0 && rowIdx < headerRows().length - 1 && hasRowNumbersCol()) {
@@ -932,8 +950,11 @@ DataGridTableComponent = __decorateClass([
932
950
  </td>
933
951
  }
934
952
  @if (hasRowNumbersCol()) {
935
- <td class="ogrid-row-number-cell">
936
-
953
+ <td class="ogrid-row-number-cell"
954
+ [style.width.px]="getRowNumberWidth()"
955
+ [style.min-width.px]="getRowNumberWidth()"
956
+ [style.max-width.px]="getRowNumberWidth()"
957
+ >
937
958
  {{ rowNumberOffset() + rowIndex + 1 }}
938
959
  </td>
939
960
  }
@@ -995,7 +1016,11 @@ DataGridTableComponent = __decorateClass([
995
1016
  [style.outline]="descriptor.isActive && !descriptor.isInRange ? '2px solid var(--ogrid-selection, #217346)' : null"
996
1017
  [style.outline-offset]="descriptor.isActive && !descriptor.isInRange ? '-2px' : null"
997
1018
  >
998
- <span [style]="resolveCellStyleFn(col, item, descriptor.displayValue)">{{ resolveCellContent(col, item, descriptor.displayValue) }}</span>
1019
+ @if (col.type === 'boolean') {
1020
+ <input type="checkbox" [checked]="!!descriptor.displayValue" disabled style="margin:0;pointer-events:none" [attr.aria-label]="descriptor.displayValue ? 'True' : 'False'" />
1021
+ } @else {
1022
+ <span [style]="resolveCellStyleFn(col, item, descriptor.displayValue)">{{ resolveCellContent(col, item, descriptor.displayValue) }}</span>
1023
+ }
999
1024
  @if (descriptor.canEditAny && descriptor.isSelectionEndCell) {
1000
1025
  <div
1001
1026
  (mousedown)="onFillHandleMouseDown($event)"
@@ -1148,19 +1173,14 @@ DataGridTableComponent = __decorateClass([
1148
1173
  z-index: 3;
1149
1174
  }
1150
1175
  .ogrid-row-number-header {
1151
- width: 50px;
1152
- min-width: 50px;
1153
- max-width: 50px;
1154
1176
  text-align: center;
1155
1177
  font-weight: 600;
1156
1178
  background: var(--ogrid-header-bg, #f5f5f5);
1157
1179
  border-bottom: 2px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
1158
1180
  z-index: 3;
1181
+ position: relative;
1159
1182
  }
1160
1183
  .ogrid-row-number-spacer {
1161
- width: 50px;
1162
- min-width: 50px;
1163
- max-width: 50px;
1164
1184
  background: var(--ogrid-header-bg, #f5f5f5);
1165
1185
  }
1166
1186
  .ogrid-column-group-header {
@@ -1200,9 +1220,6 @@ DataGridTableComponent = __decorateClass([
1200
1220
  border-bottom: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
1201
1221
  }
1202
1222
  .ogrid-row-number-cell {
1203
- width: 50px;
1204
- min-width: 50px;
1205
- max-width: 50px;
1206
1223
  padding: 6px;
1207
1224
  text-align: center;
1208
1225
  font-weight: 600;
@@ -103,6 +103,8 @@ export declare class DataGridTableComponent<T = unknown> extends BaseDataGridTab
103
103
  onRowClickPrimeng(e: MouseEvent, item: T): void;
104
104
  onRowCheckboxChangePrimeng(item: T, checked: boolean, rowIndex: number, _e: Event): void;
105
105
  onResizeStartPrimeng(e: MouseEvent, col: IColumnDef<T>): void;
106
+ onResizeRowNumber(event: MouseEvent): void;
107
+ getRowNumberWidth(): number;
106
108
  private buildProps;
107
109
  getColumnLetter(colIdx: number): string;
108
110
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alaarab/ogrid-angular-primeng",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "description": "OGrid PrimeNG – PrimeNG Table-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.2"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@angular/core": "^21.0.0",