@nanahoshi/mona-ui 0.22.1 → 0.23.1

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.
Files changed (26) hide show
  1. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1 -1
  2. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-CIMXz60d.mjs +169 -0
  3. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-CpeheGXU.mjs +176 -0
  4. package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-DZDeYdqc.mjs → nanahoshi-mona-ui-grid-grid-row.component-B_5ay_Nz.mjs} +201 -192
  5. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-BzKywU5b.mjs +173 -0
  6. package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C_mj53LF.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-IewqeT4m.mjs} +554 -667
  7. package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
  8. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +47 -7
  9. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +386 -180
  10. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +266 -99
  11. package/fesm2022/nanahoshi-mona-ui-internal.mjs +35 -32
  12. package/fesm2022/nanahoshi-mona-ui-locales.mjs +13 -0
  13. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +1 -1
  14. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1 -1
  15. package/package.json +1 -1
  16. package/types/nanahoshi-mona-ui-grid.d.ts +126 -26
  17. package/types/nanahoshi-mona-ui-i18n.d.ts +1 -0
  18. package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +35 -1
  19. package/types/nanahoshi-mona-ui-internal-list.d.ts +82 -16
  20. package/types/nanahoshi-mona-ui-internal-tree.d.ts +50 -3
  21. package/types/nanahoshi-mona-ui-internal.d.ts +18 -4
  22. package/types/nanahoshi-mona-ui-locales.d.ts +13 -0
  23. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-cell.component-blRlw0Ie.mjs +0 -108
  24. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-Cviex3cR.mjs +0 -44
  25. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-H38ZTj-_.mjs +0 -164
  26. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-b1W7r45p.mjs +0 -239
@@ -1,239 +0,0 @@
1
- import { G as GridNavigationService, c as GridService, a as GridRowFlattenerService, g as gridListBaseThemeVariants, k as gridFooterThemeVariants, l as gridFooterTableThemeVariants, b as gridFooterTableRowThemeVariants, d as gridGroupRowThemeVariants, h as gridListTableThemeVariants, m as GRID_DEFAULT_VIRTUAL_ROW_HEIGHT, i as GridLogicalCellDirective, j as GridLockedCellDirective } from './nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C_mj53LF.mjs';
2
- import { CdkVirtualScrollViewport, CdkFixedSizeVirtualScroll, CdkVirtualForOf } from '@angular/cdk/scrolling';
3
- import { NgTemplateOutlet } from '@angular/common';
4
- import * as i0 from '@angular/core';
5
- import { inject, DestroyRef, ElementRef, Injector, viewChild, computed, input, effect, untracked, afterNextRender, ChangeDetectionStrategy, Component } from '@angular/core';
6
- import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
7
- import { ImmutableList } from '@mirei/ts-collections';
8
- import { SlicePipe } from '@nanahoshi/mona-ui/common';
9
- import { ContextMenuComponent } from '@nanahoshi/mona-ui/contextmenu';
10
- import { rxTimeout } from '@nanahoshi/mona-ui/internal';
11
- import { fromEvent } from 'rxjs';
12
- import { G as GridAddRowComponent, a as GridCellComponent, b as GridRowDirective, c as GridCellDirective, d as GridDetailRowDirective, e as GridDetailIndentCellDirective, f as GridDetailContentCellDirective, g as GridToggleComponent, h as GridSelectionCheckboxComponent, i as GridRowReorderHandleComponent } from './nanahoshi-mona-ui-grid-grid-toggle.component-DZDeYdqc.mjs';
13
- import { GridFooterTableCellDirective } from './nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-Cviex3cR.mjs';
14
- import { GridFooterCellComponent } from './nanahoshi-mona-ui-grid-grid-footer-cell.component-blRlw0Ie.mjs';
15
-
16
- class GridVirtualListComponent {
17
- #destroyRef;
18
- #gridNavigationService;
19
- #groupColumns$;
20
- #hostElementRef;
21
- #injector;
22
- #rowFlattener;
23
- constructor() {
24
- this.#destroyRef = inject(DestroyRef);
25
- this.#gridNavigationService = inject(GridNavigationService);
26
- this.#groupColumns$ = toObservable(inject(GridService).groupColumns);
27
- this.#hostElementRef = inject((ElementRef));
28
- this.#injector = inject(Injector);
29
- this.#rowFlattener = inject(GridRowFlattenerService);
30
- this.addRowScrollElementRef = viewChild("addRowScrollElement", /* @ts-ignore */
31
- ...(ngDevMode ? [{ debugName: "addRowScrollElementRef" }] : /* istanbul ignore next */ []));
32
- this.bodyTableElementRef = viewChild.required("bodyTable", /* @ts-ignore */
33
- ...(ngDevMode ? [{ debugName: "bodyTableElementRef" }] : /* istanbul ignore next */ []));
34
- this.footerScrollElementRef = viewChild("footerScrollElement", /* @ts-ignore */
35
- ...(ngDevMode ? [{ debugName: "footerScrollElementRef" }] : /* istanbul ignore next */ []));
36
- this.baseClass = computed(() => {
37
- return (gridListBaseThemeVariants({ virtual: true }) +
38
- " [&_mona-grid-toggle>span]:min-h-0 [&_mona-grid-toggle>span]:h-full" +
39
- " [&_mona-grid-command-cell]:min-h-0 [&_mona-grid-command-cell>div]:min-h-0");
40
- }, /* @ts-ignore */
41
- ...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
42
- this.flattenedGroupedRows = computed(() => {
43
- const groupColumns = this.gridService.groupColumns();
44
- if (groupColumns.length === 0) {
45
- return [];
46
- }
47
- const collapsedKeys = new Set(this.gridService.collapsedGroupKeys());
48
- const groupAggregateDict = this.gridService.groupAggregateMap().toDictionary(e => e.key, e => e.value);
49
- const showFooter = this.gridService.groupableOptions().showFooter;
50
- return this.#rowFlattener.flatten(this.data(), groupColumns, collapsedKeys, showFooter, groupAggregateDict, this.gridService.serverBindingEnabled());
51
- }, /* @ts-ignore */
52
- ...(ngDevMode ? [{ debugName: "flattenedGroupedRows" }] : /* istanbul ignore next */ []));
53
- this.footerClass = computed(() => {
54
- return gridFooterThemeVariants();
55
- }, /* @ts-ignore */
56
- ...(ngDevMode ? [{ debugName: "footerClass" }] : /* istanbul ignore next */ []));
57
- this.footerTableClass = computed(() => {
58
- return gridFooterTableThemeVariants();
59
- }, /* @ts-ignore */
60
- ...(ngDevMode ? [{ debugName: "footerTableClass" }] : /* istanbul ignore next */ []));
61
- this.footerTableRowClass = computed(() => {
62
- return gridFooterTableRowThemeVariants({ virtual: true });
63
- }, /* @ts-ignore */
64
- ...(ngDevMode ? [{ debugName: "footerTableRowClass" }] : /* istanbul ignore next */ []));
65
- this.gridService = inject(GridService);
66
- this.groupRowClass = computed(() => {
67
- return gridGroupRowThemeVariants({ virtual: true });
68
- }, /* @ts-ignore */
69
- ...(ngDevMode ? [{ debugName: "groupRowClass" }] : /* istanbul ignore next */ []));
70
- this.tableClass = computed(() => {
71
- return gridListTableThemeVariants();
72
- }, /* @ts-ignore */
73
- ...(ngDevMode ? [{ debugName: "tableClass" }] : /* istanbul ignore next */ []));
74
- this.viewport = viewChild.required(CdkVirtualScrollViewport, /* @ts-ignore */
75
- ...(ngDevMode ? [{ debugName: "viewport" }] : /* istanbul ignore next */ []));
76
- this.columns = input(ImmutableList.create(), /* @ts-ignore */
77
- ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
78
- this.data = input(ImmutableList.create(), /* @ts-ignore */
79
- ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
80
- effect(() => {
81
- const footerScrollElement = this.footerScrollElementRef()?.nativeElement ?? null;
82
- untracked(() => this.gridService.footerScrollElement.set(footerScrollElement));
83
- });
84
- effect(() => {
85
- const addRowScrollElement = this.addRowScrollElementRef()?.nativeElement ?? null;
86
- const scrollLeft = this.gridService.horizontalScrollLeft();
87
- untracked(() => this.setElementScrollLeft(addRowScrollElement, scrollLeft));
88
- });
89
- afterNextRender({
90
- read: () => {
91
- const bodyTableElement = this.bodyTableElementRef().nativeElement;
92
- const bodyScrollElement = this.#hostElementRef.nativeElement.querySelector(".cdk-virtual-scroll-viewport");
93
- this.gridService.bodyTableElement.set(bodyTableElement);
94
- this.gridService.bodyScrollElement.set(bodyScrollElement);
95
- this.setFocusSubscription();
96
- this.setScrollEndSubscription();
97
- this.#destroyRef.onDestroy(() => {
98
- if (this.gridService.bodyTableElement() === bodyTableElement) {
99
- this.gridService.bodyTableElement.set(null);
100
- }
101
- if (bodyScrollElement != null && this.gridService.bodyScrollElement() === bodyScrollElement) {
102
- this.gridService.bodyScrollElement.set(null);
103
- }
104
- if (this.gridService.footerScrollElement() === this.footerScrollElementRef()?.nativeElement) {
105
- this.gridService.footerScrollElement.set(null);
106
- }
107
- });
108
- }
109
- });
110
- this.setGroupSubscriptions();
111
- this.setSelectedKeysLoadSubscription();
112
- }
113
- onGridRowClick(event, row) {
114
- this.gridService.handleRowClick(event, row);
115
- }
116
- onGroupExpandChange(groupKey) {
117
- this.gridService.toggleGroupCollapse(groupKey);
118
- }
119
- onToggleDetailClick(row) {
120
- this.gridService.setRowExpanded(row, !this.gridService.isRowExpanded(row));
121
- }
122
- onViewportFocus() {
123
- this.#gridNavigationService.focusActiveCellOrFirstHeader();
124
- }
125
- setElementScrollLeft(element, scrollLeft) {
126
- if (element != null && element.scrollLeft !== scrollLeft) {
127
- element.scrollLeft = scrollLeft;
128
- }
129
- }
130
- setFocusSubscription() {
131
- fromEvent(this.#hostElementRef.nativeElement, "focus")
132
- .pipe(takeUntilDestroyed(this.#destroyRef))
133
- .subscribe(() => {
134
- this.#gridNavigationService.focusActiveCellOrFirstHeader();
135
- });
136
- }
137
- setGroupSubscriptions() {
138
- // Workaround for @angular/components issue #21793 — virtual scroll does not update
139
- // the rendered range when data changes until the user scrolls.
140
- this.#groupColumns$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
141
- afterNextRender(() => {
142
- const renderedRange = this.viewport().getRenderedRange();
143
- this.viewport().setRenderedRange({
144
- start: renderedRange.start,
145
- end: renderedRange.end + 1
146
- });
147
- }, { injector: this.#injector });
148
- });
149
- }
150
- setScrollEndSubscription() {
151
- const viewport = this.viewport();
152
- viewport.scrolledIndexChange.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
153
- const bottomOffset = viewport.measureScrollOffset("bottom");
154
- const itemHeight = this.gridService.virtualScrollOptions().height ?? GRID_DEFAULT_VIRTUAL_ROW_HEIGHT;
155
- const threshold = this.gridService.scrollEndThreshold();
156
- if (bottomOffset <= threshold * itemHeight) {
157
- this.gridService.scrollEnd$.next();
158
- }
159
- });
160
- }
161
- setSelectedKeysLoadSubscription() {
162
- this.gridService.selectedKeysLoad$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(selectedKeys => {
163
- const firstKey = selectedKeys.firstOrDefault();
164
- if (firstKey == null) {
165
- return;
166
- }
167
- const selectBy = this.gridService.selectBy();
168
- if (this.gridService.groupColumns().any()) {
169
- const viewData = this.flattenedGroupedRows();
170
- const selectedRow = viewData.find(r => {
171
- if (r.type !== "data" || selectBy == null) {
172
- return false;
173
- }
174
- if (typeof selectBy === "string") {
175
- return r.row.data[selectBy] === firstKey;
176
- }
177
- return selectBy(r.row.data) === firstKey;
178
- });
179
- if (selectedRow != null) {
180
- const index = viewData.indexOf(selectedRow);
181
- rxTimeout(this.#destroyRef, () => {
182
- this.viewport().scrollToIndex(index);
183
- });
184
- }
185
- }
186
- else {
187
- const viewData = this.data().toImmutableList();
188
- const selectedRow = viewData.firstOrDefault(r => {
189
- if (selectBy == null) {
190
- return false;
191
- }
192
- if (typeof selectBy === "string") {
193
- return r.data[selectBy] === firstKey;
194
- }
195
- return selectBy(r.data) === firstKey;
196
- });
197
- if (selectedRow != null) {
198
- const index = viewData.indexOf(selectedRow);
199
- rxTimeout(this.#destroyRef, () => {
200
- this.viewport().scrollToIndex(index);
201
- });
202
- }
203
- }
204
- });
205
- }
206
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridVirtualListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
207
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridVirtualListComponent, isStandalone: true, selector: "mona-grid-virtual-list", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "baseClass()", "style.--mona-grid-row-height": "gridService.virtualScrollOptions().height + 'px'" } }, viewQueries: [{ propertyName: "addRowScrollElementRef", first: true, predicate: ["addRowScrollElement"], descendants: true, isSignal: true }, { propertyName: "bodyTableElementRef", first: true, predicate: ["bodyTable"], descendants: true, isSignal: true }, { propertyName: "footerScrollElementRef", first: true, predicate: ["footerScrollElement"], descendants: true, isSignal: true }, { propertyName: "viewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true, isSignal: true }], ngImport: i0, template: "@if (gridService.addRowVisible()) {\n <div\n class=\"shrink-0 overflow-hidden border-b border-b-border\"\n [style.margin-right.px]=\"gridService.scrollbarGutterWidth()\"\n #addRowScrollElement>\n <table role=\"presentation\" [class]=\"tableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of columns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <tbody role=\"rowgroup\">\n <tr monaGridAddRow [columns]=\"columns()\"></tr>\n </tbody>\n </table>\n </div>\n}\n\n<cdk-virtual-scroll-viewport\n class=\"flex-1 min-h-0\"\n [itemSize]=\"gridService.virtualScrollOptions().height\"\n [minBufferPx]=\"gridService.virtualGridMinBuffer()\"\n [maxBufferPx]=\"gridService.virtualGridMaxBuffer()\">\n <table role=\"presentation\" #bodyTable [class]=\"tableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of columns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <tbody role=\"rowgroup\" tabindex=\"0\" (focus)=\"onViewportFocus()\">\n @if (gridService.groupColumns().length === 0) {\n <ng-container *cdkVirtualFor=\"let row of data(); let rowIndex = index\">\n <tr\n monaGridRow\n [index]=\"rowIndex\"\n [row]=\"row\"\n (click)=\"onGridRowClick($event, row)\"\n #gridRow=\"monaGridRow\"\n #rowElement>\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n monaGridLogicalCell\n [structuralColumn]=\"'reorder'\"\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"row.uid\"\n [section]=\"'body'\"\n [colIndex]=\"gridService.structuralColIndexMap().get('reorder') ?? 0\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('reorder') === 0\"\n [lastInRow]=\"columns().length === 0 && gridService.structuralLastKind() === 'reorder'\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"\n [attr.colspan]=\"1\">\n <mona-grid-row-reorder-handle [row]=\"row\" [pageIndex]=\"rowIndex\" />\n </td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridCell\n monaGridLockedCell\n [structuralColumn]=\"'detail'\"\n [masterDetailToggle]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'detail'\"\n (toggleExpand)=\"onToggleDetailClick(row)\"\n [colIndex]=\"gridService.structuralColIndexMap().get('detail') ?? 0\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('detail') === 0\"\n [lastInRow]=\"columns().length === 0 && gridService.structuralLastKind() === 'detail'\"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"row.uid\"\n [section]=\"'body'\"\n [style.width.px]=\"gridService.detailColumnWidth\"\n [attr.colspan]=\"1\">\n <span class=\"flex h-full w-full items-stretch justify-center\">\n <mona-grid-toggle\n [expanded]=\"gridRow.expanded()\"\n [type]=\"'detail'\"\n [width]=\"gridService.detailColumnWidth\"\n (expandedChange)=\"onToggleDetailClick(row)\"></mona-grid-toggle>\n </span>\n </td>\n }\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n [structuralColumn]=\"'selection'\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"row.uid\"\n [section]=\"'body'\"\n [colIndex]=\"gridService.structuralColIndexMap().get('selection') ?? 0\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('selection') === 0\"\n [lastInRow]=\"columns().length === 0 && gridService.structuralLastKind() === 'selection'\"\n [style.width.px]=\"gridService.selectionColumnWidth\"\n [attr.colspan]=\"1\">\n <mona-grid-selection-checkbox [row]=\"row\" [rowIndex]=\"rowIndex\" />\n </td>\n }\n @for (column of columns(); track $index) {\n @let colIndex = $index + gridService.leadingLogicalColumnCount();\n <td\n monaGridCell\n monaGridLockedCell\n [column]=\"column\"\n [dataCell]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"column.kind\"\n [colIndex]=\"colIndex\"\n [columnId]=\"column.id\"\n [editable]=\"\n gridService.editableOptions().enabled === true &&\n gridService.editableOptions().mode === 'cell' &&\n column.kind === 'data' &&\n column.editable === true\n \"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"row.uid\"\n [section]=\"'body'\"\n [firstInRow]=\"colIndex === gridService.leadingLogicalColumnCount()\"\n [lastInRow]=\"\n colIndex === gridService.leadingLogicalColumnCount() + columns().length - 1\n \"\n [attr.colspan]=\"1\"\n [style.width.px]=\"column.calculatedWidth\"\n [style.min-width.px]=\"column.minWidth\"\n (edit)=\"gridCell.handleLogicalCellEnter()\">\n <mona-grid-cell #gridCell [column]=\"column\" [row]=\"row\"></mona-grid-cell>\n </td>\n }\n @if (gridService.contextMenuItems().length !== 0) {\n <ng-container\n [ngTemplateOutlet]=\"contextMenuTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: row.data,\n element: rowElement,\n index: rowIndex\n }\">\n </ng-container>\n }\n </tr>\n @if (gridRow.expanded() && !gridService.rowDragInProgress()) {\n <tr monaGridDetailRow [style.width.px]=\"gridService.masterDetailRowWidth()\">\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n [structuralColumn]=\"'reorder'\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></td>\n }\n <td\n monaGridCell\n monaGridLockedCell\n [lockedStructuralOffset]=\"gridService.rowReorderStructuralWidth()\"\n [indentCell]=\"true\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.masterDetailEmptyCellWidth()\"></td>\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n [structuralColumn]=\"'selection'\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.selectionColumnWidth\"></td>\n }\n <td monaGridCell [masterDetailContent]=\"true\" [attr.colspan]=\"columns().length\">\n <ng-container\n [ngTemplateOutlet]=\"gridService.masterDetailTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: row.data }\"></ng-container>\n </td>\n </tr>\n }\n </ng-container>\n } @else {\n <ng-container *cdkVirtualFor=\"let rowItem of flattenedGroupedRows(); let rowIndex = index\">\n @if (rowItem.type === \"group\") {\n @let prevRow = flattenedGroupedRows()[rowIndex - 1];\n @let isCollapsed = gridService.isGroupCollapsed(rowItem.groupKey);\n <tr\n [class]=\"groupRowClass()\"\n role=\"row\"\n [attr.aria-level]=\"rowItem.depth + 1\"\n [attr.aria-expanded]=\"!isCollapsed\">\n @for (_ of gridService.groupColumns() | monaSlice: 0 : rowItem.depth; track $index) {\n <td\n monaGridCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [grouped]=\"true\"\n [indentCell]=\"true\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n [groupPrefixWidth]=\"rowItem.depth * gridService.groupColumnWidth\"\n [grouped]=\"true\"\n [indentCell]=\"true\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></td>\n }\n\n @let colspan =\n columns().length +\n gridService.groupColumns().length +\n (gridService.masterDetailTemplate() ? 1 : 0) +\n (gridService.selectionColumnVisible() ? 1 : 0) -\n rowItem.depth +\n 1;\n\n <td\n monaGridCell\n monaGridLogicalCell\n [cellKind]=\"'group'\"\n [rowIndex]=\"rowIndex\"\n [colIndex]=\"0\"\n [section]=\"'body'\"\n [grouped]=\"true\"\n [groupHeader]=\"true\"\n [prevRowType]=\"prevRow?.type\"\n [firstInRow]=\"true\"\n [lastInRow]=\"columns().length === 0\"\n [groupKey]=\"rowItem.groupKey\"\n [attr.colspan]=\"colspan\"\n (toggleExpand)=\"onGroupExpandChange(rowItem.groupKey)\">\n <p class=\"absolute inset-0 flex items-center text-sm whitespace-nowrap overflow-hidden\">\n <mona-grid-toggle\n [expanded]=\"!isCollapsed\"\n [width]=\"gridService.groupColumnWidth\"\n [type]=\"'group'\"\n (expandedChange)=\"onGroupExpandChange(rowItem.groupKey)\"></mona-grid-toggle>\n <span class=\"font-bold\">{{ rowItem.title }}: {{ rowItem.groupValue }}</span>\n </p>\n </td>\n </tr>\n } @else if (rowItem.type === \"groupFooter\") {\n <tr role=\"row\" [class]=\"footerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [footerCellWidth]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n [footerCellWidth]=\"gridService.rowReorderColumnWidth\"></td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n [footerCellWidth]=\"gridService.detailColumnWidth\"></td>\n }\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n [footerCellWidth]=\"gridService.selectionColumnWidth\"></td>\n }\n @for (column of columns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [footerColumn]=\"column\">\n <mona-grid-footer-cell\n [column]=\"column\"\n [columnIndex]=\"$index\"\n [groupKey]=\"rowItem.groupAggregate.groupKey\"></mona-grid-footer-cell>\n </td>\n }\n </tr>\n } @else if (rowItem.type === \"data\") {\n @let nextRow = flattenedGroupedRows()[rowIndex + 1];\n @let prevRow = flattenedGroupedRows()[rowIndex - 1];\n <tr\n (click)=\"onGridRowClick($event, rowItem.row)\"\n monaGridRow\n [index]=\"rowIndex\"\n [row]=\"rowItem.row\"\n #gridRow=\"monaGridRow\"\n #rowElement>\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [grouped]=\"true\"\n [indentCell]=\"true\"\n [style.width.px]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n monaGridLogicalCell\n [structuralColumn]=\"'reorder'\"\n [grouped]=\"true\"\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [prevRowType]=\"prevRow?.type\"\n [nextRowType]=\"nextRow?.type\"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"rowItem.row.uid\"\n [section]=\"'body'\"\n [colIndex]=\"gridService.structuralColIndexMap().get('reorder') ?? 0\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('reorder') === 0\"\n [lastInRow]=\"\n columns().length === 0 && gridService.structuralLastKind() === 'reorder'\n \"\n [style.width.px]=\"gridService.rowReorderColumnWidth\">\n <mona-grid-row-reorder-handle [row]=\"rowItem.row\" [pageIndex]=\"rowIndex\" />\n </td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridCell\n monaGridLogicalCell\n monaGridLockedCell\n [structuralColumn]=\"'detail'\"\n [grouped]=\"true\"\n [masterDetailToggle]=\"true\"\n [prevRowType]=\"prevRow?.type\"\n [nextRowType]=\"nextRow?.type\"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"rowItem.row.uid\"\n [section]=\"'body'\"\n [cellKind]=\"'detail'\"\n (toggleExpand)=\"onToggleDetailClick(rowItem.row)\"\n [colIndex]=\"gridService.structuralColIndexMap().get('detail') ?? 0\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('detail') === 0\"\n [lastInRow]=\"\n columns().length === 0 && gridService.structuralLastKind() === 'detail'\n \"\n [style.width.px]=\"gridService.detailColumnWidth\">\n <span class=\"flex h-full w-full items-stretch justify-center\">\n <mona-grid-toggle\n [expanded]=\"gridRow.expanded()\"\n [type]=\"'detail'\"\n [width]=\"gridService.detailColumnWidth\"\n (expandedChange)=\"onToggleDetailClick(rowItem.row)\"></mona-grid-toggle>\n </span>\n </td>\n }\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n [structuralColumn]=\"'selection'\"\n [grouped]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [prevRowType]=\"prevRow?.type\"\n [nextRowType]=\"nextRow?.type\"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"rowItem.row.uid\"\n [section]=\"'body'\"\n [colIndex]=\"gridService.structuralColIndexMap().get('selection') ?? 0\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('selection') === 0\"\n [lastInRow]=\"\n columns().length === 0 && gridService.structuralLastKind() === 'selection'\n \"\n [style.width.px]=\"gridService.selectionColumnWidth\">\n <mona-grid-selection-checkbox [row]=\"rowItem.row\" [rowIndex]=\"rowIndex\" />\n </td>\n }\n @for (column of columns(); track $index) {\n @let colIndex = $index + gridService.leadingLogicalColumnCount();\n <td\n monaGridCell\n monaGridLockedCell\n [column]=\"column\"\n [grouped]=\"true\"\n [dataCell]=\"true\"\n [prevRowType]=\"prevRow?.type\"\n [nextRowType]=\"nextRow?.type\"\n monaGridLogicalCell\n [cellKind]=\"column.kind\"\n [colIndex]=\"colIndex\"\n [columnId]=\"column.id\"\n [editable]=\"\n gridService.editableOptions().enabled === true &&\n gridService.editableOptions().mode === 'cell' &&\n column.kind === 'data' &&\n column.editable === true\n \"\n [firstInRow]=\"colIndex === gridService.leadingLogicalColumnCount()\"\n [lastInRow]=\"\n colIndex === gridService.leadingLogicalColumnCount() + columns().length - 1\n \"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"rowItem.row.uid\"\n [section]=\"'body'\"\n [style.width.px]=\"column.calculatedWidth\"\n [style.min-width.px]=\"column.minWidth\"\n (edit)=\"gridCell.handleLogicalCellEnter()\">\n <mona-grid-cell #gridCell [column]=\"column\" [row]=\"rowItem.row\"></mona-grid-cell>\n </td>\n }\n @if (gridService.contextMenuItems().length !== 0) {\n <ng-container\n [ngTemplateOutlet]=\"contextMenuTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: rowItem.row.data,\n element: rowElement,\n index: rowIndex\n }\">\n </ng-container>\n }\n </tr>\n @if (gridRow.expanded() && !gridService.rowDragInProgress()) {\n <tr monaGridDetailRow [style.width.px]=\"gridService.masterDetailRowWidth()\">\n @for (\n _ of gridService.groupColumns() | monaSlice: 0 : rowItem.depth + 1;\n track $index\n ) {\n <td\n monaGridCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [grouped]=\"true\"\n [indentCell]=\"true\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n [structuralColumn]=\"'reorder'\"\n [grouped]=\"true\"\n [indentCell]=\"true\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></td>\n }\n @let colspan = columns().length + gridService.groupColumns().length;\n <td\n monaGridDetailIndentCell\n monaGridLockedCell\n [lockedStructuralOffset]=\"\n (rowItem.depth + 1) * gridService.groupColumnWidth +\n gridService.rowReorderStructuralWidth()\n \"\n [nextRowType]=\"nextRow?.type\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.masterDetailEmptyCellWidth()\"></td>\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n [structuralColumn]=\"'selection'\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.selectionColumnWidth\"></td>\n }\n <td monaGridDetailContentCell [nextRowType]=\"nextRow?.type\" [attr.colspan]=\"colspan\">\n <ng-container\n [ngTemplateOutlet]=\"gridService.masterDetailTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: rowItem.row.data }\"></ng-container>\n </td>\n </tr>\n }\n }\n </ng-container>\n }\n </tbody>\n </table>\n</cdk-virtual-scroll-viewport>\n\n@if (gridService.hasFooter()) {\n <div [class]=\"footerClass()\" [style.margin-right.px]=\"gridService.scrollbarGutterWidth()\" #footerScrollElement>\n <div>\n <table role=\"presentation\" [class]=\"footerTableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of columns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <tfoot role=\"rowgroup\">\n <tr role=\"row\" [class]=\"footerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [footerCellWidth]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n [footerCellWidth]=\"gridService.rowReorderColumnWidth\"></td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n [footerCellWidth]=\"gridService.detailColumnWidth\"></td>\n }\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n [footerCellWidth]=\"gridService.selectionColumnWidth\"></td>\n }\n @for (column of columns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [footerColumn]=\"column\">\n <mona-grid-footer-cell [column]=\"column\" [columnIndex]=\"$index\"></mona-grid-footer-cell>\n </td>\n }\n </tr>\n </tfoot>\n </table>\n </div>\n </div>\n}\n\n<ng-template let-rowData let-element=\"element\" let-rowIndex=\"index\" #contextMenuTemplate>\n <mona-contextmenu [target]=\"element\" [items]=\"gridService.contextMenuItems()\"></mona-contextmenu>\n <!-- [context]=\"{rowData, element, rowIndex}\"-->\n</ng-template>\n", dependencies: [{ kind: "component", type: CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: GridAddRowComponent, selector: "tr[monaGridAddRow]", inputs: ["columns"] }, { kind: "component", type: GridCellComponent, selector: "mona-grid-cell", inputs: ["column", "row"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ContextMenuComponent, selector: "mona-contextmenu", inputs: ["ariaLabel", "items", "minWidth", "rounded", "size", "target", "width"], outputs: ["menuClick"] }, { kind: "directive", type: GridRowDirective, selector: "tr[monaGridRow]", inputs: ["index", "row"], exportAs: ["monaGridRow"] }, { kind: "directive", type: GridCellDirective, selector: "td[monaGridCell]", inputs: ["dataCell", "groupHeader", "groupToggle", "grouped", "indentCell", "lastInRow", "masterDetailContent", "masterDetailToggle", "nextRowType", "prevRowType"] }, { kind: "directive", type: GridDetailRowDirective, selector: "tr[monaGridDetailRow]" }, { kind: "directive", type: GridDetailIndentCellDirective, selector: "td[monaGridDetailIndentCell]", inputs: ["nextRowType"] }, { kind: "directive", type: GridDetailContentCellDirective, selector: "td[monaGridDetailContentCell]", inputs: ["nextRowType"] }, { kind: "directive", type: GridLogicalCellDirective, selector: "td[monaGridLogicalCell], th[monaGridLogicalCell]", inputs: ["cellKind", "colIndex", "columnId", "editable", "firstInRow", "groupHeader", "groupKey", "lastInRow", "rowIndex", "rowUid", "section"], outputs: ["edit", "toggleExpand"] }, { kind: "directive", type: GridLockedCellDirective, selector: "td[monaGridLockedCell], th[monaGridLockedCell]", inputs: ["column", "groupPrefixWidth", "lockedCellHeader", "lockedStructuralOffset", "structuralColumn"] }, { kind: "directive", type: GridFooterTableCellDirective, selector: "td[monaGridFooterTableCell]", inputs: ["footerCellMinWidth", "footerCellWidth", "footerColumn"] }, { kind: "component", type: GridToggleComponent, selector: "mona-grid-toggle", inputs: ["expanded", "type", "width"], outputs: ["expandedChange"] }, { kind: "component", type: GridFooterCellComponent, selector: "mona-grid-footer-cell", inputs: ["column", "columnIndex", "groupKey"] }, { kind: "component", type: GridSelectionCheckboxComponent, selector: "mona-grid-selection-checkbox", inputs: ["row", "rowIndex"] }, { kind: "component", type: GridRowReorderHandleComponent, selector: "mona-grid-row-reorder-handle", inputs: ["pageIndex", "row"] }, { kind: "pipe", type: SlicePipe, name: "monaSlice" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
208
- }
209
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridVirtualListComponent, decorators: [{
210
- type: Component,
211
- args: [{ selector: "mona-grid-virtual-list", imports: [
212
- CdkVirtualScrollViewport,
213
- CdkFixedSizeVirtualScroll,
214
- CdkVirtualForOf,
215
- GridAddRowComponent,
216
- GridCellComponent,
217
- SlicePipe,
218
- NgTemplateOutlet,
219
- ContextMenuComponent,
220
- GridRowDirective,
221
- GridCellDirective,
222
- GridDetailRowDirective,
223
- GridDetailIndentCellDirective,
224
- GridDetailContentCellDirective,
225
- GridLogicalCellDirective,
226
- GridLockedCellDirective,
227
- GridFooterTableCellDirective,
228
- GridToggleComponent,
229
- GridFooterCellComponent,
230
- GridSelectionCheckboxComponent,
231
- GridRowReorderHandleComponent
232
- ], changeDetection: ChangeDetectionStrategy.OnPush, host: {
233
- "[class]": "baseClass()",
234
- "[style.--mona-grid-row-height]": "gridService.virtualScrollOptions().height + 'px'"
235
- }, template: "@if (gridService.addRowVisible()) {\n <div\n class=\"shrink-0 overflow-hidden border-b border-b-border\"\n [style.margin-right.px]=\"gridService.scrollbarGutterWidth()\"\n #addRowScrollElement>\n <table role=\"presentation\" [class]=\"tableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of columns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <tbody role=\"rowgroup\">\n <tr monaGridAddRow [columns]=\"columns()\"></tr>\n </tbody>\n </table>\n </div>\n}\n\n<cdk-virtual-scroll-viewport\n class=\"flex-1 min-h-0\"\n [itemSize]=\"gridService.virtualScrollOptions().height\"\n [minBufferPx]=\"gridService.virtualGridMinBuffer()\"\n [maxBufferPx]=\"gridService.virtualGridMaxBuffer()\">\n <table role=\"presentation\" #bodyTable [class]=\"tableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of columns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <tbody role=\"rowgroup\" tabindex=\"0\" (focus)=\"onViewportFocus()\">\n @if (gridService.groupColumns().length === 0) {\n <ng-container *cdkVirtualFor=\"let row of data(); let rowIndex = index\">\n <tr\n monaGridRow\n [index]=\"rowIndex\"\n [row]=\"row\"\n (click)=\"onGridRowClick($event, row)\"\n #gridRow=\"monaGridRow\"\n #rowElement>\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n monaGridLogicalCell\n [structuralColumn]=\"'reorder'\"\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"row.uid\"\n [section]=\"'body'\"\n [colIndex]=\"gridService.structuralColIndexMap().get('reorder') ?? 0\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('reorder') === 0\"\n [lastInRow]=\"columns().length === 0 && gridService.structuralLastKind() === 'reorder'\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"\n [attr.colspan]=\"1\">\n <mona-grid-row-reorder-handle [row]=\"row\" [pageIndex]=\"rowIndex\" />\n </td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridCell\n monaGridLockedCell\n [structuralColumn]=\"'detail'\"\n [masterDetailToggle]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'detail'\"\n (toggleExpand)=\"onToggleDetailClick(row)\"\n [colIndex]=\"gridService.structuralColIndexMap().get('detail') ?? 0\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('detail') === 0\"\n [lastInRow]=\"columns().length === 0 && gridService.structuralLastKind() === 'detail'\"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"row.uid\"\n [section]=\"'body'\"\n [style.width.px]=\"gridService.detailColumnWidth\"\n [attr.colspan]=\"1\">\n <span class=\"flex h-full w-full items-stretch justify-center\">\n <mona-grid-toggle\n [expanded]=\"gridRow.expanded()\"\n [type]=\"'detail'\"\n [width]=\"gridService.detailColumnWidth\"\n (expandedChange)=\"onToggleDetailClick(row)\"></mona-grid-toggle>\n </span>\n </td>\n }\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n [structuralColumn]=\"'selection'\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"row.uid\"\n [section]=\"'body'\"\n [colIndex]=\"gridService.structuralColIndexMap().get('selection') ?? 0\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('selection') === 0\"\n [lastInRow]=\"columns().length === 0 && gridService.structuralLastKind() === 'selection'\"\n [style.width.px]=\"gridService.selectionColumnWidth\"\n [attr.colspan]=\"1\">\n <mona-grid-selection-checkbox [row]=\"row\" [rowIndex]=\"rowIndex\" />\n </td>\n }\n @for (column of columns(); track $index) {\n @let colIndex = $index + gridService.leadingLogicalColumnCount();\n <td\n monaGridCell\n monaGridLockedCell\n [column]=\"column\"\n [dataCell]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"column.kind\"\n [colIndex]=\"colIndex\"\n [columnId]=\"column.id\"\n [editable]=\"\n gridService.editableOptions().enabled === true &&\n gridService.editableOptions().mode === 'cell' &&\n column.kind === 'data' &&\n column.editable === true\n \"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"row.uid\"\n [section]=\"'body'\"\n [firstInRow]=\"colIndex === gridService.leadingLogicalColumnCount()\"\n [lastInRow]=\"\n colIndex === gridService.leadingLogicalColumnCount() + columns().length - 1\n \"\n [attr.colspan]=\"1\"\n [style.width.px]=\"column.calculatedWidth\"\n [style.min-width.px]=\"column.minWidth\"\n (edit)=\"gridCell.handleLogicalCellEnter()\">\n <mona-grid-cell #gridCell [column]=\"column\" [row]=\"row\"></mona-grid-cell>\n </td>\n }\n @if (gridService.contextMenuItems().length !== 0) {\n <ng-container\n [ngTemplateOutlet]=\"contextMenuTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: row.data,\n element: rowElement,\n index: rowIndex\n }\">\n </ng-container>\n }\n </tr>\n @if (gridRow.expanded() && !gridService.rowDragInProgress()) {\n <tr monaGridDetailRow [style.width.px]=\"gridService.masterDetailRowWidth()\">\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n [structuralColumn]=\"'reorder'\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></td>\n }\n <td\n monaGridCell\n monaGridLockedCell\n [lockedStructuralOffset]=\"gridService.rowReorderStructuralWidth()\"\n [indentCell]=\"true\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.masterDetailEmptyCellWidth()\"></td>\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n [structuralColumn]=\"'selection'\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.selectionColumnWidth\"></td>\n }\n <td monaGridCell [masterDetailContent]=\"true\" [attr.colspan]=\"columns().length\">\n <ng-container\n [ngTemplateOutlet]=\"gridService.masterDetailTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: row.data }\"></ng-container>\n </td>\n </tr>\n }\n </ng-container>\n } @else {\n <ng-container *cdkVirtualFor=\"let rowItem of flattenedGroupedRows(); let rowIndex = index\">\n @if (rowItem.type === \"group\") {\n @let prevRow = flattenedGroupedRows()[rowIndex - 1];\n @let isCollapsed = gridService.isGroupCollapsed(rowItem.groupKey);\n <tr\n [class]=\"groupRowClass()\"\n role=\"row\"\n [attr.aria-level]=\"rowItem.depth + 1\"\n [attr.aria-expanded]=\"!isCollapsed\">\n @for (_ of gridService.groupColumns() | monaSlice: 0 : rowItem.depth; track $index) {\n <td\n monaGridCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [grouped]=\"true\"\n [indentCell]=\"true\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n [groupPrefixWidth]=\"rowItem.depth * gridService.groupColumnWidth\"\n [grouped]=\"true\"\n [indentCell]=\"true\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></td>\n }\n\n @let colspan =\n columns().length +\n gridService.groupColumns().length +\n (gridService.masterDetailTemplate() ? 1 : 0) +\n (gridService.selectionColumnVisible() ? 1 : 0) -\n rowItem.depth +\n 1;\n\n <td\n monaGridCell\n monaGridLogicalCell\n [cellKind]=\"'group'\"\n [rowIndex]=\"rowIndex\"\n [colIndex]=\"0\"\n [section]=\"'body'\"\n [grouped]=\"true\"\n [groupHeader]=\"true\"\n [prevRowType]=\"prevRow?.type\"\n [firstInRow]=\"true\"\n [lastInRow]=\"columns().length === 0\"\n [groupKey]=\"rowItem.groupKey\"\n [attr.colspan]=\"colspan\"\n (toggleExpand)=\"onGroupExpandChange(rowItem.groupKey)\">\n <p class=\"absolute inset-0 flex items-center text-sm whitespace-nowrap overflow-hidden\">\n <mona-grid-toggle\n [expanded]=\"!isCollapsed\"\n [width]=\"gridService.groupColumnWidth\"\n [type]=\"'group'\"\n (expandedChange)=\"onGroupExpandChange(rowItem.groupKey)\"></mona-grid-toggle>\n <span class=\"font-bold\">{{ rowItem.title }}: {{ rowItem.groupValue }}</span>\n </p>\n </td>\n </tr>\n } @else if (rowItem.type === \"groupFooter\") {\n <tr role=\"row\" [class]=\"footerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [footerCellWidth]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n [footerCellWidth]=\"gridService.rowReorderColumnWidth\"></td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n [footerCellWidth]=\"gridService.detailColumnWidth\"></td>\n }\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n [footerCellWidth]=\"gridService.selectionColumnWidth\"></td>\n }\n @for (column of columns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [footerColumn]=\"column\">\n <mona-grid-footer-cell\n [column]=\"column\"\n [columnIndex]=\"$index\"\n [groupKey]=\"rowItem.groupAggregate.groupKey\"></mona-grid-footer-cell>\n </td>\n }\n </tr>\n } @else if (rowItem.type === \"data\") {\n @let nextRow = flattenedGroupedRows()[rowIndex + 1];\n @let prevRow = flattenedGroupedRows()[rowIndex - 1];\n <tr\n (click)=\"onGridRowClick($event, rowItem.row)\"\n monaGridRow\n [index]=\"rowIndex\"\n [row]=\"rowItem.row\"\n #gridRow=\"monaGridRow\"\n #rowElement>\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [grouped]=\"true\"\n [indentCell]=\"true\"\n [style.width.px]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n monaGridLogicalCell\n [structuralColumn]=\"'reorder'\"\n [grouped]=\"true\"\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [prevRowType]=\"prevRow?.type\"\n [nextRowType]=\"nextRow?.type\"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"rowItem.row.uid\"\n [section]=\"'body'\"\n [colIndex]=\"gridService.structuralColIndexMap().get('reorder') ?? 0\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('reorder') === 0\"\n [lastInRow]=\"\n columns().length === 0 && gridService.structuralLastKind() === 'reorder'\n \"\n [style.width.px]=\"gridService.rowReorderColumnWidth\">\n <mona-grid-row-reorder-handle [row]=\"rowItem.row\" [pageIndex]=\"rowIndex\" />\n </td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridCell\n monaGridLogicalCell\n monaGridLockedCell\n [structuralColumn]=\"'detail'\"\n [grouped]=\"true\"\n [masterDetailToggle]=\"true\"\n [prevRowType]=\"prevRow?.type\"\n [nextRowType]=\"nextRow?.type\"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"rowItem.row.uid\"\n [section]=\"'body'\"\n [cellKind]=\"'detail'\"\n (toggleExpand)=\"onToggleDetailClick(rowItem.row)\"\n [colIndex]=\"gridService.structuralColIndexMap().get('detail') ?? 0\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('detail') === 0\"\n [lastInRow]=\"\n columns().length === 0 && gridService.structuralLastKind() === 'detail'\n \"\n [style.width.px]=\"gridService.detailColumnWidth\">\n <span class=\"flex h-full w-full items-stretch justify-center\">\n <mona-grid-toggle\n [expanded]=\"gridRow.expanded()\"\n [type]=\"'detail'\"\n [width]=\"gridService.detailColumnWidth\"\n (expandedChange)=\"onToggleDetailClick(rowItem.row)\"></mona-grid-toggle>\n </span>\n </td>\n }\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n [structuralColumn]=\"'selection'\"\n [grouped]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [prevRowType]=\"prevRow?.type\"\n [nextRowType]=\"nextRow?.type\"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"rowItem.row.uid\"\n [section]=\"'body'\"\n [colIndex]=\"gridService.structuralColIndexMap().get('selection') ?? 0\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('selection') === 0\"\n [lastInRow]=\"\n columns().length === 0 && gridService.structuralLastKind() === 'selection'\n \"\n [style.width.px]=\"gridService.selectionColumnWidth\">\n <mona-grid-selection-checkbox [row]=\"rowItem.row\" [rowIndex]=\"rowIndex\" />\n </td>\n }\n @for (column of columns(); track $index) {\n @let colIndex = $index + gridService.leadingLogicalColumnCount();\n <td\n monaGridCell\n monaGridLockedCell\n [column]=\"column\"\n [grouped]=\"true\"\n [dataCell]=\"true\"\n [prevRowType]=\"prevRow?.type\"\n [nextRowType]=\"nextRow?.type\"\n monaGridLogicalCell\n [cellKind]=\"column.kind\"\n [colIndex]=\"colIndex\"\n [columnId]=\"column.id\"\n [editable]=\"\n gridService.editableOptions().enabled === true &&\n gridService.editableOptions().mode === 'cell' &&\n column.kind === 'data' &&\n column.editable === true\n \"\n [firstInRow]=\"colIndex === gridService.leadingLogicalColumnCount()\"\n [lastInRow]=\"\n colIndex === gridService.leadingLogicalColumnCount() + columns().length - 1\n \"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"rowItem.row.uid\"\n [section]=\"'body'\"\n [style.width.px]=\"column.calculatedWidth\"\n [style.min-width.px]=\"column.minWidth\"\n (edit)=\"gridCell.handleLogicalCellEnter()\">\n <mona-grid-cell #gridCell [column]=\"column\" [row]=\"rowItem.row\"></mona-grid-cell>\n </td>\n }\n @if (gridService.contextMenuItems().length !== 0) {\n <ng-container\n [ngTemplateOutlet]=\"contextMenuTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: rowItem.row.data,\n element: rowElement,\n index: rowIndex\n }\">\n </ng-container>\n }\n </tr>\n @if (gridRow.expanded() && !gridService.rowDragInProgress()) {\n <tr monaGridDetailRow [style.width.px]=\"gridService.masterDetailRowWidth()\">\n @for (\n _ of gridService.groupColumns() | monaSlice: 0 : rowItem.depth + 1;\n track $index\n ) {\n <td\n monaGridCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [grouped]=\"true\"\n [indentCell]=\"true\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n [structuralColumn]=\"'reorder'\"\n [grouped]=\"true\"\n [indentCell]=\"true\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></td>\n }\n @let colspan = columns().length + gridService.groupColumns().length;\n <td\n monaGridDetailIndentCell\n monaGridLockedCell\n [lockedStructuralOffset]=\"\n (rowItem.depth + 1) * gridService.groupColumnWidth +\n gridService.rowReorderStructuralWidth()\n \"\n [nextRowType]=\"nextRow?.type\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.masterDetailEmptyCellWidth()\"></td>\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridCell\n monaGridLockedCell\n [structuralColumn]=\"'selection'\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.selectionColumnWidth\"></td>\n }\n <td monaGridDetailContentCell [nextRowType]=\"nextRow?.type\" [attr.colspan]=\"colspan\">\n <ng-container\n [ngTemplateOutlet]=\"gridService.masterDetailTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: rowItem.row.data }\"></ng-container>\n </td>\n </tr>\n }\n }\n </ng-container>\n }\n </tbody>\n </table>\n</cdk-virtual-scroll-viewport>\n\n@if (gridService.hasFooter()) {\n <div [class]=\"footerClass()\" [style.margin-right.px]=\"gridService.scrollbarGutterWidth()\" #footerScrollElement>\n <div>\n <table role=\"presentation\" [class]=\"footerTableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of columns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <tfoot role=\"rowgroup\">\n <tr role=\"row\" [class]=\"footerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [footerCellWidth]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n [footerCellWidth]=\"gridService.rowReorderColumnWidth\"></td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n [footerCellWidth]=\"gridService.detailColumnWidth\"></td>\n }\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n [footerCellWidth]=\"gridService.selectionColumnWidth\"></td>\n }\n @for (column of columns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [footerColumn]=\"column\">\n <mona-grid-footer-cell [column]=\"column\" [columnIndex]=\"$index\"></mona-grid-footer-cell>\n </td>\n }\n </tr>\n </tfoot>\n </table>\n </div>\n </div>\n}\n\n<ng-template let-rowData let-element=\"element\" let-rowIndex=\"index\" #contextMenuTemplate>\n <mona-contextmenu [target]=\"element\" [items]=\"gridService.contextMenuItems()\"></mona-contextmenu>\n <!-- [context]=\"{rowData, element, rowIndex}\"-->\n</ng-template>\n" }]
236
- }], ctorParameters: () => [], propDecorators: { addRowScrollElementRef: [{ type: i0.ViewChild, args: ["addRowScrollElement", { isSignal: true }] }], bodyTableElementRef: [{ type: i0.ViewChild, args: ["bodyTable", { isSignal: true }] }], footerScrollElementRef: [{ type: i0.ViewChild, args: ["footerScrollElement", { isSignal: true }] }], viewport: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkVirtualScrollViewport), { isSignal: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }] } });
237
-
238
- export { GridVirtualListComponent };
239
- //# sourceMappingURL=nanahoshi-mona-ui-grid-grid-virtual-list.component-b1W7r45p.mjs.map