@alaarab/ogrid-angular-primeng 2.0.9 → 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.
- package/dist/esm/column-chooser/column-chooser.component.js +9 -29
- package/dist/esm/column-header-filter/column-header-filter.component.js +47 -165
- package/dist/esm/column-header-menu/column-header-menu.component.js +88 -51
- package/dist/esm/datagrid-table/datagrid-table.component.js +614 -152
- package/dist/esm/datagrid-table/inline-cell-editor.component.js +32 -14
- package/dist/esm/datagrid-table/popover-cell-editor.component.js +39 -20
- package/dist/esm/index.js +2 -0
- package/dist/esm/ogrid/ogrid.component.js +25 -11
- package/dist/esm/pagination-controls/pagination-controls.component.js +13 -27
- package/dist/types/column-chooser/column-chooser.component.d.ts +3 -19
- package/dist/types/column-header-filter/column-header-filter.component.d.ts +5 -62
- package/dist/types/column-header-menu/column-header-menu.component.d.ts +11 -12
- package/dist/types/datagrid-table/datagrid-table.component.d.ts +72 -50
- package/dist/types/datagrid-table/inline-cell-editor.component.d.ts +9 -9
- package/dist/types/datagrid-table/popover-cell-editor.component.d.ts +9 -9
- package/dist/types/index.d.ts +0 -2
- package/dist/types/ogrid/ogrid.component.d.ts +7 -6
- package/dist/types/pagination-controls/pagination-controls.component.d.ts +2 -11
- package/package.json +14 -4
|
@@ -4,7 +4,7 @@ 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,
|
|
7
|
+
import { Component, Input, signal, computed, ViewChild, ChangeDetectionStrategy, ViewEncapsulation, } from '@angular/core';
|
|
8
8
|
import { BaseDataGridTableComponent, DataGridStateService, StatusBarComponent, GridContextMenuComponent, MarchingAntsOverlayComponent, EmptyStateComponent, DEFAULT_MIN_COLUMN_WIDTH, getCellValue, resolveCellDisplayContent, resolveCellStyle, } 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';
|
|
@@ -13,52 +13,43 @@ import { PopoverCellEditorComponent } from './popover-cell-editor.component';
|
|
|
13
13
|
let DataGridTableComponent = class DataGridTableComponent extends BaseDataGridTableComponent {
|
|
14
14
|
constructor() {
|
|
15
15
|
super();
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
41
|
-
this.
|
|
42
|
-
this.
|
|
43
|
-
this.
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
46
|
-
this.
|
|
47
|
-
this.
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
50
|
-
this.
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
53
|
-
this.peopleSearch = input(undefined);
|
|
54
|
-
this.getUserByEmail = input(undefined);
|
|
55
|
-
this.emptyStateInput = input(undefined, { alias: 'emptyState' });
|
|
56
|
-
this.onCellError = input(undefined);
|
|
57
|
-
this.ariaLabelInput = input(undefined, { alias: 'aria-label' });
|
|
58
|
-
this.ariaLabelledByInput = input(undefined, { alias: 'aria-labelledby' });
|
|
59
|
-
this.showRowNumbers = input(false);
|
|
60
|
-
this.currentPageInput = input(1, { alias: 'currentPage' });
|
|
61
|
-
this.pageSizeInput = input(25, { alias: 'pageSize' });
|
|
16
|
+
this.sortBy = undefined;
|
|
17
|
+
this.sortDirection = 'asc';
|
|
18
|
+
this.columnOrder = undefined;
|
|
19
|
+
this.onColumnOrderChange = undefined;
|
|
20
|
+
this.onColumnResized = undefined;
|
|
21
|
+
this.onColumnPinned = undefined;
|
|
22
|
+
this.pinnedColumnsInput = undefined;
|
|
23
|
+
this.initialColumnWidths = undefined;
|
|
24
|
+
this.freezeRowsInput = undefined;
|
|
25
|
+
this.freezeColsInput = undefined;
|
|
26
|
+
this.layoutMode = 'fill';
|
|
27
|
+
this.suppressHorizontalScroll = undefined;
|
|
28
|
+
this.columnReorder = undefined;
|
|
29
|
+
this.isLoadingInput = false;
|
|
30
|
+
this.loadingMessageInput = 'Loading\u2026';
|
|
31
|
+
this.editable = undefined;
|
|
32
|
+
this.cellSelection = undefined;
|
|
33
|
+
this.onCellValueChanged = undefined;
|
|
34
|
+
this.onUndoInput = undefined;
|
|
35
|
+
this.onRedoInput = undefined;
|
|
36
|
+
this.canUndoInput = undefined;
|
|
37
|
+
this.canRedoInput = undefined;
|
|
38
|
+
this.rowSelectionMode = 'none';
|
|
39
|
+
this.selectedRows = undefined;
|
|
40
|
+
this.onSelectionChange = undefined;
|
|
41
|
+
this.statusBar = undefined;
|
|
42
|
+
this.filterOptions = {};
|
|
43
|
+
this.loadingFilterOptions = {};
|
|
44
|
+
this.peopleSearch = undefined;
|
|
45
|
+
this.getUserByEmail = undefined;
|
|
46
|
+
this.emptyStateInput = undefined;
|
|
47
|
+
this.onCellError = undefined;
|
|
48
|
+
this.ariaLabelInput = undefined;
|
|
49
|
+
this.ariaLabelledByInput = undefined;
|
|
50
|
+
this.showRowNumbers = false;
|
|
51
|
+
this.currentPageInput = 1;
|
|
52
|
+
this.pageSizeInput = 25;
|
|
62
53
|
this.defaultMinWidth = DEFAULT_MIN_COLUMN_WIDTH;
|
|
63
54
|
this.statusBarClasses = {
|
|
64
55
|
statusBar: 'ogrid-status-bar',
|
|
@@ -66,19 +57,29 @@ let DataGridTableComponent = class DataGridTableComponent extends BaseDataGridTa
|
|
|
66
57
|
statusBarLabel: 'ogrid-status-bar-label',
|
|
67
58
|
statusBarValue: 'ogrid-status-bar-value',
|
|
68
59
|
};
|
|
60
|
+
this.contextMenuClasses = {
|
|
61
|
+
contextMenu: 'ogrid-context-menu',
|
|
62
|
+
contextMenuItem: 'ogrid-context-menu-item',
|
|
63
|
+
contextMenuItemLabel: 'ogrid-context-menu-item-label',
|
|
64
|
+
contextMenuItemShortcut: 'ogrid-context-menu-item-shortcut',
|
|
65
|
+
contextMenuDivider: 'ogrid-context-menu-divider',
|
|
66
|
+
};
|
|
69
67
|
// PrimeNG uses flat number overrides for column sizing
|
|
70
68
|
this.primengColumnSizingOverrides = signal({});
|
|
69
|
+
this.propsSignal = signal(undefined);
|
|
71
70
|
this.resizeStartX = 0;
|
|
72
71
|
this.resizeColumnId = '';
|
|
73
72
|
this.resizeStartWidth = 0;
|
|
73
|
+
// Bound method reference for template
|
|
74
|
+
this.cancelEditHandler = () => this.cancelEdit();
|
|
74
75
|
// --- PrimeNG-specific computed signals ---
|
|
75
|
-
this.resolvedAriaLabel = computed(() => this.ariaLabelInput
|
|
76
|
+
this.resolvedAriaLabel = computed(() => this.ariaLabelInput ?? (this.ariaLabelledByInput ? undefined : 'Data grid'));
|
|
76
77
|
this.tableWidthStyle = computed(() => {
|
|
77
78
|
if (this.showEmptyInGrid())
|
|
78
79
|
return '100%';
|
|
79
80
|
if (this.allowOverflowX())
|
|
80
81
|
return 'fit-content';
|
|
81
|
-
if (this.layoutMode
|
|
82
|
+
if (this.layoutMode === 'content')
|
|
82
83
|
return 'fit-content';
|
|
83
84
|
return '100%';
|
|
84
85
|
});
|
|
@@ -87,28 +88,32 @@ let DataGridTableComponent = class DataGridTableComponent extends BaseDataGridTa
|
|
|
87
88
|
return '100%';
|
|
88
89
|
if (this.allowOverflowX())
|
|
89
90
|
return 'max-content';
|
|
90
|
-
if (this.layoutMode
|
|
91
|
+
if (this.layoutMode === 'content')
|
|
91
92
|
return 'max-content';
|
|
92
93
|
return '100%';
|
|
93
94
|
});
|
|
94
95
|
this.initBase();
|
|
96
|
+
}
|
|
97
|
+
ngOnChanges(changes) {
|
|
95
98
|
// Initialize column sizing from initial widths
|
|
96
|
-
|
|
97
|
-
const iw = this.initialColumnWidths
|
|
99
|
+
if (changes['initialColumnWidths']) {
|
|
100
|
+
const iw = this.initialColumnWidths;
|
|
98
101
|
if (iw) {
|
|
99
102
|
this.primengColumnSizingOverrides.set({ ...iw });
|
|
100
103
|
}
|
|
101
|
-
}
|
|
104
|
+
}
|
|
105
|
+
// Rebuild props signal whenever any input changes so computed chains track it
|
|
106
|
+
this.propsSignal.set(this.buildProps());
|
|
102
107
|
}
|
|
103
108
|
// --- Abstract method implementations ---
|
|
104
109
|
getProps() {
|
|
105
|
-
return this.
|
|
110
|
+
return this.propsSignal();
|
|
106
111
|
}
|
|
107
112
|
getWrapperRef() {
|
|
108
|
-
return this.wrapperRef
|
|
113
|
+
return this.wrapperRef;
|
|
109
114
|
}
|
|
110
115
|
getTableContainerRef() {
|
|
111
|
-
return this.tableContainerRefEl
|
|
116
|
+
return this.tableContainerRefEl;
|
|
112
117
|
}
|
|
113
118
|
// --- Column width override (PrimeNG uses flat number instead of { widthPx }) ---
|
|
114
119
|
getColumnWidth(col) {
|
|
@@ -119,7 +124,7 @@ let DataGridTableComponent = class DataGridTableComponent extends BaseDataGridTa
|
|
|
119
124
|
}
|
|
120
125
|
// --- PrimeNG-specific helpers ---
|
|
121
126
|
trackByRowId(_index, item) {
|
|
122
|
-
return this.getRowIdInput(
|
|
127
|
+
return this.getRowIdInput(item);
|
|
123
128
|
}
|
|
124
129
|
getCellValueFn(item, col) {
|
|
125
130
|
return getCellValue(item, col);
|
|
@@ -134,13 +139,13 @@ let DataGridTableComponent = class DataGridTableComponent extends BaseDataGridTa
|
|
|
134
139
|
}
|
|
135
140
|
canEditCell(col, item) {
|
|
136
141
|
const colEditable = col.editable === true || (typeof col.editable === 'function' && col.editable(item));
|
|
137
|
-
return this.editable
|
|
142
|
+
return this.editable !== false && !!colEditable && this.onCellValueChanged != null && typeof col.cellEditor !== 'function';
|
|
138
143
|
}
|
|
139
144
|
isEditingCell(item, col) {
|
|
140
145
|
const editing = this.editingCell();
|
|
141
146
|
if (!editing)
|
|
142
147
|
return false;
|
|
143
|
-
return editing.rowId === this.getRowIdInput(
|
|
148
|
+
return editing.rowId === this.getRowIdInput(item) && editing.columnId === col.columnId;
|
|
144
149
|
}
|
|
145
150
|
isEditingCellInline(item, col) {
|
|
146
151
|
return this.isEditingCell(item, col) && typeof col.cellEditor !== 'function';
|
|
@@ -202,7 +207,7 @@ let DataGridTableComponent = class DataGridTableComponent extends BaseDataGridTa
|
|
|
202
207
|
// --- PrimeNG-specific event handlers ---
|
|
203
208
|
onCellDblClickPrimeng(item, col, _rowIndex, _colIdx) {
|
|
204
209
|
if (this.canEditCell(col, item)) {
|
|
205
|
-
this.stateService.setEditingCell({ rowId: this.getRowIdInput(
|
|
210
|
+
this.stateService.setEditingCell({ rowId: this.getRowIdInput(item), columnId: col.columnId });
|
|
206
211
|
}
|
|
207
212
|
}
|
|
208
213
|
onCellEditorCommit(item, col, rowIndex, colIdx, newValue) {
|
|
@@ -213,14 +218,27 @@ let DataGridTableComponent = class DataGridTableComponent extends BaseDataGridTa
|
|
|
213
218
|
this.state().rowSelection.handleSelectAll(checked);
|
|
214
219
|
}
|
|
215
220
|
onRowClickPrimeng(e, item) {
|
|
216
|
-
if (this.rowSelectionMode
|
|
221
|
+
if (this.rowSelectionMode !== 'single')
|
|
217
222
|
return;
|
|
218
|
-
const rowId = this.getRowIdInput(
|
|
223
|
+
const rowId = this.getRowIdInput(item);
|
|
219
224
|
const ids = this.selectedRowIds();
|
|
220
225
|
this.state().rowSelection.updateSelection(ids.has(rowId) ? new Set() : new Set([rowId]));
|
|
221
226
|
}
|
|
227
|
+
getColumnHeaderMenuHandlers(columnId) {
|
|
228
|
+
return {
|
|
229
|
+
onPinLeft: () => this.onPinColumn(columnId, 'left'),
|
|
230
|
+
onPinRight: () => this.onPinColumn(columnId, 'right'),
|
|
231
|
+
onUnpin: () => this.onUnpinColumn(columnId),
|
|
232
|
+
onSortAsc: () => this.onSortAsc(columnId),
|
|
233
|
+
onSortDesc: () => this.onSortDesc(columnId),
|
|
234
|
+
onClearSort: () => this.onClearSort(columnId),
|
|
235
|
+
onAutosizeThis: () => this.onAutosizeColumn(columnId),
|
|
236
|
+
onAutosizeAll: () => this.onAutosizeAllColumns(),
|
|
237
|
+
onClose: () => { }
|
|
238
|
+
};
|
|
239
|
+
}
|
|
222
240
|
onRowCheckboxChangePrimeng(item, checked, rowIndex, _e) {
|
|
223
|
-
const rowId = this.getRowIdInput(
|
|
241
|
+
const rowId = this.getRowIdInput(item);
|
|
224
242
|
this.state().rowSelection.handleRowCheckboxChange(rowId, checked, rowIndex, this.lastMouseShift);
|
|
225
243
|
}
|
|
226
244
|
onResizeStartPrimeng(e, col) {
|
|
@@ -240,7 +258,7 @@ let DataGridTableComponent = class DataGridTableComponent extends BaseDataGridTa
|
|
|
240
258
|
window.removeEventListener('mouseup', onUp, true);
|
|
241
259
|
const finalWidth = this.primengColumnSizingOverrides()[this.resizeColumnId];
|
|
242
260
|
if (finalWidth) {
|
|
243
|
-
this.onColumnResized
|
|
261
|
+
this.onColumnResized?.(this.resizeColumnId, finalWidth);
|
|
244
262
|
const overrides = {};
|
|
245
263
|
for (const [id, w] of Object.entries(this.primengColumnSizingOverrides())) {
|
|
246
264
|
overrides[id] = { widthPx: w };
|
|
@@ -254,52 +272,191 @@ let DataGridTableComponent = class DataGridTableComponent extends BaseDataGridTa
|
|
|
254
272
|
// --- Build props ---
|
|
255
273
|
buildProps() {
|
|
256
274
|
return {
|
|
257
|
-
items: this.itemsInput
|
|
258
|
-
columns: this.columns
|
|
259
|
-
getRowId: this.getRowIdInput
|
|
260
|
-
sortBy: this.sortBy
|
|
261
|
-
sortDirection: this.sortDirection
|
|
262
|
-
onColumnSort: this.onColumnSort
|
|
263
|
-
visibleColumns: this.visibleColumns
|
|
264
|
-
columnOrder: this.columnOrder
|
|
265
|
-
onColumnOrderChange: this.onColumnOrderChange
|
|
266
|
-
onColumnResized: this.onColumnResized
|
|
267
|
-
onColumnPinned: this.onColumnPinned
|
|
268
|
-
pinnedColumns: this.pinnedColumnsInput
|
|
269
|
-
initialColumnWidths: this.initialColumnWidths
|
|
270
|
-
freezeRows: this.freezeRowsInput
|
|
271
|
-
freezeCols: this.freezeColsInput
|
|
272
|
-
layoutMode: this.layoutMode
|
|
273
|
-
suppressHorizontalScroll: this.suppressHorizontalScroll
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
'aria-
|
|
275
|
+
items: this.itemsInput,
|
|
276
|
+
columns: this.columns,
|
|
277
|
+
getRowId: this.getRowIdInput,
|
|
278
|
+
sortBy: this.sortBy,
|
|
279
|
+
sortDirection: this.sortDirection,
|
|
280
|
+
onColumnSort: this.onColumnSort,
|
|
281
|
+
visibleColumns: this.visibleColumns,
|
|
282
|
+
columnOrder: this.columnOrder,
|
|
283
|
+
onColumnOrderChange: this.onColumnOrderChange,
|
|
284
|
+
onColumnResized: this.onColumnResized,
|
|
285
|
+
onColumnPinned: this.onColumnPinned,
|
|
286
|
+
pinnedColumns: this.pinnedColumnsInput,
|
|
287
|
+
initialColumnWidths: this.initialColumnWidths,
|
|
288
|
+
freezeRows: this.freezeRowsInput,
|
|
289
|
+
freezeCols: this.freezeColsInput,
|
|
290
|
+
layoutMode: this.layoutMode,
|
|
291
|
+
suppressHorizontalScroll: this.suppressHorizontalScroll,
|
|
292
|
+
columnReorder: this.columnReorder,
|
|
293
|
+
isLoading: this.isLoadingInput,
|
|
294
|
+
loadingMessage: this.loadingMessageInput,
|
|
295
|
+
editable: this.editable,
|
|
296
|
+
cellSelection: this.cellSelection,
|
|
297
|
+
onCellValueChanged: this.onCellValueChanged,
|
|
298
|
+
onUndo: this.onUndoInput,
|
|
299
|
+
onRedo: this.onRedoInput,
|
|
300
|
+
canUndo: this.canUndoInput,
|
|
301
|
+
canRedo: this.canRedoInput,
|
|
302
|
+
rowSelection: this.rowSelectionMode,
|
|
303
|
+
selectedRows: this.selectedRows,
|
|
304
|
+
onSelectionChange: this.onSelectionChange,
|
|
305
|
+
showRowNumbers: this.showRowNumbers,
|
|
306
|
+
currentPage: this.currentPageInput,
|
|
307
|
+
pageSize: this.pageSizeInput,
|
|
308
|
+
statusBar: this.statusBar,
|
|
309
|
+
filters: this.filters,
|
|
310
|
+
onFilterChange: this.onFilterChange,
|
|
311
|
+
filterOptions: this.filterOptions,
|
|
312
|
+
loadingFilterOptions: this.loadingFilterOptions,
|
|
313
|
+
peopleSearch: this.peopleSearch,
|
|
314
|
+
getUserByEmail: this.getUserByEmail,
|
|
315
|
+
emptyState: this.emptyStateInput,
|
|
316
|
+
onCellError: this.onCellError,
|
|
317
|
+
'aria-label': this.ariaLabelInput,
|
|
318
|
+
'aria-labelledby': this.ariaLabelledByInput,
|
|
300
319
|
};
|
|
301
320
|
}
|
|
302
321
|
};
|
|
322
|
+
__decorate([
|
|
323
|
+
ViewChild('wrapper')
|
|
324
|
+
], DataGridTableComponent.prototype, "wrapperRef", void 0);
|
|
325
|
+
__decorate([
|
|
326
|
+
ViewChild('tableContainer')
|
|
327
|
+
], DataGridTableComponent.prototype, "tableContainerRefEl", void 0);
|
|
328
|
+
__decorate([
|
|
329
|
+
Input({ required: true, alias: 'items' })
|
|
330
|
+
], DataGridTableComponent.prototype, "itemsInput", void 0);
|
|
331
|
+
__decorate([
|
|
332
|
+
Input({ required: true })
|
|
333
|
+
], DataGridTableComponent.prototype, "columns", void 0);
|
|
334
|
+
__decorate([
|
|
335
|
+
Input({ required: true, alias: 'getRowId' })
|
|
336
|
+
], DataGridTableComponent.prototype, "getRowIdInput", void 0);
|
|
337
|
+
__decorate([
|
|
338
|
+
Input()
|
|
339
|
+
], DataGridTableComponent.prototype, "sortBy", void 0);
|
|
340
|
+
__decorate([
|
|
341
|
+
Input()
|
|
342
|
+
], DataGridTableComponent.prototype, "sortDirection", void 0);
|
|
343
|
+
__decorate([
|
|
344
|
+
Input({ required: true })
|
|
345
|
+
], DataGridTableComponent.prototype, "onColumnSort", void 0);
|
|
346
|
+
__decorate([
|
|
347
|
+
Input({ required: true })
|
|
348
|
+
], DataGridTableComponent.prototype, "visibleColumns", void 0);
|
|
349
|
+
__decorate([
|
|
350
|
+
Input()
|
|
351
|
+
], DataGridTableComponent.prototype, "columnOrder", void 0);
|
|
352
|
+
__decorate([
|
|
353
|
+
Input()
|
|
354
|
+
], DataGridTableComponent.prototype, "onColumnOrderChange", void 0);
|
|
355
|
+
__decorate([
|
|
356
|
+
Input()
|
|
357
|
+
], DataGridTableComponent.prototype, "onColumnResized", void 0);
|
|
358
|
+
__decorate([
|
|
359
|
+
Input()
|
|
360
|
+
], DataGridTableComponent.prototype, "onColumnPinned", void 0);
|
|
361
|
+
__decorate([
|
|
362
|
+
Input({ alias: 'pinnedColumns' })
|
|
363
|
+
], DataGridTableComponent.prototype, "pinnedColumnsInput", void 0);
|
|
364
|
+
__decorate([
|
|
365
|
+
Input()
|
|
366
|
+
], DataGridTableComponent.prototype, "initialColumnWidths", void 0);
|
|
367
|
+
__decorate([
|
|
368
|
+
Input({ alias: 'freezeRows' })
|
|
369
|
+
], DataGridTableComponent.prototype, "freezeRowsInput", void 0);
|
|
370
|
+
__decorate([
|
|
371
|
+
Input({ alias: 'freezeCols' })
|
|
372
|
+
], DataGridTableComponent.prototype, "freezeColsInput", void 0);
|
|
373
|
+
__decorate([
|
|
374
|
+
Input()
|
|
375
|
+
], DataGridTableComponent.prototype, "layoutMode", void 0);
|
|
376
|
+
__decorate([
|
|
377
|
+
Input()
|
|
378
|
+
], DataGridTableComponent.prototype, "suppressHorizontalScroll", void 0);
|
|
379
|
+
__decorate([
|
|
380
|
+
Input()
|
|
381
|
+
], DataGridTableComponent.prototype, "columnReorder", void 0);
|
|
382
|
+
__decorate([
|
|
383
|
+
Input({ alias: 'isLoading' })
|
|
384
|
+
], DataGridTableComponent.prototype, "isLoadingInput", void 0);
|
|
385
|
+
__decorate([
|
|
386
|
+
Input({ alias: 'loadingMessage' })
|
|
387
|
+
], DataGridTableComponent.prototype, "loadingMessageInput", void 0);
|
|
388
|
+
__decorate([
|
|
389
|
+
Input()
|
|
390
|
+
], DataGridTableComponent.prototype, "editable", void 0);
|
|
391
|
+
__decorate([
|
|
392
|
+
Input()
|
|
393
|
+
], DataGridTableComponent.prototype, "cellSelection", void 0);
|
|
394
|
+
__decorate([
|
|
395
|
+
Input()
|
|
396
|
+
], DataGridTableComponent.prototype, "onCellValueChanged", void 0);
|
|
397
|
+
__decorate([
|
|
398
|
+
Input({ alias: 'onUndo' })
|
|
399
|
+
], DataGridTableComponent.prototype, "onUndoInput", void 0);
|
|
400
|
+
__decorate([
|
|
401
|
+
Input({ alias: 'onRedo' })
|
|
402
|
+
], DataGridTableComponent.prototype, "onRedoInput", void 0);
|
|
403
|
+
__decorate([
|
|
404
|
+
Input({ alias: 'canUndo' })
|
|
405
|
+
], DataGridTableComponent.prototype, "canUndoInput", void 0);
|
|
406
|
+
__decorate([
|
|
407
|
+
Input({ alias: 'canRedo' })
|
|
408
|
+
], DataGridTableComponent.prototype, "canRedoInput", void 0);
|
|
409
|
+
__decorate([
|
|
410
|
+
Input({ alias: 'rowSelection' })
|
|
411
|
+
], DataGridTableComponent.prototype, "rowSelectionMode", void 0);
|
|
412
|
+
__decorate([
|
|
413
|
+
Input()
|
|
414
|
+
], DataGridTableComponent.prototype, "selectedRows", void 0);
|
|
415
|
+
__decorate([
|
|
416
|
+
Input()
|
|
417
|
+
], DataGridTableComponent.prototype, "onSelectionChange", void 0);
|
|
418
|
+
__decorate([
|
|
419
|
+
Input()
|
|
420
|
+
], DataGridTableComponent.prototype, "statusBar", void 0);
|
|
421
|
+
__decorate([
|
|
422
|
+
Input({ required: true })
|
|
423
|
+
], DataGridTableComponent.prototype, "filters", void 0);
|
|
424
|
+
__decorate([
|
|
425
|
+
Input({ required: true })
|
|
426
|
+
], DataGridTableComponent.prototype, "onFilterChange", void 0);
|
|
427
|
+
__decorate([
|
|
428
|
+
Input()
|
|
429
|
+
], DataGridTableComponent.prototype, "filterOptions", void 0);
|
|
430
|
+
__decorate([
|
|
431
|
+
Input()
|
|
432
|
+
], DataGridTableComponent.prototype, "loadingFilterOptions", void 0);
|
|
433
|
+
__decorate([
|
|
434
|
+
Input()
|
|
435
|
+
], DataGridTableComponent.prototype, "peopleSearch", void 0);
|
|
436
|
+
__decorate([
|
|
437
|
+
Input()
|
|
438
|
+
], DataGridTableComponent.prototype, "getUserByEmail", void 0);
|
|
439
|
+
__decorate([
|
|
440
|
+
Input({ alias: 'emptyState' })
|
|
441
|
+
], DataGridTableComponent.prototype, "emptyStateInput", void 0);
|
|
442
|
+
__decorate([
|
|
443
|
+
Input()
|
|
444
|
+
], DataGridTableComponent.prototype, "onCellError", void 0);
|
|
445
|
+
__decorate([
|
|
446
|
+
Input({ alias: 'aria-label' })
|
|
447
|
+
], DataGridTableComponent.prototype, "ariaLabelInput", void 0);
|
|
448
|
+
__decorate([
|
|
449
|
+
Input({ alias: 'aria-labelledby' })
|
|
450
|
+
], DataGridTableComponent.prototype, "ariaLabelledByInput", void 0);
|
|
451
|
+
__decorate([
|
|
452
|
+
Input()
|
|
453
|
+
], DataGridTableComponent.prototype, "showRowNumbers", void 0);
|
|
454
|
+
__decorate([
|
|
455
|
+
Input({ alias: 'currentPage' })
|
|
456
|
+
], DataGridTableComponent.prototype, "currentPageInput", void 0);
|
|
457
|
+
__decorate([
|
|
458
|
+
Input({ alias: 'pageSize' })
|
|
459
|
+
], DataGridTableComponent.prototype, "pageSizeInput", void 0);
|
|
303
460
|
DataGridTableComponent = __decorate([
|
|
304
461
|
Component({
|
|
305
462
|
selector: 'ogrid-primeng-datagrid-table',
|
|
@@ -315,13 +472,15 @@ DataGridTableComponent = __decorate([
|
|
|
315
472
|
PopoverCellEditorComponent,
|
|
316
473
|
],
|
|
317
474
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
475
|
+
encapsulation: ViewEncapsulation.None,
|
|
318
476
|
providers: [DataGridStateService],
|
|
319
477
|
template: `
|
|
320
|
-
<div
|
|
478
|
+
<div class="ogrid-root">
|
|
321
479
|
<div
|
|
322
480
|
#wrapper
|
|
323
481
|
tabindex="0"
|
|
324
482
|
role="region"
|
|
483
|
+
class="ogrid-scroll-wrapper"
|
|
325
484
|
[attr.aria-label]="resolvedAriaLabel()"
|
|
326
485
|
[attr.aria-labelledby]="ariaLabelledBy()"
|
|
327
486
|
[attr.data-empty]="showEmptyInGrid() ? 'true' : null"
|
|
@@ -329,31 +488,24 @@ DataGridTableComponent = __decorate([
|
|
|
329
488
|
[attr.data-freeze-rows]="freezeRows() != null && freezeRows()! >= 1 ? freezeRows() : null"
|
|
330
489
|
[attr.data-freeze-cols]="freezeCols() != null && freezeCols()! >= 1 ? freezeCols() : null"
|
|
331
490
|
[attr.data-overflow-x]="allowOverflowX() ? 'true' : 'false'"
|
|
332
|
-
[attr.data-has-selection]="rowSelectionMode
|
|
491
|
+
[attr.data-has-selection]="rowSelectionMode !== 'none' ? 'true' : null"
|
|
333
492
|
(contextmenu)="$event.preventDefault()"
|
|
334
493
|
(keydown)="onGridKeyDown($event)"
|
|
335
494
|
(mousedown)="onWrapperMouseDown($event)"
|
|
336
495
|
(scroll)="onWrapperScroll($event)"
|
|
337
|
-
style="flex:1;min-height:0;overflow:auto;outline:none;position:relative;font-size:13px;color:var(--ogrid-fg, #242424)"
|
|
338
496
|
[style.--data-table-column-count]="state().layout.totalColCount"
|
|
339
497
|
[style.--data-table-width]="tableWidthStyle()"
|
|
340
498
|
[style.--data-table-min-width]="tableMinWidthStyle()"
|
|
341
499
|
>
|
|
342
|
-
<div
|
|
343
|
-
<div [class.loading-dimmed]="isLoading() && items().length > 0"
|
|
344
|
-
<div #tableContainer
|
|
345
|
-
<table
|
|
346
|
-
|
|
347
|
-
>
|
|
348
|
-
<thead style="position:sticky;top:0;z-index:3;background:var(--ogrid-header-bg, #f5f5f5)">
|
|
500
|
+
<div class="ogrid-table-wrapper">
|
|
501
|
+
<div [class.loading-dimmed]="isLoading() && items().length > 0" class="ogrid-table-wrapper">
|
|
502
|
+
<div #tableContainer class="ogrid-table-wrapper">
|
|
503
|
+
<table class="ogrid-table">
|
|
504
|
+
<thead class="ogrid-thead">
|
|
349
505
|
@for (row of headerRows(); track $index; let rowIdx = $index) {
|
|
350
506
|
<tr>
|
|
351
507
|
@if (rowIdx === headerRows().length - 1 && hasCheckboxCol()) {
|
|
352
|
-
<th
|
|
353
|
-
scope="col"
|
|
354
|
-
rowSpan="1"
|
|
355
|
-
style="width:48px;min-width:48px;max-width:48px;padding:6px 4px;text-align:center;border-bottom:1px solid var(--ogrid-border, #e0e0e0)"
|
|
356
|
-
>
|
|
508
|
+
<th scope="col" rowSpan="1" class="ogrid-checkbox-header">
|
|
357
509
|
<input
|
|
358
510
|
type="checkbox"
|
|
359
511
|
[checked]="allSelected()"
|
|
@@ -367,23 +519,19 @@ DataGridTableComponent = __decorate([
|
|
|
367
519
|
<th [attr.rowSpan]="headerRows().length - 1"></th>
|
|
368
520
|
}
|
|
369
521
|
@if (rowIdx === headerRows().length - 1 && hasRowNumbersCol()) {
|
|
370
|
-
<th
|
|
371
|
-
scope="col"
|
|
372
|
-
rowSpan="1"
|
|
373
|
-
style="width:50px;min-width:50px;max-width:50px;padding:6px;text-align:center;font-weight:600;background:var(--ogrid-bg-subtle,#fafafa);color:var(--ogrid-text-secondary,#666);border-bottom:1px solid var(--ogrid-border,#e0e0e0);position:sticky;left:0;z-index:4"
|
|
374
|
-
>
|
|
522
|
+
<th scope="col" rowSpan="1" class="ogrid-row-number-header">
|
|
375
523
|
#
|
|
376
524
|
</th>
|
|
377
525
|
}
|
|
378
526
|
@if (rowIdx === 0 && rowIdx < headerRows().length - 1 && hasRowNumbersCol()) {
|
|
379
|
-
<th [attr.rowSpan]="headerRows().length - 1"
|
|
527
|
+
<th [attr.rowSpan]="headerRows().length - 1" class="ogrid-row-number-spacer"></th>
|
|
380
528
|
}
|
|
381
529
|
@for (cell of row; track $index; let cellIdx = $index) {
|
|
382
530
|
@if (cell.isGroup) {
|
|
383
531
|
<th
|
|
384
532
|
[attr.colSpan]="cell.colSpan"
|
|
385
533
|
scope="colgroup"
|
|
386
|
-
|
|
534
|
+
class="ogrid-column-group-header"
|
|
387
535
|
>
|
|
388
536
|
{{ cell.label }}
|
|
389
537
|
</th>
|
|
@@ -392,18 +540,20 @@ DataGridTableComponent = __decorate([
|
|
|
392
540
|
@let pinned = isPinned(col.columnId);
|
|
393
541
|
<th
|
|
394
542
|
scope="col"
|
|
543
|
+
class="ogrid-header-cell"
|
|
395
544
|
[attr.data-column-id]="col.columnId"
|
|
396
545
|
[attr.rowSpan]="headerRows().length > 1 && rowIdx < headerRows().length - 1 ? headerRows().length - rowIdx : null"
|
|
397
546
|
[class.ogrid-th-pinned-left]="pinned === 'left'"
|
|
398
547
|
[class.ogrid-th-pinned-right]="pinned === 'right'"
|
|
399
|
-
style="padding:6px 8px;text-align:left;font-weight:600;border-bottom:1px solid var(--ogrid-border, #e0e0e0);position:relative"
|
|
400
548
|
[style.min-width.px]="col.minWidth ?? defaultMinWidth"
|
|
401
549
|
[style.width.px]="getColumnWidth(col)"
|
|
402
550
|
[style.max-width.px]="getColumnWidth(col)"
|
|
551
|
+
[style.left.px]="pinned === 'left' ? getPinnedLeftOffset(col.columnId) : null"
|
|
552
|
+
[style.right.px]="pinned === 'right' ? getPinnedRightOffset(col.columnId) : null"
|
|
403
553
|
[style.cursor]="columnReorderService.isDragging() ? 'grabbing' : 'grab'"
|
|
404
554
|
(mousedown)="onHeaderMouseDown(col.columnId, $event)"
|
|
405
555
|
>
|
|
406
|
-
<div
|
|
556
|
+
<div class="ogrid-header-content">
|
|
407
557
|
<ogrid-primeng-column-header-filter
|
|
408
558
|
[columnKey]="col.columnId"
|
|
409
559
|
[columnName]="col.name"
|
|
@@ -424,18 +574,20 @@ DataGridTableComponent = __decorate([
|
|
|
424
574
|
[onDateChange]="getFilterConfig(col).onDateChange"
|
|
425
575
|
></ogrid-primeng-column-header-filter>
|
|
426
576
|
@let colPinState = getPinState(col.columnId);
|
|
577
|
+
@let colSortState = getSortState(col.columnId);
|
|
427
578
|
<column-header-menu
|
|
428
579
|
[columnId]="col.columnId"
|
|
429
|
-
[onPinLeft]="() => onPinColumn(col.columnId, 'left')"
|
|
430
|
-
[onPinRight]="() => onPinColumn(col.columnId, 'right')"
|
|
431
|
-
[onUnpin]="() => onUnpinColumn(col.columnId)"
|
|
432
580
|
[canPinLeft]="colPinState.canPinLeft"
|
|
433
581
|
[canPinRight]="colPinState.canPinRight"
|
|
434
582
|
[canUnpin]="colPinState.canUnpin"
|
|
583
|
+
[currentSort]="colSortState"
|
|
584
|
+
[isSortable]="col.sortable !== false"
|
|
585
|
+
[isResizable]="col.resizable !== false"
|
|
586
|
+
[handlers]="getColumnHeaderMenuHandlers(col.columnId)"
|
|
435
587
|
/>
|
|
436
588
|
</div>
|
|
437
589
|
<div
|
|
438
|
-
|
|
590
|
+
class="ogrid-resize-handle"
|
|
439
591
|
(mousedown)="onResizeStartPrimeng($event, col)"
|
|
440
592
|
[attr.aria-label]="'Resize ' + col.name"
|
|
441
593
|
></div>
|
|
@@ -453,7 +605,7 @@ DataGridTableComponent = __decorate([
|
|
|
453
605
|
}
|
|
454
606
|
@for (item of vsVisibleItems(); track trackByRowId($index, item); let localIdx = $index) {
|
|
455
607
|
@let rowIndex = vsStartIndex() + localIdx;
|
|
456
|
-
@let rowId = getRowIdInput(
|
|
608
|
+
@let rowId = getRowIdInput(item);
|
|
457
609
|
@let isSelected = selectedRowIds().has(rowId);
|
|
458
610
|
<tr
|
|
459
611
|
[attr.data-row-id]="rowId"
|
|
@@ -462,7 +614,7 @@ DataGridTableComponent = __decorate([
|
|
|
462
614
|
>
|
|
463
615
|
@if (hasCheckboxCol()) {
|
|
464
616
|
<td
|
|
465
|
-
|
|
617
|
+
class="ogrid-checkbox-cell"
|
|
466
618
|
[attr.data-row-index]="rowIndex"
|
|
467
619
|
[attr.data-col-index]="0"
|
|
468
620
|
(click)="$event.stopPropagation()"
|
|
@@ -476,21 +628,23 @@ DataGridTableComponent = __decorate([
|
|
|
476
628
|
</td>
|
|
477
629
|
}
|
|
478
630
|
@if (hasRowNumbersCol()) {
|
|
479
|
-
<td
|
|
480
|
-
|
|
481
|
-
>
|
|
631
|
+
<td class="ogrid-row-number-cell">
|
|
632
|
+
|
|
482
633
|
{{ rowNumberOffset() + rowIndex + 1 }}
|
|
483
634
|
</td>
|
|
484
635
|
}
|
|
485
636
|
@for (col of visibleCols(); track col.columnId; let colIdx = $index) {
|
|
486
637
|
@let pinned = isPinned(col.columnId);
|
|
487
638
|
<td
|
|
639
|
+
[attr.data-column-id]="col.columnId"
|
|
488
640
|
[class.ogrid-td-pinned-left]="pinned === 'left'"
|
|
489
641
|
[class.ogrid-td-pinned-right]="pinned === 'right'"
|
|
490
|
-
|
|
642
|
+
class="ogrid-data-cell"
|
|
491
643
|
[style.min-width.px]="col.minWidth ?? defaultMinWidth"
|
|
492
644
|
[style.width.px]="getColumnWidth(col)"
|
|
493
645
|
[style.max-width.px]="getColumnWidth(col)"
|
|
646
|
+
[style.left.px]="pinned === 'left' ? getPinnedLeftOffset(col.columnId) : null"
|
|
647
|
+
[style.right.px]="pinned === 'right' ? getPinnedRightOffset(col.columnId) : null"
|
|
494
648
|
[style.text-align]="col.type === 'numeric' ? 'right' : col.type === 'boolean' ? 'center' : null"
|
|
495
649
|
>
|
|
496
650
|
@if (isEditingCellInline(item, col)) {
|
|
@@ -512,7 +666,7 @@ DataGridTableComponent = __decorate([
|
|
|
512
666
|
[globalColIndex]="colIdx + colOffset()"
|
|
513
667
|
[displayValue]="getCellValueFn(item, col)"
|
|
514
668
|
[editorProps]="editorProps"
|
|
515
|
-
[onCancel]="
|
|
669
|
+
[onCancel]="cancelEditHandler"
|
|
516
670
|
></ogrid-primeng-popover-cell-editor>
|
|
517
671
|
} @else {
|
|
518
672
|
<div
|
|
@@ -521,7 +675,7 @@ DataGridTableComponent = __decorate([
|
|
|
521
675
|
(mousedown)="onCellMouseDown($event, rowIndex, colIdx + colOffset())"
|
|
522
676
|
(dblclick)="onCellDblClickPrimeng(item, col, rowIndex, colIdx)"
|
|
523
677
|
(contextmenu)="onCellContextMenu($event)"
|
|
524
|
-
|
|
678
|
+
class="ogrid-cell-content"
|
|
525
679
|
[style.cursor]="canEditCell(col, item) ? 'cell' : 'default'"
|
|
526
680
|
[style.background]="getCellBackground(rowIndex, colIdx)"
|
|
527
681
|
[style.outline]="isActiveCell(rowIndex, colIdx) ? '2px solid var(--ogrid-selection, #217346)' : null"
|
|
@@ -531,7 +685,7 @@ DataGridTableComponent = __decorate([
|
|
|
531
685
|
@if (canEditCell(col, item) && isSelectionEndCell(rowIndex, colIdx)) {
|
|
532
686
|
<div
|
|
533
687
|
(mousedown)="onFillHandleMouseDown($event)"
|
|
534
|
-
|
|
688
|
+
class="ogrid-fill-handle"
|
|
535
689
|
aria-label="Fill handle"
|
|
536
690
|
></div>
|
|
537
691
|
}
|
|
@@ -555,12 +709,15 @@ DataGridTableComponent = __decorate([
|
|
|
555
709
|
[cutRange]="state().interaction.cutRange"
|
|
556
710
|
[colOffset]="state().layout.colOffset"
|
|
557
711
|
[columnSizingVersion]="columnSizingVersion()"
|
|
712
|
+
[items]="items()"
|
|
713
|
+
[visibleColumns]="propsVisibleColumns()"
|
|
714
|
+
[columnOrder]="propsColumnOrder()"
|
|
558
715
|
></ogrid-marching-ants-overlay>
|
|
559
716
|
|
|
560
717
|
@if (showEmptyInGrid() && emptyState()) {
|
|
561
|
-
<div
|
|
718
|
+
<div class="ogrid-empty-container">
|
|
562
719
|
<div>
|
|
563
|
-
<div
|
|
720
|
+
<div class="ogrid-empty-title">No results found</div>
|
|
564
721
|
<ogrid-empty-state
|
|
565
722
|
[message]="emptyState()?.message"
|
|
566
723
|
[hasActiveFilters]="emptyState()?.hasActiveFilters ?? false"
|
|
@@ -586,6 +743,7 @@ DataGridTableComponent = __decorate([
|
|
|
586
743
|
[hasSelection]="hasCellSelection()"
|
|
587
744
|
[canUndoProp]="canUndo()"
|
|
588
745
|
[canRedoProp]="canRedo()"
|
|
746
|
+
[classNames]="contextMenuClasses"
|
|
589
747
|
(copy)="handleCopy()"
|
|
590
748
|
(cut)="handleCut()"
|
|
591
749
|
(paste)="handlePaste()"
|
|
@@ -609,18 +767,229 @@ DataGridTableComponent = __decorate([
|
|
|
609
767
|
}
|
|
610
768
|
|
|
611
769
|
@if (isLoading()) {
|
|
612
|
-
<div
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
>
|
|
616
|
-
<div style="display:flex;align-items:center;gap:8px;color:var(--ogrid-fg, #242424)">
|
|
617
|
-
<span style="font-size:14px">{{ loadingMessage() }}</span>
|
|
770
|
+
<div class="ogrid-loading-overlay" aria-live="polite">
|
|
771
|
+
<div class="ogrid-loading-content">
|
|
772
|
+
<span class="ogrid-loading-text">{{ loadingMessage() }}</span>
|
|
618
773
|
</div>
|
|
619
774
|
</div>
|
|
620
775
|
}
|
|
621
776
|
</div>
|
|
622
777
|
`,
|
|
623
778
|
styles: [`
|
|
779
|
+
/* ─── OGrid Theme Variables ─── */
|
|
780
|
+
:root {
|
|
781
|
+
--ogrid-bg: #ffffff;
|
|
782
|
+
--ogrid-fg: rgba(0, 0, 0, 0.87);
|
|
783
|
+
--ogrid-fg-secondary: rgba(0, 0, 0, 0.6);
|
|
784
|
+
--ogrid-fg-muted: rgba(0, 0, 0, 0.5);
|
|
785
|
+
--ogrid-border: rgba(0, 0, 0, 0.12);
|
|
786
|
+
--ogrid-header-bg: rgba(0, 0, 0, 0.04);
|
|
787
|
+
--ogrid-hover-bg: rgba(0, 0, 0, 0.04);
|
|
788
|
+
--ogrid-selected-row-bg: #e6f0fb;
|
|
789
|
+
--ogrid-active-cell-bg: rgba(0, 0, 0, 0.02);
|
|
790
|
+
--ogrid-range-bg: rgba(33, 115, 70, 0.12);
|
|
791
|
+
--ogrid-accent: #0078d4;
|
|
792
|
+
--ogrid-selection-color: #217346;
|
|
793
|
+
--ogrid-loading-overlay: rgba(255, 255, 255, 0.7);
|
|
794
|
+
}
|
|
795
|
+
@media (prefers-color-scheme: dark) {
|
|
796
|
+
:root:not([data-theme="light"]) {
|
|
797
|
+
--ogrid-bg: #1e1e1e;
|
|
798
|
+
--ogrid-fg: rgba(255, 255, 255, 0.87);
|
|
799
|
+
--ogrid-fg-secondary: rgba(255, 255, 255, 0.6);
|
|
800
|
+
--ogrid-fg-muted: rgba(255, 255, 255, 0.5);
|
|
801
|
+
--ogrid-border: rgba(255, 255, 255, 0.12);
|
|
802
|
+
--ogrid-header-bg: rgba(255, 255, 255, 0.06);
|
|
803
|
+
--ogrid-hover-bg: rgba(255, 255, 255, 0.08);
|
|
804
|
+
--ogrid-selected-row-bg: #1a3a5c;
|
|
805
|
+
--ogrid-active-cell-bg: rgba(255, 255, 255, 0.06);
|
|
806
|
+
--ogrid-range-bg: rgba(46, 160, 67, 0.15);
|
|
807
|
+
--ogrid-accent: #4da6ff;
|
|
808
|
+
--ogrid-selection-color: #2ea043;
|
|
809
|
+
--ogrid-loading-overlay: rgba(0, 0, 0, 0.7);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
[data-theme="dark"] {
|
|
813
|
+
--ogrid-bg: #1e1e1e;
|
|
814
|
+
--ogrid-fg: rgba(255, 255, 255, 0.87);
|
|
815
|
+
--ogrid-fg-secondary: rgba(255, 255, 255, 0.6);
|
|
816
|
+
--ogrid-fg-muted: rgba(255, 255, 255, 0.5);
|
|
817
|
+
--ogrid-border: rgba(255, 255, 255, 0.12);
|
|
818
|
+
--ogrid-header-bg: rgba(255, 255, 255, 0.06);
|
|
819
|
+
--ogrid-hover-bg: rgba(255, 255, 255, 0.08);
|
|
820
|
+
--ogrid-selected-row-bg: #1a3a5c;
|
|
821
|
+
--ogrid-active-cell-bg: rgba(255, 255, 255, 0.06);
|
|
822
|
+
--ogrid-range-bg: rgba(46, 160, 67, 0.15);
|
|
823
|
+
--ogrid-accent: #4da6ff;
|
|
824
|
+
--ogrid-selection-color: #2ea043;
|
|
825
|
+
--ogrid-loading-overlay: rgba(0, 0, 0, 0.7);
|
|
826
|
+
}
|
|
827
|
+
:host { display: block; }
|
|
828
|
+
.ogrid-root {
|
|
829
|
+
position: relative;
|
|
830
|
+
flex: 1;
|
|
831
|
+
min-height: 0;
|
|
832
|
+
display: flex;
|
|
833
|
+
flex-direction: column;
|
|
834
|
+
overflow: hidden;
|
|
835
|
+
}
|
|
836
|
+
.ogrid-scroll-wrapper {
|
|
837
|
+
flex: 1;
|
|
838
|
+
min-height: 0;
|
|
839
|
+
overflow: auto;
|
|
840
|
+
position: relative;
|
|
841
|
+
background: var(--ogrid-bg, #ffffff);
|
|
842
|
+
color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
|
|
843
|
+
}
|
|
844
|
+
.ogrid-table-wrapper {
|
|
845
|
+
position: relative;
|
|
846
|
+
}
|
|
847
|
+
.ogrid-table {
|
|
848
|
+
width: var(--data-table-width, 100%);
|
|
849
|
+
min-width: var(--data-table-min-width, 100%);
|
|
850
|
+
border-collapse: collapse;
|
|
851
|
+
table-layout: fixed;
|
|
852
|
+
}
|
|
853
|
+
.ogrid-thead {
|
|
854
|
+
z-index: 3;
|
|
855
|
+
background: var(--ogrid-header-bg, #f5f5f5);
|
|
856
|
+
position: sticky;
|
|
857
|
+
top: 0;
|
|
858
|
+
}
|
|
859
|
+
.ogrid-checkbox-header {
|
|
860
|
+
width: 48px;
|
|
861
|
+
min-width: 48px;
|
|
862
|
+
max-width: 48px;
|
|
863
|
+
text-align: center;
|
|
864
|
+
background: var(--ogrid-header-bg, #f5f5f5);
|
|
865
|
+
border-bottom: 2px solid var(--ogrid-border, #e0e0e0);
|
|
866
|
+
position: sticky;
|
|
867
|
+
top: 0;
|
|
868
|
+
z-index: 3;
|
|
869
|
+
}
|
|
870
|
+
.ogrid-row-number-header {
|
|
871
|
+
width: 50px;
|
|
872
|
+
min-width: 50px;
|
|
873
|
+
max-width: 50px;
|
|
874
|
+
text-align: center;
|
|
875
|
+
font-weight: 600;
|
|
876
|
+
background: var(--ogrid-header-bg, #f5f5f5);
|
|
877
|
+
border-bottom: 2px solid var(--ogrid-border, #e0e0e0);
|
|
878
|
+
position: sticky;
|
|
879
|
+
top: 0;
|
|
880
|
+
z-index: 3;
|
|
881
|
+
}
|
|
882
|
+
.ogrid-row-number-spacer {
|
|
883
|
+
width: 50px;
|
|
884
|
+
min-width: 50px;
|
|
885
|
+
max-width: 50px;
|
|
886
|
+
background: var(--ogrid-header-bg, #f5f5f5);
|
|
887
|
+
}
|
|
888
|
+
.ogrid-column-group-header {
|
|
889
|
+
text-align: center;
|
|
890
|
+
font-weight: 600;
|
|
891
|
+
background: var(--ogrid-header-bg, #f5f5f5);
|
|
892
|
+
border-bottom: 2px solid var(--ogrid-border, #e0e0e0);
|
|
893
|
+
padding: 6px 10px;
|
|
894
|
+
}
|
|
895
|
+
.ogrid-header-cell {
|
|
896
|
+
background: var(--ogrid-header-bg, #f5f5f5);
|
|
897
|
+
border-bottom: 2px solid var(--ogrid-border, #e0e0e0);
|
|
898
|
+
padding: 0;
|
|
899
|
+
position: relative;
|
|
900
|
+
user-select: none;
|
|
901
|
+
}
|
|
902
|
+
.ogrid-header-content {
|
|
903
|
+
display: flex;
|
|
904
|
+
align-items: center;
|
|
905
|
+
gap: 4px;
|
|
906
|
+
padding: 6px 10px;
|
|
907
|
+
}
|
|
908
|
+
.ogrid-resize-handle {
|
|
909
|
+
position: absolute;
|
|
910
|
+
top: 0;
|
|
911
|
+
right: 0;
|
|
912
|
+
bottom: 0;
|
|
913
|
+
width: 4px;
|
|
914
|
+
cursor: col-resize;
|
|
915
|
+
}
|
|
916
|
+
.ogrid-checkbox-cell {
|
|
917
|
+
width: 48px;
|
|
918
|
+
min-width: 48px;
|
|
919
|
+
max-width: 48px;
|
|
920
|
+
padding: 6px 4px;
|
|
921
|
+
text-align: center;
|
|
922
|
+
border-bottom: 1px solid var(--ogrid-border, #f0f0f0);
|
|
923
|
+
}
|
|
924
|
+
.ogrid-row-number-cell {
|
|
925
|
+
width: 50px;
|
|
926
|
+
min-width: 50px;
|
|
927
|
+
max-width: 50px;
|
|
928
|
+
padding: 6px;
|
|
929
|
+
text-align: center;
|
|
930
|
+
font-weight: 600;
|
|
931
|
+
font-variant-numeric: tabular-nums;
|
|
932
|
+
color: var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.6));
|
|
933
|
+
background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04));
|
|
934
|
+
border-bottom: 1px solid var(--ogrid-border, #f0f0f0);
|
|
935
|
+
position: sticky;
|
|
936
|
+
left: 0;
|
|
937
|
+
z-index: 3;
|
|
938
|
+
}
|
|
939
|
+
.ogrid-data-cell {
|
|
940
|
+
padding: 0;
|
|
941
|
+
border-bottom: 1px solid var(--ogrid-border, #f0f0f0);
|
|
942
|
+
position: relative;
|
|
943
|
+
}
|
|
944
|
+
.ogrid-cell-content {
|
|
945
|
+
padding: 6px 10px;
|
|
946
|
+
min-height: 20px;
|
|
947
|
+
cursor: default;
|
|
948
|
+
overflow: hidden;
|
|
949
|
+
text-overflow: ellipsis;
|
|
950
|
+
white-space: nowrap;
|
|
951
|
+
}
|
|
952
|
+
.ogrid-scroll-wrapper [data-drag-range] { background: var(--ogrid-range-bg, rgba(33, 115, 70, 0.12)) !important; }
|
|
953
|
+
.ogrid-fill-handle {
|
|
954
|
+
position: absolute;
|
|
955
|
+
bottom: -3px;
|
|
956
|
+
right: -3px;
|
|
957
|
+
width: 7px;
|
|
958
|
+
height: 7px;
|
|
959
|
+
background: var(--ogrid-selection, #217346);
|
|
960
|
+
cursor: crosshair;
|
|
961
|
+
z-index: 2;
|
|
962
|
+
}
|
|
963
|
+
.ogrid-empty-container {
|
|
964
|
+
display: flex;
|
|
965
|
+
align-items: center;
|
|
966
|
+
justify-content: center;
|
|
967
|
+
padding: 48px 24px;
|
|
968
|
+
text-align: center;
|
|
969
|
+
color: var(--ogrid-fg-muted, rgba(0, 0, 0, 0.5));
|
|
970
|
+
}
|
|
971
|
+
.ogrid-empty-title {
|
|
972
|
+
font-weight: 600;
|
|
973
|
+
margin-bottom: 8px;
|
|
974
|
+
}
|
|
975
|
+
.ogrid-loading-overlay {
|
|
976
|
+
position: absolute;
|
|
977
|
+
inset: 0;
|
|
978
|
+
display: flex;
|
|
979
|
+
align-items: center;
|
|
980
|
+
justify-content: center;
|
|
981
|
+
background: var(--ogrid-loading-overlay, rgba(255, 255, 255, 0.7));
|
|
982
|
+
z-index: 10;
|
|
983
|
+
}
|
|
984
|
+
.ogrid-loading-content {
|
|
985
|
+
display: flex;
|
|
986
|
+
align-items: center;
|
|
987
|
+
gap: 8px;
|
|
988
|
+
color: var(--ogrid-fg, #242424);
|
|
989
|
+
}
|
|
990
|
+
.ogrid-loading-text {
|
|
991
|
+
font-size: 14px;
|
|
992
|
+
}
|
|
624
993
|
.loading-dimmed {
|
|
625
994
|
opacity: 0.5;
|
|
626
995
|
pointer-events: none;
|
|
@@ -637,6 +1006,7 @@ DataGridTableComponent = __decorate([
|
|
|
637
1006
|
}
|
|
638
1007
|
.ogrid-th-pinned-left {
|
|
639
1008
|
position: sticky;
|
|
1009
|
+
top: 0;
|
|
640
1010
|
left: 0;
|
|
641
1011
|
z-index: 10;
|
|
642
1012
|
background: var(--ogrid-header-bg, #f5f5f5);
|
|
@@ -644,6 +1014,7 @@ DataGridTableComponent = __decorate([
|
|
|
644
1014
|
}
|
|
645
1015
|
.ogrid-th-pinned-right {
|
|
646
1016
|
position: sticky;
|
|
1017
|
+
top: 0;
|
|
647
1018
|
right: 0;
|
|
648
1019
|
z-index: 10;
|
|
649
1020
|
background: var(--ogrid-header-bg, #f5f5f5);
|
|
@@ -663,6 +1034,97 @@ DataGridTableComponent = __decorate([
|
|
|
663
1034
|
background: var(--ogrid-bg, #fff);
|
|
664
1035
|
border-right: 2px solid var(--ogrid-primary, #217346);
|
|
665
1036
|
}
|
|
1037
|
+
::ng-deep th:focus-visible,
|
|
1038
|
+
::ng-deep td:focus-visible {
|
|
1039
|
+
outline: 2px solid var(--primary-color, #6366f1);
|
|
1040
|
+
outline-offset: -2px;
|
|
1041
|
+
z-index: 11;
|
|
1042
|
+
}
|
|
1043
|
+
::ng-deep .p-button:focus-visible,
|
|
1044
|
+
::ng-deep button:focus-visible {
|
|
1045
|
+
outline: 2px solid var(--primary-color, #6366f1);
|
|
1046
|
+
outline-offset: 2px;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
/* Context menu */
|
|
1050
|
+
.ogrid-context-menu {
|
|
1051
|
+
position: fixed;
|
|
1052
|
+
z-index: 10000;
|
|
1053
|
+
min-width: 160px;
|
|
1054
|
+
padding: 4px 0;
|
|
1055
|
+
background: var(--ogrid-bg, #fff);
|
|
1056
|
+
border: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
|
|
1057
|
+
border-radius: 6px;
|
|
1058
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
1059
|
+
}
|
|
1060
|
+
.ogrid-context-menu-item {
|
|
1061
|
+
display: flex;
|
|
1062
|
+
align-items: center;
|
|
1063
|
+
justify-content: space-between;
|
|
1064
|
+
gap: 24px;
|
|
1065
|
+
width: 100%;
|
|
1066
|
+
padding: 6px 12px;
|
|
1067
|
+
border: none;
|
|
1068
|
+
background: none;
|
|
1069
|
+
font-size: 13px;
|
|
1070
|
+
text-align: left;
|
|
1071
|
+
cursor: pointer;
|
|
1072
|
+
color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
|
|
1073
|
+
}
|
|
1074
|
+
.ogrid-context-menu-item:hover:not(:disabled) {
|
|
1075
|
+
background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04));
|
|
1076
|
+
}
|
|
1077
|
+
.ogrid-context-menu-item:disabled {
|
|
1078
|
+
opacity: 0.5;
|
|
1079
|
+
cursor: not-allowed;
|
|
1080
|
+
}
|
|
1081
|
+
.ogrid-context-menu-item-label {
|
|
1082
|
+
flex: 1;
|
|
1083
|
+
}
|
|
1084
|
+
.ogrid-context-menu-item-shortcut {
|
|
1085
|
+
color: var(--ogrid-fg-muted, rgba(0, 0, 0, 0.5));
|
|
1086
|
+
font-size: 0.85em;
|
|
1087
|
+
}
|
|
1088
|
+
.ogrid-context-menu-divider {
|
|
1089
|
+
height: 1px;
|
|
1090
|
+
margin: 4px 0;
|
|
1091
|
+
background: var(--ogrid-border, rgba(0, 0, 0, 0.12));
|
|
1092
|
+
}
|
|
1093
|
+
::ng-deep .p-checkbox:focus-visible {
|
|
1094
|
+
outline: 2px solid var(--primary-color, #6366f1);
|
|
1095
|
+
outline-offset: 2px;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
/* PrimeNG Menu popup overrides — must use !important to win over PrimeNG's CSS-variable-based defaults */
|
|
1099
|
+
.p-menu {
|
|
1100
|
+
background: var(--ogrid-bg, #ffffff) !important;
|
|
1101
|
+
color: var(--ogrid-fg, rgba(0, 0, 0, 0.87)) !important;
|
|
1102
|
+
border: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)) !important;
|
|
1103
|
+
border-radius: 4px !important;
|
|
1104
|
+
padding: 4px 0 !important;
|
|
1105
|
+
}
|
|
1106
|
+
.p-menu-overlay {
|
|
1107
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--ogrid-border, rgba(0, 0, 0, 0.12)) !important;
|
|
1108
|
+
}
|
|
1109
|
+
.p-menu-item-content {
|
|
1110
|
+
color: var(--ogrid-fg, rgba(0, 0, 0, 0.87)) !important;
|
|
1111
|
+
}
|
|
1112
|
+
.p-menu-item-link {
|
|
1113
|
+
color: var(--ogrid-fg, rgba(0, 0, 0, 0.87)) !important;
|
|
1114
|
+
padding: 6px 12px !important;
|
|
1115
|
+
}
|
|
1116
|
+
.p-menu-item-label {
|
|
1117
|
+
color: var(--ogrid-fg, rgba(0, 0, 0, 0.87)) !important;
|
|
1118
|
+
font-size: 0.875rem !important;
|
|
1119
|
+
}
|
|
1120
|
+
.p-menu-item:not(.p-disabled) .p-menu-item-content:hover {
|
|
1121
|
+
background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04)) !important;
|
|
1122
|
+
color: var(--ogrid-fg, rgba(0, 0, 0, 0.87)) !important;
|
|
1123
|
+
}
|
|
1124
|
+
.p-menu-separator {
|
|
1125
|
+
border-color: var(--ogrid-border, rgba(0, 0, 0, 0.12)) !important;
|
|
1126
|
+
margin: 4px 0 !important;
|
|
1127
|
+
}
|
|
666
1128
|
`],
|
|
667
1129
|
})
|
|
668
1130
|
], DataGridTableComponent);
|