@alaarab/ogrid-angular-material 2.0.11 → 2.0.12

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.
@@ -67,20 +67,24 @@ ColumnChooserComponent = __decorate([
67
67
  .ogrid-column-chooser { position: relative; }
68
68
  .ogrid-column-chooser__trigger {
69
69
  display: inline-flex; align-items: center; gap: 6px;
70
- padding: 6px 12px; border: 1px solid rgba(0,0,0,0.23); border-radius: 4px;
70
+ padding: 6px 12px; border: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.23)); border-radius: 4px;
71
71
  background: transparent; cursor: pointer; font-size: 14px; font-weight: 600;
72
72
  text-transform: none; white-space: nowrap;
73
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
73
74
  }
75
+ .ogrid-column-chooser__trigger:hover { background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04)); }
74
76
  .ogrid-column-chooser__caret { font-size: 10px; }
75
77
  .ogrid-column-chooser__dropdown {
76
78
  position: absolute; top: 100%; right: 0; z-index: 10;
77
79
  min-width: 220px; margin-top: 4px;
78
- background: #fff; border: 1px solid rgba(0,0,0,0.12); border-radius: 4px;
79
- box-shadow: 0 2px 8px rgba(0,0,0,0.15);
80
+ background: var(--ogrid-bg, #ffffff); border: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); border-radius: 4px;
81
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
80
82
  }
81
83
  .ogrid-column-chooser__header {
82
84
  padding: 8px 12px; font-size: 14px; font-weight: 600;
83
- border-bottom: 1px solid rgba(0,0,0,0.12); background: #fafafa;
85
+ border-bottom: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
86
+ background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04));
87
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
84
88
  }
85
89
  .ogrid-column-chooser__list {
86
90
  max-height: 320px; overflow-y: auto; padding: 4px 0;
@@ -88,22 +92,25 @@ ColumnChooserComponent = __decorate([
88
92
  .ogrid-column-chooser__item {
89
93
  display: flex; align-items: center; gap: 8px;
90
94
  padding: 4px 12px; min-height: 32px; cursor: pointer; font-size: 14px;
95
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
91
96
  }
92
- .ogrid-column-chooser__item:hover { background: rgba(0,0,0,0.04); }
97
+ .ogrid-column-chooser__item:hover { background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04)); }
93
98
  .ogrid-column-chooser__footer {
94
99
  display: flex; justify-content: flex-end; gap: 8px;
95
- padding: 8px 12px; border-top: 1px solid rgba(0,0,0,0.12); background: #fafafa;
100
+ padding: 8px 12px; border-top: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
101
+ background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04));
96
102
  }
97
103
  .ogrid-column-chooser__btn {
98
104
  padding: 4px 12px; border: none; border-radius: 4px;
99
105
  background: transparent; cursor: pointer; font-size: 13px; text-transform: none;
106
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
100
107
  }
101
- .ogrid-column-chooser__btn:hover { background: rgba(0,0,0,0.04); }
108
+ .ogrid-column-chooser__btn:hover { background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04)); }
102
109
  .ogrid-column-chooser__btn--primary {
103
110
  background: var(--mat-sys-primary, #1976d2); color: #fff;
104
111
  }
105
112
  .ogrid-column-chooser__btn--primary:hover {
106
- background: var(--mat-sys-primary, #1565c0);
113
+ opacity: 0.9;
107
114
  }
108
115
  `],
109
116
  host: {
@@ -232,9 +232,9 @@ ColumnHeaderFilterComponent = __decorate([
232
232
  width: 24px; height: 24px; padding: 2px; border: none; border-radius: 4px;
233
233
  background: transparent; cursor: pointer; font-size: 12px; line-height: 1;
234
234
  display: inline-flex; align-items: center; justify-content: center; position: relative;
235
- color: rgba(0,0,0,0.54);
235
+ color: var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.54));
236
236
  }
237
- .ogrid-header-filter__btn:hover { background: rgba(0,0,0,0.08); }
237
+ .ogrid-header-filter__btn:hover { background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.08)); }
238
238
  .ogrid-header-filter__btn--active { color: var(--mat-sys-primary, #1976d2); }
239
239
  .ogrid-header-filter__filter-btn {
240
240
  width: 24px; height: 24px; padding: 2px; border: none; border-radius: 4px;
@@ -243,17 +243,17 @@ ColumnHeaderFilterComponent = __decorate([
243
243
  opacity: 0.6; transition: opacity 0.15s;
244
244
  }
245
245
  .ogrid-header-filter:hover .ogrid-header-filter__filter-btn { opacity: 0.8; }
246
- .ogrid-header-filter__filter-btn:hover { background: rgba(0,0,0,0.08); opacity: 1 !important; }
246
+ .ogrid-header-filter__filter-btn:hover { background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.08)); opacity: 1 !important; }
247
247
  .ogrid-header-filter__filter-btn--active { opacity: 1 !important; }
248
248
  .ogrid-header-filter__funnel {
249
249
  display: block; width: 0; height: 0;
250
250
  border-left: 5px solid transparent; border-right: 5px solid transparent;
251
- border-top: 6px solid rgba(0,0,0,0.65);
251
+ border-top: 6px solid var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.65));
252
252
  position: relative;
253
253
  }
254
254
  .ogrid-header-filter__funnel::after {
255
255
  content: ''; display: block; width: 2px; height: 4px;
256
- background: rgba(0,0,0,0.65); position: absolute;
256
+ background: var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.65)); position: absolute;
257
257
  top: -1px; left: -1px;
258
258
  }
259
259
  .ogrid-header-filter__filter-btn--active .ogrid-header-filter__funnel {
@@ -269,24 +269,26 @@ ColumnHeaderFilterComponent = __decorate([
269
269
  }
270
270
  .ogrid-header-filter__popover {
271
271
  position: fixed; z-index: 10000;
272
- background: #ffffff; border: 1px solid rgba(0,0,0,0.2);
273
- border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.2), 0 1px 4px rgba(0,0,0,0.1);
274
- margin-top: 4px;
272
+ background: var(--ogrid-bg, #ffffff); border: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.2));
273
+ border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 1px 4px rgba(0, 0, 0, 0.1);
274
+ margin-top: 4px; color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
275
275
  }
276
276
  .ogrid-header-filter__popover-header {
277
277
  padding: 8px 12px; font-size: 14px; font-weight: 600;
278
- border-bottom: 1px solid rgba(0,0,0,0.12);
278
+ border-bottom: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
279
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
279
280
  }
280
281
  .ogrid-header-filter__popover-body { }
281
282
  .ogrid-header-filter__popover-actions {
282
283
  display: flex; justify-content: flex-end; gap: 8px; padding: 8px 12px;
283
284
  }
284
285
  .ogrid-header-filter__input {
285
- width: 100%; padding: 8px 12px; border: 1px solid rgba(0,0,0,0.23);
286
+ width: 100%; padding: 8px 12px; border: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.23));
286
287
  border-radius: 4px; font-size: 14px; box-sizing: border-box;
288
+ background: var(--ogrid-bg, #ffffff); color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
287
289
  }
288
290
  .ogrid-header-filter__input:focus { outline: 2px solid var(--mat-sys-primary, #1976d2); outline-offset: -1px; }
289
- .ogrid-header-filter__options-info { margin-top: 4px; font-size: 12px; color: rgba(0,0,0,0.6); }
291
+ .ogrid-header-filter__options-info { margin-top: 4px; font-size: 12px; color: var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.6)); }
290
292
  .ogrid-header-filter__select-actions {
291
293
  display: flex; justify-content: space-between; padding: 4px 12px;
292
294
  }
@@ -294,40 +296,44 @@ ColumnHeaderFilterComponent = __decorate([
294
296
  .ogrid-header-filter__option {
295
297
  display: flex; align-items: center; gap: 8px;
296
298
  padding: 4px 8px; cursor: pointer; font-size: 14px;
299
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
297
300
  }
298
- .ogrid-header-filter__option:hover { background: rgba(0,0,0,0.04); }
301
+ .ogrid-header-filter__option:hover { background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04)); }
299
302
  .ogrid-header-filter__loading, .ogrid-header-filter__empty {
300
- padding: 16px; text-align: center; font-size: 14px; color: rgba(0,0,0,0.6);
303
+ padding: 16px; text-align: center; font-size: 14px; color: var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.6));
301
304
  }
302
305
  .ogrid-header-filter__action-btn {
303
306
  padding: 4px 12px; border: none; border-radius: 4px;
304
307
  background: transparent; cursor: pointer; font-size: 13px;
308
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
305
309
  }
306
- .ogrid-header-filter__action-btn:hover { background: rgba(0,0,0,0.04); }
310
+ .ogrid-header-filter__action-btn:hover { background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04)); }
307
311
  .ogrid-header-filter__action-btn:disabled { opacity: 0.38; cursor: default; }
308
312
  .ogrid-header-filter__action-btn--primary {
309
313
  background: var(--mat-sys-primary, #1976d2); color: #fff;
310
314
  }
311
- .ogrid-header-filter__action-btn--primary:hover { background: var(--mat-sys-primary, #1565c0); }
315
+ .ogrid-header-filter__action-btn--primary:hover { opacity: 0.9; }
312
316
  .ogrid-header-filter__people-selected {
313
- padding: 12px; border-bottom: 1px solid rgba(0,0,0,0.12);
317
+ padding: 12px; border-bottom: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
314
318
  }
315
- .ogrid-header-filter__people-info-label { font-size: 12px; color: rgba(0,0,0,0.6); }
319
+ .ogrid-header-filter__people-info-label { font-size: 12px; color: var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.6)); }
316
320
  .ogrid-header-filter__people-card {
317
321
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
318
322
  }
319
323
  .ogrid-header-filter__people-avatar {
320
- width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,0.08);
324
+ width: 32px; height: 32px; border-radius: 50%; background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.08));
321
325
  display: flex; align-items: center; justify-content: center;
322
326
  font-size: 14px; font-weight: 600; flex-shrink: 0;
327
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
323
328
  }
324
- .ogrid-header-filter__people-details { flex: 1; min-width: 0; font-size: 14px; }
329
+ .ogrid-header-filter__people-details { flex: 1; min-width: 0; font-size: 14px; color: var(--ogrid-fg, rgba(0, 0, 0, 0.87)); }
325
330
  .ogrid-header-filter__people-details > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
326
- .ogrid-header-filter__people-email { font-size: 12px; color: rgba(0,0,0,0.6); }
331
+ .ogrid-header-filter__people-email { font-size: 12px; color: var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.6)); }
327
332
  .ogrid-header-filter__people-option {
328
333
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer;
334
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
329
335
  }
330
- .ogrid-header-filter__people-option:hover { background: rgba(0,0,0,0.04); }
336
+ .ogrid-header-filter__people-option:hover { background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04)); }
331
337
  `],
332
338
  host: {
333
339
  '(document:click)': 'onDocumentClickWrapper($event)',
@@ -121,12 +121,12 @@ ColumnHeaderMenuComponent = __decorate([
121
121
  display: inline-flex;
122
122
  align-items: center;
123
123
  justify-content: center;
124
- color: rgba(0,0,0,0.54);
124
+ color: var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.54));
125
125
  }
126
126
 
127
127
  .column-header-menu-trigger:hover {
128
- background: rgba(0,0,0,0.08);
129
- color: rgba(0,0,0,0.87);
128
+ background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.08));
129
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
130
130
  }
131
131
  `],
132
132
  })
@@ -4,8 +4,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { Component, ChangeDetectionStrategy, Input, ViewChild, signal } from '@angular/core';
8
- import { BaseDataGridTableComponent, DataGridStateService, MarchingAntsOverlayComponent, StatusBarComponent, GridContextMenuComponent, CHECKBOX_COLUMN_WIDTH, ROW_NUMBER_COLUMN_WIDTH, } from '@alaarab/ogrid-angular';
7
+ import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, ViewChild, signal } from '@angular/core';
8
+ import { BaseDataGridTableComponent, DataGridStateService, MarchingAntsOverlayComponent, StatusBarComponent, GridContextMenuComponent, EmptyStateComponent, CHECKBOX_COLUMN_WIDTH, ROW_NUMBER_COLUMN_WIDTH, } from '@alaarab/ogrid-angular';
9
9
  import { ColumnHeaderFilterComponent } from '../column-header-filter/column-header-filter.component';
10
10
  import { ColumnHeaderMenuComponent } from '../column-header-menu/column-header-menu.component';
11
11
  import { InlineCellEditorComponent } from './inline-cell-editor.component';
@@ -40,7 +40,7 @@ let DataGridTableComponent = class DataGridTableComponent extends BaseDataGridTa
40
40
  onUnpin: () => this.onUnpinColumn(columnId),
41
41
  onSortAsc: () => this.onSortAsc(columnId),
42
42
  onSortDesc: () => this.onSortDesc(columnId),
43
- onClearSort: () => this.onClearSort(),
43
+ onClearSort: () => this.onClearSort(columnId),
44
44
  onAutosizeThis: () => this.onAutosizeColumn(columnId),
45
45
  onAutosizeAll: () => this.onAutosizeAllColumns(),
46
46
  onClose: () => { }
@@ -61,7 +61,8 @@ DataGridTableComponent = __decorate([
61
61
  selector: 'ogrid-datagrid-table',
62
62
  standalone: true,
63
63
  changeDetection: ChangeDetectionStrategy.OnPush,
64
- imports: [ColumnHeaderFilterComponent, ColumnHeaderMenuComponent, StatusBarComponent, GridContextMenuComponent, MarchingAntsOverlayComponent, InlineCellEditorComponent, PopoverCellEditorComponent],
64
+ encapsulation: ViewEncapsulation.None,
65
+ imports: [ColumnHeaderFilterComponent, ColumnHeaderMenuComponent, StatusBarComponent, GridContextMenuComponent, MarchingAntsOverlayComponent, EmptyStateComponent, InlineCellEditorComponent, PopoverCellEditorComponent],
65
66
  providers: [DataGridStateService],
66
67
  template: `
67
68
  <div class="ogrid-datagrid-root">
@@ -226,6 +227,7 @@ DataGridTableComponent = __decorate([
226
227
  @for (colLayout of columnLayouts(); track colLayout.col.columnId; let colIdx = $index) {
227
228
  <td
228
229
  class="ogrid-datagrid-td"
230
+ [attr.data-column-id]="colLayout.col.columnId"
229
231
  [class.ogrid-datagrid-td--pinned-left]="colLayout.pinnedLeft"
230
232
  [class.ogrid-datagrid-td--pinned-right]="colLayout.pinnedRight"
231
233
  [style.minWidth.px]="colLayout.minWidth"
@@ -315,15 +317,12 @@ DataGridTableComponent = __decorate([
315
317
  <div class="ogrid-datagrid-empty">
316
318
  <div class="ogrid-datagrid-empty__title">No results found</div>
317
319
  <div class="ogrid-datagrid-empty__message">
318
- @if (emptyState()!.message != null) {
319
- {{ emptyState()!.message }}
320
- } @else if (emptyState()!.hasActiveFilters) {
321
- No items match your current filters. Try adjusting your search or
322
- <button class="ogrid-datagrid-empty__clear" (click)="emptyState()!.onClearAll?.()">clear all filters</button>
323
- to see all items.
324
- } @else {
325
- There are no items available at this time.
326
- }
320
+ <ogrid-empty-state
321
+ [message]="emptyState()?.message"
322
+ [hasActiveFilters]="emptyState()?.hasActiveFilters ?? false"
323
+ [render]="emptyState()?.render"
324
+ (clearAll)="emptyState()?.onClearAll()"
325
+ ></ogrid-empty-state>
327
326
  </div>
328
327
  </div>
329
328
  }
@@ -381,14 +380,63 @@ DataGridTableComponent = __decorate([
381
380
  </div>
382
381
  `,
383
382
  styles: [`
383
+ /* ─── OGrid Theme Variables ─── */
384
+ :root {
385
+ --ogrid-bg: #ffffff;
386
+ --ogrid-fg: rgba(0, 0, 0, 0.87);
387
+ --ogrid-fg-secondary: rgba(0, 0, 0, 0.6);
388
+ --ogrid-fg-muted: rgba(0, 0, 0, 0.5);
389
+ --ogrid-border: rgba(0, 0, 0, 0.12);
390
+ --ogrid-header-bg: rgba(0, 0, 0, 0.04);
391
+ --ogrid-hover-bg: rgba(0, 0, 0, 0.04);
392
+ --ogrid-selected-row-bg: #e6f0fb;
393
+ --ogrid-active-cell-bg: rgba(0, 0, 0, 0.02);
394
+ --ogrid-range-bg: rgba(33, 115, 70, 0.12);
395
+ --ogrid-accent: #0078d4;
396
+ --ogrid-selection-color: #217346;
397
+ --ogrid-loading-overlay: rgba(255, 255, 255, 0.7);
398
+ }
399
+ @media (prefers-color-scheme: dark) {
400
+ :root:not([data-theme="light"]) {
401
+ --ogrid-bg: #1e1e1e;
402
+ --ogrid-fg: rgba(255, 255, 255, 0.87);
403
+ --ogrid-fg-secondary: rgba(255, 255, 255, 0.6);
404
+ --ogrid-fg-muted: rgba(255, 255, 255, 0.5);
405
+ --ogrid-border: rgba(255, 255, 255, 0.12);
406
+ --ogrid-header-bg: rgba(255, 255, 255, 0.06);
407
+ --ogrid-hover-bg: rgba(255, 255, 255, 0.08);
408
+ --ogrid-selected-row-bg: #1a3a5c;
409
+ --ogrid-active-cell-bg: rgba(255, 255, 255, 0.06);
410
+ --ogrid-range-bg: rgba(46, 160, 67, 0.15);
411
+ --ogrid-accent: #4da6ff;
412
+ --ogrid-selection-color: #2ea043;
413
+ --ogrid-loading-overlay: rgba(0, 0, 0, 0.7);
414
+ }
415
+ }
416
+ [data-theme="dark"] {
417
+ --ogrid-bg: #1e1e1e;
418
+ --ogrid-fg: rgba(255, 255, 255, 0.87);
419
+ --ogrid-fg-secondary: rgba(255, 255, 255, 0.6);
420
+ --ogrid-fg-muted: rgba(255, 255, 255, 0.5);
421
+ --ogrid-border: rgba(255, 255, 255, 0.12);
422
+ --ogrid-header-bg: rgba(255, 255, 255, 0.06);
423
+ --ogrid-hover-bg: rgba(255, 255, 255, 0.08);
424
+ --ogrid-selected-row-bg: #1a3a5c;
425
+ --ogrid-active-cell-bg: rgba(255, 255, 255, 0.06);
426
+ --ogrid-range-bg: rgba(46, 160, 67, 0.15);
427
+ --ogrid-accent: #4da6ff;
428
+ --ogrid-selection-color: #2ea043;
429
+ --ogrid-loading-overlay: rgba(0, 0, 0, 0.7);
430
+ }
384
431
  :host { display: block; }
385
432
  .ogrid-datagrid-root { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
386
433
  .ogrid-datagrid-wrapper {
387
434
  position: relative; flex: 1; min-height: 0; width: 100%; max-width: 100%;
388
- overflow-x: hidden; overflow-y: auto; background: #fff;
435
+ overflow-x: hidden; overflow-y: auto; background: var(--ogrid-bg, #ffffff);
436
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
389
437
  will-change: scroll-position; outline: none;
390
438
  }
391
- .ogrid-datagrid-wrapper [data-drag-range] { background: rgba(33, 115, 70, 0.12) !important; }
439
+ .ogrid-datagrid-wrapper [data-drag-range] { background: var(--ogrid-range-bg, rgba(33, 115, 70, 0.12)) !important; }
392
440
  .ogrid-datagrid-wrapper--fit { width: fit-content; }
393
441
  .ogrid-datagrid-wrapper--overflow-x { overflow-x: auto; }
394
442
  .ogrid-datagrid-scroll-wrapper { display: flex; flex-direction: column; min-height: 100%; }
@@ -397,28 +445,29 @@ DataGridTableComponent = __decorate([
397
445
  width: 100%; border-collapse: collapse; table-layout: fixed;
398
446
  }
399
447
  .ogrid-datagrid-thead {
400
- z-index: 8; background: rgba(0,0,0,0.04);
448
+ z-index: 8; background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04));
401
449
  }
402
- .ogrid-datagrid-thead th { background: rgba(0,0,0,0.04); }
403
- .ogrid-datagrid-header-row { background: rgba(0,0,0,0.04); }
450
+ .ogrid-datagrid-thead th { background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04)); }
451
+ .ogrid-datagrid-header-row { background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04)); }
404
452
  .ogrid-datagrid-th {
405
453
  font-weight: 600; position: sticky; top: 0; padding: 6px 10px; text-align: left;
406
- font-size: 14px; border-bottom: 1px solid rgba(0,0,0,0.12);
407
- background: rgba(0,0,0,0.04); z-index: 8;
454
+ font-size: 14px; border-bottom: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
455
+ background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04)); z-index: 8;
456
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
408
457
  }
409
458
  .ogrid-datagrid-th:focus-visible {
410
- outline: 2px solid #1976d2; outline-offset: -2px; z-index: 11;
459
+ outline: 2px solid var(--mat-sys-primary, #1976d2); outline-offset: -2px; z-index: 11;
411
460
  }
412
461
  .ogrid-datagrid-th--pinned-left {
413
- position: sticky; top: 0; left: 0; z-index: 10; background: rgba(0,0,0,0.04); will-change: transform;
414
- border-right: 2px solid rgba(0,0,0,0.12);
462
+ position: sticky; top: 0; left: 0; z-index: 10; background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04)); will-change: transform;
463
+ border-right: 2px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
415
464
  }
416
465
  .ogrid-datagrid-th--pinned-right {
417
- position: sticky; top: 0; right: 0; z-index: 10; background: rgba(0,0,0,0.04); will-change: transform;
418
- border-left: 2px solid rgba(0,0,0,0.12);
466
+ position: sticky; top: 0; right: 0; z-index: 10; background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04)); will-change: transform;
467
+ border-left: 2px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
419
468
  }
420
469
  .ogrid-datagrid-group-header {
421
- text-align: center; font-weight: 600; border-bottom: 2px solid rgba(0,0,0,0.12); padding: 6px;
470
+ text-align: center; font-weight: 600; border-bottom: 2px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); padding: 6px;
422
471
  }
423
472
  .ogrid-datagrid-checkbox-col {
424
473
  width: ${CHECKBOX_COLUMN_WIDTH}px; min-width: ${CHECKBOX_COLUMN_WIDTH}px;
@@ -428,8 +477,8 @@ DataGridTableComponent = __decorate([
428
477
  .ogrid-row-number-header, .ogrid-row-number-cell {
429
478
  width: ${ROW_NUMBER_COLUMN_WIDTH}px; min-width: ${ROW_NUMBER_COLUMN_WIDTH}px;
430
479
  max-width: ${ROW_NUMBER_COLUMN_WIDTH}px; text-align: center;
431
- background: rgba(0,0,0,0.04); font-weight: 600;
432
- font-variant-numeric: tabular-nums; color: rgba(0,0,0,0.6);
480
+ background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04)); font-weight: 600;
481
+ font-variant-numeric: tabular-nums; color: var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.6));
433
482
  position: sticky; left: 0; z-index: 3;
434
483
  }
435
484
  .ogrid-row-number-header { z-index: 4; }
@@ -437,51 +486,53 @@ DataGridTableComponent = __decorate([
437
486
  display: flex; align-items: center; justify-content: center;
438
487
  }
439
488
  .ogrid-datagrid-row { }
440
- .ogrid-datagrid-row:hover { background: rgba(0,0,0,0.04); }
441
- .ogrid-datagrid-row--selected { background: rgba(25,118,210,0.08); }
442
- .ogrid-datagrid-td { position: relative; padding: 0; height: 1px; border-bottom: 1px solid rgba(0,0,0,0.06); }
489
+ .ogrid-datagrid-row:hover { background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04)); }
490
+ .ogrid-datagrid-row--selected { background: var(--ogrid-selected-row-bg, #e6f0fb); }
491
+ .ogrid-datagrid-td { position: relative; padding: 0; height: 1px; border-bottom: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.06)); }
443
492
  .ogrid-datagrid-td--pinned-left {
444
- position: sticky; left: 0; z-index: 6; background: #fff; will-change: transform;
445
- border-right: 2px solid rgba(0,0,0,0.12);
493
+ position: sticky; left: 0; z-index: 6; background: var(--ogrid-bg, #ffffff); will-change: transform;
494
+ border-right: 2px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
446
495
  }
447
496
  .ogrid-datagrid-td--pinned-right {
448
- position: sticky; right: 0; z-index: 6; background: #fff; will-change: transform;
449
- border-left: 2px solid rgba(0,0,0,0.12);
497
+ position: sticky; right: 0; z-index: 6; background: var(--ogrid-bg, #ffffff); will-change: transform;
498
+ border-left: 2px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
450
499
  }
451
500
  .ogrid-datagrid-cell {
452
501
  width: 100%; height: 100%; display: flex; align-items: center; min-width: 0;
453
502
  padding: 6px 10px; box-sizing: border-box; overflow: hidden;
454
503
  text-overflow: ellipsis; white-space: nowrap; user-select: none; outline: none;
455
- font-size: 14px;
504
+ font-size: 14px; color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
456
505
  }
457
506
  .ogrid-datagrid-cell:focus-visible {
458
- outline: 2px solid #1976d2; outline-offset: -2px; z-index: 3;
507
+ outline: 2px solid var(--mat-sys-primary, #1976d2); outline-offset: -2px; z-index: 3;
459
508
  }
460
509
  .ogrid-datagrid-cell--numeric { justify-content: flex-end; text-align: right; }
461
510
  .ogrid-datagrid-cell--boolean { justify-content: center; text-align: center; }
462
511
  .ogrid-datagrid-cell--editable { cursor: cell; }
463
512
  .ogrid-datagrid-cell--active {
464
- outline: 2px solid var(--ogrid-selection, #217346); outline-offset: -1px;
513
+ outline: 2px solid var(--ogrid-selection-color, #217346); outline-offset: -1px;
465
514
  z-index: 2; position: relative; overflow: visible;
466
515
  }
467
- .ogrid-datagrid-cell--in-range { background: var(--ogrid-bg-range, rgba(33, 115, 70, 0.12)); }
468
- .ogrid-datagrid-cell--in-cut-range { background: rgba(0,0,0,0.04); opacity: 0.7; }
516
+ .ogrid-datagrid-cell--in-range { background: var(--ogrid-range-bg, rgba(33, 115, 70, 0.12)); }
517
+ .ogrid-datagrid-cell--in-cut-range { background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04)); opacity: 0.7; }
469
518
  .ogrid-datagrid-cell--editing { padding: 0; }
470
519
  .ogrid-datagrid-editor-input {
471
- width: 100%; height: 100%; padding: 6px 10px; border: 2px solid var(--ogrid-selection, #217346);
520
+ width: 100%; height: 100%; padding: 6px 10px; border: 2px solid var(--ogrid-selection-color, #217346);
472
521
  box-sizing: border-box; font-size: 14px; outline: none; font-family: inherit; line-height: inherit;
522
+ background: var(--ogrid-bg, #ffffff); color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
473
523
  }
474
524
  .ogrid-datagrid-cell--numeric .ogrid-datagrid-editor-input {
475
525
  text-align: right;
476
526
  }
477
527
  .ogrid-datagrid-editor-select {
478
- width: 100%; height: 100%; padding: 4px 8px; border: 2px solid var(--ogrid-selection, #217346);
528
+ width: 100%; height: 100%; padding: 4px 8px; border: 2px solid var(--ogrid-selection-color, #217346);
479
529
  box-sizing: border-box; font-size: 14px;
530
+ background: var(--ogrid-bg, #ffffff); color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
480
531
  }
481
532
  .ogrid-datagrid-fill-handle {
482
533
  position: absolute; right: -3px; bottom: -3px; width: 7px; height: 7px;
483
- background: var(--ogrid-selection, #217346);
484
- border: 1px solid var(--ogrid-bg, #fff); border-radius: 1px;
534
+ background: var(--ogrid-selection-color, #217346);
535
+ border: 1px solid var(--ogrid-bg, #ffffff); border-radius: 1px;
485
536
  cursor: crosshair; pointer-events: auto; z-index: 3;
486
537
  }
487
538
  .ogrid-datagrid-resize-handle {
@@ -490,16 +541,16 @@ DataGridTableComponent = __decorate([
490
541
  }
491
542
  .ogrid-datagrid-resize-handle::after {
492
543
  content: ''; position: absolute; top: 4px; right: 3px; bottom: 4px; width: 2px;
493
- background: rgba(0,0,0,0.12); border-radius: 1px; transition: background 0.15s;
544
+ background: var(--ogrid-border, rgba(0, 0, 0, 0.12)); border-radius: 1px; transition: background 0.15s;
494
545
  }
495
- .ogrid-datagrid-resize-handle:hover::after { background: rgba(0,0,0,0.4); }
546
+ .ogrid-datagrid-resize-handle:hover::after { background: var(--ogrid-fg-muted, rgba(0, 0, 0, 0.4)); }
496
547
  .ogrid-datagrid-resize-handle:active::after { background: var(--mat-sys-primary, #1976d2); }
497
548
  .ogrid-datagrid-empty {
498
- padding: 32px 16px; text-align: center; border-top: 1px solid rgba(0,0,0,0.12);
499
- background: rgba(0,0,0,0.04);
549
+ padding: 32px 16px; text-align: center; border-top: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
550
+ background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04));
500
551
  }
501
- .ogrid-datagrid-empty__title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
502
- .ogrid-datagrid-empty__message { font-size: 14px; color: rgba(0,0,0,0.6); }
552
+ .ogrid-datagrid-empty__title { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--ogrid-fg, rgba(0, 0, 0, 0.87)); }
553
+ .ogrid-datagrid-empty__message { font-size: 14px; color: var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.6)); }
503
554
  .ogrid-datagrid-empty__clear {
504
555
  background: none; border: none; color: var(--mat-sys-primary, #1976d2);
505
556
  cursor: pointer; font-size: inherit; text-decoration: underline; padding: 0;
@@ -507,26 +558,42 @@ DataGridTableComponent = __decorate([
507
558
  .ogrid-datagrid-loading-overlay {
508
559
  position: absolute; inset: 0; z-index: 2;
509
560
  display: flex; align-items: center; justify-content: center;
510
- background: rgba(255,255,255,0.7);
561
+ background: var(--ogrid-loading-overlay, rgba(255, 255, 255, 0.7));
511
562
  }
512
563
  .ogrid-datagrid-loading-inner {
513
564
  display: flex; flex-direction: column; align-items: center; gap: 8px;
514
- padding: 16px; background: #fff; border: 1px solid rgba(0,0,0,0.12); border-radius: 4px;
565
+ padding: 16px; background: var(--ogrid-bg, #ffffff); border: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); border-radius: 4px;
566
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
515
567
  }
516
568
  .ogrid-datagrid-spinner {
517
- width: 24px; height: 24px; border: 3px solid rgba(0,0,0,0.12);
569
+ width: 24px; height: 24px; border: 3px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
518
570
  border-top-color: var(--mat-sys-primary, #1976d2);
519
571
  border-radius: 50%; animation: ogrid-spin 0.8s linear infinite;
520
572
  }
521
573
  @keyframes ogrid-spin { to { transform: rotate(360deg); } }
522
574
  .ogrid-datagrid-drop-indicator {
523
575
  position: absolute; top: 0; bottom: 0; width: 3px;
524
- background: var(--ogrid-primary, #217346);
576
+ background: var(--ogrid-selection-color, #217346);
525
577
  pointer-events: none; z-index: 100; transition: left 0.05s;
526
578
  }
527
579
  .ogrid-datagrid-context-menu-overlay {
528
580
  position: fixed; inset: 0; z-index: 1000;
529
581
  }
582
+
583
+ /* Angular Material Menu popup dark mode overrides */
584
+ .mat-mdc-menu-panel {
585
+ background: var(--ogrid-bg, #ffffff) !important;
586
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87)) !important;
587
+ }
588
+ .mat-mdc-menu-item {
589
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87)) !important;
590
+ }
591
+ .mat-mdc-menu-item:hover:not([disabled]) {
592
+ background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04)) !important;
593
+ }
594
+ .mat-mdc-menu-item .mat-mdc-menu-item-text {
595
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87)) !important;
596
+ }
530
597
  `],
531
598
  })
532
599
  ], DataGridTableComponent);
@@ -109,9 +109,10 @@ PopoverCellEditorComponent = __decorate([
109
109
  display: flex; align-items: center; justify-content: center;
110
110
  }
111
111
  .ogrid-popover-editor-content {
112
- background: #fff; border-radius: 4px; padding: 16px;
113
- box-shadow: 0 4px 12px rgba(0,0,0,0.15);
112
+ background: var(--ogrid-bg, #ffffff); border-radius: 4px; padding: 16px;
113
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
114
114
  max-width: 90vw; max-height: 90vh; overflow: auto;
115
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
115
116
  }
116
117
  `],
117
118
  })
@@ -52,6 +52,7 @@ OGridComponent = __decorate([
52
52
  PaginationControlsComponent,
53
53
  ],
54
54
  providers: [OGridService],
55
+ styles: [`:host { display: block; height: 100%; }`],
55
56
  template: `
56
57
  <ogrid-layout
57
58
  [className]="ogridService.className()"
@@ -97,25 +97,29 @@ PaginationControlsComponent = __decorate([
97
97
  .ogrid-pagination {
98
98
  display: flex; align-items: center; justify-content: space-between;
99
99
  flex-wrap: wrap; gap: 8px; padding: 6px 12px; font-size: 14px;
100
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
100
101
  }
101
- .ogrid-pagination__info { color: rgba(0,0,0,0.6); }
102
+ .ogrid-pagination__info { color: var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.6)); }
102
103
  .ogrid-pagination__pages { display: flex; align-items: center; gap: 2px; }
103
104
  .ogrid-pagination__btn {
104
105
  min-width: 32px; height: 32px; padding: 0 6px;
105
- border: 1px solid rgba(0,0,0,0.23); border-radius: 4px;
106
+ border: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.23)); border-radius: 4px;
106
107
  background: transparent; cursor: pointer; font-size: 14px;
108
+ color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
107
109
  }
110
+ .ogrid-pagination__btn:hover:not(:disabled) { background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04)); }
108
111
  .ogrid-pagination__btn:disabled { opacity: 0.38; cursor: default; }
109
112
  .ogrid-pagination__btn--active {
110
113
  background: var(--mat-sys-primary, #1976d2); color: #fff;
111
114
  border-color: var(--mat-sys-primary, #1976d2);
112
115
  }
113
- .ogrid-pagination__ellipsis { margin: 0 4px; color: rgba(0,0,0,0.6); }
114
- .ogrid-pagination__size { display: flex; align-items: center; gap: 8px; }
116
+ .ogrid-pagination__ellipsis { margin: 0 4px; color: var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.6)); }
117
+ .ogrid-pagination__size { display: flex; align-items: center; gap: 8px; color: var(--ogrid-fg, rgba(0, 0, 0, 0.87)); }
115
118
  .ogrid-pagination__size select {
116
119
  min-width: 60px; height: 32px; padding: 4px 8px;
117
- border: 1px solid rgba(0,0,0,0.23); border-radius: 4px;
120
+ border: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.23)); border-radius: 4px;
118
121
  font-size: 14px; margin-left: 8px;
122
+ background: var(--ogrid-bg, #ffffff); color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
119
123
  }
120
124
  `],
121
125
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alaarab/ogrid-angular-material",
3
- "version": "2.0.11",
3
+ "version": "2.0.12",
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",
@@ -14,7 +14,9 @@
14
14
  },
15
15
  "scripts": {
16
16
  "build": "rimraf dist && tsc -p tsconfig.build.json",
17
- "test": "jest --passWithNoTests"
17
+ "test": "jest --passWithNoTests",
18
+ "storybook": "ng run angular-material:storybook",
19
+ "build-storybook": "ng run angular-material:build-storybook"
18
20
  },
19
21
  "keywords": [
20
22
  "ogrid",
@@ -35,7 +37,7 @@
35
37
  "node": ">=18"
36
38
  },
37
39
  "dependencies": {
38
- "@alaarab/ogrid-angular": "2.0.11"
40
+ "@alaarab/ogrid-angular": "2.0.12"
39
41
  },
40
42
  "peerDependencies": {
41
43
  "@angular/cdk": "^21.0.0",
@@ -54,7 +56,14 @@
54
56
  "@angular/platform-browser-dynamic": "^21.1.4",
55
57
  "rxjs": "^7.8.2",
56
58
  "typescript": "^5.9.3",
57
- "zone.js": "^0.15.0"
59
+ "zone.js": "^0.15.0",
60
+ "@angular/cli": "^21.1.4",
61
+ "@angular/compiler-cli": "^21.1.4",
62
+ "@angular-devkit/core": "^21.1.4",
63
+ "@angular-devkit/architect": "^0.2101.4",
64
+ "@angular-devkit/build-angular": "^21.1.4",
65
+ "@storybook/angular": "^10.2.8",
66
+ "storybook": "^10.2.8"
58
67
  },
59
68
  "sideEffects": false,
60
69
  "publishConfig": {