@nanahoshi/mona-ui 0.18.5 → 0.19.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/README.md +71 -13
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +17 -9
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +16 -7
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +122 -48
- package/fesm2022/nanahoshi-mona-ui-card.mjs +22 -14
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +78 -18
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +199 -77
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +1 -2
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +23 -5
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +49 -28
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +42 -26
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +28 -16
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +74 -51
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +57 -25
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +13 -5
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +17 -6
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +178 -59
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +137 -54
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-WEDbZ5vy.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-Bg7rckst.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-ibH5osCg.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-BSSpaCLL.mjs} +2 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-D9AwQFDV.mjs +145 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-hc-LeIb0.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-Byb9iTes.mjs} +21 -17
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-DYajpOb9.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-CBmdtrXm.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-Pm8Fbp6M.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-DPmJmCap.mjs} +90 -42
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +1168 -0
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +12 -4
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +48 -21
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +33 -18
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +10 -10
- package/fesm2022/nanahoshi-mona-ui-list.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +29 -16
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +12 -3
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +23 -18
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +211 -106
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +14 -6
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +46 -19
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +57 -46
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +35 -15
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +38 -17
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +25 -7
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +431 -101
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +26 -8
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +222 -28
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +91 -36
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +34 -15
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +39 -23
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +50 -25
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +32 -14
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +9 -9
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +74 -56
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +16 -8
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +33 -19
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +66 -27
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +23 -15
- package/fesm2022/nanahoshi-mona-ui-window.mjs +71 -40
- package/i18n/package.json +4 -0
- package/package.json +5 -1
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +6 -1
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +9 -3
- package/types/nanahoshi-mona-ui-button-group.d.ts +9 -3
- package/types/nanahoshi-mona-ui-calendar.d.ts +13 -3
- package/types/nanahoshi-mona-ui-card.d.ts +8 -2
- package/types/nanahoshi-mona-ui-chart.d.ts +10 -1
- package/types/nanahoshi-mona-ui-chip.d.ts +14 -5
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +6 -1
- package/types/nanahoshi-mona-ui-color-palette.d.ts +21 -10
- package/types/nanahoshi-mona-ui-color-picker.d.ts +30 -20
- package/types/nanahoshi-mona-ui-combo-box.d.ts +6 -1
- package/types/nanahoshi-mona-ui-date-picker.d.ts +7 -2
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +33 -8
- package/types/nanahoshi-mona-ui-dialog.d.ts +16 -7
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +6 -1
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +4 -1
- package/types/nanahoshi-mona-ui-editor.d.ts +6 -1
- package/types/nanahoshi-mona-ui-filter.d.ts +16 -10
- package/types/nanahoshi-mona-ui-grid.d.ts +38 -1
- package/types/nanahoshi-mona-ui-i18n.d.ts +633 -0
- package/types/nanahoshi-mona-ui-internal-list.d.ts +7 -2
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +7 -3
- package/types/nanahoshi-mona-ui-list-box.d.ts +9 -4
- package/types/nanahoshi-mona-ui-list-view.d.ts +6 -6
- package/types/nanahoshi-mona-ui-list.d.ts +1 -1
- package/types/nanahoshi-mona-ui-menubar.d.ts +59 -58
- package/types/nanahoshi-mona-ui-multi-select.d.ts +6 -1
- package/types/nanahoshi-mona-ui-notification.d.ts +11 -5
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +24 -15
- package/types/nanahoshi-mona-ui-otp-input.d.ts +9 -3
- package/types/nanahoshi-mona-ui-pager.d.ts +19 -6
- package/types/nanahoshi-mona-ui-popup.d.ts +2 -1
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +9 -7
- package/types/nanahoshi-mona-ui-rating.d.ts +19 -12
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +34 -28
- package/types/nanahoshi-mona-ui-sheet.d.ts +8 -2
- package/types/nanahoshi-mona-ui-sidebar.d.ts +3 -0
- package/types/nanahoshi-mona-ui-slider.d.ts +44 -26
- package/types/nanahoshi-mona-ui-spinner.d.ts +13 -4
- package/types/nanahoshi-mona-ui-split-button.d.ts +62 -56
- package/types/nanahoshi-mona-ui-splitter.d.ts +9 -6
- package/types/nanahoshi-mona-ui-stepper.d.ts +9 -3
- package/types/nanahoshi-mona-ui-switch.d.ts +1 -1
- package/types/nanahoshi-mona-ui-tabs.d.ts +96 -35
- package/types/nanahoshi-mona-ui-text-box.d.ts +11 -5
- package/types/nanahoshi-mona-ui-time-picker.d.ts +7 -2
- package/types/nanahoshi-mona-ui-time-selector.d.ts +16 -5
- package/types/nanahoshi-mona-ui-tree-view.d.ts +15 -10
- package/types/nanahoshi-mona-ui-window.d.ts +26 -20
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ZM3CneJ0.mjs +0 -145
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { CdkDropList, CdkDrag, CdkDragPreview } from '@angular/cdk/drag-drop';
|
|
2
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { inject, DestroyRef, ElementRef, viewChild, computed, input, afterNextRender, Component } from '@angular/core';
|
|
5
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
+
import { ImmutableList, span } from '@mirei/ts-collections';
|
|
7
|
+
import { SlicePipe } from '@nanahoshi/mona-ui/common';
|
|
8
|
+
import { ContextMenuComponent } from '@nanahoshi/mona-ui/contextmenu';
|
|
9
|
+
import { fromEvent } from 'rxjs';
|
|
10
|
+
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-Byb9iTes.mjs';
|
|
11
|
+
import { GridFooterTableCellDirective } from './nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-BSSpaCLL.mjs';
|
|
12
|
+
import { G as GridNavigationService, a as GridRowFlattenerService, g as gridListBaseThemeVariants, b as gridFooterTableRowThemeVariants, c as GridService, d as gridGroupRowThemeVariants, e as gridRowDragPlaceholderThemeVariants, f as gridRowDragPreviewThemeVariants, h as gridListTableThemeVariants, i as GridLogicalCellDirective, j as GridLockedCellDirective } from './nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-DPmJmCap.mjs';
|
|
13
|
+
import { GridFooterCellComponent } from './nanahoshi-mona-ui-grid-grid-footer-cell.component-Bg7rckst.mjs';
|
|
14
|
+
|
|
15
|
+
class GridListComponent {
|
|
16
|
+
#destroyRef;
|
|
17
|
+
#gridNavigationService;
|
|
18
|
+
#hostElementRef;
|
|
19
|
+
#rowFlattener;
|
|
20
|
+
constructor() {
|
|
21
|
+
this.#destroyRef = inject(DestroyRef);
|
|
22
|
+
this.#gridNavigationService = inject(GridNavigationService);
|
|
23
|
+
this.#hostElementRef = inject((ElementRef));
|
|
24
|
+
this.#rowFlattener = inject(GridRowFlattenerService);
|
|
25
|
+
this.bodyTableElementRef = viewChild.required("bodyTable", /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "bodyTableElementRef" }] : /* istanbul ignore next */ []));
|
|
27
|
+
this.baseClass = computed(() => {
|
|
28
|
+
return gridListBaseThemeVariants({ virtual: false });
|
|
29
|
+
}, /* @ts-ignore */
|
|
30
|
+
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
31
|
+
this.flattenedGroupedRows = computed(() => {
|
|
32
|
+
const groupColumns = this.gridService.groupColumns();
|
|
33
|
+
if (groupColumns.length === 0) {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
const collapsedKeys = new Set(this.gridService.collapsedGroupKeys());
|
|
37
|
+
const groupAggregateDict = this.gridService.groupAggregateMap().toDictionary(e => e.key, e => e.value);
|
|
38
|
+
const showFooter = this.gridService.groupableOptions().showFooter;
|
|
39
|
+
return this.#rowFlattener.flatten(this.data(), groupColumns, collapsedKeys, showFooter, groupAggregateDict);
|
|
40
|
+
}, /* @ts-ignore */
|
|
41
|
+
...(ngDevMode ? [{ debugName: "flattenedGroupedRows" }] : /* istanbul ignore next */ []));
|
|
42
|
+
this.footerTableRowClass = computed(() => {
|
|
43
|
+
return gridFooterTableRowThemeVariants();
|
|
44
|
+
}, /* @ts-ignore */
|
|
45
|
+
...(ngDevMode ? [{ debugName: "footerTableRowClass" }] : /* istanbul ignore next */ []));
|
|
46
|
+
this.gridService = inject(GridService);
|
|
47
|
+
this.groupRowClass = computed(() => {
|
|
48
|
+
return gridGroupRowThemeVariants();
|
|
49
|
+
}, /* @ts-ignore */
|
|
50
|
+
...(ngDevMode ? [{ debugName: "groupRowClass" }] : /* istanbul ignore next */ []));
|
|
51
|
+
this.rowDragPlaceholderClass = computed(() => {
|
|
52
|
+
return gridRowDragPlaceholderThemeVariants();
|
|
53
|
+
}, /* @ts-ignore */
|
|
54
|
+
...(ngDevMode ? [{ debugName: "rowDragPlaceholderClass" }] : /* istanbul ignore next */ []));
|
|
55
|
+
this.rowDragPreviewClass = computed(() => {
|
|
56
|
+
return gridRowDragPreviewThemeVariants();
|
|
57
|
+
}, /* @ts-ignore */
|
|
58
|
+
...(ngDevMode ? [{ debugName: "rowDragPreviewClass" }] : /* istanbul ignore next */ []));
|
|
59
|
+
this.tableClass = computed(() => {
|
|
60
|
+
return gridListTableThemeVariants();
|
|
61
|
+
}, /* @ts-ignore */
|
|
62
|
+
...(ngDevMode ? [{ debugName: "tableClass" }] : /* istanbul ignore next */ []));
|
|
63
|
+
this.columns = input(ImmutableList.create(), /* @ts-ignore */
|
|
64
|
+
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
65
|
+
this.data = input(ImmutableList.create(), /* @ts-ignore */
|
|
66
|
+
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
67
|
+
this.span = span;
|
|
68
|
+
afterNextRender({
|
|
69
|
+
read: () => {
|
|
70
|
+
const bodyTableElement = this.bodyTableElementRef().nativeElement;
|
|
71
|
+
const bodyScrollElement = this.#hostElementRef.nativeElement;
|
|
72
|
+
this.gridService.bodyTableElement.set(bodyTableElement);
|
|
73
|
+
this.gridService.bodyScrollElement.set(bodyScrollElement);
|
|
74
|
+
this.setSubscriptions();
|
|
75
|
+
this.#destroyRef.onDestroy(() => {
|
|
76
|
+
if (this.gridService.bodyTableElement() === bodyTableElement) {
|
|
77
|
+
this.gridService.bodyTableElement.set(null);
|
|
78
|
+
}
|
|
79
|
+
if (this.gridService.bodyScrollElement() === bodyScrollElement) {
|
|
80
|
+
this.gridService.bodyScrollElement.set(null);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
onGridRowClick(event, row) {
|
|
87
|
+
this.gridService.handleRowClick(event, row);
|
|
88
|
+
}
|
|
89
|
+
onGroupExpandChange(groupKey) {
|
|
90
|
+
this.gridService.toggleGroupCollapse(groupKey);
|
|
91
|
+
}
|
|
92
|
+
onRowDragEnded(_event) {
|
|
93
|
+
this.gridService.draggingRowUid.set(null);
|
|
94
|
+
}
|
|
95
|
+
onRowDragStarted(event) {
|
|
96
|
+
this.gridService.draggingRowUid.set(event.source.data.uid);
|
|
97
|
+
}
|
|
98
|
+
onRowDrop(event) {
|
|
99
|
+
this.gridService.draggingRowUid.set(null);
|
|
100
|
+
this.gridService.requestRowReorder(event.item.data, event.previousIndex, event.currentIndex);
|
|
101
|
+
}
|
|
102
|
+
onToggleDetailClick(row) {
|
|
103
|
+
const expanded = this.gridService.isRowExpanded(row);
|
|
104
|
+
this.gridService.setRowExpanded(row, !expanded);
|
|
105
|
+
}
|
|
106
|
+
setSubscriptions() {
|
|
107
|
+
fromEvent(this.#hostElementRef.nativeElement, "focus")
|
|
108
|
+
.pipe(takeUntilDestroyed(this.#destroyRef))
|
|
109
|
+
.subscribe(() => {
|
|
110
|
+
this.#gridNavigationService.focusActiveCellOrFirstHeader();
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
114
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridListComponent, isStandalone: true, selector: "mona-grid-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()" } }, viewQueries: [{ propertyName: "bodyTableElementRef", first: true, predicate: ["bodyTable"], descendants: true, isSignal: true }], ngImport: i0, template: "<table #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\n role=\"rowgroup\"\n cdkDropList\n [cdkDropListData]=\"data().toArray()\"\n [cdkDropListDisabled]=\"!gridService.rowReorderInteractionEnabled()\"\n (cdkDropListDropped)=\"onRowDrop($event)\">\n @if (gridService.addRowVisible()) {\n <tr monaGridAddRow [columns]=\"columns()\"></tr>\n }\n @if (gridService.groupColumns().length === 0) {\n @for (row of data(); track row.uid) {\n @let rowIndex = $index;\n <tr\n (click)=\"onGridRowClick($event, row)\"\n monaGridRow\n cdkDrag\n cdkDragLockAxis=\"y\"\n [cdkDragData]=\"row\"\n [cdkDragDisabled]=\"!gridService.canReorderRow(row)\"\n (cdkDragStarted)=\"onRowDragStarted($event)\"\n (cdkDragEnded)=\"onRowDragEnded($event)\"\n [index]=\"rowIndex\"\n [row]=\"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 [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 ===\n 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]=\"{ $implicit: row.data, element: rowElement, index: $index }\">\n </ng-container>\n }\n <ng-template cdkDragPreview>\n <div [class]=\"rowDragPreviewClass()\">\n <i aria-hidden=\"true\" class=\"ri-draggable\"></i>\n <span>{{ gridService.getRowReorderAriaLabel(row, rowIndex + gridService.paginationState().skip) }}</span>\n </div>\n </ng-template>\n <ng-template cdkDragPlaceholder>\n <tr [class]=\"rowDragPlaceholderClass()\">\n <td\n [attr.colspan]=\"gridService.leadingStructuralColumnCount() + columns().length\"\n class=\"h-9 px-2\">\n <span class=\"flex items-center text-xs text-muted-foreground\">{{ gridService.messages().moveRow }}</span>\n </td>\n </tr>\n </ng-template>\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 }\n } @else {\n @for (viewRow of flattenedGroupedRows(); track $index) {\n @let rowIndex = $index;\n @if (viewRow.type === \"group\") {\n @let isCollapsed = gridService.isGroupCollapsed(viewRow.groupKey);\n @let prevRow = flattenedGroupedRows()[rowIndex - 1];\n\n <tr\n [class]=\"groupRowClass()\"\n role=\"row\"\n [attr.aria-level]=\"viewRow.depth + 1\"\n [attr.aria-expanded]=\"!isCollapsed\">\n @for (_ of gridService.groupColumns() | monaSlice: 0 : viewRow.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]=\"viewRow.depth * gridService.groupColumnWidth\"\n [grouped]=\"true\"\n [indentCell]=\"true\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></td>\n }\n @let colspan =\n columns().length +\n gridService.groupColumns().length +\n (gridService.masterDetailTemplate() ? 1 : 0) +\n (gridService.selectionColumnVisible() ? 1 : 0) -\n viewRow.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]=\"viewRow.groupKey\"\n (toggle)=\"onGroupExpandChange(viewRow.groupKey)\"\n [attr.colspan]=\"colspan\">\n <p class=\"flex h-full items-center text-sm whitespace-nowrap\">\n <mona-grid-toggle\n [expanded]=\"!isCollapsed\"\n [width]=\"gridService.groupColumnWidth\"\n [type]=\"'group'\"\n (expandedChange)=\"onGroupExpandChange(viewRow.groupKey)\"></mona-grid-toggle>\n <span class=\"font-bold\">{{ viewRow.title }}: {{ viewRow.groupValue }}</span>\n </p>\n </td>\n </tr>\n } @else if (viewRow.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]=\"viewRow.groupAggregate.groupKey\"></mona-grid-footer-cell>\n </td>\n }\n </tr>\n } @else {\n @let nextRow = flattenedGroupedRows()[rowIndex + 1];\n @let prevRow = flattenedGroupedRows()[rowIndex - 1];\n <tr\n (click)=\"onGridRowClick($event, viewRow.row)\"\n monaGridRow\n [index]=\"rowIndex\"\n [row]=\"viewRow.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\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]=\"viewRow.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 <mona-grid-row-reorder-handle [row]=\"viewRow.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]=\"viewRow.row.uid\"\n [section]=\"'body'\"\n [cellKind]=\"'detail'\"\n [colIndex]=\"gridService.structuralColIndexMap().get('detail') ?? 0\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('detail') === 0\"\n [lastInRow]=\"columns().length === 0 && gridService.structuralLastKind() === 'detail'\"\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(viewRow.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]=\"viewRow.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 <mona-grid-selection-checkbox [row]=\"viewRow.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 ===\n gridService.leadingLogicalColumnCount() + columns().length - 1\n \"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"viewRow.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]=\"viewRow.row\"></mona-grid-cell>\n </td>\n }\n @if (gridService.contextMenuItems().length !== 0) {\n <ng-container\n [ngTemplateOutlet]=\"contextMenuTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: viewRow.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 (_ of gridService.groupColumns() | monaSlice: 0 : viewRow.depth + 1; 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 [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 - 1;\n <td\n monaGridDetailIndentCell\n monaGridLockedCell\n [lockedStructuralOffset]=\"\n (viewRow.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: viewRow.row.data }\"></ng-container>\n </td>\n </tr>\n }\n }\n }\n }\n </tbody>\n</table>\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: 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: "component", type: GridToggleComponent, selector: "mona-grid-toggle", inputs: ["expanded", "type", "width"], outputs: ["expandedChange"] }, { kind: "directive", type: GridFooterTableCellDirective, selector: "td[monaGridFooterTableCell]", inputs: ["footerCellMinWidth", "footerCellWidth", "footerColumn"] }, { kind: "directive", type: GridLogicalCellDirective, selector: "td[monaGridLogicalCell], th[monaGridLogicalCell]", inputs: ["cellKind", "colIndex", "columnId", "editable", "firstInRow", "groupHeader", "groupKey", "lastInRow", "rowIndex", "rowUid", "section"], outputs: ["edit", "toggle"] }, { kind: "directive", type: GridLockedCellDirective, selector: "td[monaGridLockedCell], th[monaGridLockedCell]", inputs: ["column", "groupPrefixWidth", "lockedCellHeader", "lockedStructuralOffset", "structuralColumn"] }, { 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: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragPreview, selector: "ng-template[cdkDragPreview]", inputs: ["data", "matchSize"] }, { kind: "pipe", type: SlicePipe, name: "monaSlice" }] }); }
|
|
115
|
+
}
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridListComponent, decorators: [{
|
|
117
|
+
type: Component,
|
|
118
|
+
args: [{ selector: "mona-grid-list", imports: [
|
|
119
|
+
GridAddRowComponent,
|
|
120
|
+
GridCellComponent,
|
|
121
|
+
NgTemplateOutlet,
|
|
122
|
+
ContextMenuComponent,
|
|
123
|
+
GridRowDirective,
|
|
124
|
+
GridCellDirective,
|
|
125
|
+
GridDetailRowDirective,
|
|
126
|
+
GridDetailIndentCellDirective,
|
|
127
|
+
GridDetailContentCellDirective,
|
|
128
|
+
SlicePipe,
|
|
129
|
+
GridToggleComponent,
|
|
130
|
+
GridFooterTableCellDirective,
|
|
131
|
+
GridLogicalCellDirective,
|
|
132
|
+
GridLockedCellDirective,
|
|
133
|
+
GridFooterCellComponent,
|
|
134
|
+
GridSelectionCheckboxComponent,
|
|
135
|
+
GridRowReorderHandleComponent,
|
|
136
|
+
CdkDropList,
|
|
137
|
+
CdkDrag,
|
|
138
|
+
CdkDragPreview
|
|
139
|
+
], host: {
|
|
140
|
+
"[class]": "baseClass()"
|
|
141
|
+
}, template: "<table #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\n role=\"rowgroup\"\n cdkDropList\n [cdkDropListData]=\"data().toArray()\"\n [cdkDropListDisabled]=\"!gridService.rowReorderInteractionEnabled()\"\n (cdkDropListDropped)=\"onRowDrop($event)\">\n @if (gridService.addRowVisible()) {\n <tr monaGridAddRow [columns]=\"columns()\"></tr>\n }\n @if (gridService.groupColumns().length === 0) {\n @for (row of data(); track row.uid) {\n @let rowIndex = $index;\n <tr\n (click)=\"onGridRowClick($event, row)\"\n monaGridRow\n cdkDrag\n cdkDragLockAxis=\"y\"\n [cdkDragData]=\"row\"\n [cdkDragDisabled]=\"!gridService.canReorderRow(row)\"\n (cdkDragStarted)=\"onRowDragStarted($event)\"\n (cdkDragEnded)=\"onRowDragEnded($event)\"\n [index]=\"rowIndex\"\n [row]=\"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 [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 ===\n 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]=\"{ $implicit: row.data, element: rowElement, index: $index }\">\n </ng-container>\n }\n <ng-template cdkDragPreview>\n <div [class]=\"rowDragPreviewClass()\">\n <i aria-hidden=\"true\" class=\"ri-draggable\"></i>\n <span>{{ gridService.getRowReorderAriaLabel(row, rowIndex + gridService.paginationState().skip) }}</span>\n </div>\n </ng-template>\n <ng-template cdkDragPlaceholder>\n <tr [class]=\"rowDragPlaceholderClass()\">\n <td\n [attr.colspan]=\"gridService.leadingStructuralColumnCount() + columns().length\"\n class=\"h-9 px-2\">\n <span class=\"flex items-center text-xs text-muted-foreground\">{{ gridService.messages().moveRow }}</span>\n </td>\n </tr>\n </ng-template>\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 }\n } @else {\n @for (viewRow of flattenedGroupedRows(); track $index) {\n @let rowIndex = $index;\n @if (viewRow.type === \"group\") {\n @let isCollapsed = gridService.isGroupCollapsed(viewRow.groupKey);\n @let prevRow = flattenedGroupedRows()[rowIndex - 1];\n\n <tr\n [class]=\"groupRowClass()\"\n role=\"row\"\n [attr.aria-level]=\"viewRow.depth + 1\"\n [attr.aria-expanded]=\"!isCollapsed\">\n @for (_ of gridService.groupColumns() | monaSlice: 0 : viewRow.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]=\"viewRow.depth * gridService.groupColumnWidth\"\n [grouped]=\"true\"\n [indentCell]=\"true\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></td>\n }\n @let colspan =\n columns().length +\n gridService.groupColumns().length +\n (gridService.masterDetailTemplate() ? 1 : 0) +\n (gridService.selectionColumnVisible() ? 1 : 0) -\n viewRow.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]=\"viewRow.groupKey\"\n (toggle)=\"onGroupExpandChange(viewRow.groupKey)\"\n [attr.colspan]=\"colspan\">\n <p class=\"flex h-full items-center text-sm whitespace-nowrap\">\n <mona-grid-toggle\n [expanded]=\"!isCollapsed\"\n [width]=\"gridService.groupColumnWidth\"\n [type]=\"'group'\"\n (expandedChange)=\"onGroupExpandChange(viewRow.groupKey)\"></mona-grid-toggle>\n <span class=\"font-bold\">{{ viewRow.title }}: {{ viewRow.groupValue }}</span>\n </p>\n </td>\n </tr>\n } @else if (viewRow.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]=\"viewRow.groupAggregate.groupKey\"></mona-grid-footer-cell>\n </td>\n }\n </tr>\n } @else {\n @let nextRow = flattenedGroupedRows()[rowIndex + 1];\n @let prevRow = flattenedGroupedRows()[rowIndex - 1];\n <tr\n (click)=\"onGridRowClick($event, viewRow.row)\"\n monaGridRow\n [index]=\"rowIndex\"\n [row]=\"viewRow.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\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]=\"viewRow.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 <mona-grid-row-reorder-handle [row]=\"viewRow.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]=\"viewRow.row.uid\"\n [section]=\"'body'\"\n [cellKind]=\"'detail'\"\n [colIndex]=\"gridService.structuralColIndexMap().get('detail') ?? 0\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('detail') === 0\"\n [lastInRow]=\"columns().length === 0 && gridService.structuralLastKind() === 'detail'\"\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(viewRow.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]=\"viewRow.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 <mona-grid-selection-checkbox [row]=\"viewRow.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 ===\n gridService.leadingLogicalColumnCount() + columns().length - 1\n \"\n [rowIndex]=\"rowIndex\"\n [rowUid]=\"viewRow.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]=\"viewRow.row\"></mona-grid-cell>\n </td>\n }\n @if (gridService.contextMenuItems().length !== 0) {\n <ng-container\n [ngTemplateOutlet]=\"contextMenuTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: viewRow.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 (_ of gridService.groupColumns() | monaSlice: 0 : viewRow.depth + 1; 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 [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 - 1;\n <td\n monaGridDetailIndentCell\n monaGridLockedCell\n [lockedStructuralOffset]=\"\n (viewRow.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: viewRow.row.data }\"></ng-container>\n </td>\n </tr>\n }\n }\n }\n }\n </tbody>\n</table>\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" }]
|
|
142
|
+
}], ctorParameters: () => [], propDecorators: { bodyTableElementRef: [{ type: i0.ViewChild, args: ["bodyTable", { isSignal: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }] } });
|
|
143
|
+
|
|
144
|
+
export { GridListComponent };
|
|
145
|
+
//# sourceMappingURL=nanahoshi-mona-ui-grid-grid-list.component-D9AwQFDV.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { computed, input, Directive, inject, Component, signal, ElementRef, viewChild, output, effect, untracked, afterNextRender, ChangeDetectionStrategy, Injector, LOCALE_ID, model } from '@angular/core';
|
|
3
|
-
import { m as gridListTableCellThemeVariants, n as gridDetailContentCellThemeVariants, o as gridDetailIndentCellThemeVariants, p as gridDetailRowThemeVariants, c as GridService, q as gridListTableRowThemeVariants, r as gridCellEditorBaseThemeVariants, s as gridCellEditorInputThemeVariants, j as GridLockedCellDirective, i as GridLogicalCellDirective, G as GridNavigationService, t as gridCellBaseThemeVariants, u as gridCellContainerThemeVariants, v as gridCellDirtyIndicatorThemeVariants, w as gridCellTextThemeVariants, x as gridRowReorderHandleThemeVariants, y as gridSelectionCellThemeVariants } from './nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-
|
|
3
|
+
import { m as gridListTableCellThemeVariants, n as gridDetailContentCellThemeVariants, o as gridDetailIndentCellThemeVariants, p as gridDetailRowThemeVariants, c as GridService, q as gridListTableRowThemeVariants, r as gridCellEditorBaseThemeVariants, s as gridCellEditorInputThemeVariants, j as GridLockedCellDirective, i as GridLogicalCellDirective, G as GridNavigationService, t as gridCellBaseThemeVariants, u as gridCellContainerThemeVariants, v as gridCellDirtyIndicatorThemeVariants, w as gridCellTextThemeVariants, x as gridRowReorderHandleThemeVariants, y as gridSelectionCellThemeVariants } from './nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-DPmJmCap.mjs';
|
|
4
4
|
import { ImmutableList } from '@mirei/ts-collections';
|
|
5
5
|
import * as i1 from '@angular/cdk/a11y';
|
|
6
6
|
import { A11yModule, LiveAnnouncer } from '@angular/cdk/a11y';
|
|
@@ -212,6 +212,8 @@ class GridCommandCellComponent {
|
|
|
212
212
|
return this.newRow() || (row != null && context?.mode === "row" && context.rowUid === row.uid);
|
|
213
213
|
}, /* @ts-ignore */
|
|
214
214
|
...(ngDevMode ? [{ debugName: "isEditing" }] : /* istanbul ignore next */ []));
|
|
215
|
+
this.messages = computed(() => this.gridService.messages(), /* @ts-ignore */
|
|
216
|
+
...(ngDevMode ? [{ debugName: "messages" }] : /* istanbul ignore next */ []));
|
|
215
217
|
this.rowErrorMessages = computed(() => {
|
|
216
218
|
if (!this.isEditing()) {
|
|
217
219
|
return [];
|
|
@@ -227,7 +229,7 @@ class GridCommandCellComponent {
|
|
|
227
229
|
.filter((message) => !!message);
|
|
228
230
|
}, /* @ts-ignore */
|
|
229
231
|
...(ngDevMode ? [{ debugName: "rowErrorMessages" }] : /* istanbul ignore next */ []));
|
|
230
|
-
this.rowErrorTooltip = computed(() => this.rowErrorMessages().join("\n") ||
|
|
232
|
+
this.rowErrorTooltip = computed(() => this.rowErrorMessages().join("\n") || this.messages().rowValidationError, /* @ts-ignore */
|
|
231
233
|
...(ngDevMode ? [{ debugName: "rowErrorTooltip" }] : /* istanbul ignore next */ []));
|
|
232
234
|
this.column = input.required(/* @ts-ignore */
|
|
233
235
|
...(ngDevMode ? [{ debugName: "column" }] : /* istanbul ignore next */ []));
|
|
@@ -267,18 +269,18 @@ class GridCommandCellComponent {
|
|
|
267
269
|
}
|
|
268
270
|
const dialogRef = this.#dialogService.show({
|
|
269
271
|
actions: [
|
|
270
|
-
{ look: "error", text:
|
|
271
|
-
{ look: "default", text:
|
|
272
|
+
{ look: "error", text: this.messages().delete },
|
|
273
|
+
{ look: "default", text: this.messages().cancel }
|
|
272
274
|
],
|
|
273
275
|
closeOnEscape: true,
|
|
274
|
-
text:
|
|
275
|
-
title:
|
|
276
|
+
text: this.messages().deleteRowConfirmation,
|
|
277
|
+
title: this.messages().deleteRowTitle,
|
|
276
278
|
type: "warning",
|
|
277
279
|
modal: true,
|
|
278
280
|
width: 360
|
|
279
281
|
});
|
|
280
282
|
dialogRef.result.pipe(take(1)).subscribe(result => {
|
|
281
|
-
if (!result.viaClose && result.action.text ===
|
|
283
|
+
if (!result.viaClose && result.action.text === this.messages().delete) {
|
|
282
284
|
this.gridService.removeRow(row, event);
|
|
283
285
|
}
|
|
284
286
|
dialogRef.close();
|
|
@@ -293,7 +295,7 @@ class GridCommandCellComponent {
|
|
|
293
295
|
this.gridService.commitRowEdit(event);
|
|
294
296
|
}
|
|
295
297
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridCommandCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
296
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridCommandCellComponent, isStandalone: true, selector: "mona-grid-command-cell", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, newRow: { classPropertyName: "newRow", publicName: "newRow", isSignal: true, isRequired: false, transformFunction: null }, row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "w-full" }, ngImport: i0, template: "@if (column().commandTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column().commandTemplate\"\n [ngTemplateOutletContext]=\"commandContext()\"></ng-container>\n} @else {\n <div class=\"flex h-full items-center gap-1 px-1\">\n @if (isEditing()) {\n @if (hasRowError()) {\n <span class=\"shrink-0 px-1 text-error\" #rowErrorIcon>\n <svg lucideOctagonAlert [size]=\"14\"></svg>\n </span>\n <mona-tooltip [target]=\"rowErrorIcon\">\n <span class=\"p-1 whitespace-pre-line\">{{ rowErrorTooltip() }}</span>\n </mona-tooltip>\n }\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n [iconOnly]=\"true\"\n aria-label=\"
|
|
298
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridCommandCellComponent, isStandalone: true, selector: "mona-grid-command-cell", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, newRow: { classPropertyName: "newRow", publicName: "newRow", isSignal: true, isRequired: false, transformFunction: null }, row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "w-full" }, ngImport: i0, template: "@if (column().commandTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column().commandTemplate\"\n [ngTemplateOutletContext]=\"commandContext()\"></ng-container>\n} @else {\n <div class=\"flex h-full items-center gap-1 px-1\">\n @if (isEditing()) {\n @if (hasRowError()) {\n <span class=\"shrink-0 px-1 text-error\" #rowErrorIcon>\n <svg lucideOctagonAlert [size]=\"14\"></svg>\n </span>\n <mona-tooltip [target]=\"rowErrorIcon\">\n <span class=\"p-1 whitespace-pre-line\">{{ rowErrorTooltip() }}</span>\n </mona-tooltip>\n }\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n [iconOnly]=\"true\"\n [attr.aria-label]=\"messages().saveRow\"\n [attr.title]=\"messages().save\"\n class=\"w-6 h-6\"\n [tabindex]=\"-1\"\n (click)=\"save($event)\">\n <svg lucideCheck [size]=\"14\"></svg>\n </button>\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n [iconOnly]=\"true\"\n [attr.aria-label]=\"messages().cancelRowEdit\"\n [attr.title]=\"messages().cancel\"\n class=\"w-6 h-6\"\n [tabindex]=\"-1\"\n (click)=\"cancel($event)\">\n <svg lucideX [size]=\"14\"></svg>\n </button>\n } @else {\n @if (canEditRows()) {\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n [iconOnly]=\"true\"\n [attr.aria-label]=\"messages().editRow\"\n [attr.title]=\"messages().edit\"\n class=\"w-6 h-6\"\n [tabindex]=\"-1\"\n (click)=\"edit($event)\">\n <svg lucidePencil [size]=\"14\"></svg>\n </button>\n }\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n [iconOnly]=\"true\"\n [attr.aria-label]=\"messages().removeRow\"\n [attr.title]=\"messages().remove\"\n class=\"w-6 h-6\"\n [tabindex]=\"-1\"\n (click)=\"remove($event)\">\n <svg lucideTrash2 [size]=\"14\"></svg>\n </button>\n }\n </div>\n}\n", dependencies: [{ kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LucideCheck, selector: "svg[lucideCheck]" }, { kind: "component", type: LucideOctagonAlert, selector: "svg[lucideOctagonAlert], svg[lucideAlertOctagon]" }, { kind: "component", type: LucideX, selector: "svg[lucideX]" }, { kind: "component", type: LucidePencil, selector: "svg[lucidePencil]" }, { kind: "component", type: LucideTrash2, selector: "svg[lucideTrash2]" }, { kind: "component", type: TooltipComponent, selector: "mona-tooltip", inputs: ["disabled", "hideDelay", "position", "rounded", "showDelay", "target"], outputs: ["hidden", "shown"] }] }); }
|
|
297
299
|
}
|
|
298
300
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridCommandCellComponent, decorators: [{
|
|
299
301
|
type: Component,
|
|
@@ -308,18 +310,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
308
310
|
TooltipComponent
|
|
309
311
|
], host: {
|
|
310
312
|
class: "w-full"
|
|
311
|
-
}, template: "@if (column().commandTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column().commandTemplate\"\n [ngTemplateOutletContext]=\"commandContext()\"></ng-container>\n} @else {\n <div class=\"flex h-full items-center gap-1 px-1\">\n @if (isEditing()) {\n @if (hasRowError()) {\n <span class=\"shrink-0 px-1 text-error\" #rowErrorIcon>\n <svg lucideOctagonAlert [size]=\"14\"></svg>\n </span>\n <mona-tooltip [target]=\"rowErrorIcon\">\n <span class=\"p-1 whitespace-pre-line\">{{ rowErrorTooltip() }}</span>\n </mona-tooltip>\n }\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n [iconOnly]=\"true\"\n aria-label=\"
|
|
313
|
+
}, template: "@if (column().commandTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column().commandTemplate\"\n [ngTemplateOutletContext]=\"commandContext()\"></ng-container>\n} @else {\n <div class=\"flex h-full items-center gap-1 px-1\">\n @if (isEditing()) {\n @if (hasRowError()) {\n <span class=\"shrink-0 px-1 text-error\" #rowErrorIcon>\n <svg lucideOctagonAlert [size]=\"14\"></svg>\n </span>\n <mona-tooltip [target]=\"rowErrorIcon\">\n <span class=\"p-1 whitespace-pre-line\">{{ rowErrorTooltip() }}</span>\n </mona-tooltip>\n }\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n [iconOnly]=\"true\"\n [attr.aria-label]=\"messages().saveRow\"\n [attr.title]=\"messages().save\"\n class=\"w-6 h-6\"\n [tabindex]=\"-1\"\n (click)=\"save($event)\">\n <svg lucideCheck [size]=\"14\"></svg>\n </button>\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n [iconOnly]=\"true\"\n [attr.aria-label]=\"messages().cancelRowEdit\"\n [attr.title]=\"messages().cancel\"\n class=\"w-6 h-6\"\n [tabindex]=\"-1\"\n (click)=\"cancel($event)\">\n <svg lucideX [size]=\"14\"></svg>\n </button>\n } @else {\n @if (canEditRows()) {\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n [iconOnly]=\"true\"\n [attr.aria-label]=\"messages().editRow\"\n [attr.title]=\"messages().edit\"\n class=\"w-6 h-6\"\n [tabindex]=\"-1\"\n (click)=\"edit($event)\">\n <svg lucidePencil [size]=\"14\"></svg>\n </button>\n }\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n [iconOnly]=\"true\"\n [attr.aria-label]=\"messages().removeRow\"\n [attr.title]=\"messages().remove\"\n class=\"w-6 h-6\"\n [tabindex]=\"-1\"\n (click)=\"remove($event)\">\n <svg lucideTrash2 [size]=\"14\"></svg>\n </button>\n }\n </div>\n}\n" }]
|
|
312
314
|
}], propDecorators: { column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: true }] }], newRow: [{ type: i0.Input, args: [{ isSignal: true, alias: "newRow", required: false }] }], row: [{ type: i0.Input, args: [{ isSignal: true, alias: "row", required: false }] }] } });
|
|
313
315
|
|
|
314
316
|
const FOCUSABLE_TARGET_SELECTOR$1 = "button, input, select, textarea, a[href], [tabindex]";
|
|
315
317
|
class GridEditorComponent {
|
|
316
318
|
#datePopupOpen;
|
|
317
319
|
#elementRef;
|
|
320
|
+
#gridService;
|
|
318
321
|
#ignoreNextBooleanFocusOut;
|
|
319
322
|
constructor() {
|
|
320
323
|
this.#datePopupOpen = signal(false, /* @ts-ignore */
|
|
321
324
|
...(ngDevMode ? [{ debugName: "#datePopupOpen" }] : /* istanbul ignore next */ []));
|
|
322
325
|
this.#elementRef = inject((ElementRef));
|
|
326
|
+
this.#gridService = inject(GridService, { optional: true });
|
|
323
327
|
this.#ignoreNextBooleanFocusOut = false;
|
|
324
328
|
this.numericTextBoxRef = viewChild(NumericTextBoxComponent, /* @ts-ignore */
|
|
325
329
|
...(ngDevMode ? [{ debugName: "numericTextBoxRef" }] : /* istanbul ignore next */ []));
|
|
@@ -352,7 +356,7 @@ class GridEditorComponent {
|
|
|
352
356
|
...(ngDevMode ? [{ debugName: "editorInputClass" }] : /* istanbul ignore next */ []));
|
|
353
357
|
this.fieldErrorMessage = computed(() => {
|
|
354
358
|
const [firstError] = this.formField()().errors();
|
|
355
|
-
return firstError?.message ??
|
|
359
|
+
return firstError?.message ?? this.#gridService?.messages().fieldValidationError ?? "";
|
|
356
360
|
}, /* @ts-ignore */
|
|
357
361
|
...(ngDevMode ? [{ debugName: "fieldErrorMessage" }] : /* istanbul ignore next */ []));
|
|
358
362
|
this.formField = computed(() => {
|
|
@@ -506,7 +510,7 @@ class GridEditorComponent {
|
|
|
506
510
|
this.formField()().value.set(value);
|
|
507
511
|
}
|
|
508
512
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
509
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridEditorComponent, isStandalone: true, selector: "mona-grid-editor", inputs: { autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, isNew: { classPropertyName: "isNew", publicName: "isNew", isSignal: true, isRequired: false, transformFunction: null }, session: { classPropertyName: "session", publicName: "session", isSignal: true, isRequired: true, transformFunction: null }, tabNavigationEnabled: { classPropertyName: "tabNavigationEnabled", publicName: "tabNavigationEnabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cancel: "cancel", commit: "commit", tabNavigate: "tabNavigate" }, host: { listeners: { "keydown": "onHostKeydown($event)" }, properties: { "class": "baseClass()" } }, viewQueries: [{ propertyName: "numericTextBoxRef", first: true, predicate: NumericTextBoxComponent, descendants: true, isSignal: true }, { propertyName: "textBoxRef", first: true, predicate: TextBoxComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@if (column().editTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column().editTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: editTemplateContext() }\"></ng-container>\n} @else {\n <div class=\"relative flex items-center w-full h-full\">\n @switch (column().dataType) {\n @case (\"string\") {\n <mona-text-box\n [class]=\"editorInputClass()\"\n [inputAttributes]=\"{ autocomplete: 'off' }\"\n [rounded]=\"'none'\"\n [formField]=\"$any(formField())\"\n (keydown.enter)=\"commit.emit()\"\n (keydown.escape)=\"onEditCancel()\"\n (inputBlur)=\"commit.emit()\"\n [size]=\"'small'\"></mona-text-box>\n }\n @case (\"number\") {\n <mona-numeric-text-box\n [class]=\"editorInputClass()\"\n [rounded]=\"'none'\"\n [formField]=\"$any(formField())\"\n (keydown.enter)=\"commit.emit()\"\n (keydown.escape)=\"onEditCancel()\"\n (inputBlur)=\"commit.emit()\"\n [size]=\"'small'\"></mona-numeric-text-box>\n }\n @case (\"boolean\") {\n <mona-check-box\n class=\"{{ editorInputClass() }}
|
|
513
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridEditorComponent, isStandalone: true, selector: "mona-grid-editor", inputs: { autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, isNew: { classPropertyName: "isNew", publicName: "isNew", isSignal: true, isRequired: false, transformFunction: null }, session: { classPropertyName: "session", publicName: "session", isSignal: true, isRequired: true, transformFunction: null }, tabNavigationEnabled: { classPropertyName: "tabNavigationEnabled", publicName: "tabNavigationEnabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cancel: "cancel", commit: "commit", tabNavigate: "tabNavigate" }, host: { listeners: { "keydown": "onHostKeydown($event)" }, properties: { "class": "baseClass()" } }, viewQueries: [{ propertyName: "numericTextBoxRef", first: true, predicate: NumericTextBoxComponent, descendants: true, isSignal: true }, { propertyName: "textBoxRef", first: true, predicate: TextBoxComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@if (column().editTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column().editTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: editTemplateContext() }\"></ng-container>\n} @else {\n <div class=\"relative flex items-center w-full h-full\">\n @switch (column().dataType) {\n @case (\"string\") {\n <mona-text-box\n [class]=\"editorInputClass()\"\n [inputAttributes]=\"{ autocomplete: 'off' }\"\n [rounded]=\"'none'\"\n [formField]=\"$any(formField())\"\n (keydown.enter)=\"commit.emit()\"\n (keydown.escape)=\"onEditCancel()\"\n (inputBlur)=\"commit.emit()\"\n [size]=\"'small'\"></mona-text-box>\n }\n @case (\"number\") {\n <mona-numeric-text-box\n [class]=\"editorInputClass()\"\n [rounded]=\"'none'\"\n [formField]=\"$any(formField())\"\n (keydown.enter)=\"commit.emit()\"\n (keydown.escape)=\"onEditCancel()\"\n (inputBlur)=\"commit.emit()\"\n [size]=\"'small'\"></mona-numeric-text-box>\n }\n @case (\"boolean\") {\n <mona-check-box\n class=\"{{ editorInputClass() }} ms-2\"\n [rounded]=\"'none'\"\n [formField]=\"$any(formField())\"\n (click)=\"onBooleanEditorClick()\"\n (focusout)=\"onBooleanEditorFocusOut($event)\"\n (pointerdown)=\"onBooleanEditorPointerDown()\"\n (keydown.escape)=\"onEditCancel()\"\n (keydown.enter)=\"commit.emit()\"></mona-check-box>\n }\n @case (\"date\") {\n <mona-date-picker\n [class]=\"editorInputClass()\"\n [rounded]=\"'none'\"\n [formField]=\"$any(formField())\"\n (keydown.enter)=\"onDatePickerEnter($event)\"\n (keydown.escape)=\"onEditCancel()\"\n (focusout)=\"onDatePickerFocusOut($event)\"\n (opened)=\"onDatePickerOpen()\"\n (closed)=\"onDatePickerClose()\"\n size=\"small\"></mona-date-picker>\n }\n }\n @if (hasFieldError()) {\n <span class=\"shrink-0 px-1 text-error\" #fieldErrorIcon>\n <svg lucideOctagonAlert [size]=\"12\"></svg>\n </span>\n <mona-tooltip [target]=\"fieldErrorIcon\">\n <span class=\"p-1\">{{ fieldErrorMessage() }}</span>\n </mona-tooltip>\n }\n </div>\n}\n", dependencies: [{ kind: "component", type: CheckBoxComponent, selector: "mona-check-box", inputs: ["checked", "disabled", "indeterminate", "invalid", "label", "labelPosition", "labelSize", "required", "rounded", "tabIndex", "touched", "class"], outputs: ["checkedChange", "inputBlur", "inputChange", "inputFocus", "touch"] }, { kind: "component", type: DatePickerComponent, selector: "mona-date-picker", inputs: ["disabled", "disabledDates", "firstDay", "format", "invalid", "max", "min", "placeholder", "popupClass", "popupHeight", "popupWidth", "readonly", "readonlyInput", "required", "rounded", "showClearButton", "size", "touched", "class", "value", "weekNumber"], outputs: ["close", "closed", "open", "opened", "touch", "valueChange"] }, { kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }, { kind: "component", type: LucideOctagonAlert, selector: "svg[lucideOctagonAlert], svg[lucideAlertOctagon]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NumericTextBoxComponent, selector: "mona-numeric-text-box", inputs: ["aria-label", "decimals", "disabled", "formatter", "invalid", "maxValue", "minValue", "nullable", "readonly", "required", "rounded", "size", "spinners", "step", "tabindex", "touched", "class", "value"], outputs: ["inputBlur", "inputFocus", "inputFocusOut", "touch", "valueChange"] }, { kind: "component", type: TextBoxComponent, selector: "mona-text-box", inputs: ["clearButton", "disabled", "inputAttributes", "inputClass", "inputStyle", "invalid", "placeholder", "readonly", "required", "rounded", "size", "touched", "type", "class", "value"], outputs: ["inputBlur", "inputFocus", "touch", "valueChange"] }, { kind: "component", type: TooltipComponent, selector: "mona-tooltip", inputs: ["disabled", "hideDelay", "position", "rounded", "showDelay", "target"], outputs: ["hidden", "shown"] }] }); }
|
|
510
514
|
}
|
|
511
515
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridEditorComponent, decorators: [{
|
|
512
516
|
type: Component,
|
|
@@ -522,7 +526,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
522
526
|
], host: {
|
|
523
527
|
"[class]": "baseClass()",
|
|
524
528
|
"(keydown)": "onHostKeydown($event)"
|
|
525
|
-
}, template: "@if (column().editTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column().editTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: editTemplateContext() }\"></ng-container>\n} @else {\n <div class=\"relative flex items-center w-full h-full\">\n @switch (column().dataType) {\n @case (\"string\") {\n <mona-text-box\n [class]=\"editorInputClass()\"\n [inputAttributes]=\"{ autocomplete: 'off' }\"\n [rounded]=\"'none'\"\n [formField]=\"$any(formField())\"\n (keydown.enter)=\"commit.emit()\"\n (keydown.escape)=\"onEditCancel()\"\n (inputBlur)=\"commit.emit()\"\n [size]=\"'small'\"></mona-text-box>\n }\n @case (\"number\") {\n <mona-numeric-text-box\n [class]=\"editorInputClass()\"\n [rounded]=\"'none'\"\n [formField]=\"$any(formField())\"\n (keydown.enter)=\"commit.emit()\"\n (keydown.escape)=\"onEditCancel()\"\n (inputBlur)=\"commit.emit()\"\n [size]=\"'small'\"></mona-numeric-text-box>\n }\n @case (\"boolean\") {\n <mona-check-box\n class=\"{{ editorInputClass() }}
|
|
529
|
+
}, template: "@if (column().editTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column().editTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: editTemplateContext() }\"></ng-container>\n} @else {\n <div class=\"relative flex items-center w-full h-full\">\n @switch (column().dataType) {\n @case (\"string\") {\n <mona-text-box\n [class]=\"editorInputClass()\"\n [inputAttributes]=\"{ autocomplete: 'off' }\"\n [rounded]=\"'none'\"\n [formField]=\"$any(formField())\"\n (keydown.enter)=\"commit.emit()\"\n (keydown.escape)=\"onEditCancel()\"\n (inputBlur)=\"commit.emit()\"\n [size]=\"'small'\"></mona-text-box>\n }\n @case (\"number\") {\n <mona-numeric-text-box\n [class]=\"editorInputClass()\"\n [rounded]=\"'none'\"\n [formField]=\"$any(formField())\"\n (keydown.enter)=\"commit.emit()\"\n (keydown.escape)=\"onEditCancel()\"\n (inputBlur)=\"commit.emit()\"\n [size]=\"'small'\"></mona-numeric-text-box>\n }\n @case (\"boolean\") {\n <mona-check-box\n class=\"{{ editorInputClass() }} ms-2\"\n [rounded]=\"'none'\"\n [formField]=\"$any(formField())\"\n (click)=\"onBooleanEditorClick()\"\n (focusout)=\"onBooleanEditorFocusOut($event)\"\n (pointerdown)=\"onBooleanEditorPointerDown()\"\n (keydown.escape)=\"onEditCancel()\"\n (keydown.enter)=\"commit.emit()\"></mona-check-box>\n }\n @case (\"date\") {\n <mona-date-picker\n [class]=\"editorInputClass()\"\n [rounded]=\"'none'\"\n [formField]=\"$any(formField())\"\n (keydown.enter)=\"onDatePickerEnter($event)\"\n (keydown.escape)=\"onEditCancel()\"\n (focusout)=\"onDatePickerFocusOut($event)\"\n (opened)=\"onDatePickerOpen()\"\n (closed)=\"onDatePickerClose()\"\n size=\"small\"></mona-date-picker>\n }\n }\n @if (hasFieldError()) {\n <span class=\"shrink-0 px-1 text-error\" #fieldErrorIcon>\n <svg lucideOctagonAlert [size]=\"12\"></svg>\n </span>\n <mona-tooltip [target]=\"fieldErrorIcon\">\n <span class=\"p-1\">{{ fieldErrorMessage() }}</span>\n </mona-tooltip>\n }\n </div>\n}\n" }]
|
|
526
530
|
}], ctorParameters: () => [], propDecorators: { numericTextBoxRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => NumericTextBoxComponent), { isSignal: true }] }], textBoxRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TextBoxComponent), { isSignal: true }] }], autoFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFocus", required: false }] }], cancel: [{ type: i0.Output, args: ["cancel"] }], column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: true }] }], commit: [{ type: i0.Output, args: ["commit"] }], isNew: [{ type: i0.Input, args: [{ isSignal: true, alias: "isNew", required: false }] }], session: [{ type: i0.Input, args: [{ isSignal: true, alias: "session", required: true }] }], tabNavigate: [{ type: i0.Output, args: ["tabNavigate"] }], tabNavigationEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabNavigationEnabled", required: false }] }] } });
|
|
527
531
|
|
|
528
532
|
class GridAddRowComponent {
|
|
@@ -754,13 +758,13 @@ class GridCellComponent {
|
|
|
754
758
|
this.gridService.startCellEdit(this.cellUid(), this.row(), this.column(), originalEvent);
|
|
755
759
|
}
|
|
756
760
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
757
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridCellComponent, isStandalone: true, selector: "mona-grid-cell", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class": "baseClass()" } }, ngImport: i0, template: "@let dataItem = row().data;\n@let dataKey = column().field;\n\n@if (column().kind === \"command\") {\n <mona-grid-command-cell [column]=\"column()\" [row]=\"row()\"></mona-grid-command-cell>\n} @else {\n <div\n role=\"gridcell\"\n [class]=\"cellContainerClass()\"\n cdkMonitorSubtreeFocus\n [attr.data-uid]=\"cellUid()\"\n [attr.data-ruid]=\"row().uid\"\n [attr.data-field]=\"dataKey\"\n [attr.data-col-index]=\"column().index\"\n [attr.aria-readonly]=\"!(gridService.editableOptions().enabled && column().editable)\"\n (dblclick)=\"onCellDoubleClick($event)\">\n @if (isEditing() && gridService.editSession(); as session) {\n <mona-grid-editor\n [column]=\"column()\"\n [autoFocus]=\"shouldAutoFocusEditor()\"\n [session]=\"session\"\n [tabNavigationEnabled]=\"editContextIsCellMode()\"\n (commit)=\"onEditCommit()\"\n (cancel)=\"onEditCancel()\"\n (tabNavigate)=\"onEditTabNavigate($event)\"></mona-grid-editor>\n } @else if (column().cellTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column().cellTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem, column: column().field }\"></ng-container>\n } @else {\n <span [class]=\"cellTextClass()\">{{ formattedDisplayValue() }}</span>\n }\n @if (!isCellPristine()) {\n <span aria-hidden=\"true\" [class]=\"cellDirtyIndicatorClass()\" title=\"
|
|
761
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridCellComponent, isStandalone: true, selector: "mona-grid-cell", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class": "baseClass()" } }, ngImport: i0, template: "@let dataItem = row().data;\n@let dataKey = column().field;\n\n@if (column().kind === \"command\") {\n <mona-grid-command-cell [column]=\"column()\" [row]=\"row()\"></mona-grid-command-cell>\n} @else {\n <div\n role=\"gridcell\"\n [class]=\"cellContainerClass()\"\n cdkMonitorSubtreeFocus\n [attr.data-uid]=\"cellUid()\"\n [attr.data-ruid]=\"row().uid\"\n [attr.data-field]=\"dataKey\"\n [attr.data-col-index]=\"column().index\"\n [attr.aria-readonly]=\"!(gridService.editableOptions().enabled && column().editable)\"\n (dblclick)=\"onCellDoubleClick($event)\">\n @if (isEditing() && gridService.editSession(); as session) {\n <mona-grid-editor\n [column]=\"column()\"\n [autoFocus]=\"shouldAutoFocusEditor()\"\n [session]=\"session\"\n [tabNavigationEnabled]=\"editContextIsCellMode()\"\n (commit)=\"onEditCommit()\"\n (cancel)=\"onEditCancel()\"\n (tabNavigate)=\"onEditTabNavigate($event)\"></mona-grid-editor>\n } @else if (column().cellTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column().cellTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem, column: column().field }\"></ng-container>\n } @else {\n <span [class]=\"cellTextClass()\">{{ formattedDisplayValue() }}</span>\n }\n @if (!isCellPristine()) {\n <span aria-hidden=\"true\" [class]=\"cellDirtyIndicatorClass()\" [title]=\"gridService.messages().modified\"></span>\n }\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1.CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: ["cdkFocusChange"], exportAs: ["cdkMonitorFocus"] }, { kind: "component", type: GridCommandCellComponent, selector: "mona-grid-command-cell", inputs: ["column", "newRow", "row"] }, { kind: "component", type: GridEditorComponent, selector: "mona-grid-editor", inputs: ["autoFocus", "column", "isNew", "session", "tabNavigationEnabled"], outputs: ["cancel", "commit", "tabNavigate"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
758
762
|
}
|
|
759
763
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridCellComponent, decorators: [{
|
|
760
764
|
type: Component,
|
|
761
765
|
args: [{ selector: "mona-grid-cell", imports: [A11yModule, GridCommandCellComponent, GridEditorComponent, NgTemplateOutlet], host: {
|
|
762
766
|
"[class]": "baseClass()"
|
|
763
|
-
}, template: "@let dataItem = row().data;\n@let dataKey = column().field;\n\n@if (column().kind === \"command\") {\n <mona-grid-command-cell [column]=\"column()\" [row]=\"row()\"></mona-grid-command-cell>\n} @else {\n <div\n role=\"gridcell\"\n [class]=\"cellContainerClass()\"\n cdkMonitorSubtreeFocus\n [attr.data-uid]=\"cellUid()\"\n [attr.data-ruid]=\"row().uid\"\n [attr.data-field]=\"dataKey\"\n [attr.data-col-index]=\"column().index\"\n [attr.aria-readonly]=\"!(gridService.editableOptions().enabled && column().editable)\"\n (dblclick)=\"onCellDoubleClick($event)\">\n @if (isEditing() && gridService.editSession(); as session) {\n <mona-grid-editor\n [column]=\"column()\"\n [autoFocus]=\"shouldAutoFocusEditor()\"\n [session]=\"session\"\n [tabNavigationEnabled]=\"editContextIsCellMode()\"\n (commit)=\"onEditCommit()\"\n (cancel)=\"onEditCancel()\"\n (tabNavigate)=\"onEditTabNavigate($event)\"></mona-grid-editor>\n } @else if (column().cellTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column().cellTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem, column: column().field }\"></ng-container>\n } @else {\n <span [class]=\"cellTextClass()\">{{ formattedDisplayValue() }}</span>\n }\n @if (!isCellPristine()) {\n <span aria-hidden=\"true\" [class]=\"cellDirtyIndicatorClass()\" title=\"
|
|
767
|
+
}, template: "@let dataItem = row().data;\n@let dataKey = column().field;\n\n@if (column().kind === \"command\") {\n <mona-grid-command-cell [column]=\"column()\" [row]=\"row()\"></mona-grid-command-cell>\n} @else {\n <div\n role=\"gridcell\"\n [class]=\"cellContainerClass()\"\n cdkMonitorSubtreeFocus\n [attr.data-uid]=\"cellUid()\"\n [attr.data-ruid]=\"row().uid\"\n [attr.data-field]=\"dataKey\"\n [attr.data-col-index]=\"column().index\"\n [attr.aria-readonly]=\"!(gridService.editableOptions().enabled && column().editable)\"\n (dblclick)=\"onCellDoubleClick($event)\">\n @if (isEditing() && gridService.editSession(); as session) {\n <mona-grid-editor\n [column]=\"column()\"\n [autoFocus]=\"shouldAutoFocusEditor()\"\n [session]=\"session\"\n [tabNavigationEnabled]=\"editContextIsCellMode()\"\n (commit)=\"onEditCommit()\"\n (cancel)=\"onEditCancel()\"\n (tabNavigate)=\"onEditTabNavigate($event)\"></mona-grid-editor>\n } @else if (column().cellTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column().cellTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem, column: column().field }\"></ng-container>\n } @else {\n <span [class]=\"cellTextClass()\">{{ formattedDisplayValue() }}</span>\n }\n @if (!isCellPristine()) {\n <span aria-hidden=\"true\" [class]=\"cellDirtyIndicatorClass()\" [title]=\"gridService.messages().modified\"></span>\n }\n </div>\n}\n" }]
|
|
764
768
|
}], propDecorators: { column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: true }] }], row: [{ type: i0.Input, args: [{ isSignal: true, alias: "row", required: true }] }] } });
|
|
765
769
|
|
|
766
770
|
const ROW_REORDER_DISABLED_REASON_TEXT = {
|
|
@@ -781,7 +785,7 @@ class GridRowReorderHandleComponent {
|
|
|
781
785
|
const label = this.#gridService.getRowReorderAriaLabel(this.row(), absoluteIndex);
|
|
782
786
|
const reasonText = this.disabledReasonText();
|
|
783
787
|
const suffix = reasonText == null ? "" : ` ${reasonText}`;
|
|
784
|
-
return `${label}.
|
|
788
|
+
return `${label}. ${this.#gridService.messages().rowReorderKeyboardHint}${suffix}`;
|
|
785
789
|
}, /* @ts-ignore */
|
|
786
790
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
787
791
|
this.disabled = computed(() => !this.#gridService.canReorderRow(this.row()), /* @ts-ignore */
|
|
@@ -843,7 +847,7 @@ class GridSelectionCheckboxComponent {
|
|
|
843
847
|
if (labelFn) {
|
|
844
848
|
return labelFn(this.row().data);
|
|
845
849
|
}
|
|
846
|
-
return
|
|
850
|
+
return this.#gridService.messages().selectRow(this.rowIndex() + 1);
|
|
847
851
|
}, /* @ts-ignore */
|
|
848
852
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
849
853
|
this.checked = computed(() => this.#gridService.isRowSelected(this.row()), /* @ts-ignore */
|
|
@@ -908,4 +912,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
908
912
|
}], propDecorators: { expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: true }] }, { type: i0.Output, args: ["expandedChange"] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: true }] }] } });
|
|
909
913
|
|
|
910
914
|
export { GridAddRowComponent as G, GridCellComponent as a, GridRowDirective as b, GridCellDirective as c, GridDetailRowDirective as d, GridDetailIndentCellDirective as e, GridDetailContentCellDirective as f, GridToggleComponent as g, GridSelectionCheckboxComponent as h, GridRowReorderHandleComponent as i };
|
|
911
|
-
//# sourceMappingURL=nanahoshi-mona-ui-grid-grid-toggle.component-
|
|
915
|
+
//# sourceMappingURL=nanahoshi-mona-ui-grid-grid-toggle.component-Byb9iTes.mjs.map
|
|
@@ -8,10 +8,10 @@ import { SlicePipe } from '@nanahoshi/mona-ui/common';
|
|
|
8
8
|
import { ContextMenuComponent } from '@nanahoshi/mona-ui/contextmenu';
|
|
9
9
|
import { rxTimeout } from '@nanahoshi/mona-ui/internal';
|
|
10
10
|
import { fromEvent } from 'rxjs';
|
|
11
|
-
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-
|
|
12
|
-
import { GridFooterTableCellDirective } from './nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-
|
|
13
|
-
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, i as GridLogicalCellDirective, j as GridLockedCellDirective } from './nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-
|
|
14
|
-
import { GridFooterCellComponent } from './nanahoshi-mona-ui-grid-grid-footer-cell.component-
|
|
11
|
+
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-Byb9iTes.mjs';
|
|
12
|
+
import { GridFooterTableCellDirective } from './nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-BSSpaCLL.mjs';
|
|
13
|
+
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, i as GridLogicalCellDirective, j as GridLockedCellDirective } from './nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-DPmJmCap.mjs';
|
|
14
|
+
import { GridFooterCellComponent } from './nanahoshi-mona-ui-grid-grid-footer-cell.component-Bg7rckst.mjs';
|
|
15
15
|
|
|
16
16
|
class GridVirtualListComponent {
|
|
17
17
|
#destroyRef;
|
|
@@ -230,4 +230,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
230
230
|
}], 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 }] }] } });
|
|
231
231
|
|
|
232
232
|
export { GridVirtualListComponent };
|
|
233
|
-
//# sourceMappingURL=nanahoshi-mona-ui-grid-grid-virtual-list.component-
|
|
233
|
+
//# sourceMappingURL=nanahoshi-mona-ui-grid-grid-virtual-list.component-CBmdtrXm.mjs.map
|