@nanahoshi/mona-ui 0.20.1 → 0.22.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/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +5 -3
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +4 -3
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +4 -2
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +4 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-DLqCAee3.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-cJjJ1b6M.mjs} +7 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-Bd2twji1.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-CkkLBnoI.mjs} +12 -6
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-Do-ktlth.mjs +164 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-CtEs5t9x.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-BDMX9KGc.mjs} +47 -36
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-Cs1gPJps.mjs +239 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BIK61ieq.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CIfTr1Qm.mjs} +564 -300
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +3 -2
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +17 -14
- package/fesm2022/nanahoshi-mona-ui-locales.mjs +26 -13
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +10 -5
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +11 -3
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-grid.d.ts +87 -42
- package/types/nanahoshi-mona-ui-i18n.d.ts +1 -0
- package/types/nanahoshi-mona-ui-locales.d.ts +13 -0
- package/types/nanahoshi-mona-ui-pager.d.ts +1 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-hakVMhqu.mjs +0 -145
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DoAGYLzr.mjs +0 -233
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PreventableEvent, deepEquals } from '@nanahoshi/mona-ui/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Directive, signal, inject, DOCUMENT,
|
|
3
|
+
import { Directive, signal, computed, inject, DOCUMENT, Injector, PLATFORM_ID, effect, Injectable, input, contentChildren, untracked, DestroyRef, output, afterNextRender, model, afterRenderEffect, isDevMode, InjectionToken, contentChild, TemplateRef, forwardRef, Component, ChangeDetectionStrategy, ElementRef, afterEveryRender, Pipe, linkedSignal, viewChild } from '@angular/core';
|
|
4
4
|
import { isPlatformBrowser, DOCUMENT as DOCUMENT$1, NgTemplateOutlet } from '@angular/common';
|
|
5
5
|
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { form } from '@angular/forms/signals';
|
|
@@ -11,9 +11,10 @@ import { Subject, BehaviorSubject, filter, startWith, pairwise, map, skip, fromE
|
|
|
11
11
|
import { v4 } from 'uuid';
|
|
12
12
|
import { ContextMenuItemComponent } from '@nanahoshi/mona-ui/contextmenu';
|
|
13
13
|
import { CdkDropList, CdkDrag, CdkDragPreview, CdkDragPlaceholder } from '@angular/cdk/drag-drop';
|
|
14
|
+
import { LucideFunnel, LucideFunnelX, LucideArrowDown, LucideArrowLeft, LucideArrowRight, LucideArrowUp, LucideEllipsisVertical } from '@lucide/angular';
|
|
14
15
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
15
16
|
import { ChipComponent } from '@nanahoshi/mona-ui/chip';
|
|
16
|
-
import { FilterService, FilterMenuComponent } from '@nanahoshi/mona-ui/filter';
|
|
17
|
+
import { FilterService, FilterMenuComponent, FILTER_DEFAULT_MESSAGES } from '@nanahoshi/mona-ui/filter';
|
|
17
18
|
import { PagerComponent } from '@nanahoshi/mona-ui/pager';
|
|
18
19
|
import { PlaceholderComponent } from '@nanahoshi/mona-ui/placeholder';
|
|
19
20
|
import { PopupService, PopupComponent } from '@nanahoshi/mona-ui/popup';
|
|
@@ -23,7 +24,6 @@ import { Clipboard } from '@angular/cdk/clipboard';
|
|
|
23
24
|
import { cva } from 'class-variance-authority';
|
|
24
25
|
import { FilterInputComponent } from '@nanahoshi/mona-ui/internal/filter-input';
|
|
25
26
|
import { ListViewComponent, ListViewHeaderTemplateDirective, ListViewSelectableDirective, ListViewFooterTemplateDirective } from '@nanahoshi/mona-ui/list-view';
|
|
26
|
-
import { LucideFunnel, LucideFunnelX } from '@lucide/angular';
|
|
27
27
|
import * as i1 from '@angular/forms';
|
|
28
28
|
import { FormsModule } from '@angular/forms';
|
|
29
29
|
import { DatePickerComponent } from '@nanahoshi/mona-ui/date-picker';
|
|
@@ -159,6 +159,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
159
159
|
}]
|
|
160
160
|
}] });
|
|
161
161
|
|
|
162
|
+
/** Fixed item height used when virtual scrolling has no explicit height. */
|
|
163
|
+
const GRID_DEFAULT_VIRTUAL_ROW_HEIGHT = 36;
|
|
164
|
+
|
|
165
|
+
function toGridComparableValue(value) {
|
|
166
|
+
if (value instanceof Date) {
|
|
167
|
+
return value.getTime();
|
|
168
|
+
}
|
|
169
|
+
switch (typeof value) {
|
|
170
|
+
case "bigint":
|
|
171
|
+
case "boolean":
|
|
172
|
+
case "number":
|
|
173
|
+
case "string":
|
|
174
|
+
return value;
|
|
175
|
+
default:
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/** Nullish and unsupported values sort first ascending, with stable ties. */
|
|
180
|
+
function compareGridComparableValues(left, right) {
|
|
181
|
+
if (left == null) {
|
|
182
|
+
return right == null ? 0 : -1;
|
|
183
|
+
}
|
|
184
|
+
if (right == null) {
|
|
185
|
+
return 1;
|
|
186
|
+
}
|
|
187
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
188
|
+
}
|
|
189
|
+
|
|
162
190
|
class Row {
|
|
163
191
|
constructor(data, uid = v4()) {
|
|
164
192
|
this.data = data;
|
|
@@ -222,6 +250,7 @@ const GRID_DEFAULT_MESSAGES = {
|
|
|
222
250
|
rowReorderDisabledEditing: "Finish editing to reorder rows.",
|
|
223
251
|
rowReorderDisabledFiltered: "Clear filters to reorder rows.",
|
|
224
252
|
rowReorderDisabledGrouped: "Clear grouping to reorder rows.",
|
|
253
|
+
rowReorderDisabledServerBinding: "Row reordering isn't available with server binding.",
|
|
225
254
|
rowReorderDisabledSingleRow: "At least two rows are needed to reorder.",
|
|
226
255
|
rowReorderDisabledSorted: "Clear sorting to reorder rows.",
|
|
227
256
|
rowReorderDisabledVirtualScroll: "Row reordering isn't available while virtual scrolling is enabled.",
|
|
@@ -238,6 +267,10 @@ const GRID_DEFAULT_MESSAGES = {
|
|
|
238
267
|
const GRID_STATE_VERSION = 1;
|
|
239
268
|
class GridService {
|
|
240
269
|
#anchorRowKey;
|
|
270
|
+
// Counts how many *selected* keys fall inside the current selection scope, iterating the
|
|
271
|
+
// (usually much smaller) selection rather than rescanning the whole scope on every toggle.
|
|
272
|
+
#bulkSelectionRowKeys;
|
|
273
|
+
#bulkSelectionSelectedCount;
|
|
241
274
|
#document;
|
|
242
275
|
#editContext;
|
|
243
276
|
#editSession;
|
|
@@ -251,18 +284,42 @@ class GridService {
|
|
|
251
284
|
#reorderableOptions;
|
|
252
285
|
#resizableOptions;
|
|
253
286
|
#rowReorderableOptions;
|
|
254
|
-
#scrollbarGutterMeasurementSource;
|
|
255
|
-
#scrollbarGutterWidth;
|
|
256
287
|
#rowUidByData;
|
|
257
288
|
#rowUidByKeyObject;
|
|
289
|
+
#scrollbarGutterMeasurementSource;
|
|
290
|
+
#scrollbarGutterWidth;
|
|
291
|
+
#serverBindingEnabled;
|
|
292
|
+
#serverLoading;
|
|
293
|
+
#serverTotal;
|
|
258
294
|
#textMeasureCache;
|
|
259
|
-
|
|
260
|
-
// (usually much smaller) selection rather than rescanning the whole scope on every toggle.
|
|
261
|
-
#bulkSelectionRowKeys;
|
|
262
|
-
#bulkSelectionSelectedCount;
|
|
295
|
+
#dataStateEmissionPending;
|
|
263
296
|
constructor() {
|
|
264
297
|
this.#anchorRowKey = signal(null, /* @ts-ignore */
|
|
265
298
|
...(ngDevMode ? [{ debugName: "#anchorRowKey" }] : /* istanbul ignore next */ []));
|
|
299
|
+
// Counts how many *selected* keys fall inside the current selection scope, iterating the
|
|
300
|
+
// (usually much smaller) selection rather than rescanning the whole scope on every toggle.
|
|
301
|
+
this.#bulkSelectionRowKeys = computed(() => {
|
|
302
|
+
const keys = new Set();
|
|
303
|
+
for (const row of this.bulkSelectionRows()) {
|
|
304
|
+
keys.add(this.getRowSelectionKey(row));
|
|
305
|
+
}
|
|
306
|
+
return keys;
|
|
307
|
+
}, /* @ts-ignore */
|
|
308
|
+
...(ngDevMode ? [{ debugName: "#bulkSelectionRowKeys" }] : /* istanbul ignore next */ []));
|
|
309
|
+
this.#bulkSelectionSelectedCount = computed(() => {
|
|
310
|
+
const scopeKeys = this.#bulkSelectionRowKeys();
|
|
311
|
+
if (scopeKeys.size === 0) {
|
|
312
|
+
return 0;
|
|
313
|
+
}
|
|
314
|
+
let count = 0;
|
|
315
|
+
for (const key of this.selectedKeys()) {
|
|
316
|
+
if (scopeKeys.has(key)) {
|
|
317
|
+
count++;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
return count;
|
|
321
|
+
}, /* @ts-ignore */
|
|
322
|
+
...(ngDevMode ? [{ debugName: "#bulkSelectionSelectedCount" }] : /* istanbul ignore next */ []));
|
|
266
323
|
this.#document = inject(DOCUMENT);
|
|
267
324
|
this.#editContext = signal(null, /* @ts-ignore */
|
|
268
325
|
...(ngDevMode ? [{ debugName: "#editContext" }] : /* istanbul ignore next */ []));
|
|
@@ -287,13 +344,21 @@ class GridService {
|
|
|
287
344
|
...(ngDevMode ? [{ debugName: "#resizableOptions" }] : /* istanbul ignore next */ []));
|
|
288
345
|
this.#rowReorderableOptions = signal({ enabled: false }, /* @ts-ignore */
|
|
289
346
|
...(ngDevMode ? [{ debugName: "#rowReorderableOptions" }] : /* istanbul ignore next */ []));
|
|
347
|
+
this.#rowUidByData = new WeakMap();
|
|
348
|
+
this.#rowUidByKeyObject = new WeakMap();
|
|
290
349
|
this.#scrollbarGutterMeasurementSource = signal("fallback", /* @ts-ignore */
|
|
291
350
|
...(ngDevMode ? [{ debugName: "#scrollbarGutterMeasurementSource" }] : /* istanbul ignore next */ []));
|
|
292
351
|
this.#scrollbarGutterWidth = signal(0, /* @ts-ignore */
|
|
293
352
|
...(ngDevMode ? [{ debugName: "#scrollbarGutterWidth" }] : /* istanbul ignore next */ []));
|
|
294
|
-
this.#
|
|
295
|
-
|
|
353
|
+
this.#serverBindingEnabled = signal(false, /* @ts-ignore */
|
|
354
|
+
...(ngDevMode ? [{ debugName: "#serverBindingEnabled" }] : /* istanbul ignore next */ []));
|
|
355
|
+
this.#serverLoading = signal(false, /* @ts-ignore */
|
|
356
|
+
...(ngDevMode ? [{ debugName: "#serverLoading" }] : /* istanbul ignore next */ []));
|
|
357
|
+
this.#serverTotal = signal(0, /* @ts-ignore */
|
|
358
|
+
...(ngDevMode ? [{ debugName: "#serverTotal" }] : /* istanbul ignore next */ []));
|
|
296
359
|
this.#textMeasureCache = new Map();
|
|
360
|
+
this.#dataStateEmissionPending = false;
|
|
361
|
+
this.add$ = new Subject();
|
|
297
362
|
this.addRowData = computed(() => {
|
|
298
363
|
const session = this.#editSession();
|
|
299
364
|
return session?.operation === "create" ? session.model() : null;
|
|
@@ -301,36 +366,6 @@ class GridService {
|
|
|
301
366
|
...(ngDevMode ? [{ debugName: "addRowData" }] : /* istanbul ignore next */ []));
|
|
302
367
|
this.addRowVisible = computed(() => this.addRowData() != null, /* @ts-ignore */
|
|
303
368
|
...(ngDevMode ? [{ debugName: "addRowVisible" }] : /* istanbul ignore next */ []));
|
|
304
|
-
this.add$ = new Subject();
|
|
305
|
-
// Counts how many *selected* keys fall inside the current selection scope, iterating the
|
|
306
|
-
// (usually much smaller) selection rather than rescanning the whole scope on every toggle.
|
|
307
|
-
this.#bulkSelectionRowKeys = computed(() => {
|
|
308
|
-
const keys = new Set();
|
|
309
|
-
for (const row of this.bulkSelectionRows()) {
|
|
310
|
-
keys.add(this.getRowSelectionKey(row));
|
|
311
|
-
}
|
|
312
|
-
return keys;
|
|
313
|
-
}, /* @ts-ignore */
|
|
314
|
-
...(ngDevMode ? [{ debugName: "#bulkSelectionRowKeys" }] : /* istanbul ignore next */ []));
|
|
315
|
-
this.#bulkSelectionSelectedCount = computed(() => {
|
|
316
|
-
const scopeKeys = this.#bulkSelectionRowKeys();
|
|
317
|
-
if (scopeKeys.size === 0) {
|
|
318
|
-
return 0;
|
|
319
|
-
}
|
|
320
|
-
let count = 0;
|
|
321
|
-
for (const key of this.selectedKeys()) {
|
|
322
|
-
if (scopeKeys.has(key)) {
|
|
323
|
-
count++;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
return count;
|
|
327
|
-
}, /* @ts-ignore */
|
|
328
|
-
...(ngDevMode ? [{ debugName: "#bulkSelectionSelectedCount" }] : /* istanbul ignore next */ []));
|
|
329
|
-
this.allBulkSelectionRowsSelected = computed(() => {
|
|
330
|
-
const scopeSize = this.#bulkSelectionRowKeys().size;
|
|
331
|
-
return scopeSize > 0 && this.#bulkSelectionSelectedCount() === scopeSize;
|
|
332
|
-
}, /* @ts-ignore */
|
|
333
|
-
...(ngDevMode ? [{ debugName: "allBulkSelectionRowsSelected" }] : /* istanbul ignore next */ []));
|
|
334
369
|
this.aggregateColumns = computed(() => {
|
|
335
370
|
return this.visibleColumns()
|
|
336
371
|
.where(column => column.kind === "data" && column.aggregate != null)
|
|
@@ -349,6 +384,11 @@ class GridService {
|
|
|
349
384
|
.select(row => row.data)
|
|
350
385
|
.toArray(), /* @ts-ignore */
|
|
351
386
|
...(ngDevMode ? [{ debugName: "aggregateRows" }] : /* istanbul ignore next */ []));
|
|
387
|
+
this.allBulkSelectionRowsSelected = computed(() => {
|
|
388
|
+
const scopeSize = this.#bulkSelectionRowKeys().size;
|
|
389
|
+
return scopeSize > 0 && this.#bulkSelectionSelectedCount() === scopeSize;
|
|
390
|
+
}, /* @ts-ignore */
|
|
391
|
+
...(ngDevMode ? [{ debugName: "allBulkSelectionRowsSelected" }] : /* istanbul ignore next */ []));
|
|
352
392
|
this.appliedFilters = signal(ImmutableDictionary.create(), /* @ts-ignore */
|
|
353
393
|
...(ngDevMode ? [{ debugName: "appliedFilters" }] : /* istanbul ignore next */ []));
|
|
354
394
|
this.appliedGroupSorts = signal(ImmutableDictionary.create(), /* @ts-ignore */
|
|
@@ -367,8 +407,8 @@ class GridService {
|
|
|
367
407
|
return this.viewRows();
|
|
368
408
|
}, /* @ts-ignore */
|
|
369
409
|
...(ngDevMode ? [{ debugName: "bulkSelectionRows" }] : /* istanbul ignore next */ []));
|
|
370
|
-
this.cellEdit$ = new Subject();
|
|
371
410
|
this.cancel$ = new Subject();
|
|
411
|
+
this.cellEdit$ = new Subject();
|
|
372
412
|
/** Set of currently collapsed group keys (global, shared by both paginated and virtual list). */
|
|
373
413
|
this.collapsedGroupKeys = signal(ImmutableSet.create(), /* @ts-ignore */
|
|
374
414
|
...(ngDevMode ? [{ debugName: "collapsedGroupKeys" }] : /* istanbul ignore next */ []));
|
|
@@ -379,18 +419,22 @@ class GridService {
|
|
|
379
419
|
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
380
420
|
this.contextMenuItems = signal(ImmutableSet.create(), /* @ts-ignore */
|
|
381
421
|
...(ngDevMode ? [{ debugName: "contextMenuItems" }] : /* istanbul ignore next */ []));
|
|
382
|
-
this.
|
|
422
|
+
this.dataStateChange$ = new Subject();
|
|
383
423
|
this.detailColumnOffset = computed(() => this.structuralColumnOffset("detail", this.groupStructuralWidth()), /* @ts-ignore */
|
|
384
424
|
...(ngDevMode ? [{ debugName: "detailColumnOffset" }] : /* istanbul ignore next */ []));
|
|
425
|
+
this.detailColumnWidth = 36;
|
|
385
426
|
this.detailStructuralWidth = computed(() => this.masterDetailTemplate() != null ? this.detailColumnWidth : 0, /* @ts-ignore */
|
|
386
427
|
...(ngDevMode ? [{ debugName: "detailStructuralWidth" }] : /* istanbul ignore next */ []));
|
|
428
|
+
this.draggingRowUid = signal(null, /* @ts-ignore */
|
|
429
|
+
...(ngDevMode ? [{ debugName: "draggingRowUid" }] : /* istanbul ignore next */ []));
|
|
430
|
+
this.edit$ = new Subject();
|
|
387
431
|
this.editBaseDict = computed(() => {
|
|
388
432
|
const pairs = this.#editSource().select(item => new KeyValuePair(item.$rowId, item));
|
|
389
433
|
return ImmutableDictionary.create(pairs);
|
|
390
434
|
}, /* @ts-ignore */
|
|
391
435
|
...(ngDevMode ? [{ debugName: "editBaseDict" }] : /* istanbul ignore next */ []));
|
|
392
436
|
this.editContext = this.#editContext.asReadonly();
|
|
393
|
-
this.
|
|
437
|
+
this.editSession = this.#editSession.asReadonly();
|
|
394
438
|
this.editViewDict = computed(() => {
|
|
395
439
|
const session = this.#editSession();
|
|
396
440
|
if (session == null || session.operation !== "update" || session.rowUid == null) {
|
|
@@ -401,7 +445,6 @@ class GridService {
|
|
|
401
445
|
return ImmutableDictionary.create(pairs);
|
|
402
446
|
}, /* @ts-ignore */
|
|
403
447
|
...(ngDevMode ? [{ debugName: "editViewDict" }] : /* istanbul ignore next */ []));
|
|
404
|
-
this.editSession = this.#editSession.asReadonly();
|
|
405
448
|
this.editableOptions = signal({ enabled: false, mode: "cell" }, /* @ts-ignore */
|
|
406
449
|
...(ngDevMode ? [{ debugName: "editableOptions" }] : /* istanbul ignore next */ []));
|
|
407
450
|
this.editingRowUid = computed(() => this.#editContext()?.rowUid ?? null, /* @ts-ignore */
|
|
@@ -438,12 +481,12 @@ class GridService {
|
|
|
438
481
|
...(ngDevMode ? [{ debugName: "groupStructuralWidth" }] : /* istanbul ignore next */ []));
|
|
439
482
|
this.groupableOptions = signal({ enabled: false, showFooter: false }, /* @ts-ignore */
|
|
440
483
|
...(ngDevMode ? [{ debugName: "groupableOptions" }] : /* istanbul ignore next */ []));
|
|
484
|
+
this.hasFooter = computed(() => this.aggregateColumns().any(), /* @ts-ignore */
|
|
485
|
+
...(ngDevMode ? [{ debugName: "hasFooter" }] : /* istanbul ignore next */ []));
|
|
441
486
|
this.hasLeftLockedColumns = computed(() => this.rowReorderColumnVisible() ||
|
|
442
487
|
this.selectionColumnVisible() ||
|
|
443
488
|
this.visibleColumns().any(column => column.locked && column.lockedPosition === "left"), /* @ts-ignore */
|
|
444
489
|
...(ngDevMode ? [{ debugName: "hasLeftLockedColumns" }] : /* istanbul ignore next */ []));
|
|
445
|
-
this.hasFooter = computed(() => this.aggregateColumns().any(), /* @ts-ignore */
|
|
446
|
-
...(ngDevMode ? [{ debugName: "hasFooter" }] : /* istanbul ignore next */ []));
|
|
447
490
|
this.hasLiveScrollbarGutterWidth = computed(() => this.#scrollbarGutterMeasurementSource() === "body", /* @ts-ignore */
|
|
448
491
|
...(ngDevMode ? [{ debugName: "hasLiveScrollbarGutterWidth" }] : /* istanbul ignore next */ []));
|
|
449
492
|
this.headerTableElement = signal(null, /* @ts-ignore */
|
|
@@ -464,6 +507,13 @@ class GridService {
|
|
|
464
507
|
return groupCount > 0 ? (groupCount - 1) * this.groupColumnWidth : null;
|
|
465
508
|
}, /* @ts-ignore */
|
|
466
509
|
...(ngDevMode ? [{ debugName: "lastLeftStructuralOffset" }] : /* istanbul ignore next */ []));
|
|
510
|
+
this.leadingLogicalColumnCount = computed(() => this.visibleStructuralColumns().length, /* @ts-ignore */
|
|
511
|
+
...(ngDevMode ? [{ debugName: "leadingLogicalColumnCount" }] : /* istanbul ignore next */ []));
|
|
512
|
+
this.leadingStructuralColumnCount = computed(() => this.groupColumns().length + this.visibleStructuralColumns().length, /* @ts-ignore */
|
|
513
|
+
...(ngDevMode ? [{ debugName: "leadingStructuralColumnCount" }] : /* istanbul ignore next */ []));
|
|
514
|
+
this.leadingStructuralWidth = computed(() => this.groupStructuralWidth() +
|
|
515
|
+
this.visibleStructuralColumns().reduce((total, column) => total + column.width, 0), /* @ts-ignore */
|
|
516
|
+
...(ngDevMode ? [{ debugName: "leadingStructuralWidth" }] : /* istanbul ignore next */ []));
|
|
467
517
|
this.leftLockedStructuralWidth = computed(() => {
|
|
468
518
|
if (!this.hasLeftLockedColumns()) {
|
|
469
519
|
return 0;
|
|
@@ -497,13 +547,6 @@ class GridService {
|
|
|
497
547
|
return states;
|
|
498
548
|
}, /* @ts-ignore */
|
|
499
549
|
...(ngDevMode ? [{ debugName: "lockedColumnStates" }] : /* istanbul ignore next */ []));
|
|
500
|
-
this.leadingStructuralWidth = computed(() => this.groupStructuralWidth() +
|
|
501
|
-
this.visibleStructuralColumns().reduce((total, column) => total + column.width, 0), /* @ts-ignore */
|
|
502
|
-
...(ngDevMode ? [{ debugName: "leadingStructuralWidth" }] : /* istanbul ignore next */ []));
|
|
503
|
-
this.leadingStructuralColumnCount = computed(() => this.groupColumns().length + this.visibleStructuralColumns().length, /* @ts-ignore */
|
|
504
|
-
...(ngDevMode ? [{ debugName: "leadingStructuralColumnCount" }] : /* istanbul ignore next */ []));
|
|
505
|
-
this.leadingLogicalColumnCount = computed(() => this.visibleStructuralColumns().length, /* @ts-ignore */
|
|
506
|
-
...(ngDevMode ? [{ debugName: "leadingLogicalColumnCount" }] : /* istanbul ignore next */ []));
|
|
507
550
|
this.masterDetailEmptyCellWidth = computed(() => {
|
|
508
551
|
return this.detailColumnWidth * (this.groupColumns().length + 1);
|
|
509
552
|
}, /* @ts-ignore */
|
|
@@ -519,6 +562,8 @@ class GridService {
|
|
|
519
562
|
this.messages = this.#i18n.componentMessages("grid", GRID_DEFAULT_MESSAGES);
|
|
520
563
|
this.newRowFactory = signal(() => ({}), /* @ts-ignore */
|
|
521
564
|
...(ngDevMode ? [{ debugName: "newRowFactory" }] : /* istanbul ignore next */ []));
|
|
565
|
+
this.pagerTotal = computed(() => this.serverBindingEnabled() ? this.serverTotal() : this.viewRowCount(), /* @ts-ignore */
|
|
566
|
+
...(ngDevMode ? [{ debugName: "pagerTotal" }] : /* istanbul ignore next */ []));
|
|
522
567
|
this.paginationState = signal({ page: 1, skip: 0, take: 10 }, /* @ts-ignore */
|
|
523
568
|
...(ngDevMode ? [{ debugName: "paginationState" }] : /* istanbul ignore next */ []));
|
|
524
569
|
this.remove$ = new Subject();
|
|
@@ -539,6 +584,9 @@ class GridService {
|
|
|
539
584
|
if (!this.rowReorderableOptions().enabled) {
|
|
540
585
|
return "disabled";
|
|
541
586
|
}
|
|
587
|
+
if (this.serverBindingEnabled()) {
|
|
588
|
+
return "server-binding";
|
|
589
|
+
}
|
|
542
590
|
if (this.virtualScrollOptions().enabled) {
|
|
543
591
|
return "virtual-scroll";
|
|
544
592
|
}
|
|
@@ -568,8 +616,6 @@ class GridService {
|
|
|
568
616
|
this.rows = signal(ImmutableList.create(), /* @ts-ignore */
|
|
569
617
|
...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
570
618
|
this.save$ = new Subject();
|
|
571
|
-
this.draggingRowUid = signal(null, /* @ts-ignore */
|
|
572
|
-
...(ngDevMode ? [{ debugName: "draggingRowUid" }] : /* istanbul ignore next */ []));
|
|
573
619
|
this.scrollEnd$ = new Subject();
|
|
574
620
|
this.scrollEndThreshold = signal(5, /* @ts-ignore */
|
|
575
621
|
...(ngDevMode ? [{ debugName: "scrollEndThreshold" }] : /* istanbul ignore next */ []));
|
|
@@ -596,16 +642,19 @@ class GridService {
|
|
|
596
642
|
.toImmutableSet();
|
|
597
643
|
}, /* @ts-ignore */
|
|
598
644
|
...(ngDevMode ? [{ debugName: "selectedRows" }] : /* istanbul ignore next */ []));
|
|
599
|
-
this.
|
|
645
|
+
this.selectionColumnOffset = computed(() => this.structuralColumnOffset("selection", this.groupStructuralWidth()), /* @ts-ignore */
|
|
646
|
+
...(ngDevMode ? [{ debugName: "selectionColumnOffset" }] : /* istanbul ignore next */ []));
|
|
600
647
|
this.selectionColumnVisible = computed(() => {
|
|
601
648
|
const options = this.selectableOptions();
|
|
602
649
|
return options.enabled === true && options.showCheckboxes === true;
|
|
603
650
|
}, /* @ts-ignore */
|
|
604
651
|
...(ngDevMode ? [{ debugName: "selectionColumnVisible" }] : /* istanbul ignore next */ []));
|
|
605
|
-
this.
|
|
606
|
-
...(ngDevMode ? [{ debugName: "selectionColumnOffset" }] : /* istanbul ignore next */ []));
|
|
652
|
+
this.selectionColumnWidth = 40;
|
|
607
653
|
this.selectionStructuralWidth = computed(() => this.selectionColumnVisible() ? this.selectionColumnWidth : 0, /* @ts-ignore */
|
|
608
654
|
...(ngDevMode ? [{ debugName: "selectionStructuralWidth" }] : /* istanbul ignore next */ []));
|
|
655
|
+
this.serverBindingEnabled = this.#serverBindingEnabled.asReadonly();
|
|
656
|
+
this.serverLoading = this.#serverLoading.asReadonly();
|
|
657
|
+
this.serverTotal = this.#serverTotal.asReadonly();
|
|
609
658
|
this.someBulkSelectionRowsSelected = computed(() => {
|
|
610
659
|
const scopeSize = this.#bulkSelectionRowKeys().size;
|
|
611
660
|
const count = this.#bulkSelectionSelectedCount();
|
|
@@ -651,6 +700,9 @@ class GridService {
|
|
|
651
700
|
}, /* @ts-ignore */
|
|
652
701
|
...(ngDevMode ? [{ debugName: "tableWidth" }] : /* istanbul ignore next */ []));
|
|
653
702
|
this.viewPageRows = computed(() => {
|
|
703
|
+
if (this.serverBindingEnabled()) {
|
|
704
|
+
return this.viewRows();
|
|
705
|
+
}
|
|
654
706
|
const skip = this.paginationState().skip;
|
|
655
707
|
const take = this.paginationState().take;
|
|
656
708
|
const viewRows = this.viewRows();
|
|
@@ -664,6 +716,9 @@ class GridService {
|
|
|
664
716
|
...(ngDevMode ? [{ debugName: "viewRowCount" }] : /* istanbul ignore next */ []));
|
|
665
717
|
this.viewRows = computed(() => {
|
|
666
718
|
const rows = this.rows();
|
|
719
|
+
if (this.serverBindingEnabled()) {
|
|
720
|
+
return rows;
|
|
721
|
+
}
|
|
667
722
|
const appliedFilters = this.appliedFilters();
|
|
668
723
|
const appliedSorts = this.appliedSorts();
|
|
669
724
|
const groupColumns = this.groupColumns();
|
|
@@ -693,7 +748,10 @@ class GridService {
|
|
|
693
748
|
...(ngDevMode ? [{ debugName: "virtualGridMaxBuffer" }] : /* istanbul ignore next */ []));
|
|
694
749
|
this.virtualGridMinBuffer = signal(0, /* @ts-ignore */
|
|
695
750
|
...(ngDevMode ? [{ debugName: "virtualGridMinBuffer" }] : /* istanbul ignore next */ []));
|
|
696
|
-
this.virtualScrollOptions = signal({
|
|
751
|
+
this.virtualScrollOptions = signal({
|
|
752
|
+
enabled: false,
|
|
753
|
+
height: GRID_DEFAULT_VIRTUAL_ROW_HEIGHT
|
|
754
|
+
}, /* @ts-ignore */
|
|
697
755
|
...(ngDevMode ? [{ debugName: "virtualScrollOptions" }] : /* istanbul ignore next */ []));
|
|
698
756
|
this.visibleColumns = computed(() => this.columns()
|
|
699
757
|
.where(column => !column.hidden)
|
|
@@ -723,6 +781,7 @@ class GridService {
|
|
|
723
781
|
if (options.schemaVersion != null && state.schemaVersion !== options.schemaVersion) {
|
|
724
782
|
return { ignoredColumns: [], missingColumns: [], status: "rejected-schema" };
|
|
725
783
|
}
|
|
784
|
+
const previousDataState = this.getDataState();
|
|
726
785
|
let columns = this.columns().toArray();
|
|
727
786
|
const columnById = new Map();
|
|
728
787
|
for (const column of columns) {
|
|
@@ -773,6 +832,12 @@ class GridService {
|
|
|
773
832
|
if (options.persistPageSize !== false && state.pageSize != null) {
|
|
774
833
|
this.setPageState({ page: 1, skip: 0, take: state.pageSize });
|
|
775
834
|
}
|
|
835
|
+
if (this.serverBindingEnabled()) {
|
|
836
|
+
this.setPageState({ skip: 0 });
|
|
837
|
+
}
|
|
838
|
+
if (!deepEquals(previousDataState, this.getDataState())) {
|
|
839
|
+
this.requestDataStateChange({ resetPage: true });
|
|
840
|
+
}
|
|
776
841
|
return { ignoredColumns, missingColumns, status: "applied" };
|
|
777
842
|
}
|
|
778
843
|
canReorderRow(row) {
|
|
@@ -837,10 +902,10 @@ class GridService {
|
|
|
837
902
|
.where(filter => filter != null)
|
|
838
903
|
.toArray(),
|
|
839
904
|
group: this.getGroupDescriptors(this.groupColumns()),
|
|
840
|
-
sort: this.
|
|
841
|
-
.
|
|
842
|
-
|
|
843
|
-
|
|
905
|
+
sort: this.getSortDescriptors().map(sort => ({
|
|
906
|
+
dir: sort.dir,
|
|
907
|
+
field: sort.field
|
|
908
|
+
})),
|
|
844
909
|
version: GRID_STATE_VERSION
|
|
845
910
|
};
|
|
846
911
|
if (options.schemaVersion != null) {
|
|
@@ -937,6 +1002,20 @@ class GridService {
|
|
|
937
1002
|
getColumnWidth(column) {
|
|
938
1003
|
return this.normalizeRenderedWidth(column.calculatedWidth ?? column.width ?? column.minWidth ?? 0);
|
|
939
1004
|
}
|
|
1005
|
+
getDataState() {
|
|
1006
|
+
const { skip, take } = this.paginationState();
|
|
1007
|
+
return {
|
|
1008
|
+
skip,
|
|
1009
|
+
take,
|
|
1010
|
+
sort: this.getSortDescriptors(),
|
|
1011
|
+
filter: this.appliedFilters()
|
|
1012
|
+
.values()
|
|
1013
|
+
.select(state => state.filter)
|
|
1014
|
+
.where(filter => filter != null)
|
|
1015
|
+
.select(filter => this.cloneFilter(filter))
|
|
1016
|
+
.toArray()
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
940
1019
|
getGroupDescriptors(columns) {
|
|
941
1020
|
return select(columns, c => ({
|
|
942
1021
|
field: c.field,
|
|
@@ -948,6 +1027,16 @@ class GridService {
|
|
|
948
1027
|
const label = options.rowAriaLabel?.(row.data, absoluteIndex);
|
|
949
1028
|
return label ?? this.messages().reorderRow(absoluteIndex + 1);
|
|
950
1029
|
}
|
|
1030
|
+
/** Sort order shared by models, persistence, and server requests. */
|
|
1031
|
+
getSortDescriptors() {
|
|
1032
|
+
const columns = this.columns().toArray();
|
|
1033
|
+
return this.appliedSorts()
|
|
1034
|
+
.values()
|
|
1035
|
+
.toArray()
|
|
1036
|
+
.sort((left, right) => (columns.find(c => c.field === left.sort.field)?.sortIndex ?? Number.MAX_SAFE_INTEGER) -
|
|
1037
|
+
(columns.find(c => c.field === right.sort.field)?.sortIndex ?? Number.MAX_SAFE_INTEGER))
|
|
1038
|
+
.map(state => ({ ...state.sort }));
|
|
1039
|
+
}
|
|
951
1040
|
handleMultipleSelection(event, row) {
|
|
952
1041
|
if (event.shiftKey) {
|
|
953
1042
|
this.selectRowRange(row);
|
|
@@ -1121,6 +1210,24 @@ class GridService {
|
|
|
1121
1210
|
this.remove$.next(event);
|
|
1122
1211
|
return !event.isDefaultPrevented();
|
|
1123
1212
|
}
|
|
1213
|
+
requestDataStateChange(options = {}) {
|
|
1214
|
+
if (!this.serverBindingEnabled()) {
|
|
1215
|
+
return;
|
|
1216
|
+
}
|
|
1217
|
+
if (options.resetPage) {
|
|
1218
|
+
this.setPageState({ skip: 0 });
|
|
1219
|
+
}
|
|
1220
|
+
if (this.#dataStateEmissionPending) {
|
|
1221
|
+
return;
|
|
1222
|
+
}
|
|
1223
|
+
this.#dataStateEmissionPending = true;
|
|
1224
|
+
queueMicrotask(() => {
|
|
1225
|
+
this.#dataStateEmissionPending = false;
|
|
1226
|
+
if (this.serverBindingEnabled()) {
|
|
1227
|
+
this.dataStateChange$.next(this.getDataState());
|
|
1228
|
+
}
|
|
1229
|
+
});
|
|
1230
|
+
}
|
|
1124
1231
|
requestRowReorder(row, previousPageIndex, currentPageIndex) {
|
|
1125
1232
|
if (!this.rowReorderInteractionEnabled()) {
|
|
1126
1233
|
return false;
|
|
@@ -1283,7 +1390,19 @@ class GridService {
|
|
|
1283
1390
|
this.newRowFactory.set(factory);
|
|
1284
1391
|
}
|
|
1285
1392
|
setPageState(state) {
|
|
1286
|
-
this.paginationState
|
|
1393
|
+
const current = this.paginationState();
|
|
1394
|
+
const take = state.take ?? current.take;
|
|
1395
|
+
const skip = state.skip ?? (state.page != null ? (state.page - 1) * take : current.skip);
|
|
1396
|
+
if (this.serverBindingEnabled()) {
|
|
1397
|
+
this.validateServerInteger(skip, "skip");
|
|
1398
|
+
if (!Number.isSafeInteger(take) || take <= 0) {
|
|
1399
|
+
throw new Error("monaGridServerBinding: pageSize must be a finite positive integer.");
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
const page = Math.floor(skip / take) + 1;
|
|
1403
|
+
if (current.skip !== skip || current.take !== take || current.page !== page) {
|
|
1404
|
+
this.paginationState.set({ skip, take, page });
|
|
1405
|
+
}
|
|
1287
1406
|
}
|
|
1288
1407
|
setReorderableOptions(options) {
|
|
1289
1408
|
this.#reorderableOptions.update(v => ({ ...v, ...options }));
|
|
@@ -1297,12 +1416,6 @@ class GridService {
|
|
|
1297
1416
|
setRowReorderableOptions(options) {
|
|
1298
1417
|
this.#rowReorderableOptions.set(options);
|
|
1299
1418
|
}
|
|
1300
|
-
setRows(value, rowKey = null) {
|
|
1301
|
-
this.rows.set(ImmutableList.create(select(value, r => new Row(r, this.getRowUid(r, rowKey)))));
|
|
1302
|
-
}
|
|
1303
|
-
setSelectableOptions(options) {
|
|
1304
|
-
this.selectableOptions.update(v => ({ ...v, ...options }));
|
|
1305
|
-
}
|
|
1306
1419
|
setRowSelected(row, selected) {
|
|
1307
1420
|
const key = this.getRowSelectionKey(row);
|
|
1308
1421
|
const mode = this.selectableOptions().mode;
|
|
@@ -1317,14 +1430,44 @@ class GridService {
|
|
|
1317
1430
|
}
|
|
1318
1431
|
this.selectedKeys.update(keys => keys.remove(key));
|
|
1319
1432
|
}
|
|
1320
|
-
|
|
1321
|
-
this.
|
|
1433
|
+
setRows(value, rowKey = null) {
|
|
1434
|
+
this.rows.set(ImmutableList.create(select(value, r => new Row(r, this.getRowUid(r, rowKey)))));
|
|
1322
1435
|
}
|
|
1323
1436
|
setScrollEndThreshold(threshold) {
|
|
1324
1437
|
this.scrollEndThreshold.set(threshold);
|
|
1325
1438
|
}
|
|
1439
|
+
setSelectableOptions(options) {
|
|
1440
|
+
this.selectableOptions.update(v => ({ ...v, ...options }));
|
|
1441
|
+
}
|
|
1442
|
+
setServerBindingEnabled(enabled) {
|
|
1443
|
+
if (enabled && this.virtualScrollOptions().enabled) {
|
|
1444
|
+
throw new Error("monaGridServerBinding and monaGridVirtualScroll cannot be enabled together.");
|
|
1445
|
+
}
|
|
1446
|
+
this.#serverBindingEnabled.set(enabled);
|
|
1447
|
+
}
|
|
1448
|
+
setServerLoading(loading) {
|
|
1449
|
+
this.#serverLoading.set(loading);
|
|
1450
|
+
}
|
|
1451
|
+
setServerSkip(skip) {
|
|
1452
|
+
this.validateServerInteger(skip, "skip");
|
|
1453
|
+
this.setPageState({ skip, page: Math.floor(skip / this.paginationState().take) + 1 });
|
|
1454
|
+
}
|
|
1455
|
+
setServerTotal(total) {
|
|
1456
|
+
this.validateServerInteger(total, "total");
|
|
1457
|
+
this.#serverTotal.set(total);
|
|
1458
|
+
}
|
|
1459
|
+
setSortableOptions(options) {
|
|
1460
|
+
this.sortableOptions.update(v => ({ ...v, ...options }));
|
|
1461
|
+
}
|
|
1326
1462
|
setVirtualScrollOptions(options) {
|
|
1327
|
-
this.virtualScrollOptions.
|
|
1463
|
+
const height = options.height ?? this.virtualScrollOptions().height ?? GRID_DEFAULT_VIRTUAL_ROW_HEIGHT;
|
|
1464
|
+
if (!Number.isFinite(height) || height <= 0) {
|
|
1465
|
+
throw new Error("monaGridVirtualScroll: height must be finite and greater than zero.");
|
|
1466
|
+
}
|
|
1467
|
+
if (options.enabled && this.serverBindingEnabled()) {
|
|
1468
|
+
throw new Error("monaGridServerBinding and monaGridVirtualScroll cannot be enabled together.");
|
|
1469
|
+
}
|
|
1470
|
+
this.virtualScrollOptions.update(v => ({ ...v, ...options, height }));
|
|
1328
1471
|
}
|
|
1329
1472
|
startAddRow(originalEvent) {
|
|
1330
1473
|
const activeSession = this.#editSession();
|
|
@@ -1501,17 +1644,31 @@ class GridService {
|
|
|
1501
1644
|
const segment = `${field}:${String(value ?? "")}`;
|
|
1502
1645
|
return parentKey != null ? `${parentKey}/${segment}` : segment;
|
|
1503
1646
|
}
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1647
|
+
clearEditSession() {
|
|
1648
|
+
this.#editContext.set(null);
|
|
1649
|
+
this.#editSession.set(null);
|
|
1650
|
+
}
|
|
1651
|
+
cloneFilter(filter) {
|
|
1652
|
+
return {
|
|
1653
|
+
...filter,
|
|
1654
|
+
filters: filter.filters.map(descriptor => "filters" in descriptor
|
|
1655
|
+
? this.cloneFilter(descriptor)
|
|
1656
|
+
: "value" in descriptor
|
|
1657
|
+
? { ...descriptor, value: this.cloneFilterValue(descriptor.value) }
|
|
1658
|
+
: { ...descriptor })
|
|
1659
|
+
};
|
|
1660
|
+
}
|
|
1661
|
+
cloneFilterValue(value) {
|
|
1662
|
+
if (value instanceof Date) {
|
|
1663
|
+
return new Date(value.getTime());
|
|
1507
1664
|
}
|
|
1508
|
-
if (
|
|
1509
|
-
return
|
|
1665
|
+
if (Array.isArray(value)) {
|
|
1666
|
+
return value.map(item => this.cloneFilterValue(item));
|
|
1510
1667
|
}
|
|
1511
|
-
if (
|
|
1512
|
-
return
|
|
1668
|
+
if (value != null && typeof value === "object") {
|
|
1669
|
+
return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, this.cloneFilterValue(item)]));
|
|
1513
1670
|
}
|
|
1514
|
-
return
|
|
1671
|
+
return value;
|
|
1515
1672
|
}
|
|
1516
1673
|
createAggregateBucket(rows, column) {
|
|
1517
1674
|
const field = column.field;
|
|
@@ -1533,14 +1690,14 @@ class GridService {
|
|
|
1533
1690
|
if (value == null) {
|
|
1534
1691
|
continue;
|
|
1535
1692
|
}
|
|
1536
|
-
const comparableValue =
|
|
1693
|
+
const comparableValue = toGridComparableValue(value);
|
|
1537
1694
|
if (comparableValue == null) {
|
|
1538
1695
|
continue;
|
|
1539
1696
|
}
|
|
1540
|
-
if (min == null ||
|
|
1697
|
+
if (min == null || compareGridComparableValues(comparableValue, toGridComparableValue(min)) < 0) {
|
|
1541
1698
|
min = value;
|
|
1542
1699
|
}
|
|
1543
|
-
if (max == null ||
|
|
1700
|
+
if (max == null || compareGridComparableValues(comparableValue, toGridComparableValue(max)) > 0) {
|
|
1544
1701
|
max = value;
|
|
1545
1702
|
}
|
|
1546
1703
|
}
|
|
@@ -1555,6 +1712,35 @@ class GridService {
|
|
|
1555
1712
|
}
|
|
1556
1713
|
return aggregates.toImmutableDictionary(e => e.key, e => e.value);
|
|
1557
1714
|
}
|
|
1715
|
+
createEditSession(options) {
|
|
1716
|
+
const model = signal({ ...options.rowData }, /* @ts-ignore */
|
|
1717
|
+
...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
|
|
1718
|
+
const context = {
|
|
1719
|
+
column: options.column,
|
|
1720
|
+
field: options.field,
|
|
1721
|
+
isNew: options.isNew,
|
|
1722
|
+
mode: options.mode,
|
|
1723
|
+
operation: options.operation,
|
|
1724
|
+
originalRowData: options.originalRowData,
|
|
1725
|
+
rowData: options.rowData
|
|
1726
|
+
};
|
|
1727
|
+
const schema = this.editableOptions().schema?.(context) ?? null;
|
|
1728
|
+
const editForm = schema == null
|
|
1729
|
+
? form(model, { injector: this.#injector })
|
|
1730
|
+
: form(model, schema, { injector: this.#injector });
|
|
1731
|
+
return {
|
|
1732
|
+
column: options.column,
|
|
1733
|
+
field: options.field,
|
|
1734
|
+
form: editForm,
|
|
1735
|
+
isNew: options.isNew,
|
|
1736
|
+
mode: options.mode,
|
|
1737
|
+
model,
|
|
1738
|
+
operation: options.operation,
|
|
1739
|
+
originalRowData: options.originalRowData,
|
|
1740
|
+
row: options.row,
|
|
1741
|
+
rowUid: options.rowUid
|
|
1742
|
+
};
|
|
1743
|
+
}
|
|
1558
1744
|
deserializeCompositeFilter(filter) {
|
|
1559
1745
|
const filters = filter.filters
|
|
1560
1746
|
.map(child => "filters" in child ? this.deserializeCompositeFilter(child) : this.deserializeFilterDescriptor(child))
|
|
@@ -1700,6 +1886,9 @@ class GridService {
|
|
|
1700
1886
|
const rightLockedColumns = columns.filter(column => this.getColumnLockBucket(column) === "right");
|
|
1701
1887
|
return [...leftLockedColumns, ...unlockedColumns, ...rightLockedColumns];
|
|
1702
1888
|
}
|
|
1889
|
+
patchSessionField(session, field, value) {
|
|
1890
|
+
session.model.update(rowData => ({ ...rowData, [field]: value }));
|
|
1891
|
+
}
|
|
1703
1892
|
reconcileColumn(config, previous) {
|
|
1704
1893
|
const hidden = previous != null && previous.configuredHidden === config.hidden ? previous.hidden : config.hidden;
|
|
1705
1894
|
return {
|
|
@@ -1715,6 +1904,17 @@ class GridService {
|
|
|
1715
1904
|
sortIndex: previous?.sortIndex ?? null
|
|
1716
1905
|
};
|
|
1717
1906
|
}
|
|
1907
|
+
resolveEditedRowData(rowUid, fallbackRowData) {
|
|
1908
|
+
const editedRowData = this.editViewDict().get(rowUid);
|
|
1909
|
+
if (editedRowData == null) {
|
|
1910
|
+
return fallbackRowData;
|
|
1911
|
+
}
|
|
1912
|
+
const { $rowId: _rowId, ...rowData } = editedRowData;
|
|
1913
|
+
return rowData;
|
|
1914
|
+
}
|
|
1915
|
+
resolveSessionRowData(session) {
|
|
1916
|
+
return { ...session.form().value() };
|
|
1917
|
+
}
|
|
1718
1918
|
// Range selection is scoped to bulkSelectionRows() (current page, or full view when virtualized/
|
|
1719
1919
|
// view-scoped) since that's the same click-reachable ordering used for the select-all checkbox.
|
|
1720
1920
|
selectRowRange(row) {
|
|
@@ -1739,66 +1939,6 @@ class GridService {
|
|
|
1739
1939
|
const rangeKeys = rows.slice(start, end + 1).map(r => this.getRowSelectionKey(r));
|
|
1740
1940
|
this.selectedKeys.set(ImmutableSet.create(rangeKeys));
|
|
1741
1941
|
}
|
|
1742
|
-
clearEditSession() {
|
|
1743
|
-
this.#editContext.set(null);
|
|
1744
|
-
this.#editSession.set(null);
|
|
1745
|
-
}
|
|
1746
|
-
createEditSession(options) {
|
|
1747
|
-
const model = signal({ ...options.rowData }, /* @ts-ignore */
|
|
1748
|
-
...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
|
|
1749
|
-
const context = {
|
|
1750
|
-
column: options.column,
|
|
1751
|
-
field: options.field,
|
|
1752
|
-
isNew: options.isNew,
|
|
1753
|
-
mode: options.mode,
|
|
1754
|
-
operation: options.operation,
|
|
1755
|
-
originalRowData: options.originalRowData,
|
|
1756
|
-
rowData: options.rowData
|
|
1757
|
-
};
|
|
1758
|
-
const schema = this.editableOptions().schema?.(context) ?? null;
|
|
1759
|
-
const editForm = schema == null
|
|
1760
|
-
? form(model, { injector: this.#injector })
|
|
1761
|
-
: form(model, schema, { injector: this.#injector });
|
|
1762
|
-
return {
|
|
1763
|
-
column: options.column,
|
|
1764
|
-
field: options.field,
|
|
1765
|
-
form: editForm,
|
|
1766
|
-
isNew: options.isNew,
|
|
1767
|
-
mode: options.mode,
|
|
1768
|
-
model,
|
|
1769
|
-
operation: options.operation,
|
|
1770
|
-
originalRowData: options.originalRowData,
|
|
1771
|
-
row: options.row,
|
|
1772
|
-
rowUid: options.rowUid
|
|
1773
|
-
};
|
|
1774
|
-
}
|
|
1775
|
-
patchSessionField(session, field, value) {
|
|
1776
|
-
session.model.update(rowData => ({ ...rowData, [field]: value }));
|
|
1777
|
-
}
|
|
1778
|
-
resolveEditedRowData(rowUid, fallbackRowData) {
|
|
1779
|
-
const editedRowData = this.editViewDict().get(rowUid);
|
|
1780
|
-
if (editedRowData == null) {
|
|
1781
|
-
return fallbackRowData;
|
|
1782
|
-
}
|
|
1783
|
-
const { $rowId, ...rowData } = editedRowData;
|
|
1784
|
-
return rowData;
|
|
1785
|
-
}
|
|
1786
|
-
resolveSessionRowData(session) {
|
|
1787
|
-
return { ...session.form().value() };
|
|
1788
|
-
}
|
|
1789
|
-
validateSessionForSave(session) {
|
|
1790
|
-
const rootField = session.form();
|
|
1791
|
-
const editedField = session.mode === "cell" && session.field != null ? session.form[session.field] : null;
|
|
1792
|
-
if (editedField == null) {
|
|
1793
|
-
rootField.markAsTouched();
|
|
1794
|
-
return !rootField.invalid() && !rootField.pending();
|
|
1795
|
-
}
|
|
1796
|
-
// A cell edit can only fix its own field. Row-level errors still block the save, but an invalid
|
|
1797
|
-
// sibling field must not trap the user in a cell whose own value is valid.
|
|
1798
|
-
const field = editedField();
|
|
1799
|
-
field.markAsTouched();
|
|
1800
|
-
return !field.invalid() && !field.pending() && rootField.errors().length === 0;
|
|
1801
|
-
}
|
|
1802
1942
|
serializeFilter(filter) {
|
|
1803
1943
|
if (filter == null) {
|
|
1804
1944
|
return null;
|
|
@@ -1901,23 +2041,27 @@ class GridService {
|
|
|
1901
2041
|
onCleanup(() => resizeObserver.disconnect());
|
|
1902
2042
|
});
|
|
1903
2043
|
}
|
|
1904
|
-
toComparableValue(value) {
|
|
1905
|
-
if (value instanceof Date) {
|
|
1906
|
-
return value.getTime();
|
|
1907
|
-
}
|
|
1908
|
-
switch (typeof value) {
|
|
1909
|
-
case "bigint":
|
|
1910
|
-
case "boolean":
|
|
1911
|
-
case "number":
|
|
1912
|
-
case "string":
|
|
1913
|
-
return value;
|
|
1914
|
-
default:
|
|
1915
|
-
return null;
|
|
1916
|
-
}
|
|
1917
|
-
}
|
|
1918
2044
|
updateColumns(updater) {
|
|
1919
2045
|
this.columns.update(columns => ImmutableList.create(this.applyColumnIndexes(columns.select(updater).toArray())));
|
|
1920
2046
|
}
|
|
2047
|
+
validateServerInteger(value, name) {
|
|
2048
|
+
if (!Number.isSafeInteger(value) || value < 0) {
|
|
2049
|
+
throw new Error(`monaGridServerBinding: ${name} must be a finite non-negative integer.`);
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
validateSessionForSave(session) {
|
|
2053
|
+
const rootField = session.form();
|
|
2054
|
+
const editedField = session.mode === "cell" && session.field != null ? session.form[session.field] : null;
|
|
2055
|
+
if (editedField == null) {
|
|
2056
|
+
rootField.markAsTouched();
|
|
2057
|
+
return !rootField.invalid() && !rootField.pending();
|
|
2058
|
+
}
|
|
2059
|
+
// A cell edit can only fix its own field. Row-level errors still block the save, but an invalid
|
|
2060
|
+
// sibling field must not trap the user in a cell whose own value is valid.
|
|
2061
|
+
const field = editedField();
|
|
2062
|
+
field.markAsTouched();
|
|
2063
|
+
return !field.invalid() && !field.pending() && rootField.errors().length === 0;
|
|
2064
|
+
}
|
|
1921
2065
|
withColumnIndices(columns) {
|
|
1922
2066
|
return columns.map((column, index) => ({ ...column, index }));
|
|
1923
2067
|
}
|
|
@@ -2617,33 +2761,30 @@ class GridSortableDirective {
|
|
|
2617
2761
|
});
|
|
2618
2762
|
}
|
|
2619
2763
|
applyColumnSort(column, sortDirection) {
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
this.#gridService
|
|
2623
|
-
.columns()
|
|
2624
|
-
.where(c => c.field !== column.field)
|
|
2625
|
-
.forEach(c => {
|
|
2626
|
-
appliedSorts = appliedSorts.remove(c.field);
|
|
2627
|
-
});
|
|
2628
|
-
}
|
|
2764
|
+
const sorts = this.#gridService.sortableOptions().mode === "single" ? [] : this.#gridService.getSortDescriptors();
|
|
2765
|
+
const index = sorts.findIndex(sort => sort.field === column.field);
|
|
2629
2766
|
if (sortDirection != null) {
|
|
2630
2767
|
const sortDescriptor = {
|
|
2631
2768
|
field: column.field,
|
|
2632
2769
|
dir: sortDirection
|
|
2633
2770
|
};
|
|
2634
|
-
|
|
2771
|
+
if (index < 0) {
|
|
2772
|
+
sorts.push(sortDescriptor);
|
|
2773
|
+
}
|
|
2774
|
+
else {
|
|
2775
|
+
sorts[index] = sortDescriptor;
|
|
2776
|
+
}
|
|
2635
2777
|
}
|
|
2636
|
-
else {
|
|
2637
|
-
|
|
2778
|
+
else if (index >= 0) {
|
|
2779
|
+
sorts.splice(index, 1);
|
|
2638
2780
|
}
|
|
2639
|
-
this.#gridService.
|
|
2640
|
-
this.#gridService.loadSorts(appliedSorts
|
|
2641
|
-
.values()
|
|
2642
|
-
.select(s => s.sort)
|
|
2643
|
-
.toArray());
|
|
2781
|
+
this.#gridService.loadSorts(sorts);
|
|
2644
2782
|
}
|
|
2645
2783
|
#setSubscriptions() {
|
|
2646
2784
|
this.#gridService.columnSort$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(event => {
|
|
2785
|
+
if (!this.#gridService.sortableOptions().enabled || !event.column.sortable) {
|
|
2786
|
+
return;
|
|
2787
|
+
}
|
|
2647
2788
|
this.columnSort.emit(event);
|
|
2648
2789
|
if (event.isDefaultPrevented()) {
|
|
2649
2790
|
return;
|
|
@@ -2663,12 +2804,9 @@ class GridSortableDirective {
|
|
|
2663
2804
|
nextSortDirection = "asc";
|
|
2664
2805
|
}
|
|
2665
2806
|
this.applyColumnSort(column, nextSortDirection);
|
|
2666
|
-
const sortDescriptors = this.#gridService
|
|
2667
|
-
.appliedSorts()
|
|
2668
|
-
.values()
|
|
2669
|
-
.select(s => s.sort)
|
|
2670
|
-
.toArray();
|
|
2807
|
+
const sortDescriptors = this.#gridService.getSortDescriptors();
|
|
2671
2808
|
this.sort.set(sortDescriptors);
|
|
2809
|
+
this.#gridService.requestDataStateChange({ resetPage: true });
|
|
2672
2810
|
});
|
|
2673
2811
|
}
|
|
2674
2812
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridSortableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
@@ -2681,6 +2819,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
2681
2819
|
}]
|
|
2682
2820
|
}], ctorParameters: () => [], propDecorators: { columnSort: [{ type: i0.Output, args: ["columnSort"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaGridSortable", required: false }] }], sort: [{ type: i0.Input, args: [{ isSignal: true, alias: "sort", required: false }] }, { type: i0.Output, args: ["sortChange"] }] } });
|
|
2683
2821
|
|
|
2822
|
+
class GridServerBindingDirective {
|
|
2823
|
+
#destroyRef;
|
|
2824
|
+
#gridService;
|
|
2825
|
+
constructor() {
|
|
2826
|
+
this.#destroyRef = inject(DestroyRef);
|
|
2827
|
+
this.#gridService = inject(GridService);
|
|
2828
|
+
/** @description Emitted once per user paging, sorting, or filtering action with the requested server state. */
|
|
2829
|
+
this.dataStateChange = output();
|
|
2830
|
+
/** @description Shows a loading overlay while the application requests server data. */
|
|
2831
|
+
this.loading = input(false, /* @ts-ignore */
|
|
2832
|
+
...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
2833
|
+
/** @description Zero-based offset of the supplied server page. External changes do not request data. */
|
|
2834
|
+
this.skip = input(0, /* @ts-ignore */
|
|
2835
|
+
...(ngDevMode ? [{ debugName: "skip" }] : /* istanbul ignore next */ []));
|
|
2836
|
+
/** @description Total matching server records before paging. Must be a non-negative integer. */
|
|
2837
|
+
this.total = input.required(/* @ts-ignore */
|
|
2838
|
+
...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
2839
|
+
this.#gridService.setServerBindingEnabled(true);
|
|
2840
|
+
effect(() => {
|
|
2841
|
+
const total = this.total();
|
|
2842
|
+
untracked(() => this.#gridService.setServerTotal(total));
|
|
2843
|
+
});
|
|
2844
|
+
effect(() => {
|
|
2845
|
+
const skip = this.skip();
|
|
2846
|
+
untracked(() => this.#gridService.setServerSkip(skip));
|
|
2847
|
+
});
|
|
2848
|
+
effect(() => {
|
|
2849
|
+
const loading = this.loading();
|
|
2850
|
+
untracked(() => this.#gridService.setServerLoading(loading));
|
|
2851
|
+
});
|
|
2852
|
+
this.#gridService.dataStateChange$
|
|
2853
|
+
.pipe(takeUntilDestroyed(this.#destroyRef))
|
|
2854
|
+
.subscribe(state => this.dataStateChange.emit(state));
|
|
2855
|
+
this.#destroyRef.onDestroy(() => this.#gridService.setServerBindingEnabled(false));
|
|
2856
|
+
}
|
|
2857
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridServerBindingDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2858
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: GridServerBindingDirective, isStandalone: true, selector: "mona-grid[monaGridServerBinding]", inputs: { loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, skip: { classPropertyName: "skip", publicName: "skip", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dataStateChange: "dataStateChange" }, ngImport: i0 }); }
|
|
2859
|
+
}
|
|
2860
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridServerBindingDirective, decorators: [{
|
|
2861
|
+
type: Directive,
|
|
2862
|
+
args: [{ selector: "mona-grid[monaGridServerBinding]" }]
|
|
2863
|
+
}], ctorParameters: () => [], propDecorators: { dataStateChange: [{ type: i0.Output, args: ["dataStateChange"] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], skip: [{ type: i0.Input, args: [{ isSignal: true, alias: "skip", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: true }] }] } });
|
|
2864
|
+
|
|
2684
2865
|
class GridStatePersistenceDirective {
|
|
2685
2866
|
#gridService;
|
|
2686
2867
|
#initialized;
|
|
@@ -2704,7 +2885,10 @@ class GridStatePersistenceDirective {
|
|
|
2704
2885
|
afterNextRender({
|
|
2705
2886
|
read: () => {
|
|
2706
2887
|
if (this.#isEnabled()) {
|
|
2707
|
-
this.loadState(this.state());
|
|
2888
|
+
const result = this.loadState(this.state());
|
|
2889
|
+
if (result.status === "applied") {
|
|
2890
|
+
this.#gridService.requestDataStateChange({ resetPage: true });
|
|
2891
|
+
}
|
|
2708
2892
|
}
|
|
2709
2893
|
this.#initialized.set(true);
|
|
2710
2894
|
}
|
|
@@ -2715,7 +2899,11 @@ class GridStatePersistenceDirective {
|
|
|
2715
2899
|
if (!this.#initialized() || this.#emittingState || !this.#isEnabled()) {
|
|
2716
2900
|
return;
|
|
2717
2901
|
}
|
|
2718
|
-
untracked(() =>
|
|
2902
|
+
untracked(() => {
|
|
2903
|
+
if (!deepEquals(state, this.#gridService.captureState(options))) {
|
|
2904
|
+
this.loadState(state, options);
|
|
2905
|
+
}
|
|
2906
|
+
});
|
|
2719
2907
|
});
|
|
2720
2908
|
effect(() => {
|
|
2721
2909
|
if (!this.#initialized() || this.#loadingState || !this.#isEnabled()) {
|
|
@@ -2861,7 +3049,7 @@ class GridVirtualScrollDirective {
|
|
|
2861
3049
|
constructor() {
|
|
2862
3050
|
this.#defaultOptions = {
|
|
2863
3051
|
enabled: true,
|
|
2864
|
-
height:
|
|
3052
|
+
height: GRID_DEFAULT_VIRTUAL_ROW_HEIGHT
|
|
2865
3053
|
};
|
|
2866
3054
|
this.#destroyRef = inject(DestroyRef);
|
|
2867
3055
|
this.#gridService = inject(GridService);
|
|
@@ -2942,6 +3130,7 @@ class GridCommandColumnComponent {
|
|
|
2942
3130
|
maxWidth: this.maxWidth(),
|
|
2943
3131
|
minWidth: this.minWidth(),
|
|
2944
3132
|
removeConfirmation: this.removeConfirmation(),
|
|
3133
|
+
sortable: false,
|
|
2945
3134
|
sortIndex: null,
|
|
2946
3135
|
stateKey,
|
|
2947
3136
|
title: this.title(),
|
|
@@ -3017,7 +3206,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
3017
3206
|
|
|
3018
3207
|
class GridColumnComponent {
|
|
3019
3208
|
constructor() {
|
|
3020
|
-
this.#columnId = v4();
|
|
3021
3209
|
this.#column = computed(() => ({
|
|
3022
3210
|
aggregate: this.aggregate(),
|
|
3023
3211
|
calculatedWidth: null,
|
|
@@ -3045,6 +3233,7 @@ class GridColumnComponent {
|
|
|
3045
3233
|
maxWidth: this.maxWidth(),
|
|
3046
3234
|
minWidth: this.minWidth(),
|
|
3047
3235
|
removeConfirmation: false,
|
|
3236
|
+
sortable: this.sortable(),
|
|
3048
3237
|
sortIndex: null,
|
|
3049
3238
|
stateKey: this.stateKey(),
|
|
3050
3239
|
title: this.title(),
|
|
@@ -3052,6 +3241,7 @@ class GridColumnComponent {
|
|
|
3052
3241
|
width: this.width() ?? null
|
|
3053
3242
|
}), /* @ts-ignore */
|
|
3054
3243
|
...(ngDevMode ? [{ debugName: "#column" }] : /* istanbul ignore next */ []));
|
|
3244
|
+
this.#columnId = v4();
|
|
3055
3245
|
this.cellTemplate = contentChild(GridCellTemplateDirective, { ...(ngDevMode ? { debugName: "cellTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
3056
3246
|
this.editTemplate = contentChild(GridEditTemplateDirective, { ...(ngDevMode ? { debugName: "editTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
3057
3247
|
this.footerTemplate = contentChild(GridFooterTemplateDirective, { ...(ngDevMode ? { debugName: "footerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
@@ -3108,6 +3298,11 @@ class GridColumnComponent {
|
|
|
3108
3298
|
*/
|
|
3109
3299
|
this.minWidth = input(40, /* @ts-ignore */
|
|
3110
3300
|
...(ngDevMode ? [{ debugName: "minWidth" }] : /* istanbul ignore next */ []));
|
|
3301
|
+
/**
|
|
3302
|
+
* @description Whether this column can be sorted through its header when grid sorting is enabled. Has no effect if sorting is disabled on the grid.
|
|
3303
|
+
*/
|
|
3304
|
+
this.sortable = input(true, /* @ts-ignore */
|
|
3305
|
+
...(ngDevMode ? [{ debugName: "sortable" }] : /* istanbul ignore next */ []));
|
|
3111
3306
|
/**
|
|
3112
3307
|
* @description A stable key used to persist state for columns whose field is empty or unstable.
|
|
3113
3308
|
*/
|
|
@@ -3129,13 +3324,13 @@ class GridColumnComponent {
|
|
|
3129
3324
|
this.width = input(/* @ts-ignore */
|
|
3130
3325
|
...(ngDevMode ? [undefined, { debugName: "width" }] : /* istanbul ignore next */ []));
|
|
3131
3326
|
}
|
|
3132
|
-
#columnId;
|
|
3133
3327
|
#column;
|
|
3328
|
+
#columnId;
|
|
3134
3329
|
getColumn() {
|
|
3135
3330
|
return this.#column();
|
|
3136
3331
|
}
|
|
3137
3332
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3138
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.6", type: GridColumnComponent, isStandalone: true, selector: "mona-grid-column", inputs: { aggregate: { classPropertyName: "aggregate", publicName: "aggregate", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: false, transformFunction: null }, filterable: { classPropertyName: "filterable", publicName: "filterable", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, hidden: { classPropertyName: "hidden", publicName: "hidden", isSignal: true, isRequired: false, transformFunction: null }, locked: { classPropertyName: "locked", publicName: "locked", isSignal: true, isRequired: false, transformFunction: null }, lockedPosition: { classPropertyName: "lockedPosition", publicName: "lockedPosition", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, stateKey: { classPropertyName: "stateKey", publicName: "stateKey", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: GRID_COLUMN_DEFINITION, useExisting: forwardRef(() => GridColumnComponent) }], queries: [{ propertyName: "cellTemplate", first: true, predicate: GridCellTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "editTemplate", first: true, predicate: GridEditTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: GridFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupFooterTemplate", first: true, predicate: GridGroupFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: GridHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "titleTemplate", first: true, predicate: GridColumnTitleTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3333
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.6", type: GridColumnComponent, isStandalone: true, selector: "mona-grid-column", inputs: { aggregate: { classPropertyName: "aggregate", publicName: "aggregate", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: false, transformFunction: null }, filterable: { classPropertyName: "filterable", publicName: "filterable", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, hidden: { classPropertyName: "hidden", publicName: "hidden", isSignal: true, isRequired: false, transformFunction: null }, locked: { classPropertyName: "locked", publicName: "locked", isSignal: true, isRequired: false, transformFunction: null }, lockedPosition: { classPropertyName: "lockedPosition", publicName: "lockedPosition", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, sortable: { classPropertyName: "sortable", publicName: "sortable", isSignal: true, isRequired: false, transformFunction: null }, stateKey: { classPropertyName: "stateKey", publicName: "stateKey", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: GRID_COLUMN_DEFINITION, useExisting: forwardRef(() => GridColumnComponent) }], queries: [{ propertyName: "cellTemplate", first: true, predicate: GridCellTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "editTemplate", first: true, predicate: GridEditTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: GridFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupFooterTemplate", first: true, predicate: GridGroupFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: GridHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "titleTemplate", first: true, predicate: GridColumnTitleTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3139
3334
|
}
|
|
3140
3335
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridColumnComponent, decorators: [{
|
|
3141
3336
|
type: Component,
|
|
@@ -3145,7 +3340,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
3145
3340
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3146
3341
|
providers: [{ provide: GRID_COLUMN_DEFINITION, useExisting: forwardRef(() => GridColumnComponent) }]
|
|
3147
3342
|
}]
|
|
3148
|
-
}], propDecorators: { cellTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridCellTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], editTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridEditTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], footerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], groupFooterTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridGroupFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridHeaderTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], titleTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridColumnTitleTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], aggregate: [{ type: i0.Input, args: [{ isSignal: true, alias: "aggregate", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: false }] }], filterable: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterable", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], hidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidden", required: false }] }], locked: [{ type: i0.Input, args: [{ isSignal: true, alias: "locked", required: false }] }], lockedPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "lockedPosition", required: false }] }], maxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxWidth", required: false }] }], minWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minWidth", required: false }] }], stateKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "stateKey", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }] } });
|
|
3343
|
+
}], propDecorators: { cellTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridCellTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], editTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridEditTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], footerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], groupFooterTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridGroupFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridHeaderTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], titleTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridColumnTitleTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], aggregate: [{ type: i0.Input, args: [{ isSignal: true, alias: "aggregate", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: false }] }], filterable: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterable", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], hidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidden", required: false }] }], locked: [{ type: i0.Input, args: [{ isSignal: true, alias: "locked", required: false }] }], lockedPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "lockedPosition", required: false }] }], maxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxWidth", required: false }] }], minWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minWidth", required: false }] }], sortable: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortable", required: false }] }], stateKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "stateKey", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }] } });
|
|
3149
3344
|
|
|
3150
3345
|
class GridColumnResizeHandlerDirective {
|
|
3151
3346
|
#destroyRef;
|
|
@@ -3451,8 +3646,12 @@ class GridNavigationService {
|
|
|
3451
3646
|
this.#setFocusedCell(key, data);
|
|
3452
3647
|
}
|
|
3453
3648
|
}
|
|
3454
|
-
unregisterCell(cellKey) {
|
|
3649
|
+
unregisterCell(cellKey, element) {
|
|
3455
3650
|
const data = this.#cellElementDict().get(cellKey);
|
|
3651
|
+
// A cached view may be destroyed after another view has taken over this logical identity.
|
|
3652
|
+
if (!data || (element != null && data.element !== element)) {
|
|
3653
|
+
return;
|
|
3654
|
+
}
|
|
3456
3655
|
this.#cellElementDict.update(dict => dict.remove(cellKey));
|
|
3457
3656
|
if (this.#lastFocusedCellKey() !== cellKey) {
|
|
3458
3657
|
return;
|
|
@@ -3699,7 +3898,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
3699
3898
|
type: Injectable
|
|
3700
3899
|
}] });
|
|
3701
3900
|
|
|
3702
|
-
const
|
|
3901
|
+
const gridRowMinHeightClass = "min-h-9";
|
|
3902
|
+
const gridVirtualRowHeightClass = "h-(--mona-grid-row-height) min-h-(--mona-grid-row-height) max-h-(--mona-grid-row-height)";
|
|
3703
3903
|
const gridBaseThemeVariants = cva(`
|
|
3704
3904
|
relative flex flex-col
|
|
3705
3905
|
h-full overflow-hidden
|
|
@@ -3715,24 +3915,34 @@ const gridBaseThemeVariants = cva(`
|
|
|
3715
3915
|
}
|
|
3716
3916
|
}
|
|
3717
3917
|
});
|
|
3718
|
-
const gridCellBaseThemeVariants = cva(
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3918
|
+
const gridCellBaseThemeVariants = cva("flex w-full min-w-0", {
|
|
3919
|
+
variants: {
|
|
3920
|
+
virtual: {
|
|
3921
|
+
true: "absolute inset-0 overflow-hidden",
|
|
3922
|
+
false: `relative ${gridRowMinHeightClass}`
|
|
3923
|
+
}
|
|
3924
|
+
},
|
|
3925
|
+
defaultVariants: { virtual: false }
|
|
3926
|
+
});
|
|
3722
3927
|
const gridCellContainerThemeVariants = cva(`
|
|
3723
|
-
flex
|
|
3928
|
+
flex w-full min-w-0 items-center
|
|
3724
3929
|
flex-1 outline-none
|
|
3725
|
-
overflow-hidden
|
|
3726
3930
|
`, {
|
|
3727
3931
|
variants: {
|
|
3932
|
+
virtual: {
|
|
3933
|
+
true: "h-full overflow-hidden",
|
|
3934
|
+
false: gridRowMinHeightClass
|
|
3935
|
+
},
|
|
3728
3936
|
editing: {
|
|
3729
3937
|
true: "px-0",
|
|
3730
3938
|
false: "px-2"
|
|
3731
3939
|
}
|
|
3732
3940
|
},
|
|
3733
3941
|
defaultVariants: {
|
|
3734
|
-
editing: false
|
|
3735
|
-
|
|
3942
|
+
editing: false,
|
|
3943
|
+
virtual: false
|
|
3944
|
+
},
|
|
3945
|
+
compoundVariants: [{ virtual: false, editing: false, class: "py-1" }]
|
|
3736
3946
|
});
|
|
3737
3947
|
const gridCellDirtyIndicatorThemeVariants = cva(`
|
|
3738
3948
|
absolute top-0 end-0 w-0 h-0
|
|
@@ -3741,23 +3951,30 @@ const gridCellDirtyIndicatorThemeVariants = cva(`
|
|
|
3741
3951
|
pointer-events-none
|
|
3742
3952
|
`);
|
|
3743
3953
|
const gridCellEditorBaseThemeVariants = cva(`
|
|
3744
|
-
flex
|
|
3954
|
+
flex w-full min-w-0 items-center
|
|
3745
3955
|
bg-input-background border border-focus-indicator/40
|
|
3746
|
-
|
|
3956
|
+
`, {
|
|
3957
|
+
variants: { virtual: { true: "h-full overflow-hidden", false: gridRowMinHeightClass } },
|
|
3958
|
+
defaultVariants: { virtual: false }
|
|
3959
|
+
});
|
|
3747
3960
|
const gridCellEditorInputThemeVariants = cva(`
|
|
3748
|
-
|
|
3961
|
+
w-full border-transparent
|
|
3749
3962
|
data-[expanded='true']:border-focus-indicator
|
|
3750
3963
|
data-[expanded='true']:focus-within:border-focus-indicator/40
|
|
3751
|
-
|
|
3964
|
+
`, {
|
|
3965
|
+
variants: { virtual: { true: "h-full", false: "min-h-8" } },
|
|
3966
|
+
defaultVariants: { virtual: false }
|
|
3967
|
+
});
|
|
3752
3968
|
const gridCellTextThemeVariants = cva(`
|
|
3753
3969
|
truncate cursor-default select-none
|
|
3754
3970
|
`);
|
|
3755
3971
|
const gridSelectAllCellThemeVariants = cva(`
|
|
3756
3972
|
absolute inset-0 flex h-full w-full items-center justify-center
|
|
3757
3973
|
`);
|
|
3758
|
-
const gridSelectionCellThemeVariants = cva(
|
|
3759
|
-
absolute inset-0
|
|
3760
|
-
|
|
3974
|
+
const gridSelectionCellThemeVariants = cva("flex w-full items-center justify-center", {
|
|
3975
|
+
variants: { virtual: { true: "absolute inset-0 h-full", false: gridRowMinHeightClass } },
|
|
3976
|
+
defaultVariants: { virtual: false }
|
|
3977
|
+
});
|
|
3761
3978
|
const gridColumnActionsThemeVariants = cva(`
|
|
3762
3979
|
flex items-center justify-center
|
|
3763
3980
|
text-xs [&_i]:text-xs
|
|
@@ -3794,7 +4011,7 @@ const gridDetailIndentCellThemeVariants = cva(`
|
|
|
3794
4011
|
});
|
|
3795
4012
|
const gridDetailRowThemeVariants = cva(``);
|
|
3796
4013
|
const gridRowReorderHandleThemeVariants = cva(`
|
|
3797
|
-
flex h-
|
|
4014
|
+
flex min-h-9 w-full items-center justify-center
|
|
3798
4015
|
cursor-grab select-none touch-none
|
|
3799
4016
|
text-muted-foreground
|
|
3800
4017
|
hover:text-foreground
|
|
@@ -3827,7 +4044,10 @@ const gridFooterThemeVariants = cva(`
|
|
|
3827
4044
|
const gridFooterTableThemeVariants = cva(`
|
|
3828
4045
|
border-separate border-spacing-0 table-fixed
|
|
3829
4046
|
`);
|
|
3830
|
-
const gridFooterTableRowThemeVariants = cva(`relative inline-flex [&>td:last-child]:border-e-0
|
|
4047
|
+
const gridFooterTableRowThemeVariants = cva(`relative inline-flex [&>td:last-child]:border-e-0`, {
|
|
4048
|
+
variants: { virtual: { true: `${gridVirtualRowHeightClass} overflow-hidden`, false: "" } },
|
|
4049
|
+
defaultVariants: { virtual: false }
|
|
4050
|
+
});
|
|
3831
4051
|
const gridFooterTableCellThemeVariants = cva(`
|
|
3832
4052
|
relative overflow-hidden
|
|
3833
4053
|
text-start align-middle px-2 py-2
|
|
@@ -3847,7 +4067,7 @@ const gridGroupRowThemeVariants = cva(`
|
|
|
3847
4067
|
relative z-10
|
|
3848
4068
|
w-full
|
|
3849
4069
|
bg-surface-muted border-e border-e-border-subtle
|
|
3850
|
-
|
|
4070
|
+
`, { variants: { virtual: { true: gridVirtualRowHeightClass, false: "" } }, defaultVariants: { virtual: false } });
|
|
3851
4071
|
const gridHeaderThemeVariants = cva(`
|
|
3852
4072
|
flex flex-row grow-0 shrink-0 basis-auto
|
|
3853
4073
|
overflow-hidden
|
|
@@ -3882,7 +4102,7 @@ const gridListBaseThemeVariants = cva(`
|
|
|
3882
4102
|
variants: {
|
|
3883
4103
|
virtual: {
|
|
3884
4104
|
true: "overflow-x-hidden overflow-y-hidden flex flex-col min-h-0",
|
|
3885
|
-
false: "overflow-x-auto overflow-y-scroll"
|
|
4105
|
+
false: "block overflow-x-auto overflow-y-scroll"
|
|
3886
4106
|
}
|
|
3887
4107
|
}
|
|
3888
4108
|
});
|
|
@@ -3895,24 +4115,25 @@ const gridListTableRowThemeVariants = cva(``, {
|
|
|
3895
4115
|
variants: {
|
|
3896
4116
|
selected: {
|
|
3897
4117
|
true: `
|
|
3898
|
-
${gridRowHeightClass}
|
|
3899
4118
|
bg-(--color-selected) text-(--color-selected-foreground) hover:bg-(--color-selected-active)
|
|
3900
4119
|
`,
|
|
3901
|
-
false:
|
|
3902
|
-
}
|
|
3903
|
-
|
|
4120
|
+
false: "bg-surface hover:bg-hover"
|
|
4121
|
+
},
|
|
4122
|
+
virtual: { true: gridVirtualRowHeightClass, false: "" }
|
|
4123
|
+
},
|
|
4124
|
+
defaultVariants: { virtual: false }
|
|
3904
4125
|
});
|
|
3905
4126
|
const gridListTableCellThemeVariants = cva(`
|
|
3906
4127
|
relative
|
|
3907
|
-
${gridRowHeightClass}
|
|
3908
4128
|
outline-none z-1
|
|
3909
|
-
align-
|
|
4129
|
+
align-middle
|
|
3910
4130
|
border-b border-b-border-subtle
|
|
3911
4131
|
after:content-[''] after:block
|
|
3912
4132
|
after:absolute after:inset-0 after:pointer-events-none
|
|
3913
4133
|
focus:after:ring-1 focus:after:ring-inset focus:after:ring-focus-indicator/35
|
|
3914
4134
|
`, {
|
|
3915
4135
|
variants: {
|
|
4136
|
+
virtual: { true: gridVirtualRowHeightClass, false: "" },
|
|
3916
4137
|
groupHeader: {
|
|
3917
4138
|
true: "",
|
|
3918
4139
|
false: ""
|
|
@@ -3946,6 +4167,7 @@ const gridListTableCellThemeVariants = cva(`
|
|
|
3946
4167
|
false: ""
|
|
3947
4168
|
}
|
|
3948
4169
|
},
|
|
4170
|
+
defaultVariants: { virtual: false },
|
|
3949
4171
|
compoundVariants: [
|
|
3950
4172
|
{
|
|
3951
4173
|
grouped: false,
|
|
@@ -4056,6 +4278,7 @@ class GridLogicalCellDirective {
|
|
|
4056
4278
|
return "";
|
|
4057
4279
|
}
|
|
4058
4280
|
return gridListTableCellThemeVariants({
|
|
4281
|
+
virtual: this.#gridService.virtualScrollOptions().enabled,
|
|
4059
4282
|
groupHeader: this.groupHeader(),
|
|
4060
4283
|
lastInRow: this.lastInRow() || this.groupHeader()
|
|
4061
4284
|
});
|
|
@@ -4117,18 +4340,24 @@ class GridLogicalCellDirective {
|
|
|
4117
4340
|
...(ngDevMode ? [undefined, { debugName: "rowUid" }] : /* istanbul ignore next */ []));
|
|
4118
4341
|
this.section = input(null, /* @ts-ignore */
|
|
4119
4342
|
...(ngDevMode ? [{ debugName: "section" }] : /* istanbul ignore next */ []));
|
|
4120
|
-
this.
|
|
4343
|
+
this.toggleExpand = output();
|
|
4121
4344
|
afterRenderEffect({
|
|
4122
4345
|
read: () => {
|
|
4123
|
-
const
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
this.#
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4346
|
+
const data = this.#cellData();
|
|
4347
|
+
// Cached virtual views must not re-register in response to another view's registry writes.
|
|
4348
|
+
untracked(() => {
|
|
4349
|
+
const previousCellKey = this.#cellKey();
|
|
4350
|
+
const nextCellKey = this.#gridNavigationService.registerCell(data);
|
|
4351
|
+
if (previousCellKey && previousCellKey !== nextCellKey) {
|
|
4352
|
+
this.#gridNavigationService.unregisterCell(previousCellKey, data.element);
|
|
4353
|
+
}
|
|
4354
|
+
this.#cellKey.set(nextCellKey);
|
|
4355
|
+
});
|
|
4130
4356
|
}
|
|
4131
4357
|
});
|
|
4358
|
+
afterEveryRender({
|
|
4359
|
+
mixedReadWrite: () => this.#syncInnerFocusableTabIndexes()
|
|
4360
|
+
});
|
|
4132
4361
|
afterNextRender({
|
|
4133
4362
|
read: () => {
|
|
4134
4363
|
this.#setCellCopySubscription();
|
|
@@ -4140,7 +4369,7 @@ class GridLogicalCellDirective {
|
|
|
4140
4369
|
if (!cellKey) {
|
|
4141
4370
|
return;
|
|
4142
4371
|
}
|
|
4143
|
-
this.#gridNavigationService.unregisterCell(cellKey);
|
|
4372
|
+
this.#gridNavigationService.unregisterCell(cellKey, this.#hostElementRef.nativeElement);
|
|
4144
4373
|
});
|
|
4145
4374
|
}
|
|
4146
4375
|
focusNextPageTabTarget(backwards) {
|
|
@@ -4184,6 +4413,7 @@ class GridLogicalCellDirective {
|
|
|
4184
4413
|
const host = this.#hostElementRef.nativeElement;
|
|
4185
4414
|
const targets = Array.from(host.ownerDocument.querySelectorAll(FOCUSABLE_TARGET_SELECTOR$1));
|
|
4186
4415
|
return targets.filter(target => target !== host &&
|
|
4416
|
+
!target.matches("mona-grid tbody[role='rowgroup']") &&
|
|
4187
4417
|
target.getAttribute("tabindex") !== "-1" &&
|
|
4188
4418
|
!this.#isElementDisabled(target) &&
|
|
4189
4419
|
!this.#isElementHidden(target));
|
|
@@ -4230,8 +4460,8 @@ class GridLogicalCellDirective {
|
|
|
4230
4460
|
return this.#gridNavigationService.navigate(cellKey, navigationKey);
|
|
4231
4461
|
}
|
|
4232
4462
|
#onEnterKey() {
|
|
4233
|
-
if (this.groupHeader() || this.resolvedSection() === "header") {
|
|
4234
|
-
this.
|
|
4463
|
+
if (this.groupHeader() || this.resolvedSection() === "header" || this.resolvedCellKind() === "detail") {
|
|
4464
|
+
this.toggleExpand.emit();
|
|
4235
4465
|
return;
|
|
4236
4466
|
}
|
|
4237
4467
|
if (this.resolvedCellKind() === "command") {
|
|
@@ -4280,7 +4510,7 @@ class GridLogicalCellDirective {
|
|
|
4280
4510
|
}
|
|
4281
4511
|
if (event.key === "ArrowDown") {
|
|
4282
4512
|
if (event.altKey) {
|
|
4283
|
-
this.
|
|
4513
|
+
this.toggleExpand.emit();
|
|
4284
4514
|
event.preventDefault();
|
|
4285
4515
|
return;
|
|
4286
4516
|
}
|
|
@@ -4343,11 +4573,13 @@ class GridLogicalCellDirective {
|
|
|
4343
4573
|
}
|
|
4344
4574
|
#syncInnerFocusableTabIndexes() {
|
|
4345
4575
|
for (const target of this.#getInnerFocusableTargets()) {
|
|
4346
|
-
target.
|
|
4576
|
+
if (target.getAttribute("tabindex") !== "-1") {
|
|
4577
|
+
target.setAttribute("tabindex", "-1");
|
|
4578
|
+
}
|
|
4347
4579
|
}
|
|
4348
4580
|
}
|
|
4349
4581
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridLogicalCellDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4350
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: GridLogicalCellDirective, isStandalone: true, selector: "td[monaGridLogicalCell], th[monaGridLogicalCell]", inputs: { cellKind: { classPropertyName: "cellKind", publicName: "cellKind", isSignal: true, isRequired: false, transformFunction: null }, colIndex: { classPropertyName: "colIndex", publicName: "colIndex", isSignal: true, isRequired: true, transformFunction: null }, columnId: { classPropertyName: "columnId", publicName: "columnId", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, firstInRow: { classPropertyName: "firstInRow", publicName: "firstInRow", isSignal: true, isRequired: true, transformFunction: null }, groupHeader: { classPropertyName: "groupHeader", publicName: "groupHeader", isSignal: true, isRequired: false, transformFunction: null }, groupKey: { classPropertyName: "groupKey", publicName: "groupKey", isSignal: true, isRequired: false, transformFunction: null }, lastInRow: { classPropertyName: "lastInRow", publicName: "lastInRow", isSignal: true, isRequired: true, transformFunction: null }, rowIndex: { classPropertyName: "rowIndex", publicName: "rowIndex", isSignal: true, isRequired: true, transformFunction: null }, rowUid: { classPropertyName: "rowUid", publicName: "rowUid", isSignal: true, isRequired: false, transformFunction: null }, section: { classPropertyName: "section", publicName: "section", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { edit: "edit",
|
|
4582
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: GridLogicalCellDirective, isStandalone: true, selector: "td[monaGridLogicalCell], th[monaGridLogicalCell]", inputs: { cellKind: { classPropertyName: "cellKind", publicName: "cellKind", isSignal: true, isRequired: false, transformFunction: null }, colIndex: { classPropertyName: "colIndex", publicName: "colIndex", isSignal: true, isRequired: true, transformFunction: null }, columnId: { classPropertyName: "columnId", publicName: "columnId", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, firstInRow: { classPropertyName: "firstInRow", publicName: "firstInRow", isSignal: true, isRequired: true, transformFunction: null }, groupHeader: { classPropertyName: "groupHeader", publicName: "groupHeader", isSignal: true, isRequired: false, transformFunction: null }, groupKey: { classPropertyName: "groupKey", publicName: "groupKey", isSignal: true, isRequired: false, transformFunction: null }, lastInRow: { classPropertyName: "lastInRow", publicName: "lastInRow", isSignal: true, isRequired: true, transformFunction: null }, rowIndex: { classPropertyName: "rowIndex", publicName: "rowIndex", isSignal: true, isRequired: true, transformFunction: null }, rowUid: { classPropertyName: "rowUid", publicName: "rowUid", isSignal: true, isRequired: false, transformFunction: null }, section: { classPropertyName: "section", publicName: "section", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { edit: "edit", toggleExpand: "toggleExpand" }, host: { properties: { "class": "baseClass()", "attr.tabindex": "focused() ? 0 : -1", "attr.aria-colindex": "ariaColIndex()", "attr.aria-readonly": "resolvedCellKind() === 'data' ? !editable() : null" } }, ngImport: i0 }); }
|
|
4351
4583
|
}
|
|
4352
4584
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridLogicalCellDirective, decorators: [{
|
|
4353
4585
|
type: Directive,
|
|
@@ -4356,10 +4588,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
4356
4588
|
host: {
|
|
4357
4589
|
"[class]": "baseClass()",
|
|
4358
4590
|
"[attr.tabindex]": "focused() ? 0 : -1",
|
|
4359
|
-
"[attr.aria-colindex]": "ariaColIndex()"
|
|
4591
|
+
"[attr.aria-colindex]": "ariaColIndex()",
|
|
4592
|
+
"[attr.aria-readonly]": "resolvedCellKind() === 'data' ? !editable() : null"
|
|
4360
4593
|
}
|
|
4361
4594
|
}]
|
|
4362
|
-
}], ctorParameters: () => [], propDecorators: { cellKind: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellKind", required: false }] }], colIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "colIndex", required: true }] }], columnId: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnId", required: false }] }], edit: [{ type: i0.Output, args: ["edit"] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], firstInRow: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstInRow", required: true }] }], groupHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupHeader", required: false }] }], groupKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupKey", required: false }] }], lastInRow: [{ type: i0.Input, args: [{ isSignal: true, alias: "lastInRow", required: true }] }], rowIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowIndex", required: true }] }], rowUid: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowUid", required: false }] }], section: [{ type: i0.Input, args: [{ isSignal: true, alias: "section", required: false }] }],
|
|
4595
|
+
}], ctorParameters: () => [], propDecorators: { cellKind: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellKind", required: false }] }], colIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "colIndex", required: true }] }], columnId: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnId", required: false }] }], edit: [{ type: i0.Output, args: ["edit"] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], firstInRow: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstInRow", required: true }] }], groupHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupHeader", required: false }] }], groupKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupKey", required: false }] }], lastInRow: [{ type: i0.Input, args: [{ isSignal: true, alias: "lastInRow", required: true }] }], rowIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowIndex", required: true }] }], rowUid: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowUid", required: false }] }], section: [{ type: i0.Input, args: [{ isSignal: true, alias: "section", required: false }] }], toggleExpand: [{ type: i0.Output, args: ["toggleExpand"] }] } });
|
|
4363
4596
|
|
|
4364
4597
|
class ColumnReorderEvent extends PreventableEvent {
|
|
4365
4598
|
#column;
|
|
@@ -4418,6 +4651,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
4418
4651
|
* suitable for rendering by both paginated and virtual-scrolled grid list components.
|
|
4419
4652
|
*/
|
|
4420
4653
|
class GridRowFlattenerService {
|
|
4654
|
+
/**
|
|
4655
|
+
* Builds a deterministic, hierarchical group key.
|
|
4656
|
+
*
|
|
4657
|
+
* @example
|
|
4658
|
+
* buildGroupKey(null, "Country", "USA") // => "Country:USA"
|
|
4659
|
+
* buildGroupKey("Country:USA", "City", "NYC") // => "Country:USA/City:NYC"
|
|
4660
|
+
*/
|
|
4661
|
+
buildGroupKey(parentKey, field, value) {
|
|
4662
|
+
const segment = `${field}:${String(value ?? "")}`;
|
|
4663
|
+
return parentKey != null ? `${parentKey}/${segment}` : segment;
|
|
4664
|
+
}
|
|
4421
4665
|
/**
|
|
4422
4666
|
* Groups rows by the given columns and flattens them into a linear `GridViewRow[]`.
|
|
4423
4667
|
*
|
|
@@ -4425,29 +4669,19 @@ class GridRowFlattenerService {
|
|
|
4425
4669
|
* @param groupColumns - The ordered list of columns to group by.
|
|
4426
4670
|
* @param collapsedKeys - The set of group keys that are currently collapsed.
|
|
4427
4671
|
* @param groupAggregates - The dictionary of group aggregates.
|
|
4672
|
+
* @param orderGroups - Orders buckets by direction. Disable for client rows already ordered by Query.
|
|
4428
4673
|
* @returns A flat array of `GridViewRow` items.
|
|
4429
4674
|
*/
|
|
4430
|
-
flatten(rows, groupColumns, collapsedKeys, showFooter, groupAggregates = new Dictionary()) {
|
|
4675
|
+
flatten(rows, groupColumns, collapsedKeys, showFooter, groupAggregates = new Dictionary(), orderGroups = true) {
|
|
4431
4676
|
const columnArray = [...groupColumns];
|
|
4432
4677
|
if (columnArray.length === 0) {
|
|
4433
4678
|
return [];
|
|
4434
4679
|
}
|
|
4435
4680
|
const result = [];
|
|
4436
|
-
this.#flattenRecursive([...rows], columnArray, groupAggregates, 0, null, collapsedKeys, showFooter, result);
|
|
4681
|
+
this.#flattenRecursive([...rows], columnArray, groupAggregates, 0, null, collapsedKeys, showFooter, orderGroups, result);
|
|
4437
4682
|
return result;
|
|
4438
4683
|
}
|
|
4439
|
-
|
|
4440
|
-
* Builds a deterministic, hierarchical group key.
|
|
4441
|
-
*
|
|
4442
|
-
* @example
|
|
4443
|
-
* buildGroupKey(null, "Country", "USA") // => "Country:USA"
|
|
4444
|
-
* buildGroupKey("Country:USA", "City", "NYC") // => "Country:USA/City:NYC"
|
|
4445
|
-
*/
|
|
4446
|
-
buildGroupKey(parentKey, field, value) {
|
|
4447
|
-
const segment = `${field}:${String(value ?? "")}`;
|
|
4448
|
-
return parentKey != null ? `${parentKey}/${segment}` : segment;
|
|
4449
|
-
}
|
|
4450
|
-
#flattenRecursive(rows, groupColumns, groupAggregates, depth, parentKey, collapsedKeys, showFooter, result) {
|
|
4684
|
+
#flattenRecursive(rows, groupColumns, groupAggregates, depth, parentKey, collapsedKeys, showFooter, orderGroups, result) {
|
|
4451
4685
|
const column = groupColumns[depth];
|
|
4452
4686
|
if (column == null) {
|
|
4453
4687
|
return;
|
|
@@ -4465,7 +4699,15 @@ class GridRowFlattenerService {
|
|
|
4465
4699
|
}
|
|
4466
4700
|
groupMap.get(mapKey).push(row);
|
|
4467
4701
|
}
|
|
4468
|
-
|
|
4702
|
+
const entries = keyOrder.map((mapKey, index) => ({ mapKey, index, rows: groupMap.get(mapKey) }));
|
|
4703
|
+
const direction = column.groupSortDirection;
|
|
4704
|
+
if (orderGroups && direction != null) {
|
|
4705
|
+
entries.sort((left, right) => {
|
|
4706
|
+
const comparison = compareGridComparableValues(toGridComparableValue(left.rows[0].data[field]), toGridComparableValue(right.rows[0].data[field]));
|
|
4707
|
+
return (direction === "asc" ? comparison : -comparison) || left.index - right.index;
|
|
4708
|
+
});
|
|
4709
|
+
}
|
|
4710
|
+
for (const { mapKey } of entries) {
|
|
4469
4711
|
const groupRows = groupMap.get(mapKey);
|
|
4470
4712
|
const groupValue = groupRows[0].data[field];
|
|
4471
4713
|
const groupKey = this.buildGroupKey(parentKey, field, groupValue);
|
|
@@ -4482,7 +4724,7 @@ class GridRowFlattenerService {
|
|
|
4482
4724
|
const isCollapsed = collapsedKeys.has(groupKey);
|
|
4483
4725
|
if (!isCollapsed) {
|
|
4484
4726
|
if (depth < groupColumns.length - 1) {
|
|
4485
|
-
this.#flattenRecursive(groupRows, groupColumns, groupAggregates, depth + 1, groupKey, collapsedKeys, showFooter, result);
|
|
4727
|
+
this.#flattenRecursive(groupRows, groupColumns, groupAggregates, depth + 1, groupKey, collapsedKeys, showFooter, orderGroups, result);
|
|
4486
4728
|
}
|
|
4487
4729
|
else {
|
|
4488
4730
|
for (const row of groupRows) {
|
|
@@ -4688,7 +4930,13 @@ class GridFilterRowCellComponent {
|
|
|
4688
4930
|
return gridFilterRowCellThemeVariants();
|
|
4689
4931
|
}, /* @ts-ignore */
|
|
4690
4932
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
4691
|
-
this.
|
|
4933
|
+
this.booleanFilterMenuItems = this.#filterService.booleanFilterMenuItems;
|
|
4934
|
+
this.booleanValue = signal(null, /* @ts-ignore */
|
|
4935
|
+
...(ngDevMode ? [{ debugName: "booleanValue" }] : /* istanbul ignore next */ []));
|
|
4936
|
+
this.dateFilterMenuItems = this.#filterService.dateFilterMenuItems;
|
|
4937
|
+
this.dateValue = signal(null, /* @ts-ignore */
|
|
4938
|
+
...(ngDevMode ? [{ debugName: "dateValue" }] : /* istanbul ignore next */ []));
|
|
4939
|
+
this.filterMessages = inject(MonaI18nService).componentMessages("filter", FILTER_DEFAULT_MESSAGES);
|
|
4692
4940
|
this.isFilterActive = computed(() => {
|
|
4693
4941
|
const op = this.selectedOperator();
|
|
4694
4942
|
if (op === "isnull" || op === "isnotnull") {
|
|
@@ -4712,12 +4960,7 @@ class GridFilterRowCellComponent {
|
|
|
4712
4960
|
}
|
|
4713
4961
|
}, /* @ts-ignore */
|
|
4714
4962
|
...(ngDevMode ? [{ debugName: "isFilterActive" }] : /* istanbul ignore next */ []));
|
|
4715
|
-
this.
|
|
4716
|
-
this.booleanValue = signal(null, /* @ts-ignore */
|
|
4717
|
-
...(ngDevMode ? [{ debugName: "booleanValue" }] : /* istanbul ignore next */ []));
|
|
4718
|
-
this.dateFilterMenuItems = this.#filterService.dateFilterMenuItems;
|
|
4719
|
-
this.dateValue = signal(null, /* @ts-ignore */
|
|
4720
|
-
...(ngDevMode ? [{ debugName: "dateValue" }] : /* istanbul ignore next */ []));
|
|
4963
|
+
this.messages = this.#gridService.messages;
|
|
4721
4964
|
this.numberValue = signal(null, /* @ts-ignore */
|
|
4722
4965
|
...(ngDevMode ? [{ debugName: "numberValue" }] : /* istanbul ignore next */ []));
|
|
4723
4966
|
this.numericFilterMenuItems = this.#filterService.numericFilterMenuItems;
|
|
@@ -4802,7 +5045,7 @@ class GridFilterRowCellComponent {
|
|
|
4802
5045
|
const operator = this.selectedOperator();
|
|
4803
5046
|
const field = this.column().field;
|
|
4804
5047
|
let filter;
|
|
4805
|
-
|
|
5048
|
+
const filterOperator = operator;
|
|
4806
5049
|
switch (this.column().dataType) {
|
|
4807
5050
|
case "string":
|
|
4808
5051
|
filter = this.#filterService.buildStringFilterDescriptor({
|
|
@@ -4878,11 +5121,12 @@ class GridFilterRowCellComponent {
|
|
|
4878
5121
|
this.selectedOperator.set(v.operator1);
|
|
4879
5122
|
this.dateValue.set(v.value1 ?? null);
|
|
4880
5123
|
break;
|
|
4881
|
-
case "boolean":
|
|
5124
|
+
case "boolean": {
|
|
4882
5125
|
this.selectedOperator.set(v.operator1);
|
|
4883
5126
|
const item = this.booleanFilterMenuItems.find(i => i.value === v.operator1) ?? null;
|
|
4884
5127
|
this.booleanValue.set(item);
|
|
4885
5128
|
break;
|
|
5129
|
+
}
|
|
4886
5130
|
}
|
|
4887
5131
|
}
|
|
4888
5132
|
#setValueChangeSubscriptions() {
|
|
@@ -4904,7 +5148,7 @@ class GridFilterRowCellComponent {
|
|
|
4904
5148
|
});
|
|
4905
5149
|
}
|
|
4906
5150
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridFilterRowCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4907
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridFilterRowCellComponent, isStandalone: true, selector: "mona-grid-filter-row-cell", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { apply: "apply" }, host: { properties: { "class": "baseClass()" } }, ngImport: i0, template: "@let dataType = column().dataType;\n\n@switch (dataType) {\n @case (\"string\") {\n <div class=\"flex gap-0.5 w-full\">\n <mona-text-box\n size=\"small\"\n [ngModel]=\"stringValue()\"\n (ngModelChange)=\"onStringChange($event)\"\n [placeholder]=\"messages().filterPlaceholder\" />\n <button
|
|
5151
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridFilterRowCellComponent, isStandalone: true, selector: "mona-grid-filter-row-cell", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { apply: "apply" }, host: { properties: { "class": "baseClass()" } }, ngImport: i0, template: "@let dataType = column().dataType;\n\n@switch (dataType) {\n @case (\"string\") {\n <div class=\"flex gap-0.5 w-full\">\n <mona-text-box\n size=\"small\"\n [inputAttributes]=\"{ 'aria-label': messages().filterByColumn(column().title) }\"\n [ngModel]=\"stringValue()\"\n (ngModelChange)=\"onStringChange($event)\"\n [placeholder]=\"messages().filterPlaceholder\" />\n <button\n monaButton\n look=\"ghost\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n #filterButton\n [attr.aria-label]=\"messages().filterByColumn(column().title)\">\n <svg lucideFunnel [size]=\"14\" [class.text-info]=\"isFilterActive()\"></svg>\n </button>\n <ng-container\n *ngTemplateOutlet=\"clearFilterButtonTemplate; context: { $implicit: isFilterActive() }\"></ng-container>\n </div>\n <mona-popup-menu [target]=\"filterButton\" [size]=\"'small'\">\n @for (item of stringFilterMenuItems; track item) {\n <mona-popup-menu-checkbox-item\n size=\"small\"\n [label]=\"item.text\"\n (menuClick)=\"onOperatorChange(item.value)\"\n [checked]=\"selectedOperator() === item.value\"></mona-popup-menu-checkbox-item>\n }\n </mona-popup-menu>\n }\n @case (\"number\") {\n <div class=\"flex gap-0.5 w-full\">\n <mona-numeric-text-box\n size=\"small\"\n [aria-label]=\"messages().filterByColumn(column().title)\"\n [ngModel]=\"numberValue()\"\n (ngModelChange)=\"onNumberChange($event)\"\n [style.width.%]=\"100\" />\n\n <button\n monaButton\n look=\"ghost\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n #filterButton\n [attr.aria-label]=\"messages().filterByColumn(column().title)\">\n <svg lucideFunnel [size]=\"14\" [class.text-info]=\"isFilterActive()\"></svg>\n </button>\n <mona-popup-menu [target]=\"filterButton\" [size]=\"'small'\">\n @for (item of numericFilterMenuItems; track item) {\n <mona-popup-menu-checkbox-item\n size=\"small\"\n [label]=\"item.text\"\n (menuClick)=\"onOperatorChange(item.value)\"\n [checked]=\"selectedOperator() === item.value\"></mona-popup-menu-checkbox-item>\n }\n </mona-popup-menu>\n <ng-container\n *ngTemplateOutlet=\"clearFilterButtonTemplate; context: { $implicit: isFilterActive() }\"></ng-container>\n </div>\n }\n @case (\"date\") {\n <div class=\"flex gap-0.5 w-full\">\n @if (dataType === \"date\") {\n <mona-date-picker\n size=\"small\"\n [ngModel]=\"dateValue()\"\n (ngModelChange)=\"onDateChange($event)\"\n [style.width.%]=\"100\" />\n }\n <button\n monaButton\n look=\"ghost\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n #filterButton\n [attr.aria-label]=\"messages().filterByColumn(column().title)\">\n <svg lucideFunnel [size]=\"14\" [class.text-info]=\"isFilterActive()\"></svg>\n </button>\n <ng-container\n *ngTemplateOutlet=\"clearFilterButtonTemplate; context: { $implicit: isFilterActive() }\"></ng-container>\n </div>\n <mona-popup-menu [target]=\"filterButton\" [size]=\"'small'\">\n @for (item of dateFilterMenuItems; track item) {\n <mona-popup-menu-checkbox-item\n size=\"small\"\n [label]=\"item.text\"\n (menuClick)=\"onOperatorChange(item.value)\"\n [checked]=\"selectedOperator() === item.value\"></mona-popup-menu-checkbox-item>\n }\n </mona-popup-menu>\n }\n @case (\"boolean\") {\n <div class=\"flex gap-0.5 w-full\">\n <mona-dropdown-list\n size=\"small\"\n [data]=\"booleanFilterMenuItems\"\n textField=\"text\"\n valueField=\"value\"\n [placeholder]=\"messages().all\"\n [aria-label]=\"messages().filterByColumn(column().title)\"\n [ngModel]=\"booleanValue()\"\n (ngModelChange)=\"onBooleanChange($event)\"\n [style.width.%]=\"100\" />\n <ng-container\n *ngTemplateOutlet=\"clearFilterButtonTemplate; context: { $implicit: isFilterActive() }\"></ng-container>\n </div>\n }\n}\n\n<ng-template #clearFilterButtonTemplate let-hasValue>\n @if (selectedOperator() != null && hasValue) {\n <button\n monaButton\n look=\"ghost\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n (click)=\"onClear()\"\n [attr.aria-label]=\"filterMessages().clear\">\n <svg lucideFunnelX [size]=\"14\" class=\"text-error\"></svg>\n </button>\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: TextBoxComponent, selector: "mona-text-box", inputs: ["clearButton", "disabled", "inputAttributes", "inputClass", "inputStyle", "invalid", "placeholder", "readonly", "required", "rounded", "size", "touched", "type", "class", "value"], outputs: ["inputBlur", "inputFocus", "touch", "valueChange"] }, { kind: "component", type: NumericTextBoxComponent, selector: "mona-numeric-text-box", inputs: ["aria-label", "decimals", "disabled", "formatter", "invalid", "maxValue", "minValue", "nullable", "readonly", "required", "rounded", "size", "spinners", "step", "tabindex", "touched", "class", "value"], outputs: ["inputBlur", "inputFocus", "inputFocusOut", "touch", "valueChange"] }, { kind: "component", type: DatePickerComponent, selector: "mona-date-picker", inputs: ["disabled", "disabledDates", "firstDay", "format", "invalid", "max", "min", "placeholder", "popupClass", "popupHeight", "popupWidth", "readonly", "readonlyInput", "required", "rounded", "showClearButton", "size", "touched", "class", "value", "weekNumber"], outputs: ["close", "closed", "open", "opened", "touch", "valueChange"] }, { kind: "component", type: DropdownListComponent, selector: "mona-dropdown-list", inputs: ["aria-label", "aria-labelledby", "data", "disabled", "invalid", "itemDisabled", "loading", "placeholder", "popupClass", "popupHeight", "popupWidth", "readonly", "required", "rounded", "showClearButton", "size", "textField", "touched", "class", "value", "valueField", "valuePrimitive"], outputs: ["close", "closed", "disabledChange", "open", "opened", "touch", "valueChange"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: PopupMenuComponent, selector: "mona-popup-menu", inputs: ["anchor", "anchorConnectionPoint", "items", "id", "minWidth", "offset", "popupConnectionPoint", "precise", "rounded", "size", "target", "trigger", "width", "class"], outputs: ["close", "menuClick", "navigate", "open"] }, { kind: "component", type: PopupMenuCheckboxItemComponent, selector: "mona-popup-menu-checkbox-item", inputs: ["checked", "disabled", "label"], outputs: ["checkedChange", "menuClick"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LucideFunnelX, selector: "svg[lucideFunnelX], svg[lucideFilterX]" }, { kind: "component", type: LucideFunnel, selector: "svg[lucideFunnel], svg[lucideFilter]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4908
5152
|
}
|
|
4909
5153
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridFilterRowCellComponent, decorators: [{
|
|
4910
5154
|
type: Component,
|
|
@@ -4922,7 +5166,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
4922
5166
|
LucideFunnel
|
|
4923
5167
|
], host: {
|
|
4924
5168
|
"[class]": "baseClass()"
|
|
4925
|
-
}, template: "@let dataType = column().dataType;\n\n@switch (dataType) {\n @case (\"string\") {\n <div class=\"flex gap-0.5 w-full\">\n <mona-text-box\n size=\"small\"\n [ngModel]=\"stringValue()\"\n (ngModelChange)=\"onStringChange($event)\"\n [placeholder]=\"messages().filterPlaceholder\" />\n <button
|
|
5169
|
+
}, template: "@let dataType = column().dataType;\n\n@switch (dataType) {\n @case (\"string\") {\n <div class=\"flex gap-0.5 w-full\">\n <mona-text-box\n size=\"small\"\n [inputAttributes]=\"{ 'aria-label': messages().filterByColumn(column().title) }\"\n [ngModel]=\"stringValue()\"\n (ngModelChange)=\"onStringChange($event)\"\n [placeholder]=\"messages().filterPlaceholder\" />\n <button\n monaButton\n look=\"ghost\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n #filterButton\n [attr.aria-label]=\"messages().filterByColumn(column().title)\">\n <svg lucideFunnel [size]=\"14\" [class.text-info]=\"isFilterActive()\"></svg>\n </button>\n <ng-container\n *ngTemplateOutlet=\"clearFilterButtonTemplate; context: { $implicit: isFilterActive() }\"></ng-container>\n </div>\n <mona-popup-menu [target]=\"filterButton\" [size]=\"'small'\">\n @for (item of stringFilterMenuItems; track item) {\n <mona-popup-menu-checkbox-item\n size=\"small\"\n [label]=\"item.text\"\n (menuClick)=\"onOperatorChange(item.value)\"\n [checked]=\"selectedOperator() === item.value\"></mona-popup-menu-checkbox-item>\n }\n </mona-popup-menu>\n }\n @case (\"number\") {\n <div class=\"flex gap-0.5 w-full\">\n <mona-numeric-text-box\n size=\"small\"\n [aria-label]=\"messages().filterByColumn(column().title)\"\n [ngModel]=\"numberValue()\"\n (ngModelChange)=\"onNumberChange($event)\"\n [style.width.%]=\"100\" />\n\n <button\n monaButton\n look=\"ghost\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n #filterButton\n [attr.aria-label]=\"messages().filterByColumn(column().title)\">\n <svg lucideFunnel [size]=\"14\" [class.text-info]=\"isFilterActive()\"></svg>\n </button>\n <mona-popup-menu [target]=\"filterButton\" [size]=\"'small'\">\n @for (item of numericFilterMenuItems; track item) {\n <mona-popup-menu-checkbox-item\n size=\"small\"\n [label]=\"item.text\"\n (menuClick)=\"onOperatorChange(item.value)\"\n [checked]=\"selectedOperator() === item.value\"></mona-popup-menu-checkbox-item>\n }\n </mona-popup-menu>\n <ng-container\n *ngTemplateOutlet=\"clearFilterButtonTemplate; context: { $implicit: isFilterActive() }\"></ng-container>\n </div>\n }\n @case (\"date\") {\n <div class=\"flex gap-0.5 w-full\">\n @if (dataType === \"date\") {\n <mona-date-picker\n size=\"small\"\n [ngModel]=\"dateValue()\"\n (ngModelChange)=\"onDateChange($event)\"\n [style.width.%]=\"100\" />\n }\n <button\n monaButton\n look=\"ghost\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n #filterButton\n [attr.aria-label]=\"messages().filterByColumn(column().title)\">\n <svg lucideFunnel [size]=\"14\" [class.text-info]=\"isFilterActive()\"></svg>\n </button>\n <ng-container\n *ngTemplateOutlet=\"clearFilterButtonTemplate; context: { $implicit: isFilterActive() }\"></ng-container>\n </div>\n <mona-popup-menu [target]=\"filterButton\" [size]=\"'small'\">\n @for (item of dateFilterMenuItems; track item) {\n <mona-popup-menu-checkbox-item\n size=\"small\"\n [label]=\"item.text\"\n (menuClick)=\"onOperatorChange(item.value)\"\n [checked]=\"selectedOperator() === item.value\"></mona-popup-menu-checkbox-item>\n }\n </mona-popup-menu>\n }\n @case (\"boolean\") {\n <div class=\"flex gap-0.5 w-full\">\n <mona-dropdown-list\n size=\"small\"\n [data]=\"booleanFilterMenuItems\"\n textField=\"text\"\n valueField=\"value\"\n [placeholder]=\"messages().all\"\n [aria-label]=\"messages().filterByColumn(column().title)\"\n [ngModel]=\"booleanValue()\"\n (ngModelChange)=\"onBooleanChange($event)\"\n [style.width.%]=\"100\" />\n <ng-container\n *ngTemplateOutlet=\"clearFilterButtonTemplate; context: { $implicit: isFilterActive() }\"></ng-container>\n </div>\n }\n}\n\n<ng-template #clearFilterButtonTemplate let-hasValue>\n @if (selectedOperator() != null && hasValue) {\n <button\n monaButton\n look=\"ghost\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n (click)=\"onClear()\"\n [attr.aria-label]=\"filterMessages().clear\">\n <svg lucideFunnelX [size]=\"14\" class=\"text-error\"></svg>\n </button>\n }\n</ng-template>\n" }]
|
|
4926
5170
|
}], ctorParameters: () => [], propDecorators: { apply: [{ type: i0.Output, args: ["apply"] }], column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: true }] }] } });
|
|
4927
5171
|
|
|
4928
5172
|
class GridSelectAllCheckboxComponent {
|
|
@@ -5044,19 +5288,18 @@ class GridComponent {
|
|
|
5044
5288
|
this.gridHeaderTableElement = viewChild.required("headerTable", /* @ts-ignore */
|
|
5045
5289
|
...(ngDevMode ? [{ debugName: "gridHeaderTableElement" }] : /* istanbul ignore next */ []));
|
|
5046
5290
|
this.gridService = inject(GridService);
|
|
5047
|
-
this.messages = this.gridService.messages;
|
|
5048
5291
|
this.gridWidthSet = signal(false, /* @ts-ignore */
|
|
5049
5292
|
...(ngDevMode ? [{ debugName: "gridWidthSet" }] : /* istanbul ignore next */ []));
|
|
5050
5293
|
this.groupColumnList = viewChild("groupColumnList", /* @ts-ignore */
|
|
5051
5294
|
...(ngDevMode ? [{ debugName: "groupColumnList" }] : /* istanbul ignore next */ []));
|
|
5052
|
-
this.groupPanelPlaceholderClass = computed(() => {
|
|
5053
|
-
return gridGroupPanelPlaceholderThemeVariants();
|
|
5054
|
-
}, /* @ts-ignore */
|
|
5055
|
-
...(ngDevMode ? [{ debugName: "groupPanelPlaceholderClass" }] : /* istanbul ignore next */ []));
|
|
5056
5295
|
this.groupPanelClass = computed(() => {
|
|
5057
5296
|
return gridGroupPanelThemeVariants();
|
|
5058
5297
|
}, /* @ts-ignore */
|
|
5059
5298
|
...(ngDevMode ? [{ debugName: "groupPanelClass" }] : /* istanbul ignore next */ []));
|
|
5299
|
+
this.groupPanelPlaceholderClass = computed(() => {
|
|
5300
|
+
return gridGroupPanelPlaceholderThemeVariants();
|
|
5301
|
+
}, /* @ts-ignore */
|
|
5302
|
+
...(ngDevMode ? [{ debugName: "groupPanelPlaceholderClass" }] : /* istanbul ignore next */ []));
|
|
5060
5303
|
this.groupPanelPlaceholderVisible = signal(true, /* @ts-ignore */
|
|
5061
5304
|
...(ngDevMode ? [{ debugName: "groupPanelPlaceholderVisible" }] : /* istanbul ignore next */ []));
|
|
5062
5305
|
this.groupable = computed(() => this.gridService.groupableOptions().enabled, /* @ts-ignore */
|
|
@@ -5067,16 +5310,16 @@ class GridComponent {
|
|
|
5067
5310
|
return gridHeaderThemeVariants();
|
|
5068
5311
|
}, /* @ts-ignore */
|
|
5069
5312
|
...(ngDevMode ? [{ debugName: "headerClass" }] : /* istanbul ignore next */ []));
|
|
5070
|
-
this.
|
|
5071
|
-
...(ngDevMode ? [{ debugName: "
|
|
5072
|
-
this.headerTableClass = computed(() => {
|
|
5073
|
-
return gridHeaderTableThemeVariants();
|
|
5074
|
-
}, /* @ts-ignore */
|
|
5075
|
-
...(ngDevMode ? [{ debugName: "headerTableClass" }] : /* istanbul ignore next */ []));
|
|
5313
|
+
this.headerMarginInlineEnd = computed(() => this.gridService.scrollbarGutterWidth(), /* @ts-ignore */
|
|
5314
|
+
...(ngDevMode ? [{ debugName: "headerMarginInlineEnd" }] : /* istanbul ignore next */ []));
|
|
5076
5315
|
this.headerTableCellClass = computed(() => {
|
|
5077
5316
|
return gridHeaderTableCellThemeVariants();
|
|
5078
5317
|
}, /* @ts-ignore */
|
|
5079
5318
|
...(ngDevMode ? [{ debugName: "headerTableCellClass" }] : /* istanbul ignore next */ []));
|
|
5319
|
+
this.headerTableClass = computed(() => {
|
|
5320
|
+
return gridHeaderTableThemeVariants();
|
|
5321
|
+
}, /* @ts-ignore */
|
|
5322
|
+
...(ngDevMode ? [{ debugName: "headerTableClass" }] : /* istanbul ignore next */ []));
|
|
5080
5323
|
this.headerTableColumnTitleClass = computed(() => {
|
|
5081
5324
|
return gridHeaderTableColumnTitleThemeVariants();
|
|
5082
5325
|
}, /* @ts-ignore */
|
|
@@ -5089,6 +5332,7 @@ class GridComponent {
|
|
|
5089
5332
|
return gridHeaderTableRowThemeVariants();
|
|
5090
5333
|
}, /* @ts-ignore */
|
|
5091
5334
|
...(ngDevMode ? [{ debugName: "headerTableRowClass" }] : /* istanbul ignore next */ []));
|
|
5335
|
+
this.messages = this.gridService.messages;
|
|
5092
5336
|
this.noDataClass = computed(() => {
|
|
5093
5337
|
return gridNoDataThemeVariants();
|
|
5094
5338
|
}, /* @ts-ignore */
|
|
@@ -5138,13 +5382,6 @@ class GridComponent {
|
|
|
5138
5382
|
*/
|
|
5139
5383
|
this.resizeMethod = input("fitView", /* @ts-ignore */
|
|
5140
5384
|
...(ngDevMode ? [{ debugName: "resizeMethod" }] : /* istanbul ignore next */ []));
|
|
5141
|
-
/**
|
|
5142
|
-
* @description Field name or selector used to derive a stable identity for each row.
|
|
5143
|
-
* The resolved value must be unique within the grid data.
|
|
5144
|
-
* @default null
|
|
5145
|
-
*/
|
|
5146
|
-
this.rowKey = input(null, /* @ts-ignore */
|
|
5147
|
-
...(ngDevMode ? [{ debugName: "rowKey" }] : /* istanbul ignore next */ []));
|
|
5148
5385
|
/**
|
|
5149
5386
|
* @description Whether the pager is responsive.
|
|
5150
5387
|
* If set to `true`, the pager will be displayed as a dropdown when the grid width gets smaller.
|
|
@@ -5158,6 +5395,13 @@ class GridComponent {
|
|
|
5158
5395
|
*/
|
|
5159
5396
|
this.rounded = input("medium", /* @ts-ignore */
|
|
5160
5397
|
...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
|
|
5398
|
+
/**
|
|
5399
|
+
* @description Field name or selector used to derive a stable identity for each row.
|
|
5400
|
+
* The resolved value must be unique within the grid data.
|
|
5401
|
+
* @default null
|
|
5402
|
+
*/
|
|
5403
|
+
this.rowKey = input(null, /* @ts-ignore */
|
|
5404
|
+
...(ngDevMode ? [{ debugName: "rowKey" }] : /* istanbul ignore next */ []));
|
|
5161
5405
|
/**
|
|
5162
5406
|
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
5163
5407
|
* @default ""
|
|
@@ -5273,7 +5517,9 @@ class GridComponent {
|
|
|
5273
5517
|
this.gridService.appliedFilters.update(dict => dict.remove(column.field));
|
|
5274
5518
|
this.gridService.setColumnFiltered(column.id, false);
|
|
5275
5519
|
}
|
|
5276
|
-
this.
|
|
5520
|
+
if (!this.gridService.serverBindingEnabled()) {
|
|
5521
|
+
this.adjustPageAfterFilter();
|
|
5522
|
+
}
|
|
5277
5523
|
const allFilters = this.gridService
|
|
5278
5524
|
.appliedFilters()
|
|
5279
5525
|
.values()
|
|
@@ -5281,6 +5527,7 @@ class GridComponent {
|
|
|
5281
5527
|
.where(f => f != null)
|
|
5282
5528
|
.toArray();
|
|
5283
5529
|
this.gridService.filterChange$.next(allFilters);
|
|
5530
|
+
this.gridService.requestDataStateChange({ resetPage: true });
|
|
5284
5531
|
}
|
|
5285
5532
|
onColumnMouseEnter(column) {
|
|
5286
5533
|
if (!this.columnDragging() || this.resizing()) {
|
|
@@ -5297,7 +5544,7 @@ class GridComponent {
|
|
|
5297
5544
|
this.resizing.set(true);
|
|
5298
5545
|
}
|
|
5299
5546
|
onColumnSort(column) {
|
|
5300
|
-
if (column.kind === "command") {
|
|
5547
|
+
if (column.kind === "command" || !column.sortable) {
|
|
5301
5548
|
return;
|
|
5302
5549
|
}
|
|
5303
5550
|
if (!this.gridService.sortableOptions().enabled) {
|
|
@@ -5308,14 +5555,14 @@ class GridComponent {
|
|
|
5308
5555
|
}
|
|
5309
5556
|
this.gridService.columnSort$.next(new ColumnSortEvent(column));
|
|
5310
5557
|
}
|
|
5558
|
+
onGroupColumnReorder(column, moveAs) {
|
|
5559
|
+
this.gridService.moveGroupColumn(column, moveAs);
|
|
5560
|
+
}
|
|
5311
5561
|
onGroupingColumnRemove(event, column) {
|
|
5312
5562
|
event.stopPropagation();
|
|
5313
5563
|
this.gridService.clearColumnGrouping(column);
|
|
5314
5564
|
this.groupPanelPlaceholderVisible.set(this.gridService.groupColumns().length === 0);
|
|
5315
5565
|
}
|
|
5316
|
-
onGroupColumnReorder(column, moveAs) {
|
|
5317
|
-
this.gridService.moveGroupColumn(column, moveAs);
|
|
5318
|
-
}
|
|
5319
5566
|
onGroupingColumnSort(column) {
|
|
5320
5567
|
let nextGroupSortDirection = "asc";
|
|
5321
5568
|
if (column.groupSortDirection === "asc") {
|
|
@@ -5328,7 +5575,11 @@ class GridComponent {
|
|
|
5328
5575
|
this.gridService.appliedGroupSorts.update(dict => dict.remove(column.field).put(column.field, { sort: { field: column.field, dir: nextGroupSortDirection } }));
|
|
5329
5576
|
}
|
|
5330
5577
|
onPageChange(event) {
|
|
5578
|
+
const previous = this.gridService.paginationState();
|
|
5331
5579
|
this.gridService.setPageState({ page: event.page, skip: event.skip, take: event.take });
|
|
5580
|
+
if (previous.skip !== event.skip || previous.take !== event.take) {
|
|
5581
|
+
this.gridService.requestDataStateChange();
|
|
5582
|
+
}
|
|
5332
5583
|
if (isPlatformBrowser(this.#platformId)) {
|
|
5333
5584
|
const scrollableElement = this.#hostElementRef.nativeElement.querySelector("div.mona-grid-list");
|
|
5334
5585
|
if (scrollableElement) {
|
|
@@ -5337,7 +5588,11 @@ class GridComponent {
|
|
|
5337
5588
|
}
|
|
5338
5589
|
}
|
|
5339
5590
|
onPageSizeChange(data) {
|
|
5340
|
-
this.gridService.
|
|
5591
|
+
const previous = this.gridService.paginationState();
|
|
5592
|
+
this.gridService.setPageState({ skip: 0, take: data.newPageSize });
|
|
5593
|
+
if (previous.skip !== 0 || previous.take !== data.newPageSize) {
|
|
5594
|
+
this.gridService.requestDataStateChange();
|
|
5595
|
+
}
|
|
5341
5596
|
}
|
|
5342
5597
|
onToolbarKeydown(event) {
|
|
5343
5598
|
const targets = this.getToolbarFocusTargets();
|
|
@@ -5405,6 +5660,9 @@ class GridComponent {
|
|
|
5405
5660
|
}
|
|
5406
5661
|
return widthByColumnId;
|
|
5407
5662
|
}
|
|
5663
|
+
getColumnLockBucket(column) {
|
|
5664
|
+
return column.locked ? column.lockedPosition : "unlocked";
|
|
5665
|
+
}
|
|
5408
5666
|
getTableColumnHeaderCellList() {
|
|
5409
5667
|
const headerElement = this.gridHeaderElement();
|
|
5410
5668
|
if (!headerElement) {
|
|
@@ -5426,9 +5684,6 @@ class GridComponent {
|
|
|
5426
5684
|
}
|
|
5427
5685
|
return headerCells;
|
|
5428
5686
|
}
|
|
5429
|
-
getColumnLockBucket(column) {
|
|
5430
|
-
return column.locked ? column.lockedPosition : "unlocked";
|
|
5431
|
-
}
|
|
5432
5687
|
getToolbarFocusTargets() {
|
|
5433
5688
|
const toolbarElement = this.toolbarElement()?.nativeElement;
|
|
5434
5689
|
if (toolbarElement == null) {
|
|
@@ -5600,19 +5855,26 @@ class GridComponent {
|
|
|
5600
5855
|
}
|
|
5601
5856
|
}
|
|
5602
5857
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5603
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridComponent, isStandalone: true, selector: "mona-grid", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, pageSizeValues: { classPropertyName: "pageSizeValues", publicName: "pageSizeValues", isSignal: true, isRequired: false, transformFunction: null }, resizeMethod: { classPropertyName: "resizeMethod", publicName: "resizeMethod", isSignal: true, isRequired: false, transformFunction: null }, rowKey: { classPropertyName: "rowKey", publicName: "rowKey", isSignal: true, isRequired: false, transformFunction: null }, responsivePager: { classPropertyName: "responsivePager", publicName: "responsivePager", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "grid" }, properties: { "class": "baseClass()", "attr.data-uid": "uid" } }, providers: [GridService, GridNavigationService, GridRowFlattenerService, FilterService], queries: [{ propertyName: "columnDefinitions", predicate: GRID_COLUMN_DEFINITION, isSignal: true }, { propertyName: "gridDetailTemplate", first: true, predicate: GridDetailTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: GridNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "toolbarTemplate", first: true, predicate: GridToolbarTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "footerScrollElement", first: true, predicate: ["footerScrollElement"], descendants: true, isSignal: true }, { propertyName: "gridHeaderElement", first: true, predicate: ["gridHeaderElement"], descendants: true, isSignal: true }, { propertyName: "gridHeaderTableElement", first: true, predicate: ["headerTable"], descendants: true, isSignal: true }, { propertyName: "groupColumnList", first: true, predicate: ["groupColumnList"], descendants: true, isSignal: true }, { propertyName: "toolbarElement", first: true, predicate: ["toolbarElement"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (toolbarTemplate()) {\n <div\n class=\"flex min-h-10 items-center gap-2 border-b border-border p-2\"\n #toolbarElement\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 $index) {\n <mona-chip\n [removable]=\"true\"\n size=\"small\"\n [rounded]=\"rounded()\"\n (click)=\"onGroupingColumnSort(groupColumn)\"\n (remove)=\"onGroupingColumnRemove($event, groupColumn)\">\n @if (groupColumn.groupSortDirection === \"asc\") {\n <i class=\"ri-arrow-down-line\"></i>\n } @else if (groupColumn.groupSortDirection === \"desc\") {\n <i class=\"ri-arrow-up-line\"></i>\n }\n <span>{{ groupColumn.title }}</span>\n <span class=\"ms-2\" (click)=\"$event.stopPropagation()\" #groupReorder>\n <i class=\"ri-more-2-fill\"></i>\n </span>\n <mona-popup-menu size=\"small\" [target]=\"groupReorder\">\n <mona-popup-menu-item\n [disabled]=\"$first\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'prev')\">\n <ng-template monaPopupMenuTextTemplate>\n <i class=\"ri-arrow-left-fill rtl:rotate-180\"></i> {{ 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 <i class=\"ri-arrow-right-fill rtl:rotate-180\"></i> {{ 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 [class]=\"headerClass()\" [style.margin-right.px]=\"headerMarginRight()\" #gridHeaderElement>\n <div>\n <table #headerTable [class]=\"headerTableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of gridService.visibleColumns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <thead role=\"rowgroup\" [style.visibility]=\"!gridWidthSet() ? 'hidden' : undefined\">\n <tr\n cdkDropList\n [cdkDropListConnectedTo]=\"groupable() ? [groupColumnList()!] : []\"\n (cdkDropListDropped)=\"onColumnDrop()\"\n [class]=\"headerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-e border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.groupColumnWidth\"></th>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"0\"\n [section]=\"'header'\"\n [firstInRow]=\"gridService.groupColumns().length === 0\"\n [lastInRow]=\"\n !gridService.masterDetailTemplate() &&\n !gridService.selectionColumnVisible() &&\n gridService.visibleColumns().length === 0\n \"\n scope=\"col\"\n [attr.aria-label]=\"gridService.messages().rowReorder\"\n class=\"border-e border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></th>\n }\n @if (gridService.masterDetailTemplate()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n scope=\"col\"\n class=\"border-e border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.detailColumnWidth\"></th>\n }\n @if (gridService.selectionColumnVisible()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"\n (gridService.rowReorderColumnVisible() ? 1 : 0) +\n (gridService.masterDetailTemplate() ? 1 : 0)\n \"\n [section]=\"'header'\"\n [firstInRow]=\"\n !gridService.rowReorderColumnVisible() &&\n !gridService.masterDetailTemplate() &&\n gridService.groupColumns().length === 0\n \"\n [lastInRow]=\"gridService.visibleColumns().length === 0\"\n scope=\"col\"\n class=\"border-e border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.selectionColumnWidth\">\n @if (\n gridService.selectableOptions().mode === \"multiple\" &&\n gridService.selectableOptions().showSelectAll !== false\n ) {\n <mona-grid-select-all-checkbox />\n }\n </th>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n @let colIndex = $index + gridService.leadingLogicalColumnCount();\n <th\n scope=\"col\"\n role=\"columnheader\"\n cdkDrag\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'header'\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [colIndex]=\"colIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"colIndex === gridService.leadingLogicalColumnCount()\"\n [lastInRow]=\"\n colIndex ===\n gridService.leadingLogicalColumnCount() +\n gridService.visibleColumns().length -\n 1\n \"\n (toggle)=\"onColumnSort(column)\"\n [cdkDragData]=\"column\"\n [cdkDragDisabled]=\"isColumnDragDisabled(column)\"\n [class]=\"headerTableCellClass()\"\n (mouseenter)=\"onColumnMouseEnter(column)\"\n (cdkDragEntered)=\"onColumnDragEnter($event)\"\n (cdkDragStarted)=\"onColumnDragStart($event)\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\"\n [attr.colspan]=\"1\"\n [attr.aria-sort]=\"\n gridService.sortableOptions().enabled\n ? (column.columnSortDirection | columnAriaSort)\n : null\n \">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: column, column }\"></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\n <div [class]=\"columnActionsClass()\" [attr.data-column-actions]=\"true\">\n @if (gridService.sortableOptions().showIndices && column.sortIndex !== null) {\n <span>{{ column.sortIndex }}</span>\n }\n @if (column.columnSortDirection === \"asc\") {\n <i class=\"ri-arrow-down-line\"></i>\n } @else if (column.columnSortDirection === \"desc\") {\n <i class=\"ri-arrow-up-line\"></i>\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)=\"onColumnFilter(column, $event)\"></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 [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\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [class]=\"headerTableCellClass()\"\n [style.min-width.px]=\"column.minWidth\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"column.calculatedWidth\">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: column, column }\"></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 }\n </tr>\n @if (filterRowEnabled()) {\n <tr role=\"row\" [class]=\"headerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"gridService.groupColumnWidth\"></th>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></th>\n }\n @if (gridService.masterDetailTemplate()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"gridService.detailColumnWidth\"></th>\n }\n @if (gridService.selectionColumnVisible()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"gridService.selectionColumnWidth\"></th>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n <th\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n scope=\"col\"\n class=\"border-e border-border overflow-hidden\"\n [style.width.px]=\"column.calculatedWidth\"\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 }\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\n [columns]=\"gridService.visibleColumns()\"\n [data]=\"gridService.viewRows()\"></mona-grid-virtual-list>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\"></ng-container>\n }\n } @else {\n @if (gridService.viewPageRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-list\n [columns]=\"gridService.visibleColumns()\"\n [data]=\"gridService.viewPageRows()\"></mona-grid-list>\n @if (footerVisible()) {\n <div\n [class]=\"footerClass()\"\n [style.margin-right.px]=\"gridService.scrollbarGutterWidth()\"\n #footerScrollElement\n data-grid-footer-scroll>\n <div>\n <table [class]=\"footerTableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of gridService.visibleColumns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <tfoot role=\"rowgroup\">\n <tr [class]=\"footerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [footerCellWidth]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n [footerCellWidth]=\"gridService.rowReorderColumnWidth\"></td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n [footerCellWidth]=\"gridService.detailColumnWidth\"></td>\n }\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n [footerCellWidth]=\"gridService.selectionColumnWidth\"></td>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [footerColumn]=\"column\">\n <mona-grid-footer-cell\n [column]=\"column\"\n [columnIndex]=\"$index\"></mona-grid-footer-cell>\n </td>\n }\n </tr>\n </tfoot>\n </table>\n </div>\n </div>\n }\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.viewRowCount()\"\n [size]=\"'small'\"\n [rounded]=\"rounded()\"\n [pageInput]=\"true\"\n [pageSizeValues]=\"pageSizeValues()\"\n [responsive]=\"responsivePager()\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n (pageChange)=\"onPageChange($event)\"></mona-pager>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\"></ng-container>\n }\n }\n} @placeholder {\n <mona-placeholder text=\"Loading...\"></mona-placeholder>\n}\n\n<ng-template #emptyGridTemplate>\n <div [class]=\"noDataClass()\">\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</ng-template>\n", dependencies: [{ kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "component", type: ChipComponent, selector: "mona-chip", inputs: ["aria-label", "disabled", "label", "look", "removable", "removeLabel", "removeTabIndex", "rounded", "selected", "size", "tabindex", "toggleable", "class", "value"], outputs: ["contentClick", "remove", "selectedChange"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: GridFilterMenuComponent, selector: "mona-grid-filter-menu", inputs: ["column", "type"], outputs: ["apply"] }, { kind: "component", type: GridFilterRowCellComponent, selector: "mona-grid-filter-row-cell", inputs: ["column"], outputs: ["apply"] }, { kind: "directive", type: GridColumnResizeHandlerDirective, selector: "[monaGridColumnResizeHandler]", inputs: ["column"], outputs: ["resizeEnd", "resizeStart"] }, { kind: "directive", type: CdkDragPreview, selector: "ng-template[cdkDragPreview]", inputs: ["data", "matchSize"] }, { kind: "directive", type: CdkDragPlaceholder, selector: "ng-template[cdkDragPlaceholder]", inputs: ["data"] }, { kind: "component", type: PlaceholderComponent, selector: "mona-placeholder", inputs: ["text", "class"] }, { kind: "component", type: PopupMenuComponent, selector: "mona-popup-menu", inputs: ["anchor", "anchorConnectionPoint", "items", "id", "minWidth", "offset", "popupConnectionPoint", "precise", "rounded", "size", "target", "trigger", "width", "class"], outputs: ["close", "menuClick", "navigate", "open"] }, { kind: "component", type: PopupMenuItemComponent, selector: "mona-popup-menu-item", inputs: ["disabled", "label"], outputs: ["menuClick"] }, { kind: "directive", type: PopupMenuTextTemplateDirective, selector: "ng-template[monaPopupMenuTextTemplate]" }, { kind: "directive", type: GridLogicalCellDirective, selector: "td[monaGridLogicalCell], th[monaGridLogicalCell]", inputs: ["cellKind", "colIndex", "columnId", "editable", "firstInRow", "groupHeader", "groupKey", "lastInRow", "rowIndex", "rowUid", "section"], outputs: ["edit", "toggle"] }, { kind: "directive", type: GridLockedCellDirective, selector: "td[monaGridLockedCell], th[monaGridLockedCell]", inputs: ["column", "groupPrefixWidth", "lockedCellHeader", "lockedStructuralOffset", "structuralColumn"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: PopupComponent, selector: "mona-popup", inputs: ["anchor", "anchorConnectionPoint", "animation", "backdropClass", "closeOnBackdropClick", "closeOnEscape", "closeOnMouseLeave", "closeOnOutsideClick", "data", "hasBackdrop", "height", "maxHeight", "maxWidth", "minHeight", "minWidth", "offset", "popupClass", "popupConnectionPoint", "popupWrapperClass", "positionStrategy", "positions", "preventClose", "providers", "trigger", "width", "withPush", "closeOnScroll", "restoreFocus", "withScrollTracking"], outputs: ["close", "open"] }, { kind: "component", type: GridColumnChooserComponent, selector: "mona-grid-column-chooser", outputs: ["apply", "cancel"] }, { kind: "component", type: GridSelectAllCheckboxComponent, selector: "mona-grid-select-all-checkbox" }, { kind: "pipe", type: ColumnAriaSortPipe, name: "columnAriaSort" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [NgTemplateOutlet, /* @ts-ignore */
|
|
5604
|
-
import('./nanahoshi-mona-ui-grid-grid-footer-cell.component-
|
|
5605
|
-
import('./nanahoshi-mona-ui-grid-grid-list.component-
|
|
5606
|
-
import('./nanahoshi-mona-ui-grid-grid-virtual-list.component-
|
|
5607
|
-
import('./nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-
|
|
5858
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridComponent, isStandalone: true, selector: "mona-grid", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, pageSizeValues: { classPropertyName: "pageSizeValues", publicName: "pageSizeValues", isSignal: true, isRequired: false, transformFunction: null }, resizeMethod: { classPropertyName: "resizeMethod", publicName: "resizeMethod", isSignal: true, isRequired: false, transformFunction: null }, responsivePager: { classPropertyName: "responsivePager", publicName: "responsivePager", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, rowKey: { classPropertyName: "rowKey", publicName: "rowKey", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "class": "baseClass()", "attr.data-uid": "uid", "attr.aria-busy": "gridService.serverLoading() || null" } }, providers: [GridService, GridNavigationService, GridRowFlattenerService, FilterService], queries: [{ propertyName: "columnDefinitions", predicate: GRID_COLUMN_DEFINITION, isSignal: true }, { propertyName: "gridDetailTemplate", first: true, predicate: GridDetailTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: GridNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "toolbarTemplate", first: true, predicate: GridToolbarTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "footerScrollElement", first: true, predicate: ["footerScrollElement"], descendants: true, isSignal: true }, { propertyName: "gridHeaderElement", first: true, predicate: ["gridHeaderElement"], descendants: true, isSignal: true }, { propertyName: "gridHeaderTableElement", first: true, predicate: ["headerTable"], descendants: true, isSignal: true }, { propertyName: "groupColumnList", first: true, predicate: ["groupColumnList"], descendants: true, isSignal: true }, { propertyName: "toolbarElement", first: true, predicate: ["toolbarElement"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (toolbarTemplate()) {\n <div\n class=\"flex min-h-10 items-center gap-2 border-b border-border p-2\"\n #toolbarElement\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 $index) {\n <mona-chip\n [removable]=\"true\"\n size=\"small\"\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 <span class=\"ms-2\" (click)=\"$event.stopPropagation()\" #groupReorder>\n <svg lucideEllipsisVertical [size]=\"16\" aria-hidden=\"true\"></svg>\n </span>\n <mona-popup-menu size=\"small\" [target]=\"groupReorder\">\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 class=\"flex flex-col flex-1 min-h-0\" [attr.role]=\"groupable() ? 'treegrid' : 'grid'\">\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>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of gridService.visibleColumns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <thead role=\"rowgroup\" [style.visibility]=\"!gridWidthSet() ? 'hidden' : undefined\">\n <tr\n role=\"row\"\n cdkDropList\n [cdkDropListConnectedTo]=\"groupable() ? [groupColumnList()!] : []\"\n (cdkDropListDropped)=\"onColumnDrop()\"\n [class]=\"headerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-e border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.groupColumnWidth\"></th>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"0\"\n [section]=\"'header'\"\n [firstInRow]=\"gridService.groupColumns().length === 0\"\n [lastInRow]=\"\n !gridService.masterDetailTemplate() &&\n !gridService.selectionColumnVisible() &&\n gridService.visibleColumns().length === 0\n \"\n scope=\"col\"\n [attr.aria-label]=\"gridService.messages().rowReorder\"\n class=\"border-e border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></th>\n }\n @if (gridService.masterDetailTemplate()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n scope=\"col\"\n class=\"border-e border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.detailColumnWidth\"></th>\n }\n @if (gridService.selectionColumnVisible()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"\n (gridService.rowReorderColumnVisible() ? 1 : 0) +\n (gridService.masterDetailTemplate() ? 1 : 0)\n \"\n [section]=\"'header'\"\n [firstInRow]=\"\n !gridService.rowReorderColumnVisible() &&\n !gridService.masterDetailTemplate() &&\n gridService.groupColumns().length === 0\n \"\n [lastInRow]=\"gridService.visibleColumns().length === 0\"\n scope=\"col\"\n class=\"border-e border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.selectionColumnWidth\">\n @if (\n gridService.selectableOptions().mode === \"multiple\" &&\n gridService.selectableOptions().showSelectAll !== false\n ) {\n <mona-grid-select-all-checkbox />\n }\n </th>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n @let colIndex = $index + gridService.leadingLogicalColumnCount();\n <th\n scope=\"col\"\n role=\"columnheader\"\n cdkDrag\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'header'\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [colIndex]=\"colIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"colIndex === gridService.leadingLogicalColumnCount()\"\n [lastInRow]=\"\n colIndex ===\n gridService.leadingLogicalColumnCount() + gridService.visibleColumns().length - 1\n \"\n (toggleExpand)=\"onColumnSort(column)\"\n [cdkDragData]=\"column\"\n [cdkDragDisabled]=\"isColumnDragDisabled(column)\"\n [class]=\"headerTableCellClass()\"\n (mouseenter)=\"onColumnMouseEnter(column)\"\n (cdkDragEntered)=\"onColumnDragEnter($event)\"\n (cdkDragStarted)=\"onColumnDragStart($event)\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\"\n [attr.colspan]=\"1\"\n [attr.aria-sort]=\"\n gridService.sortableOptions().enabled\n ? (column.columnSortDirection | columnAriaSort)\n : null\n \">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: column, column }\"></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\n <div [class]=\"columnActionsClass()\" [attr.data-column-actions]=\"true\">\n @if (\n gridService.sortableOptions().enabled && column.columnSortDirection !== null\n ) {\n <div class=\"inline-flex shrink-0 items-center gap-0.5\">\n @if (column.columnSortDirection === \"asc\") {\n <svg lucideArrowDown [size]=\"16\" aria-hidden=\"true\"></svg>\n } @else {\n <svg lucideArrowUp [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\">{{ column.sortIndex }}</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)=\"onColumnFilter(column, $event)\"></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 [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\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [class]=\"headerTableCellClass()\"\n [style.min-width.px]=\"column.minWidth\"\n [attr.colspan]=\"1\"\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 }\n </tr>\n @if (filterRowEnabled()) {\n <tr role=\"row\" [class]=\"headerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"gridService.groupColumnWidth\"></th>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></th>\n }\n @if (gridService.masterDetailTemplate()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"gridService.detailColumnWidth\"></th>\n }\n @if (gridService.selectionColumnVisible()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"gridService.selectionColumnWidth\"></th>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n <th\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n scope=\"col\"\n class=\"border-e border-border overflow-hidden\"\n [style.width.px]=\"column.calculatedWidth\"\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 }\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 [columns]=\"gridService.visibleColumns()\" [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 [columns]=\"gridService.visibleColumns()\" [data]=\"gridService.viewPageRows()\" />\n } @else if (!gridService.serverLoading()) {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\" />\n }\n @if (gridService.serverLoading()) {\n <div class=\"absolute inset-0 z-20 flex items-center justify-center bg-surface/60\" 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>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of gridService.visibleColumns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <tfoot role=\"rowgroup\">\n <tr role=\"row\" [class]=\"footerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [footerCellWidth]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n [footerCellWidth]=\"gridService.rowReorderColumnWidth\"></td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n [footerCellWidth]=\"gridService.detailColumnWidth\"></td>\n }\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n [footerCellWidth]=\"gridService.selectionColumnWidth\"></td>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [footerColumn]=\"column\">\n <mona-grid-footer-cell\n [column]=\"column\"\n [columnIndex]=\"$index\"></mona-grid-footer-cell>\n </td>\n }\n </tr>\n </tfoot>\n </table>\n </div>\n </div>\n }\n }\n }\n } @placeholder {\n <mona-placeholder text=\"Loading...\" />\n }\n</div>\n@if (!gridService.virtualScrollOptions().enabled) {\n @if (gridService.serverBindingEnabled() || gridService.viewPageRows().length !== 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 (pageSizeChange)=\"onPageSizeChange($event)\"\n (pageChange)=\"onPageChange($event)\"></mona-pager>\n }\n}\n\n<ng-template #emptyGridTemplate>\n <div [class]=\"noDataClass()\">\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</ng-template>\n", dependencies: [{ kind: "component", type: LucideArrowDown, selector: "svg[lucideArrowDown]" }, { kind: "component", type: LucideArrowLeft, selector: "svg[lucideArrowLeft]" }, { kind: "component", type: LucideArrowRight, selector: "svg[lucideArrowRight]" }, { kind: "component", type: LucideArrowUp, selector: "svg[lucideArrowUp]" }, { kind: "component", type: LucideEllipsisVertical, selector: "svg[lucideEllipsisVertical], svg[lucideMoreVertical]" }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "component", type: ChipComponent, selector: "mona-chip", inputs: ["aria-label", "disabled", "label", "look", "removable", "removeLabel", "removeTabIndex", "rounded", "selected", "size", "tabindex", "toggleable", "class", "value"], outputs: ["contentClick", "remove", "selectedChange"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: GridFilterMenuComponent, selector: "mona-grid-filter-menu", inputs: ["column", "type"], outputs: ["apply"] }, { kind: "component", type: GridFilterRowCellComponent, selector: "mona-grid-filter-row-cell", inputs: ["column"], outputs: ["apply"] }, { kind: "directive", type: GridColumnResizeHandlerDirective, selector: "[monaGridColumnResizeHandler]", inputs: ["column"], outputs: ["resizeEnd", "resizeStart"] }, { kind: "directive", type: CdkDragPreview, selector: "ng-template[cdkDragPreview]", inputs: ["data", "matchSize"] }, { kind: "component", type: PagerComponent, selector: "mona-pager", inputs: ["firstLast", "navigable", "pageInput", "pageSize", "pageSizeValues", "previousNext", "responsive", "rounded", "showInfo", "size", "skip", "total", "type", "class", "visiblePages"], outputs: ["pageChange", "pageSizeChange"] }, { kind: "directive", type: CdkDragPlaceholder, selector: "ng-template[cdkDragPlaceholder]", inputs: ["data"] }, { kind: "component", type: PlaceholderComponent, selector: "mona-placeholder", inputs: ["text", "class"] }, { kind: "component", type: PopupMenuComponent, selector: "mona-popup-menu", inputs: ["anchor", "anchorConnectionPoint", "items", "id", "minWidth", "offset", "popupConnectionPoint", "precise", "rounded", "size", "target", "trigger", "width", "class"], outputs: ["close", "menuClick", "navigate", "open"] }, { kind: "component", type: PopupMenuItemComponent, selector: "mona-popup-menu-item", inputs: ["disabled", "label"], outputs: ["menuClick"] }, { kind: "directive", type: PopupMenuTextTemplateDirective, selector: "ng-template[monaPopupMenuTextTemplate]" }, { kind: "directive", type: GridLogicalCellDirective, selector: "td[monaGridLogicalCell], th[monaGridLogicalCell]", inputs: ["cellKind", "colIndex", "columnId", "editable", "firstInRow", "groupHeader", "groupKey", "lastInRow", "rowIndex", "rowUid", "section"], outputs: ["edit", "toggleExpand"] }, { kind: "directive", type: GridLockedCellDirective, selector: "td[monaGridLockedCell], th[monaGridLockedCell]", inputs: ["column", "groupPrefixWidth", "lockedCellHeader", "lockedStructuralOffset", "structuralColumn"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: PopupComponent, selector: "mona-popup", inputs: ["anchor", "anchorConnectionPoint", "animation", "backdropClass", "closeOnBackdropClick", "closeOnEscape", "closeOnMouseLeave", "closeOnOutsideClick", "data", "hasBackdrop", "height", "maxHeight", "maxWidth", "minHeight", "minWidth", "offset", "popupClass", "popupConnectionPoint", "popupWrapperClass", "positionStrategy", "positions", "preventClose", "providers", "trigger", "width", "withPush", "closeOnScroll", "restoreFocus", "withScrollTracking"], outputs: ["close", "open"] }, { kind: "component", type: GridColumnChooserComponent, selector: "mona-grid-column-chooser", outputs: ["apply", "cancel"] }, { kind: "component", type: GridSelectAllCheckboxComponent, selector: "mona-grid-select-all-checkbox" }, { kind: "pipe", type: ColumnAriaSortPipe, name: "columnAriaSort" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [NgTemplateOutlet, /* @ts-ignore */
|
|
5859
|
+
import('./nanahoshi-mona-ui-grid-grid-footer-cell.component-cJjJ1b6M.mjs').then(m => m.GridFooterCellComponent), /* @ts-ignore */
|
|
5860
|
+
import('./nanahoshi-mona-ui-grid-grid-list.component-Do-ktlth.mjs').then(m => m.GridListComponent), /* @ts-ignore */
|
|
5861
|
+
import('./nanahoshi-mona-ui-grid-grid-virtual-list.component-Cs1gPJps.mjs').then(m => m.GridVirtualListComponent), /* @ts-ignore */
|
|
5862
|
+
import('./nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-CkkLBnoI.mjs').then(m => m.GridFooterTableCellDirective), GridLockedCellDirective, /* @ts-ignore */
|
|
5863
|
+
import('@nanahoshi/mona-ui/spinner').then(m => m.SpinnerComponent)]] }); }
|
|
5608
5864
|
}
|
|
5609
5865
|
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.0.6", ngImport: i0, type: GridComponent, resolveDeferredDeps: () => [/* @ts-ignore */
|
|
5610
|
-
import('./nanahoshi-mona-ui-grid-grid-footer-cell.component-
|
|
5611
|
-
import('./nanahoshi-mona-ui-grid-grid-list.component-
|
|
5612
|
-
import('./nanahoshi-mona-ui-grid-grid-virtual-list.component-
|
|
5613
|
-
import('./nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-
|
|
5866
|
+
import('./nanahoshi-mona-ui-grid-grid-footer-cell.component-cJjJ1b6M.mjs').then(m => m.GridFooterCellComponent), /* @ts-ignore */
|
|
5867
|
+
import('./nanahoshi-mona-ui-grid-grid-list.component-Do-ktlth.mjs').then(m => m.GridListComponent), /* @ts-ignore */
|
|
5868
|
+
import('./nanahoshi-mona-ui-grid-grid-virtual-list.component-Cs1gPJps.mjs').then(m => m.GridVirtualListComponent), /* @ts-ignore */
|
|
5869
|
+
import('./nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-CkkLBnoI.mjs').then(m => m.GridFooterTableCellDirective), /* @ts-ignore */
|
|
5870
|
+
import('@nanahoshi/mona-ui/spinner').then(m => m.SpinnerComponent)], resolveMetadata: (GridFooterCellComponent, GridListComponent, GridVirtualListComponent, GridFooterTableCellDirective, SpinnerComponent) => ({ decorators: [{
|
|
5614
5871
|
type: Component,
|
|
5615
5872
|
args: [{ selector: "mona-grid", changeDetection: ChangeDetectionStrategy.OnPush, providers: [GridService, GridNavigationService, GridRowFlattenerService, FilterService], imports: [
|
|
5873
|
+
LucideArrowDown,
|
|
5874
|
+
LucideArrowLeft,
|
|
5875
|
+
LucideArrowRight,
|
|
5876
|
+
LucideArrowUp,
|
|
5877
|
+
LucideEllipsisVertical,
|
|
5616
5878
|
CdkDropList,
|
|
5617
5879
|
ChipComponent,
|
|
5618
5880
|
CdkDrag,
|
|
@@ -5637,13 +5899,15 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.0.6", ng
|
|
|
5637
5899
|
ButtonDirective,
|
|
5638
5900
|
PopupComponent,
|
|
5639
5901
|
GridColumnChooserComponent,
|
|
5640
|
-
GridSelectAllCheckboxComponent
|
|
5902
|
+
GridSelectAllCheckboxComponent,
|
|
5903
|
+
SpinnerComponent
|
|
5641
5904
|
], host: {
|
|
5642
5905
|
"[class]": "baseClass()",
|
|
5643
5906
|
"[attr.data-uid]": "uid",
|
|
5644
|
-
|
|
5645
|
-
}, template: "@if (toolbarTemplate()) {\n <div\n class=\"flex min-h-10 items-center gap-2 border-b border-border p-2\"\n #toolbarElement\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 $index) {\n <mona-chip\n [removable]=\"true\"\n size=\"small\"\n [rounded]=\"rounded()\"\n (click)=\"onGroupingColumnSort(groupColumn)\"\n (remove)=\"onGroupingColumnRemove($event, groupColumn)\">\n @if (groupColumn.groupSortDirection === \"asc\") {\n <i class=\"ri-arrow-down-line\"></i>\n } @else if (groupColumn.groupSortDirection === \"desc\") {\n <i class=\"ri-arrow-up-line\"></i>\n }\n <span>{{ groupColumn.title }}</span>\n <span class=\"ms-2\" (click)=\"$event.stopPropagation()\" #groupReorder>\n <i class=\"ri-more-2-fill\"></i>\n </span>\n <mona-popup-menu size=\"small\" [target]=\"groupReorder\">\n <mona-popup-menu-item\n [disabled]=\"$first\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'prev')\">\n <ng-template monaPopupMenuTextTemplate>\n <i class=\"ri-arrow-left-fill rtl:rotate-180\"></i> {{ 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 <i class=\"ri-arrow-right-fill rtl:rotate-180\"></i> {{ 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 [class]=\"headerClass()\" [style.margin-right.px]=\"headerMarginRight()\" #gridHeaderElement>\n <div>\n <table #headerTable [class]=\"headerTableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of gridService.visibleColumns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <thead role=\"rowgroup\" [style.visibility]=\"!gridWidthSet() ? 'hidden' : undefined\">\n <tr\n cdkDropList\n [cdkDropListConnectedTo]=\"groupable() ? [groupColumnList()!] : []\"\n (cdkDropListDropped)=\"onColumnDrop()\"\n [class]=\"headerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-e border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.groupColumnWidth\"></th>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"0\"\n [section]=\"'header'\"\n [firstInRow]=\"gridService.groupColumns().length === 0\"\n [lastInRow]=\"\n !gridService.masterDetailTemplate() &&\n !gridService.selectionColumnVisible() &&\n gridService.visibleColumns().length === 0\n \"\n scope=\"col\"\n [attr.aria-label]=\"gridService.messages().rowReorder\"\n class=\"border-e border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></th>\n }\n @if (gridService.masterDetailTemplate()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n scope=\"col\"\n class=\"border-e border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.detailColumnWidth\"></th>\n }\n @if (gridService.selectionColumnVisible()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"\n (gridService.rowReorderColumnVisible() ? 1 : 0) +\n (gridService.masterDetailTemplate() ? 1 : 0)\n \"\n [section]=\"'header'\"\n [firstInRow]=\"\n !gridService.rowReorderColumnVisible() &&\n !gridService.masterDetailTemplate() &&\n gridService.groupColumns().length === 0\n \"\n [lastInRow]=\"gridService.visibleColumns().length === 0\"\n scope=\"col\"\n class=\"border-e border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.selectionColumnWidth\">\n @if (\n gridService.selectableOptions().mode === \"multiple\" &&\n gridService.selectableOptions().showSelectAll !== false\n ) {\n <mona-grid-select-all-checkbox />\n }\n </th>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n @let colIndex = $index + gridService.leadingLogicalColumnCount();\n <th\n scope=\"col\"\n role=\"columnheader\"\n cdkDrag\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'header'\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [colIndex]=\"colIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"colIndex === gridService.leadingLogicalColumnCount()\"\n [lastInRow]=\"\n colIndex ===\n gridService.leadingLogicalColumnCount() +\n gridService.visibleColumns().length -\n 1\n \"\n (toggle)=\"onColumnSort(column)\"\n [cdkDragData]=\"column\"\n [cdkDragDisabled]=\"isColumnDragDisabled(column)\"\n [class]=\"headerTableCellClass()\"\n (mouseenter)=\"onColumnMouseEnter(column)\"\n (cdkDragEntered)=\"onColumnDragEnter($event)\"\n (cdkDragStarted)=\"onColumnDragStart($event)\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\"\n [attr.colspan]=\"1\"\n [attr.aria-sort]=\"\n gridService.sortableOptions().enabled\n ? (column.columnSortDirection | columnAriaSort)\n : null\n \">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: column, column }\"></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\n <div [class]=\"columnActionsClass()\" [attr.data-column-actions]=\"true\">\n @if (gridService.sortableOptions().showIndices && column.sortIndex !== null) {\n <span>{{ column.sortIndex }}</span>\n }\n @if (column.columnSortDirection === \"asc\") {\n <i class=\"ri-arrow-down-line\"></i>\n } @else if (column.columnSortDirection === \"desc\") {\n <i class=\"ri-arrow-up-line\"></i>\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)=\"onColumnFilter(column, $event)\"></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 [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\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [class]=\"headerTableCellClass()\"\n [style.min-width.px]=\"column.minWidth\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"column.calculatedWidth\">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: column, column }\"></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 }\n </tr>\n @if (filterRowEnabled()) {\n <tr role=\"row\" [class]=\"headerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"gridService.groupColumnWidth\"></th>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></th>\n }\n @if (gridService.masterDetailTemplate()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"gridService.detailColumnWidth\"></th>\n }\n @if (gridService.selectionColumnVisible()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"gridService.selectionColumnWidth\"></th>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n <th\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n scope=\"col\"\n class=\"border-e border-border overflow-hidden\"\n [style.width.px]=\"column.calculatedWidth\"\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 }\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\n [columns]=\"gridService.visibleColumns()\"\n [data]=\"gridService.viewRows()\"></mona-grid-virtual-list>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\"></ng-container>\n }\n } @else {\n @if (gridService.viewPageRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-list\n [columns]=\"gridService.visibleColumns()\"\n [data]=\"gridService.viewPageRows()\"></mona-grid-list>\n @if (footerVisible()) {\n <div\n [class]=\"footerClass()\"\n [style.margin-right.px]=\"gridService.scrollbarGutterWidth()\"\n #footerScrollElement\n data-grid-footer-scroll>\n <div>\n <table [class]=\"footerTableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of gridService.visibleColumns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <tfoot role=\"rowgroup\">\n <tr [class]=\"footerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [footerCellWidth]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n [footerCellWidth]=\"gridService.rowReorderColumnWidth\"></td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n [footerCellWidth]=\"gridService.detailColumnWidth\"></td>\n }\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n [footerCellWidth]=\"gridService.selectionColumnWidth\"></td>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [footerColumn]=\"column\">\n <mona-grid-footer-cell\n [column]=\"column\"\n [columnIndex]=\"$index\"></mona-grid-footer-cell>\n </td>\n }\n </tr>\n </tfoot>\n </table>\n </div>\n </div>\n }\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.viewRowCount()\"\n [size]=\"'small'\"\n [rounded]=\"rounded()\"\n [pageInput]=\"true\"\n [pageSizeValues]=\"pageSizeValues()\"\n [responsive]=\"responsivePager()\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n (pageChange)=\"onPageChange($event)\"></mona-pager>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\"></ng-container>\n }\n }\n} @placeholder {\n <mona-placeholder text=\"Loading...\"></mona-placeholder>\n}\n\n<ng-template #emptyGridTemplate>\n <div [class]=\"noDataClass()\">\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</ng-template>\n" }]
|
|
5646
|
-
}], ctorParameters: () => [], propDecorators: { columnDefinitions: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => GRID_COLUMN_DEFINITION), { isSignal: true }] }], footerScrollElement: [{ type: i0.ViewChild, args: ["footerScrollElement", { isSignal: true }] }], gridDetailTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridDetailTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], gridHeaderElement: [{ type: i0.ViewChild, args: ["gridHeaderElement", { isSignal: true }] }], gridHeaderTableElement: [{ type: i0.ViewChild, args: ["headerTable", { isSignal: true }] }], groupColumnList: [{ type: i0.ViewChild, args: ["groupColumnList", { isSignal: true }] }], noDataTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridNoDataTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], toolbarElement: [{ type: i0.ViewChild, args: ["toolbarElement", { isSignal: true }] }], toolbarTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridToolbarTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], pageSizeValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeValues", required: false }] }], resizeMethod: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizeMethod", required: false }] }], rowKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowKey", required: false }] }], responsivePager: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsivePager", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } }) });
|
|
5907
|
+
"[attr.aria-busy]": "gridService.serverLoading() || null",
|
|
5908
|
+
role: "group"
|
|
5909
|
+
}, template: "@if (toolbarTemplate()) {\n <div\n class=\"flex min-h-10 items-center gap-2 border-b border-border p-2\"\n #toolbarElement\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 $index) {\n <mona-chip\n [removable]=\"true\"\n size=\"small\"\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 <span class=\"ms-2\" (click)=\"$event.stopPropagation()\" #groupReorder>\n <svg lucideEllipsisVertical [size]=\"16\" aria-hidden=\"true\"></svg>\n </span>\n <mona-popup-menu size=\"small\" [target]=\"groupReorder\">\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 class=\"flex flex-col flex-1 min-h-0\" [attr.role]=\"groupable() ? 'treegrid' : 'grid'\">\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>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of gridService.visibleColumns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <thead role=\"rowgroup\" [style.visibility]=\"!gridWidthSet() ? 'hidden' : undefined\">\n <tr\n role=\"row\"\n cdkDropList\n [cdkDropListConnectedTo]=\"groupable() ? [groupColumnList()!] : []\"\n (cdkDropListDropped)=\"onColumnDrop()\"\n [class]=\"headerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-e border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.groupColumnWidth\"></th>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"0\"\n [section]=\"'header'\"\n [firstInRow]=\"gridService.groupColumns().length === 0\"\n [lastInRow]=\"\n !gridService.masterDetailTemplate() &&\n !gridService.selectionColumnVisible() &&\n gridService.visibleColumns().length === 0\n \"\n scope=\"col\"\n [attr.aria-label]=\"gridService.messages().rowReorder\"\n class=\"border-e border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></th>\n }\n @if (gridService.masterDetailTemplate()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n scope=\"col\"\n class=\"border-e border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.detailColumnWidth\"></th>\n }\n @if (gridService.selectionColumnVisible()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"\n (gridService.rowReorderColumnVisible() ? 1 : 0) +\n (gridService.masterDetailTemplate() ? 1 : 0)\n \"\n [section]=\"'header'\"\n [firstInRow]=\"\n !gridService.rowReorderColumnVisible() &&\n !gridService.masterDetailTemplate() &&\n gridService.groupColumns().length === 0\n \"\n [lastInRow]=\"gridService.visibleColumns().length === 0\"\n scope=\"col\"\n class=\"border-e border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.selectionColumnWidth\">\n @if (\n gridService.selectableOptions().mode === \"multiple\" &&\n gridService.selectableOptions().showSelectAll !== false\n ) {\n <mona-grid-select-all-checkbox />\n }\n </th>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n @let colIndex = $index + gridService.leadingLogicalColumnCount();\n <th\n scope=\"col\"\n role=\"columnheader\"\n cdkDrag\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'header'\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [colIndex]=\"colIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"colIndex === gridService.leadingLogicalColumnCount()\"\n [lastInRow]=\"\n colIndex ===\n gridService.leadingLogicalColumnCount() + gridService.visibleColumns().length - 1\n \"\n (toggleExpand)=\"onColumnSort(column)\"\n [cdkDragData]=\"column\"\n [cdkDragDisabled]=\"isColumnDragDisabled(column)\"\n [class]=\"headerTableCellClass()\"\n (mouseenter)=\"onColumnMouseEnter(column)\"\n (cdkDragEntered)=\"onColumnDragEnter($event)\"\n (cdkDragStarted)=\"onColumnDragStart($event)\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\"\n [attr.colspan]=\"1\"\n [attr.aria-sort]=\"\n gridService.sortableOptions().enabled\n ? (column.columnSortDirection | columnAriaSort)\n : null\n \">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: column, column }\"></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\n <div [class]=\"columnActionsClass()\" [attr.data-column-actions]=\"true\">\n @if (\n gridService.sortableOptions().enabled && column.columnSortDirection !== null\n ) {\n <div class=\"inline-flex shrink-0 items-center gap-0.5\">\n @if (column.columnSortDirection === \"asc\") {\n <svg lucideArrowDown [size]=\"16\" aria-hidden=\"true\"></svg>\n } @else {\n <svg lucideArrowUp [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\">{{ column.sortIndex }}</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)=\"onColumnFilter(column, $event)\"></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 [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\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [class]=\"headerTableCellClass()\"\n [style.min-width.px]=\"column.minWidth\"\n [attr.colspan]=\"1\"\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 }\n </tr>\n @if (filterRowEnabled()) {\n <tr role=\"row\" [class]=\"headerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"gridService.groupColumnWidth\"></th>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></th>\n }\n @if (gridService.masterDetailTemplate()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"gridService.detailColumnWidth\"></th>\n }\n @if (gridService.selectionColumnVisible()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"gridService.selectionColumnWidth\"></th>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n <th\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n scope=\"col\"\n class=\"border-e border-border overflow-hidden\"\n [style.width.px]=\"column.calculatedWidth\"\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 }\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 [columns]=\"gridService.visibleColumns()\" [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 [columns]=\"gridService.visibleColumns()\" [data]=\"gridService.viewPageRows()\" />\n } @else if (!gridService.serverLoading()) {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\" />\n }\n @if (gridService.serverLoading()) {\n <div class=\"absolute inset-0 z-20 flex items-center justify-center bg-surface/60\" 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>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of gridService.visibleColumns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <tfoot role=\"rowgroup\">\n <tr role=\"row\" [class]=\"footerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [footerCellWidth]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n [footerCellWidth]=\"gridService.rowReorderColumnWidth\"></td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n [footerCellWidth]=\"gridService.detailColumnWidth\"></td>\n }\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n [footerCellWidth]=\"gridService.selectionColumnWidth\"></td>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [footerColumn]=\"column\">\n <mona-grid-footer-cell\n [column]=\"column\"\n [columnIndex]=\"$index\"></mona-grid-footer-cell>\n </td>\n }\n </tr>\n </tfoot>\n </table>\n </div>\n </div>\n }\n }\n }\n } @placeholder {\n <mona-placeholder text=\"Loading...\" />\n }\n</div>\n@if (!gridService.virtualScrollOptions().enabled) {\n @if (gridService.serverBindingEnabled() || gridService.viewPageRows().length !== 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 (pageSizeChange)=\"onPageSizeChange($event)\"\n (pageChange)=\"onPageChange($event)\"></mona-pager>\n }\n}\n\n<ng-template #emptyGridTemplate>\n <div [class]=\"noDataClass()\">\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</ng-template>\n" }]
|
|
5910
|
+
}], ctorParameters: () => [], propDecorators: { columnDefinitions: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => GRID_COLUMN_DEFINITION), { isSignal: true }] }], footerScrollElement: [{ type: i0.ViewChild, args: ["footerScrollElement", { isSignal: true }] }], gridDetailTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridDetailTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], gridHeaderElement: [{ type: i0.ViewChild, args: ["gridHeaderElement", { isSignal: true }] }], gridHeaderTableElement: [{ type: i0.ViewChild, args: ["headerTable", { isSignal: true }] }], groupColumnList: [{ type: i0.ViewChild, args: ["groupColumnList", { isSignal: true }] }], noDataTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridNoDataTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], toolbarElement: [{ type: i0.ViewChild, args: ["toolbarElement", { isSignal: true }] }], toolbarTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridToolbarTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], pageSizeValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeValues", required: false }] }], resizeMethod: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizeMethod", required: false }] }], responsivePager: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsivePager", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], rowKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowKey", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } }) });
|
|
5647
5911
|
|
|
5648
5912
|
/*
|
|
5649
5913
|
* Public API Surface of @nanahoshi/mona-ui/grid
|
|
@@ -5653,5 +5917,5 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.0.6", ng
|
|
|
5653
5917
|
* Generated bundle index. Do not edit.
|
|
5654
5918
|
*/
|
|
5655
5919
|
|
|
5656
|
-
export {
|
|
5657
|
-
//# sourceMappingURL=nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-
|
|
5920
|
+
export { GridRemoveEvent as $, gridFooterTableCellThemeVariants as A, GRID_DEFAULT_MESSAGES as B, CellEditEvent as C, GridAddCommandDirective as D, GridAddEvent as E, GridCancelCommandDirective as F, GridNavigationService as G, GridCancelEvent as H, GridCellTemplateDirective as I, GridColumnComponent as J, GridColumnTitleTemplateDirective as K, GridCommandColumnComponent as L, GridComponent as M, GridContextMenuDirective as N, GridDetailTemplateDirective as O, GridEditCommandDirective as P, GridEditEvent as Q, GridEditTemplateDirective as R, GridEditableDirective as S, GridExportDirective as T, GridFilterableDirective as U, GridFooterTemplateDirective as V, GridGroupFooterTemplateDirective as W, GridGroupableDirective as X, GridHeaderTemplateDirective as Y, GridNoDataTemplateDirective as Z, GridRemoveCommandDirective as _, GridRowFlattenerService as a, GridReorderableDirective as a0, GridResizableDirective as a1, GridRowReorderableDirective as a2, GridSaveCommandDirective as a3, GridSaveEvent as a4, GridSelectableDirective as a5, GridServerBindingDirective as a6, GridSortableDirective as a7, GridStatePersistenceDirective as a8, GridToolbarTemplateDirective as a9, GridVirtualScrollDirective as aa, RowEditEvent as ab, RowReorderEvent as ac, gridFooterTableRowThemeVariants as b, GridService as c, gridGroupRowThemeVariants as d, gridRowDragPlaceholderThemeVariants as e, gridRowDragPreviewThemeVariants as f, gridListBaseThemeVariants as g, gridListTableThemeVariants as h, GridLogicalCellDirective as i, GridLockedCellDirective as j, gridFooterThemeVariants as k, gridFooterTableThemeVariants as l, GRID_DEFAULT_VIRTUAL_ROW_HEIGHT as m, gridListTableCellThemeVariants as n, gridDetailContentCellThemeVariants as o, gridDetailIndentCellThemeVariants as p, gridDetailRowThemeVariants as q, gridListTableRowThemeVariants as r, gridCellEditorBaseThemeVariants as s, gridCellEditorInputThemeVariants as t, gridCellBaseThemeVariants as u, gridCellContainerThemeVariants as v, gridCellDirtyIndicatorThemeVariants as w, gridCellTextThemeVariants as x, gridRowReorderHandleThemeVariants as y, gridSelectionCellThemeVariants as z };
|
|
5921
|
+
//# sourceMappingURL=nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CIfTr1Qm.mjs.map
|