@reforgium/data-grid 3.1.1 → 3.2.0
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/CHANGELOG.md +19 -0
- package/fesm2022/reforgium-data-grid-column-manager.mjs +25 -25
- package/fesm2022/{reforgium-data-grid-grid-overlay-scroll.feature-DkosLX9_.mjs → reforgium-data-grid-grid-overlay-scroll.feature-6tkNtIuO.mjs} +2 -2
- package/fesm2022/reforgium-data-grid-paginator.mjs +19 -19
- package/fesm2022/{reforgium-data-grid-reforgium-data-grid-D4fn-nOx.mjs → reforgium-data-grid-reforgium-data-grid-Cb2oAQjG.mjs} +170 -152
- package/fesm2022/reforgium-data-grid-ui.mjs +7 -7
- package/fesm2022/reforgium-data-grid.mjs +1 -1
- package/package.json +1 -1
- package/types/reforgium-data-grid.d.ts +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
## [3.2.0]: 14.04.2026
|
|
2
|
+
|
|
3
|
+
### Feat:
|
|
4
|
+
- `DataGrid`: added `getRowClass` input (`string | ((row: Data, index: number) => string)`) — applies CSS class(es) to data rows based on a static string or a resolver function; works alongside `isRowDisabled` and other row-level predicates
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## [3.1.2]: 14.04.2026
|
|
9
|
+
|
|
10
|
+
### Fix:
|
|
11
|
+
- `DataGrid`: source/infinity lifecycle for long-lived sources was stabilized; remounting a grid against the same `GridPagedDataSource` / `PagedQueryStore` instance now resets component-local source session state instead of reusing stale buffered pages, queued requests, or pending flags from the previous screen lifecycle
|
|
12
|
+
- `DataGrid`: source/infinity now rebases correctly when a reused source reattaches on a non-zero page without `totalElements`; the current source page becomes the local starting point instead of rendering an empty grid
|
|
13
|
+
- `DataGrid`: singleton-like source reuse now settles correctly after empty successful replacements and remounts, so stale rows are cleared and `loading` no longer depends on previous component-local source state
|
|
14
|
+
|
|
15
|
+
### Test:
|
|
16
|
+
- added regression coverage for same-source remount, empty replacement after remount, non-zero-page reattach without `totalElements`, and source-session reset on version change
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
1
20
|
## [3.1.1]: 06.04.2026
|
|
2
21
|
|
|
3
22
|
### Fix:
|
|
@@ -107,7 +107,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
107
107
|
|
|
108
108
|
/* eslint-disable max-len */
|
|
109
109
|
class EyeIcon {
|
|
110
|
-
open = input(false, { ...(ngDevMode ? { debugName: "open" } : {}), transform: booleanAttribute });
|
|
110
|
+
open = input(false, { ...(ngDevMode ? { debugName: "open" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
111
111
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: EyeIcon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
112
112
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: EyeIcon, isStandalone: true, selector: "re-eye-ic", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
113
113
|
@if (open()) {
|
|
@@ -150,7 +150,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
150
150
|
|
|
151
151
|
/* eslint-disable max-len */
|
|
152
152
|
class PinIcon {
|
|
153
|
-
toRight = input(false, { ...(ngDevMode ? { debugName: "toRight" } : {}), transform: booleanAttribute });
|
|
153
|
+
toRight = input(false, { ...(ngDevMode ? { debugName: "toRight" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
154
154
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: PinIcon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
155
155
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.4", type: PinIcon, isStandalone: true, selector: "re-pin-ic", inputs: { toRight: { classPropertyName: "toRight", publicName: "toRight", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
156
156
|
<svg
|
|
@@ -189,28 +189,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
189
189
|
|
|
190
190
|
class DataGridColumnManager {
|
|
191
191
|
injector = inject(Injector);
|
|
192
|
-
columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
|
|
193
|
-
triggerLabel = input('Columns', ...(ngDevMode ? [{ debugName: "triggerLabel" }] : []));
|
|
194
|
-
showAllLabel = input('Show all', ...(ngDevMode ? [{ debugName: "showAllLabel" }] : []));
|
|
195
|
-
hideAllLabel = input('Hide All', ...(ngDevMode ? [{ debugName: "hideAllLabel" }] : []));
|
|
196
|
-
controlsVisible = input(true, { ...(ngDevMode ? { debugName: "controlsVisible" } : {}), transform: booleanAttribute });
|
|
197
|
-
searchable = input(true, { ...(ngDevMode ? { debugName: "searchable" } : {}), transform: booleanAttribute });
|
|
198
|
-
searchPlaceholder = input('Search columns...', ...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : []));
|
|
199
|
-
allowReorder = input(true, { ...(ngDevMode ? { debugName: "allowReorder" } : {}), transform: booleanAttribute });
|
|
200
|
-
allowPin = input(true, { ...(ngDevMode ? { debugName: "allowPin" } : {}), transform: booleanAttribute });
|
|
201
|
-
allowVisibility = input(true, { ...(ngDevMode ? { debugName: "allowVisibility" } : {}), transform: booleanAttribute });
|
|
192
|
+
columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
193
|
+
triggerLabel = input('Columns', ...(ngDevMode ? [{ debugName: "triggerLabel" }] : /* istanbul ignore next */ []));
|
|
194
|
+
showAllLabel = input('Show all', ...(ngDevMode ? [{ debugName: "showAllLabel" }] : /* istanbul ignore next */ []));
|
|
195
|
+
hideAllLabel = input('Hide All', ...(ngDevMode ? [{ debugName: "hideAllLabel" }] : /* istanbul ignore next */ []));
|
|
196
|
+
controlsVisible = input(true, { ...(ngDevMode ? { debugName: "controlsVisible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
197
|
+
searchable = input(true, { ...(ngDevMode ? { debugName: "searchable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
198
|
+
searchPlaceholder = input('Search columns...', ...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []));
|
|
199
|
+
allowReorder = input(true, { ...(ngDevMode ? { debugName: "allowReorder" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
200
|
+
allowPin = input(true, { ...(ngDevMode ? { debugName: "allowPin" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
201
|
+
allowVisibility = input(true, { ...(ngDevMode ? { debugName: "allowVisibility" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
202
202
|
columnsChange = output();
|
|
203
|
-
triggerDirective = contentChild(DataGridColumnManagerTriggerDirective, ...(ngDevMode ? [{ debugName: "triggerDirective" }] : []));
|
|
204
|
-
columnTitleTemplate = contentChild((DataGridColumnManagerColumnTitleDirective), ...(ngDevMode ? [{ debugName: "columnTitleTemplate" }] : []));
|
|
205
|
-
state = signal([], ...(ngDevMode ? [{ debugName: "state" }] : []));
|
|
206
|
-
searchQuery = signal('', ...(ngDevMode ? [{ debugName: "searchQuery" }] : []));
|
|
207
|
-
draggingKey = signal(null, ...(ngDevMode ? [{ debugName: "draggingKey" }] : []));
|
|
208
|
-
opened = signal(false, ...(ngDevMode ? [{ debugName: "opened" }] : []));
|
|
209
|
-
openedPinMenuKey = signal(null, ...(ngDevMode ? [{ debugName: "openedPinMenuKey" }] : []));
|
|
210
|
-
panelLeft = signal(0, ...(ngDevMode ? [{ debugName: "panelLeft" }] : []));
|
|
211
|
-
triggerTemplate = computed(() => this.triggerDirective()?.template, ...(ngDevMode ? [{ debugName: "triggerTemplate" }] : []));
|
|
212
|
-
root = viewChild('root', ...(ngDevMode ? [{ debugName: "root" }] : []));
|
|
213
|
-
panel = viewChild('panel', ...(ngDevMode ? [{ debugName: "panel" }] : []));
|
|
203
|
+
triggerDirective = contentChild(DataGridColumnManagerTriggerDirective, ...(ngDevMode ? [{ debugName: "triggerDirective" }] : /* istanbul ignore next */ []));
|
|
204
|
+
columnTitleTemplate = contentChild((DataGridColumnManagerColumnTitleDirective), ...(ngDevMode ? [{ debugName: "columnTitleTemplate" }] : /* istanbul ignore next */ []));
|
|
205
|
+
state = signal([], ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
206
|
+
searchQuery = signal('', ...(ngDevMode ? [{ debugName: "searchQuery" }] : /* istanbul ignore next */ []));
|
|
207
|
+
draggingKey = signal(null, ...(ngDevMode ? [{ debugName: "draggingKey" }] : /* istanbul ignore next */ []));
|
|
208
|
+
opened = signal(false, ...(ngDevMode ? [{ debugName: "opened" }] : /* istanbul ignore next */ []));
|
|
209
|
+
openedPinMenuKey = signal(null, ...(ngDevMode ? [{ debugName: "openedPinMenuKey" }] : /* istanbul ignore next */ []));
|
|
210
|
+
panelLeft = signal(0, ...(ngDevMode ? [{ debugName: "panelLeft" }] : /* istanbul ignore next */ []));
|
|
211
|
+
triggerTemplate = computed(() => this.triggerDirective()?.template, ...(ngDevMode ? [{ debugName: "triggerTemplate" }] : /* istanbul ignore next */ []));
|
|
212
|
+
root = viewChild('root', ...(ngDevMode ? [{ debugName: "root" }] : /* istanbul ignore next */ []));
|
|
213
|
+
panel = viewChild('panel', ...(ngDevMode ? [{ debugName: "panel" }] : /* istanbul ignore next */ []));
|
|
214
214
|
filteredColumns = computed(() => {
|
|
215
215
|
const query = this.searchQuery().trim().toLowerCase();
|
|
216
216
|
if (!query) {
|
|
@@ -221,8 +221,8 @@ class DataGridColumnManager {
|
|
|
221
221
|
const header = String(column.header || '').toLowerCase();
|
|
222
222
|
return key.includes(query) || header.includes(query);
|
|
223
223
|
});
|
|
224
|
-
}, ...(ngDevMode ? [{ debugName: "filteredColumns" }] : []));
|
|
225
|
-
visibleColumnsCount = computed(() => this.state().filter((column) => column.visible !== false).length, ...(ngDevMode ? [{ debugName: "visibleColumnsCount" }] : []));
|
|
224
|
+
}, ...(ngDevMode ? [{ debugName: "filteredColumns" }] : /* istanbul ignore next */ []));
|
|
225
|
+
visibleColumnsCount = computed(() => this.state().filter((column) => column.visible !== false).length, ...(ngDevMode ? [{ debugName: "visibleColumnsCount" }] : /* istanbul ignore next */ []));
|
|
226
226
|
constructor() {
|
|
227
227
|
effect(() => this.state.set(cloneColumns(this.columns())));
|
|
228
228
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as computeScrollbarState, a as clampThumbTop, m as mapThumbTopToScrollTop } from './reforgium-data-grid-reforgium-data-grid-
|
|
1
|
+
import { c as computeScrollbarState, a as clampThumbTop, m as mapThumbTopToScrollTop } from './reforgium-data-grid-reforgium-data-grid-Cb2oAQjG.mjs';
|
|
2
2
|
|
|
3
3
|
function createGridOverlayScrollFeature(ctx) {
|
|
4
4
|
const showScrollbar = () => {
|
|
@@ -76,4 +76,4 @@ function createGridOverlayScrollFeature(ctx) {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
export { createGridOverlayScrollFeature };
|
|
79
|
-
//# sourceMappingURL=reforgium-data-grid-grid-overlay-scroll.feature-
|
|
79
|
+
//# sourceMappingURL=reforgium-data-grid-grid-overlay-scroll.feature-6tkNtIuO.mjs.map
|
|
@@ -39,24 +39,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
39
39
|
|
|
40
40
|
// noinspection CssUnresolvedCustomProperty
|
|
41
41
|
class DataGridPaginator {
|
|
42
|
-
current = input(0, { ...(ngDevMode ? { debugName: "current" } : {}), transform: numberAttribute });
|
|
43
|
-
totalElements = input(0, { ...(ngDevMode ? { debugName: "totalElements" } : {}), transform: numberAttribute });
|
|
44
|
-
pageSize = input(0, { ...(ngDevMode ? { debugName: "pageSize" } : {}), transform: numberAttribute });
|
|
45
|
-
maxShowPages = input(7, { ...(ngDevMode ? { debugName: "maxShowPages" } : {}), transform: numberAttribute });
|
|
46
|
-
showFirstLast = input(false, { ...(ngDevMode ? { debugName: "showFirstLast" } : {}), transform: booleanAttribute });
|
|
47
|
-
firstLabel = input('First', ...(ngDevMode ? [{ debugName: "firstLabel" }] : []));
|
|
48
|
-
lastLabel = input('Last', ...(ngDevMode ? [{ debugName: "lastLabel" }] : []));
|
|
49
|
-
showPerPage = input(false, { ...(ngDevMode ? { debugName: "showPerPage" } : {}), transform: booleanAttribute });
|
|
50
|
-
perPageLabel = input('Items per page:', ...(ngDevMode ? [{ debugName: "perPageLabel" }] : []));
|
|
51
|
-
pageSizeOptions = input([10, 20, 50, 100], ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : []));
|
|
42
|
+
current = input(0, { ...(ngDevMode ? { debugName: "current" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
43
|
+
totalElements = input(0, { ...(ngDevMode ? { debugName: "totalElements" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
44
|
+
pageSize = input(0, { ...(ngDevMode ? { debugName: "pageSize" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
45
|
+
maxShowPages = input(7, { ...(ngDevMode ? { debugName: "maxShowPages" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
46
|
+
showFirstLast = input(false, { ...(ngDevMode ? { debugName: "showFirstLast" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
47
|
+
firstLabel = input('First', ...(ngDevMode ? [{ debugName: "firstLabel" }] : /* istanbul ignore next */ []));
|
|
48
|
+
lastLabel = input('Last', ...(ngDevMode ? [{ debugName: "lastLabel" }] : /* istanbul ignore next */ []));
|
|
49
|
+
showPerPage = input(false, { ...(ngDevMode ? { debugName: "showPerPage" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
50
|
+
perPageLabel = input('Items per page:', ...(ngDevMode ? [{ debugName: "perPageLabel" }] : /* istanbul ignore next */ []));
|
|
51
|
+
pageSizeOptions = input([10, 20, 50, 100], ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : /* istanbul ignore next */ []));
|
|
52
52
|
pageChange = output();
|
|
53
53
|
pageSizeChange = output();
|
|
54
|
-
firstSlotRefs = contentChildren(DataGridPaginatorFirstDirective, ...(ngDevMode ? [{ debugName: "firstSlotRefs" }] : []));
|
|
55
|
-
lastSlotRefs = contentChildren(DataGridPaginatorLastDirective, ...(ngDevMode ? [{ debugName: "lastSlotRefs" }] : []));
|
|
56
|
-
pageSlotRefs = contentChildren(DataGridPaginatorPageDirective, ...(ngDevMode ? [{ debugName: "pageSlotRefs" }] : []));
|
|
57
|
-
firstTpl = computed(() => this.firstSlotRefs()?.at(0), ...(ngDevMode ? [{ debugName: "firstTpl" }] : []));
|
|
58
|
-
lastTpl = computed(() => this.lastSlotRefs()?.at(0), ...(ngDevMode ? [{ debugName: "lastTpl" }] : []));
|
|
59
|
-
pageTpl = computed(() => this.pageSlotRefs()?.at(0), ...(ngDevMode ? [{ debugName: "pageTpl" }] : []));
|
|
54
|
+
firstSlotRefs = contentChildren(DataGridPaginatorFirstDirective, ...(ngDevMode ? [{ debugName: "firstSlotRefs" }] : /* istanbul ignore next */ []));
|
|
55
|
+
lastSlotRefs = contentChildren(DataGridPaginatorLastDirective, ...(ngDevMode ? [{ debugName: "lastSlotRefs" }] : /* istanbul ignore next */ []));
|
|
56
|
+
pageSlotRefs = contentChildren(DataGridPaginatorPageDirective, ...(ngDevMode ? [{ debugName: "pageSlotRefs" }] : /* istanbul ignore next */ []));
|
|
57
|
+
firstTpl = computed(() => this.firstSlotRefs()?.at(0), ...(ngDevMode ? [{ debugName: "firstTpl" }] : /* istanbul ignore next */ []));
|
|
58
|
+
lastTpl = computed(() => this.lastSlotRefs()?.at(0), ...(ngDevMode ? [{ debugName: "lastTpl" }] : /* istanbul ignore next */ []));
|
|
59
|
+
pageTpl = computed(() => this.pageSlotRefs()?.at(0), ...(ngDevMode ? [{ debugName: "pageTpl" }] : /* istanbul ignore next */ []));
|
|
60
60
|
normalizedPageSizeOptions = computed(() => {
|
|
61
61
|
const uniq = new Set(this.pageSizeOptions()
|
|
62
62
|
.map((value) => Number(value))
|
|
@@ -65,11 +65,11 @@ class DataGridPaginator {
|
|
|
65
65
|
uniq.add(this.pageSize());
|
|
66
66
|
}
|
|
67
67
|
return [...uniq].sort((a, b) => a - b).map((value) => ({ label: `${value}`, value }));
|
|
68
|
-
}, ...(ngDevMode ? [{ debugName: "normalizedPageSizeOptions" }] : []));
|
|
68
|
+
}, ...(ngDevMode ? [{ debugName: "normalizedPageSizeOptions" }] : /* istanbul ignore next */ []));
|
|
69
69
|
totalPages = computed(() => {
|
|
70
70
|
const size = this.pageSize();
|
|
71
71
|
return size > 0 ? Math.ceil(this.totalElements() / size) : 0;
|
|
72
|
-
}, ...(ngDevMode ? [{ debugName: "totalPages" }] : []));
|
|
72
|
+
}, ...(ngDevMode ? [{ debugName: "totalPages" }] : /* istanbul ignore next */ []));
|
|
73
73
|
pages = computed(() => {
|
|
74
74
|
const current = this.current();
|
|
75
75
|
const total = this.totalPages();
|
|
@@ -99,7 +99,7 @@ class DataGridPaginator {
|
|
|
99
99
|
}
|
|
100
100
|
pages.push(total - 1);
|
|
101
101
|
return pages;
|
|
102
|
-
}, ...(ngDevMode ? [{ debugName: "pages" }] : []));
|
|
102
|
+
}, ...(ngDevMode ? [{ debugName: "pages" }] : /* istanbul ignore next */ []));
|
|
103
103
|
goToPage(page) {
|
|
104
104
|
if (!Number.isInteger(page)) {
|
|
105
105
|
return;
|