@nanahoshi/mona-ui 0.22.0 → 0.23.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-grid-grid-footer-row.component--nF_Q7Bd.mjs +169 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-S2qxwP2M.mjs +176 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-BDMX9KGc.mjs → nanahoshi-mona-ui-grid-grid-row.component-Dwy8hCm7.mjs} +201 -192
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DArxdAah.mjs +173 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CIfTr1Qm.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-bduDEm-x.mjs} +553 -666
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-grid.d.ts +126 -26
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-cell.component-cJjJ1b6M.mjs +0 -108
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-CkkLBnoI.mjs +0 -44
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-Do-ktlth.mjs +0 -164
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-Cs1gPJps.mjs +0 -239
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PreventableEvent, deepEquals } from '@nanahoshi/mona-ui/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Directive, signal, computed, inject, DOCUMENT, Injector, PLATFORM_ID, effect,
|
|
3
|
+
import { Directive, Injectable, signal, computed, inject, DOCUMENT, Injector, PLATFORM_ID, effect, 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';
|
|
7
|
-
import { ImmutableList, ImmutableDictionary, ImmutableSet, KeyValuePair,
|
|
7
|
+
import { Dictionary, ImmutableList, ImmutableDictionary, ImmutableSet, KeyValuePair, select, sequenceEqual, orderBy, any } from '@mirei/ts-collections';
|
|
8
8
|
import { MonaI18nService, injectComponentDirection } from '@nanahoshi/mona-ui/i18n';
|
|
9
9
|
import { Query } from '@nanahoshi/mona-ui/query';
|
|
10
10
|
import { Subject, BehaviorSubject, filter, startWith, pairwise, map, skip, fromEvent, take, debounceTime } from 'rxjs';
|
|
@@ -264,6 +264,122 @@ const GRID_DEFAULT_MESSAGES = {
|
|
|
264
264
|
selectRow: (rowNumber) => `Select row ${rowNumber}`
|
|
265
265
|
};
|
|
266
266
|
|
|
267
|
+
/**
|
|
268
|
+
* A stateless service that groups and flattens rows into a linear `GridViewRow[]`
|
|
269
|
+
* suitable for rendering by both paginated and virtual-scrolled grid list components.
|
|
270
|
+
*/
|
|
271
|
+
class GridRowFlattenerService {
|
|
272
|
+
/**
|
|
273
|
+
* Builds a deterministic, hierarchical group key.
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* buildGroupKey(null, "Country", "USA") // => "Country:USA"
|
|
277
|
+
* buildGroupKey("Country:USA", "City", "NYC") // => "Country:USA/City:NYC"
|
|
278
|
+
*/
|
|
279
|
+
buildGroupKey(parentKey, field, value) {
|
|
280
|
+
const segment = `${field}:${String(value ?? "")}`;
|
|
281
|
+
return parentKey != null ? `${parentKey}/${segment}` : segment;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Groups rows by the given columns and flattens them into a linear `GridViewRow[]`.
|
|
285
|
+
*
|
|
286
|
+
* @param rows - The source data rows.
|
|
287
|
+
* @param groupColumns - The ordered list of columns to group by.
|
|
288
|
+
* @param collapsedKeys - The set of group keys that are currently collapsed.
|
|
289
|
+
* @param groupAggregates - The dictionary of group aggregates.
|
|
290
|
+
* @param orderGroups - Orders buckets by direction. Disable for client rows already ordered by Query.
|
|
291
|
+
* @returns A flat array of `GridViewRow` items.
|
|
292
|
+
*/
|
|
293
|
+
flatten(rows, groupColumns, collapsedKeys, showFooter, groupAggregates = new Dictionary(), orderGroups = true) {
|
|
294
|
+
const columnArray = [...groupColumns];
|
|
295
|
+
if (columnArray.length === 0) {
|
|
296
|
+
return [];
|
|
297
|
+
}
|
|
298
|
+
const result = [];
|
|
299
|
+
this.#flattenRecursive([...rows], columnArray, groupAggregates, 0, null, collapsedKeys, showFooter, orderGroups, result);
|
|
300
|
+
return result;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Wraps ungrouped rows as data view rows, so grouped and ungrouped bodies render from the same shape.
|
|
304
|
+
*/
|
|
305
|
+
toDataRows(rows) {
|
|
306
|
+
return Array.from(rows, row => this.#createDataRow(row, 0, null));
|
|
307
|
+
}
|
|
308
|
+
#createDataRow(row, depth, groupKey) {
|
|
309
|
+
return { depth, groupKey, key: `row:${row.uid}`, row, type: "data" };
|
|
310
|
+
}
|
|
311
|
+
#flattenRecursive(rows, groupColumns, groupAggregates, depth, parentKey, collapsedKeys, showFooter, orderGroups, result) {
|
|
312
|
+
const column = groupColumns[depth];
|
|
313
|
+
if (column == null) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
const field = column.field;
|
|
317
|
+
const isDate = column.dataType === "date";
|
|
318
|
+
const groupMap = new Map();
|
|
319
|
+
const keyOrder = [];
|
|
320
|
+
for (const row of rows) {
|
|
321
|
+
const rawValue = row.data[field];
|
|
322
|
+
const mapKey = isDate && rawValue instanceof Date ? rawValue.toISOString() : rawValue;
|
|
323
|
+
if (!groupMap.has(mapKey)) {
|
|
324
|
+
groupMap.set(mapKey, []);
|
|
325
|
+
keyOrder.push(mapKey);
|
|
326
|
+
}
|
|
327
|
+
groupMap.get(mapKey).push(row);
|
|
328
|
+
}
|
|
329
|
+
const entries = keyOrder.map((mapKey, index) => ({ mapKey, index, rows: groupMap.get(mapKey) }));
|
|
330
|
+
const direction = column.groupSortDirection;
|
|
331
|
+
if (orderGroups && direction != null) {
|
|
332
|
+
entries.sort((left, right) => {
|
|
333
|
+
const comparison = compareGridComparableValues(toGridComparableValue(left.rows[0].data[field]), toGridComparableValue(right.rows[0].data[field]));
|
|
334
|
+
return (direction === "asc" ? comparison : -comparison) || left.index - right.index;
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
for (const { mapKey } of entries) {
|
|
338
|
+
const groupRows = groupMap.get(mapKey);
|
|
339
|
+
const groupValue = groupRows[0].data[field];
|
|
340
|
+
const groupKey = this.buildGroupKey(parentKey, field, groupValue);
|
|
341
|
+
const groupRow = {
|
|
342
|
+
count: groupRows.length,
|
|
343
|
+
depth,
|
|
344
|
+
field,
|
|
345
|
+
groupKey,
|
|
346
|
+
groupValue,
|
|
347
|
+
key: `group:${groupKey}`,
|
|
348
|
+
title: column.title,
|
|
349
|
+
type: "group"
|
|
350
|
+
};
|
|
351
|
+
result.push(groupRow);
|
|
352
|
+
const isCollapsed = collapsedKeys.has(groupKey);
|
|
353
|
+
if (!isCollapsed) {
|
|
354
|
+
if (depth < groupColumns.length - 1) {
|
|
355
|
+
this.#flattenRecursive(groupRows, groupColumns, groupAggregates, depth + 1, groupKey, collapsedKeys, showFooter, orderGroups, result);
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
for (const row of groupRows) {
|
|
359
|
+
result.push(this.#createDataRow(row, depth, groupKey));
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
const groupAggregate = groupAggregates.get(groupKey);
|
|
364
|
+
if (groupAggregate != null && (!isCollapsed || showFooter)) {
|
|
365
|
+
const groupFooterRow = {
|
|
366
|
+
depth,
|
|
367
|
+
groupAggregate,
|
|
368
|
+
key: `groupFooter:${groupKey}`,
|
|
369
|
+
type: "groupFooter"
|
|
370
|
+
};
|
|
371
|
+
result.push(groupFooterRow);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridRowFlattenerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
376
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridRowFlattenerService, providedIn: "root" }); }
|
|
377
|
+
}
|
|
378
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridRowFlattenerService, decorators: [{
|
|
379
|
+
type: Injectable,
|
|
380
|
+
args: [{ providedIn: "root" }]
|
|
381
|
+
}] });
|
|
382
|
+
|
|
267
383
|
const GRID_STATE_VERSION = 1;
|
|
268
384
|
class GridService {
|
|
269
385
|
#anchorRowKey;
|
|
@@ -283,6 +399,7 @@ class GridService {
|
|
|
283
399
|
#platformId;
|
|
284
400
|
#reorderableOptions;
|
|
285
401
|
#resizableOptions;
|
|
402
|
+
#rowFlattener;
|
|
286
403
|
#rowReorderableOptions;
|
|
287
404
|
#rowUidByData;
|
|
288
405
|
#rowUidByKeyObject;
|
|
@@ -342,6 +459,7 @@ class GridService {
|
|
|
342
459
|
...(ngDevMode ? [{ debugName: "#reorderableOptions" }] : /* istanbul ignore next */ []));
|
|
343
460
|
this.#resizableOptions = signal({ enabled: false }, /* @ts-ignore */
|
|
344
461
|
...(ngDevMode ? [{ debugName: "#resizableOptions" }] : /* istanbul ignore next */ []));
|
|
462
|
+
this.#rowFlattener = inject(GridRowFlattenerService);
|
|
345
463
|
this.#rowReorderableOptions = signal({ enabled: false }, /* @ts-ignore */
|
|
346
464
|
...(ngDevMode ? [{ debugName: "#rowReorderableOptions" }] : /* istanbul ignore next */ []));
|
|
347
465
|
this.#rowUidByData = new WeakMap();
|
|
@@ -420,11 +538,7 @@ class GridService {
|
|
|
420
538
|
this.contextMenuItems = signal(ImmutableSet.create(), /* @ts-ignore */
|
|
421
539
|
...(ngDevMode ? [{ debugName: "contextMenuItems" }] : /* istanbul ignore next */ []));
|
|
422
540
|
this.dataStateChange$ = new Subject();
|
|
423
|
-
this.detailColumnOffset = computed(() => this.structuralColumnOffset("detail", this.groupStructuralWidth()), /* @ts-ignore */
|
|
424
|
-
...(ngDevMode ? [{ debugName: "detailColumnOffset" }] : /* istanbul ignore next */ []));
|
|
425
541
|
this.detailColumnWidth = 36;
|
|
426
|
-
this.detailStructuralWidth = computed(() => this.masterDetailTemplate() != null ? this.detailColumnWidth : 0, /* @ts-ignore */
|
|
427
|
-
...(ngDevMode ? [{ debugName: "detailStructuralWidth" }] : /* istanbul ignore next */ []));
|
|
428
542
|
this.draggingRowUid = signal(null, /* @ts-ignore */
|
|
429
543
|
...(ngDevMode ? [{ debugName: "draggingRowUid" }] : /* istanbul ignore next */ []));
|
|
430
544
|
this.edit$ = new Subject();
|
|
@@ -494,63 +608,84 @@ class GridService {
|
|
|
494
608
|
this.horizontalScrollLeft = this.#horizontalScrollLeft.asReadonly();
|
|
495
609
|
this.isInEditMode = computed(() => this.#editSession() != null, /* @ts-ignore */
|
|
496
610
|
...(ngDevMode ? [{ debugName: "isInEditMode" }] : /* istanbul ignore next */ []));
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
const
|
|
502
|
-
const
|
|
503
|
-
if (lastVisible != null) {
|
|
504
|
-
return this.structuralColumnOffset(lastVisible.kind, this.groupStructuralWidth());
|
|
505
|
-
}
|
|
611
|
+
// The physical column sequence shared by every table section: group indents, then the visible
|
|
612
|
+
// structural columns, then the visible user columns. Each entry also carries its sticky state.
|
|
613
|
+
this.layout = computed(() => {
|
|
614
|
+
const columns = this.visibleColumns().toArray();
|
|
615
|
+
const startLockedColumns = columns.filter(column => column.locked && column.lockedPosition === "left");
|
|
616
|
+
const endLockedColumns = columns.filter(column => column.locked && column.lockedPosition === "right");
|
|
506
617
|
const groupCount = this.groupColumns().length;
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
618
|
+
const structuralColumns = this.visibleStructuralColumns();
|
|
619
|
+
const leadingColumnCount = groupCount + structuralColumns.length;
|
|
620
|
+
// Group indents and structural columns stay pinned alongside any start-pinned column. The innermost
|
|
621
|
+
// pinned column draws the separator, so the leading columns only own it without start-locked columns.
|
|
622
|
+
const leadingSticky = this.hasLeftLockedColumns();
|
|
623
|
+
const leadingEdgeIndex = startLockedColumns.length === 0 ? leadingColumnCount - 1 : -1;
|
|
624
|
+
let startOffset = 0;
|
|
625
|
+
const nextLeadingSticky = (index, width) => {
|
|
626
|
+
const offset = startOffset;
|
|
627
|
+
startOffset += width;
|
|
628
|
+
return leadingSticky ? { edge: index === leadingEdgeIndex, offset, side: "start" } : null;
|
|
629
|
+
};
|
|
630
|
+
const layout = [];
|
|
631
|
+
for (let depth = 0; depth < groupCount; depth++) {
|
|
632
|
+
layout.push({
|
|
633
|
+
depth,
|
|
634
|
+
key: `group:${depth}`,
|
|
635
|
+
kind: "group",
|
|
636
|
+
logicalIndex: null,
|
|
637
|
+
sticky: nextLeadingSticky(depth, this.groupColumnWidth),
|
|
638
|
+
width: this.groupColumnWidth
|
|
639
|
+
});
|
|
520
640
|
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
states.set(column.id, {
|
|
532
|
-
edge: index === leftColumns.length - 1,
|
|
533
|
-
offset: leftOffset,
|
|
534
|
-
side: "left"
|
|
641
|
+
// Arrow keys move across structural and user columns as one row.
|
|
642
|
+
for (const [index, structuralColumn] of structuralColumns.entries()) {
|
|
643
|
+
layout.push({
|
|
644
|
+
firstInRow: index === 0,
|
|
645
|
+
key: `structural:${structuralColumn.kind}`,
|
|
646
|
+
kind: structuralColumn.kind,
|
|
647
|
+
lastInRow: columns.length === 0 && index === structuralColumns.length - 1,
|
|
648
|
+
logicalIndex: index,
|
|
649
|
+
sticky: nextLeadingSticky(groupCount + index, structuralColumn.width),
|
|
650
|
+
width: structuralColumn.width
|
|
535
651
|
});
|
|
536
|
-
leftOffset += this.getColumnWidth(column);
|
|
537
652
|
}
|
|
538
|
-
let
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
653
|
+
let logicalIndex = structuralColumns.length;
|
|
654
|
+
const stickyByColumn = new Map();
|
|
655
|
+
for (const [index, column] of startLockedColumns.entries()) {
|
|
656
|
+
stickyByColumn.set(column, {
|
|
657
|
+
edge: index === startLockedColumns.length - 1,
|
|
658
|
+
offset: startOffset,
|
|
659
|
+
side: "start"
|
|
660
|
+
});
|
|
661
|
+
startOffset += this.getColumnWidth(column);
|
|
662
|
+
}
|
|
663
|
+
let endOffset = 0;
|
|
664
|
+
for (const column of [...endLockedColumns].reverse()) {
|
|
665
|
+
stickyByColumn.set(column, { edge: column === endLockedColumns[0], offset: endOffset, side: "end" });
|
|
666
|
+
endOffset += this.getColumnWidth(column);
|
|
667
|
+
}
|
|
668
|
+
for (const [columnIndex, column] of columns.entries()) {
|
|
669
|
+
layout.push({
|
|
670
|
+
column,
|
|
671
|
+
columnIndex,
|
|
672
|
+
firstInRow: structuralColumns.length === 0 && columnIndex === 0,
|
|
673
|
+
key: `column:${column.id}`,
|
|
674
|
+
kind: "column",
|
|
675
|
+
lastInRow: columnIndex === columns.length - 1,
|
|
676
|
+
logicalIndex: logicalIndex++,
|
|
677
|
+
sticky: stickyByColumn.get(column) ?? null,
|
|
678
|
+
width: column.calculatedWidth
|
|
544
679
|
});
|
|
545
|
-
rightOffset += this.getColumnWidth(column);
|
|
546
680
|
}
|
|
547
|
-
return
|
|
681
|
+
return layout;
|
|
548
682
|
}, /* @ts-ignore */
|
|
549
|
-
...(ngDevMode ? [{ debugName: "
|
|
550
|
-
this.
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
683
|
+
...(ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []));
|
|
684
|
+
this.layoutColumnByKey = computed(() => new Map(this.layout().map(layoutColumn => [layoutColumn.key, layoutColumn])), /* @ts-ignore */
|
|
685
|
+
...(ngDevMode ? [{ debugName: "layoutColumnByKey" }] : /* istanbul ignore next */ []));
|
|
686
|
+
this.leadingStructuralWidth = computed(() => this.groupStructuralWidth() +
|
|
687
|
+
this.visibleStructuralColumns().reduce((total, column) => total + column.width, 0), /* @ts-ignore */
|
|
688
|
+
...(ngDevMode ? [{ debugName: "leadingStructuralWidth" }] : /* istanbul ignore next */ []));
|
|
554
689
|
this.masterDetailRowWidth = computed(() => {
|
|
555
690
|
const columns = this.visibleColumns();
|
|
556
691
|
const columnListWidth = columns.aggregate((acc, c) => acc + this.getColumnWidth(c), 0);
|
|
@@ -569,14 +704,14 @@ class GridService {
|
|
|
569
704
|
this.remove$ = new Subject();
|
|
570
705
|
this.reorderableOptions = this.#reorderableOptions.asReadonly();
|
|
571
706
|
this.resizableOptions = this.#resizableOptions.asReadonly();
|
|
707
|
+
this.rowClass = signal(null, /* @ts-ignore */
|
|
708
|
+
...(ngDevMode ? [{ debugName: "rowClass" }] : /* istanbul ignore next */ []));
|
|
572
709
|
this.rowDragInProgress = computed(() => this.draggingRowUid() != null, /* @ts-ignore */
|
|
573
710
|
...(ngDevMode ? [{ debugName: "rowDragInProgress" }] : /* istanbul ignore next */ []));
|
|
574
711
|
this.rowEdit$ = new Subject();
|
|
575
712
|
this.rowKey = signal(null, /* @ts-ignore */
|
|
576
713
|
...(ngDevMode ? [{ debugName: "rowKey" }] : /* istanbul ignore next */ []));
|
|
577
714
|
this.rowReorder$ = new Subject();
|
|
578
|
-
this.rowReorderColumnOffset = computed(() => this.structuralColumnOffset("reorder", this.groupStructuralWidth()), /* @ts-ignore */
|
|
579
|
-
...(ngDevMode ? [{ debugName: "rowReorderColumnOffset" }] : /* istanbul ignore next */ []));
|
|
580
715
|
this.rowReorderColumnVisible = computed(() => this.rowReorderableOptions().enabled === true, /* @ts-ignore */
|
|
581
716
|
...(ngDevMode ? [{ debugName: "rowReorderColumnVisible" }] : /* istanbul ignore next */ []));
|
|
582
717
|
this.rowReorderColumnWidth = 36;
|
|
@@ -610,8 +745,6 @@ class GridService {
|
|
|
610
745
|
...(ngDevMode ? [{ debugName: "rowReorderDisabledReason" }] : /* istanbul ignore next */ []));
|
|
611
746
|
this.rowReorderInteractionEnabled = computed(() => this.rowReorderDisabledReason() == null, /* @ts-ignore */
|
|
612
747
|
...(ngDevMode ? [{ debugName: "rowReorderInteractionEnabled" }] : /* istanbul ignore next */ []));
|
|
613
|
-
this.rowReorderStructuralWidth = computed(() => this.rowReorderColumnVisible() ? this.rowReorderColumnWidth : 0, /* @ts-ignore */
|
|
614
|
-
...(ngDevMode ? [{ debugName: "rowReorderStructuralWidth" }] : /* istanbul ignore next */ []));
|
|
615
748
|
this.rowReorderableOptions = this.#rowReorderableOptions.asReadonly();
|
|
616
749
|
this.rows = signal(ImmutableList.create(), /* @ts-ignore */
|
|
617
750
|
...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
@@ -642,16 +775,12 @@ class GridService {
|
|
|
642
775
|
.toImmutableSet();
|
|
643
776
|
}, /* @ts-ignore */
|
|
644
777
|
...(ngDevMode ? [{ debugName: "selectedRows" }] : /* istanbul ignore next */ []));
|
|
645
|
-
this.selectionColumnOffset = computed(() => this.structuralColumnOffset("selection", this.groupStructuralWidth()), /* @ts-ignore */
|
|
646
|
-
...(ngDevMode ? [{ debugName: "selectionColumnOffset" }] : /* istanbul ignore next */ []));
|
|
647
778
|
this.selectionColumnVisible = computed(() => {
|
|
648
779
|
const options = this.selectableOptions();
|
|
649
780
|
return options.enabled === true && options.showCheckboxes === true;
|
|
650
781
|
}, /* @ts-ignore */
|
|
651
782
|
...(ngDevMode ? [{ debugName: "selectionColumnVisible" }] : /* istanbul ignore next */ []));
|
|
652
783
|
this.selectionColumnWidth = 40;
|
|
653
|
-
this.selectionStructuralWidth = computed(() => this.selectionColumnVisible() ? this.selectionColumnWidth : 0, /* @ts-ignore */
|
|
654
|
-
...(ngDevMode ? [{ debugName: "selectionStructuralWidth" }] : /* istanbul ignore next */ []));
|
|
655
784
|
this.serverBindingEnabled = this.#serverBindingEnabled.asReadonly();
|
|
656
785
|
this.serverLoading = this.#serverLoading.asReadonly();
|
|
657
786
|
this.serverTotal = this.#serverTotal.asReadonly();
|
|
@@ -668,25 +797,13 @@ class GridService {
|
|
|
668
797
|
showIndices: true
|
|
669
798
|
}, /* @ts-ignore */
|
|
670
799
|
...(ngDevMode ? [{ debugName: "sortableOptions" }] : /* istanbul ignore next */ []));
|
|
671
|
-
|
|
672
|
-
const map = new Map();
|
|
673
|
-
this.visibleStructuralColumns().forEach((column, index) => map.set(column.kind, index));
|
|
674
|
-
return map;
|
|
675
|
-
}, /* @ts-ignore */
|
|
676
|
-
...(ngDevMode ? [{ debugName: "structuralColIndexMap" }] : /* istanbul ignore next */ []));
|
|
677
|
-
// Single source of truth for structural-column left-to-right order; every offset/colIndex
|
|
678
|
-
// consumer derives its answer from this array instead of independently re-deriving the order.
|
|
800
|
+
// The fixed order of the structural columns; GridService.layout places them after the group indents.
|
|
679
801
|
this.structuralColumns = computed(() => [
|
|
680
802
|
{ kind: "reorder", visible: this.rowReorderColumnVisible(), width: this.rowReorderColumnWidth },
|
|
681
803
|
{ kind: "detail", visible: this.masterDetailTemplate() != null, width: this.detailColumnWidth },
|
|
682
804
|
{ kind: "selection", visible: this.selectionColumnVisible(), width: this.selectionColumnWidth }
|
|
683
805
|
], /* @ts-ignore */
|
|
684
806
|
...(ngDevMode ? [{ debugName: "structuralColumns" }] : /* istanbul ignore next */ []));
|
|
685
|
-
this.structuralLastKind = computed(() => {
|
|
686
|
-
const visible = this.visibleStructuralColumns();
|
|
687
|
-
return visible.length > 0 ? visible[visible.length - 1].kind : null;
|
|
688
|
-
}, /* @ts-ignore */
|
|
689
|
-
...(ngDevMode ? [{ debugName: "structuralLastKind" }] : /* istanbul ignore next */ []));
|
|
690
807
|
this.tableWidth = computed(() => {
|
|
691
808
|
const columns = this.visibleColumns();
|
|
692
809
|
if (!columns.any()) {
|
|
@@ -955,6 +1072,18 @@ class GridService {
|
|
|
955
1072
|
this.rowEdit$.next(new RowEditEvent({ originalRowData: context.row.data, rowData, session }));
|
|
956
1073
|
return true;
|
|
957
1074
|
}
|
|
1075
|
+
/**
|
|
1076
|
+
* Builds the body rows for the given data rows: plain data rows when ungrouped, otherwise the flattened
|
|
1077
|
+
* group headers, data rows and group footers. Reads grouping state, so call it inside a computed.
|
|
1078
|
+
*/
|
|
1079
|
+
createBodyRows(rows) {
|
|
1080
|
+
const groupColumns = this.groupColumns();
|
|
1081
|
+
if (groupColumns.length === 0) {
|
|
1082
|
+
return this.#rowFlattener.toDataRows(rows);
|
|
1083
|
+
}
|
|
1084
|
+
const groupAggregates = this.groupAggregateMap().toDictionary(e => e.key, e => e.value);
|
|
1085
|
+
return this.#rowFlattener.flatten(rows, groupColumns, new Set(this.collapsedGroupKeys()), this.groupableOptions().showFooter, groupAggregates, this.serverBindingEnabled());
|
|
1086
|
+
}
|
|
958
1087
|
deselectAllRows() {
|
|
959
1088
|
this.selectedKeys.update(set => set.clear());
|
|
960
1089
|
}
|
|
@@ -1600,16 +1729,6 @@ class GridService {
|
|
|
1600
1729
|
this.clearEditSession();
|
|
1601
1730
|
return true;
|
|
1602
1731
|
}
|
|
1603
|
-
structuralColumnOffset(kind, groupPrefixWidth) {
|
|
1604
|
-
let offset = groupPrefixWidth;
|
|
1605
|
-
for (const column of this.visibleStructuralColumns()) {
|
|
1606
|
-
if (column.kind === kind) {
|
|
1607
|
-
return offset;
|
|
1608
|
-
}
|
|
1609
|
-
offset += column.width;
|
|
1610
|
-
}
|
|
1611
|
-
return offset;
|
|
1612
|
-
}
|
|
1613
1732
|
toggleGroupCollapse(groupKey) {
|
|
1614
1733
|
this.collapsedGroupKeys.update(keys => (keys.contains(groupKey) ? keys.remove(groupKey) : keys.add(groupKey)));
|
|
1615
1734
|
}
|
|
@@ -3442,80 +3561,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
3442
3561
|
}]
|
|
3443
3562
|
}], ctorParameters: () => [], propDecorators: { column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: true }] }], resizeEnd: [{ type: i0.Output, args: ["resizeEnd"] }], resizeStart: [{ type: i0.Output, args: ["resizeStart"] }] } });
|
|
3444
3563
|
|
|
3564
|
+
const STICKY_EDGE_BORDER = "1px solid var(--color-border)";
|
|
3565
|
+
/**
|
|
3566
|
+
* Pins a cell while the grid scrolls horizontally, using the sticky state of its layout column.
|
|
3567
|
+
* Offsets and separator borders use logical properties so pinning follows the text direction.
|
|
3568
|
+
*/
|
|
3445
3569
|
class GridLockedCellDirective {
|
|
3446
3570
|
constructor() {
|
|
3447
|
-
this.#hostElementRef = inject((ElementRef));
|
|
3448
3571
|
this.#gridService = inject(GridService);
|
|
3572
|
+
this.#hostElementRef = inject((ElementRef));
|
|
3449
3573
|
this.bodyLocked = computed(() => this.state() != null && !this.lockedCellHeader(), /* @ts-ignore */
|
|
3450
3574
|
...(ngDevMode ? [{ debugName: "bodyLocked" }] : /* istanbul ignore next */ []));
|
|
3451
|
-
this.
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
return
|
|
3456
|
-
}, /* @ts-ignore */
|
|
3457
|
-
...(ngDevMode ? [{ debugName: "borderLeft" }] : /* istanbul ignore next */ []));
|
|
3458
|
-
this.borderRight = computed(() => {
|
|
3459
|
-
if (!this.leftEdge()) {
|
|
3460
|
-
return null;
|
|
3461
|
-
}
|
|
3462
|
-
return `1px solid var(--color-border)`;
|
|
3575
|
+
this.endEdge = computed(() => this.state()?.side === "end" && this.state()?.edge === true, /* @ts-ignore */
|
|
3576
|
+
...(ngDevMode ? [{ debugName: "endEdge" }] : /* istanbul ignore next */ []));
|
|
3577
|
+
this.endOffset = computed(() => {
|
|
3578
|
+
const state = this.state();
|
|
3579
|
+
return state?.side === "end" ? state.offset : null;
|
|
3463
3580
|
}, /* @ts-ignore */
|
|
3464
|
-
...(ngDevMode ? [{ debugName: "
|
|
3581
|
+
...(ngDevMode ? [{ debugName: "endOffset" }] : /* istanbul ignore next */ []));
|
|
3465
3582
|
this.footerCell = this.#hostElementRef.nativeElement.hasAttribute("monaGridFooterTableCell");
|
|
3466
3583
|
this.headerLocked = computed(() => this.state() != null && this.lockedCellHeader(), /* @ts-ignore */
|
|
3467
3584
|
...(ngDevMode ? [{ debugName: "headerLocked" }] : /* istanbul ignore next */ []));
|
|
3468
|
-
this.
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
}, /* @ts-ignore */
|
|
3472
|
-
...(ngDevMode ? [{ debugName: "leftEdge" }] : /* istanbul ignore next */ []));
|
|
3473
|
-
this.leftOffset = computed(() => {
|
|
3474
|
-
const state = this.state();
|
|
3475
|
-
return state?.side === "left" ? state.offset : null;
|
|
3476
|
-
}, /* @ts-ignore */
|
|
3477
|
-
...(ngDevMode ? [{ debugName: "leftOffset" }] : /* istanbul ignore next */ []));
|
|
3478
|
-
this.position = computed(() => (this.state() == null ? null : "sticky"), /* @ts-ignore */
|
|
3479
|
-
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
3480
|
-
this.rightEdge = computed(() => {
|
|
3481
|
-
const state = this.state();
|
|
3482
|
-
return state?.side === "right" && state.edge;
|
|
3483
|
-
}, /* @ts-ignore */
|
|
3484
|
-
...(ngDevMode ? [{ debugName: "rightEdge" }] : /* istanbul ignore next */ []));
|
|
3485
|
-
this.rightOffset = computed(() => {
|
|
3585
|
+
this.startEdge = computed(() => this.state()?.side === "start" && this.state()?.edge === true, /* @ts-ignore */
|
|
3586
|
+
...(ngDevMode ? [{ debugName: "startEdge" }] : /* istanbul ignore next */ []));
|
|
3587
|
+
this.startOffset = computed(() => {
|
|
3486
3588
|
const state = this.state();
|
|
3487
|
-
return state?.side === "
|
|
3589
|
+
return state?.side === "start" ? state.offset : null;
|
|
3488
3590
|
}, /* @ts-ignore */
|
|
3489
|
-
...(ngDevMode ? [{ debugName: "
|
|
3591
|
+
...(ngDevMode ? [{ debugName: "startOffset" }] : /* istanbul ignore next */ []));
|
|
3490
3592
|
this.state = computed(() => {
|
|
3491
|
-
const
|
|
3492
|
-
|
|
3493
|
-
return this.#gridService.lockedColumnStates().get(column.id) ?? null;
|
|
3494
|
-
}
|
|
3495
|
-
const structuralColumn = this.structuralColumn();
|
|
3496
|
-
if (structuralColumn != null) {
|
|
3497
|
-
if (!this.#gridService.hasLeftLockedColumns()) {
|
|
3498
|
-
return null;
|
|
3499
|
-
}
|
|
3500
|
-
const groupPrefixWidth = this.groupPrefixWidth() ?? this.#gridService.groupStructuralWidth();
|
|
3501
|
-
const offset = this.#gridService.structuralColumnOffset(structuralColumn, groupPrefixWidth);
|
|
3502
|
-
return {
|
|
3503
|
-
edge: offset === this.#gridService.lastLeftStructuralOffset(),
|
|
3504
|
-
offset,
|
|
3505
|
-
side: "left"
|
|
3506
|
-
};
|
|
3507
|
-
}
|
|
3508
|
-
const structuralOffset = this.lockedStructuralOffset();
|
|
3509
|
-
if (structuralOffset == null || !this.#gridService.hasLeftLockedColumns()) {
|
|
3510
|
-
return null;
|
|
3511
|
-
}
|
|
3512
|
-
return {
|
|
3513
|
-
edge: structuralOffset === this.#gridService.lastLeftStructuralOffset(),
|
|
3514
|
-
offset: structuralOffset,
|
|
3515
|
-
side: "left"
|
|
3516
|
-
};
|
|
3593
|
+
const layoutKey = this.layoutKey();
|
|
3594
|
+
return layoutKey ? (this.#gridService.layoutColumnByKey().get(layoutKey)?.sticky ?? null) : null;
|
|
3517
3595
|
}, /* @ts-ignore */
|
|
3518
3596
|
...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
3597
|
+
this.stickyEdgeBorder = STICKY_EDGE_BORDER;
|
|
3519
3598
|
this.zIndex = computed(() => {
|
|
3520
3599
|
if (this.state() == null) {
|
|
3521
3600
|
return null;
|
|
@@ -3523,38 +3602,35 @@ class GridLockedCellDirective {
|
|
|
3523
3602
|
return this.lockedCellHeader() ? 4 : 2;
|
|
3524
3603
|
}, /* @ts-ignore */
|
|
3525
3604
|
...(ngDevMode ? [{ debugName: "zIndex" }] : /* istanbul ignore next */ []));
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3605
|
+
/**
|
|
3606
|
+
* The key of the layout column whose sticky state this cell follows, such as `column:<id>`,
|
|
3607
|
+
* `structural:selection` or `group:0`.
|
|
3608
|
+
*/
|
|
3609
|
+
this.layoutKey = input(null, { ...(ngDevMode ? { debugName: "layoutKey" } : /* istanbul ignore next */ {}), alias: "monaGridLockedCell" });
|
|
3530
3610
|
this.lockedCellHeader = input(false, /* @ts-ignore */
|
|
3531
3611
|
...(ngDevMode ? [{ debugName: "lockedCellHeader" }] : /* istanbul ignore next */ []));
|
|
3532
|
-
this.lockedStructuralOffset = input(null, /* @ts-ignore */
|
|
3533
|
-
...(ngDevMode ? [{ debugName: "lockedStructuralOffset" }] : /* istanbul ignore next */ []));
|
|
3534
|
-
this.structuralColumn = input(null, /* @ts-ignore */
|
|
3535
|
-
...(ngDevMode ? [{ debugName: "structuralColumn" }] : /* istanbul ignore next */ []));
|
|
3536
3612
|
}
|
|
3537
|
-
#hostElementRef;
|
|
3538
3613
|
#gridService;
|
|
3614
|
+
#hostElementRef;
|
|
3539
3615
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridLockedCellDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3540
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: GridLockedCellDirective, isStandalone: true, selector: "td[monaGridLockedCell], th[monaGridLockedCell]", inputs: {
|
|
3616
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: GridLockedCellDirective, isStandalone: true, selector: "td[monaGridLockedCell], th[monaGridLockedCell]", inputs: { layoutKey: { classPropertyName: "layoutKey", publicName: "monaGridLockedCell", isSignal: true, isRequired: false, transformFunction: null }, lockedCellHeader: { classPropertyName: "lockedCellHeader", publicName: "lockedCellHeader", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.position": "state() == null ? null : 'sticky'", "style.inset-inline-start.px": "startOffset()", "style.inset-inline-end.px": "endOffset()", "style.z-index": "zIndex()", "class.bg-header-background": "headerLocked() || footerCell", "class.bg-inherit": "bodyLocked()", "style.border-inline-start": "endEdge() ? stickyEdgeBorder : null", "style.border-inline-end": "startEdge() ? stickyEdgeBorder : null" } }, ngImport: i0 }); }
|
|
3541
3617
|
}
|
|
3542
3618
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridLockedCellDirective, decorators: [{
|
|
3543
3619
|
type: Directive,
|
|
3544
3620
|
args: [{
|
|
3545
3621
|
selector: "td[monaGridLockedCell], th[monaGridLockedCell]",
|
|
3546
3622
|
host: {
|
|
3547
|
-
"[style.position]": "
|
|
3548
|
-
"[style.
|
|
3549
|
-
"[style.
|
|
3623
|
+
"[style.position]": "state() == null ? null : 'sticky'",
|
|
3624
|
+
"[style.inset-inline-start.px]": "startOffset()",
|
|
3625
|
+
"[style.inset-inline-end.px]": "endOffset()",
|
|
3550
3626
|
"[style.z-index]": "zIndex()",
|
|
3551
3627
|
"[class.bg-header-background]": "headerLocked() || footerCell",
|
|
3552
3628
|
"[class.bg-inherit]": "bodyLocked()",
|
|
3553
|
-
"[style.border-
|
|
3554
|
-
"[style.border-
|
|
3629
|
+
"[style.border-inline-start]": "endEdge() ? stickyEdgeBorder : null",
|
|
3630
|
+
"[style.border-inline-end]": "startEdge() ? stickyEdgeBorder : null"
|
|
3555
3631
|
}
|
|
3556
3632
|
}]
|
|
3557
|
-
}], propDecorators: {
|
|
3633
|
+
}], propDecorators: { layoutKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaGridLockedCell", required: false }] }], lockedCellHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "lockedCellHeader", required: false }] }] } });
|
|
3558
3634
|
|
|
3559
3635
|
class GridNavigationService {
|
|
3560
3636
|
#cellElementDict = signal(ImmutableDictionary.create(), /* @ts-ignore */
|
|
@@ -3616,9 +3692,9 @@ class GridNavigationService {
|
|
|
3616
3692
|
case "ArrowUp":
|
|
3617
3693
|
return this.#navigateVertically("up", cellKey);
|
|
3618
3694
|
case "ArrowLeft":
|
|
3619
|
-
return this.#navigateHorizontally("
|
|
3695
|
+
return this.#navigateHorizontally("previous", cellKey);
|
|
3620
3696
|
case "ArrowRight":
|
|
3621
|
-
return this.#navigateHorizontally("
|
|
3697
|
+
return this.#navigateHorizontally("next", cellKey);
|
|
3622
3698
|
case "Home":
|
|
3623
3699
|
return this.#navigateToRowEdge("first", cellKey);
|
|
3624
3700
|
case "End":
|
|
@@ -3770,32 +3846,26 @@ class GridNavigationService {
|
|
|
3770
3846
|
const data = this.#cellElementDict().get(key);
|
|
3771
3847
|
return data ? { key, value: data } : null;
|
|
3772
3848
|
}
|
|
3849
|
+
// Moves in logical column order; callers map arrow keys to it according to the text direction.
|
|
3773
3850
|
#navigateHorizontally(direction, cellKey) {
|
|
3774
3851
|
const data = this.#cellElementDict().get(cellKey);
|
|
3775
3852
|
if (!data || data.groupHeader) {
|
|
3776
3853
|
return false;
|
|
3777
3854
|
}
|
|
3778
|
-
if (direction === "
|
|
3779
|
-
|
|
3780
|
-
return false;
|
|
3781
|
-
}
|
|
3782
|
-
const prevCell = this.#findCellAt(data.section, data.rowIndex, data.colIndex - 1);
|
|
3783
|
-
if (prevCell) {
|
|
3784
|
-
this.#focusCell(prevCell.key, prevCell.value);
|
|
3785
|
-
return true;
|
|
3786
|
-
}
|
|
3855
|
+
if (direction === "previous" ? data.firstInRow : data.lastInRow) {
|
|
3856
|
+
return false;
|
|
3787
3857
|
}
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
}
|
|
3858
|
+
// Not every layout column registers a cell in every section (the header has no detail cell),
|
|
3859
|
+
// so move to the nearest registered cell instead of the adjacent index.
|
|
3860
|
+
const rowCells = this.#findCellsInRow(data.rowIndex, data.section);
|
|
3861
|
+
const target = direction === "previous"
|
|
3862
|
+
? rowCells.filter(cell => cell.value.colIndex < data.colIndex).at(-1)
|
|
3863
|
+
: rowCells.find(cell => cell.value.colIndex > data.colIndex);
|
|
3864
|
+
if (!target) {
|
|
3865
|
+
return false;
|
|
3797
3866
|
}
|
|
3798
|
-
|
|
3867
|
+
this.#focusCell(target.key, target.value);
|
|
3868
|
+
return true;
|
|
3799
3869
|
}
|
|
3800
3870
|
#navigateToGridEdge(edge) {
|
|
3801
3871
|
const dict = this.#cellElementDict();
|
|
@@ -3898,339 +3968,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
3898
3968
|
type: Injectable
|
|
3899
3969
|
}] });
|
|
3900
3970
|
|
|
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)";
|
|
3903
|
-
const gridBaseThemeVariants = cva(`
|
|
3904
|
-
relative flex flex-col
|
|
3905
|
-
h-full overflow-hidden
|
|
3906
|
-
text-foreground text-sm
|
|
3907
|
-
bg-surface border border-border
|
|
3908
|
-
`, {
|
|
3909
|
-
variants: {
|
|
3910
|
-
rounded: {
|
|
3911
|
-
small: "rounded-sm",
|
|
3912
|
-
medium: "rounded-md",
|
|
3913
|
-
large: "rounded-lg",
|
|
3914
|
-
none: "rounded-none"
|
|
3915
|
-
}
|
|
3916
|
-
}
|
|
3917
|
-
});
|
|
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
|
-
});
|
|
3927
|
-
const gridCellContainerThemeVariants = cva(`
|
|
3928
|
-
flex w-full min-w-0 items-center
|
|
3929
|
-
flex-1 outline-none
|
|
3930
|
-
`, {
|
|
3931
|
-
variants: {
|
|
3932
|
-
virtual: {
|
|
3933
|
-
true: "h-full overflow-hidden",
|
|
3934
|
-
false: gridRowMinHeightClass
|
|
3935
|
-
},
|
|
3936
|
-
editing: {
|
|
3937
|
-
true: "px-0",
|
|
3938
|
-
false: "px-2"
|
|
3939
|
-
}
|
|
3940
|
-
},
|
|
3941
|
-
defaultVariants: {
|
|
3942
|
-
editing: false,
|
|
3943
|
-
virtual: false
|
|
3944
|
-
},
|
|
3945
|
-
compoundVariants: [{ virtual: false, editing: false, class: "py-1" }]
|
|
3946
|
-
});
|
|
3947
|
-
const gridCellDirtyIndicatorThemeVariants = cva(`
|
|
3948
|
-
absolute top-0 end-0 w-0 h-0
|
|
3949
|
-
border-t-[8px] border-s-[8px]
|
|
3950
|
-
border-t-destructive border-s-transparent
|
|
3951
|
-
pointer-events-none
|
|
3952
|
-
`);
|
|
3953
|
-
const gridCellEditorBaseThemeVariants = cva(`
|
|
3954
|
-
flex w-full min-w-0 items-center
|
|
3955
|
-
bg-input-background border border-focus-indicator/40
|
|
3956
|
-
`, {
|
|
3957
|
-
variants: { virtual: { true: "h-full overflow-hidden", false: gridRowMinHeightClass } },
|
|
3958
|
-
defaultVariants: { virtual: false }
|
|
3959
|
-
});
|
|
3960
|
-
const gridCellEditorInputThemeVariants = cva(`
|
|
3961
|
-
w-full border-transparent
|
|
3962
|
-
data-[expanded='true']:border-focus-indicator
|
|
3963
|
-
data-[expanded='true']:focus-within:border-focus-indicator/40
|
|
3964
|
-
`, {
|
|
3965
|
-
variants: { virtual: { true: "h-full", false: "min-h-8" } },
|
|
3966
|
-
defaultVariants: { virtual: false }
|
|
3967
|
-
});
|
|
3968
|
-
const gridCellTextThemeVariants = cva(`
|
|
3969
|
-
truncate cursor-default select-none
|
|
3970
|
-
`);
|
|
3971
|
-
const gridSelectAllCellThemeVariants = cva(`
|
|
3972
|
-
absolute inset-0 flex h-full w-full items-center justify-center
|
|
3973
|
-
`);
|
|
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
|
-
});
|
|
3978
|
-
const gridColumnActionsThemeVariants = cva(`
|
|
3979
|
-
flex items-center justify-center
|
|
3980
|
-
text-xs [&_i]:text-xs
|
|
3981
|
-
`);
|
|
3982
|
-
const gridColumnDragPreviewThemeVariants = cva(`
|
|
3983
|
-
flex items-center justify-center
|
|
3984
|
-
px-2! py-0.5!
|
|
3985
|
-
bg-surface-raised! text-foreground!
|
|
3986
|
-
border! border-border! rounded-md shadow-(--shadow-overlay)!
|
|
3987
|
-
`);
|
|
3988
|
-
const gridColumnDropHintThemeVariants = cva(`
|
|
3989
|
-
absolute flex w-1 h-full bg-primary z-10! top-0 bottom-0
|
|
3990
|
-
`);
|
|
3991
|
-
const gridColumnResizerThemeVariants = cva(`
|
|
3992
|
-
absolute top-0 bottom-0 w-3 bg-transparent cursor-col-resize z-10 -end-1.5
|
|
3993
|
-
`);
|
|
3994
|
-
const gridDetailContentCellThemeVariants = cva(`border-b border-b-border-subtle`, {
|
|
3995
|
-
variants: {
|
|
3996
|
-
nextIsGroup: {
|
|
3997
|
-
true: "",
|
|
3998
|
-
false: ""
|
|
3999
|
-
}
|
|
4000
|
-
}
|
|
4001
|
-
});
|
|
4002
|
-
const gridDetailIndentCellThemeVariants = cva(`
|
|
4003
|
-
border-e border-e-border-subtle border-b border-b-border-subtle
|
|
4004
|
-
`, {
|
|
4005
|
-
variants: {
|
|
4006
|
-
nextIsGroup: {
|
|
4007
|
-
true: "",
|
|
4008
|
-
false: ""
|
|
4009
|
-
}
|
|
4010
|
-
}
|
|
4011
|
-
});
|
|
4012
|
-
const gridDetailRowThemeVariants = cva(``);
|
|
4013
|
-
const gridRowReorderHandleThemeVariants = cva(`
|
|
4014
|
-
flex min-h-9 w-full items-center justify-center
|
|
4015
|
-
cursor-grab select-none touch-none
|
|
4016
|
-
text-muted-foreground
|
|
4017
|
-
hover:text-foreground
|
|
4018
|
-
active:cursor-grabbing
|
|
4019
|
-
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-indicator/50
|
|
4020
|
-
disabled:cursor-not-allowed disabled:text-muted-foreground/35 disabled:hover:text-muted-foreground/35
|
|
4021
|
-
`);
|
|
4022
|
-
const gridRowDragPreviewThemeVariants = cva(`
|
|
4023
|
-
flex items-center gap-2
|
|
4024
|
-
px-2! py-1!
|
|
4025
|
-
bg-surface-raised! text-foreground!
|
|
4026
|
-
border! border-border! rounded-md shadow-(--shadow-overlay)!
|
|
4027
|
-
`);
|
|
4028
|
-
const gridRowDragPlaceholderThemeVariants = cva(`
|
|
4029
|
-
opacity-40
|
|
4030
|
-
[&>td]:bg-hover! [&>td]:border-dashed! [&>td]:border-border!
|
|
4031
|
-
`);
|
|
4032
|
-
const gridFilterRowCellThemeVariants = cva(`
|
|
4033
|
-
flex items-center px-1 py-0.5 w-full
|
|
4034
|
-
[--mona-effect-control-background-color:var(--mona-effect-raised-background-color,var(--color-surface-raised))]
|
|
4035
|
-
[--mona-effect-control-fallback-background-color:var(--mona-effect-raised-fallback-background-color,var(--color-surface-raised))]
|
|
4036
|
-
[--mona-effect-control-background-image:var(--mona-effect-raised-background-image,none)]
|
|
4037
|
-
[--mona-effect-control-backdrop-filter:var(--mona-effect-raised-backdrop-filter,none)]
|
|
4038
|
-
`);
|
|
4039
|
-
const gridFooterThemeVariants = cva(`
|
|
4040
|
-
flex flex-row grow-0 shrink-0 basis-auto
|
|
4041
|
-
overflow-hidden
|
|
4042
|
-
bg-surface-muted border-e border-e-border-subtle border-t border-t-border-subtle
|
|
4043
|
-
`);
|
|
4044
|
-
const gridFooterTableThemeVariants = cva(`
|
|
4045
|
-
border-separate border-spacing-0 table-fixed
|
|
4046
|
-
`);
|
|
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
|
-
});
|
|
4051
|
-
const gridFooterTableCellThemeVariants = cva(`
|
|
4052
|
-
relative overflow-hidden
|
|
4053
|
-
text-start align-middle px-2 py-2
|
|
4054
|
-
bg-surface-muted
|
|
4055
|
-
border-e border-e-border-subtle border-b border-b-border-subtle
|
|
4056
|
-
font-medium
|
|
4057
|
-
`);
|
|
4058
|
-
const gridGroupPanelPlaceholderThemeVariants = cva(`
|
|
4059
|
-
truncate text-muted-foreground
|
|
4060
|
-
`);
|
|
4061
|
-
const gridGroupPanelThemeVariants = cva(`
|
|
4062
|
-
flex items-center flex-wrap
|
|
4063
|
-
p-1 h-auto gap-1
|
|
4064
|
-
bg-surface-muted border-b border-b-border-subtle
|
|
4065
|
-
`);
|
|
4066
|
-
const gridGroupRowThemeVariants = cva(`
|
|
4067
|
-
relative z-10
|
|
4068
|
-
w-full
|
|
4069
|
-
bg-surface-muted border-e border-e-border-subtle
|
|
4070
|
-
`, { variants: { virtual: { true: gridVirtualRowHeightClass, false: "" } }, defaultVariants: { virtual: false } });
|
|
4071
|
-
const gridHeaderThemeVariants = cva(`
|
|
4072
|
-
flex flex-row grow-0 shrink-0 basis-auto
|
|
4073
|
-
overflow-hidden
|
|
4074
|
-
bg-surface-muted border-e border-e-border-subtle
|
|
4075
|
-
`);
|
|
4076
|
-
const gridHeaderTableThemeVariants = cva(`
|
|
4077
|
-
border-separate border-spacing-0 table-fixed
|
|
4078
|
-
`);
|
|
4079
|
-
const gridHeaderTableRowThemeVariants = cva(`relative inline-flex not-first:border-t not-first:border-t-border-subtle [&>th:last-child]:border-e-0`);
|
|
4080
|
-
const gridHeaderTableCellThemeVariants = cva(`
|
|
4081
|
-
relative select-none
|
|
4082
|
-
text-start overflow-visible
|
|
4083
|
-
outline-none border-e border-e-border-subtle
|
|
4084
|
-
after:absolute after:inset-0 after:pointer-events-none
|
|
4085
|
-
focus:after:ring-1 focus:after:ring-inset focus:after:ring-focus-indicator/35
|
|
4086
|
-
`);
|
|
4087
|
-
const gridHeaderTableColumnWrapThemeVariants = cva(`
|
|
4088
|
-
w-full h-full px-1
|
|
4089
|
-
flex items-center justify-between
|
|
4090
|
-
cursor-pointer overflow-hidden
|
|
4091
|
-
`);
|
|
4092
|
-
const gridHeaderTableColumnTitleThemeVariants = cva(`
|
|
4093
|
-
flex-1 px-1 py-2 truncate
|
|
4094
|
-
font-medium
|
|
4095
|
-
`);
|
|
4096
|
-
const gridListBaseThemeVariants = cva(`
|
|
4097
|
-
w-full h-full
|
|
4098
|
-
outline-none
|
|
4099
|
-
border-t border-t-border-subtle
|
|
4100
|
-
[scrollbar-color:var(--color-scrollbar-thumb)_var(--color-scrollbar-track)] [scrollbar-width:thin]
|
|
4101
|
-
`, {
|
|
4102
|
-
variants: {
|
|
4103
|
-
virtual: {
|
|
4104
|
-
true: "overflow-x-hidden overflow-y-hidden flex flex-col min-h-0",
|
|
4105
|
-
false: "block overflow-x-auto overflow-y-scroll"
|
|
4106
|
-
}
|
|
4107
|
-
}
|
|
4108
|
-
});
|
|
4109
|
-
const gridListTableThemeVariants = cva(`
|
|
4110
|
-
border-separate border-spacing-0 w-full table-fixed
|
|
4111
|
-
[&_.cdk-drag-dragging]:z-10! [&_.cdk-drag-dragging]:shadow-(--shadow-overlay)
|
|
4112
|
-
[&_.cdk-drag-animating]:transition-transform
|
|
4113
|
-
`);
|
|
4114
|
-
const gridListTableRowThemeVariants = cva(``, {
|
|
4115
|
-
variants: {
|
|
4116
|
-
selected: {
|
|
4117
|
-
true: `
|
|
4118
|
-
bg-(--color-selected) text-(--color-selected-foreground) hover:bg-(--color-selected-active)
|
|
4119
|
-
`,
|
|
4120
|
-
false: "bg-surface hover:bg-hover"
|
|
4121
|
-
},
|
|
4122
|
-
virtual: { true: gridVirtualRowHeightClass, false: "" }
|
|
4123
|
-
},
|
|
4124
|
-
defaultVariants: { virtual: false }
|
|
4125
|
-
});
|
|
4126
|
-
const gridListTableCellThemeVariants = cva(`
|
|
4127
|
-
relative
|
|
4128
|
-
outline-none z-1
|
|
4129
|
-
align-middle
|
|
4130
|
-
border-b border-b-border-subtle
|
|
4131
|
-
after:content-[''] after:block
|
|
4132
|
-
after:absolute after:inset-0 after:pointer-events-none
|
|
4133
|
-
focus:after:ring-1 focus:after:ring-inset focus:after:ring-focus-indicator/35
|
|
4134
|
-
`, {
|
|
4135
|
-
variants: {
|
|
4136
|
-
virtual: { true: gridVirtualRowHeightClass, false: "" },
|
|
4137
|
-
groupHeader: {
|
|
4138
|
-
true: "",
|
|
4139
|
-
false: ""
|
|
4140
|
-
},
|
|
4141
|
-
groupToggle: {
|
|
4142
|
-
true: "",
|
|
4143
|
-
false: ""
|
|
4144
|
-
},
|
|
4145
|
-
grouped: {
|
|
4146
|
-
true: "",
|
|
4147
|
-
false: ""
|
|
4148
|
-
},
|
|
4149
|
-
indentCell: {
|
|
4150
|
-
true: "",
|
|
4151
|
-
false: ""
|
|
4152
|
-
},
|
|
4153
|
-
lastInRow: {
|
|
4154
|
-
true: "",
|
|
4155
|
-
false: "border-e border-e-border-subtle"
|
|
4156
|
-
},
|
|
4157
|
-
masterDetailContent: {
|
|
4158
|
-
true: "",
|
|
4159
|
-
false: ""
|
|
4160
|
-
},
|
|
4161
|
-
masterDetailToggle: {
|
|
4162
|
-
true: "",
|
|
4163
|
-
false: ""
|
|
4164
|
-
},
|
|
4165
|
-
dataCell: {
|
|
4166
|
-
true: "",
|
|
4167
|
-
false: ""
|
|
4168
|
-
}
|
|
4169
|
-
},
|
|
4170
|
-
defaultVariants: { virtual: false },
|
|
4171
|
-
compoundVariants: [
|
|
4172
|
-
{
|
|
4173
|
-
grouped: false,
|
|
4174
|
-
masterDetailToggle: true,
|
|
4175
|
-
class: ""
|
|
4176
|
-
},
|
|
4177
|
-
{
|
|
4178
|
-
grouped: false,
|
|
4179
|
-
dataCell: true,
|
|
4180
|
-
class: ""
|
|
4181
|
-
},
|
|
4182
|
-
{
|
|
4183
|
-
grouped: false,
|
|
4184
|
-
indentCell: true,
|
|
4185
|
-
class: ""
|
|
4186
|
-
},
|
|
4187
|
-
{
|
|
4188
|
-
grouped: false,
|
|
4189
|
-
masterDetailContent: true,
|
|
4190
|
-
class: ""
|
|
4191
|
-
},
|
|
4192
|
-
{
|
|
4193
|
-
groupHeader: true,
|
|
4194
|
-
class: ""
|
|
4195
|
-
},
|
|
4196
|
-
{
|
|
4197
|
-
grouped: true,
|
|
4198
|
-
masterDetailToggle: true,
|
|
4199
|
-
class: ""
|
|
4200
|
-
},
|
|
4201
|
-
{
|
|
4202
|
-
grouped: true,
|
|
4203
|
-
dataCell: true,
|
|
4204
|
-
class: ""
|
|
4205
|
-
},
|
|
4206
|
-
{
|
|
4207
|
-
grouped: true,
|
|
4208
|
-
indentCell: true,
|
|
4209
|
-
class: "bg-surface-muted"
|
|
4210
|
-
},
|
|
4211
|
-
{
|
|
4212
|
-
grouped: true,
|
|
4213
|
-
indentCell: false,
|
|
4214
|
-
class: ""
|
|
4215
|
-
},
|
|
4216
|
-
{
|
|
4217
|
-
grouped: true,
|
|
4218
|
-
indentCell: true,
|
|
4219
|
-
masterDetailToggle: true,
|
|
4220
|
-
class: ""
|
|
4221
|
-
},
|
|
4222
|
-
{
|
|
4223
|
-
grouped: true,
|
|
4224
|
-
groupToggle: true,
|
|
4225
|
-
class: ""
|
|
4226
|
-
}
|
|
4227
|
-
]
|
|
4228
|
-
});
|
|
4229
|
-
const gridNoDataThemeVariants = cva(`
|
|
4230
|
-
flex items-center justify-center h-full
|
|
4231
|
-
text-muted-foreground border-t border-t-border-subtle
|
|
4232
|
-
`);
|
|
4233
|
-
|
|
4234
3971
|
const FOCUSABLE_TARGET_SELECTOR$1 = "button, input, select, textarea, a[href], [tabindex]";
|
|
4235
3972
|
class GridLogicalCellDirective {
|
|
4236
3973
|
#cellData;
|
|
@@ -4273,17 +4010,6 @@ class GridLogicalCellDirective {
|
|
|
4273
4010
|
};
|
|
4274
4011
|
this.ariaColIndex = computed(() => this.colIndex() + this.#gridService.groupColumns().length + 1, /* @ts-ignore */
|
|
4275
4012
|
...(ngDevMode ? [{ debugName: "ariaColIndex" }] : /* istanbul ignore next */ []));
|
|
4276
|
-
this.baseClass = computed(() => {
|
|
4277
|
-
if (this.#hostElementRef.nativeElement.tagName === "TH") {
|
|
4278
|
-
return "";
|
|
4279
|
-
}
|
|
4280
|
-
return gridListTableCellThemeVariants({
|
|
4281
|
-
virtual: this.#gridService.virtualScrollOptions().enabled,
|
|
4282
|
-
groupHeader: this.groupHeader(),
|
|
4283
|
-
lastInRow: this.lastInRow() || this.groupHeader()
|
|
4284
|
-
});
|
|
4285
|
-
}, /* @ts-ignore */
|
|
4286
|
-
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
4287
4013
|
this.focused = computed(() => {
|
|
4288
4014
|
const key = this.#cellKey();
|
|
4289
4015
|
if (!key) {
|
|
@@ -4429,12 +4155,13 @@ class GridLogicalCellDirective {
|
|
|
4429
4155
|
this.#focusNextInnerTarget(target, event.shiftKey);
|
|
4430
4156
|
return;
|
|
4431
4157
|
}
|
|
4432
|
-
|
|
4158
|
+
const key = this.#toLogicalArrowKey(event.key);
|
|
4159
|
+
if (key === "ArrowRight" || key === "ArrowDown") {
|
|
4433
4160
|
event.preventDefault();
|
|
4434
4161
|
this.#focusNextInnerTarget(target, false);
|
|
4435
4162
|
return;
|
|
4436
4163
|
}
|
|
4437
|
-
if (
|
|
4164
|
+
if (key === "ArrowLeft" || key === "ArrowUp") {
|
|
4438
4165
|
event.preventDefault();
|
|
4439
4166
|
this.#focusNextInnerTarget(target, true);
|
|
4440
4167
|
}
|
|
@@ -4517,13 +4244,8 @@ class GridLogicalCellDirective {
|
|
|
4517
4244
|
event.preventDefault();
|
|
4518
4245
|
this.#navigate("ArrowDown");
|
|
4519
4246
|
}
|
|
4520
|
-
else if (event.key === "ArrowLeft") {
|
|
4521
|
-
if (this.#navigate(
|
|
4522
|
-
event.preventDefault();
|
|
4523
|
-
}
|
|
4524
|
-
}
|
|
4525
|
-
else if (event.key === "ArrowRight") {
|
|
4526
|
-
if (this.#navigate("ArrowRight")) {
|
|
4247
|
+
else if (event.key === "ArrowLeft" || event.key === "ArrowRight") {
|
|
4248
|
+
if (this.#navigate(this.#toLogicalArrowKey(event.key))) {
|
|
4527
4249
|
event.preventDefault();
|
|
4528
4250
|
}
|
|
4529
4251
|
}
|
|
@@ -4578,15 +4300,29 @@ class GridLogicalCellDirective {
|
|
|
4578
4300
|
}
|
|
4579
4301
|
}
|
|
4580
4302
|
}
|
|
4303
|
+
/**
|
|
4304
|
+
* Maps a horizontal arrow key to its logical meaning: ArrowRight moves to the next column in LTR
|
|
4305
|
+
* and to the previous column in RTL, where columns run right to left.
|
|
4306
|
+
*/
|
|
4307
|
+
#toLogicalArrowKey(key) {
|
|
4308
|
+
// Read on demand: a direction observer per cell would be costly in large grids.
|
|
4309
|
+
const host = this.#hostElementRef.nativeElement;
|
|
4310
|
+
if (host.ownerDocument.defaultView?.getComputedStyle(host).direction !== "rtl") {
|
|
4311
|
+
return key;
|
|
4312
|
+
}
|
|
4313
|
+
if (key === "ArrowLeft") {
|
|
4314
|
+
return "ArrowRight";
|
|
4315
|
+
}
|
|
4316
|
+
return key === "ArrowRight" ? "ArrowLeft" : key;
|
|
4317
|
+
}
|
|
4581
4318
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridLogicalCellDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
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: { "
|
|
4319
|
+
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: { "attr.tabindex": "focused() ? 0 : -1", "attr.aria-colindex": "ariaColIndex()", "attr.aria-readonly": "resolvedCellKind() === 'data' ? !editable() : null" } }, ngImport: i0 }); }
|
|
4583
4320
|
}
|
|
4584
4321
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridLogicalCellDirective, decorators: [{
|
|
4585
4322
|
type: Directive,
|
|
4586
4323
|
args: [{
|
|
4587
4324
|
selector: "td[monaGridLogicalCell], th[monaGridLogicalCell]",
|
|
4588
4325
|
host: {
|
|
4589
|
-
"[class]": "baseClass()",
|
|
4590
4326
|
"[attr.tabindex]": "focused() ? 0 : -1",
|
|
4591
4327
|
"[attr.aria-colindex]": "ariaColIndex()",
|
|
4592
4328
|
"[attr.aria-readonly]": "resolvedCellKind() === 'data' ? !editable() : null"
|
|
@@ -4646,114 +4382,254 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
4646
4382
|
}]
|
|
4647
4383
|
}] });
|
|
4648
4384
|
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
return parentKey != null ? `${parentKey}/${segment}` : segment;
|
|
4664
|
-
}
|
|
4665
|
-
/**
|
|
4666
|
-
* Groups rows by the given columns and flattens them into a linear `GridViewRow[]`.
|
|
4667
|
-
*
|
|
4668
|
-
* @param rows - The source data rows.
|
|
4669
|
-
* @param groupColumns - The ordered list of columns to group by.
|
|
4670
|
-
* @param collapsedKeys - The set of group keys that are currently collapsed.
|
|
4671
|
-
* @param groupAggregates - The dictionary of group aggregates.
|
|
4672
|
-
* @param orderGroups - Orders buckets by direction. Disable for client rows already ordered by Query.
|
|
4673
|
-
* @returns A flat array of `GridViewRow` items.
|
|
4674
|
-
*/
|
|
4675
|
-
flatten(rows, groupColumns, collapsedKeys, showFooter, groupAggregates = new Dictionary(), orderGroups = true) {
|
|
4676
|
-
const columnArray = [...groupColumns];
|
|
4677
|
-
if (columnArray.length === 0) {
|
|
4678
|
-
return [];
|
|
4385
|
+
const gridRowMinHeightClass = "min-h-9";
|
|
4386
|
+
const gridVirtualRowHeightClass = "h-(--mona-grid-row-height) min-h-(--mona-grid-row-height) max-h-(--mona-grid-row-height)";
|
|
4387
|
+
const gridBaseThemeVariants = cva(`
|
|
4388
|
+
relative flex flex-col
|
|
4389
|
+
h-full overflow-hidden
|
|
4390
|
+
text-foreground text-sm
|
|
4391
|
+
bg-surface border border-border
|
|
4392
|
+
`, {
|
|
4393
|
+
variants: {
|
|
4394
|
+
rounded: {
|
|
4395
|
+
small: "rounded-sm",
|
|
4396
|
+
medium: "rounded-md",
|
|
4397
|
+
large: "rounded-lg",
|
|
4398
|
+
none: "rounded-none"
|
|
4679
4399
|
}
|
|
4680
|
-
const result = [];
|
|
4681
|
-
this.#flattenRecursive([...rows], columnArray, groupAggregates, 0, null, collapsedKeys, showFooter, orderGroups, result);
|
|
4682
|
-
return result;
|
|
4683
4400
|
}
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
const isDate = column.dataType === "date";
|
|
4691
|
-
const groupMap = new Map();
|
|
4692
|
-
const keyOrder = [];
|
|
4693
|
-
for (const row of rows) {
|
|
4694
|
-
const rawValue = row.data[field];
|
|
4695
|
-
const mapKey = isDate && rawValue instanceof Date ? rawValue.toISOString() : rawValue;
|
|
4696
|
-
if (!groupMap.has(mapKey)) {
|
|
4697
|
-
groupMap.set(mapKey, []);
|
|
4698
|
-
keyOrder.push(mapKey);
|
|
4699
|
-
}
|
|
4700
|
-
groupMap.get(mapKey).push(row);
|
|
4401
|
+
});
|
|
4402
|
+
const gridCellBaseThemeVariants = cva("flex w-full min-w-0", {
|
|
4403
|
+
variants: {
|
|
4404
|
+
virtual: {
|
|
4405
|
+
true: "absolute inset-0 overflow-hidden",
|
|
4406
|
+
false: `relative ${gridRowMinHeightClass}`
|
|
4701
4407
|
}
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4408
|
+
},
|
|
4409
|
+
defaultVariants: { virtual: false }
|
|
4410
|
+
});
|
|
4411
|
+
const gridCellContainerThemeVariants = cva(`
|
|
4412
|
+
flex w-full min-w-0 items-center
|
|
4413
|
+
flex-1 outline-none
|
|
4414
|
+
`, {
|
|
4415
|
+
variants: {
|
|
4416
|
+
virtual: {
|
|
4417
|
+
true: "h-full overflow-hidden",
|
|
4418
|
+
false: gridRowMinHeightClass
|
|
4419
|
+
},
|
|
4420
|
+
editing: {
|
|
4421
|
+
true: "px-0",
|
|
4422
|
+
false: "px-2"
|
|
4709
4423
|
}
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4424
|
+
},
|
|
4425
|
+
defaultVariants: {
|
|
4426
|
+
editing: false,
|
|
4427
|
+
virtual: false
|
|
4428
|
+
},
|
|
4429
|
+
compoundVariants: [{ virtual: false, editing: false, class: "py-1" }]
|
|
4430
|
+
});
|
|
4431
|
+
const gridCellDirtyIndicatorThemeVariants = cva(`
|
|
4432
|
+
absolute top-0 end-0 w-0 h-0
|
|
4433
|
+
border-t-[8px] border-s-[8px]
|
|
4434
|
+
border-t-destructive border-s-transparent
|
|
4435
|
+
pointer-events-none
|
|
4436
|
+
`);
|
|
4437
|
+
const gridCellEditorBaseThemeVariants = cva(`
|
|
4438
|
+
flex w-full min-w-0 items-center
|
|
4439
|
+
bg-input-background border border-focus-indicator/40
|
|
4440
|
+
`, {
|
|
4441
|
+
variants: { virtual: { true: "h-full overflow-hidden", false: gridRowMinHeightClass } },
|
|
4442
|
+
defaultVariants: { virtual: false }
|
|
4443
|
+
});
|
|
4444
|
+
const gridCellEditorInputThemeVariants = cva(`
|
|
4445
|
+
w-full border-transparent
|
|
4446
|
+
data-[expanded='true']:border-focus-indicator
|
|
4447
|
+
data-[expanded='true']:focus-within:border-focus-indicator/40
|
|
4448
|
+
`, {
|
|
4449
|
+
variants: { virtual: { true: "h-full", false: "min-h-8" } },
|
|
4450
|
+
defaultVariants: { virtual: false }
|
|
4451
|
+
});
|
|
4452
|
+
const gridCellTextThemeVariants = cva(`
|
|
4453
|
+
truncate cursor-default select-none
|
|
4454
|
+
`);
|
|
4455
|
+
const gridSelectAllCellThemeVariants = cva(`
|
|
4456
|
+
absolute inset-0 flex h-full w-full items-center justify-center
|
|
4457
|
+
`);
|
|
4458
|
+
const gridSelectionCellThemeVariants = cva("flex w-full items-center justify-center", {
|
|
4459
|
+
variants: { virtual: { true: "absolute inset-0 h-full", false: gridRowMinHeightClass } },
|
|
4460
|
+
defaultVariants: { virtual: false }
|
|
4461
|
+
});
|
|
4462
|
+
const gridColumnActionsThemeVariants = cva(`
|
|
4463
|
+
flex items-center justify-center
|
|
4464
|
+
text-xs [&_i]:text-xs
|
|
4465
|
+
`);
|
|
4466
|
+
const gridColumnDragPreviewThemeVariants = cva(`
|
|
4467
|
+
flex items-center justify-center
|
|
4468
|
+
px-2! py-0.5!
|
|
4469
|
+
bg-surface-raised! text-foreground!
|
|
4470
|
+
border! border-border! rounded-md shadow-(--shadow-overlay)!
|
|
4471
|
+
`);
|
|
4472
|
+
const gridColumnDropHintThemeVariants = cva(`
|
|
4473
|
+
absolute flex w-1 h-full bg-primary z-10! top-0 bottom-0
|
|
4474
|
+
`);
|
|
4475
|
+
const gridColumnResizerThemeVariants = cva(`
|
|
4476
|
+
absolute top-0 bottom-0 w-3 bg-transparent cursor-col-resize z-10 -end-1.5
|
|
4477
|
+
`);
|
|
4478
|
+
const gridRowReorderHandleThemeVariants = cva(`
|
|
4479
|
+
flex min-h-9 w-full items-center justify-center
|
|
4480
|
+
cursor-grab select-none touch-none
|
|
4481
|
+
text-muted-foreground
|
|
4482
|
+
hover:text-foreground
|
|
4483
|
+
active:cursor-grabbing
|
|
4484
|
+
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-indicator/50
|
|
4485
|
+
disabled:cursor-not-allowed disabled:text-muted-foreground/35 disabled:hover:text-muted-foreground/35
|
|
4486
|
+
`);
|
|
4487
|
+
/** On drop, the preview glides into the row's new slot and fades out. */
|
|
4488
|
+
const gridRowDragPreviewThemeVariants = cva(`
|
|
4489
|
+
flex items-center gap-2
|
|
4490
|
+
px-2! py-1!
|
|
4491
|
+
bg-surface-raised! text-foreground!
|
|
4492
|
+
border! border-border! rounded-md shadow-(--shadow-overlay)!
|
|
4493
|
+
[&.cdk-drag-animating]:opacity-0
|
|
4494
|
+
[&.cdk-drag-animating]:transition-[transform,opacity] [&.cdk-drag-animating]:duration-200
|
|
4495
|
+
[&.cdk-drag-animating]:ease-[cubic-bezier(0.2,0,0,1)]
|
|
4496
|
+
motion-reduce:[&.cdk-drag-animating]:transition-none
|
|
4497
|
+
`);
|
|
4498
|
+
const gridFilterRowCellThemeVariants = cva(`
|
|
4499
|
+
flex items-center px-1 py-0.5 w-full
|
|
4500
|
+
[--mona-effect-control-background-color:var(--mona-effect-raised-background-color,var(--color-surface-raised))]
|
|
4501
|
+
[--mona-effect-control-fallback-background-color:var(--mona-effect-raised-fallback-background-color,var(--color-surface-raised))]
|
|
4502
|
+
[--mona-effect-control-background-image:var(--mona-effect-raised-background-image,none)]
|
|
4503
|
+
[--mona-effect-control-backdrop-filter:var(--mona-effect-raised-backdrop-filter,none)]
|
|
4504
|
+
`);
|
|
4505
|
+
const gridFooterThemeVariants = cva(`
|
|
4506
|
+
flex flex-row grow-0 shrink-0 basis-auto
|
|
4507
|
+
overflow-hidden
|
|
4508
|
+
bg-surface-muted border-e border-e-border-subtle border-t border-t-border-subtle
|
|
4509
|
+
`);
|
|
4510
|
+
const gridFooterTableThemeVariants = cva(`
|
|
4511
|
+
border-separate border-spacing-0 table-fixed
|
|
4512
|
+
`);
|
|
4513
|
+
const gridFooterTableRowThemeVariants = cva(`relative inline-flex [&>td:last-child]:border-e-0`, {
|
|
4514
|
+
variants: { virtual: { true: `${gridVirtualRowHeightClass} overflow-hidden`, false: "" } },
|
|
4515
|
+
defaultVariants: { virtual: false }
|
|
4516
|
+
});
|
|
4517
|
+
const gridFooterTableCellThemeVariants = cva(`
|
|
4518
|
+
relative overflow-hidden
|
|
4519
|
+
text-start align-middle px-2 py-2
|
|
4520
|
+
bg-surface-muted
|
|
4521
|
+
border-e border-e-border-subtle border-b border-b-border-subtle
|
|
4522
|
+
font-medium
|
|
4523
|
+
`);
|
|
4524
|
+
const gridGroupPanelPlaceholderThemeVariants = cva(`
|
|
4525
|
+
truncate text-muted-foreground
|
|
4526
|
+
`);
|
|
4527
|
+
const gridGroupPanelThemeVariants = cva(`
|
|
4528
|
+
flex items-center flex-wrap
|
|
4529
|
+
p-1 h-auto gap-1
|
|
4530
|
+
bg-surface-muted border-b border-b-border-subtle
|
|
4531
|
+
`);
|
|
4532
|
+
const gridGroupRowThemeVariants = cva(`
|
|
4533
|
+
relative z-10
|
|
4534
|
+
w-full
|
|
4535
|
+
bg-surface-muted border-e border-e-border-subtle
|
|
4536
|
+
`, { variants: { virtual: { true: gridVirtualRowHeightClass, false: "" } }, defaultVariants: { virtual: false } });
|
|
4537
|
+
const gridHeaderThemeVariants = cva(`
|
|
4538
|
+
flex flex-row grow-0 shrink-0 basis-auto
|
|
4539
|
+
overflow-hidden
|
|
4540
|
+
bg-surface-muted border-e border-e-border-subtle
|
|
4541
|
+
`);
|
|
4542
|
+
const gridHeaderTableThemeVariants = cva(`
|
|
4543
|
+
border-separate border-spacing-0 table-fixed
|
|
4544
|
+
`);
|
|
4545
|
+
const gridHeaderTableRowThemeVariants = cva(`relative inline-flex not-first:border-t not-first:border-t-border-subtle [&>th:last-child]:border-e-0`);
|
|
4546
|
+
const gridHeaderTableCellThemeVariants = cva(`
|
|
4547
|
+
relative select-none
|
|
4548
|
+
text-start overflow-visible
|
|
4549
|
+
outline-none border-e border-e-border-subtle
|
|
4550
|
+
after:absolute after:inset-0 after:pointer-events-none
|
|
4551
|
+
focus:after:ring-1 focus:after:ring-inset focus:after:ring-focus-indicator/35
|
|
4552
|
+
`);
|
|
4553
|
+
const gridHeaderTableColumnWrapThemeVariants = cva(`
|
|
4554
|
+
w-full h-full px-1
|
|
4555
|
+
flex items-center justify-between
|
|
4556
|
+
overflow-hidden
|
|
4557
|
+
`);
|
|
4558
|
+
const gridHeaderTableColumnTitleThemeVariants = cva(`
|
|
4559
|
+
flex-1 px-1 py-2 truncate
|
|
4560
|
+
font-medium
|
|
4561
|
+
`);
|
|
4562
|
+
const gridListBaseThemeVariants = cva(`
|
|
4563
|
+
w-full h-full
|
|
4564
|
+
outline-none
|
|
4565
|
+
border-t border-t-border-subtle
|
|
4566
|
+
[scrollbar-color:var(--color-scrollbar-thumb)_var(--color-scrollbar-track)] [scrollbar-width:thin]
|
|
4567
|
+
`, {
|
|
4568
|
+
variants: {
|
|
4569
|
+
virtual: {
|
|
4570
|
+
true: "overflow-x-hidden overflow-y-hidden flex flex-col min-h-0",
|
|
4571
|
+
false: "block overflow-x-auto overflow-y-scroll"
|
|
4750
4572
|
}
|
|
4751
4573
|
}
|
|
4752
|
-
|
|
4753
|
-
|
|
4574
|
+
});
|
|
4575
|
+
/**
|
|
4576
|
+
* While a row is dragged, the other rows slide out of its way and the slot it will drop into shows the row dimmed.
|
|
4577
|
+
*/
|
|
4578
|
+
const gridListTableThemeVariants = cva(`
|
|
4579
|
+
border-separate border-spacing-0 w-full table-fixed
|
|
4580
|
+
[&_.cdk-drop-list-dragging>.cdk-drag]:transition-transform
|
|
4581
|
+
[&_.cdk-drop-list-dragging>.cdk-drag]:duration-200
|
|
4582
|
+
[&_.cdk-drop-list-dragging>.cdk-drag]:ease-[cubic-bezier(0.2,0,0,1)]
|
|
4583
|
+
motion-reduce:[&_.cdk-drop-list-dragging>.cdk-drag]:transition-none
|
|
4584
|
+
[&_.cdk-drag-placeholder]:opacity-60 [&_.cdk-drag-placeholder>td]:bg-hover!
|
|
4585
|
+
`);
|
|
4586
|
+
const gridListTableRowThemeVariants = cva(``, {
|
|
4587
|
+
variants: {
|
|
4588
|
+
selected: {
|
|
4589
|
+
true: `
|
|
4590
|
+
bg-(--color-selected) text-(--color-selected-foreground) hover:bg-(--color-selected-active)
|
|
4591
|
+
`,
|
|
4592
|
+
false: "bg-surface hover:bg-hover"
|
|
4593
|
+
},
|
|
4594
|
+
virtual: { true: gridVirtualRowHeightClass, false: "" }
|
|
4595
|
+
},
|
|
4596
|
+
defaultVariants: { virtual: false }
|
|
4597
|
+
});
|
|
4598
|
+
const gridListTableCellThemeVariants = cva(`
|
|
4599
|
+
relative
|
|
4600
|
+
outline-none z-1
|
|
4601
|
+
align-middle
|
|
4602
|
+
border-b border-b-border-subtle
|
|
4603
|
+
after:content-[''] after:block
|
|
4604
|
+
after:absolute after:inset-0 after:pointer-events-none
|
|
4605
|
+
focus:after:ring-1 focus:after:ring-inset focus:after:ring-focus-indicator/35
|
|
4606
|
+
`, {
|
|
4607
|
+
variants: {
|
|
4608
|
+
virtual: { true: gridVirtualRowHeightClass, false: "" },
|
|
4609
|
+
groupIndent: { true: "bg-surface-muted", false: "" },
|
|
4610
|
+
lastInRow: { true: "", false: "border-e border-e-border-subtle" }
|
|
4611
|
+
},
|
|
4612
|
+
defaultVariants: { virtual: false }
|
|
4613
|
+
});
|
|
4614
|
+
const gridNoDataThemeVariants = cva(`
|
|
4615
|
+
flex items-center justify-center h-full
|
|
4616
|
+
text-muted-foreground border-t border-t-border-subtle
|
|
4617
|
+
`);
|
|
4618
|
+
|
|
4619
|
+
/**
|
|
4620
|
+
* Renders the `<col>` sequence for a grid table from the shared layout, so that the header, body,
|
|
4621
|
+
* add row and footer tables always agree on column order and width.
|
|
4622
|
+
*/
|
|
4623
|
+
class GridColgroupComponent {
|
|
4624
|
+
constructor() {
|
|
4625
|
+
this.gridService = inject(GridService);
|
|
4626
|
+
}
|
|
4627
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridColgroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4628
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridColgroupComponent, isStandalone: true, selector: "colgroup[monaGridColgroup]", ngImport: i0, template: "@for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n <col [style.width.px]=\"layoutColumn.width\" />\n}\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4754
4629
|
}
|
|
4755
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type:
|
|
4756
|
-
type:
|
|
4630
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridColgroupComponent, decorators: [{
|
|
4631
|
+
type: Component,
|
|
4632
|
+
args: [{ selector: "colgroup[monaGridColgroup]", changeDetection: ChangeDetectionStrategy.OnPush, template: "@for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n <col [style.width.px]=\"layoutColumn.width\" />\n}\n" }]
|
|
4757
4633
|
}] });
|
|
4758
4634
|
|
|
4759
4635
|
class GridColumnChooserComponent {
|
|
@@ -5172,25 +5048,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
5172
5048
|
class GridSelectAllCheckboxComponent {
|
|
5173
5049
|
constructor() {
|
|
5174
5050
|
this.#gridService = inject(GridService);
|
|
5175
|
-
this.messages = this.#gridService.messages;
|
|
5176
5051
|
this.checked = computed(() => this.#gridService.allBulkSelectionRowsSelected(), /* @ts-ignore */
|
|
5177
5052
|
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
5178
|
-
this.hostClass =
|
|
5179
|
-
...(ngDevMode ? [{ debugName: "hostClass" }] : /* istanbul ignore next */ []));
|
|
5053
|
+
this.hostClass = gridSelectAllCellThemeVariants();
|
|
5180
5054
|
this.indeterminate = computed(() => this.#gridService.someBulkSelectionRowsSelected(), /* @ts-ignore */
|
|
5181
5055
|
...(ngDevMode ? [{ debugName: "indeterminate" }] : /* istanbul ignore next */ []));
|
|
5056
|
+
this.messages = this.#gridService.messages;
|
|
5182
5057
|
}
|
|
5183
5058
|
#gridService;
|
|
5184
5059
|
onCheckedChange(checked) {
|
|
5185
5060
|
this.#gridService.setBulkSelection(checked);
|
|
5186
5061
|
}
|
|
5187
5062
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridSelectAllCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5188
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: GridSelectAllCheckboxComponent, isStandalone: true, selector: "mona-grid-select-all-checkbox", host: { listeners: { "click": "$event.stopPropagation()" }, properties: { "class": "hostClass
|
|
5063
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: GridSelectAllCheckboxComponent, isStandalone: true, selector: "mona-grid-select-all-checkbox", host: { listeners: { "click": "$event.stopPropagation()" }, properties: { "class": "hostClass" } }, ngImport: i0, template: "<mona-check-box\n [checked]=\"checked()\"\n [indeterminate]=\"indeterminate()\"\n (checkedChange)=\"onCheckedChange($event)\">\n <span class=\"sr-only\">{{ messages().selectAllRows }}</span>\n</mona-check-box>\n", dependencies: [{ kind: "component", type: CheckBoxComponent, selector: "mona-check-box", inputs: ["checked", "disabled", "indeterminate", "invalid", "label", "labelPosition", "labelSize", "required", "rounded", "tabIndex", "touched", "class"], outputs: ["checkedChange", "inputBlur", "inputChange", "inputFocus", "touch"] }] }); }
|
|
5189
5064
|
}
|
|
5190
5065
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridSelectAllCheckboxComponent, decorators: [{
|
|
5191
5066
|
type: Component,
|
|
5192
5067
|
args: [{ selector: "mona-grid-select-all-checkbox", imports: [CheckBoxComponent], host: {
|
|
5193
|
-
"[class]": "hostClass
|
|
5068
|
+
"[class]": "hostClass",
|
|
5194
5069
|
"(click)": "$event.stopPropagation()"
|
|
5195
5070
|
}, template: "<mona-check-box\n [checked]=\"checked()\"\n [indeterminate]=\"indeterminate()\"\n (checkedChange)=\"onCheckedChange($event)\">\n <span class=\"sr-only\">{{ messages().selectAllRows }}</span>\n</mona-check-box>\n" }]
|
|
5196
5071
|
}] });
|
|
@@ -5276,10 +5151,6 @@ class GridComponent {
|
|
|
5276
5151
|
return gridFooterTableThemeVariants();
|
|
5277
5152
|
}, /* @ts-ignore */
|
|
5278
5153
|
...(ngDevMode ? [{ debugName: "footerTableClass" }] : /* istanbul ignore next */ []));
|
|
5279
|
-
this.footerTableRowClass = computed(() => {
|
|
5280
|
-
return gridFooterTableRowThemeVariants();
|
|
5281
|
-
}, /* @ts-ignore */
|
|
5282
|
-
...(ngDevMode ? [{ debugName: "footerTableRowClass" }] : /* istanbul ignore next */ []));
|
|
5283
5154
|
this.footerVisible = computed(() => !this.gridService.virtualScrollOptions().enabled && this.gridService.hasFooter(), /* @ts-ignore */
|
|
5284
5155
|
...(ngDevMode ? [{ debugName: "footerVisible" }] : /* istanbul ignore next */ []));
|
|
5285
5156
|
this.gridDetailTemplate = contentChild(GridDetailTemplateDirective, { ...(ngDevMode ? { debugName: "gridDetailTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
@@ -5395,6 +5266,17 @@ class GridComponent {
|
|
|
5395
5266
|
*/
|
|
5396
5267
|
this.rounded = input("medium", /* @ts-ignore */
|
|
5397
5268
|
...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
|
|
5269
|
+
/**
|
|
5270
|
+
* @description Returns extra CSS classes for the data row that shows an item, merged onto the row's own
|
|
5271
|
+
* classes via `tailwind-merge`. It runs again whenever the item's row is rebound.
|
|
5272
|
+
* Group, group footer and detail rows are not affected.
|
|
5273
|
+
*
|
|
5274
|
+
* To dim a row, prefer a text style such as `text-muted-foreground` over `opacity`: locked cells stay
|
|
5275
|
+
* opaque so scrolled cells pass beneath them, and opacity on the row or its cells would let those show through.
|
|
5276
|
+
* @default null
|
|
5277
|
+
*/
|
|
5278
|
+
this.rowClass = input(null, /* @ts-ignore */
|
|
5279
|
+
...(ngDevMode ? [{ debugName: "rowClass" }] : /* istanbul ignore next */ []));
|
|
5398
5280
|
/**
|
|
5399
5281
|
* @description Field name or selector used to derive a stable identity for each row.
|
|
5400
5282
|
* The resolved value must be unique within the grid data.
|
|
@@ -5411,6 +5293,7 @@ class GridComponent {
|
|
|
5411
5293
|
const columns = this.columnDefinitions().map(definition => definition.getColumn());
|
|
5412
5294
|
untracked(() => this.gridService.setColumnDefinitions(columns));
|
|
5413
5295
|
});
|
|
5296
|
+
effect(() => this.gridService.rowClass.set(this.rowClass()));
|
|
5414
5297
|
this.setPageSizeEffect();
|
|
5415
5298
|
this.setGridDetailEffect();
|
|
5416
5299
|
this.setDataEffect();
|
|
@@ -5721,6 +5604,11 @@ class GridComponent {
|
|
|
5721
5604
|
if (this.gridService.editContext() != null) {
|
|
5722
5605
|
return;
|
|
5723
5606
|
}
|
|
5607
|
+
// Focus that survived the render, or was already put back, stays where it is.
|
|
5608
|
+
const host = this.#hostElementRef.nativeElement;
|
|
5609
|
+
if (host.contains(host.ownerDocument.activeElement)) {
|
|
5610
|
+
return;
|
|
5611
|
+
}
|
|
5724
5612
|
this.#gridNavigationService.focusActiveCellOrFirstHeader();
|
|
5725
5613
|
}
|
|
5726
5614
|
}, { injector: this.#injector });
|
|
@@ -5855,21 +5743,20 @@ class GridComponent {
|
|
|
5855
5743
|
}
|
|
5856
5744
|
}
|
|
5857
5745
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
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
|
-
|
|
5860
|
-
import('./nanahoshi-mona-ui-grid-grid-
|
|
5861
|
-
import('./nanahoshi-mona-ui-grid-grid-
|
|
5862
|
-
import('./nanahoshi-mona-ui-grid-grid-
|
|
5746
|
+
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 }, rowClass: { classPropertyName: "rowClass", publicName: "rowClass", 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, 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 monaGridColgroup></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 (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n @let column = layoutColumn.column;\n @let columnSortable =\n gridService.sortableOptions().enabled &&\n column.kind === \"data\" &&\n column.sortable &&\n column.field !== \"\";\n <th\n scope=\"col\"\n role=\"columnheader\"\n cdkDrag\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'header'\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n (toggleExpand)=\"onColumnSort(column)\"\n [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.aria-sort]=\"\n columnSortable ? (column.columnSortDirection | columnAriaSort) : null\n \">\n <div\n [class]=\"headerTableColumnWrapClass()\"\n [style.cursor]=\"columnSortable ? 'pointer' : 'default'\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: column,\n column\n }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n (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 &&\n column.columnSortDirection !== null\n ) {\n <div class=\"inline-flex shrink-0 items-center gap-0.5\">\n @if (column.columnSortDirection === \"asc\") {\n <svg lucideArrowUp [size]=\"16\" aria-hidden=\"true\"></svg>\n } @else {\n <svg lucideArrowDown [size]=\"16\" aria-hidden=\"true\"></svg>\n }\n @if (\n gridService.sortableOptions().mode === \"multiple\" &&\n gridService.sortableOptions().showIndices &&\n column.sortIndex !== null\n ) {\n <span class=\"tabular-nums\">{{ 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)=\"\n onColumnFilter(column, $event)\n \"></mona-grid-filter-menu>\n }\n }\n </div>\n </div>\n @if (\n dropColumn() === column &&\n dragColumn() &&\n gridService.reorderableOptions().enabled &&\n !groupingInProgress()\n ) {\n <span [class]=\"columnDropHintClass()\"> </span>\n }\n @if (gridService.resizableOptions().enabled && !columnDragging()) {\n <div\n monaGridColumnResizeHandler\n [column]=\"column\"\n [class]=\"columnResizerClass()\"\n (resizeStart)=\"onColumnResizeStart()\"\n (resizeEnd)=\"onColumnResizeEnd($event)\"></div>\n }\n <ng-template cdkDragPreview>\n <div [class]=\"columnDragPreviewClass()\">\n <span>{{ column.title }}</span>\n </div>\n </ng-template>\n <ng-template cdkDragPlaceholder>\n @if (groupingInProgress()) {\n <mona-chip\n style=\"z-index: 10; pointer-events: none\"\n [removable]=\"true\"\n [rounded]=\"rounded()\"\n >{{ column.title }}</mona-chip\n >\n }\n </ng-template>\n </th>\n @if (columnDragging() && dragColumn() === column) {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n [class]=\"headerTableCellClass()\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: column,\n column\n }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n </div>\n </th>\n }\n } @else if (layoutColumn.kind === \"reorder\") {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n scope=\"col\"\n [attr.aria-label]=\"gridService.messages().rowReorder\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\"></th>\n } @else if (layoutColumn.kind === \"selection\") {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\">\n @if (\n gridService.selectableOptions().mode === \"multiple\" &&\n gridService.selectableOptions().showSelectAll !== false\n ) {\n <mona-grid-select-all-checkbox />\n }\n </th>\n } @else {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\"></th>\n }\n }\n </tr>\n @if (filterRowEnabled()) {\n <tr role=\"row\" [class]=\"headerTableRowClass()\">\n @for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n @let column = layoutColumn.column;\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n scope=\"col\"\n class=\"border-e border-border overflow-hidden\"\n [style.width.px]=\"layoutColumn.width\"\n [attr.aria-label]=\"messages().filterByColumn(column.title)\">\n @if (column.kind === \"data\" && column.field && column.filterable) {\n <mona-grid-filter-row-cell\n [column]=\"column\"\n (apply)=\"onColumnFilter(column, $event)\" />\n }\n </th>\n } @else {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\"></th>\n }\n }\n </tr>\n }\n </thead>\n </table>\n </div>\n </div>\n\n @defer (when gridWidthSet()) {\n @if (gridService.virtualScrollOptions().enabled) {\n @if (gridService.viewRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-virtual-list [data]=\"gridService.viewRows()\" />\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\" />\n }\n } @else {\n <div class=\"relative flex-1 min-h-0\" data-grid-body-region>\n @if (gridService.viewPageRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-list [data]=\"gridService.viewPageRows()\" />\n } @else if (!gridService.serverLoading()) {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\" />\n }\n @if (gridService.serverLoading()) {\n <div 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 monaGridColgroup></colgroup>\n <tfoot role=\"rowgroup\">\n <tr monaGridFooterRow></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: GridColgroupComponent, selector: "colgroup[monaGridColgroup]" }, { 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: ["monaGridLockedCell", "lockedCellHeader"] }, { 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,
|
|
5747
|
+
GridColgroupComponent, /* @ts-ignore */
|
|
5748
|
+
import('./nanahoshi-mona-ui-grid-grid-footer-row.component--nF_Q7Bd.mjs').then(m => m.GridFooterRowComponent), /* @ts-ignore */
|
|
5749
|
+
import('./nanahoshi-mona-ui-grid-grid-list.component-S2qxwP2M.mjs').then(m => m.GridListComponent), /* @ts-ignore */
|
|
5750
|
+
import('./nanahoshi-mona-ui-grid-grid-virtual-list.component-DArxdAah.mjs').then(m => m.GridVirtualListComponent), /* @ts-ignore */
|
|
5863
5751
|
import('@nanahoshi/mona-ui/spinner').then(m => m.SpinnerComponent)]] }); }
|
|
5864
5752
|
}
|
|
5865
5753
|
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.0.6", ngImport: i0, type: GridComponent, resolveDeferredDeps: () => [/* @ts-ignore */
|
|
5866
|
-
import('./nanahoshi-mona-ui-grid-grid-footer-
|
|
5867
|
-
import('./nanahoshi-mona-ui-grid-grid-list.component-
|
|
5868
|
-
import('./nanahoshi-mona-ui-grid-grid-virtual-list.component-
|
|
5869
|
-
import('
|
|
5870
|
-
import('@nanahoshi/mona-ui/spinner').then(m => m.SpinnerComponent)], resolveMetadata: (GridFooterCellComponent, GridListComponent, GridVirtualListComponent, GridFooterTableCellDirective, SpinnerComponent) => ({ decorators: [{
|
|
5754
|
+
import('./nanahoshi-mona-ui-grid-grid-footer-row.component--nF_Q7Bd.mjs').then(m => m.GridFooterRowComponent), /* @ts-ignore */
|
|
5755
|
+
import('./nanahoshi-mona-ui-grid-grid-list.component-S2qxwP2M.mjs').then(m => m.GridListComponent), /* @ts-ignore */
|
|
5756
|
+
import('./nanahoshi-mona-ui-grid-grid-virtual-list.component-DArxdAah.mjs').then(m => m.GridVirtualListComponent), /* @ts-ignore */
|
|
5757
|
+
import('@nanahoshi/mona-ui/spinner').then(m => m.SpinnerComponent)], resolveMetadata: (GridFooterRowComponent, GridListComponent, GridVirtualListComponent, SpinnerComponent) => ({ decorators: [{
|
|
5871
5758
|
type: Component,
|
|
5872
|
-
args: [{ selector: "mona-grid", changeDetection: ChangeDetectionStrategy.OnPush, providers: [GridService, GridNavigationService,
|
|
5759
|
+
args: [{ selector: "mona-grid", changeDetection: ChangeDetectionStrategy.OnPush, providers: [GridService, GridNavigationService, FilterService], imports: [
|
|
5873
5760
|
LucideArrowDown,
|
|
5874
5761
|
LucideArrowLeft,
|
|
5875
5762
|
LucideArrowRight,
|
|
@@ -5879,9 +5766,10 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.0.6", ng
|
|
|
5879
5766
|
ChipComponent,
|
|
5880
5767
|
CdkDrag,
|
|
5881
5768
|
NgTemplateOutlet,
|
|
5769
|
+
GridColgroupComponent,
|
|
5882
5770
|
GridFilterMenuComponent,
|
|
5883
5771
|
GridFilterRowCellComponent,
|
|
5884
|
-
|
|
5772
|
+
GridFooterRowComponent,
|
|
5885
5773
|
GridColumnResizeHandlerDirective,
|
|
5886
5774
|
CdkDragPreview,
|
|
5887
5775
|
GridListComponent,
|
|
@@ -5893,7 +5781,6 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.0.6", ng
|
|
|
5893
5781
|
PopupMenuItemComponent,
|
|
5894
5782
|
PopupMenuTextTemplateDirective,
|
|
5895
5783
|
ColumnAriaSortPipe,
|
|
5896
|
-
GridFooterTableCellDirective,
|
|
5897
5784
|
GridLogicalCellDirective,
|
|
5898
5785
|
GridLockedCellDirective,
|
|
5899
5786
|
ButtonDirective,
|
|
@@ -5906,8 +5793,8 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.0.6", ng
|
|
|
5906
5793
|
"[attr.data-uid]": "uid",
|
|
5907
5794
|
"[attr.aria-busy]": "gridService.serverLoading() || null",
|
|
5908
5795
|
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 }] }] } }) });
|
|
5796
|
+
}, 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 monaGridColgroup></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 (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n @let column = layoutColumn.column;\n @let columnSortable =\n gridService.sortableOptions().enabled &&\n column.kind === \"data\" &&\n column.sortable &&\n column.field !== \"\";\n <th\n scope=\"col\"\n role=\"columnheader\"\n cdkDrag\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'header'\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n (toggleExpand)=\"onColumnSort(column)\"\n [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.aria-sort]=\"\n columnSortable ? (column.columnSortDirection | columnAriaSort) : null\n \">\n <div\n [class]=\"headerTableColumnWrapClass()\"\n [style.cursor]=\"columnSortable ? 'pointer' : 'default'\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: column,\n column\n }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n (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 &&\n column.columnSortDirection !== null\n ) {\n <div class=\"inline-flex shrink-0 items-center gap-0.5\">\n @if (column.columnSortDirection === \"asc\") {\n <svg lucideArrowUp [size]=\"16\" aria-hidden=\"true\"></svg>\n } @else {\n <svg lucideArrowDown [size]=\"16\" aria-hidden=\"true\"></svg>\n }\n @if (\n gridService.sortableOptions().mode === \"multiple\" &&\n gridService.sortableOptions().showIndices &&\n column.sortIndex !== null\n ) {\n <span class=\"tabular-nums\">{{ 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)=\"\n onColumnFilter(column, $event)\n \"></mona-grid-filter-menu>\n }\n }\n </div>\n </div>\n @if (\n dropColumn() === column &&\n dragColumn() &&\n gridService.reorderableOptions().enabled &&\n !groupingInProgress()\n ) {\n <span [class]=\"columnDropHintClass()\"> </span>\n }\n @if (gridService.resizableOptions().enabled && !columnDragging()) {\n <div\n monaGridColumnResizeHandler\n [column]=\"column\"\n [class]=\"columnResizerClass()\"\n (resizeStart)=\"onColumnResizeStart()\"\n (resizeEnd)=\"onColumnResizeEnd($event)\"></div>\n }\n <ng-template cdkDragPreview>\n <div [class]=\"columnDragPreviewClass()\">\n <span>{{ column.title }}</span>\n </div>\n </ng-template>\n <ng-template cdkDragPlaceholder>\n @if (groupingInProgress()) {\n <mona-chip\n style=\"z-index: 10; pointer-events: none\"\n [removable]=\"true\"\n [rounded]=\"rounded()\"\n >{{ column.title }}</mona-chip\n >\n }\n </ng-template>\n </th>\n @if (columnDragging() && dragColumn() === column) {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n [class]=\"headerTableCellClass()\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: column,\n column\n }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n </div>\n </th>\n }\n } @else if (layoutColumn.kind === \"reorder\") {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n scope=\"col\"\n [attr.aria-label]=\"gridService.messages().rowReorder\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\"></th>\n } @else if (layoutColumn.kind === \"selection\") {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"layoutColumn.logicalIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"layoutColumn.firstInRow\"\n [lastInRow]=\"layoutColumn.lastInRow\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\">\n @if (\n gridService.selectableOptions().mode === \"multiple\" &&\n gridService.selectableOptions().showSelectAll !== false\n ) {\n <mona-grid-select-all-checkbox />\n }\n </th>\n } @else {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\"></th>\n }\n }\n </tr>\n @if (filterRowEnabled()) {\n <tr role=\"row\" [class]=\"headerTableRowClass()\">\n @for (layoutColumn of gridService.layout(); track layoutColumn.key) {\n @if (layoutColumn.kind === \"column\") {\n @let column = layoutColumn.column;\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n scope=\"col\"\n class=\"border-e border-border overflow-hidden\"\n [style.width.px]=\"layoutColumn.width\"\n [attr.aria-label]=\"messages().filterByColumn(column.title)\">\n @if (column.kind === \"data\" && column.field && column.filterable) {\n <mona-grid-filter-row-cell\n [column]=\"column\"\n (apply)=\"onColumnFilter(column, $event)\" />\n }\n </th>\n } @else {\n <th\n [monaGridLockedCell]=\"layoutColumn.key\"\n [lockedCellHeader]=\"true\"\n scope=\"col\"\n class=\"border-e border-border\"\n [style.width.px]=\"layoutColumn.width\"></th>\n }\n }\n </tr>\n }\n </thead>\n </table>\n </div>\n </div>\n\n @defer (when gridWidthSet()) {\n @if (gridService.virtualScrollOptions().enabled) {\n @if (gridService.viewRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-virtual-list [data]=\"gridService.viewRows()\" />\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\" />\n }\n } @else {\n <div class=\"relative flex-1 min-h-0\" data-grid-body-region>\n @if (gridService.viewPageRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-list [data]=\"gridService.viewPageRows()\" />\n } @else if (!gridService.serverLoading()) {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\" />\n }\n @if (gridService.serverLoading()) {\n <div 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 monaGridColgroup></colgroup>\n <tfoot role=\"rowgroup\">\n <tr monaGridFooterRow></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" }]
|
|
5797
|
+
}], 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 }] }], rowClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClass", required: false }] }], rowKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowKey", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } }) });
|
|
5911
5798
|
|
|
5912
5799
|
/*
|
|
5913
5800
|
* Public API Surface of @nanahoshi/mona-ui/grid
|
|
@@ -5917,5 +5804,5 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.0.6", ng
|
|
|
5917
5804
|
* Generated bundle index. Do not edit.
|
|
5918
5805
|
*/
|
|
5919
5806
|
|
|
5920
|
-
export {
|
|
5921
|
-
//# sourceMappingURL=nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-
|
|
5807
|
+
export { GridSaveCommandDirective as $, GridCancelCommandDirective as A, GridCancelEvent as B, CellEditEvent as C, GridCellTemplateDirective as D, GridColumnComponent as E, GridColumnTitleTemplateDirective as F, GridNavigationService as G, GridCommandColumnComponent as H, GridComponent as I, GridContextMenuDirective as J, GridDetailTemplateDirective as K, GridEditCommandDirective as L, GridEditEvent as M, GridEditTemplateDirective as N, GridEditableDirective as O, GridExportDirective as P, GridFilterableDirective as Q, GridFooterTemplateDirective as R, GridGroupFooterTemplateDirective as S, GridGroupableDirective as T, GridHeaderTemplateDirective as U, GridNoDataTemplateDirective as V, GridRemoveCommandDirective as W, GridRemoveEvent as X, GridReorderableDirective as Y, GridResizableDirective as Z, GridRowReorderableDirective as _, GridService as a, GridSaveEvent as a0, GridSelectableDirective as a1, GridServerBindingDirective as a2, GridSortableDirective as a3, GridStatePersistenceDirective as a4, GridToolbarTemplateDirective as a5, GridVirtualScrollDirective as a6, RowEditEvent as a7, RowReorderEvent as a8, gridRowDragPreviewThemeVariants as b, gridListTableThemeVariants as c, GridColgroupComponent as d, gridFooterThemeVariants as e, gridFooterTableThemeVariants as f, gridListBaseThemeVariants as g, GRID_DEFAULT_VIRTUAL_ROW_HEIGHT as h, gridListTableCellThemeVariants as i, gridCellEditorBaseThemeVariants as j, gridCellEditorInputThemeVariants as k, gridListTableRowThemeVariants as l, GridLockedCellDirective as m, GridLogicalCellDirective as n, gridGroupRowThemeVariants as o, gridCellBaseThemeVariants as p, gridCellContainerThemeVariants as q, gridCellDirtyIndicatorThemeVariants as r, gridCellTextThemeVariants as s, gridRowReorderHandleThemeVariants as t, gridSelectionCellThemeVariants as u, gridFooterTableCellThemeVariants as v, gridFooterTableRowThemeVariants as w, GRID_DEFAULT_MESSAGES as x, GridAddCommandDirective as y, GridAddEvent as z };
|
|
5808
|
+
//# sourceMappingURL=nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-bduDEm-x.mjs.map
|