@nanahoshi/mona-ui 0.47.0 → 0.48.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/docs/api/grid.json +1 -1
- package/docs/api/grid.md +18 -0
- package/docs/api/index.json +1 -1
- package/docs/grid-rows.md +36 -0
- package/docs/grid-server.md +6 -0
- package/docs/grid.md +3 -2
- package/docs/manifest.json +1 -1
- package/fesm2022/{grid-colgroup.component-B4jx10Yi.mjs → grid-colgroup.component-BFbiAvkG.mjs} +2 -2
- package/fesm2022/{grid-footer-row.component-CVUltI39.mjs → grid-footer-row.component-DpSu7jvG.mjs} +3 -2
- package/fesm2022/{grid-list.component-Cv1KB5VQ.mjs → grid-list.component-B-F4bvFL.mjs} +5 -5
- package/fesm2022/{grid-row.component-BauMmps5.mjs → grid-row.component-CuCQ_Z5F.mjs} +37 -9
- package/fesm2022/{grid-virtual-list.component-DNjoZfHq.mjs → grid-virtual-list.component-rIz5AUOU.mjs} +31 -12
- package/fesm2022/{grid.styles-BJHVTT_v.mjs → grid.styles-D6jP3vwD.mjs} +110 -35
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +16 -20
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-grid.d.ts +35 -4
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
import { P as gridListTableThemeVariants, _ as gridFooterThemeVariants, g as gridFooterTableThemeVariants, j as gridListBaseThemeVariants, q as GridService, tt as GridNavigationService } from "./grid.styles-
|
|
2
|
-
import { n as GridGroupRowComponent, r as GridAddRowComponent, t as GridRowComponent } from "./grid-row.component-
|
|
3
|
-
import { t as GridColgroupComponent } from "./grid-colgroup.component-
|
|
4
|
-
import { GridFooterRowComponent } from "./grid-footer-row.component-
|
|
1
|
+
import { P as gridListTableThemeVariants, _ as gridFooterThemeVariants, g as gridFooterTableThemeVariants, j as gridListBaseThemeVariants, q as GridService, tt as GridNavigationService } from "./grid.styles-D6jP3vwD.mjs";
|
|
2
|
+
import { n as GridGroupRowComponent, r as GridAddRowComponent, t as GridRowComponent } from "./grid-row.component-CuCQ_Z5F.mjs";
|
|
3
|
+
import { t as GridColgroupComponent } from "./grid-colgroup.component-BFbiAvkG.mjs";
|
|
4
|
+
import { GridFooterRowComponent } from "./grid-footer-row.component-DpSu7jvG.mjs";
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
import { Component, DestroyRef, ElementRef, Injector, afterNextRender, computed, effect, inject, input, untracked, viewChild } from "@angular/core";
|
|
6
|
+
import { Component, DestroyRef, ElementRef, Injector, afterNextRender, computed, effect, inject, input, signal, untracked, viewChild } from "@angular/core";
|
|
7
7
|
import { takeUntilDestroyed, toObservable } from "@angular/core/rxjs-interop";
|
|
8
8
|
import { rxTimeout } from "@nanahoshi/mona-ui/internal";
|
|
9
9
|
import { ImmutableList } from "@mirei/ts-collections";
|
|
10
10
|
import { ContextMenuComponent } from "@nanahoshi/mona-ui/contextmenu";
|
|
11
11
|
import { CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport } from "@angular/cdk/scrolling";
|
|
12
|
+
const MIN_BUFFER_ROWS = 4;
|
|
13
|
+
const MAX_BUFFER_ROWS = 8;
|
|
12
14
|
var GridVirtualListComponent = class GridVirtualListComponent {
|
|
13
15
|
#destroyRef;
|
|
14
16
|
#gridNavigationService;
|
|
15
17
|
#groupColumns$;
|
|
16
18
|
#hostElementRef;
|
|
17
19
|
#injector;
|
|
20
|
+
#viewportHeight;
|
|
18
21
|
constructor() {
|
|
19
22
|
this.#destroyRef = inject(DestroyRef);
|
|
20
23
|
this.#gridNavigationService = inject(GridNavigationService);
|
|
21
24
|
this.#groupColumns$ = toObservable(inject(GridService).groupColumns);
|
|
22
25
|
this.#hostElementRef = inject(ElementRef);
|
|
23
26
|
this.#injector = inject(Injector);
|
|
27
|
+
this.#viewportHeight = signal(0, ...ngDevMode ? [{ debugName: "#viewportHeight" }] : /* istanbul ignore next */ []);
|
|
24
28
|
this.addRowScrollElementRef = viewChild("addRowScrollElement", ...ngDevMode ? [{ debugName: "addRowScrollElementRef" }] : /* istanbul ignore next */ []);
|
|
25
29
|
this.bodyTableElementRef = viewChild.required("bodyTable", ...ngDevMode ? [{ debugName: "bodyTableElementRef" }] : /* istanbul ignore next */ []);
|
|
26
30
|
this.footerScrollElementRef = viewChild("footerScrollElement", ...ngDevMode ? [{ debugName: "footerScrollElementRef" }] : /* istanbul ignore next */ []);
|
|
@@ -36,9 +40,13 @@ var GridVirtualListComponent = class GridVirtualListComponent {
|
|
|
36
40
|
}, ...ngDevMode ? [{ debugName: "footerTableClass" }] : /* istanbul ignore next */ []);
|
|
37
41
|
this.gridAriaRowCount = computed(() => this.gridService.bodyAriaRowStart() + this.bodyRows().length + 1, ...ngDevMode ? [{ debugName: "gridAriaRowCount" }] : /* istanbul ignore next */ []);
|
|
38
42
|
this.gridService = inject(GridService);
|
|
43
|
+
this.maxBufferPx = computed(() => this.rowHeight() * MAX_BUFFER_ROWS, ...ngDevMode ? [{ debugName: "maxBufferPx" }] : /* istanbul ignore next */ []);
|
|
44
|
+
this.minBufferPx = computed(() => this.rowHeight() * MIN_BUFFER_ROWS, ...ngDevMode ? [{ debugName: "minBufferPx" }] : /* istanbul ignore next */ []);
|
|
45
|
+
this.rowHeight = computed(() => this.gridService.virtualScrollOptions().height ?? 36, ...ngDevMode ? [{ debugName: "rowHeight" }] : /* istanbul ignore next */ []);
|
|
39
46
|
this.tableClass = computed(() => {
|
|
40
47
|
return gridListTableThemeVariants();
|
|
41
48
|
}, ...ngDevMode ? [{ debugName: "tableClass" }] : /* istanbul ignore next */ []);
|
|
49
|
+
this.templateCacheSize = computed(() => Math.ceil(this.#viewportHeight() / this.rowHeight()) + 16 + 2, ...ngDevMode ? [{ debugName: "templateCacheSize" }] : /* istanbul ignore next */ []);
|
|
42
50
|
this.viewport = viewChild.required(CdkVirtualScrollViewport, ...ngDevMode ? [{ debugName: "viewport" }] : /* istanbul ignore next */ []);
|
|
43
51
|
this.data = input(ImmutableList.create(), ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
44
52
|
effect(() => {
|
|
@@ -57,6 +65,7 @@ var GridVirtualListComponent = class GridVirtualListComponent {
|
|
|
57
65
|
this.gridService.bodyScrollElement.set(bodyScrollElement);
|
|
58
66
|
this.setRowScroller();
|
|
59
67
|
this.setScrollEndSubscription();
|
|
68
|
+
this.setViewportResizeObserver(bodyScrollElement);
|
|
60
69
|
this.#destroyRef.onDestroy(() => {
|
|
61
70
|
if (this.gridService.bodyTableElement() === bodyTableElement) this.gridService.bodyTableElement.set(null);
|
|
62
71
|
if (bodyScrollElement != null && this.gridService.bodyScrollElement() === bodyScrollElement) this.gridService.bodyScrollElement.set(null);
|
|
@@ -99,10 +108,9 @@ var GridVirtualListComponent = class GridVirtualListComponent {
|
|
|
99
108
|
}
|
|
100
109
|
setScrollEndSubscription() {
|
|
101
110
|
const viewport = this.viewport();
|
|
102
|
-
viewport.scrolledIndexChange.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
if (bottomOffset <= this.gridService.scrollEndThreshold() * itemHeight) this.gridService.scrollEnd$.next();
|
|
111
|
+
viewport.scrolledIndexChange.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((index) => {
|
|
112
|
+
const itemHeight = this.rowHeight();
|
|
113
|
+
if ((viewport.getDataLength() - index) * itemHeight - viewport.getViewportSize() <= this.gridService.scrollEndThreshold() * itemHeight) this.gridService.scrollEnd$.next();
|
|
106
114
|
});
|
|
107
115
|
}
|
|
108
116
|
setSelectedKeysLoadSubscription() {
|
|
@@ -119,6 +127,17 @@ var GridVirtualListComponent = class GridVirtualListComponent {
|
|
|
119
127
|
});
|
|
120
128
|
});
|
|
121
129
|
}
|
|
130
|
+
setViewportResizeObserver(viewportElement) {
|
|
131
|
+
if (viewportElement == null) return;
|
|
132
|
+
this.#viewportHeight.set(viewportElement.clientHeight);
|
|
133
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
134
|
+
const observer = new ResizeObserver((entries) => {
|
|
135
|
+
this.#viewportHeight.set(entries[entries.length - 1]?.contentRect.height ?? 0);
|
|
136
|
+
this.viewport().checkViewportSize();
|
|
137
|
+
});
|
|
138
|
+
observer.observe(viewportElement);
|
|
139
|
+
this.#destroyRef.onDestroy(() => observer.disconnect());
|
|
140
|
+
}
|
|
122
141
|
static {
|
|
123
142
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
124
143
|
minVersion: "12.0.0",
|
|
@@ -178,7 +197,7 @@ var GridVirtualListComponent = class GridVirtualListComponent {
|
|
|
178
197
|
}
|
|
179
198
|
],
|
|
180
199
|
ngImport: i0,
|
|
181
|
-
template: "@if (gridService.addRowVisible()) {\n <div\n class=\"shrink-0 overflow-hidden border-b border-b-border\"\n [style.margin-inline-end.px]=\"gridService.scrollbarGutterWidth()\"\n #addRowScrollElement>\n <table role=\"presentation\" [class]=\"tableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <tbody role=\"rowgroup\">\n <tr monaGridAddRow></tr>\n </tbody>\n </table>\n </div>\n}\n\n<cdk-virtual-scroll-viewport\n class=\"flex-1 min-h-0\"\n [itemSize]=\"
|
|
200
|
+
template: "@if (gridService.addRowVisible()) {\n <div\n class=\"shrink-0 overflow-hidden border-b border-b-border\"\n [style.margin-inline-end.px]=\"gridService.scrollbarGutterWidth()\"\n #addRowScrollElement>\n <table role=\"presentation\" [class]=\"tableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <tbody role=\"rowgroup\">\n <tr monaGridAddRow></tr>\n </tbody>\n </table>\n </div>\n}\n\n<cdk-virtual-scroll-viewport\n class=\"flex-1 min-h-0\"\n [itemSize]=\"rowHeight()\"\n [minBufferPx]=\"minBufferPx()\"\n [maxBufferPx]=\"maxBufferPx()\">\n <table role=\"presentation\" #bodyTable [class]=\"tableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <tbody role=\"rowgroup\" #bodyElement>\n <ng-container\n *cdkVirtualFor=\"\n let bodyRow of bodyRows();\n let rowIndex = index;\n trackBy: trackBodyRow;\n templateCacheSize: templateCacheSize()\n \">\n @let ariaRowIndex = gridService.bodyAriaRowStart() + rowIndex + 1;\n @if (bodyRow.type === \"group\") {\n <tr monaGridGroupRow [group]=\"bodyRow\" [rowIndex]=\"rowIndex\" [ariaRowIndex]=\"ariaRowIndex\"></tr>\n } @else if (bodyRow.type === \"groupFooter\") {\n <tr\n monaGridFooterRow\n [groupKey]=\"bodyRow.groupAggregate.groupKey\"\n [rowIndex]=\"rowIndex\"\n [section]=\"'body'\"\n [ariaLevel]=\"bodyRow.depth + 2\"\n [ariaRowIndex]=\"ariaRowIndex\"></tr>\n } @else {\n <!-- Detail rows aren't drawn with virtual scrolling: they would break the fixed row height. -->\n <tr monaGridRow [row]=\"bodyRow.row\" [index]=\"rowIndex\" [ariaRowIndex]=\"ariaRowIndex\"></tr>\n }\n </ng-container>\n </tbody>\n </table>\n</cdk-virtual-scroll-viewport>\n@if (gridService.contextMenuItems().length !== 0) {\n <mona-contextmenu [target]=\"bodyElement\" [items]=\"gridService.contextMenuItems()\" />\n}\n\n@if (gridService.hasFooter()) {\n <div [class]=\"footerClass()\" [style.margin-inline-end.px]=\"gridService.scrollbarGutterWidth()\" #footerScrollElement>\n <div>\n <table role=\"presentation\" [class]=\"footerTableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <tfoot role=\"rowgroup\">\n <tr monaGridFooterRow [ariaRowIndex]=\"gridAriaRowCount()\"></tr>\n </tfoot>\n </table>\n </div>\n </div>\n}\n",
|
|
182
201
|
dependencies: [
|
|
183
202
|
{
|
|
184
203
|
kind: "component",
|
|
@@ -294,7 +313,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
294
313
|
"[class]": "baseClass()",
|
|
295
314
|
"[style.--mona-grid-row-height]": "gridService.virtualScrollOptions().height + 'px'"
|
|
296
315
|
},
|
|
297
|
-
template: "@if (gridService.addRowVisible()) {\n <div\n class=\"shrink-0 overflow-hidden border-b border-b-border\"\n [style.margin-inline-end.px]=\"gridService.scrollbarGutterWidth()\"\n #addRowScrollElement>\n <table role=\"presentation\" [class]=\"tableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <tbody role=\"rowgroup\">\n <tr monaGridAddRow></tr>\n </tbody>\n </table>\n </div>\n}\n\n<cdk-virtual-scroll-viewport\n class=\"flex-1 min-h-0\"\n [itemSize]=\"
|
|
316
|
+
template: "@if (gridService.addRowVisible()) {\n <div\n class=\"shrink-0 overflow-hidden border-b border-b-border\"\n [style.margin-inline-end.px]=\"gridService.scrollbarGutterWidth()\"\n #addRowScrollElement>\n <table role=\"presentation\" [class]=\"tableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <tbody role=\"rowgroup\">\n <tr monaGridAddRow></tr>\n </tbody>\n </table>\n </div>\n}\n\n<cdk-virtual-scroll-viewport\n class=\"flex-1 min-h-0\"\n [itemSize]=\"rowHeight()\"\n [minBufferPx]=\"minBufferPx()\"\n [maxBufferPx]=\"maxBufferPx()\">\n <table role=\"presentation\" #bodyTable [class]=\"tableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <tbody role=\"rowgroup\" #bodyElement>\n <ng-container\n *cdkVirtualFor=\"\n let bodyRow of bodyRows();\n let rowIndex = index;\n trackBy: trackBodyRow;\n templateCacheSize: templateCacheSize()\n \">\n @let ariaRowIndex = gridService.bodyAriaRowStart() + rowIndex + 1;\n @if (bodyRow.type === \"group\") {\n <tr monaGridGroupRow [group]=\"bodyRow\" [rowIndex]=\"rowIndex\" [ariaRowIndex]=\"ariaRowIndex\"></tr>\n } @else if (bodyRow.type === \"groupFooter\") {\n <tr\n monaGridFooterRow\n [groupKey]=\"bodyRow.groupAggregate.groupKey\"\n [rowIndex]=\"rowIndex\"\n [section]=\"'body'\"\n [ariaLevel]=\"bodyRow.depth + 2\"\n [ariaRowIndex]=\"ariaRowIndex\"></tr>\n } @else {\n <!-- Detail rows aren't drawn with virtual scrolling: they would break the fixed row height. -->\n <tr monaGridRow [row]=\"bodyRow.row\" [index]=\"rowIndex\" [ariaRowIndex]=\"ariaRowIndex\"></tr>\n }\n </ng-container>\n </tbody>\n </table>\n</cdk-virtual-scroll-viewport>\n@if (gridService.contextMenuItems().length !== 0) {\n <mona-contextmenu [target]=\"bodyElement\" [items]=\"gridService.contextMenuItems()\" />\n}\n\n@if (gridService.hasFooter()) {\n <div [class]=\"footerClass()\" [style.margin-inline-end.px]=\"gridService.scrollbarGutterWidth()\" #footerScrollElement>\n <div>\n <table role=\"presentation\" [class]=\"footerTableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <tfoot role=\"rowgroup\">\n <tr monaGridFooterRow [ariaRowIndex]=\"gridAriaRowCount()\"></tr>\n </tfoot>\n </table>\n </div>\n </div>\n}\n"
|
|
298
317
|
}]
|
|
299
318
|
}],
|
|
300
319
|
ctorParameters: () => [],
|
|
@@ -327,4 +346,4 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
327
346
|
});
|
|
328
347
|
export { GridVirtualListComponent };
|
|
329
348
|
|
|
330
|
-
//# sourceMappingURL=grid-virtual-list.component-
|
|
349
|
+
//# sourceMappingURL=grid-virtual-list.component-rIz5AUOU.mjs.map
|
|
@@ -1164,8 +1164,13 @@ var GridRowFlattenerService = class GridRowFlattenerService {
|
|
|
1164
1164
|
this.#flattenRecursive([...rows], columnArray, groupAggregates, 0, null, collapsedKeys, showFooter, orderGroups ? options : null, result);
|
|
1165
1165
|
return result;
|
|
1166
1166
|
}
|
|
1167
|
-
toDataRows(rows) {
|
|
1168
|
-
|
|
1167
|
+
toDataRows(rows, previous = []) {
|
|
1168
|
+
const dataRows = [];
|
|
1169
|
+
for (const row of rows) {
|
|
1170
|
+
const kept = previous[dataRows.length];
|
|
1171
|
+
dataRows.push(kept?.type === "data" && kept.row === row && kept.groupKey === null && kept.depth === 0 ? kept : this.#createDataRow(row, 0, null));
|
|
1172
|
+
}
|
|
1173
|
+
return dataRows;
|
|
1169
1174
|
}
|
|
1170
1175
|
#createDataRow(row, depth, groupKey) {
|
|
1171
1176
|
return {
|
|
@@ -1457,7 +1462,9 @@ var GridService = class GridService {
|
|
|
1457
1462
|
#dataStateEmissionPending;
|
|
1458
1463
|
#groupRequest;
|
|
1459
1464
|
#loadedSelectedKeys;
|
|
1465
|
+
#previousDataRows;
|
|
1460
1466
|
#rowSource;
|
|
1467
|
+
#rowState;
|
|
1461
1468
|
constructor() {
|
|
1462
1469
|
this.#anchorRowKey = signal(null, ...ngDevMode ? [{ debugName: "#anchorRowKey" }] : /* istanbul ignore next */ []);
|
|
1463
1470
|
this.#bulkSelectionRowKeys = computed(() => {
|
|
@@ -1544,7 +1551,9 @@ var GridService = class GridService {
|
|
|
1544
1551
|
this.#dataStateEmissionPending = false;
|
|
1545
1552
|
this.#groupRequest = [];
|
|
1546
1553
|
this.#loadedSelectedKeys = null;
|
|
1554
|
+
this.#previousDataRows = [];
|
|
1547
1555
|
this.#rowSource = null;
|
|
1556
|
+
this.#rowState = null;
|
|
1548
1557
|
this.add$ = new Subject();
|
|
1549
1558
|
this.addRowData = computed(() => {
|
|
1550
1559
|
const session = this.#editSession();
|
|
@@ -1756,6 +1765,7 @@ var GridService = class GridService {
|
|
|
1756
1765
|
this.renderedBodyRowCount = signal(0, ...ngDevMode ? [{ debugName: "renderedBodyRowCount" }] : /* istanbul ignore next */ []);
|
|
1757
1766
|
this.reorderableOptions = this.#reorderableOptions.asReadonly();
|
|
1758
1767
|
this.resizableOptions = this.#resizableOptions.asReadonly();
|
|
1768
|
+
this.rowActivate$ = new Subject();
|
|
1759
1769
|
this.rowClass = signal(null, ...ngDevMode ? [{ debugName: "rowClass" }] : /* istanbul ignore next */ []);
|
|
1760
1770
|
this.rowDragInProgress = computed(() => this.draggingRowUid() != null, ...ngDevMode ? [{ debugName: "rowDragInProgress" }] : /* istanbul ignore next */ []);
|
|
1761
1771
|
this.rowEdit$ = new Subject();
|
|
@@ -1890,19 +1900,19 @@ var GridService = class GridService {
|
|
|
1890
1900
|
if (tree != null) return ImmutableList.create(tree.rows);
|
|
1891
1901
|
const rows = this.rows();
|
|
1892
1902
|
if (this.serverBindingEnabled()) return rows;
|
|
1893
|
-
|
|
1894
|
-
for (const filter of this.getFilterDescriptors()) queryEnumerable = queryEnumerable.filter(filter, (r) => r.data);
|
|
1903
|
+
const filters = this.getFilterDescriptors();
|
|
1895
1904
|
const groupSorts = this.getGroupDescriptors(this.groupColumns()).map((d) => ({
|
|
1896
1905
|
field: d.field,
|
|
1897
1906
|
dir: d.dir ?? "asc"
|
|
1898
1907
|
}));
|
|
1899
1908
|
const groupFields = new Set(groupSorts.map((sort) => sort.field));
|
|
1900
1909
|
const columnSorts = this.#sortDescriptors().filter((sort) => !groupFields.has(sort.field));
|
|
1910
|
+
if (filters.length === 0 && groupSorts.length === 0 && columnSorts.length === 0) return rows;
|
|
1911
|
+
let queryEnumerable = Query.from(rows, { locale: this.#i18n.localeId() });
|
|
1912
|
+
for (const filter of filters) queryEnumerable = queryEnumerable.filter(filter, (r) => r.data);
|
|
1901
1913
|
queryEnumerable = queryEnumerable.sort([...groupSorts, ...columnSorts], (r) => r.data);
|
|
1902
1914
|
return ImmutableList.create(queryEnumerable.run());
|
|
1903
1915
|
}, ...ngDevMode ? [{ debugName: "viewRows" }] : /* istanbul ignore next */ []);
|
|
1904
|
-
this.virtualGridMaxBuffer = computed(() => this.virtualGridMinBuffer() * 1.42857, ...ngDevMode ? [{ debugName: "virtualGridMaxBuffer" }] : /* istanbul ignore next */ []);
|
|
1905
|
-
this.virtualGridMinBuffer = signal(0, ...ngDevMode ? [{ debugName: "virtualGridMinBuffer" }] : /* istanbul ignore next */ []);
|
|
1906
1916
|
this.virtualScrollOptions = signal({
|
|
1907
1917
|
enabled: false,
|
|
1908
1918
|
height: 36
|
|
@@ -1913,6 +1923,13 @@ var GridService = class GridService {
|
|
|
1913
1923
|
this.setHorizontalScrollSyncEffects();
|
|
1914
1924
|
this.setScrollbarGutterEffects();
|
|
1915
1925
|
}
|
|
1926
|
+
activateRow(row, originalEvent) {
|
|
1927
|
+
if (this.isInEditMode()) return;
|
|
1928
|
+
this.rowActivate$.next({
|
|
1929
|
+
originalEvent,
|
|
1930
|
+
rowData: row.data
|
|
1931
|
+
});
|
|
1932
|
+
}
|
|
1916
1933
|
addGroupColumn(column) {
|
|
1917
1934
|
if (column.kind === "command" || this.#groupColumnIds().contains(column.id)) return;
|
|
1918
1935
|
this.#groupColumnIds.update((ids) => ids.add(column.id));
|
|
@@ -2093,7 +2110,11 @@ var GridService = class GridService {
|
|
|
2093
2110
|
}
|
|
2094
2111
|
createBodyRows(rows) {
|
|
2095
2112
|
const groupColumns = this.groupColumns();
|
|
2096
|
-
if (groupColumns.length === 0)
|
|
2113
|
+
if (groupColumns.length === 0) {
|
|
2114
|
+
const dataRows = this.#rowFlattener.toDataRows(rows, this.#previousDataRows);
|
|
2115
|
+
this.#previousDataRows = dataRows;
|
|
2116
|
+
return dataRows;
|
|
2117
|
+
}
|
|
2097
2118
|
return this.#rowFlattener.flatten(rows, groupColumns, new Set(this.collapsedGroupKeys()), this.groupableOptions().showFooter, this.groupAggregateMap(), this.serverBindingEnabled(), { locale: this.#i18n.localeId() });
|
|
2098
2119
|
}
|
|
2099
2120
|
deselectAllRows() {
|
|
@@ -2758,22 +2779,27 @@ var GridService = class GridService {
|
|
|
2758
2779
|
data: value,
|
|
2759
2780
|
rowKey
|
|
2760
2781
|
};
|
|
2761
|
-
const
|
|
2762
|
-
|
|
2782
|
+
const children = this.#treeOptions()?.children ?? null;
|
|
2783
|
+
if (children == null && Array.isArray(value) && this.appendRows(value, rowKey)) return;
|
|
2784
|
+
const state = {
|
|
2785
|
+
duplicateKey: false,
|
|
2786
|
+
items: [],
|
|
2787
|
+
keys: [],
|
|
2788
|
+
occurrences: /* @__PURE__ */ new Map(),
|
|
2789
|
+
rowKey,
|
|
2790
|
+
rows: ImmutableList.create(),
|
|
2791
|
+
seen: /* @__PURE__ */ new Set()
|
|
2792
|
+
};
|
|
2763
2793
|
const rows = [];
|
|
2764
2794
|
const parents = /* @__PURE__ */ new Map();
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
if (occurrence > 1 && rowKey) duplicateKey = true;
|
|
2774
|
-
const row = new Row(data, occurrence === 1 ? uid : `${uid}#${occurrence}`);
|
|
2775
|
-
rows.push(row);
|
|
2776
|
-
if (children != null) {
|
|
2795
|
+
if (children == null) for (const data of value) rows.push(this.readRow(data, state, true));
|
|
2796
|
+
else {
|
|
2797
|
+
const path = /* @__PURE__ */ new Set();
|
|
2798
|
+
const addRows = (items, parentUid) => {
|
|
2799
|
+
for (const data of items) {
|
|
2800
|
+
if (path.has(data)) continue;
|
|
2801
|
+
const row = this.readRow(data, state, false);
|
|
2802
|
+
rows.push(row);
|
|
2777
2803
|
parents.set(row.uid, parentUid);
|
|
2778
2804
|
const childItems = getTreeChildren(data, children);
|
|
2779
2805
|
if (childItems != null) {
|
|
@@ -2782,12 +2808,14 @@ var GridService = class GridService {
|
|
|
2782
2808
|
path.delete(data);
|
|
2783
2809
|
}
|
|
2784
2810
|
}
|
|
2785
|
-
}
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2811
|
+
};
|
|
2812
|
+
addRows(value, null);
|
|
2813
|
+
}
|
|
2814
|
+
this.warnDuplicateKeys(state);
|
|
2789
2815
|
this.#treeParents.set(parents);
|
|
2790
|
-
|
|
2816
|
+
state.rows = ImmutableList.create(rows);
|
|
2817
|
+
this.#rowState = children == null ? state : null;
|
|
2818
|
+
this.rows.set(state.rows);
|
|
2791
2819
|
}
|
|
2792
2820
|
setScrollEndThreshold(threshold) {
|
|
2793
2821
|
this.scrollEndThreshold.set(threshold);
|
|
@@ -3003,6 +3031,21 @@ var GridService = class GridService {
|
|
|
3003
3031
|
const message = (field != null ? [...field().errors(), ...session.form().errors()] : session.form().errorSummary()).find((error) => !!error.message)?.message || (field != null ? messages.fieldValidationError : messages.rowValidationError);
|
|
3004
3032
|
if (message) this.#liveAnnouncer.announce(message, "polite");
|
|
3005
3033
|
}
|
|
3034
|
+
appendRows(items, rowKey) {
|
|
3035
|
+
const state = this.#rowState;
|
|
3036
|
+
if (state == null || state.rowKey !== rowKey || state.rows !== this.rows() || items.length <= state.items.length) return false;
|
|
3037
|
+
const readCount = state.items.length;
|
|
3038
|
+
for (let index = 0; index < readCount; index++) if (items[index] !== state.items[index]) return false;
|
|
3039
|
+
if (rowKey) {
|
|
3040
|
+
for (let index = 0; index < readCount; index++) if (!Object.is(this.getRowUidKey(items[index], rowKey), state.keys[index])) return false;
|
|
3041
|
+
}
|
|
3042
|
+
const rows = [];
|
|
3043
|
+
for (let index = readCount; index < items.length; index++) rows.push(this.readRow(items[index], state, true));
|
|
3044
|
+
this.warnDuplicateKeys(state);
|
|
3045
|
+
state.rows = state.rows.addAll(rows);
|
|
3046
|
+
this.rows.set(state.rows);
|
|
3047
|
+
return true;
|
|
3048
|
+
}
|
|
3006
3049
|
applyColumnIndexes(columns) {
|
|
3007
3050
|
return this.withColumnIndices(columns);
|
|
3008
3051
|
}
|
|
@@ -3177,8 +3220,7 @@ var GridService = class GridService {
|
|
|
3177
3220
|
getRowSelectionKey(row) {
|
|
3178
3221
|
return this.getRowDataItemSelectionKey(row.data);
|
|
3179
3222
|
}
|
|
3180
|
-
getRowUid(data,
|
|
3181
|
-
const key = this.getRowUidKey(data, rowKey);
|
|
3223
|
+
getRowUid(data, key) {
|
|
3182
3224
|
if (key != null) {
|
|
3183
3225
|
if (typeof key === "object" || typeof key === "function") {
|
|
3184
3226
|
const cachedKeyUid = this.#rowUidByKeyObject.get(key);
|
|
@@ -3229,6 +3271,25 @@ var GridService = class GridService {
|
|
|
3229
3271
|
...rightLockedColumns
|
|
3230
3272
|
];
|
|
3231
3273
|
}
|
|
3274
|
+
readRow(data, state, flat) {
|
|
3275
|
+
const key = this.getRowUidKey(data, state.rowKey);
|
|
3276
|
+
const uid = this.getRowUid(data, key);
|
|
3277
|
+
const source = key == null ? data : typeof key === "symbol" ? uid : key;
|
|
3278
|
+
const seenCount = state.seen.size;
|
|
3279
|
+
state.seen.add(source);
|
|
3280
|
+
let rowUid = uid;
|
|
3281
|
+
if (state.seen.size === seenCount) {
|
|
3282
|
+
const occurrence = (state.occurrences.get(uid) ?? 1) + 1;
|
|
3283
|
+
state.occurrences.set(uid, occurrence);
|
|
3284
|
+
rowUid = `${uid}#${occurrence}`;
|
|
3285
|
+
if (state.rowKey) state.duplicateKey = true;
|
|
3286
|
+
}
|
|
3287
|
+
if (flat) {
|
|
3288
|
+
state.items.push(data);
|
|
3289
|
+
state.keys.push(key);
|
|
3290
|
+
}
|
|
3291
|
+
return new Row(data, rowUid);
|
|
3292
|
+
}
|
|
3232
3293
|
reconcileColumn(config, previous) {
|
|
3233
3294
|
const hidden = previous != null && previous.configuredHidden === config.hidden ? previous.hidden : config.hidden;
|
|
3234
3295
|
return {
|
|
@@ -3426,6 +3487,9 @@ var GridService = class GridService {
|
|
|
3426
3487
|
if (!valid && !field.pending()) this.announceInvalid(session);
|
|
3427
3488
|
return valid;
|
|
3428
3489
|
}
|
|
3490
|
+
warnDuplicateKeys(state) {
|
|
3491
|
+
if (state.duplicateKey && isDevMode()) console.warn("mona-grid: several rows have the same rowKey value. Selection, editing and detail rows follow the key, so give every row a unique key.");
|
|
3492
|
+
}
|
|
3429
3493
|
withColumnIndices(columns) {
|
|
3430
3494
|
return columns.map((column, index) => column.index === index ? column : {
|
|
3431
3495
|
...column,
|
|
@@ -3736,6 +3800,7 @@ var GridLogicalCellDirective = class GridLogicalCellDirective {
|
|
|
3736
3800
|
if (section != null) return section;
|
|
3737
3801
|
return this.#hostElementRef.nativeElement.tagName === "TH" ? "header" : "body";
|
|
3738
3802
|
}, ...ngDevMode ? [{ debugName: "resolvedSection" }] : /* istanbul ignore next */ []);
|
|
3803
|
+
this.activate = output();
|
|
3739
3804
|
this.ariaColIndex = input(null, ...ngDevMode ? [{ debugName: "ariaColIndex" }] : /* istanbul ignore next */ []);
|
|
3740
3805
|
this.cellKind = input(null, ...ngDevMode ? [{ debugName: "cellKind" }] : /* istanbul ignore next */ []);
|
|
3741
3806
|
this.colIndex = input.required(...ngDevMode ? [{ debugName: "colIndex" }] : /* istanbul ignore next */ []);
|
|
@@ -3910,20 +3975,25 @@ var GridLogicalCellDirective = class GridLogicalCellDirective {
|
|
|
3910
3975
|
if (!cellKey) return false;
|
|
3911
3976
|
return this.#gridNavigationService.navigate(cellKey, navigationKey);
|
|
3912
3977
|
}
|
|
3913
|
-
#onEnterKey() {
|
|
3978
|
+
#onEnterKey(event) {
|
|
3914
3979
|
if (this.groupHeader() || this.resolvedSection() === "header" || this.resolvedCellKind() === "detail") {
|
|
3915
3980
|
this.toggleExpand.emit();
|
|
3916
3981
|
return;
|
|
3917
3982
|
}
|
|
3918
|
-
this.#onF2Key();
|
|
3983
|
+
if (!this.#onF2Key()) this.activate.emit(event);
|
|
3919
3984
|
}
|
|
3920
3985
|
#onF2Key() {
|
|
3921
3986
|
if (this.editable()) {
|
|
3922
3987
|
this.edit.emit();
|
|
3923
|
-
return;
|
|
3988
|
+
return true;
|
|
3989
|
+
}
|
|
3990
|
+
if (this.#enterCell()) return true;
|
|
3991
|
+
const editableOptions = this.#gridService.editableOptions();
|
|
3992
|
+
if (this.resolvedCellKind() === "data" && editableOptions.enabled === true && editableOptions.mode === "row") {
|
|
3993
|
+
this.edit.emit();
|
|
3994
|
+
return true;
|
|
3924
3995
|
}
|
|
3925
|
-
|
|
3926
|
-
if (this.resolvedCellKind() === "data") this.edit.emit();
|
|
3996
|
+
return false;
|
|
3927
3997
|
}
|
|
3928
3998
|
#onHostKeydown(event) {
|
|
3929
3999
|
if (event.defaultPrevented || event.isComposing) return;
|
|
@@ -3964,7 +4034,7 @@ var GridLogicalCellDirective = class GridLogicalCellDirective {
|
|
|
3964
4034
|
}
|
|
3965
4035
|
case "Enter":
|
|
3966
4036
|
event.preventDefault();
|
|
3967
|
-
this.#onEnterKey();
|
|
4037
|
+
this.#onEnterKey(event);
|
|
3968
4038
|
return;
|
|
3969
4039
|
case "F2":
|
|
3970
4040
|
event.preventDefault();
|
|
@@ -4138,6 +4208,7 @@ var GridLogicalCellDirective = class GridLogicalCellDirective {
|
|
|
4138
4208
|
}
|
|
4139
4209
|
},
|
|
4140
4210
|
outputs: {
|
|
4211
|
+
activate: "activate",
|
|
4141
4212
|
edit: "edit",
|
|
4142
4213
|
menuOpen: "menuOpen",
|
|
4143
4214
|
toggleExpand: "toggleExpand"
|
|
@@ -4171,6 +4242,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4171
4242
|
}],
|
|
4172
4243
|
ctorParameters: () => [],
|
|
4173
4244
|
propDecorators: {
|
|
4245
|
+
activate: [{
|
|
4246
|
+
type: i0.Output,
|
|
4247
|
+
args: ["activate"]
|
|
4248
|
+
}],
|
|
4174
4249
|
ariaColIndex: [{
|
|
4175
4250
|
type: i0.Input,
|
|
4176
4251
|
args: [{
|
|
@@ -4601,4 +4676,4 @@ const gridNoDataThemeVariants = cva(`
|
|
|
4601
4676
|
`);
|
|
4602
4677
|
export { getGridCellText as $, gridHeaderThemeVariants as A, gridTreeLeafSpacerThemeVariants as B, gridHeaderGroupTableRowThemeVariants as C, gridHeaderTableColumnWrapThemeVariants as D, gridHeaderTableColumnTitleThemeVariants as E, gridNoDataThemeVariants as F, observeGridCellTabStops as G, GridLogicalCellDirective as H, gridRowDragPreviewThemeVariants as I, getColumnGroupDepth as J, GridLockedCellDirective as K, gridRowReorderHandleThemeVariants as L, gridListTableCellThemeVariants as M, gridListTableRowThemeVariants as N, gridHeaderTableRowThemeVariants as O, gridListTableThemeVariants as P, formatGridCellValue as Q, gridSelectAllCellThemeVariants as R, gridHeaderGroupSpacerCellThemeVariants as S, gridHeaderTableCellThemeVariants as T, GRID_CELL_FOCUSABLE_SELECTOR as U, gridTreeToggleThemeVariants as V, isKeyboardEntryElement as W, getColumnStepTarget as X, getColumnGroups as Y, getSiblingRuns as Z, gridFooterThemeVariants as _, gridCellEditorBaseThemeVariants as a, GridEditEvent as at, gridGroupRowThemeVariants as b, gridColumnActionsThemeVariants as c, RowEditEvent as ct, gridColumnResizerThemeVariants as d, RowReorderEvent as et, gridFilterRowCellThemeVariants as f, gridFooterTableThemeVariants as g, gridFooterTableRowThemeVariants as h, gridCellDirtyIndicatorThemeVariants as i, GridRemoveEvent as it, gridListBaseThemeVariants as j, gridHeaderTableThemeVariants as k, gridColumnDragPreviewThemeVariants as l, CellEditEvent as lt, gridFooterTableCellThemeVariants as m, gridCellBaseThemeVariants as n, GRID_DEFAULT_MESSAGES as nt, gridCellEditorInputThemeVariants as o, GridCancelEvent as ot, gridFilterRowHeaderCellThemeVariants as p, GridService as q, gridCellContainerThemeVariants as r, GridSaveEvent as rt, gridCellTextThemeVariants as s, GridAddEvent as st, gridBaseThemeVariants as t, GridNavigationService as tt, gridColumnDropHintThemeVariants as u, gridGroupPanelPlaceholderThemeVariants as v, gridHeaderGroupTitleThemeVariants as w, gridHeaderGroupCellThemeVariants as x, gridGroupPanelThemeVariants as y, gridSelectionCellThemeVariants as z };
|
|
4603
4678
|
|
|
4604
|
-
//# sourceMappingURL=grid.styles-
|
|
4679
|
+
//# sourceMappingURL=grid.styles-D6jP3vwD.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as getGridCellText, A as gridHeaderThemeVariants, C as gridHeaderGroupTableRowThemeVariants, D as gridHeaderTableColumnWrapThemeVariants, E as gridHeaderTableColumnTitleThemeVariants, F as gridNoDataThemeVariants, G as observeGridCellTabStops, H as GridLogicalCellDirective, J as getColumnGroupDepth, K as GridLockedCellDirective, O as gridHeaderTableRowThemeVariants, R as gridSelectAllCellThemeVariants, S as gridHeaderGroupSpacerCellThemeVariants, T as gridHeaderTableCellThemeVariants, W as isKeyboardEntryElement, X as getColumnStepTarget, Y as getColumnGroups, Z as getSiblingRuns, _ as gridFooterThemeVariants, at as GridEditEvent, c as gridColumnActionsThemeVariants, ct as RowEditEvent, d as gridColumnResizerThemeVariants, et as RowReorderEvent, f as gridFilterRowCellThemeVariants, g as gridFooterTableThemeVariants, it as GridRemoveEvent, k as gridHeaderTableThemeVariants, l as gridColumnDragPreviewThemeVariants, lt as CellEditEvent, nt as GRID_DEFAULT_MESSAGES, ot as GridCancelEvent, p as gridFilterRowHeaderCellThemeVariants, q as GridService, rt as GridSaveEvent, st as GridAddEvent, t as gridBaseThemeVariants, tt as GridNavigationService, u as gridColumnDropHintThemeVariants, v as gridGroupPanelPlaceholderThemeVariants, w as gridHeaderGroupTitleThemeVariants, x as gridHeaderGroupCellThemeVariants, y as gridGroupPanelThemeVariants } from "./grid.styles-
|
|
2
|
-
import { n as removeGridRow, t as GridColgroupComponent } from "./grid-colgroup.component-
|
|
1
|
+
import { $ as getGridCellText, A as gridHeaderThemeVariants, C as gridHeaderGroupTableRowThemeVariants, D as gridHeaderTableColumnWrapThemeVariants, E as gridHeaderTableColumnTitleThemeVariants, F as gridNoDataThemeVariants, G as observeGridCellTabStops, H as GridLogicalCellDirective, J as getColumnGroupDepth, K as GridLockedCellDirective, O as gridHeaderTableRowThemeVariants, R as gridSelectAllCellThemeVariants, S as gridHeaderGroupSpacerCellThemeVariants, T as gridHeaderTableCellThemeVariants, W as isKeyboardEntryElement, X as getColumnStepTarget, Y as getColumnGroups, Z as getSiblingRuns, _ as gridFooterThemeVariants, at as GridEditEvent, c as gridColumnActionsThemeVariants, ct as RowEditEvent, d as gridColumnResizerThemeVariants, et as RowReorderEvent, f as gridFilterRowCellThemeVariants, g as gridFooterTableThemeVariants, it as GridRemoveEvent, k as gridHeaderTableThemeVariants, l as gridColumnDragPreviewThemeVariants, lt as CellEditEvent, nt as GRID_DEFAULT_MESSAGES, ot as GridCancelEvent, p as gridFilterRowHeaderCellThemeVariants, q as GridService, rt as GridSaveEvent, st as GridAddEvent, t as gridBaseThemeVariants, tt as GridNavigationService, u as gridColumnDropHintThemeVariants, v as gridGroupPanelPlaceholderThemeVariants, w as gridHeaderGroupTitleThemeVariants, x as gridHeaderGroupCellThemeVariants, y as gridGroupPanelThemeVariants } from "./grid.styles-D6jP3vwD.mjs";
|
|
2
|
+
import { n as removeGridRow, t as GridColgroupComponent } from "./grid-colgroup.component-BFbiAvkG.mjs";
|
|
3
3
|
import { DOCUMENT, NgTemplateOutlet, isPlatformBrowser } from "@angular/common";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
import { Component, DOCUMENT as DOCUMENT$1, DestroyRef, Directive, ElementRef, Injectable, InjectionToken, Injector, LOCALE_ID, PLATFORM_ID, Pipe, TemplateRef, afterEveryRender, afterNextRender, booleanAttribute, computed, contentChild, contentChildren, effect, forwardRef, inject, input, isDevMode, linkedSignal, model, output, signal, untracked, viewChild, viewChildren } from "@angular/core";
|
|
@@ -5975,7 +5975,6 @@ var GridComponent = class GridComponent {
|
|
|
5975
5975
|
#registeredFooterScrollElement;
|
|
5976
5976
|
#dragCancelled;
|
|
5977
5977
|
#dragKeySubscription;
|
|
5978
|
-
#resizeObserver;
|
|
5979
5978
|
#toolbarActiveItem;
|
|
5980
5979
|
#toolbarActiveItemIndex;
|
|
5981
5980
|
constructor() {
|
|
@@ -5991,7 +5990,6 @@ var GridComponent = class GridComponent {
|
|
|
5991
5990
|
this.#registeredFooterScrollElement = signal(null, ...ngDevMode ? [{ debugName: "#registeredFooterScrollElement" }] : /* istanbul ignore next */ []);
|
|
5992
5991
|
this.#dragCancelled = false;
|
|
5993
5992
|
this.#dragKeySubscription = null;
|
|
5994
|
-
this.#resizeObserver = null;
|
|
5995
5993
|
this.#toolbarActiveItem = null;
|
|
5996
5994
|
this.#toolbarActiveItemIndex = 0;
|
|
5997
5995
|
this.columnDefinitions = contentChildren(GRID_COLUMN_DEFINITION, {
|
|
@@ -6158,6 +6156,7 @@ var GridComponent = class GridComponent {
|
|
|
6158
6156
|
transform: booleanAttribute
|
|
6159
6157
|
});
|
|
6160
6158
|
this.rounded = input("medium", ...ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []);
|
|
6159
|
+
this.rowActivate = output();
|
|
6161
6160
|
this.rowClass = input(null, ...ngDevMode ? [{ debugName: "rowClass" }] : /* istanbul ignore next */ []);
|
|
6162
6161
|
this.rowKey = input(null, ...ngDevMode ? [{ debugName: "rowKey" }] : /* istanbul ignore next */ []);
|
|
6163
6162
|
this.skip = model(0, ...ngDevMode ? [{ debugName: "skip" }] : /* istanbul ignore next */ []);
|
|
@@ -6170,6 +6169,7 @@ var GridComponent = class GridComponent {
|
|
|
6170
6169
|
untracked(() => this.gridService.setColumnDefinitions(columns));
|
|
6171
6170
|
});
|
|
6172
6171
|
effect(() => this.gridService.rowClass.set(this.rowClass()));
|
|
6172
|
+
this.gridService.rowActivate$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => this.rowActivate.emit(event));
|
|
6173
6173
|
this.setPageSizeEffect();
|
|
6174
6174
|
this.setPagingEffects();
|
|
6175
6175
|
this.setGridDetailEffect();
|
|
@@ -6188,11 +6188,9 @@ var GridComponent = class GridComponent {
|
|
|
6188
6188
|
this.setInitialCalculatedWidthOfColumns();
|
|
6189
6189
|
this.#fitViewInitialScrollbarGutterWidth.set(this.gridService.scrollbarGutterWidth());
|
|
6190
6190
|
this.gridWidthSet.set(true);
|
|
6191
|
-
this.setResizeObserver();
|
|
6192
6191
|
const stopObservingTabStops = observeGridCellTabStops(this.#hostElementRef.nativeElement);
|
|
6193
6192
|
this.#destroyRef.onDestroy(stopObservingTabStops);
|
|
6194
6193
|
} });
|
|
6195
|
-
this.#destroyRef.onDestroy(() => this.#resizeObserver?.disconnect());
|
|
6196
6194
|
}
|
|
6197
6195
|
isColumnDragDisabled(column) {
|
|
6198
6196
|
return column.locked || !this.gridService.reorderableOptions().enabled && !this.groupable();
|
|
@@ -6630,14 +6628,6 @@ var GridComponent = class GridComponent {
|
|
|
6630
6628
|
});
|
|
6631
6629
|
});
|
|
6632
6630
|
}
|
|
6633
|
-
setResizeObserver() {
|
|
6634
|
-
if (typeof ResizeObserver === "undefined") return;
|
|
6635
|
-
this.#resizeObserver = new ResizeObserver(() => {
|
|
6636
|
-
const rect = this.#hostElementRef.nativeElement.getBoundingClientRect();
|
|
6637
|
-
this.gridService.virtualGridMinBuffer.set(rect.height);
|
|
6638
|
-
});
|
|
6639
|
-
this.#resizeObserver.observe(this.#hostElementRef.nativeElement);
|
|
6640
|
-
}
|
|
6641
6631
|
syncToolbarFocusTargets() {
|
|
6642
6632
|
const targets = this.getToolbarFocusTargets();
|
|
6643
6633
|
if (targets.length === 0) return;
|
|
@@ -6765,6 +6755,7 @@ var GridComponent = class GridComponent {
|
|
|
6765
6755
|
expandedKeys: "expandedKeysChange",
|
|
6766
6756
|
pageChange: "pageChange",
|
|
6767
6757
|
pageSize: "pageSizeChange",
|
|
6758
|
+
rowActivate: "rowActivate",
|
|
6768
6759
|
skip: "skipChange"
|
|
6769
6760
|
},
|
|
6770
6761
|
host: { properties: {
|
|
@@ -7114,6 +7105,7 @@ var GridComponent = class GridComponent {
|
|
|
7114
7105
|
"treeCell"
|
|
7115
7106
|
],
|
|
7116
7107
|
outputs: [
|
|
7108
|
+
"activate",
|
|
7117
7109
|
"edit",
|
|
7118
7110
|
"menuOpen",
|
|
7119
7111
|
"toggleExpand"
|
|
@@ -7207,9 +7199,9 @@ var GridComponent = class GridComponent {
|
|
|
7207
7199
|
deferBlockDependencies: [() => [
|
|
7208
7200
|
NgTemplateOutlet,
|
|
7209
7201
|
GridColgroupComponent,
|
|
7210
|
-
import("./grid-footer-row.component-
|
|
7211
|
-
import("./grid-list.component-
|
|
7212
|
-
import("./grid-virtual-list.component-
|
|
7202
|
+
import("./grid-footer-row.component-DpSu7jvG.mjs").then((m) => m.GridFooterRowComponent),
|
|
7203
|
+
import("./grid-list.component-B-F4bvFL.mjs").then((m) => m.GridListComponent),
|
|
7204
|
+
import("./grid-virtual-list.component-rIz5AUOU.mjs").then((m) => m.GridVirtualListComponent),
|
|
7213
7205
|
import("@nanahoshi/mona-ui/spinner").then((m) => m.SpinnerComponent)
|
|
7214
7206
|
]]
|
|
7215
7207
|
});
|
|
@@ -7221,9 +7213,9 @@ i0.ɵɵngDeclareClassMetadataAsync({
|
|
|
7221
7213
|
ngImport: i0,
|
|
7222
7214
|
type: GridComponent,
|
|
7223
7215
|
resolveDeferredDeps: () => [
|
|
7224
|
-
import("./grid-footer-row.component-
|
|
7225
|
-
import("./grid-list.component-
|
|
7226
|
-
import("./grid-virtual-list.component-
|
|
7216
|
+
import("./grid-footer-row.component-DpSu7jvG.mjs").then((m) => m.GridFooterRowComponent),
|
|
7217
|
+
import("./grid-list.component-B-F4bvFL.mjs").then((m) => m.GridListComponent),
|
|
7218
|
+
import("./grid-virtual-list.component-rIz5AUOU.mjs").then((m) => m.GridVirtualListComponent),
|
|
7227
7219
|
import("@nanahoshi/mona-ui/spinner").then((m) => m.SpinnerComponent)
|
|
7228
7220
|
],
|
|
7229
7221
|
resolveMetadata: (GridFooterRowComponent, GridListComponent, GridVirtualListComponent, SpinnerComponent) => ({
|
|
@@ -7414,6 +7406,10 @@ i0.ɵɵngDeclareClassMetadataAsync({
|
|
|
7414
7406
|
required: false
|
|
7415
7407
|
}]
|
|
7416
7408
|
}],
|
|
7409
|
+
rowActivate: [{
|
|
7410
|
+
type: i0.Output,
|
|
7411
|
+
args: ["rowActivate"]
|
|
7412
|
+
}],
|
|
7417
7413
|
rowClass: [{
|
|
7418
7414
|
type: i0.Input,
|
|
7419
7415
|
args: [{
|
package/llms.txt
CHANGED
|
@@ -209,7 +209,7 @@ Mona UI is an Angular component library styled with Tailwind CSS 4. Its componen
|
|
|
209
209
|
- [`@nanahoshi/mona-ui/file-upload`](docs/api/file-upload.md): 8 exports, in full.
|
|
210
210
|
- [`@nanahoshi/mona-ui/filter`](docs/api/filter.md): 7 exports, in full.
|
|
211
211
|
- [`@nanahoshi/mona-ui/form-field`](docs/api/form-field.md): 6 exports, in full.
|
|
212
|
-
- [`@nanahoshi/mona-ui/grid`](docs/api/grid.md):
|
|
212
|
+
- [`@nanahoshi/mona-ui/grid`](docs/api/grid.md): 98 exports, in full.
|
|
213
213
|
- [`@nanahoshi/mona-ui/i18n`](docs/api/i18n.md): 122 exports, in full.
|
|
214
214
|
- [`@nanahoshi/mona-ui/kanban`](docs/api/kanban.md): 10 exports, in full.
|
|
215
215
|
- [`@nanahoshi/mona-ui/label`](docs/api/label.md): 4 exports, in full.
|
package/package.json
CHANGED