@alaarab/ogrid-angular-material 2.1.3 → 2.1.5

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.
@@ -1,551 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, ViewChild, signal } from '@angular/core';
8
- import { BaseDataGridTableComponent, DataGridStateService, ColumnReorderService, VirtualScrollService, MarchingAntsOverlayComponent, StatusBarComponent, GridContextMenuComponent, EmptyStateComponent, CHECKBOX_COLUMN_WIDTH, ROW_NUMBER_COLUMN_WIDTH, OGRID_THEME_VARS_CSS, } from '@alaarab/ogrid-angular';
9
- import { ColumnHeaderFilterComponent } from '../column-header-filter/column-header-filter.component';
10
- import { ColumnHeaderMenuComponent } from '../column-header-menu/column-header-menu.component';
11
- import { InlineCellEditorComponent } from './inline-cell-editor.component';
12
- import { PopoverCellEditorComponent } from './popover-cell-editor.component';
13
- /**
14
- * DataGridTable component using native HTML table with Material Design-inspired styling.
15
- * Standalone component — this is the workhorse of the grid.
16
- */
17
- let DataGridTableComponent = class DataGridTableComponent extends BaseDataGridTableComponent {
18
- set propsInput(value) {
19
- this.propsSignal.set(value);
20
- }
21
- constructor() {
22
- super();
23
- this.propsSignal = signal(undefined);
24
- this.initBase();
25
- }
26
- getProps() {
27
- return this.propsSignal();
28
- }
29
- getWrapperRef() {
30
- return this.wrapperRef;
31
- }
32
- getTableContainerRef() {
33
- return this.tableContainerRef;
34
- }
35
- };
36
- __decorate([
37
- Input({ required: true, alias: 'props' })
38
- ], DataGridTableComponent.prototype, "propsInput", null);
39
- __decorate([
40
- ViewChild('wrapperEl')
41
- ], DataGridTableComponent.prototype, "wrapperRef", void 0);
42
- __decorate([
43
- ViewChild('tableContainerElRef')
44
- ], DataGridTableComponent.prototype, "tableContainerRef", void 0);
45
- DataGridTableComponent = __decorate([
46
- Component({
47
- selector: 'ogrid-datagrid-table',
48
- standalone: true,
49
- changeDetection: ChangeDetectionStrategy.OnPush,
50
- encapsulation: ViewEncapsulation.None,
51
- imports: [ColumnHeaderFilterComponent, ColumnHeaderMenuComponent, StatusBarComponent, GridContextMenuComponent, MarchingAntsOverlayComponent, EmptyStateComponent, InlineCellEditorComponent, PopoverCellEditorComponent],
52
- providers: [DataGridStateService, ColumnReorderService, VirtualScrollService],
53
- template: `
54
- <div class="ogrid-datagrid-root">
55
- <div
56
- #wrapperEl
57
- class="ogrid-datagrid-wrapper"
58
- [class.ogrid-datagrid-wrapper--fit]="layoutModeFit()"
59
- [class.ogrid-datagrid-wrapper--overflow-x]="allowOverflowX()"
60
- [class.ogrid-datagrid-wrapper--loading-empty]="isLoading() && items().length === 0"
61
- [style.--ogrid-row-height]="rowHeightCssVar()"
62
- tabindex="0"
63
- role="region"
64
- [attr.aria-label]="ariaLabel()"
65
- [attr.aria-labelledby]="ariaLabelledBy()"
66
- (mousedown)="onWrapperMouseDown($event)"
67
- (keydown)="onGridKeyDown($event)"
68
- (scroll)="onWrapperScroll($event)"
69
- (contextmenu)="$event.preventDefault()"
70
- [attr.data-overflow-x]="allowOverflowX() ? 'true' : 'false'"
71
- >
72
- <div class="ogrid-datagrid-scroll-wrapper">
73
- <div [style.minWidth.px]="allowOverflowX() ? minTableWidth() : undefined">
74
- <div [class.ogrid-datagrid-table-wrapper--loading]="isLoading() && items().length > 0" #tableContainerElRef>
75
- <table class="ogrid-datagrid-table" [style.minWidth.px]="minTableWidth()"
76
- >
77
- <thead [class]="stickyHeader() ? 'ogrid-datagrid-thead ogrid-sticky-header' : 'ogrid-datagrid-thead'">
78
- @for (row of headerRows(); track $index; let rowIdx = $index) {
79
- <tr class="ogrid-datagrid-header-row">
80
- @if (rowIdx === headerRows().length - 1 && hasCheckboxCol()) {
81
- <th class="ogrid-datagrid-th ogrid-datagrid-checkbox-col" [attr.rowSpan]="headerRows().length > 1 ? 1 : null">
82
- <div class="ogrid-datagrid-checkbox-wrapper">
83
- <input
84
- type="checkbox"
85
- [checked]="allSelected()"
86
- [indeterminate]="someSelected()"
87
- (change)="onSelectAllChange($event)"
88
- aria-label="Select all rows"
89
- />
90
- </div>
91
- </th>
92
- }
93
- @if (rowIdx === 0 && rowIdx < headerRows().length - 1 && hasCheckboxCol()) {
94
- <th [attr.rowSpan]="headerRows().length - 1" class="ogrid-datagrid-th" style="width: 48px; min-width: 48px; padding: 0;"></th>
95
- }
96
- @if (rowIdx === headerRows().length - 1 && hasRowNumbersCol()) {
97
- <th class="ogrid-datagrid-th ogrid-row-number-header" [attr.rowSpan]="headerRows().length > 1 ? 1 : null">
98
- <div class="ogrid-row-number-header-content">#</div>
99
- </th>
100
- }
101
- @if (rowIdx === 0 && rowIdx < headerRows().length - 1 && hasRowNumbersCol()) {
102
- <th [attr.rowSpan]="headerRows().length - 1" class="ogrid-datagrid-th" [style.width.px]="50" [style.min-width.px]="50" style="padding: 0;"></th>
103
- }
104
- @for (cell of row; track cell.columnDef?.columnId ?? $index; let cellIdx = $index) {
105
- @if (cell.isGroup) {
106
- <th [attr.colSpan]="cell.colSpan" scope="colgroup" class="ogrid-datagrid-th ogrid-datagrid-group-header">
107
- {{ cell.label }}
108
- </th>
109
- } @else {
110
- @let col = asColumnDef(cell.columnDef);
111
- @let colW = getColumnWidth(col);
112
- @let pinned = isPinned(col.columnId);
113
- @let pinnedLeft = pinned === 'left';
114
- @let pinnedRight = pinned === 'right';
115
- @let sortState = getSortState(col.columnId);
116
- @let ariaSort = sortState === 'asc' ? 'ascending' : sortState === 'desc' ? 'descending' : null;
117
- @let config = getFilterConfig(col);
118
- <th scope="col"
119
- class="ogrid-datagrid-th"
120
- [class.ogrid-datagrid-th--pinned-left]="pinnedLeft"
121
- [class.ogrid-datagrid-th--pinned-right]="pinnedRight"
122
- [attr.rowSpan]="headerRows().length > 1 ? headerRows().length - rowIdx : null"
123
- [attr.data-column-id]="col.columnId"
124
- [attr.aria-sort]="ariaSort"
125
- [style.minWidth.px]="getEffectiveMinWidth(col)"
126
- [style.width.px]="colW"
127
- [style.maxWidth.px]="colW"
128
- [style.cursor]="columnReorderService.isDragging() ? 'grabbing' : 'grab'"
129
- [style.left.px]="pinnedLeft ? getPinnedLeftOffset(col.columnId) : null"
130
- [style.right.px]="pinnedRight ? getPinnedRightOffset(col.columnId) : null"
131
- (mousedown)="onHeaderMouseDown(col.columnId, $event)"
132
- >
133
- <div style="display:flex;align-items:center;gap:4px;">
134
- <ogrid-column-header-filter
135
- [columnKey]="col.columnId"
136
- [columnName]="col.name"
137
- [filterType]="config.filterType"
138
- [isSorted]="config.isSorted"
139
- [isSortedDescending]="config.isSortedDescending"
140
- [onSort]="config.onSort"
141
- [selectedValues]="config.selectedValues"
142
- [onFilterChange]="config.onFilterChange"
143
- [options]="config.options"
144
- [isLoadingOptions]="config.isLoadingOptions ?? false"
145
- [textValue]="config.textValue ?? ''"
146
- [onTextChange]="config.onTextChange"
147
- [selectedUser]="config.selectedUser"
148
- [onUserChange]="config.onUserChange"
149
- [peopleSearch]="config.peopleSearch"
150
- [dateValue]="config.dateValue"
151
- [onDateChange]="config.onDateChange"
152
- />
153
- @let pinState = getPinState(col.columnId);
154
- <column-header-menu
155
- [columnId]="col.columnId"
156
- [canPinLeft]="pinState.canPinLeft"
157
- [canPinRight]="pinState.canPinRight"
158
- [canUnpin]="pinState.canUnpin"
159
- [currentSort]="sortState"
160
- [isSortable]="col.sortable !== false"
161
- [isResizable]="col.resizable !== false"
162
- [handlers]="getColumnMenuHandlersMemoized(col.columnId)"
163
- />
164
- </div>
165
- <div class="ogrid-datagrid-resize-handle" (mousedown)="onResizeStart($event, col)"></div>
166
- </th>
167
- }
168
- }
169
- </tr>
170
- }
171
- </thead>
172
- @if (!showEmptyInGrid()) {
173
- <tbody>
174
- @if (vsEnabled() && vsTopSpacerHeight() > 0) {
175
- <tr class="ogrid-datagrid-vs-spacer" [style.height.px]="vsTopSpacerHeight()"></tr>
176
- }
177
- @for (item of vsVisibleItems(); track getRowId()(item); let localIdx = $index) {
178
- @let rowIndex = vsStartIndex() + localIdx;
179
- @let rowId = getRowId()(item);
180
- @let isSelected = selectedRowIds().has(rowId);
181
- <tr
182
- class="ogrid-datagrid-row"
183
- [class.ogrid-datagrid-row--selected]="isSelected"
184
- [attr.data-row-id]="rowId"
185
- (click)="onRowClick($event, rowId)"
186
- >
187
- @if (hasCheckboxCol()) {
188
- <td class="ogrid-datagrid-td ogrid-datagrid-checkbox-col">
189
- <div
190
- class="ogrid-datagrid-checkbox-wrapper"
191
- [attr.data-row-index]="rowIndex"
192
- [attr.data-col-index]="0"
193
- (click)="$event.stopPropagation()"
194
- >
195
- <input
196
- type="checkbox"
197
- [checked]="isSelected"
198
- (change)="onRowCheckboxChange(rowId, $event, rowIndex)"
199
- [attr.aria-label]="'Select row ' + (rowIndex + 1)"
200
- />
201
- </div>
202
- </td>
203
- }
204
- @if (hasRowNumbersCol()) {
205
- <td class="ogrid-datagrid-td ogrid-row-number-cell">
206
- <div class="ogrid-row-number-cell-content">
207
- {{ rowNumberOffset() + rowIndex + 1 }}
208
- </div>
209
- </td>
210
- }
211
- @for (colLayout of columnLayouts(); track colLayout.col.columnId; let colIdx = $index) {
212
- <td
213
- class="ogrid-datagrid-td"
214
- [attr.data-column-id]="colLayout.col.columnId"
215
- [class.ogrid-datagrid-td--pinned-left]="colLayout.pinnedLeft"
216
- [class.ogrid-datagrid-td--pinned-right]="colLayout.pinnedRight"
217
- [style.minWidth.px]="colLayout.minWidth"
218
- [style.width.px]="colLayout.width"
219
- [style.maxWidth.px]="colLayout.width"
220
- [style.left.px]="colLayout.pinnedLeft ? getPinnedLeftOffset(colLayout.col.columnId) : null"
221
- [style.right.px]="colLayout.pinnedRight ? getPinnedRightOffset(colLayout.col.columnId) : null"
222
- >
223
- @let descriptor = getCellDescriptor(item, colLayout.col, rowIndex, colIdx);
224
- @if (descriptor.mode === 'editing-inline') {
225
- <div class="ogrid-editing-cell">
226
- <ogrid-mat-inline-cell-editor
227
- [value]="descriptor.value"
228
- [item]="item"
229
- [column]="colLayout.col"
230
- [rowIndex]="rowIndex"
231
- [editorType]="descriptor.editorType ?? 'text'"
232
- (commit)="commitEdit(item, colLayout.col.columnId, descriptor.value, $event, rowIndex, descriptor.globalColIndex)"
233
- (cancel)="cancelEdit()"
234
- ></ogrid-mat-inline-cell-editor>
235
- </div>
236
- } @else if (descriptor.mode === 'editing-popover') {
237
- @let editorProps = buildPopoverEditorProps(item, colLayout.col, descriptor);
238
- <ogrid-mat-popover-cell-editor
239
- [item]="item"
240
- [column]="colLayout.col"
241
- [rowIndex]="rowIndex"
242
- [globalColIndex]="descriptor.globalColIndex"
243
- [displayValue]="descriptor.displayValue"
244
- [editorProps]="editorProps"
245
- [onCancel]="cancelEdit.bind(this)"
246
- ></ogrid-mat-popover-cell-editor>
247
- } @else {
248
- @let content = resolveCellContent(colLayout.col, item, descriptor.displayValue);
249
- @let cellStyle = resolveCellStyleFn(colLayout.col, item);
250
- <div
251
- class="ogrid-datagrid-cell"
252
- [class.ogrid-datagrid-cell--active]="descriptor.isActive && !descriptor.isInRange"
253
- [class.ogrid-datagrid-cell--in-range]="descriptor.isInRange"
254
- [class.ogrid-datagrid-cell--in-cut-range]="descriptor.isInCutRange"
255
- [class.ogrid-datagrid-cell--editable]="descriptor.canEditAny"
256
- [class.ogrid-datagrid-cell--numeric]="colLayout.col.type === 'numeric'"
257
- [class.ogrid-datagrid-cell--boolean]="colLayout.col.type === 'boolean'"
258
- [attr.data-row-index]="rowIndex"
259
- [attr.data-col-index]="descriptor.globalColIndex"
260
- [attr.data-in-range]="descriptor.isInRange ? 'true' : null"
261
- [attr.tabindex]="descriptor.isActive ? 0 : -1"
262
- (mousedown)="onCellMouseDown($event, rowIndex, descriptor.globalColIndex)"
263
- (click)="onCellClick(rowIndex, descriptor.globalColIndex)"
264
- (contextmenu)="onCellContextMenu($event)"
265
- (dblclick)="descriptor.canEditAny ? onCellDblClick(descriptor.rowId, colLayout.col.columnId) : null"
266
- [attr.role]="descriptor.canEditAny ? 'button' : null"
267
- [style]="cellStyle ?? undefined"
268
- >
269
- {{ content }}
270
- @if (descriptor.canEditAny && descriptor.isSelectionEndCell) {
271
- <div
272
- class="ogrid-datagrid-fill-handle"
273
- (mousedown)="onFillHandleMouseDown($event)"
274
- aria-label="Fill handle"
275
- ></div>
276
- }
277
- </div>
278
- }
279
- </td>
280
- }
281
- </tr>
282
- }
283
- @if (vsEnabled() && vsBottomSpacerHeight() > 0) {
284
- <tr class="ogrid-datagrid-vs-spacer" [style.height.px]="vsBottomSpacerHeight()"></tr>
285
- }
286
- </tbody>
287
- }
288
- </table>
289
-
290
- <ogrid-marching-ants-overlay
291
- [containerEl]="tableContainerEl()"
292
- [selectionRange]="state().interaction.selectionRange"
293
- [copyRange]="state().interaction.copyRange"
294
- [cutRange]="state().interaction.cutRange"
295
- [colOffset]="state().layout.colOffset"
296
- [columnSizingVersion]="columnSizingVersion()"
297
- [items]="items()"
298
- [visibleColumns]="propsVisibleColumns()"
299
- [columnOrder]="propsColumnOrder()"
300
- ></ogrid-marching-ants-overlay>
301
-
302
- @if (showEmptyInGrid() && emptyState()) {
303
- <div class="ogrid-datagrid-empty">
304
- <div class="ogrid-datagrid-empty__title">No results found</div>
305
- <div class="ogrid-datagrid-empty__message">
306
- <ogrid-empty-state
307
- [message]="emptyState()?.message"
308
- [hasActiveFilters]="emptyState()?.hasActiveFilters ?? false"
309
- [render]="emptyState()?.render"
310
- (clearAll)="emptyState()?.onClearAll()"
311
- ></ogrid-empty-state>
312
- </div>
313
- </div>
314
- }
315
- </div>
316
- </div>
317
- </div>
318
-
319
- @if (columnReorderService.isDragging() && columnReorderService.dropIndicatorX() !== null) {
320
- <div class="ogrid-datagrid-drop-indicator" [style.left.px]="columnReorderService.dropIndicatorX()"></div>
321
- }
322
-
323
- @if (menuPosition()) {
324
- <div
325
- class="ogrid-datagrid-context-menu-overlay"
326
- (click)="closeContextMenu()"
327
- (contextmenu)="$event.preventDefault(); closeContextMenu()"
328
- >
329
- <ogrid-context-menu
330
- [x]="menuPosition()!.x"
331
- [y]="menuPosition()!.y"
332
- [hasSelection]="hasCellSelection()"
333
- [canUndoProp]="canUndo()"
334
- [canRedoProp]="canRedo()"
335
- (undoAction)="onUndo()"
336
- (redoAction)="onRedo()"
337
- (copyAction)="handleCopy()"
338
- (cutAction)="handleCut()"
339
- (pasteAction)="handlePaste()"
340
- (selectAllAction)="handleSelectAllCells()"
341
- (closeAction)="closeContextMenu()"
342
- />
343
- </div>
344
- }
345
- </div>
346
-
347
- @let sbConfig = statusBarConfig();
348
- @if (sbConfig) {
349
- <ogrid-status-bar
350
- [totalCount]="sbConfig.totalCount"
351
- [filteredCount]="sbConfig.filteredCount"
352
- [selectedCount]="sbConfig.selectedCount ?? selectedRowIds().size"
353
- [selectedCellCount]="selectionCellCount()"
354
- [aggregation]="sbConfig.aggregation"
355
- [suppressRowCount]="sbConfig.suppressRowCount"
356
- />
357
- }
358
-
359
- @if (isLoading()) {
360
- <div class="ogrid-datagrid-loading-overlay">
361
- <div class="ogrid-datagrid-loading-inner">
362
- <div class="ogrid-datagrid-spinner"></div>
363
- <span>{{ loadingMessage() }}</span>
364
- </div>
365
- </div>
366
- }
367
- </div>
368
- `,
369
- styles: [OGRID_THEME_VARS_CSS, `
370
- :host { display: block; }
371
- .ogrid-datagrid-root { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
372
- .ogrid-datagrid-wrapper {
373
- position: relative; flex: 1; min-height: 0; width: 100%; max-width: 100%;
374
- overflow-x: hidden; overflow-y: auto; background: var(--ogrid-bg, #ffffff);
375
- color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
376
- will-change: scroll-position; outline: none;
377
- }
378
- .ogrid-datagrid-wrapper [data-drag-range] { background: var(--ogrid-range-bg, rgba(33, 115, 70, 0.12)) !important; }
379
- .ogrid-datagrid-wrapper--fit { width: fit-content; }
380
- .ogrid-datagrid-wrapper--overflow-x { overflow-x: auto; }
381
- .ogrid-datagrid-wrapper--loading-empty { min-height: 200px; }
382
- .ogrid-datagrid-scroll-wrapper { display: flex; flex-direction: column; min-height: 100%; }
383
- .ogrid-datagrid-table-wrapper--loading { position: relative; opacity: 0.6; }
384
- .ogrid-datagrid-table {
385
- width: 100%; border-collapse: collapse; table-layout: fixed;
386
- }
387
- .ogrid-datagrid-table tbody tr { height: var(--ogrid-row-height, auto); }
388
- .ogrid-datagrid-thead {
389
- z-index: 8; background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04));
390
- }
391
- .ogrid-datagrid-thead th { background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04)); }
392
- .ogrid-datagrid-header-row { background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04)); }
393
- .ogrid-datagrid-th {
394
- font-weight: 600; padding: 6px 10px; text-align: left;
395
- font-size: 14px; border-bottom: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
396
- background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04)); z-index: 8;
397
- color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
398
- }
399
- .ogrid-sticky-header .ogrid-datagrid-th { position: sticky; top: 0; }
400
- .ogrid-datagrid-th:focus-visible {
401
- outline: 2px solid var(--mat-sys-primary, #1976d2); outline-offset: -2px; z-index: 11;
402
- }
403
- .ogrid-datagrid-th--pinned-left {
404
- position: sticky; top: 0; left: 0; z-index: 10; background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04)); will-change: transform;
405
- border-right: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
406
- box-shadow: 2px 0 4px -1px rgba(0, 0, 0, 0.1);
407
- }
408
- .ogrid-datagrid-th--pinned-right {
409
- position: sticky; top: 0; right: 0; z-index: 10; background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04)); will-change: transform;
410
- border-left: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
411
- box-shadow: -2px 0 4px -1px rgba(0, 0, 0, 0.1);
412
- }
413
- .ogrid-datagrid-group-header {
414
- text-align: center; font-weight: 600; border-bottom: 2px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); padding: 6px;
415
- }
416
- .ogrid-datagrid-checkbox-col {
417
- width: ${CHECKBOX_COLUMN_WIDTH}px; min-width: ${CHECKBOX_COLUMN_WIDTH}px;
418
- max-width: ${CHECKBOX_COLUMN_WIDTH}px; text-align: center;
419
- }
420
- .ogrid-datagrid-checkbox-wrapper { display: flex; align-items: center; justify-content: center; }
421
- .ogrid-row-number-header, .ogrid-row-number-cell {
422
- width: ${ROW_NUMBER_COLUMN_WIDTH}px; min-width: ${ROW_NUMBER_COLUMN_WIDTH}px;
423
- max-width: ${ROW_NUMBER_COLUMN_WIDTH}px; text-align: center;
424
- background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04)); font-weight: 600;
425
- font-variant-numeric: tabular-nums; color: var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.6));
426
- position: sticky; left: 0; z-index: 3;
427
- }
428
- .ogrid-row-number-header { z-index: 4; }
429
- .ogrid-row-number-header-content, .ogrid-row-number-cell-content {
430
- display: flex; align-items: center; justify-content: center;
431
- }
432
- .ogrid-datagrid-row { }
433
- .ogrid-datagrid-row:hover { background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04)); }
434
- .ogrid-datagrid-row--selected { background: var(--ogrid-selected-row-bg, #e6f0fb); }
435
- .ogrid-datagrid-td { position: relative; padding: 0; height: 1px; border-bottom: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.06)); }
436
- .ogrid-datagrid-td--pinned-left {
437
- position: sticky; left: 0; z-index: 6; background: var(--ogrid-bg, #ffffff); will-change: transform;
438
- border-right: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
439
- box-shadow: 2px 0 4px -1px rgba(0, 0, 0, 0.1);
440
- }
441
- .ogrid-datagrid-td--pinned-right {
442
- position: sticky; right: 0; z-index: 6; background: var(--ogrid-bg, #ffffff); will-change: transform;
443
- border-left: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
444
- box-shadow: -2px 0 4px -1px rgba(0, 0, 0, 0.1);
445
- }
446
- .ogrid-datagrid-cell {
447
- width: 100%; height: 100%; display: flex; align-items: center; min-width: 0;
448
- padding: 6px 10px; box-sizing: border-box; overflow: hidden;
449
- text-overflow: ellipsis; white-space: nowrap; user-select: none; outline: none;
450
- font-size: 14px; color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
451
- }
452
- .ogrid-datagrid-cell:focus-visible {
453
- outline: 2px solid var(--mat-sys-primary, #1976d2); outline-offset: -2px; z-index: 3;
454
- }
455
- .ogrid-datagrid-cell--numeric { justify-content: flex-end; text-align: right; }
456
- .ogrid-datagrid-cell--boolean { justify-content: center; text-align: center; }
457
- .ogrid-datagrid-cell--editable { cursor: cell; }
458
- .ogrid-datagrid-cell--active {
459
- outline: 2px solid var(--ogrid-selection-color, #217346); outline-offset: -1px;
460
- z-index: 2; position: relative; overflow: visible;
461
- }
462
- .ogrid-datagrid-cell--in-range { background: var(--ogrid-range-bg, rgba(33, 115, 70, 0.12)); }
463
- .ogrid-datagrid-cell--in-cut-range { background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04)); opacity: 0.7; }
464
- .ogrid-datagrid-cell--editing { padding: 0; }
465
- .ogrid-editing-cell {
466
- width: 100%; height: 100%; display: flex; align-items: center; box-sizing: border-box;
467
- outline: 2px solid var(--ogrid-selection-color, #217346); outline-offset: -1px;
468
- z-index: 2; position: relative; background: var(--ogrid-bg, #fff); overflow: visible; padding: 0;
469
- }
470
- .ogrid-datagrid-editor-input {
471
- width: 100%; height: 100%; padding: 6px 10px; border: 2px solid var(--ogrid-selection-color, #217346);
472
- box-sizing: border-box; font-size: 14px; outline: none; font-family: inherit; line-height: inherit;
473
- background: var(--ogrid-bg, #ffffff); color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
474
- }
475
- .ogrid-datagrid-cell--numeric .ogrid-datagrid-editor-input {
476
- text-align: right;
477
- }
478
- .ogrid-datagrid-editor-select {
479
- width: 100%; height: 100%; padding: 4px 8px; border: 2px solid var(--ogrid-selection-color, #217346);
480
- box-sizing: border-box; font-size: 14px;
481
- background: var(--ogrid-bg, #ffffff); color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
482
- }
483
- .ogrid-datagrid-fill-handle {
484
- position: absolute; right: -3px; bottom: -3px; width: 7px; height: 7px;
485
- background: var(--ogrid-selection-color, #217346);
486
- border: 1px solid var(--ogrid-bg, #ffffff); border-radius: 1px;
487
- cursor: crosshair; pointer-events: auto; z-index: 3;
488
- }
489
- .ogrid-datagrid-resize-handle {
490
- position: absolute; top: 0; right: -3px; bottom: 0; width: 8px;
491
- cursor: col-resize; user-select: none;
492
- }
493
- .ogrid-datagrid-resize-handle::after {
494
- content: ''; position: absolute; top: 4px; right: 3px; bottom: 4px; width: 2px;
495
- background: var(--ogrid-border, rgba(0, 0, 0, 0.12)); border-radius: 1px; transition: background 0.15s;
496
- }
497
- .ogrid-datagrid-resize-handle:hover::after { background: var(--ogrid-fg-muted, rgba(0, 0, 0, 0.4)); }
498
- .ogrid-datagrid-resize-handle:active::after { background: var(--mat-sys-primary, #1976d2); }
499
- .ogrid-datagrid-empty {
500
- padding: 32px 16px; text-align: center; border-top: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
501
- background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04));
502
- }
503
- .ogrid-datagrid-empty__title { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--ogrid-fg, rgba(0, 0, 0, 0.87)); }
504
- .ogrid-datagrid-empty__message { font-size: 14px; color: var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.6)); }
505
- .ogrid-datagrid-empty__clear {
506
- background: none; border: none; color: var(--mat-sys-primary, #1976d2);
507
- cursor: pointer; font-size: inherit; text-decoration: underline; padding: 0;
508
- }
509
- .ogrid-datagrid-loading-overlay {
510
- position: absolute; inset: 0; z-index: 2;
511
- display: flex; align-items: center; justify-content: center;
512
- background: var(--ogrid-loading-overlay, rgba(255, 255, 255, 0.7));
513
- }
514
- .ogrid-datagrid-loading-inner {
515
- display: flex; flex-direction: column; align-items: center; gap: 8px;
516
- padding: 16px; background: var(--ogrid-bg, #ffffff); border: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); border-radius: 4px;
517
- color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
518
- }
519
- .ogrid-datagrid-spinner {
520
- width: 24px; height: 24px; border: 3px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));
521
- border-top-color: var(--mat-sys-primary, #1976d2);
522
- border-radius: 50%; animation: ogrid-spin 0.8s linear infinite;
523
- }
524
- @keyframes ogrid-spin { to { transform: rotate(360deg); } }
525
- .ogrid-datagrid-drop-indicator {
526
- position: absolute; top: 0; bottom: 0; width: 3px;
527
- background: var(--ogrid-selection-color, #217346);
528
- pointer-events: none; z-index: 100; transition: left 0.05s;
529
- }
530
- .ogrid-datagrid-context-menu-overlay {
531
- position: fixed; inset: 0; z-index: 1000;
532
- }
533
-
534
- /* Angular Material Menu popup dark mode overrides */
535
- .mat-mdc-menu-panel {
536
- background: var(--ogrid-bg, #ffffff) !important;
537
- color: var(--ogrid-fg, rgba(0, 0, 0, 0.87)) !important;
538
- }
539
- .mat-mdc-menu-item {
540
- color: var(--ogrid-fg, rgba(0, 0, 0, 0.87)) !important;
541
- }
542
- .mat-mdc-menu-item:hover:not([disabled]) {
543
- background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04)) !important;
544
- }
545
- .mat-mdc-menu-item .mat-mdc-menu-item-text {
546
- color: var(--ogrid-fg, rgba(0, 0, 0, 0.87)) !important;
547
- }
548
- `],
549
- })
550
- ], DataGridTableComponent);
551
- export { DataGridTableComponent };
@@ -1,20 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { Component, ChangeDetectionStrategy } from '@angular/core';
8
- import { BaseInlineCellEditorComponent, INLINE_CELL_EDITOR_TEMPLATE, INLINE_CELL_EDITOR_STYLES } from '@alaarab/ogrid-angular';
9
- let InlineCellEditorComponent = class InlineCellEditorComponent extends BaseInlineCellEditorComponent {
10
- };
11
- InlineCellEditorComponent = __decorate([
12
- Component({
13
- selector: 'ogrid-mat-inline-cell-editor',
14
- standalone: true,
15
- changeDetection: ChangeDetectionStrategy.OnPush,
16
- template: INLINE_CELL_EDITOR_TEMPLATE,
17
- styles: [INLINE_CELL_EDITOR_STYLES],
18
- })
19
- ], InlineCellEditorComponent);
20
- export { InlineCellEditorComponent };
@@ -1,29 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { Component, ChangeDetectionStrategy } from '@angular/core';
8
- import { BasePopoverCellEditorComponent, POPOVER_CELL_EDITOR_TEMPLATE, POPOVER_CELL_EDITOR_OVERLAY_STYLES } from '@alaarab/ogrid-angular';
9
- let PopoverCellEditorComponent = class PopoverCellEditorComponent extends BasePopoverCellEditorComponent {
10
- };
11
- PopoverCellEditorComponent = __decorate([
12
- Component({
13
- selector: 'ogrid-mat-popover-cell-editor',
14
- standalone: true,
15
- changeDetection: ChangeDetectionStrategy.OnPush,
16
- template: POPOVER_CELL_EDITOR_TEMPLATE,
17
- styles: [`
18
- ${POPOVER_CELL_EDITOR_OVERLAY_STYLES}
19
- .ogrid-popover-anchor {
20
- width: 100%; height: 100%; display: flex; align-items: center; min-width: 0;
21
- padding: 6px 10px; box-sizing: border-box; overflow: hidden;
22
- text-overflow: ellipsis; white-space: nowrap; user-select: none;
23
- outline: 2px solid var(--ogrid-selection, #217346); outline-offset: -1px;
24
- z-index: 2; position: relative;
25
- }
26
- `],
27
- })
28
- ], PopoverCellEditorComponent);
29
- export { PopoverCellEditorComponent };