@nanahoshi/mona-ui 0.33.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/api/grid.md +46 -13
- package/docs/grid-columns.md +121 -17
- package/docs/grid-state-export.md +24 -7
- package/docs/grid.md +1 -1
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-colgroup.component-C62HvK-w.mjs → nanahoshi-mona-ui-grid-grid-colgroup.component-Lv3GunpV.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-BpsJwMkQ.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-BYH9XbCV.mjs} +8 -3
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-BVpGUjA7.mjs → nanahoshi-mona-ui-grid-grid-list.component-S2iCn8TV.mjs} +10 -6
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-D0T8kfdm.mjs → nanahoshi-mona-ui-grid-grid-row.component-BUJvgihp.mjs} +21 -6
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-5D2BjGx4.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-Wndy-_Bt.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-grid.styles-62LTuPhD.mjs → nanahoshi-mona-ui-grid-grid.styles-aPD3c2A6.mjs} +228 -16
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +422 -29
- package/llms.txt +3 -3
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-grid.d.ts +142 -64
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import { n as removeGridRow, t as GridColgroupComponent } from "./nanahoshi-mona-ui-grid-grid-colgroup.component-
|
|
1
|
+
import { $ as GridSaveEvent, A as gridHeaderThemeVariants, B as GridLogicalCellDirective, C as gridHeaderGroupTableRowThemeVariants, D as gridHeaderTableColumnWrapThemeVariants, E as gridHeaderTableColumnTitleThemeVariants, F as gridNoDataThemeVariants, G as GridService, H as isKeyboardEntryElement, J as getColumnStepTarget, K as getColumnGroupDepth, O as gridHeaderTableRowThemeVariants, Q as GRID_DEFAULT_MESSAGES, R as gridSelectAllCellThemeVariants, S as gridHeaderGroupSpacerCellThemeVariants, T as gridHeaderTableCellThemeVariants, U as observeGridCellTabStops, W as GridLockedCellDirective, X as RowReorderEvent, Y as getSiblingRuns, Z as GridNavigationService, _ as gridFooterThemeVariants, at as CellEditEvent, c as gridColumnActionsThemeVariants, d as gridColumnResizerThemeVariants, et as GridRemoveEvent, f as gridFilterRowCellThemeVariants, g as gridFooterTableThemeVariants, it as RowEditEvent, k as gridHeaderTableThemeVariants, l as gridColumnDragPreviewThemeVariants, nt as GridCancelEvent, p as gridFilterRowHeaderCellThemeVariants, q as getColumnGroups, rt as GridAddEvent, t as gridBaseThemeVariants, tt as GridEditEvent, u as gridColumnDropHintThemeVariants, v as gridGroupPanelPlaceholderThemeVariants, w as gridHeaderGroupTitleThemeVariants, x as gridHeaderGroupCellThemeVariants, y as gridGroupPanelThemeVariants } from "./nanahoshi-mona-ui-grid-grid.styles-aPD3c2A6.mjs";
|
|
2
|
+
import { n as removeGridRow, t as GridColgroupComponent } from "./nanahoshi-mona-ui-grid-grid-colgroup.component-Lv3GunpV.mjs";
|
|
3
3
|
import { PreventableEvent, deepEquals } from "@nanahoshi/mona-ui/common";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
import { Component, DOCUMENT, DestroyRef, Directive, ElementRef, Injectable, InjectionToken, Injector, PLATFORM_ID, Pipe, TemplateRef, afterEveryRender, afterNextRender, booleanAttribute, computed, contentChild, contentChildren, effect, forwardRef, inject, input, isDevMode, linkedSignal, model, output, signal, untracked, viewChild, viewChildren } from "@angular/core";
|
|
@@ -66,6 +66,74 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
66
66
|
}]
|
|
67
67
|
});
|
|
68
68
|
const GRID_COLUMN_DEFINITION = new InjectionToken("GRID_COLUMN_DEFINITION");
|
|
69
|
+
var _a;
|
|
70
|
+
var GridColumnGroupComponent = class GridColumnGroupComponent {
|
|
71
|
+
constructor() {
|
|
72
|
+
this.#id = v4();
|
|
73
|
+
this.#parent = inject(_a, {
|
|
74
|
+
optional: true,
|
|
75
|
+
skipSelf: true
|
|
76
|
+
});
|
|
77
|
+
this.path = computed(() => [...this.#parent?.path() ?? [], {
|
|
78
|
+
id: this.#id,
|
|
79
|
+
title: this.title()
|
|
80
|
+
}], ...ngDevMode ? [{ debugName: "path" }] : /* istanbul ignore next */ []);
|
|
81
|
+
this.title = input("", ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
|
|
82
|
+
}
|
|
83
|
+
#id;
|
|
84
|
+
#parent;
|
|
85
|
+
static {
|
|
86
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
87
|
+
minVersion: "12.0.0",
|
|
88
|
+
version: "22.2.6",
|
|
89
|
+
ngImport: i0,
|
|
90
|
+
type: GridColumnGroupComponent,
|
|
91
|
+
deps: [],
|
|
92
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
static {
|
|
96
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
97
|
+
minVersion: "17.1.0",
|
|
98
|
+
version: "22.2.6",
|
|
99
|
+
type: GridColumnGroupComponent,
|
|
100
|
+
isStandalone: true,
|
|
101
|
+
selector: "mona-grid-column-group",
|
|
102
|
+
inputs: { title: {
|
|
103
|
+
classPropertyName: "title",
|
|
104
|
+
publicName: "title",
|
|
105
|
+
isSignal: true,
|
|
106
|
+
isRequired: false,
|
|
107
|
+
transformFunction: null
|
|
108
|
+
} },
|
|
109
|
+
ngImport: i0,
|
|
110
|
+
template: "",
|
|
111
|
+
isInline: true
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
_a = GridColumnGroupComponent;
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
117
|
+
minVersion: "12.0.0",
|
|
118
|
+
version: "22.2.6",
|
|
119
|
+
ngImport: i0,
|
|
120
|
+
type: GridColumnGroupComponent,
|
|
121
|
+
decorators: [{
|
|
122
|
+
type: Component,
|
|
123
|
+
args: [{
|
|
124
|
+
selector: "mona-grid-column-group",
|
|
125
|
+
template: ""
|
|
126
|
+
}]
|
|
127
|
+
}],
|
|
128
|
+
propDecorators: { title: [{
|
|
129
|
+
type: i0.Input,
|
|
130
|
+
args: [{
|
|
131
|
+
isSignal: true,
|
|
132
|
+
alias: "title",
|
|
133
|
+
required: false
|
|
134
|
+
}]
|
|
135
|
+
}] }
|
|
136
|
+
});
|
|
69
137
|
var GridCommandColumnComponent = class GridCommandColumnComponent {
|
|
70
138
|
constructor() {
|
|
71
139
|
this.#column = computed(() => {
|
|
@@ -87,6 +155,7 @@ var GridCommandColumnComponent = class GridCommandColumnComponent {
|
|
|
87
155
|
format: null,
|
|
88
156
|
groupFooterTemplate: null,
|
|
89
157
|
groupSortDirection: null,
|
|
158
|
+
groups: this.#group?.path() ?? [],
|
|
90
159
|
headerTemplate: null,
|
|
91
160
|
hidden: this.hidden(),
|
|
92
161
|
id: this.#columnId,
|
|
@@ -106,6 +175,7 @@ var GridCommandColumnComponent = class GridCommandColumnComponent {
|
|
|
106
175
|
};
|
|
107
176
|
}, ...ngDevMode ? [{ debugName: "#column" }] : /* istanbul ignore next */ []);
|
|
108
177
|
this.#columnId = v4();
|
|
178
|
+
this.#group = inject(GridColumnGroupComponent, { optional: true });
|
|
109
179
|
this.#messages = inject(MonaI18nService).componentMessages("grid", GRID_DEFAULT_MESSAGES);
|
|
110
180
|
this.commandTemplate = contentChild(GridCellTemplateDirective, {
|
|
111
181
|
...ngDevMode ? { debugName: "commandTemplate" } : /* istanbul ignore next */ {},
|
|
@@ -132,6 +202,7 @@ var GridCommandColumnComponent = class GridCommandColumnComponent {
|
|
|
132
202
|
}
|
|
133
203
|
#column;
|
|
134
204
|
#columnId;
|
|
205
|
+
#group;
|
|
135
206
|
#messages;
|
|
136
207
|
getColumn() {
|
|
137
208
|
return this.#column();
|
|
@@ -2003,13 +2074,221 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2003
2074
|
args: [{ selector: "ng-template[monaGridToolbarTemplate]" }]
|
|
2004
2075
|
}]
|
|
2005
2076
|
});
|
|
2077
|
+
const LOCAL_HEADER_SIGNATURE = 67324752;
|
|
2078
|
+
const CENTRAL_HEADER_SIGNATURE = 33639248;
|
|
2079
|
+
const END_OF_CENTRAL_DIRECTORY_SIGNATURE = 101010256;
|
|
2080
|
+
const ZIP_VERSION = 20;
|
|
2081
|
+
const UTF8_FLAG = 2048;
|
|
2082
|
+
const METHOD_STORE = 0;
|
|
2083
|
+
const METHOD_DEFLATE = 8;
|
|
2084
|
+
let crcTable = null;
|
|
2085
|
+
async function createZip(entries, modified = /* @__PURE__ */ new Date()) {
|
|
2086
|
+
const encoder = new TextEncoder();
|
|
2087
|
+
const { date, time } = toDosDateTime(modified);
|
|
2088
|
+
const parts = [];
|
|
2089
|
+
const centralParts = [];
|
|
2090
|
+
let offset = 0;
|
|
2091
|
+
for (const entry of entries) {
|
|
2092
|
+
const name = encoder.encode(entry.name);
|
|
2093
|
+
const crc = crc32(entry.data);
|
|
2094
|
+
const deflated = await deflateRaw(entry.data);
|
|
2095
|
+
const compressed = deflated != null && deflated.length < entry.data.length;
|
|
2096
|
+
const content = compressed ? deflated : entry.data;
|
|
2097
|
+
const method = compressed ? METHOD_DEFLATE : METHOD_STORE;
|
|
2098
|
+
const local = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(30));
|
|
2099
|
+
local.setUint32(0, LOCAL_HEADER_SIGNATURE, true);
|
|
2100
|
+
local.setUint16(4, ZIP_VERSION, true);
|
|
2101
|
+
local.setUint16(6, UTF8_FLAG, true);
|
|
2102
|
+
local.setUint16(8, method, true);
|
|
2103
|
+
local.setUint16(10, time, true);
|
|
2104
|
+
local.setUint16(12, date, true);
|
|
2105
|
+
local.setUint32(14, crc, true);
|
|
2106
|
+
local.setUint32(18, content.length, true);
|
|
2107
|
+
local.setUint32(22, entry.data.length, true);
|
|
2108
|
+
local.setUint16(26, name.length, true);
|
|
2109
|
+
local.setUint16(28, 0, true);
|
|
2110
|
+
parts.push(new Uint8Array(local.buffer), name, content);
|
|
2111
|
+
const central = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(46));
|
|
2112
|
+
central.setUint32(0, CENTRAL_HEADER_SIGNATURE, true);
|
|
2113
|
+
central.setUint16(4, ZIP_VERSION, true);
|
|
2114
|
+
central.setUint16(6, ZIP_VERSION, true);
|
|
2115
|
+
central.setUint16(8, UTF8_FLAG, true);
|
|
2116
|
+
central.setUint16(10, method, true);
|
|
2117
|
+
central.setUint16(12, time, true);
|
|
2118
|
+
central.setUint16(14, date, true);
|
|
2119
|
+
central.setUint32(16, crc, true);
|
|
2120
|
+
central.setUint32(20, content.length, true);
|
|
2121
|
+
central.setUint32(24, entry.data.length, true);
|
|
2122
|
+
central.setUint16(28, name.length, true);
|
|
2123
|
+
central.setUint32(42, offset, true);
|
|
2124
|
+
centralParts.push(new Uint8Array(central.buffer), name);
|
|
2125
|
+
offset += 30 + name.length + content.length;
|
|
2126
|
+
}
|
|
2127
|
+
const centralSize = centralParts.reduce((total, part) => total + part.length, 0);
|
|
2128
|
+
const end = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(22));
|
|
2129
|
+
end.setUint32(0, END_OF_CENTRAL_DIRECTORY_SIGNATURE, true);
|
|
2130
|
+
end.setUint16(8, entries.length, true);
|
|
2131
|
+
end.setUint16(10, entries.length, true);
|
|
2132
|
+
end.setUint32(12, centralSize, true);
|
|
2133
|
+
end.setUint32(16, offset, true);
|
|
2134
|
+
return concat([
|
|
2135
|
+
...parts,
|
|
2136
|
+
...centralParts,
|
|
2137
|
+
new Uint8Array(end.buffer)
|
|
2138
|
+
]);
|
|
2139
|
+
}
|
|
2140
|
+
function crc32(data) {
|
|
2141
|
+
const table = crcTable ??= createCrcTable();
|
|
2142
|
+
let crc = 4294967295;
|
|
2143
|
+
for (const byte of data) crc = table[(crc ^ byte) & 255] ^ crc >>> 8;
|
|
2144
|
+
return (crc ^ 4294967295) >>> 0;
|
|
2145
|
+
}
|
|
2146
|
+
function concat(parts) {
|
|
2147
|
+
const result = new Uint8Array(parts.reduce((total, part) => total + part.length, 0));
|
|
2148
|
+
let offset = 0;
|
|
2149
|
+
for (const part of parts) {
|
|
2150
|
+
result.set(part, offset);
|
|
2151
|
+
offset += part.length;
|
|
2152
|
+
}
|
|
2153
|
+
return result;
|
|
2154
|
+
}
|
|
2155
|
+
function createCrcTable() {
|
|
2156
|
+
const table = /* @__PURE__ */ new Uint32Array(256);
|
|
2157
|
+
for (let index = 0; index < 256; index++) {
|
|
2158
|
+
let value = index;
|
|
2159
|
+
for (let bit = 0; bit < 8; bit++) value = value & 1 ? 3988292384 ^ value >>> 1 : value >>> 1;
|
|
2160
|
+
table[index] = value >>> 0;
|
|
2161
|
+
}
|
|
2162
|
+
return table;
|
|
2163
|
+
}
|
|
2164
|
+
async function deflateRaw(data) {
|
|
2165
|
+
if (typeof CompressionStream === "undefined") return null;
|
|
2166
|
+
let stream;
|
|
2167
|
+
try {
|
|
2168
|
+
stream = new CompressionStream("deflate-raw");
|
|
2169
|
+
} catch {
|
|
2170
|
+
return null;
|
|
2171
|
+
}
|
|
2172
|
+
const writer = stream.writable.getWriter();
|
|
2173
|
+
writer.write(data);
|
|
2174
|
+
writer.close();
|
|
2175
|
+
const reader = stream.readable.getReader();
|
|
2176
|
+
const chunks = [];
|
|
2177
|
+
for (let result = await reader.read(); !result.done; result = await reader.read()) chunks.push(result.value);
|
|
2178
|
+
return concat(chunks);
|
|
2179
|
+
}
|
|
2180
|
+
function toDosDateTime(value) {
|
|
2181
|
+
return {
|
|
2182
|
+
date: Math.min(Math.max(value.getFullYear(), 1980), 2107) - 1980 << 9 | value.getMonth() + 1 << 5 | value.getDate(),
|
|
2183
|
+
time: value.getHours() << 11 | value.getMinutes() << 5 | Math.floor(value.getSeconds() / 2)
|
|
2184
|
+
};
|
|
2185
|
+
}
|
|
2186
|
+
const XLSX_MIME_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
2187
|
+
const MAX_CELL_TEXT_LENGTH = 32767;
|
|
2188
|
+
const MAX_SHEET_NAME_LENGTH = 31;
|
|
2189
|
+
const MAX_DIGIT_WIDTH = 7;
|
|
2190
|
+
const MILLISECONDS_PER_DAY = 864e5;
|
|
2191
|
+
const EXCEL_EPOCH = Date.UTC(1899, 11, 30);
|
|
2192
|
+
const SPREADSHEET_NAMESPACE = "http://schemas.openxmlformats.org/spreadsheetml/2006/main";
|
|
2193
|
+
const RELATIONSHIP_NAMESPACE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
2194
|
+
const PACKAGE_RELATIONSHIP_NAMESPACE = "http://schemas.openxmlformats.org/package/2006/relationships";
|
|
2195
|
+
const XML_DECLARATION = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n`;
|
|
2196
|
+
const STYLE_INDEX = {
|
|
2197
|
+
date: 3,
|
|
2198
|
+
group: 2,
|
|
2199
|
+
header: 1
|
|
2200
|
+
};
|
|
2201
|
+
async function writeXlsx(sheet) {
|
|
2202
|
+
const encoder = new TextEncoder();
|
|
2203
|
+
return createZip([
|
|
2204
|
+
["[Content_Types].xml", contentTypesXml()],
|
|
2205
|
+
["_rels/.rels", rootRelationshipsXml()],
|
|
2206
|
+
["xl/workbook.xml", workbookXml(toSheetName(sheet.name))],
|
|
2207
|
+
["xl/_rels/workbook.xml.rels", workbookRelationshipsXml()],
|
|
2208
|
+
["xl/styles.xml", stylesXml()],
|
|
2209
|
+
["xl/worksheets/sheet1.xml", worksheetXml(sheet)]
|
|
2210
|
+
].map(([name, xml]) => ({
|
|
2211
|
+
data: encoder.encode(xml),
|
|
2212
|
+
name
|
|
2213
|
+
})));
|
|
2214
|
+
}
|
|
2215
|
+
function toColumnName(index) {
|
|
2216
|
+
let name = "";
|
|
2217
|
+
for (let remaining = index + 1; remaining > 0; remaining = Math.floor((remaining - 1) / 26)) name = String.fromCharCode(65 + (remaining - 1) % 26) + name;
|
|
2218
|
+
return name;
|
|
2219
|
+
}
|
|
2220
|
+
function toExcelDate(value) {
|
|
2221
|
+
if (Number.isNaN(value.getTime())) return null;
|
|
2222
|
+
return (Date.UTC(value.getFullYear(), value.getMonth(), value.getDate()) - EXCEL_EPOCH) / MILLISECONDS_PER_DAY;
|
|
2223
|
+
}
|
|
2224
|
+
function toSheetName(name) {
|
|
2225
|
+
const cleaned = Array.from(name.replace(/[\\/?*[\]:]/g, " ").replace(/\s+/g, " ")).slice(0, MAX_SHEET_NAME_LENGTH).join("").replace(/^['\s]+|['\s]+$/g, "");
|
|
2226
|
+
return cleaned === "" || cleaned.toLowerCase() === "history" ? "Sheet1" : cleaned;
|
|
2227
|
+
}
|
|
2228
|
+
function cellXml(cell, reference) {
|
|
2229
|
+
const value = cell.value;
|
|
2230
|
+
const style = cell.style == null ? "" : ` s="${STYLE_INDEX[cell.style]}"`;
|
|
2231
|
+
if (value == null) return style === "" ? "" : `<c r="${reference}"${style}/>`;
|
|
2232
|
+
if (typeof value === "number") return Number.isFinite(value) ? `<c r="${reference}"${style}><v>${value}</v></c>` : "";
|
|
2233
|
+
if (typeof value === "boolean") return `<c r="${reference}"${style} t="b"><v>${value ? 1 : 0}</v></c>`;
|
|
2234
|
+
if (value instanceof Date) {
|
|
2235
|
+
const serial = toExcelDate(value);
|
|
2236
|
+
return serial == null ? "" : `<c r="${reference}" s="${STYLE_INDEX.date}"><v>${serial}</v></c>`;
|
|
2237
|
+
}
|
|
2238
|
+
const text = escapeXml(value.length > MAX_CELL_TEXT_LENGTH ? value.slice(0, MAX_CELL_TEXT_LENGTH) : value);
|
|
2239
|
+
return `<c r="${reference}"${style} t="inlineStr"><is><t${/^\s|\s$/.test(text) ? ` xml:space="preserve"` : ""}>${text}</t></is></c>`;
|
|
2240
|
+
}
|
|
2241
|
+
function contentTypesXml() {
|
|
2242
|
+
return XML_DECLARATION + "<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\"><Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/><Default Extension=\"xml\" ContentType=\"application/xml\"/><Override PartName=\"/xl/workbook.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\"/><Override PartName=\"/xl/worksheets/sheet1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\"/><Override PartName=\"/xl/styles.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\"/></Types>";
|
|
2243
|
+
}
|
|
2244
|
+
function escapeXml(text) {
|
|
2245
|
+
return text.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g, "").replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
2246
|
+
}
|
|
2247
|
+
function rootRelationshipsXml() {
|
|
2248
|
+
return XML_DECLARATION + `<Relationships xmlns="${PACKAGE_RELATIONSHIP_NAMESPACE}"><Relationship Id="rId1" Type="${RELATIONSHIP_NAMESPACE}/officeDocument" Target="xl/workbook.xml"/></Relationships>`;
|
|
2249
|
+
}
|
|
2250
|
+
function sheetViewXml(sheet) {
|
|
2251
|
+
const rightToLeft = sheet.rightToLeft ? ` rightToLeft="1"` : "";
|
|
2252
|
+
const columns = Math.max(0, sheet.frozenColumns);
|
|
2253
|
+
const rows = Math.max(0, sheet.frozenRows);
|
|
2254
|
+
if (columns === 0 && rows === 0) return `<sheetViews><sheetView workbookViewId="0"${rightToLeft}/></sheetViews>`;
|
|
2255
|
+
const pane = columns !== 0 && rows !== 0 ? "bottomRight" : rows !== 0 ? "bottomLeft" : "topRight";
|
|
2256
|
+
const split = (columns === 0 ? "" : ` xSplit="${columns}"`) + (rows === 0 ? "" : ` ySplit="${rows}"`);
|
|
2257
|
+
const topLeft = `${toColumnName(columns)}${rows + 1}`;
|
|
2258
|
+
return `<sheetViews><sheetView workbookViewId="0"${rightToLeft}><pane${split} topLeftCell="${topLeft}" activePane="${pane}" state="frozen"/><selection pane="${pane}" activeCell="${topLeft}" sqref="${topLeft}"/></sheetView></sheetViews>`;
|
|
2259
|
+
}
|
|
2260
|
+
function stylesXml() {
|
|
2261
|
+
const font = `<sz val="11"/><name val="Calibri"/><family val="2"/>`;
|
|
2262
|
+
return XML_DECLARATION + `<styleSheet xmlns="${SPREADSHEET_NAMESPACE}"><fonts count="2"><font>${font}</font><font><b/>${font}</font></fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="4"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/><xf numFmtId="0" fontId="1" fillId="0" borderId="0" xfId="0" applyFont="1"/><xf numFmtId="0" fontId="1" fillId="0" borderId="0" xfId="0" applyFont="1" applyAlignment="1"><alignment horizontal="center"/></xf><xf numFmtId="14" fontId="0" fillId="0" borderId="0" xfId="0" applyNumberFormat="1"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>`;
|
|
2263
|
+
}
|
|
2264
|
+
function toColumnWidth(pixels) {
|
|
2265
|
+
return Math.max(0, Math.round((pixels - 5) / MAX_DIGIT_WIDTH * 100) / 100);
|
|
2266
|
+
}
|
|
2267
|
+
function workbookRelationshipsXml() {
|
|
2268
|
+
return XML_DECLARATION + `<Relationships xmlns="${PACKAGE_RELATIONSHIP_NAMESPACE}"><Relationship Id="rId1" Type="${RELATIONSHIP_NAMESPACE}/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="${RELATIONSHIP_NAMESPACE}/styles" Target="styles.xml"/></Relationships>`;
|
|
2269
|
+
}
|
|
2270
|
+
function workbookXml(sheetName) {
|
|
2271
|
+
return XML_DECLARATION + `<workbook xmlns="${SPREADSHEET_NAMESPACE}" xmlns:r="${RELATIONSHIP_NAMESPACE}"><sheets><sheet name="${escapeXml(sheetName)}" sheetId="1" r:id="rId1"/></sheets></workbook>`;
|
|
2272
|
+
}
|
|
2273
|
+
function worksheetXml(sheet) {
|
|
2274
|
+
const columnCount = Math.max(sheet.columnWidths.length, ...sheet.rows.map((row) => row.length), 1);
|
|
2275
|
+
const rowCount = Math.max(sheet.rows.length, 1);
|
|
2276
|
+
const dimension = `A1:${toColumnName(columnCount - 1)}${rowCount}`;
|
|
2277
|
+
const columns = sheet.columnWidths.map((width, index) => width == null ? "" : `<col min="${index + 1}" max="${index + 1}" width="${toColumnWidth(width)}" customWidth="1"/>`).join("");
|
|
2278
|
+
const rows = sheet.rows.map((row, rowIndex) => {
|
|
2279
|
+
const cells = row.map((cell, columnIndex) => cell == null ? "" : cellXml(cell, `${toColumnName(columnIndex)}${rowIndex + 1}`)).join("");
|
|
2280
|
+
return cells === "" ? "" : `<row r="${rowIndex + 1}">${cells}</row>`;
|
|
2281
|
+
}).join("");
|
|
2282
|
+
const merges = sheet.merges.length === 0 ? "" : `<mergeCells count="${sheet.merges.length}">` + sheet.merges.map((merge) => `<mergeCell ref="${toColumnName(merge.firstColumn)}${merge.firstRow + 1}:${toColumnName(merge.lastColumn)}${merge.lastRow + 1}"/>`).join("") + `</mergeCells>`;
|
|
2283
|
+
return XML_DECLARATION + `<worksheet xmlns="${SPREADSHEET_NAMESPACE}" xmlns:r="${RELATIONSHIP_NAMESPACE}"><dimension ref="${dimension}"/>` + sheetViewXml(sheet) + `<sheetFormatPr defaultRowHeight="15"/>` + (columns === "" ? "" : `<cols>${columns}</cols>`) + `<sheetData>${rows}</sheetData>` + merges + `</worksheet>`;
|
|
2284
|
+
}
|
|
2006
2285
|
var GridExportService = class GridExportService {
|
|
2007
2286
|
#document = inject(DOCUMENT$1);
|
|
2008
2287
|
#gridService = inject(GridService);
|
|
2009
2288
|
#platformId = inject(PLATFORM_ID);
|
|
2010
2289
|
exportCsv(filename) {
|
|
2011
2290
|
if (!isPlatformBrowser(this.#platformId)) return;
|
|
2012
|
-
const columns = this.#
|
|
2291
|
+
const columns = this.#exportedColumns();
|
|
2013
2292
|
if (columns.length === 0) return;
|
|
2014
2293
|
const header = columns.map((c) => this.#escapeCsvValue(c.title)).join(",");
|
|
2015
2294
|
const rowLines = [];
|
|
@@ -2018,11 +2297,72 @@ var GridExportService = class GridExportService {
|
|
|
2018
2297
|
rowLines.push(line);
|
|
2019
2298
|
});
|
|
2020
2299
|
const csv = "" + [header, ...rowLines].join("\r\n");
|
|
2021
|
-
|
|
2300
|
+
this.#download(new Blob([csv], { type: "text/csv;charset=utf-8;" }), filename ?? "export.csv");
|
|
2301
|
+
}
|
|
2302
|
+
async exportExcel(filename) {
|
|
2303
|
+
if (!isPlatformBrowser(this.#platformId)) return;
|
|
2304
|
+
const columns = this.#exportedColumns();
|
|
2305
|
+
if (columns.length === 0) return;
|
|
2306
|
+
const name = filename ?? "export.xlsx";
|
|
2307
|
+
const workbook = await writeXlsx(this.#createSheet(columns, name.replace(/\.xlsx$/i, "")));
|
|
2308
|
+
this.#download(new Blob([workbook], { type: XLSX_MIME_TYPE }), name);
|
|
2309
|
+
}
|
|
2310
|
+
#createSheet(columns, name) {
|
|
2311
|
+
const depth = getColumnGroupDepth(columns);
|
|
2312
|
+
const header = Array.from({ length: depth + 1 }, () => columns.map(() => null));
|
|
2313
|
+
const merges = [];
|
|
2314
|
+
for (let level = 0; level < depth; level++) {
|
|
2315
|
+
let start = 0;
|
|
2316
|
+
for (let index = 1; index <= columns.length; index++) {
|
|
2317
|
+
const group = getColumnGroups(columns[start])[level];
|
|
2318
|
+
if (index < columns.length && group != null && getColumnGroups(columns[index])[level]?.id === group.id) continue;
|
|
2319
|
+
if (group != null) {
|
|
2320
|
+
header[level][start] = {
|
|
2321
|
+
style: "group",
|
|
2322
|
+
value: group.title
|
|
2323
|
+
};
|
|
2324
|
+
if (index - 1 > start) merges.push({
|
|
2325
|
+
firstColumn: start,
|
|
2326
|
+
firstRow: level,
|
|
2327
|
+
lastColumn: index - 1,
|
|
2328
|
+
lastRow: level
|
|
2329
|
+
});
|
|
2330
|
+
}
|
|
2331
|
+
start = index;
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2334
|
+
for (const [index, column] of columns.entries()) {
|
|
2335
|
+
const titleRow = getColumnGroups(column).length;
|
|
2336
|
+
header[titleRow][index] = {
|
|
2337
|
+
style: "header",
|
|
2338
|
+
value: column.title
|
|
2339
|
+
};
|
|
2340
|
+
if (titleRow < depth) merges.push({
|
|
2341
|
+
firstColumn: index,
|
|
2342
|
+
firstRow: titleRow,
|
|
2343
|
+
lastColumn: index,
|
|
2344
|
+
lastRow: depth
|
|
2345
|
+
});
|
|
2346
|
+
}
|
|
2347
|
+
const body = this.#gridService.viewRows().select((row) => columns.map((column) => ({ value: this.#toCellValue(row.data[column.field], column.dataType) }))).toArray();
|
|
2348
|
+
const frozenColumns = columns.findIndex((column) => !(column.locked && column.lockedPosition === "left"));
|
|
2349
|
+
const headerTable = this.#gridService.headerTableElement();
|
|
2350
|
+
const view = headerTable?.ownerDocument.defaultView;
|
|
2351
|
+
return {
|
|
2352
|
+
columnWidths: columns.map((column) => column.calculatedWidth ?? column.width),
|
|
2353
|
+
frozenColumns: frozenColumns < 0 ? columns.length : frozenColumns,
|
|
2354
|
+
frozenRows: depth + 1,
|
|
2355
|
+
merges,
|
|
2356
|
+
name,
|
|
2357
|
+
rightToLeft: headerTable != null && view?.getComputedStyle(headerTable).direction === "rtl",
|
|
2358
|
+
rows: [...header, ...body]
|
|
2359
|
+
};
|
|
2360
|
+
}
|
|
2361
|
+
#download(blob, filename) {
|
|
2022
2362
|
const url = this.#document.defaultView.URL.createObjectURL(blob);
|
|
2023
2363
|
const anchor = this.#document.createElement("a");
|
|
2024
2364
|
anchor.href = url;
|
|
2025
|
-
anchor.download = filename
|
|
2365
|
+
anchor.download = filename;
|
|
2026
2366
|
anchor.style.display = "none";
|
|
2027
2367
|
this.#document.body.appendChild(anchor);
|
|
2028
2368
|
anchor.click();
|
|
@@ -2034,6 +2374,9 @@ var GridExportService = class GridExportService {
|
|
|
2034
2374
|
if (/[,"\r\n]/.test(text)) return "\"" + text.replace(/"/g, "\"\"") + "\"";
|
|
2035
2375
|
return text;
|
|
2036
2376
|
}
|
|
2377
|
+
#exportedColumns() {
|
|
2378
|
+
return this.#gridService.columns().where((c) => !!c.field && !c.hidden && c.kind !== "command").toArray();
|
|
2379
|
+
}
|
|
2037
2380
|
#formatValue(value, dataType) {
|
|
2038
2381
|
if (value == null) return "";
|
|
2039
2382
|
switch (dataType) {
|
|
@@ -2043,6 +2386,13 @@ var GridExportService = class GridExportService {
|
|
|
2043
2386
|
default: return this.#escapeCsvValue(String(value));
|
|
2044
2387
|
}
|
|
2045
2388
|
}
|
|
2389
|
+
#toCellValue(value, dataType) {
|
|
2390
|
+
if (value == null || value === "") return null;
|
|
2391
|
+
if (dataType === "number" && typeof value === "number") return value;
|
|
2392
|
+
if (dataType === "boolean" && typeof value === "boolean") return value;
|
|
2393
|
+
if (dataType === "date" && value instanceof Date) return value;
|
|
2394
|
+
return String(value);
|
|
2395
|
+
}
|
|
2046
2396
|
static {
|
|
2047
2397
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
2048
2398
|
minVersion: "12.0.0",
|
|
@@ -2079,6 +2429,9 @@ var GridExportDirective = class GridExportDirective {
|
|
|
2079
2429
|
exportCsv(filename) {
|
|
2080
2430
|
this.#exportService.exportCsv(filename);
|
|
2081
2431
|
}
|
|
2432
|
+
exportExcel(filename) {
|
|
2433
|
+
return this.#exportService.exportExcel(filename);
|
|
2434
|
+
}
|
|
2082
2435
|
static {
|
|
2083
2436
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
2084
2437
|
minVersion: "12.0.0",
|
|
@@ -2243,6 +2596,7 @@ var GridColumnComponent = class GridColumnComponent {
|
|
|
2243
2596
|
format: this.format() ?? null,
|
|
2244
2597
|
groupFooterTemplate: this.groupFooterTemplate() ?? null,
|
|
2245
2598
|
groupSortDirection: null,
|
|
2599
|
+
groups: this.#group?.path() ?? [],
|
|
2246
2600
|
headerTemplate: this.headerTemplate() ?? null,
|
|
2247
2601
|
hidden: this.hidden(),
|
|
2248
2602
|
id: this.#columnId,
|
|
@@ -2262,6 +2616,7 @@ var GridColumnComponent = class GridColumnComponent {
|
|
|
2262
2616
|
width: this.width() ?? null
|
|
2263
2617
|
}), ...ngDevMode ? [{ debugName: "#column" }] : /* istanbul ignore next */ []);
|
|
2264
2618
|
this.#columnId = v4();
|
|
2619
|
+
this.#group = inject(GridColumnGroupComponent, { optional: true });
|
|
2265
2620
|
this.cellTemplate = contentChild(GridCellTemplateDirective, {
|
|
2266
2621
|
...ngDevMode ? { debugName: "cellTemplate" } : /* istanbul ignore next */ {},
|
|
2267
2622
|
read: TemplateRef
|
|
@@ -2320,6 +2675,7 @@ var GridColumnComponent = class GridColumnComponent {
|
|
|
2320
2675
|
}
|
|
2321
2676
|
#column;
|
|
2322
2677
|
#columnId;
|
|
2678
|
+
#group;
|
|
2323
2679
|
getColumn() {
|
|
2324
2680
|
return this.#column();
|
|
2325
2681
|
}
|
|
@@ -2989,7 +3345,7 @@ var GridColumnChooserComponent = class GridColumnChooserComponent {
|
|
|
2989
3345
|
this.columnListSource = computed(() => {
|
|
2990
3346
|
const source = this.#gridService.columns().select((c) => ({
|
|
2991
3347
|
field: c.field,
|
|
2992
|
-
title: c.title
|
|
3348
|
+
title: [...getColumnGroups(c).map((group) => group.title), c.title].join(" / ")
|
|
2993
3349
|
}));
|
|
2994
3350
|
const filterText = this.filterText();
|
|
2995
3351
|
if (!filterText) return source.toImmutableSet();
|
|
@@ -3994,7 +4350,10 @@ var GridComponent = class GridComponent {
|
|
|
3994
4350
|
this.#resizeObserver = null;
|
|
3995
4351
|
this.#toolbarActiveItem = null;
|
|
3996
4352
|
this.#toolbarActiveItemIndex = 0;
|
|
3997
|
-
this.columnDefinitions = contentChildren(GRID_COLUMN_DEFINITION,
|
|
4353
|
+
this.columnDefinitions = contentChildren(GRID_COLUMN_DEFINITION, {
|
|
4354
|
+
...ngDevMode ? { debugName: "columnDefinitions" } : /* istanbul ignore next */ {},
|
|
4355
|
+
descendants: true
|
|
4356
|
+
});
|
|
3998
4357
|
this.filterMenus = viewChildren(GridFilterMenuComponent, ...ngDevMode ? [{ debugName: "filterMenus" }] : /* istanbul ignore next */ []);
|
|
3999
4358
|
this.footerScrollElement = viewChild("footerScrollElement", ...ngDevMode ? [{ debugName: "footerScrollElement" }] : /* istanbul ignore next */ []);
|
|
4000
4359
|
this.ariaRowCount = computed(() => {
|
|
@@ -4065,6 +4424,10 @@ var GridComponent = class GridComponent {
|
|
|
4065
4424
|
this.headerClass = computed(() => {
|
|
4066
4425
|
return gridHeaderThemeVariants();
|
|
4067
4426
|
}, ...ngDevMode ? [{ debugName: "headerClass" }] : /* istanbul ignore next */ []);
|
|
4427
|
+
this.headerGroupCellClass = computed(() => gridHeaderGroupCellThemeVariants(), ...ngDevMode ? [{ debugName: "headerGroupCellClass" }] : /* istanbul ignore next */ []);
|
|
4428
|
+
this.headerGroupRowClass = computed(() => gridHeaderGroupTableRowThemeVariants(), ...ngDevMode ? [{ debugName: "headerGroupRowClass" }] : /* istanbul ignore next */ []);
|
|
4429
|
+
this.headerGroupSpacerCellClass = computed(() => gridHeaderGroupSpacerCellThemeVariants(), ...ngDevMode ? [{ debugName: "headerGroupSpacerCellClass" }] : /* istanbul ignore next */ []);
|
|
4430
|
+
this.headerGroupTitleClass = computed(() => gridHeaderGroupTitleThemeVariants(), ...ngDevMode ? [{ debugName: "headerGroupTitleClass" }] : /* istanbul ignore next */ []);
|
|
4068
4431
|
this.headerKeyShortcuts = computed(() => {
|
|
4069
4432
|
const shortcuts = /* @__PURE__ */ new Map();
|
|
4070
4433
|
const reorderable = this.gridService.reorderableOptions().enabled;
|
|
@@ -4085,6 +4448,7 @@ var GridComponent = class GridComponent {
|
|
|
4085
4448
|
this.headerTableClass = computed(() => {
|
|
4086
4449
|
return gridHeaderTableThemeVariants();
|
|
4087
4450
|
}, ...ngDevMode ? [{ debugName: "headerTableClass" }] : /* istanbul ignore next */ []);
|
|
4451
|
+
this.headerTableColumnRowClass = computed(() => this.gridService.headerGroupDepth() === 0 ? this.headerTableRowClass() : this.headerGroupRowClass(), ...ngDevMode ? [{ debugName: "headerTableColumnRowClass" }] : /* istanbul ignore next */ []);
|
|
4088
4452
|
this.headerTableColumnTitleClass = computed(() => {
|
|
4089
4453
|
return gridHeaderTableColumnTitleThemeVariants();
|
|
4090
4454
|
}, ...ngDevMode ? [{ debugName: "headerTableColumnTitleClass" }] : /* istanbul ignore next */ []);
|
|
@@ -4217,8 +4581,9 @@ var GridComponent = class GridComponent {
|
|
|
4217
4581
|
const column = this.gridService.columns().firstOrDefault((candidate) => candidate.id === columnId);
|
|
4218
4582
|
if (column == null) return;
|
|
4219
4583
|
const pastMiddle = x > rect.left + rect.width / 2;
|
|
4220
|
-
this
|
|
4221
|
-
this.
|
|
4584
|
+
const target = this.#resolveColumnDropTarget(column, pastMiddle !== rtl);
|
|
4585
|
+
this.dropColumn.set(target?.column ?? null);
|
|
4586
|
+
this.dropAfter.set(target?.after ?? false);
|
|
4222
4587
|
return;
|
|
4223
4588
|
}
|
|
4224
4589
|
}
|
|
@@ -4389,14 +4754,9 @@ var GridComponent = class GridComponent {
|
|
|
4389
4754
|
}
|
|
4390
4755
|
#moveColumnByKeyboard(column, step) {
|
|
4391
4756
|
if (column.locked || !this.gridService.reorderableOptions().enabled) return;
|
|
4392
|
-
const
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
let neighbor = index + step;
|
|
4396
|
-
while (neighbor >= 0 && neighbor < columns.length && columns[neighbor].hidden) neighbor += step;
|
|
4397
|
-
const target = columns[neighbor];
|
|
4398
|
-
if (index < 0 || target == null || this.getColumnLockBucket(target) !== bucket) return;
|
|
4399
|
-
if (!this.gridService.reorderColumn(column, step === 1 ? neighbor + 1 : neighbor)) return;
|
|
4757
|
+
const target = getColumnStepTarget(this.gridService.columns().toArray(), column, step);
|
|
4758
|
+
if (target == null || this.getColumnLockBucket(target.neighbor) !== this.getColumnLockBucket(column)) return;
|
|
4759
|
+
if (!this.gridService.reorderColumn(column, target.beforeIndex)) return;
|
|
4400
4760
|
const position = this.gridService.visibleColumns().toArray().findIndex((candidate) => candidate.id === column.id) + 1;
|
|
4401
4761
|
this.#liveAnnouncer.announce(this.messages().columnMoved(column.title, position));
|
|
4402
4762
|
this.#refocusHeader(column.id);
|
|
@@ -4406,6 +4766,30 @@ var GridComponent = class GridComponent {
|
|
|
4406
4766
|
if (!this.#gridNavigationService.focusHeaderCell(columnId)) this.#gridNavigationService.focusActiveCellOrFirstHeader();
|
|
4407
4767
|
} }, { injector: this.#injector });
|
|
4408
4768
|
}
|
|
4769
|
+
#resolveColumnDropTarget(hovered, after) {
|
|
4770
|
+
const dragColumn = this.dragColumn();
|
|
4771
|
+
if (dragColumn == null) return {
|
|
4772
|
+
after,
|
|
4773
|
+
column: hovered
|
|
4774
|
+
};
|
|
4775
|
+
const columns = this.gridService.columns().toArray();
|
|
4776
|
+
const index = columns.findIndex((candidate) => candidate.id === hovered.id);
|
|
4777
|
+
const run = getSiblingRuns(columns, dragColumn).find((candidate) => candidate.start <= index && index < candidate.end);
|
|
4778
|
+
if (run == null) return null;
|
|
4779
|
+
const visible = columns.slice(run.start, run.end).filter((candidate) => !candidate.hidden);
|
|
4780
|
+
if (visible.length <= 1) return {
|
|
4781
|
+
after,
|
|
4782
|
+
column: hovered
|
|
4783
|
+
};
|
|
4784
|
+
const position = visible.findIndex((candidate) => candidate.id === hovered.id) * 2 + 1;
|
|
4785
|
+
return (position === visible.length ? after : position > visible.length) ? {
|
|
4786
|
+
after: true,
|
|
4787
|
+
column: visible[visible.length - 1]
|
|
4788
|
+
} : {
|
|
4789
|
+
after: false,
|
|
4790
|
+
column: visible[0]
|
|
4791
|
+
};
|
|
4792
|
+
}
|
|
4409
4793
|
clearDragState() {
|
|
4410
4794
|
this.dragColumn.set(null);
|
|
4411
4795
|
this.dropColumn.set(null);
|
|
@@ -4437,7 +4821,7 @@ var GridComponent = class GridComponent {
|
|
|
4437
4821
|
getTableColumnHeaderCellList() {
|
|
4438
4822
|
const headerElement = this.gridHeaderElement();
|
|
4439
4823
|
if (!headerElement) return [];
|
|
4440
|
-
const thList = headerElement.nativeElement.querySelectorAll("thead > tr
|
|
4824
|
+
const thList = headerElement.nativeElement.querySelectorAll("thead > tr[data-grid-column-header-row] > th");
|
|
4441
4825
|
const headerCells = Array.from(thList);
|
|
4442
4826
|
if (this.gridService.rowReorderColumnVisible()) headerCells.shift();
|
|
4443
4827
|
if (this.gridService.masterDetailTemplate()) headerCells.shift();
|
|
@@ -4754,6 +5138,7 @@ var GridComponent = class GridComponent {
|
|
|
4754
5138
|
{
|
|
4755
5139
|
propertyName: "columnDefinitions",
|
|
4756
5140
|
predicate: GRID_COLUMN_DEFINITION,
|
|
5141
|
+
descendants: true,
|
|
4757
5142
|
isSignal: true
|
|
4758
5143
|
},
|
|
4759
5144
|
{
|
|
@@ -4825,7 +5210,7 @@ var GridComponent = class GridComponent {
|
|
|
4825
5210
|
}
|
|
4826
5211
|
],
|
|
4827
5212
|
ngImport: i0,
|
|
4828
|
-
template: "@if (toolbarTemplate()) {\n <div\n class=\"flex min-h-10 items-center gap-2 border-b border-border p-2\"\n role=\"toolbar\"\n [attr.aria-label]=\"messages().toolbar\"\n #toolbarElement\n (focusin)=\"onToolbarFocusIn($event)\"\n (keydown)=\"onToolbarKeydown($event)\">\n <ng-container\n [ngTemplateOutlet]=\"toolbarTemplate() ?? null\"\n [ngTemplateOutletContext]=\"toolbarContext()\"></ng-container>\n <button monaButton size=\"small\" #columnsButton>{{ messages().columns }}</button>\n <mona-popup\n [anchor]=\"columnsButton\"\n [animation]=\"{ leave: [] }\"\n [width]=\"'max-content'\"\n [anchorConnectionPoint]=\"'bottomleft'\"\n [popupConnectionPoint]=\"'topleft'\"\n #popup>\n <mona-grid-column-chooser\n (apply)=\"popup.closePopup()\"\n (cancel)=\"popup.closePopup()\"></mona-grid-column-chooser>\n </mona-popup>\n </div>\n}\n\n@if (groupable()) {\n <div\n [class]=\"groupPanelClass()\"\n cdkDropList\n #groupColumnList=\"cdkDropList\"\n cdkDropListOrientation=\"horizontal\"\n (cdkDropListEntered)=\"onColumnDragEnterForGrouping()\"\n (cdkDropListExited)=\"onColumnDragExitForGrouping()\"\n (cdkDropListDropped)=\"onColumnDropForGrouping($event)\">\n @if (gridService.groupColumns().length !== 0) {\n @for (groupColumn of gridService.groupColumns(); track groupColumn.id) {\n @let groupMenuId = groupColumn.id + \"-group-menu\";\n @let groupMenuOpen = openGroupMenuColumnId() === groupColumn.id;\n <mona-chip\n [aria-label]=\"groupColumn.title\"\n [removable]=\"true\"\n size=\"small\"\n tabindex=\"-1\"\n [rounded]=\"rounded()\"\n (click)=\"onGroupingColumnSort(groupColumn)\"\n (remove)=\"onGroupingColumnRemove($event, groupColumn)\">\n @if (groupColumn.groupSortDirection === \"asc\") {\n <svg lucideArrowDown [size]=\"16\" aria-hidden=\"true\"></svg>\n } @else if (groupColumn.groupSortDirection === \"desc\") {\n <svg lucideArrowUp [size]=\"16\" aria-hidden=\"true\"></svg>\n }\n <span>{{ groupColumn.title }}</span>\n <button\n monaButton\n look=\"link\"\n type=\"button\"\n class=\"ms-1\"\n aria-haspopup=\"menu\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [id]=\"groupColumn.id + '-group-button'\"\n [attr.aria-controls]=\"groupMenuOpen ? groupMenuId : null\"\n [attr.aria-expanded]=\"groupMenuOpen\"\n [attr.aria-label]=\"messages().groupOptions(groupColumn.title)\"\n (click)=\"$event.stopPropagation()\"\n #groupReorder>\n <svg lucideEllipsisVertical [size]=\"16\" aria-hidden=\"true\"></svg>\n </button>\n <mona-popup-menu\n size=\"small\"\n [id]=\"groupMenuId\"\n [target]=\"groupReorder\"\n (close)=\"openGroupMenuColumnId.set(null)\"\n (open)=\"openGroupMenuColumnId.set(groupColumn.id)\">\n <mona-popup-menu-item\n [disabled]=\"$first\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'prev')\">\n <ng-template monaPopupMenuTextTemplate>\n <svg lucideArrowLeft [size]=\"16\" aria-hidden=\"true\" class=\"rtl:rotate-180\"></svg>\n {{ messages().moveAsPrevious }}\n </ng-template>\n </mona-popup-menu-item>\n <mona-popup-menu-item\n [disabled]=\"$last\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'next')\">\n <ng-template monaPopupMenuTextTemplate>\n <svg lucideArrowRight [size]=\"16\" aria-hidden=\"true\" class=\"rtl:rotate-180\"></svg>\n {{ messages().moveAsNext }}\n </ng-template>\n </mona-popup-menu-item>\n </mona-popup-menu>\n </mona-chip>\n }\n } @else if (groupPanelPlaceholderVisible()) {\n <span [class]=\"groupPanelPlaceholderClass()\">{{ messages().dragColumnHeaderToGroup }}</span>\n }\n </div>\n}\n<div\n class=\"flex flex-col flex-1 min-h-0\"\n [attr.role]=\"gridRole()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-busy]=\"gridService.serverLoading() || null\"\n [attr.aria-rowcount]=\"ariaRowCount()\"\n [attr.aria-colcount]=\"gridService.layout().length\"\n [attr.aria-multiselectable]=\"multiselectable() || null\"\n [attr.aria-readonly]=\"gridService.editableOptions().enabled ? null : true\">\n <div [class]=\"headerClass()\" [style.margin-inline-end.px]=\"headerMarginInlineEnd()\" #gridHeaderElement>\n <div>\n <table\n role=\"presentation\"\n #headerTable\n [class]=\"headerTableClass()\"\n [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <thead role=\"rowgroup\" [style.visibility]=\"!gridWidthSet() ? 'hidden' : undefined\">\n <tr\n role=\"row\"\n aria-rowindex=\"1\"\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n [cdkDropListSortingDisabled]=\"true\"\n [cdkDropListConnectedTo]=\"groupable() ? [groupColumnList()!] : []\"\n (cdkDropListDropped)=\"onColumnDrop()\"\n [class]=\"headerTableRowClass()\">\n @for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n @let column = layoutColumn.column;\n @let columnSortable =\n gridService.sortableOptions().enabled &&\n column.kind === \"data\" &&\n column.sortable &&\n column.field !== \"\";\n @let sortOrderShown =\n gridService.sortableOptions().enabled &&\n gridService.sortableOptions().mode === \"multiple\" &&\n gridService.sortableOptions().showIndices &&\n column.sortIndex !== null;\n @let defaultTitle = !column.headerTemplate && !column.titleTemplate;\n <th\n scope=\"col\"\n role=\"columnheader\"\n [attr.data-column-id]=\"column.id\"\n [attr.aria-labelledby]=\"defaultTitle ? uid + '-title-' + column.id : null\"\n [attr.aria-label]=\"!defaultTitle && column.title ? column.title : null\"\n [attr.aria-describedby]=\"sortOrderShown ? uid + '-sort-' + column.id : null\"\n cdkDrag\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'header'\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n (toggleExpand)=\"onColumnSort(column)\"\n (menuOpen)=\"openColumnFilterMenu(column)\"\n [attr.aria-keyshortcuts]=\"headerKeyShortcuts().get(column.id) ?? null\"\n (keydown)=\"onHeaderKeydown($event, column)\"\n [cdkDragData]=\"column\"\n [cdkDragDisabled]=\"isColumnDragDisabled(column)\"\n [class]=\"headerTableCellClass()\"\n (cdkDragMoved)=\"onColumnDragMove($event)\"\n (cdkDragEntered)=\"onColumnDragEnter($event)\"\n (cdkDragStarted)=\"onColumnDragStart($event)\"\n (cdkDragEnded)=\"onColumnDragEnd($event)\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\"\n [attr.aria-sort]=\"\n columnSortable && (column.sortIndex ?? 1) === 1\n ? (column.columnSortDirection | columnAriaSort)\n : null\n \">\n <div\n [class]=\"headerTableColumnWrapClass()\"\n [style.cursor]=\"columnSortable ? 'pointer' : 'default'\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: column,\n column\n }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n [id]=\"uid + '-title-' + column.id\"\n data-column-title\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n\n @if (sortOrderShown) {\n <span class=\"sr-only\" [id]=\"uid + '-sort-' + column.id\">{{\n messages().sortOrder(column.sortIndex ?? 1)\n }}</span>\n }\n <div [class]=\"columnActionsClass()\" [attr.data-column-actions]=\"true\">\n @if (\n gridService.sortableOptions().enabled &&\n column.columnSortDirection !== null\n ) {\n <div class=\"inline-flex shrink-0 items-center gap-0.5\">\n @if (column.columnSortDirection === \"asc\") {\n <svg lucideArrowUp [size]=\"16\" aria-hidden=\"true\"></svg>\n } @else {\n <svg lucideArrowDown [size]=\"16\" aria-hidden=\"true\"></svg>\n }\n @if (\n gridService.sortableOptions().mode === \"multiple\" &&\n gridService.sortableOptions().showIndices &&\n column.sortIndex !== null\n ) {\n <span class=\"tabular-nums\" aria-hidden=\"true\">{{\n column.sortIndex\n }}</span>\n }\n </div>\n }\n @if (filterMenuEnabled()) {\n @if (column.kind === \"data\" && column.filterable) {\n <mona-grid-filter-menu\n [column]=\"column\"\n [type]=\"column.dataType\"\n (apply)=\"\n onColumnFilter(column, $event)\n \"></mona-grid-filter-menu>\n }\n }\n </div>\n </div>\n @if (\n dropColumn() === column &&\n dragColumn() &&\n gridService.reorderableOptions().enabled &&\n !groupingInProgress()\n ) {\n <span [class]=\"columnDropHintClass()\"> </span>\n }\n @if (gridService.resizableOptions().enabled && !columnDragging()) {\n <div\n monaGridColumnResizeHandler\n [column]=\"column\"\n [class]=\"columnResizerClass()\"\n (resizeStart)=\"onColumnResizeStart()\"\n (resizeEnd)=\"onColumnResizeEnd($event)\"></div>\n }\n <ng-template cdkDragPreview>\n <div [class]=\"columnDragPreviewClass()\">\n <span>{{ column.title }}</span>\n </div>\n </ng-template>\n <ng-template cdkDragPlaceholder>\n @if (groupingInProgress()) {\n <mona-chip\n style=\"z-index: 10; pointer-events: none\"\n [aria-label]=\"column.title\"\n [removable]=\"true\"\n [rounded]=\"rounded()\"\n >{{ column.title }}</mona-chip\n >\n }\n </ng-template>\n </th>\n @if (columnDragging() && dragColumn() === column) {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n aria-hidden=\"true\"\n [class]=\"headerTableCellClass()\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: column,\n column\n }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n </div>\n </th>\n }\n } @else if (layoutColumn.kind === \"reorder\") {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n scope=\"col\"\n role=\"columnheader\"\n [attr.aria-label]=\"gridService.messages().rowReorder\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\"></th>\n } @else if (layoutColumn.kind === \"selection\") {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n scope=\"col\"\n role=\"columnheader\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\">\n @if (\n gridService.selectableOptions().mode === \"multiple\" &&\n gridService.selectableOptions().showSelectAll !== false\n ) {\n <mona-grid-select-all-checkbox />\n }\n </th>\n } @else {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n scope=\"col\"\n role=\"columnheader\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\">\n <span class=\"sr-only\">{{\n layoutColumn.kind === \"detail\" ? messages().details : messages().group\n }}</span>\n </th>\n }\n }\n </tr>\n @if (filterRowEnabled()) {\n <tr role=\"row\" aria-rowindex=\"2\" [class]=\"headerTableRowClass()\">\n @for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n @let column = layoutColumn.column;\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'filter'\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'filter'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n role=\"gridcell\"\n [class]=\"filterRowCellClass()\"\n [style.width.px]=\"layoutColumn.width\"\n [attr.aria-label]=\"messages().filterByColumn(column.title)\">\n @if (column.kind === \"data\" && column.field && column.filterable) {\n <mona-grid-filter-row-cell\n [column]=\"column\"\n (apply)=\"onColumnFilter(column, $event)\" />\n }\n </th>\n } @else {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n role=\"gridcell\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\"></th>\n }\n }\n </tr>\n }\n </thead>\n </table>\n </div>\n </div>\n\n @defer (when gridWidthSet()) {\n @if (gridService.virtualScrollOptions().enabled) {\n @if (gridService.viewRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-virtual-list [data]=\"gridService.viewRows()\" />\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\" />\n }\n } @else {\n <div class=\"relative flex-1 min-h-0\" data-grid-body-region>\n @if (gridService.viewPageRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-list [data]=\"gridService.viewPageRows()\" />\n } @else if (!gridService.serverLoading()) {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\" />\n }\n @if (gridService.serverLoading()) {\n <div\n class=\"absolute inset-0 z-20 flex items-center justify-center bg-surface/60\"\n aria-hidden=\"true\"\n data-grid-loading>\n <mona-spinner size=\"large\" />\n </div>\n }\n </div>\n @if (gridService.viewPageRows().length !== 0 || gridService.addRowVisible()) {\n @if (footerVisible()) {\n <div\n [class]=\"footerClass()\"\n [style.margin-inline-end.px]=\"gridService.scrollbarGutterWidth()\"\n #footerScrollElement\n data-grid-footer-scroll>\n <div>\n <table\n role=\"presentation\"\n [class]=\"footerTableClass()\"\n [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <tfoot role=\"rowgroup\">\n <tr monaGridFooterRow [ariaRowIndex]=\"ariaRowCount()\"></tr>\n </tfoot>\n </table>\n </div>\n </div>\n }\n }\n }\n } @placeholder {\n <mona-placeholder [text]=\"messages().loading\" />\n }\n</div>\n@if (!gridService.virtualScrollOptions().enabled) {\n @if (gridService.serverBindingEnabled() || gridService.pagerTotal() !== 0 || gridService.addRowVisible()) {\n <mona-pager\n class=\"border-0 border-t border-t-border rounded-ss-none rounded-se-none\"\n [skip]=\"gridService.paginationState().skip\"\n [pageSize]=\"gridService.paginationState().take\"\n [total]=\"gridService.pagerTotal()\"\n [size]=\"'small'\"\n [rounded]=\"rounded()\"\n [pageInput]=\"true\"\n [pageSizeValues]=\"pageSizeValues()\"\n [responsive]=\"responsivePager()\"\n (pageChange)=\"onPageChange($event)\"></mona-pager>\n }\n}\n\n<ng-template #emptyGridTemplate>\n <div [class]=\"noDataClass()\" role=\"rowgroup\">\n <div role=\"row\" class=\"contents\" [attr.aria-rowindex]=\"gridService.bodyAriaRowStart() + 1\">\n <div role=\"gridcell\" class=\"contents\" [attr.aria-colspan]=\"gridService.layout().length\">\n @if (noDataTemplate()) {\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n } @else {\n <mona-placeholder [text]=\"gridService.messages().noData\"></mona-placeholder>\n }\n </div>\n </div>\n </div>\n</ng-template>\n",
|
|
5213
|
+
template: "@if (toolbarTemplate()) {\n <div\n class=\"flex min-h-10 items-center gap-2 border-b border-border p-2\"\n role=\"toolbar\"\n [attr.aria-label]=\"messages().toolbar\"\n #toolbarElement\n (focusin)=\"onToolbarFocusIn($event)\"\n (keydown)=\"onToolbarKeydown($event)\">\n <ng-container\n [ngTemplateOutlet]=\"toolbarTemplate() ?? null\"\n [ngTemplateOutletContext]=\"toolbarContext()\"></ng-container>\n <button monaButton size=\"small\" #columnsButton>{{ messages().columns }}</button>\n <mona-popup\n [anchor]=\"columnsButton\"\n [animation]=\"{ leave: [] }\"\n [width]=\"'max-content'\"\n [anchorConnectionPoint]=\"'bottomleft'\"\n [popupConnectionPoint]=\"'topleft'\"\n #popup>\n <mona-grid-column-chooser\n (apply)=\"popup.closePopup()\"\n (cancel)=\"popup.closePopup()\"></mona-grid-column-chooser>\n </mona-popup>\n </div>\n}\n\n@if (groupable()) {\n <div\n [class]=\"groupPanelClass()\"\n cdkDropList\n #groupColumnList=\"cdkDropList\"\n cdkDropListOrientation=\"horizontal\"\n (cdkDropListEntered)=\"onColumnDragEnterForGrouping()\"\n (cdkDropListExited)=\"onColumnDragExitForGrouping()\"\n (cdkDropListDropped)=\"onColumnDropForGrouping($event)\">\n @if (gridService.groupColumns().length !== 0) {\n @for (groupColumn of gridService.groupColumns(); track groupColumn.id) {\n @let groupMenuId = groupColumn.id + \"-group-menu\";\n @let groupMenuOpen = openGroupMenuColumnId() === groupColumn.id;\n <mona-chip\n [aria-label]=\"groupColumn.title\"\n [removable]=\"true\"\n size=\"small\"\n tabindex=\"-1\"\n [rounded]=\"rounded()\"\n (click)=\"onGroupingColumnSort(groupColumn)\"\n (remove)=\"onGroupingColumnRemove($event, groupColumn)\">\n @if (groupColumn.groupSortDirection === \"asc\") {\n <svg lucideArrowDown [size]=\"16\" aria-hidden=\"true\"></svg>\n } @else if (groupColumn.groupSortDirection === \"desc\") {\n <svg lucideArrowUp [size]=\"16\" aria-hidden=\"true\"></svg>\n }\n <span>{{ groupColumn.title }}</span>\n <button\n monaButton\n look=\"link\"\n type=\"button\"\n class=\"ms-1\"\n aria-haspopup=\"menu\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [id]=\"groupColumn.id + '-group-button'\"\n [attr.aria-controls]=\"groupMenuOpen ? groupMenuId : null\"\n [attr.aria-expanded]=\"groupMenuOpen\"\n [attr.aria-label]=\"messages().groupOptions(groupColumn.title)\"\n (click)=\"$event.stopPropagation()\"\n #groupReorder>\n <svg lucideEllipsisVertical [size]=\"16\" aria-hidden=\"true\"></svg>\n </button>\n <mona-popup-menu\n size=\"small\"\n [id]=\"groupMenuId\"\n [target]=\"groupReorder\"\n (close)=\"openGroupMenuColumnId.set(null)\"\n (open)=\"openGroupMenuColumnId.set(groupColumn.id)\">\n <mona-popup-menu-item\n [disabled]=\"$first\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'prev')\">\n <ng-template monaPopupMenuTextTemplate>\n <svg lucideArrowLeft [size]=\"16\" aria-hidden=\"true\" class=\"rtl:rotate-180\"></svg>\n {{ messages().moveAsPrevious }}\n </ng-template>\n </mona-popup-menu-item>\n <mona-popup-menu-item\n [disabled]=\"$last\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'next')\">\n <ng-template monaPopupMenuTextTemplate>\n <svg lucideArrowRight [size]=\"16\" aria-hidden=\"true\" class=\"rtl:rotate-180\"></svg>\n {{ messages().moveAsNext }}\n </ng-template>\n </mona-popup-menu-item>\n </mona-popup-menu>\n </mona-chip>\n }\n } @else if (groupPanelPlaceholderVisible()) {\n <span [class]=\"groupPanelPlaceholderClass()\">{{ messages().dragColumnHeaderToGroup }}</span>\n }\n </div>\n}\n<div\n class=\"flex flex-col flex-1 min-h-0\"\n [attr.role]=\"gridRole()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-busy]=\"gridService.serverLoading() || null\"\n [attr.aria-rowcount]=\"ariaRowCount()\"\n [attr.aria-colcount]=\"gridService.layout().length\"\n [attr.aria-multiselectable]=\"multiselectable() || null\"\n [attr.aria-readonly]=\"gridService.editableOptions().enabled ? null : true\">\n <div [class]=\"headerClass()\" [style.margin-inline-end.px]=\"headerMarginInlineEnd()\" #gridHeaderElement>\n <div>\n <table\n role=\"presentation\"\n #headerTable\n [class]=\"headerTableClass()\"\n [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <thead role=\"rowgroup\" [style.visibility]=\"!gridWidthSet() ? 'hidden' : undefined\">\n @let groupDepth = gridService.headerGroupDepth();\n @for (groupRow of gridService.headerGroupRows(); track $index; let level = $index) {\n <tr role=\"row\" [attr.aria-rowindex]=\"level + 1\" [class]=\"headerGroupRowClass()\">\n @for (cell of groupRow; track cell.key) {\n @if (cell.kind === \"group\") {\n <th\n scope=\"colgroup\"\n role=\"columnheader\"\n [attr.data-column-group-id]=\"cell.group.id\"\n [attr.aria-colspan]=\"cell.colSpan\"\n [monaGridLockedCell]=\"null\"\n [lockedCellHeader]=\"true\"\n [stickyState]=\"cell.sticky\"\n monaGridLogicalCell\n [cellKind]=\"'header'\"\n [columnId]=\"'$group:' + cell.key\"\n [rowIndex]=\"level - groupDepth - 1\"\n [colIndex]=\"cell.colIndex\"\n [columnSpan]=\"cell.colSpan\"\n [ariaColIndex]=\"cell.ariaColIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"cell.firstInRow\"\n [lastInRow]=\"cell.lastInRow\"\n [class]=\"headerGroupCellClass()\"\n [style.width.px]=\"cell.width\">\n <span\n [class]=\"headerGroupTitleClass()\"\n [style.inset-inline-start.px]=\"\n cell.sticky === null ? gridService.stickyInset().start : null\n \"\n [title]=\"cell.group.title\"\n >{{ cell.group.title }}</span\n >\n </th>\n } @else {\n <th\n aria-hidden=\"true\"\n [monaGridLockedCell]=\"cell.layoutKey\"\n [lockedCellHeader]=\"true\"\n [class]=\"headerGroupSpacerCellClass()\"\n [style.width.px]=\"cell.width\"></th>\n }\n }\n </tr>\n }\n <tr\n role=\"row\"\n data-grid-column-header-row\n [attr.aria-rowindex]=\"groupDepth + 1\"\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n [cdkDropListSortingDisabled]=\"true\"\n [cdkDropListConnectedTo]=\"groupable() ? [groupColumnList()!] : []\"\n (cdkDropListDropped)=\"onColumnDrop()\"\n [class]=\"headerTableColumnRowClass()\">\n @for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n @let column = layoutColumn.column;\n @let columnSortable =\n gridService.sortableOptions().enabled &&\n column.kind === \"data\" &&\n column.sortable &&\n column.field !== \"\";\n @let sortOrderShown =\n gridService.sortableOptions().enabled &&\n gridService.sortableOptions().mode === \"multiple\" &&\n gridService.sortableOptions().showIndices &&\n column.sortIndex !== null;\n @let defaultTitle = !column.headerTemplate && !column.titleTemplate;\n <th\n scope=\"col\"\n role=\"columnheader\"\n [attr.data-column-id]=\"column.id\"\n [attr.aria-labelledby]=\"defaultTitle ? uid + '-title-' + column.id : null\"\n [attr.aria-label]=\"!defaultTitle && column.title ? column.title : null\"\n [attr.aria-describedby]=\"sortOrderShown ? uid + '-sort-' + column.id : null\"\n cdkDrag\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'header'\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n (toggleExpand)=\"onColumnSort(column)\"\n (menuOpen)=\"openColumnFilterMenu(column)\"\n [attr.aria-keyshortcuts]=\"headerKeyShortcuts().get(column.id) ?? null\"\n (keydown)=\"onHeaderKeydown($event, column)\"\n [cdkDragData]=\"column\"\n [cdkDragDisabled]=\"isColumnDragDisabled(column)\"\n [class]=\"headerTableCellClass()\"\n (cdkDragMoved)=\"onColumnDragMove($event)\"\n (cdkDragEntered)=\"onColumnDragEnter($event)\"\n (cdkDragStarted)=\"onColumnDragStart($event)\"\n (cdkDragEnded)=\"onColumnDragEnd($event)\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\"\n [attr.aria-sort]=\"\n columnSortable && (column.sortIndex ?? 1) === 1\n ? (column.columnSortDirection | columnAriaSort)\n : null\n \">\n <div\n [class]=\"headerTableColumnWrapClass()\"\n [style.cursor]=\"columnSortable ? 'pointer' : 'default'\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: column,\n column\n }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n [id]=\"uid + '-title-' + column.id\"\n data-column-title\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n\n @if (sortOrderShown) {\n <span class=\"sr-only\" [id]=\"uid + '-sort-' + column.id\">{{\n messages().sortOrder(column.sortIndex ?? 1)\n }}</span>\n }\n <div [class]=\"columnActionsClass()\" [attr.data-column-actions]=\"true\">\n @if (\n gridService.sortableOptions().enabled &&\n column.columnSortDirection !== null\n ) {\n <div class=\"inline-flex shrink-0 items-center gap-0.5\">\n @if (column.columnSortDirection === \"asc\") {\n <svg lucideArrowUp [size]=\"16\" aria-hidden=\"true\"></svg>\n } @else {\n <svg lucideArrowDown [size]=\"16\" aria-hidden=\"true\"></svg>\n }\n @if (\n gridService.sortableOptions().mode === \"multiple\" &&\n gridService.sortableOptions().showIndices &&\n column.sortIndex !== null\n ) {\n <span class=\"tabular-nums\" aria-hidden=\"true\">{{\n column.sortIndex\n }}</span>\n }\n </div>\n }\n @if (filterMenuEnabled()) {\n @if (column.kind === \"data\" && column.filterable) {\n <mona-grid-filter-menu\n [column]=\"column\"\n [type]=\"column.dataType\"\n (apply)=\"\n onColumnFilter(column, $event)\n \"></mona-grid-filter-menu>\n }\n }\n </div>\n </div>\n @if (\n dropColumn() === column &&\n dragColumn() &&\n gridService.reorderableOptions().enabled &&\n !groupingInProgress()\n ) {\n <span [class]=\"columnDropHintClass()\"> </span>\n }\n @if (gridService.resizableOptions().enabled && !columnDragging()) {\n <div\n monaGridColumnResizeHandler\n [column]=\"column\"\n [class]=\"columnResizerClass()\"\n (resizeStart)=\"onColumnResizeStart()\"\n (resizeEnd)=\"onColumnResizeEnd($event)\"></div>\n }\n <ng-template cdkDragPreview>\n <div [class]=\"columnDragPreviewClass()\">\n <span>{{ column.title }}</span>\n </div>\n </ng-template>\n <ng-template cdkDragPlaceholder>\n @if (groupingInProgress()) {\n <mona-chip\n style=\"z-index: 10; pointer-events: none\"\n [aria-label]=\"column.title\"\n [removable]=\"true\"\n [rounded]=\"rounded()\"\n >{{ column.title }}</mona-chip\n >\n }\n </ng-template>\n </th>\n @if (columnDragging() && dragColumn() === column) {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n aria-hidden=\"true\"\n [class]=\"headerTableCellClass()\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: column,\n column\n }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n </div>\n </th>\n }\n } @else if (layoutColumn.kind === \"reorder\") {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n scope=\"col\"\n role=\"columnheader\"\n [attr.aria-label]=\"gridService.messages().rowReorder\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\"></th>\n } @else if (layoutColumn.kind === \"selection\") {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n scope=\"col\"\n role=\"columnheader\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\">\n @if (\n gridService.selectableOptions().mode === \"multiple\" &&\n gridService.selectableOptions().showSelectAll !== false\n ) {\n <mona-grid-select-all-checkbox />\n }\n </th>\n } @else {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n scope=\"col\"\n role=\"columnheader\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\">\n <span class=\"sr-only\">{{\n layoutColumn.kind === \"detail\" ? messages().details : messages().group\n }}</span>\n </th>\n }\n }\n </tr>\n @if (filterRowEnabled()) {\n <tr role=\"row\" [attr.aria-rowindex]=\"groupDepth + 2\" [class]=\"headerTableRowClass()\">\n @for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n @let column = layoutColumn.column;\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'filter'\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'filter'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n role=\"gridcell\"\n [class]=\"filterRowCellClass()\"\n [style.width.px]=\"layoutColumn.width\"\n [attr.aria-label]=\"messages().filterByColumn(column.title)\">\n @if (column.kind === \"data\" && column.field && column.filterable) {\n <mona-grid-filter-row-cell\n [column]=\"column\"\n (apply)=\"onColumnFilter(column, $event)\" />\n }\n </th>\n } @else {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n role=\"gridcell\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\"></th>\n }\n }\n </tr>\n }\n </thead>\n </table>\n </div>\n </div>\n\n @defer (when gridWidthSet()) {\n @if (gridService.virtualScrollOptions().enabled) {\n @if (gridService.viewRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-virtual-list [data]=\"gridService.viewRows()\" />\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\" />\n }\n } @else {\n <div class=\"relative flex-1 min-h-0\" data-grid-body-region>\n @if (gridService.viewPageRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-list [data]=\"gridService.viewPageRows()\" />\n } @else if (!gridService.serverLoading()) {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\" />\n }\n @if (gridService.serverLoading()) {\n <div\n class=\"absolute inset-0 z-20 flex items-center justify-center bg-surface/60\"\n aria-hidden=\"true\"\n data-grid-loading>\n <mona-spinner size=\"large\" />\n </div>\n }\n </div>\n @if (gridService.viewPageRows().length !== 0 || gridService.addRowVisible()) {\n @if (footerVisible()) {\n <div\n [class]=\"footerClass()\"\n [style.margin-inline-end.px]=\"gridService.scrollbarGutterWidth()\"\n #footerScrollElement\n data-grid-footer-scroll>\n <div>\n <table\n role=\"presentation\"\n [class]=\"footerTableClass()\"\n [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <tfoot role=\"rowgroup\">\n <tr monaGridFooterRow [ariaRowIndex]=\"ariaRowCount()\"></tr>\n </tfoot>\n </table>\n </div>\n </div>\n }\n }\n }\n } @placeholder {\n <mona-placeholder [text]=\"messages().loading\" />\n }\n</div>\n@if (!gridService.virtualScrollOptions().enabled) {\n @if (gridService.serverBindingEnabled() || gridService.pagerTotal() !== 0 || gridService.addRowVisible()) {\n <mona-pager\n class=\"border-0 border-t border-t-border rounded-ss-none rounded-se-none\"\n [skip]=\"gridService.paginationState().skip\"\n [pageSize]=\"gridService.paginationState().take\"\n [total]=\"gridService.pagerTotal()\"\n [size]=\"'small'\"\n [rounded]=\"rounded()\"\n [pageInput]=\"true\"\n [pageSizeValues]=\"pageSizeValues()\"\n [responsive]=\"responsivePager()\"\n (pageChange)=\"onPageChange($event)\"></mona-pager>\n }\n}\n\n<ng-template #emptyGridTemplate>\n <div [class]=\"noDataClass()\" role=\"rowgroup\">\n <div role=\"row\" class=\"contents\" [attr.aria-rowindex]=\"gridService.bodyAriaRowStart() + 1\">\n <div role=\"gridcell\" class=\"contents\" [attr.aria-colspan]=\"gridService.layout().length\">\n @if (noDataTemplate()) {\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n } @else {\n <mona-placeholder [text]=\"gridService.messages().noData\"></mona-placeholder>\n }\n </div>\n </div>\n </div>\n</ng-template>\n",
|
|
4829
5214
|
dependencies: [
|
|
4830
5215
|
{
|
|
4831
5216
|
kind: "component",
|
|
@@ -5071,6 +5456,7 @@ var GridComponent = class GridComponent {
|
|
|
5071
5456
|
"cellKind",
|
|
5072
5457
|
"colIndex",
|
|
5073
5458
|
"columnId",
|
|
5459
|
+
"columnSpan",
|
|
5074
5460
|
"editable",
|
|
5075
5461
|
"expanded",
|
|
5076
5462
|
"firstInRow",
|
|
@@ -5092,7 +5478,11 @@ var GridComponent = class GridComponent {
|
|
|
5092
5478
|
kind: "directive",
|
|
5093
5479
|
type: GridLockedCellDirective,
|
|
5094
5480
|
selector: "td[monaGridLockedCell], th[monaGridLockedCell]",
|
|
5095
|
-
inputs: [
|
|
5481
|
+
inputs: [
|
|
5482
|
+
"monaGridLockedCell",
|
|
5483
|
+
"lockedCellHeader",
|
|
5484
|
+
"stickyState"
|
|
5485
|
+
]
|
|
5096
5486
|
},
|
|
5097
5487
|
{
|
|
5098
5488
|
kind: "directive",
|
|
@@ -5172,9 +5562,9 @@ var GridComponent = class GridComponent {
|
|
|
5172
5562
|
deferBlockDependencies: [() => [
|
|
5173
5563
|
NgTemplateOutlet,
|
|
5174
5564
|
GridColgroupComponent,
|
|
5175
|
-
import("./nanahoshi-mona-ui-grid-grid-footer-row.component-
|
|
5176
|
-
import("./nanahoshi-mona-ui-grid-grid-list.component-
|
|
5177
|
-
import("./nanahoshi-mona-ui-grid-grid-virtual-list.component-
|
|
5565
|
+
import("./nanahoshi-mona-ui-grid-grid-footer-row.component-BYH9XbCV.mjs").then((m) => m.GridFooterRowComponent),
|
|
5566
|
+
import("./nanahoshi-mona-ui-grid-grid-list.component-S2iCn8TV.mjs").then((m) => m.GridListComponent),
|
|
5567
|
+
import("./nanahoshi-mona-ui-grid-grid-virtual-list.component-Wndy-_Bt.mjs").then((m) => m.GridVirtualListComponent),
|
|
5178
5568
|
import("@nanahoshi/mona-ui/spinner").then((m) => m.SpinnerComponent)
|
|
5179
5569
|
]]
|
|
5180
5570
|
});
|
|
@@ -5186,9 +5576,9 @@ i0.ɵɵngDeclareClassMetadataAsync({
|
|
|
5186
5576
|
ngImport: i0,
|
|
5187
5577
|
type: GridComponent,
|
|
5188
5578
|
resolveDeferredDeps: () => [
|
|
5189
|
-
import("./nanahoshi-mona-ui-grid-grid-footer-row.component-
|
|
5190
|
-
import("./nanahoshi-mona-ui-grid-grid-list.component-
|
|
5191
|
-
import("./nanahoshi-mona-ui-grid-grid-virtual-list.component-
|
|
5579
|
+
import("./nanahoshi-mona-ui-grid-grid-footer-row.component-BYH9XbCV.mjs").then((m) => m.GridFooterRowComponent),
|
|
5580
|
+
import("./nanahoshi-mona-ui-grid-grid-list.component-S2iCn8TV.mjs").then((m) => m.GridListComponent),
|
|
5581
|
+
import("./nanahoshi-mona-ui-grid-grid-virtual-list.component-Wndy-_Bt.mjs").then((m) => m.GridVirtualListComponent),
|
|
5192
5582
|
import("@nanahoshi/mona-ui/spinner").then((m) => m.SpinnerComponent)
|
|
5193
5583
|
],
|
|
5194
5584
|
resolveMetadata: (GridFooterRowComponent, GridListComponent, GridVirtualListComponent, SpinnerComponent) => ({
|
|
@@ -5240,14 +5630,17 @@ i0.ɵɵngDeclareClassMetadataAsync({
|
|
|
5240
5630
|
"[class]": "baseClass()",
|
|
5241
5631
|
"[attr.data-uid]": "uid"
|
|
5242
5632
|
},
|
|
5243
|
-
template: "@if (toolbarTemplate()) {\n <div\n class=\"flex min-h-10 items-center gap-2 border-b border-border p-2\"\n role=\"toolbar\"\n [attr.aria-label]=\"messages().toolbar\"\n #toolbarElement\n (focusin)=\"onToolbarFocusIn($event)\"\n (keydown)=\"onToolbarKeydown($event)\">\n <ng-container\n [ngTemplateOutlet]=\"toolbarTemplate() ?? null\"\n [ngTemplateOutletContext]=\"toolbarContext()\"></ng-container>\n <button monaButton size=\"small\" #columnsButton>{{ messages().columns }}</button>\n <mona-popup\n [anchor]=\"columnsButton\"\n [animation]=\"{ leave: [] }\"\n [width]=\"'max-content'\"\n [anchorConnectionPoint]=\"'bottomleft'\"\n [popupConnectionPoint]=\"'topleft'\"\n #popup>\n <mona-grid-column-chooser\n (apply)=\"popup.closePopup()\"\n (cancel)=\"popup.closePopup()\"></mona-grid-column-chooser>\n </mona-popup>\n </div>\n}\n\n@if (groupable()) {\n <div\n [class]=\"groupPanelClass()\"\n cdkDropList\n #groupColumnList=\"cdkDropList\"\n cdkDropListOrientation=\"horizontal\"\n (cdkDropListEntered)=\"onColumnDragEnterForGrouping()\"\n (cdkDropListExited)=\"onColumnDragExitForGrouping()\"\n (cdkDropListDropped)=\"onColumnDropForGrouping($event)\">\n @if (gridService.groupColumns().length !== 0) {\n @for (groupColumn of gridService.groupColumns(); track groupColumn.id) {\n @let groupMenuId = groupColumn.id + \"-group-menu\";\n @let groupMenuOpen = openGroupMenuColumnId() === groupColumn.id;\n <mona-chip\n [aria-label]=\"groupColumn.title\"\n [removable]=\"true\"\n size=\"small\"\n tabindex=\"-1\"\n [rounded]=\"rounded()\"\n (click)=\"onGroupingColumnSort(groupColumn)\"\n (remove)=\"onGroupingColumnRemove($event, groupColumn)\">\n @if (groupColumn.groupSortDirection === \"asc\") {\n <svg lucideArrowDown [size]=\"16\" aria-hidden=\"true\"></svg>\n } @else if (groupColumn.groupSortDirection === \"desc\") {\n <svg lucideArrowUp [size]=\"16\" aria-hidden=\"true\"></svg>\n }\n <span>{{ groupColumn.title }}</span>\n <button\n monaButton\n look=\"link\"\n type=\"button\"\n class=\"ms-1\"\n aria-haspopup=\"menu\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [id]=\"groupColumn.id + '-group-button'\"\n [attr.aria-controls]=\"groupMenuOpen ? groupMenuId : null\"\n [attr.aria-expanded]=\"groupMenuOpen\"\n [attr.aria-label]=\"messages().groupOptions(groupColumn.title)\"\n (click)=\"$event.stopPropagation()\"\n #groupReorder>\n <svg lucideEllipsisVertical [size]=\"16\" aria-hidden=\"true\"></svg>\n </button>\n <mona-popup-menu\n size=\"small\"\n [id]=\"groupMenuId\"\n [target]=\"groupReorder\"\n (close)=\"openGroupMenuColumnId.set(null)\"\n (open)=\"openGroupMenuColumnId.set(groupColumn.id)\">\n <mona-popup-menu-item\n [disabled]=\"$first\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'prev')\">\n <ng-template monaPopupMenuTextTemplate>\n <svg lucideArrowLeft [size]=\"16\" aria-hidden=\"true\" class=\"rtl:rotate-180\"></svg>\n {{ messages().moveAsPrevious }}\n </ng-template>\n </mona-popup-menu-item>\n <mona-popup-menu-item\n [disabled]=\"$last\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'next')\">\n <ng-template monaPopupMenuTextTemplate>\n <svg lucideArrowRight [size]=\"16\" aria-hidden=\"true\" class=\"rtl:rotate-180\"></svg>\n {{ messages().moveAsNext }}\n </ng-template>\n </mona-popup-menu-item>\n </mona-popup-menu>\n </mona-chip>\n }\n } @else if (groupPanelPlaceholderVisible()) {\n <span [class]=\"groupPanelPlaceholderClass()\">{{ messages().dragColumnHeaderToGroup }}</span>\n }\n </div>\n}\n<div\n class=\"flex flex-col flex-1 min-h-0\"\n [attr.role]=\"gridRole()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-busy]=\"gridService.serverLoading() || null\"\n [attr.aria-rowcount]=\"ariaRowCount()\"\n [attr.aria-colcount]=\"gridService.layout().length\"\n [attr.aria-multiselectable]=\"multiselectable() || null\"\n [attr.aria-readonly]=\"gridService.editableOptions().enabled ? null : true\">\n <div [class]=\"headerClass()\" [style.margin-inline-end.px]=\"headerMarginInlineEnd()\" #gridHeaderElement>\n <div>\n <table\n role=\"presentation\"\n #headerTable\n [class]=\"headerTableClass()\"\n [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <thead role=\"rowgroup\" [style.visibility]=\"!gridWidthSet() ? 'hidden' : undefined\">\n <tr\n role=\"row\"\n aria-rowindex=\"1\"\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n [cdkDropListSortingDisabled]=\"true\"\n [cdkDropListConnectedTo]=\"groupable() ? [groupColumnList()!] : []\"\n (cdkDropListDropped)=\"onColumnDrop()\"\n [class]=\"headerTableRowClass()\">\n @for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n @let column = layoutColumn.column;\n @let columnSortable =\n gridService.sortableOptions().enabled &&\n column.kind === \"data\" &&\n column.sortable &&\n column.field !== \"\";\n @let sortOrderShown =\n gridService.sortableOptions().enabled &&\n gridService.sortableOptions().mode === \"multiple\" &&\n gridService.sortableOptions().showIndices &&\n column.sortIndex !== null;\n @let defaultTitle = !column.headerTemplate && !column.titleTemplate;\n <th\n scope=\"col\"\n role=\"columnheader\"\n [attr.data-column-id]=\"column.id\"\n [attr.aria-labelledby]=\"defaultTitle ? uid + '-title-' + column.id : null\"\n [attr.aria-label]=\"!defaultTitle && column.title ? column.title : null\"\n [attr.aria-describedby]=\"sortOrderShown ? uid + '-sort-' + column.id : null\"\n cdkDrag\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'header'\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n (toggleExpand)=\"onColumnSort(column)\"\n (menuOpen)=\"openColumnFilterMenu(column)\"\n [attr.aria-keyshortcuts]=\"headerKeyShortcuts().get(column.id) ?? null\"\n (keydown)=\"onHeaderKeydown($event, column)\"\n [cdkDragData]=\"column\"\n [cdkDragDisabled]=\"isColumnDragDisabled(column)\"\n [class]=\"headerTableCellClass()\"\n (cdkDragMoved)=\"onColumnDragMove($event)\"\n (cdkDragEntered)=\"onColumnDragEnter($event)\"\n (cdkDragStarted)=\"onColumnDragStart($event)\"\n (cdkDragEnded)=\"onColumnDragEnd($event)\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\"\n [attr.aria-sort]=\"\n columnSortable && (column.sortIndex ?? 1) === 1\n ? (column.columnSortDirection | columnAriaSort)\n : null\n \">\n <div\n [class]=\"headerTableColumnWrapClass()\"\n [style.cursor]=\"columnSortable ? 'pointer' : 'default'\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: column,\n column\n }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n [id]=\"uid + '-title-' + column.id\"\n data-column-title\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n\n @if (sortOrderShown) {\n <span class=\"sr-only\" [id]=\"uid + '-sort-' + column.id\">{{\n messages().sortOrder(column.sortIndex ?? 1)\n }}</span>\n }\n <div [class]=\"columnActionsClass()\" [attr.data-column-actions]=\"true\">\n @if (\n gridService.sortableOptions().enabled &&\n column.columnSortDirection !== null\n ) {\n <div class=\"inline-flex shrink-0 items-center gap-0.5\">\n @if (column.columnSortDirection === \"asc\") {\n <svg lucideArrowUp [size]=\"16\" aria-hidden=\"true\"></svg>\n } @else {\n <svg lucideArrowDown [size]=\"16\" aria-hidden=\"true\"></svg>\n }\n @if (\n gridService.sortableOptions().mode === \"multiple\" &&\n gridService.sortableOptions().showIndices &&\n column.sortIndex !== null\n ) {\n <span class=\"tabular-nums\" aria-hidden=\"true\">{{\n column.sortIndex\n }}</span>\n }\n </div>\n }\n @if (filterMenuEnabled()) {\n @if (column.kind === \"data\" && column.filterable) {\n <mona-grid-filter-menu\n [column]=\"column\"\n [type]=\"column.dataType\"\n (apply)=\"\n onColumnFilter(column, $event)\n \"></mona-grid-filter-menu>\n }\n }\n </div>\n </div>\n @if (\n dropColumn() === column &&\n dragColumn() &&\n gridService.reorderableOptions().enabled &&\n !groupingInProgress()\n ) {\n <span [class]=\"columnDropHintClass()\"> </span>\n }\n @if (gridService.resizableOptions().enabled && !columnDragging()) {\n <div\n monaGridColumnResizeHandler\n [column]=\"column\"\n [class]=\"columnResizerClass()\"\n (resizeStart)=\"onColumnResizeStart()\"\n (resizeEnd)=\"onColumnResizeEnd($event)\"></div>\n }\n <ng-template cdkDragPreview>\n <div [class]=\"columnDragPreviewClass()\">\n <span>{{ column.title }}</span>\n </div>\n </ng-template>\n <ng-template cdkDragPlaceholder>\n @if (groupingInProgress()) {\n <mona-chip\n style=\"z-index: 10; pointer-events: none\"\n [aria-label]=\"column.title\"\n [removable]=\"true\"\n [rounded]=\"rounded()\"\n >{{ column.title }}</mona-chip\n >\n }\n </ng-template>\n </th>\n @if (columnDragging() && dragColumn() === column) {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n aria-hidden=\"true\"\n [class]=\"headerTableCellClass()\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: column,\n column\n }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n </div>\n </th>\n }\n } @else if (layoutColumn.kind === \"reorder\") {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n scope=\"col\"\n role=\"columnheader\"\n [attr.aria-label]=\"gridService.messages().rowReorder\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\"></th>\n } @else if (layoutColumn.kind === \"selection\") {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n scope=\"col\"\n role=\"columnheader\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\">\n @if (\n gridService.selectableOptions().mode === \"multiple\" &&\n gridService.selectableOptions().showSelectAll !== false\n ) {\n <mona-grid-select-all-checkbox />\n }\n </th>\n } @else {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n scope=\"col\"\n role=\"columnheader\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\">\n <span class=\"sr-only\">{{\n layoutColumn.kind === \"detail\" ? messages().details : messages().group\n }}</span>\n </th>\n }\n }\n </tr>\n @if (filterRowEnabled()) {\n <tr role=\"row\" aria-rowindex=\"2\" [class]=\"headerTableRowClass()\">\n @for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n @let column = layoutColumn.column;\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'filter'\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'filter'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n role=\"gridcell\"\n [class]=\"filterRowCellClass()\"\n [style.width.px]=\"layoutColumn.width\"\n [attr.aria-label]=\"messages().filterByColumn(column.title)\">\n @if (column.kind === \"data\" && column.field && column.filterable) {\n <mona-grid-filter-row-cell\n [column]=\"column\"\n (apply)=\"onColumnFilter(column, $event)\" />\n }\n </th>\n } @else {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n role=\"gridcell\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\"></th>\n }\n }\n </tr>\n }\n </thead>\n </table>\n </div>\n </div>\n\n @defer (when gridWidthSet()) {\n @if (gridService.virtualScrollOptions().enabled) {\n @if (gridService.viewRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-virtual-list [data]=\"gridService.viewRows()\" />\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\" />\n }\n } @else {\n <div class=\"relative flex-1 min-h-0\" data-grid-body-region>\n @if (gridService.viewPageRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-list [data]=\"gridService.viewPageRows()\" />\n } @else if (!gridService.serverLoading()) {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\" />\n }\n @if (gridService.serverLoading()) {\n <div\n class=\"absolute inset-0 z-20 flex items-center justify-center bg-surface/60\"\n aria-hidden=\"true\"\n data-grid-loading>\n <mona-spinner size=\"large\" />\n </div>\n }\n </div>\n @if (gridService.viewPageRows().length !== 0 || gridService.addRowVisible()) {\n @if (footerVisible()) {\n <div\n [class]=\"footerClass()\"\n [style.margin-inline-end.px]=\"gridService.scrollbarGutterWidth()\"\n #footerScrollElement\n data-grid-footer-scroll>\n <div>\n <table\n role=\"presentation\"\n [class]=\"footerTableClass()\"\n [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <tfoot role=\"rowgroup\">\n <tr monaGridFooterRow [ariaRowIndex]=\"ariaRowCount()\"></tr>\n </tfoot>\n </table>\n </div>\n </div>\n }\n }\n }\n } @placeholder {\n <mona-placeholder [text]=\"messages().loading\" />\n }\n</div>\n@if (!gridService.virtualScrollOptions().enabled) {\n @if (gridService.serverBindingEnabled() || gridService.pagerTotal() !== 0 || gridService.addRowVisible()) {\n <mona-pager\n class=\"border-0 border-t border-t-border rounded-ss-none rounded-se-none\"\n [skip]=\"gridService.paginationState().skip\"\n [pageSize]=\"gridService.paginationState().take\"\n [total]=\"gridService.pagerTotal()\"\n [size]=\"'small'\"\n [rounded]=\"rounded()\"\n [pageInput]=\"true\"\n [pageSizeValues]=\"pageSizeValues()\"\n [responsive]=\"responsivePager()\"\n (pageChange)=\"onPageChange($event)\"></mona-pager>\n }\n}\n\n<ng-template #emptyGridTemplate>\n <div [class]=\"noDataClass()\" role=\"rowgroup\">\n <div role=\"row\" class=\"contents\" [attr.aria-rowindex]=\"gridService.bodyAriaRowStart() + 1\">\n <div role=\"gridcell\" class=\"contents\" [attr.aria-colspan]=\"gridService.layout().length\">\n @if (noDataTemplate()) {\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n } @else {\n <mona-placeholder [text]=\"gridService.messages().noData\"></mona-placeholder>\n }\n </div>\n </div>\n </div>\n</ng-template>\n"
|
|
5633
|
+
template: "@if (toolbarTemplate()) {\n <div\n class=\"flex min-h-10 items-center gap-2 border-b border-border p-2\"\n role=\"toolbar\"\n [attr.aria-label]=\"messages().toolbar\"\n #toolbarElement\n (focusin)=\"onToolbarFocusIn($event)\"\n (keydown)=\"onToolbarKeydown($event)\">\n <ng-container\n [ngTemplateOutlet]=\"toolbarTemplate() ?? null\"\n [ngTemplateOutletContext]=\"toolbarContext()\"></ng-container>\n <button monaButton size=\"small\" #columnsButton>{{ messages().columns }}</button>\n <mona-popup\n [anchor]=\"columnsButton\"\n [animation]=\"{ leave: [] }\"\n [width]=\"'max-content'\"\n [anchorConnectionPoint]=\"'bottomleft'\"\n [popupConnectionPoint]=\"'topleft'\"\n #popup>\n <mona-grid-column-chooser\n (apply)=\"popup.closePopup()\"\n (cancel)=\"popup.closePopup()\"></mona-grid-column-chooser>\n </mona-popup>\n </div>\n}\n\n@if (groupable()) {\n <div\n [class]=\"groupPanelClass()\"\n cdkDropList\n #groupColumnList=\"cdkDropList\"\n cdkDropListOrientation=\"horizontal\"\n (cdkDropListEntered)=\"onColumnDragEnterForGrouping()\"\n (cdkDropListExited)=\"onColumnDragExitForGrouping()\"\n (cdkDropListDropped)=\"onColumnDropForGrouping($event)\">\n @if (gridService.groupColumns().length !== 0) {\n @for (groupColumn of gridService.groupColumns(); track groupColumn.id) {\n @let groupMenuId = groupColumn.id + \"-group-menu\";\n @let groupMenuOpen = openGroupMenuColumnId() === groupColumn.id;\n <mona-chip\n [aria-label]=\"groupColumn.title\"\n [removable]=\"true\"\n size=\"small\"\n tabindex=\"-1\"\n [rounded]=\"rounded()\"\n (click)=\"onGroupingColumnSort(groupColumn)\"\n (remove)=\"onGroupingColumnRemove($event, groupColumn)\">\n @if (groupColumn.groupSortDirection === \"asc\") {\n <svg lucideArrowDown [size]=\"16\" aria-hidden=\"true\"></svg>\n } @else if (groupColumn.groupSortDirection === \"desc\") {\n <svg lucideArrowUp [size]=\"16\" aria-hidden=\"true\"></svg>\n }\n <span>{{ groupColumn.title }}</span>\n <button\n monaButton\n look=\"link\"\n type=\"button\"\n class=\"ms-1\"\n aria-haspopup=\"menu\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [id]=\"groupColumn.id + '-group-button'\"\n [attr.aria-controls]=\"groupMenuOpen ? groupMenuId : null\"\n [attr.aria-expanded]=\"groupMenuOpen\"\n [attr.aria-label]=\"messages().groupOptions(groupColumn.title)\"\n (click)=\"$event.stopPropagation()\"\n #groupReorder>\n <svg lucideEllipsisVertical [size]=\"16\" aria-hidden=\"true\"></svg>\n </button>\n <mona-popup-menu\n size=\"small\"\n [id]=\"groupMenuId\"\n [target]=\"groupReorder\"\n (close)=\"openGroupMenuColumnId.set(null)\"\n (open)=\"openGroupMenuColumnId.set(groupColumn.id)\">\n <mona-popup-menu-item\n [disabled]=\"$first\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'prev')\">\n <ng-template monaPopupMenuTextTemplate>\n <svg lucideArrowLeft [size]=\"16\" aria-hidden=\"true\" class=\"rtl:rotate-180\"></svg>\n {{ messages().moveAsPrevious }}\n </ng-template>\n </mona-popup-menu-item>\n <mona-popup-menu-item\n [disabled]=\"$last\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'next')\">\n <ng-template monaPopupMenuTextTemplate>\n <svg lucideArrowRight [size]=\"16\" aria-hidden=\"true\" class=\"rtl:rotate-180\"></svg>\n {{ messages().moveAsNext }}\n </ng-template>\n </mona-popup-menu-item>\n </mona-popup-menu>\n </mona-chip>\n }\n } @else if (groupPanelPlaceholderVisible()) {\n <span [class]=\"groupPanelPlaceholderClass()\">{{ messages().dragColumnHeaderToGroup }}</span>\n }\n </div>\n}\n<div\n class=\"flex flex-col flex-1 min-h-0\"\n [attr.role]=\"gridRole()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-busy]=\"gridService.serverLoading() || null\"\n [attr.aria-rowcount]=\"ariaRowCount()\"\n [attr.aria-colcount]=\"gridService.layout().length\"\n [attr.aria-multiselectable]=\"multiselectable() || null\"\n [attr.aria-readonly]=\"gridService.editableOptions().enabled ? null : true\">\n <div [class]=\"headerClass()\" [style.margin-inline-end.px]=\"headerMarginInlineEnd()\" #gridHeaderElement>\n <div>\n <table\n role=\"presentation\"\n #headerTable\n [class]=\"headerTableClass()\"\n [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <thead role=\"rowgroup\" [style.visibility]=\"!gridWidthSet() ? 'hidden' : undefined\">\n @let groupDepth = gridService.headerGroupDepth();\n @for (groupRow of gridService.headerGroupRows(); track $index; let level = $index) {\n <tr role=\"row\" [attr.aria-rowindex]=\"level + 1\" [class]=\"headerGroupRowClass()\">\n @for (cell of groupRow; track cell.key) {\n @if (cell.kind === \"group\") {\n <th\n scope=\"colgroup\"\n role=\"columnheader\"\n [attr.data-column-group-id]=\"cell.group.id\"\n [attr.aria-colspan]=\"cell.colSpan\"\n [monaGridLockedCell]=\"null\"\n [lockedCellHeader]=\"true\"\n [stickyState]=\"cell.sticky\"\n monaGridLogicalCell\n [cellKind]=\"'header'\"\n [columnId]=\"'$group:' + cell.key\"\n [rowIndex]=\"level - groupDepth - 1\"\n [colIndex]=\"cell.colIndex\"\n [columnSpan]=\"cell.colSpan\"\n [ariaColIndex]=\"cell.ariaColIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"cell.firstInRow\"\n [lastInRow]=\"cell.lastInRow\"\n [class]=\"headerGroupCellClass()\"\n [style.width.px]=\"cell.width\">\n <span\n [class]=\"headerGroupTitleClass()\"\n [style.inset-inline-start.px]=\"\n cell.sticky === null ? gridService.stickyInset().start : null\n \"\n [title]=\"cell.group.title\"\n >{{ cell.group.title }}</span\n >\n </th>\n } @else {\n <th\n aria-hidden=\"true\"\n [monaGridLockedCell]=\"cell.layoutKey\"\n [lockedCellHeader]=\"true\"\n [class]=\"headerGroupSpacerCellClass()\"\n [style.width.px]=\"cell.width\"></th>\n }\n }\n </tr>\n }\n <tr\n role=\"row\"\n data-grid-column-header-row\n [attr.aria-rowindex]=\"groupDepth + 1\"\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n [cdkDropListSortingDisabled]=\"true\"\n [cdkDropListConnectedTo]=\"groupable() ? [groupColumnList()!] : []\"\n (cdkDropListDropped)=\"onColumnDrop()\"\n [class]=\"headerTableColumnRowClass()\">\n @for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n @let column = layoutColumn.column;\n @let columnSortable =\n gridService.sortableOptions().enabled &&\n column.kind === \"data\" &&\n column.sortable &&\n column.field !== \"\";\n @let sortOrderShown =\n gridService.sortableOptions().enabled &&\n gridService.sortableOptions().mode === \"multiple\" &&\n gridService.sortableOptions().showIndices &&\n column.sortIndex !== null;\n @let defaultTitle = !column.headerTemplate && !column.titleTemplate;\n <th\n scope=\"col\"\n role=\"columnheader\"\n [attr.data-column-id]=\"column.id\"\n [attr.aria-labelledby]=\"defaultTitle ? uid + '-title-' + column.id : null\"\n [attr.aria-label]=\"!defaultTitle && column.title ? column.title : null\"\n [attr.aria-describedby]=\"sortOrderShown ? uid + '-sort-' + column.id : null\"\n cdkDrag\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'header'\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n (toggleExpand)=\"onColumnSort(column)\"\n (menuOpen)=\"openColumnFilterMenu(column)\"\n [attr.aria-keyshortcuts]=\"headerKeyShortcuts().get(column.id) ?? null\"\n (keydown)=\"onHeaderKeydown($event, column)\"\n [cdkDragData]=\"column\"\n [cdkDragDisabled]=\"isColumnDragDisabled(column)\"\n [class]=\"headerTableCellClass()\"\n (cdkDragMoved)=\"onColumnDragMove($event)\"\n (cdkDragEntered)=\"onColumnDragEnter($event)\"\n (cdkDragStarted)=\"onColumnDragStart($event)\"\n (cdkDragEnded)=\"onColumnDragEnd($event)\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\"\n [attr.aria-sort]=\"\n columnSortable && (column.sortIndex ?? 1) === 1\n ? (column.columnSortDirection | columnAriaSort)\n : null\n \">\n <div\n [class]=\"headerTableColumnWrapClass()\"\n [style.cursor]=\"columnSortable ? 'pointer' : 'default'\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: column,\n column\n }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n [id]=\"uid + '-title-' + column.id\"\n data-column-title\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n\n @if (sortOrderShown) {\n <span class=\"sr-only\" [id]=\"uid + '-sort-' + column.id\">{{\n messages().sortOrder(column.sortIndex ?? 1)\n }}</span>\n }\n <div [class]=\"columnActionsClass()\" [attr.data-column-actions]=\"true\">\n @if (\n gridService.sortableOptions().enabled &&\n column.columnSortDirection !== null\n ) {\n <div class=\"inline-flex shrink-0 items-center gap-0.5\">\n @if (column.columnSortDirection === \"asc\") {\n <svg lucideArrowUp [size]=\"16\" aria-hidden=\"true\"></svg>\n } @else {\n <svg lucideArrowDown [size]=\"16\" aria-hidden=\"true\"></svg>\n }\n @if (\n gridService.sortableOptions().mode === \"multiple\" &&\n gridService.sortableOptions().showIndices &&\n column.sortIndex !== null\n ) {\n <span class=\"tabular-nums\" aria-hidden=\"true\">{{\n column.sortIndex\n }}</span>\n }\n </div>\n }\n @if (filterMenuEnabled()) {\n @if (column.kind === \"data\" && column.filterable) {\n <mona-grid-filter-menu\n [column]=\"column\"\n [type]=\"column.dataType\"\n (apply)=\"\n onColumnFilter(column, $event)\n \"></mona-grid-filter-menu>\n }\n }\n </div>\n </div>\n @if (\n dropColumn() === column &&\n dragColumn() &&\n gridService.reorderableOptions().enabled &&\n !groupingInProgress()\n ) {\n <span [class]=\"columnDropHintClass()\"> </span>\n }\n @if (gridService.resizableOptions().enabled && !columnDragging()) {\n <div\n monaGridColumnResizeHandler\n [column]=\"column\"\n [class]=\"columnResizerClass()\"\n (resizeStart)=\"onColumnResizeStart()\"\n (resizeEnd)=\"onColumnResizeEnd($event)\"></div>\n }\n <ng-template cdkDragPreview>\n <div [class]=\"columnDragPreviewClass()\">\n <span>{{ column.title }}</span>\n </div>\n </ng-template>\n <ng-template cdkDragPlaceholder>\n @if (groupingInProgress()) {\n <mona-chip\n style=\"z-index: 10; pointer-events: none\"\n [aria-label]=\"column.title\"\n [removable]=\"true\"\n [rounded]=\"rounded()\"\n >{{ column.title }}</mona-chip\n >\n }\n </ng-template>\n </th>\n @if (columnDragging() && dragColumn() === column) {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n aria-hidden=\"true\"\n [class]=\"headerTableCellClass()\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: column,\n column\n }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n </div>\n </th>\n }\n } @else if (layoutColumn.kind === \"reorder\") {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n scope=\"col\"\n role=\"columnheader\"\n [attr.aria-label]=\"gridService.messages().rowReorder\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\"></th>\n } @else if (layoutColumn.kind === \"selection\") {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n scope=\"col\"\n role=\"columnheader\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\">\n @if (\n gridService.selectableOptions().mode === \"multiple\" &&\n gridService.selectableOptions().showSelectAll !== false\n ) {\n <mona-grid-select-all-checkbox />\n }\n </th>\n } @else {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n scope=\"col\"\n role=\"columnheader\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\">\n <span class=\"sr-only\">{{\n layoutColumn.kind === \"detail\" ? messages().details : messages().group\n }}</span>\n </th>\n }\n }\n </tr>\n @if (filterRowEnabled()) {\n <tr role=\"row\" [attr.aria-rowindex]=\"groupDepth + 2\" [class]=\"headerTableRowClass()\">\n @for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n @let column = layoutColumn.column;\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'filter'\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'filter'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n role=\"gridcell\"\n [class]=\"filterRowCellClass()\"\n [style.width.px]=\"layoutColumn.width\"\n [attr.aria-label]=\"messages().filterByColumn(column.title)\">\n @if (column.kind === \"data\" && column.field && column.filterable) {\n <mona-grid-filter-row-cell\n [column]=\"column\"\n (apply)=\"onColumnFilter(column, $event)\" />\n }\n </th>\n } @else {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n role=\"gridcell\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\"></th>\n }\n }\n </tr>\n }\n </thead>\n </table>\n </div>\n </div>\n\n @defer (when gridWidthSet()) {\n @if (gridService.virtualScrollOptions().enabled) {\n @if (gridService.viewRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-virtual-list [data]=\"gridService.viewRows()\" />\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\" />\n }\n } @else {\n <div class=\"relative flex-1 min-h-0\" data-grid-body-region>\n @if (gridService.viewPageRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-list [data]=\"gridService.viewPageRows()\" />\n } @else if (!gridService.serverLoading()) {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\" />\n }\n @if (gridService.serverLoading()) {\n <div\n class=\"absolute inset-0 z-20 flex items-center justify-center bg-surface/60\"\n aria-hidden=\"true\"\n data-grid-loading>\n <mona-spinner size=\"large\" />\n </div>\n }\n </div>\n @if (gridService.viewPageRows().length !== 0 || gridService.addRowVisible()) {\n @if (footerVisible()) {\n <div\n [class]=\"footerClass()\"\n [style.margin-inline-end.px]=\"gridService.scrollbarGutterWidth()\"\n #footerScrollElement\n data-grid-footer-scroll>\n <div>\n <table\n role=\"presentation\"\n [class]=\"footerTableClass()\"\n [style.width.px]=\"gridService.tableWidth()\">\n <colgroup monaGridColgroup></colgroup>\n <tfoot role=\"rowgroup\">\n <tr monaGridFooterRow [ariaRowIndex]=\"ariaRowCount()\"></tr>\n </tfoot>\n </table>\n </div>\n </div>\n }\n }\n }\n } @placeholder {\n <mona-placeholder [text]=\"messages().loading\" />\n }\n</div>\n@if (!gridService.virtualScrollOptions().enabled) {\n @if (gridService.serverBindingEnabled() || gridService.pagerTotal() !== 0 || gridService.addRowVisible()) {\n <mona-pager\n class=\"border-0 border-t border-t-border rounded-ss-none rounded-se-none\"\n [skip]=\"gridService.paginationState().skip\"\n [pageSize]=\"gridService.paginationState().take\"\n [total]=\"gridService.pagerTotal()\"\n [size]=\"'small'\"\n [rounded]=\"rounded()\"\n [pageInput]=\"true\"\n [pageSizeValues]=\"pageSizeValues()\"\n [responsive]=\"responsivePager()\"\n (pageChange)=\"onPageChange($event)\"></mona-pager>\n }\n}\n\n<ng-template #emptyGridTemplate>\n <div [class]=\"noDataClass()\" role=\"rowgroup\">\n <div role=\"row\" class=\"contents\" [attr.aria-rowindex]=\"gridService.bodyAriaRowStart() + 1\">\n <div role=\"gridcell\" class=\"contents\" [attr.aria-colspan]=\"gridService.layout().length\">\n @if (noDataTemplate()) {\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n } @else {\n <mona-placeholder [text]=\"gridService.messages().noData\"></mona-placeholder>\n }\n </div>\n </div>\n </div>\n</ng-template>\n"
|
|
5244
5634
|
}]
|
|
5245
5635
|
}],
|
|
5246
5636
|
ctorParameters: () => [],
|
|
5247
5637
|
propDecorators: {
|
|
5248
5638
|
columnDefinitions: [{
|
|
5249
5639
|
type: i0.ContentChildren,
|
|
5250
|
-
args: [i0.forwardRef(() => GRID_COLUMN_DEFINITION), {
|
|
5640
|
+
args: [i0.forwardRef(() => GRID_COLUMN_DEFINITION), {
|
|
5641
|
+
descendants: true,
|
|
5642
|
+
isSignal: true
|
|
5643
|
+
}]
|
|
5251
5644
|
}],
|
|
5252
5645
|
filterMenus: [{
|
|
5253
5646
|
type: i0.ViewChildren,
|
|
@@ -5414,6 +5807,6 @@ i0.ɵɵngDeclareClassMetadataAsync({
|
|
|
5414
5807
|
}
|
|
5415
5808
|
})
|
|
5416
5809
|
});
|
|
5417
|
-
export { CellEditEvent, GRID_DEFAULT_MESSAGES, GridAddCommandDirective, GridAddEvent, GridCancelCommandDirective, GridCancelEvent, GridCellTemplateDirective, GridColumnComponent, GridColumnTitleTemplateDirective, GridCommandColumnComponent, GridComponent, GridContextMenuDirective, GridDetailTemplateDirective, GridEditCommandDirective, GridEditEvent, GridEditTemplateDirective, GridEditableDirective, GridExportDirective, GridFilterableDirective, GridFooterTemplateDirective, GridGroupFooterTemplateDirective, GridGroupableDirective, GridHeaderTemplateDirective, GridNoDataTemplateDirective, GridRemoveCommandDirective, GridRemoveEvent, GridReorderableDirective, GridResizableDirective, GridRowReorderableDirective, GridSaveCommandDirective, GridSaveEvent, GridSelectableDirective, GridServerBindingDirective, GridSortableDirective, GridStatePersistenceDirective, GridToolbarTemplateDirective, GridVirtualScrollDirective, RowEditEvent, RowReorderEvent };
|
|
5810
|
+
export { CellEditEvent, GRID_DEFAULT_MESSAGES, GridAddCommandDirective, GridAddEvent, GridCancelCommandDirective, GridCancelEvent, GridCellTemplateDirective, GridColumnComponent, GridColumnGroupComponent, GridColumnTitleTemplateDirective, GridCommandColumnComponent, GridComponent, GridContextMenuDirective, GridDetailTemplateDirective, GridEditCommandDirective, GridEditEvent, GridEditTemplateDirective, GridEditableDirective, GridExportDirective, GridFilterableDirective, GridFooterTemplateDirective, GridGroupFooterTemplateDirective, GridGroupableDirective, GridHeaderTemplateDirective, GridNoDataTemplateDirective, GridRemoveCommandDirective, GridRemoveEvent, GridReorderableDirective, GridResizableDirective, GridRowReorderableDirective, GridSaveCommandDirective, GridSaveEvent, GridSelectableDirective, GridServerBindingDirective, GridSortableDirective, GridStatePersistenceDirective, GridToolbarTemplateDirective, GridVirtualScrollDirective, RowEditEvent, RowReorderEvent };
|
|
5418
5811
|
|
|
5419
5812
|
//# sourceMappingURL=nanahoshi-mona-ui-grid.mjs.map
|