ngx-core-components 0.3.21 → 0.3.22
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/ai/ai-chat/ai-chat.component.d.ts +2 -1
- package/ai/ngx-web-llm.service.d.ts +22 -0
- package/ai/public-api.d.ts +2 -0
- package/charts/gantt-chart/gantt-chart.component.d.ts +4 -1
- package/charts/line-chart/line-chart.component.d.ts +19 -1
- package/fesm2022/ngx-core-components-ai.mjs +173 -9
- package/fesm2022/ngx-core-components-ai.mjs.map +1 -1
- package/fesm2022/ngx-core-components-charts.mjs +119 -12
- package/fesm2022/ngx-core-components-charts.mjs.map +1 -1
- package/fesm2022/ngx-core-components-grid.mjs +119 -38
- package/fesm2022/ngx-core-components-grid.mjs.map +1 -1
- package/fesm2022/ngx-core-components-inputs.mjs +714 -3
- package/fesm2022/ngx-core-components-inputs.mjs.map +1 -1
- package/fesm2022/ngx-core-components-navigation.mjs +19 -13
- package/fesm2022/ngx-core-components-navigation.mjs.map +1 -1
- package/fesm2022/ngx-core-components.mjs +2 -2
- package/fesm2022/ngx-core-components.mjs.map +1 -1
- package/grid/data-grid/data-grid.component.d.ts +40 -1
- package/inputs/form-builder/form-builder.component.d.ts +20 -0
- package/inputs/form-builder/form-designer.component.d.ts +42 -0
- package/inputs/public-api.d.ts +1 -0
- package/package.json +9 -9
- package/public-api.d.ts +3 -1
- package/themes/theme.css +22 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject, TemplateRef, Input, Directive, input, output, signal, ElementRef, DestroyRef, effect, untracked,
|
|
2
|
+
import { Injectable, inject, TemplateRef, Input, Directive, input, output, signal, computed, ElementRef, DestroyRef, effect, untracked, HostListener, ContentChildren, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
4
4
|
import { NGX_CORE_I18N } from 'ngx-core-components/i18n';
|
|
5
5
|
|
|
@@ -183,7 +183,13 @@ class DataGridComponent {
|
|
|
183
183
|
editCellTemplates;
|
|
184
184
|
headerTemplates;
|
|
185
185
|
footerTemplates;
|
|
186
|
+
/**
|
|
187
|
+
* The tabular dataset to render in the grid.
|
|
188
|
+
*/
|
|
186
189
|
data = input([]);
|
|
190
|
+
/**
|
|
191
|
+
* The column definition metadata specifying header labels, fields, sorting/filtering settings, and templates.
|
|
192
|
+
*/
|
|
187
193
|
columns = input([]);
|
|
188
194
|
stateKey = input('');
|
|
189
195
|
reorderable = input(false);
|
|
@@ -193,12 +199,28 @@ class DataGridComponent {
|
|
|
193
199
|
showGlobalSearch = input(false);
|
|
194
200
|
globalSearchPlaceholder = input('Search...');
|
|
195
201
|
rowReorder = output();
|
|
202
|
+
/**
|
|
203
|
+
* Number of rows to render per page in paginated mode.
|
|
204
|
+
* @default 10
|
|
205
|
+
*/
|
|
196
206
|
pageSize = input(10);
|
|
207
|
+
/**
|
|
208
|
+
* The current active 1-indexed page number.
|
|
209
|
+
* @default 1
|
|
210
|
+
*/
|
|
197
211
|
page = input(1);
|
|
198
212
|
total = input(0);
|
|
213
|
+
/**
|
|
214
|
+
* Whether row selection is enabled.
|
|
215
|
+
* @default false
|
|
216
|
+
*/
|
|
199
217
|
selectable = input(false);
|
|
200
218
|
striped = input(true);
|
|
201
219
|
loading = input(false);
|
|
220
|
+
/**
|
|
221
|
+
* Whether inline cell/row editing is enabled.
|
|
222
|
+
* @default false
|
|
223
|
+
*/
|
|
202
224
|
editable = input(false);
|
|
203
225
|
sortMode = input('client');
|
|
204
226
|
filterMode = input('client');
|
|
@@ -227,6 +249,17 @@ class DataGridComponent {
|
|
|
227
249
|
enableContextMenu = input(false);
|
|
228
250
|
keyboardNavigation = input(false);
|
|
229
251
|
groupAggregations = input(false);
|
|
252
|
+
/**
|
|
253
|
+
* Whether to render only the visible rows using high-performance row virtualization.
|
|
254
|
+
* Useful when rendering large datasets (1,000+ items).
|
|
255
|
+
* @default false
|
|
256
|
+
*/
|
|
257
|
+
virtualScroll = input(false);
|
|
258
|
+
/**
|
|
259
|
+
* The height of each row in pixels. Required for virtual scrolling viewport calculations.
|
|
260
|
+
* @default 49
|
|
261
|
+
*/
|
|
262
|
+
rowHeight = input(49);
|
|
230
263
|
sortState = signal(null);
|
|
231
264
|
currentPage = signal(1);
|
|
232
265
|
selectedRows = signal(new Set());
|
|
@@ -236,6 +269,25 @@ class DataGridComponent {
|
|
|
236
269
|
editingDraft = signal({});
|
|
237
270
|
internalPageSize = signal(10);
|
|
238
271
|
internalGroupBy = signal(null);
|
|
272
|
+
scrollTop = signal(0);
|
|
273
|
+
viewportHeight = signal(400);
|
|
274
|
+
startIndex = computed(() => {
|
|
275
|
+
if (!this.virtualScroll())
|
|
276
|
+
return 0;
|
|
277
|
+
return Math.max(0, Math.floor(this.scrollTop() / this.rowHeight()) - 3);
|
|
278
|
+
});
|
|
279
|
+
endIndex = computed(() => {
|
|
280
|
+
const totalCount = this.flatRenderedRows().length;
|
|
281
|
+
if (!this.virtualScroll())
|
|
282
|
+
return totalCount;
|
|
283
|
+
return Math.min(totalCount, Math.ceil((this.scrollTop() + this.viewportHeight()) / this.rowHeight()) + 3);
|
|
284
|
+
});
|
|
285
|
+
visibleRows = computed(() => {
|
|
286
|
+
const rendered = this.flatRenderedRows();
|
|
287
|
+
if (!this.virtualScroll())
|
|
288
|
+
return rendered;
|
|
289
|
+
return rendered.slice(this.startIndex(), this.endIndex());
|
|
290
|
+
});
|
|
239
291
|
// Enterprise Extensions
|
|
240
292
|
i18n = inject(NGX_CORE_I18N);
|
|
241
293
|
elementRef = inject(ElementRef);
|
|
@@ -1345,6 +1397,13 @@ class DataGridComponent {
|
|
|
1345
1397
|
this.draggingRowIndex.set(null);
|
|
1346
1398
|
this.dragOverRowIndex.set(null);
|
|
1347
1399
|
}
|
|
1400
|
+
onViewportScroll(event) {
|
|
1401
|
+
const target = event.target;
|
|
1402
|
+
if (target && this.virtualScroll()) {
|
|
1403
|
+
this.scrollTop.set(target.scrollTop);
|
|
1404
|
+
this.viewportHeight.set(target.clientHeight || 400);
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1348
1407
|
onRowDragEnd() {
|
|
1349
1408
|
this.draggingRowIndex.set(null);
|
|
1350
1409
|
this.dragOverRowIndex.set(null);
|
|
@@ -1879,7 +1938,7 @@ class DataGridComponent {
|
|
|
1879
1938
|
}
|
|
1880
1939
|
}
|
|
1881
1940
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DataGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1882
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: DataGridComponent, isStandalone: true, selector: "ngx-data-grid", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, stateKey: { classPropertyName: "stateKey", publicName: "stateKey", isSignal: true, isRequired: false, transformFunction: null }, reorderable: { classPropertyName: "reorderable", publicName: "reorderable", isSignal: true, isRequired: false, transformFunction: null }, multiSort: { classPropertyName: "multiSort", publicName: "multiSort", isSignal: true, isRequired: false, transformFunction: null }, rowReorderable: { classPropertyName: "rowReorderable", publicName: "rowReorderable", isSignal: true, isRequired: false, transformFunction: null }, showGlobalSearch: { classPropertyName: "showGlobalSearch", publicName: "showGlobalSearch", isSignal: true, isRequired: false, transformFunction: null }, globalSearchPlaceholder: { classPropertyName: "globalSearchPlaceholder", publicName: "globalSearchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, striped: { classPropertyName: "striped", publicName: "striped", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, sortMode: { classPropertyName: "sortMode", publicName: "sortMode", isSignal: true, isRequired: false, transformFunction: null }, filterMode: { classPropertyName: "filterMode", publicName: "filterMode", isSignal: true, isRequired: false, transformFunction: null }, groupMode: { classPropertyName: "groupMode", publicName: "groupMode", isSignal: true, isRequired: false, transformFunction: null }, pagingMode: { classPropertyName: "pagingMode", publicName: "pagingMode", isSignal: true, isRequired: false, transformFunction: null }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null }, groupedData: { classPropertyName: "groupedData", publicName: "groupedData", isSignal: true, isRequired: false, transformFunction: null }, headerTemplate: { classPropertyName: "headerTemplate", publicName: "headerTemplate", isSignal: true, isRequired: false, transformFunction: null }, cellTemplate: { classPropertyName: "cellTemplate", publicName: "cellTemplate", isSignal: true, isRequired: false, transformFunction: null }, editCellTemplate: { classPropertyName: "editCellTemplate", publicName: "editCellTemplate", isSignal: true, isRequired: false, transformFunction: null }, rowTemplate: { classPropertyName: "rowTemplate", publicName: "rowTemplate", isSignal: true, isRequired: false, transformFunction: null }, detailRowTemplate: { classPropertyName: "detailRowTemplate", publicName: "detailRowTemplate", isSignal: true, isRequired: false, transformFunction: null }, footerTemplate: { classPropertyName: "footerTemplate", publicName: "footerTemplate", isSignal: true, isRequired: false, transformFunction: null }, showColumnChooser: { classPropertyName: "showColumnChooser", publicName: "showColumnChooser", isSignal: true, isRequired: false, transformFunction: null }, cellSelection: { classPropertyName: "cellSelection", publicName: "cellSelection", isSignal: true, isRequired: false, transformFunction: null }, enableContextMenu: { classPropertyName: "enableContextMenu", publicName: "enableContextMenu", isSignal: true, isRequired: false, transformFunction: null }, keyboardNavigation: { classPropertyName: "keyboardNavigation", publicName: "keyboardNavigation", isSignal: true, isRequired: false, transformFunction: null }, groupAggregations: { classPropertyName: "groupAggregations", publicName: "groupAggregations", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columnReorder: "columnReorder", rowReorder: "rowReorder", rowClick: "rowClick", selectionChange: "selectionChange", sortChange: "sortChange", filterChange: "filterChange", groupChange: "groupChange", pageChange: "pageChange", dataStateChange: "dataStateChange", rowUpdate: "rowUpdate", cellSelectionChange: "cellSelectionChange" }, host: { listeners: { "keydown": "handleKeyDown($event)" } }, queries: [{ propertyName: "cellTemplates", predicate: NgxGridCellTemplateDirective }, { propertyName: "editCellTemplates", predicate: NgxGridEditCellTemplateDirective }, { propertyName: "headerTemplates", predicate: NgxGridHeaderTemplateDirective }, { propertyName: "footerTemplates", predicate: NgxGridFooterTemplateDirective }], ngImport: i0, template: `
|
|
1941
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: DataGridComponent, isStandalone: true, selector: "ngx-data-grid", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, stateKey: { classPropertyName: "stateKey", publicName: "stateKey", isSignal: true, isRequired: false, transformFunction: null }, reorderable: { classPropertyName: "reorderable", publicName: "reorderable", isSignal: true, isRequired: false, transformFunction: null }, multiSort: { classPropertyName: "multiSort", publicName: "multiSort", isSignal: true, isRequired: false, transformFunction: null }, rowReorderable: { classPropertyName: "rowReorderable", publicName: "rowReorderable", isSignal: true, isRequired: false, transformFunction: null }, showGlobalSearch: { classPropertyName: "showGlobalSearch", publicName: "showGlobalSearch", isSignal: true, isRequired: false, transformFunction: null }, globalSearchPlaceholder: { classPropertyName: "globalSearchPlaceholder", publicName: "globalSearchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, striped: { classPropertyName: "striped", publicName: "striped", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, sortMode: { classPropertyName: "sortMode", publicName: "sortMode", isSignal: true, isRequired: false, transformFunction: null }, filterMode: { classPropertyName: "filterMode", publicName: "filterMode", isSignal: true, isRequired: false, transformFunction: null }, groupMode: { classPropertyName: "groupMode", publicName: "groupMode", isSignal: true, isRequired: false, transformFunction: null }, pagingMode: { classPropertyName: "pagingMode", publicName: "pagingMode", isSignal: true, isRequired: false, transformFunction: null }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null }, groupedData: { classPropertyName: "groupedData", publicName: "groupedData", isSignal: true, isRequired: false, transformFunction: null }, headerTemplate: { classPropertyName: "headerTemplate", publicName: "headerTemplate", isSignal: true, isRequired: false, transformFunction: null }, cellTemplate: { classPropertyName: "cellTemplate", publicName: "cellTemplate", isSignal: true, isRequired: false, transformFunction: null }, editCellTemplate: { classPropertyName: "editCellTemplate", publicName: "editCellTemplate", isSignal: true, isRequired: false, transformFunction: null }, rowTemplate: { classPropertyName: "rowTemplate", publicName: "rowTemplate", isSignal: true, isRequired: false, transformFunction: null }, detailRowTemplate: { classPropertyName: "detailRowTemplate", publicName: "detailRowTemplate", isSignal: true, isRequired: false, transformFunction: null }, footerTemplate: { classPropertyName: "footerTemplate", publicName: "footerTemplate", isSignal: true, isRequired: false, transformFunction: null }, showColumnChooser: { classPropertyName: "showColumnChooser", publicName: "showColumnChooser", isSignal: true, isRequired: false, transformFunction: null }, cellSelection: { classPropertyName: "cellSelection", publicName: "cellSelection", isSignal: true, isRequired: false, transformFunction: null }, enableContextMenu: { classPropertyName: "enableContextMenu", publicName: "enableContextMenu", isSignal: true, isRequired: false, transformFunction: null }, keyboardNavigation: { classPropertyName: "keyboardNavigation", publicName: "keyboardNavigation", isSignal: true, isRequired: false, transformFunction: null }, groupAggregations: { classPropertyName: "groupAggregations", publicName: "groupAggregations", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, rowHeight: { classPropertyName: "rowHeight", publicName: "rowHeight", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columnReorder: "columnReorder", rowReorder: "rowReorder", rowClick: "rowClick", selectionChange: "selectionChange", sortChange: "sortChange", filterChange: "filterChange", groupChange: "groupChange", pageChange: "pageChange", dataStateChange: "dataStateChange", rowUpdate: "rowUpdate", cellSelectionChange: "cellSelectionChange" }, host: { listeners: { "keydown": "handleKeyDown($event)" } }, queries: [{ propertyName: "cellTemplates", predicate: NgxGridCellTemplateDirective }, { propertyName: "editCellTemplates", predicate: NgxGridEditCellTemplateDirective }, { propertyName: "headerTemplates", predicate: NgxGridHeaderTemplateDirective }, { propertyName: "footerTemplates", predicate: NgxGridFooterTemplateDirective }], ngImport: i0, template: `
|
|
1883
1942
|
<div class="ngx-data-grid" [class.loading]="loading()">
|
|
1884
1943
|
|
|
1885
1944
|
<div class="grid-toolbar">
|
|
@@ -1908,7 +1967,7 @@ class DataGridComponent {
|
|
|
1908
1967
|
</div>
|
|
1909
1968
|
</div>
|
|
1910
1969
|
|
|
1911
|
-
<div class="grid-table-wrap">
|
|
1970
|
+
<div class="grid-table-wrap" #viewportEl (scroll)="onViewportScroll($event)">
|
|
1912
1971
|
<table class="grid-table" [class.striped]="striped()">
|
|
1913
1972
|
<colgroup>
|
|
1914
1973
|
@if (rowReorderable()) {
|
|
@@ -2277,22 +2336,28 @@ class DataGridComponent {
|
|
|
2277
2336
|
}
|
|
2278
2337
|
}
|
|
2279
2338
|
} @else {
|
|
2280
|
-
@
|
|
2339
|
+
@if (virtualScroll()) {
|
|
2340
|
+
<tr [style.height.px]="startIndex() * rowHeight()">
|
|
2341
|
+
<td [attr.colspan]="renderColumnCount()" style="padding:0; border:none; height: inherit;"></td>
|
|
2342
|
+
</tr>
|
|
2343
|
+
}
|
|
2344
|
+
@for (row of (virtualScroll() ? visibleRows() : flatRenderedRows()); track getKey(row, $index); let i = $index) {
|
|
2345
|
+
@let actualIndex = virtualScroll() ? startIndex() + i : i;
|
|
2281
2346
|
<tr
|
|
2282
2347
|
class="grid-row"
|
|
2283
2348
|
[class.selected]="isRowSelected(row)"
|
|
2284
|
-
[class.dragging-row]="draggingRowIndex() ===
|
|
2285
|
-
[class.drag-over-row]="dragOverRowIndex() ===
|
|
2286
|
-
[style.transform]="getRowTranslation(
|
|
2287
|
-
(dragover)="onRowDragOver($event,
|
|
2288
|
-
(drop)="onRowDrop($event,
|
|
2349
|
+
[class.dragging-row]="draggingRowIndex() === actualIndex"
|
|
2350
|
+
[class.drag-over-row]="dragOverRowIndex() === actualIndex"
|
|
2351
|
+
[style.transform]="getRowTranslation(actualIndex)"
|
|
2352
|
+
(dragover)="onRowDragOver($event, actualIndex)"
|
|
2353
|
+
(drop)="onRowDrop($event, actualIndex)"
|
|
2289
2354
|
(dragend)="onRowDragEnd()"
|
|
2290
|
-
(click)="onRowClick(row,
|
|
2291
|
-
(dblclick)="editable() ? beginEdit(row,
|
|
2355
|
+
(click)="onRowClick(row, actualIndex)"
|
|
2356
|
+
(dblclick)="editable() ? beginEdit(row, actualIndex) : null"
|
|
2292
2357
|
>
|
|
2293
2358
|
@if (rowReorderable()) {
|
|
2294
2359
|
<td class="grid-td grid-td-reorder pinned-left" [class.pinned-left-last]="isRowReorderableLastPinned()" style="left:0px; text-align:center; width:44px">
|
|
2295
|
-
<span class="row-drag-handle" draggable="true" (dragstart)="onRowDragStart($event,
|
|
2360
|
+
<span class="row-drag-handle" draggable="true" (dragstart)="onRowDragStart($event, actualIndex)" (dragend)="onRowDragEnd()" title="Drag row to reorder">
|
|
2296
2361
|
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="display: block;">
|
|
2297
2362
|
<circle cx="9" cy="5" r="1.5"></circle>
|
|
2298
2363
|
<circle cx="9" cy="12" r="1.5"></circle>
|
|
@@ -2324,17 +2389,17 @@ class DataGridComponent {
|
|
|
2324
2389
|
<ng-container *ngTemplateOutlet="rowTemplate(); context: {
|
|
2325
2390
|
$implicit: row,
|
|
2326
2391
|
row: row,
|
|
2327
|
-
index:
|
|
2392
|
+
index: actualIndex,
|
|
2328
2393
|
editing: isEditing(row),
|
|
2329
2394
|
expanded: isExpanded(row)
|
|
2330
2395
|
}" />
|
|
2331
2396
|
</td>
|
|
2332
2397
|
} @else {
|
|
2333
2398
|
@for (col of orderedColumns(); track col.field) {
|
|
2334
|
-
@if (getCellRowSpan(row, col.field,
|
|
2399
|
+
@if (getCellRowSpan(row, col.field, actualIndex) > 0) {
|
|
2335
2400
|
<td
|
|
2336
2401
|
class="grid-td"
|
|
2337
|
-
[attr.rowspan]="getCellRowSpan(row, col.field,
|
|
2402
|
+
[attr.rowspan]="getCellRowSpan(row, col.field, actualIndex)"
|
|
2338
2403
|
[class.pinned-left]="col.pinned === 'left'"
|
|
2339
2404
|
[class.pinned-left-last]="col.pinned === 'left' && lastPinnedColumnField() === col.field"
|
|
2340
2405
|
[class.pinned-right]="col.pinned === 'right'"
|
|
@@ -2358,7 +2423,7 @@ class DataGridComponent {
|
|
|
2358
2423
|
value: getCellValue(row, col.field),
|
|
2359
2424
|
row: row,
|
|
2360
2425
|
column: col,
|
|
2361
|
-
index:
|
|
2426
|
+
index: actualIndex,
|
|
2362
2427
|
editing: true,
|
|
2363
2428
|
draftValue: getDraftValue(row, col.field),
|
|
2364
2429
|
updateDraft: getUpdateDraftCallback(col.field)
|
|
@@ -2377,7 +2442,7 @@ class DataGridComponent {
|
|
|
2377
2442
|
value: getCellValue(row, col.field),
|
|
2378
2443
|
row: row,
|
|
2379
2444
|
column: col,
|
|
2380
|
-
index:
|
|
2445
|
+
index: actualIndex,
|
|
2381
2446
|
editing: isEditing(row)
|
|
2382
2447
|
}" />
|
|
2383
2448
|
} @else {
|
|
@@ -2400,9 +2465,9 @@ class DataGridComponent {
|
|
|
2400
2465
|
style="width:120px"
|
|
2401
2466
|
>
|
|
2402
2467
|
@if (!isEditing(row)) {
|
|
2403
|
-
<button class="action-btn" type="button" (click)="beginEdit(row,
|
|
2468
|
+
<button class="action-btn" type="button" (click)="beginEdit(row, actualIndex); $event.stopPropagation()">Edit</button>
|
|
2404
2469
|
} @else {
|
|
2405
|
-
<button class="action-btn save" type="button" (click)="saveEdit(row,
|
|
2470
|
+
<button class="action-btn save" type="button" (click)="saveEdit(row, actualIndex); $event.stopPropagation()">Save</button>
|
|
2406
2471
|
<button class="action-btn" type="button" (click)="cancelEdit(); $event.stopPropagation()">Cancel</button>
|
|
2407
2472
|
}
|
|
2408
2473
|
</td>
|
|
@@ -2417,13 +2482,18 @@ class DataGridComponent {
|
|
|
2417
2482
|
<ng-container *ngTemplateOutlet="detailRowTemplate(); context: {
|
|
2418
2483
|
$implicit: row,
|
|
2419
2484
|
row: row,
|
|
2420
|
-
index:
|
|
2485
|
+
index: actualIndex
|
|
2421
2486
|
}" />
|
|
2422
2487
|
</div>
|
|
2423
2488
|
</td>
|
|
2424
2489
|
</tr>
|
|
2425
2490
|
}
|
|
2426
2491
|
}
|
|
2492
|
+
@if (virtualScroll()) {
|
|
2493
|
+
<tr [style.height.px]="(flatRenderedRows().length - endIndex()) * rowHeight()">
|
|
2494
|
+
<td [attr.colspan]="renderColumnCount()" style="padding:0; border:none; height: inherit;"></td>
|
|
2495
|
+
</tr>
|
|
2496
|
+
}
|
|
2427
2497
|
}
|
|
2428
2498
|
</tbody>
|
|
2429
2499
|
@if (hasAggregation()) {
|
|
@@ -2698,7 +2768,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
2698
2768
|
</div>
|
|
2699
2769
|
</div>
|
|
2700
2770
|
|
|
2701
|
-
<div class="grid-table-wrap">
|
|
2771
|
+
<div class="grid-table-wrap" #viewportEl (scroll)="onViewportScroll($event)">
|
|
2702
2772
|
<table class="grid-table" [class.striped]="striped()">
|
|
2703
2773
|
<colgroup>
|
|
2704
2774
|
@if (rowReorderable()) {
|
|
@@ -3067,22 +3137,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
3067
3137
|
}
|
|
3068
3138
|
}
|
|
3069
3139
|
} @else {
|
|
3070
|
-
@
|
|
3140
|
+
@if (virtualScroll()) {
|
|
3141
|
+
<tr [style.height.px]="startIndex() * rowHeight()">
|
|
3142
|
+
<td [attr.colspan]="renderColumnCount()" style="padding:0; border:none; height: inherit;"></td>
|
|
3143
|
+
</tr>
|
|
3144
|
+
}
|
|
3145
|
+
@for (row of (virtualScroll() ? visibleRows() : flatRenderedRows()); track getKey(row, $index); let i = $index) {
|
|
3146
|
+
@let actualIndex = virtualScroll() ? startIndex() + i : i;
|
|
3071
3147
|
<tr
|
|
3072
3148
|
class="grid-row"
|
|
3073
3149
|
[class.selected]="isRowSelected(row)"
|
|
3074
|
-
[class.dragging-row]="draggingRowIndex() ===
|
|
3075
|
-
[class.drag-over-row]="dragOverRowIndex() ===
|
|
3076
|
-
[style.transform]="getRowTranslation(
|
|
3077
|
-
(dragover)="onRowDragOver($event,
|
|
3078
|
-
(drop)="onRowDrop($event,
|
|
3150
|
+
[class.dragging-row]="draggingRowIndex() === actualIndex"
|
|
3151
|
+
[class.drag-over-row]="dragOverRowIndex() === actualIndex"
|
|
3152
|
+
[style.transform]="getRowTranslation(actualIndex)"
|
|
3153
|
+
(dragover)="onRowDragOver($event, actualIndex)"
|
|
3154
|
+
(drop)="onRowDrop($event, actualIndex)"
|
|
3079
3155
|
(dragend)="onRowDragEnd()"
|
|
3080
|
-
(click)="onRowClick(row,
|
|
3081
|
-
(dblclick)="editable() ? beginEdit(row,
|
|
3156
|
+
(click)="onRowClick(row, actualIndex)"
|
|
3157
|
+
(dblclick)="editable() ? beginEdit(row, actualIndex) : null"
|
|
3082
3158
|
>
|
|
3083
3159
|
@if (rowReorderable()) {
|
|
3084
3160
|
<td class="grid-td grid-td-reorder pinned-left" [class.pinned-left-last]="isRowReorderableLastPinned()" style="left:0px; text-align:center; width:44px">
|
|
3085
|
-
<span class="row-drag-handle" draggable="true" (dragstart)="onRowDragStart($event,
|
|
3161
|
+
<span class="row-drag-handle" draggable="true" (dragstart)="onRowDragStart($event, actualIndex)" (dragend)="onRowDragEnd()" title="Drag row to reorder">
|
|
3086
3162
|
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="display: block;">
|
|
3087
3163
|
<circle cx="9" cy="5" r="1.5"></circle>
|
|
3088
3164
|
<circle cx="9" cy="12" r="1.5"></circle>
|
|
@@ -3114,17 +3190,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
3114
3190
|
<ng-container *ngTemplateOutlet="rowTemplate(); context: {
|
|
3115
3191
|
$implicit: row,
|
|
3116
3192
|
row: row,
|
|
3117
|
-
index:
|
|
3193
|
+
index: actualIndex,
|
|
3118
3194
|
editing: isEditing(row),
|
|
3119
3195
|
expanded: isExpanded(row)
|
|
3120
3196
|
}" />
|
|
3121
3197
|
</td>
|
|
3122
3198
|
} @else {
|
|
3123
3199
|
@for (col of orderedColumns(); track col.field) {
|
|
3124
|
-
@if (getCellRowSpan(row, col.field,
|
|
3200
|
+
@if (getCellRowSpan(row, col.field, actualIndex) > 0) {
|
|
3125
3201
|
<td
|
|
3126
3202
|
class="grid-td"
|
|
3127
|
-
[attr.rowspan]="getCellRowSpan(row, col.field,
|
|
3203
|
+
[attr.rowspan]="getCellRowSpan(row, col.field, actualIndex)"
|
|
3128
3204
|
[class.pinned-left]="col.pinned === 'left'"
|
|
3129
3205
|
[class.pinned-left-last]="col.pinned === 'left' && lastPinnedColumnField() === col.field"
|
|
3130
3206
|
[class.pinned-right]="col.pinned === 'right'"
|
|
@@ -3148,7 +3224,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
3148
3224
|
value: getCellValue(row, col.field),
|
|
3149
3225
|
row: row,
|
|
3150
3226
|
column: col,
|
|
3151
|
-
index:
|
|
3227
|
+
index: actualIndex,
|
|
3152
3228
|
editing: true,
|
|
3153
3229
|
draftValue: getDraftValue(row, col.field),
|
|
3154
3230
|
updateDraft: getUpdateDraftCallback(col.field)
|
|
@@ -3167,7 +3243,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
3167
3243
|
value: getCellValue(row, col.field),
|
|
3168
3244
|
row: row,
|
|
3169
3245
|
column: col,
|
|
3170
|
-
index:
|
|
3246
|
+
index: actualIndex,
|
|
3171
3247
|
editing: isEditing(row)
|
|
3172
3248
|
}" />
|
|
3173
3249
|
} @else {
|
|
@@ -3190,9 +3266,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
3190
3266
|
style="width:120px"
|
|
3191
3267
|
>
|
|
3192
3268
|
@if (!isEditing(row)) {
|
|
3193
|
-
<button class="action-btn" type="button" (click)="beginEdit(row,
|
|
3269
|
+
<button class="action-btn" type="button" (click)="beginEdit(row, actualIndex); $event.stopPropagation()">Edit</button>
|
|
3194
3270
|
} @else {
|
|
3195
|
-
<button class="action-btn save" type="button" (click)="saveEdit(row,
|
|
3271
|
+
<button class="action-btn save" type="button" (click)="saveEdit(row, actualIndex); $event.stopPropagation()">Save</button>
|
|
3196
3272
|
<button class="action-btn" type="button" (click)="cancelEdit(); $event.stopPropagation()">Cancel</button>
|
|
3197
3273
|
}
|
|
3198
3274
|
</td>
|
|
@@ -3207,13 +3283,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
3207
3283
|
<ng-container *ngTemplateOutlet="detailRowTemplate(); context: {
|
|
3208
3284
|
$implicit: row,
|
|
3209
3285
|
row: row,
|
|
3210
|
-
index:
|
|
3286
|
+
index: actualIndex
|
|
3211
3287
|
}" />
|
|
3212
3288
|
</div>
|
|
3213
3289
|
</td>
|
|
3214
3290
|
</tr>
|
|
3215
3291
|
}
|
|
3216
3292
|
}
|
|
3293
|
+
@if (virtualScroll()) {
|
|
3294
|
+
<tr [style.height.px]="(flatRenderedRows().length - endIndex()) * rowHeight()">
|
|
3295
|
+
<td [attr.colspan]="renderColumnCount()" style="padding:0; border:none; height: inherit;"></td>
|
|
3296
|
+
</tr>
|
|
3297
|
+
}
|
|
3217
3298
|
}
|
|
3218
3299
|
</tbody>
|
|
3219
3300
|
@if (hasAggregation()) {
|