@nanahoshi/mona-ui 0.8.0 → 0.10.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.
@@ -1,6 +1,6 @@
1
1
  import { PreventableEvent, deepEquals } from '@nanahoshi/mona-ui/common';
2
2
  import * as i0 from '@angular/core';
3
- import { Directive, inject, DOCUMENT, signal, computed, Injector, PLATFORM_ID, effect, Injectable, input, contentChildren, untracked, DestroyRef, output, afterNextRender, model, afterRenderEffect, InjectionToken, contentChild, TemplateRef, forwardRef, Component, ChangeDetectionStrategy, ElementRef, Pipe, linkedSignal, viewChild } from '@angular/core';
3
+ import { Directive, signal, inject, DOCUMENT, computed, Injector, PLATFORM_ID, effect, Injectable, input, contentChildren, untracked, DestroyRef, output, afterNextRender, model, afterRenderEffect, isDevMode, InjectionToken, contentChild, TemplateRef, forwardRef, Component, ChangeDetectionStrategy, ElementRef, 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';
@@ -29,6 +29,7 @@ import { DatePickerComponent } from '@nanahoshi/mona-ui/date-picker';
29
29
  import { DropdownListComponent } from '@nanahoshi/mona-ui/dropdown-list';
30
30
  import { NumericTextBoxComponent } from '@nanahoshi/mona-ui/numeric-text-box';
31
31
  import { TextBoxComponent } from '@nanahoshi/mona-ui/text-box';
32
+ import { CheckBoxComponent } from '@nanahoshi/mona-ui/check-box';
32
33
 
33
34
  class CellEditEvent extends PreventableEvent {
34
35
  #options;
@@ -164,8 +165,35 @@ class Row {
164
165
  }
165
166
  }
166
167
 
168
+ class RowReorderEvent extends PreventableEvent {
169
+ #options;
170
+ constructor(options) {
171
+ super("rowReorder");
172
+ this.#options = options;
173
+ }
174
+ get currentIndex() {
175
+ return this.#options.currentIndex;
176
+ }
177
+ get currentPageIndex() {
178
+ return this.#options.currentPageIndex;
179
+ }
180
+ get previousIndex() {
181
+ return this.#options.previousIndex;
182
+ }
183
+ get previousPageIndex() {
184
+ return this.#options.previousPageIndex;
185
+ }
186
+ get reorderedData() {
187
+ return this.#options.reorderedData;
188
+ }
189
+ get rowData() {
190
+ return this.#options.rowData;
191
+ }
192
+ }
193
+
167
194
  const GRID_STATE_VERSION = 1;
168
195
  class GridService {
196
+ #anchorRowKey;
169
197
  #document;
170
198
  #editContext;
171
199
  #editSession;
@@ -177,12 +205,19 @@ class GridService {
177
205
  #platformId;
178
206
  #reorderableOptions;
179
207
  #resizableOptions;
208
+ #rowReorderableOptions;
180
209
  #scrollbarGutterMeasurementSource;
181
210
  #scrollbarGutterWidth;
182
211
  #rowUidByData;
183
212
  #rowUidByKeyObject;
184
213
  #textMeasureCache;
214
+ // Counts how many *selected* keys fall inside the current selection scope, iterating the
215
+ // (usually much smaller) selection rather than rescanning the whole scope on every toggle.
216
+ #bulkSelectionRowKeys;
217
+ #bulkSelectionSelectedCount;
185
218
  constructor() {
219
+ this.#anchorRowKey = signal(null, /* @ts-ignore */
220
+ ...(ngDevMode ? [{ debugName: "#anchorRowKey" }] : /* istanbul ignore next */ []));
186
221
  this.#document = inject(DOCUMENT);
187
222
  this.#editContext = signal(null, /* @ts-ignore */
188
223
  ...(ngDevMode ? [{ debugName: "#editContext" }] : /* istanbul ignore next */ []));
@@ -190,7 +225,7 @@ class GridService {
190
225
  ...(ngDevMode ? [{ debugName: "#editSession" }] : /* istanbul ignore next */ []));
191
226
  this.#editSource = computed(() => this.rows()
192
227
  .select(r => ({ $rowId: r.uid, ...r.data }))
193
- .toImmutableSet(), /* @ts-ignore */
228
+ .toImmutableList(), /* @ts-ignore */
194
229
  ...(ngDevMode ? [{ debugName: "#editSource" }] : /* istanbul ignore next */ []));
195
230
  this.#filterableOptions = signal({ enabled: false, type: "menu" }, /* @ts-ignore */
196
231
  ...(ngDevMode ? [{ debugName: "#filterableOptions" }] : /* istanbul ignore next */ []));
@@ -204,6 +239,8 @@ class GridService {
204
239
  ...(ngDevMode ? [{ debugName: "#reorderableOptions" }] : /* istanbul ignore next */ []));
205
240
  this.#resizableOptions = signal({ enabled: false }, /* @ts-ignore */
206
241
  ...(ngDevMode ? [{ debugName: "#resizableOptions" }] : /* istanbul ignore next */ []));
242
+ this.#rowReorderableOptions = signal({ enabled: false }, /* @ts-ignore */
243
+ ...(ngDevMode ? [{ debugName: "#rowReorderableOptions" }] : /* istanbul ignore next */ []));
207
244
  this.#scrollbarGutterMeasurementSource = signal("fallback", /* @ts-ignore */
208
245
  ...(ngDevMode ? [{ debugName: "#scrollbarGutterMeasurementSource" }] : /* istanbul ignore next */ []));
209
246
  this.#scrollbarGutterWidth = signal(0, /* @ts-ignore */
@@ -219,6 +256,35 @@ class GridService {
219
256
  this.addRowVisible = computed(() => this.addRowData() != null, /* @ts-ignore */
220
257
  ...(ngDevMode ? [{ debugName: "addRowVisible" }] : /* istanbul ignore next */ []));
221
258
  this.add$ = new Subject();
259
+ // Counts how many *selected* keys fall inside the current selection scope, iterating the
260
+ // (usually much smaller) selection rather than rescanning the whole scope on every toggle.
261
+ this.#bulkSelectionRowKeys = computed(() => {
262
+ const keys = new Set();
263
+ for (const row of this.bulkSelectionRows()) {
264
+ keys.add(this.getRowSelectionKey(row));
265
+ }
266
+ return keys;
267
+ }, /* @ts-ignore */
268
+ ...(ngDevMode ? [{ debugName: "#bulkSelectionRowKeys" }] : /* istanbul ignore next */ []));
269
+ this.#bulkSelectionSelectedCount = computed(() => {
270
+ const scopeKeys = this.#bulkSelectionRowKeys();
271
+ if (scopeKeys.size === 0) {
272
+ return 0;
273
+ }
274
+ let count = 0;
275
+ for (const key of this.selectedKeys()) {
276
+ if (scopeKeys.has(key)) {
277
+ count++;
278
+ }
279
+ }
280
+ return count;
281
+ }, /* @ts-ignore */
282
+ ...(ngDevMode ? [{ debugName: "#bulkSelectionSelectedCount" }] : /* istanbul ignore next */ []));
283
+ this.allBulkSelectionRowsSelected = computed(() => {
284
+ const scopeSize = this.#bulkSelectionRowKeys().size;
285
+ return scopeSize > 0 && this.#bulkSelectionSelectedCount() === scopeSize;
286
+ }, /* @ts-ignore */
287
+ ...(ngDevMode ? [{ debugName: "allBulkSelectionRowsSelected" }] : /* istanbul ignore next */ []));
222
288
  this.aggregateColumns = computed(() => {
223
289
  return this.visibleColumns()
224
290
  .where(column => column.kind === "data" && column.aggregate != null)
@@ -247,6 +313,14 @@ class GridService {
247
313
  ...(ngDevMode ? [{ debugName: "bodyScrollElement" }] : /* istanbul ignore next */ []));
248
314
  this.bodyTableElement = signal(null, /* @ts-ignore */
249
315
  ...(ngDevMode ? [{ debugName: "bodyTableElement" }] : /* istanbul ignore next */ []));
316
+ this.bulkSelectionRows = computed(() => {
317
+ const options = this.selectableOptions();
318
+ if (options.selectAllScope === "page" && !this.virtualScrollOptions().enabled) {
319
+ return this.viewPageRows();
320
+ }
321
+ return this.viewRows();
322
+ }, /* @ts-ignore */
323
+ ...(ngDevMode ? [{ debugName: "bulkSelectionRows" }] : /* istanbul ignore next */ []));
250
324
  this.cellEdit$ = new Subject();
251
325
  this.cancel$ = new Subject();
252
326
  /** Set of currently collapsed group keys (global, shared by both paginated and virtual list). */
@@ -260,6 +334,10 @@ class GridService {
260
334
  this.contextMenuItems = signal(ImmutableSet.create(), /* @ts-ignore */
261
335
  ...(ngDevMode ? [{ debugName: "contextMenuItems" }] : /* istanbul ignore next */ []));
262
336
  this.detailColumnWidth = 36;
337
+ this.detailColumnOffset = computed(() => this.structuralColumnOffset("detail", this.groupStructuralWidth()), /* @ts-ignore */
338
+ ...(ngDevMode ? [{ debugName: "detailColumnOffset" }] : /* istanbul ignore next */ []));
339
+ this.detailStructuralWidth = computed(() => this.masterDetailTemplate() != null ? this.detailColumnWidth : 0, /* @ts-ignore */
340
+ ...(ngDevMode ? [{ debugName: "detailStructuralWidth" }] : /* istanbul ignore next */ []));
263
341
  this.editBaseDict = computed(() => {
264
342
  const pairs = this.#editSource().select(item => new KeyValuePair(item.$rowId, item));
265
343
  return ImmutableDictionary.create(pairs);
@@ -280,8 +358,6 @@ class GridService {
280
358
  this.editSession = this.#editSession.asReadonly();
281
359
  this.editableOptions = signal({ enabled: false, mode: "cell" }, /* @ts-ignore */
282
360
  ...(ngDevMode ? [{ debugName: "editableOptions" }] : /* istanbul ignore next */ []));
283
- this.editableRowKey = signal(null, /* @ts-ignore */
284
- ...(ngDevMode ? [{ debugName: "editableRowKey" }] : /* istanbul ignore next */ []));
285
361
  this.editingRowUid = computed(() => this.#editContext()?.rowUid ?? null, /* @ts-ignore */
286
362
  ...(ngDevMode ? [{ debugName: "editingRowUid" }] : /* istanbul ignore next */ []));
287
363
  this.expandedKeys = signal(ImmutableSet.create(), /* @ts-ignore */
@@ -312,9 +388,13 @@ class GridService {
312
388
  .toImmutableList();
313
389
  }, /* @ts-ignore */
314
390
  ...(ngDevMode ? [{ debugName: "groupColumns" }] : /* istanbul ignore next */ []));
391
+ this.groupStructuralWidth = computed(() => this.groupColumns().length * this.groupColumnWidth, /* @ts-ignore */
392
+ ...(ngDevMode ? [{ debugName: "groupStructuralWidth" }] : /* istanbul ignore next */ []));
315
393
  this.groupableOptions = signal({ enabled: false, showFooter: false }, /* @ts-ignore */
316
394
  ...(ngDevMode ? [{ debugName: "groupableOptions" }] : /* istanbul ignore next */ []));
317
- this.hasLeftLockedColumns = computed(() => this.visibleColumns().any(column => column.locked && column.lockedPosition === "left"), /* @ts-ignore */
395
+ this.hasLeftLockedColumns = computed(() => this.rowReorderColumnVisible() ||
396
+ this.selectionColumnVisible() ||
397
+ this.visibleColumns().any(column => column.locked && column.lockedPosition === "left"), /* @ts-ignore */
318
398
  ...(ngDevMode ? [{ debugName: "hasLeftLockedColumns" }] : /* istanbul ignore next */ []));
319
399
  this.hasFooter = computed(() => this.aggregateColumns().any(), /* @ts-ignore */
320
400
  ...(ngDevMode ? [{ debugName: "hasFooter" }] : /* istanbul ignore next */ []));
@@ -325,13 +405,24 @@ class GridService {
325
405
  this.horizontalScrollLeft = this.#horizontalScrollLeft.asReadonly();
326
406
  this.isInEditMode = computed(() => this.#editSession() != null, /* @ts-ignore */
327
407
  ...(ngDevMode ? [{ debugName: "isInEditMode" }] : /* istanbul ignore next */ []));
408
+ this.lastLeftStructuralOffset = computed(() => {
409
+ if (this.visibleColumns().any(column => column.locked && column.lockedPosition === "left")) {
410
+ return null;
411
+ }
412
+ const visible = this.visibleStructuralColumns();
413
+ const lastVisible = visible[visible.length - 1];
414
+ if (lastVisible != null) {
415
+ return this.structuralColumnOffset(lastVisible.kind, this.groupStructuralWidth());
416
+ }
417
+ const groupCount = this.groupColumns().length;
418
+ return groupCount > 0 ? (groupCount - 1) * this.groupColumnWidth : null;
419
+ }, /* @ts-ignore */
420
+ ...(ngDevMode ? [{ debugName: "lastLeftStructuralOffset" }] : /* istanbul ignore next */ []));
328
421
  this.leftLockedStructuralWidth = computed(() => {
329
422
  if (!this.hasLeftLockedColumns()) {
330
423
  return 0;
331
424
  }
332
- const groupWidth = this.groupColumnWidth * this.groupColumns().length;
333
- const detailWidth = this.masterDetailTemplate() != null ? this.detailColumnWidth : 0;
334
- return groupWidth + detailWidth;
425
+ return this.leadingStructuralWidth();
335
426
  }, /* @ts-ignore */
336
427
  ...(ngDevMode ? [{ debugName: "leftLockedStructuralWidth" }] : /* istanbul ignore next */ []));
337
428
  this.lockedColumnStates = computed(() => {
@@ -339,7 +430,7 @@ class GridService {
339
430
  const columns = this.visibleColumns().toArray();
340
431
  const leftColumns = columns.filter(column => column.locked && column.lockedPosition === "left");
341
432
  const rightColumns = columns.filter(column => column.locked && column.lockedPosition === "right");
342
- let leftOffset = this.leftLockedStructuralWidth();
433
+ let leftOffset = this.leadingStructuralWidth();
343
434
  for (const [index, column] of leftColumns.entries()) {
344
435
  states.set(column.id, {
345
436
  edge: index === leftColumns.length - 1,
@@ -360,17 +451,21 @@ class GridService {
360
451
  return states;
361
452
  }, /* @ts-ignore */
362
453
  ...(ngDevMode ? [{ debugName: "lockedColumnStates" }] : /* istanbul ignore next */ []));
454
+ this.leadingStructuralWidth = computed(() => this.groupStructuralWidth() +
455
+ this.visibleStructuralColumns().reduce((total, column) => total + column.width, 0), /* @ts-ignore */
456
+ ...(ngDevMode ? [{ debugName: "leadingStructuralWidth" }] : /* istanbul ignore next */ []));
457
+ this.leadingStructuralColumnCount = computed(() => this.groupColumns().length + this.visibleStructuralColumns().length, /* @ts-ignore */
458
+ ...(ngDevMode ? [{ debugName: "leadingStructuralColumnCount" }] : /* istanbul ignore next */ []));
459
+ this.leadingLogicalColumnCount = computed(() => this.visibleStructuralColumns().length, /* @ts-ignore */
460
+ ...(ngDevMode ? [{ debugName: "leadingLogicalColumnCount" }] : /* istanbul ignore next */ []));
363
461
  this.masterDetailEmptyCellWidth = computed(() => {
364
462
  return this.detailColumnWidth * (this.groupColumns().length + 1);
365
463
  }, /* @ts-ignore */
366
464
  ...(ngDevMode ? [{ debugName: "masterDetailEmptyCellWidth" }] : /* istanbul ignore next */ []));
367
465
  this.masterDetailRowWidth = computed(() => {
368
- const groupColumns = this.groupColumns();
369
466
  const columns = this.visibleColumns();
370
- const groupColumnWidth = this.groupColumnWidth;
371
- const groupColumnCount = groupColumns.length;
372
467
  const columnListWidth = columns.aggregate((acc, c) => acc + this.getColumnWidth(c), 0);
373
- return this.normalizeRenderedWidth(groupColumnWidth * (groupColumnCount + 1) + columnListWidth);
468
+ return this.normalizeRenderedWidth(this.leadingStructuralWidth() + columnListWidth);
374
469
  }, /* @ts-ignore */
375
470
  ...(ngDevMode ? [{ debugName: "masterDetailRowWidth" }] : /* istanbul ignore next */ []));
376
471
  this.masterDetailTemplate = signal(null, /* @ts-ignore */
@@ -382,17 +477,66 @@ class GridService {
382
477
  this.remove$ = new Subject();
383
478
  this.reorderableOptions = this.#reorderableOptions.asReadonly();
384
479
  this.resizableOptions = this.#resizableOptions.asReadonly();
480
+ this.rowDragInProgress = computed(() => this.draggingRowUid() != null, /* @ts-ignore */
481
+ ...(ngDevMode ? [{ debugName: "rowDragInProgress" }] : /* istanbul ignore next */ []));
385
482
  this.rowEdit$ = new Subject();
386
- this.rows = signal(ImmutableSet.create(), /* @ts-ignore */
483
+ this.rowKey = signal(null, /* @ts-ignore */
484
+ ...(ngDevMode ? [{ debugName: "rowKey" }] : /* istanbul ignore next */ []));
485
+ this.rowReorder$ = new Subject();
486
+ this.rowReorderColumnOffset = computed(() => this.structuralColumnOffset("reorder", this.groupStructuralWidth()), /* @ts-ignore */
487
+ ...(ngDevMode ? [{ debugName: "rowReorderColumnOffset" }] : /* istanbul ignore next */ []));
488
+ this.rowReorderColumnVisible = computed(() => this.rowReorderableOptions().enabled === true, /* @ts-ignore */
489
+ ...(ngDevMode ? [{ debugName: "rowReorderColumnVisible" }] : /* istanbul ignore next */ []));
490
+ this.rowReorderColumnWidth = 36;
491
+ this.rowReorderDisabledReason = computed(() => {
492
+ if (!this.rowReorderableOptions().enabled) {
493
+ return "disabled";
494
+ }
495
+ if (this.virtualScrollOptions().enabled) {
496
+ return "virtual-scroll";
497
+ }
498
+ if (this.groupColumns().any()) {
499
+ return "grouped";
500
+ }
501
+ if (!this.appliedSorts().isEmpty()) {
502
+ return "sorted";
503
+ }
504
+ if (!this.appliedFilters().isEmpty()) {
505
+ return "filtered";
506
+ }
507
+ if (this.isInEditMode()) {
508
+ return "editing";
509
+ }
510
+ if (this.viewPageRows().length < 2) {
511
+ return "single-row";
512
+ }
513
+ return null;
514
+ }, /* @ts-ignore */
515
+ ...(ngDevMode ? [{ debugName: "rowReorderDisabledReason" }] : /* istanbul ignore next */ []));
516
+ this.rowReorderInteractionEnabled = computed(() => this.rowReorderDisabledReason() == null, /* @ts-ignore */
517
+ ...(ngDevMode ? [{ debugName: "rowReorderInteractionEnabled" }] : /* istanbul ignore next */ []));
518
+ this.rowReorderStructuralWidth = computed(() => this.rowReorderColumnVisible() ? this.rowReorderColumnWidth : 0, /* @ts-ignore */
519
+ ...(ngDevMode ? [{ debugName: "rowReorderStructuralWidth" }] : /* istanbul ignore next */ []));
520
+ this.rowReorderableOptions = this.#rowReorderableOptions.asReadonly();
521
+ this.rows = signal(ImmutableList.create(), /* @ts-ignore */
387
522
  ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
388
523
  this.save$ = new Subject();
524
+ this.draggingRowUid = signal(null, /* @ts-ignore */
525
+ ...(ngDevMode ? [{ debugName: "draggingRowUid" }] : /* istanbul ignore next */ []));
389
526
  this.scrollEnd$ = new Subject();
390
527
  this.scrollEndThreshold = signal(5, /* @ts-ignore */
391
528
  ...(ngDevMode ? [{ debugName: "scrollEndThreshold" }] : /* istanbul ignore next */ []));
392
529
  this.scrollbarGutterWidth = this.#scrollbarGutterWidth.asReadonly();
393
530
  this.selectBy = signal("", /* @ts-ignore */
394
531
  ...(ngDevMode ? [{ debugName: "selectBy" }] : /* istanbul ignore next */ []));
395
- this.selectableOptions = signal({ enabled: false, mode: "single" }, /* @ts-ignore */
532
+ this.selectableOptions = signal({
533
+ enabled: false,
534
+ mode: "single",
535
+ selectAllScope: "page",
536
+ selectOnRowClick: false,
537
+ showCheckboxes: false,
538
+ showSelectAll: true
539
+ }, /* @ts-ignore */
396
540
  ...(ngDevMode ? [{ debugName: "selectableOptions" }] : /* istanbul ignore next */ []));
397
541
  this.selectedKeys = signal(ImmutableSet.create(), /* @ts-ignore */
398
542
  ...(ngDevMode ? [{ debugName: "selectedKeys" }] : /* istanbul ignore next */ []));
@@ -400,12 +544,27 @@ class GridService {
400
544
  this.selectedKeysLoad$ = new BehaviorSubject(ImmutableSet.create());
401
545
  this.selectedRows = computed(() => {
402
546
  const selectedKeys = this.selectedKeys();
403
- return selectedKeys
404
- .select(key => this.rows().firstOrDefault(r => this.getRowSelectionKey(r) === key))
405
- .where(i => i != null)
547
+ return this.rows()
548
+ .where(row => selectedKeys.contains(this.getRowSelectionKey(row)))
406
549
  .toImmutableSet();
407
550
  }, /* @ts-ignore */
408
551
  ...(ngDevMode ? [{ debugName: "selectedRows" }] : /* istanbul ignore next */ []));
552
+ this.selectionColumnWidth = 40;
553
+ this.selectionColumnVisible = computed(() => {
554
+ const options = this.selectableOptions();
555
+ return options.enabled === true && options.showCheckboxes === true;
556
+ }, /* @ts-ignore */
557
+ ...(ngDevMode ? [{ debugName: "selectionColumnVisible" }] : /* istanbul ignore next */ []));
558
+ this.selectionColumnOffset = computed(() => this.structuralColumnOffset("selection", this.groupStructuralWidth()), /* @ts-ignore */
559
+ ...(ngDevMode ? [{ debugName: "selectionColumnOffset" }] : /* istanbul ignore next */ []));
560
+ this.selectionStructuralWidth = computed(() => this.selectionColumnVisible() ? this.selectionColumnWidth : 0, /* @ts-ignore */
561
+ ...(ngDevMode ? [{ debugName: "selectionStructuralWidth" }] : /* istanbul ignore next */ []));
562
+ this.someBulkSelectionRowsSelected = computed(() => {
563
+ const scopeSize = this.#bulkSelectionRowKeys().size;
564
+ const count = this.#bulkSelectionSelectedCount();
565
+ return count > 0 && count < scopeSize;
566
+ }, /* @ts-ignore */
567
+ ...(ngDevMode ? [{ debugName: "someBulkSelectionRowsSelected" }] : /* istanbul ignore next */ []));
409
568
  this.sortableOptions = signal({
410
569
  enabled: false,
411
570
  mode: "single",
@@ -413,6 +572,25 @@ class GridService {
413
572
  showIndices: true
414
573
  }, /* @ts-ignore */
415
574
  ...(ngDevMode ? [{ debugName: "sortableOptions" }] : /* istanbul ignore next */ []));
575
+ this.structuralColIndexMap = computed(() => {
576
+ const map = new Map();
577
+ this.visibleStructuralColumns().forEach((column, index) => map.set(column.kind, index));
578
+ return map;
579
+ }, /* @ts-ignore */
580
+ ...(ngDevMode ? [{ debugName: "structuralColIndexMap" }] : /* istanbul ignore next */ []));
581
+ // Single source of truth for structural-column left-to-right order; every offset/colIndex
582
+ // consumer derives its answer from this array instead of independently re-deriving the order.
583
+ this.structuralColumns = computed(() => [
584
+ { kind: "reorder", visible: this.rowReorderColumnVisible(), width: this.rowReorderColumnWidth },
585
+ { kind: "detail", visible: this.masterDetailTemplate() != null, width: this.detailColumnWidth },
586
+ { kind: "selection", visible: this.selectionColumnVisible(), width: this.selectionColumnWidth }
587
+ ], /* @ts-ignore */
588
+ ...(ngDevMode ? [{ debugName: "structuralColumns" }] : /* istanbul ignore next */ []));
589
+ this.structuralLastKind = computed(() => {
590
+ const visible = this.visibleStructuralColumns();
591
+ return visible.length > 0 ? visible[visible.length - 1].kind : null;
592
+ }, /* @ts-ignore */
593
+ ...(ngDevMode ? [{ debugName: "structuralLastKind" }] : /* istanbul ignore next */ []));
416
594
  this.tableWidth = computed(() => {
417
595
  const columns = this.visibleColumns();
418
596
  if (!columns.any()) {
@@ -422,9 +600,7 @@ class GridService {
422
600
  return null;
423
601
  }
424
602
  const dataWidth = columns.aggregate((acc, c) => acc + this.getColumnWidth(c), 0);
425
- const groupWidth = this.groupColumnWidth * this.groupColumns().length;
426
- const detailWidth = this.masterDetailTemplate() != null ? this.detailColumnWidth : 0;
427
- return this.normalizeRenderedWidth(dataWidth + groupWidth + detailWidth);
603
+ return this.normalizeRenderedWidth(dataWidth + this.leadingStructuralWidth());
428
604
  }, /* @ts-ignore */
429
605
  ...(ngDevMode ? [{ debugName: "tableWidth" }] : /* istanbul ignore next */ []));
430
606
  this.viewPageRows = computed(() => {
@@ -432,9 +608,9 @@ class GridService {
432
608
  const take = this.paginationState().take;
433
609
  const viewRows = this.viewRows();
434
610
  if (!viewRows.any()) {
435
- return ImmutableSet.create();
611
+ return ImmutableList.create();
436
612
  }
437
- return viewRows.skip(skip).take(take).toImmutableSet();
613
+ return viewRows.skip(skip).take(take).toImmutableList();
438
614
  }, /* @ts-ignore */
439
615
  ...(ngDevMode ? [{ debugName: "viewPageRows" }] : /* istanbul ignore next */ []));
440
616
  this.viewRowCount = computed(() => this.viewRows().size(), /* @ts-ignore */
@@ -463,7 +639,7 @@ class GridService {
463
639
  queryEnumerable = queryEnumerable.sort(sortState, r => r.data);
464
640
  }
465
641
  const result = queryEnumerable.run();
466
- return ImmutableSet.create(result);
642
+ return ImmutableList.create(result);
467
643
  }, /* @ts-ignore */
468
644
  ...(ngDevMode ? [{ debugName: "viewRows" }] : /* istanbul ignore next */ []));
469
645
  this.virtualGridMaxBuffer = computed(() => this.virtualGridMinBuffer() * 1.42857, /* @ts-ignore */
@@ -476,6 +652,8 @@ class GridService {
476
652
  .where(column => !column.hidden)
477
653
  .toImmutableList(), /* @ts-ignore */
478
654
  ...(ngDevMode ? [{ debugName: "visibleColumns" }] : /* istanbul ignore next */ []));
655
+ this.visibleStructuralColumns = computed(() => this.structuralColumns().filter(c => c.visible), /* @ts-ignore */
656
+ ...(ngDevMode ? [{ debugName: "visibleStructuralColumns" }] : /* istanbul ignore next */ []));
479
657
  this.#scrollbarGutterWidth.set(this.measureFallbackScrollbarGutter());
480
658
  this.setHorizontalScrollSyncEffects();
481
659
  this.setScrollbarGutterEffects();
@@ -550,6 +728,13 @@ class GridService {
550
728
  }
551
729
  return { ignoredColumns, missingColumns, status: "applied" };
552
730
  }
731
+ canReorderRow(row) {
732
+ if (!this.rowReorderInteractionEnabled()) {
733
+ return false;
734
+ }
735
+ const predicate = this.rowReorderableOptions().canReorder;
736
+ return predicate?.(row.data) !== false;
737
+ }
553
738
  cancelAddRow(originalEvent) {
554
739
  const session = this.#editSession();
555
740
  if (session == null || session.operation !== "create") {
@@ -661,6 +846,9 @@ class GridService {
661
846
  deselectAllRows() {
662
847
  this.selectedKeys.update(set => set.clear());
663
848
  }
849
+ deselectRow(row) {
850
+ this.setRowSelected(row, false);
851
+ }
664
852
  findTextWidthOfColumn(column, element) {
665
853
  if (!isPlatformBrowser(this.#platformId)) {
666
854
  return 0;
@@ -708,19 +896,36 @@ class GridService {
708
896
  dir: c.groupSortDirection ?? undefined
709
897
  })).toArray();
710
898
  }
899
+ getRowReorderAriaLabel(row, absoluteIndex) {
900
+ const options = this.rowReorderableOptions();
901
+ const label = options.rowAriaLabel?.(row.data, absoluteIndex);
902
+ return label ?? `Reorder row ${absoluteIndex + 1}`;
903
+ }
711
904
  handleMultipleSelection(event, row) {
712
- if (!this.selectedRows().contains(row)) {
713
- this.selectRow(row);
905
+ if (event.shiftKey) {
906
+ this.selectRowRange(row);
907
+ return;
714
908
  }
715
- else if (event.ctrlKey || event.metaKey) {
716
- this.selectedKeys.update(set => set.remove(this.getRowSelectionKey(row)));
909
+ if (event.ctrlKey || event.metaKey) {
910
+ if (this.isRowSelected(row)) {
911
+ this.deselectRow(row);
912
+ }
913
+ else {
914
+ this.selectRow(row);
915
+ }
916
+ this.#anchorRowKey.set(this.getRowSelectionKey(row));
917
+ return;
717
918
  }
919
+ this.deselectAllRows();
920
+ this.selectRow(row);
921
+ this.#anchorRowKey.set(this.getRowSelectionKey(row));
718
922
  }
719
923
  handleRowClick(event, row) {
720
- if (!this.isSelectableGrid()) {
924
+ const options = this.selectableOptions();
925
+ if (!options.enabled || options.selectOnRowClick === false) {
721
926
  return;
722
927
  }
723
- if (this.selectableOptions().mode === "single") {
928
+ if (options.mode === "single") {
724
929
  this.handleSingleSelection(event, row);
725
930
  }
726
931
  else {
@@ -730,23 +935,19 @@ class GridService {
730
935
  handleSingleSelection(event, row) {
731
936
  if (this.isRowSelected(row) && (event.ctrlKey || event.metaKey)) {
732
937
  this.deselectAllRows();
938
+ return;
733
939
  }
734
- else {
735
- this.deselectAllRows();
736
- this.selectRow(row);
737
- }
940
+ this.deselectAllRows();
941
+ this.selectRow(row);
738
942
  }
739
943
  isGroupCollapsed(groupKey) {
740
944
  return this.collapsedGroupKeys().contains(groupKey);
741
945
  }
742
946
  isRowExpanded(row) {
743
- return this.expandedKeys().contains(this.getRowSelectionKey(row));
947
+ return this.expandedKeys().contains(row.uid);
744
948
  }
745
949
  isRowSelected(row) {
746
- return this.selectedRows().contains(row);
747
- }
748
- isSelectableGrid() {
749
- return !!this.selectableOptions().enabled;
950
+ return this.selectedKeys().contains(this.getRowSelectionKey(row));
750
951
  }
751
952
  loadFilters(filters) {
752
953
  const newAppliedFilters = new Dictionary();
@@ -873,6 +1074,49 @@ class GridService {
873
1074
  this.remove$.next(event);
874
1075
  return !event.isDefaultPrevented();
875
1076
  }
1077
+ requestRowReorder(row, previousPageIndex, currentPageIndex) {
1078
+ if (!this.rowReorderInteractionEnabled()) {
1079
+ return false;
1080
+ }
1081
+ if (previousPageIndex === currentPageIndex) {
1082
+ return false;
1083
+ }
1084
+ if (!this.canReorderRow(row)) {
1085
+ return false;
1086
+ }
1087
+ const pageRows = this.viewPageRows();
1088
+ if (previousPageIndex < 0 ||
1089
+ previousPageIndex >= pageRows.length ||
1090
+ currentPageIndex < 0 ||
1091
+ currentPageIndex >= pageRows.length) {
1092
+ return false;
1093
+ }
1094
+ const pageRow = pageRows.get(previousPageIndex);
1095
+ if (pageRow == null || pageRow.uid !== row.uid) {
1096
+ return false;
1097
+ }
1098
+ const skip = this.paginationState().skip;
1099
+ const previousIndex = skip + previousPageIndex;
1100
+ const currentIndex = skip + currentPageIndex;
1101
+ const reorderedData = this.rows()
1102
+ .select(sourceRow => sourceRow.data)
1103
+ .toArray();
1104
+ const [moved] = reorderedData.splice(previousIndex, 1);
1105
+ if (moved == null) {
1106
+ return false;
1107
+ }
1108
+ reorderedData.splice(currentIndex, 0, moved);
1109
+ const event = new RowReorderEvent({
1110
+ currentIndex,
1111
+ currentPageIndex,
1112
+ previousIndex,
1113
+ previousPageIndex,
1114
+ reorderedData,
1115
+ rowData: row.data
1116
+ });
1117
+ this.rowReorder$.next(event);
1118
+ return !event.isDefaultPrevented();
1119
+ }
876
1120
  resolveAggregateValue(bucket, aggregateFunction) {
877
1121
  if (bucket == null || aggregateFunction == null || aggregateFunction === "custom") {
878
1122
  return null;
@@ -908,8 +1152,23 @@ class GridService {
908
1152
  return true;
909
1153
  }
910
1154
  selectRow(row) {
911
- const key = this.getRowSelectionKey(row);
912
- this.selectedKeys.update(set => set.add(key));
1155
+ this.setRowSelected(row, true);
1156
+ }
1157
+ setBulkSelection(selected) {
1158
+ if (this.selectableOptions().mode !== "multiple") {
1159
+ return;
1160
+ }
1161
+ const keys = this.bulkSelectionRows()
1162
+ .select(row => this.getRowSelectionKey(row))
1163
+ .toArray();
1164
+ if (selected) {
1165
+ this.selectedKeys.update(currentKeys => currentKeys.addAll(keys));
1166
+ return;
1167
+ }
1168
+ // ImmutableSet#exceptWith scans the removal list per retained element (O(n*m)); for large
1169
+ // virtualized grids that pairing is expensive, so filter through a native Set (O(n)) instead.
1170
+ const keysToRemove = new Set(keys);
1171
+ this.selectedKeys.update(currentKeys => ImmutableSet.create([...currentKeys].filter(key => !keysToRemove.has(key))));
913
1172
  }
914
1173
  setCalculatedWidth(columnId, value) {
915
1174
  this.updateColumn(columnId, { calculatedWidth: value });
@@ -986,15 +1245,31 @@ class GridService {
986
1245
  this.#resizableOptions.update(v => ({ ...v, ...options }));
987
1246
  }
988
1247
  setRowExpanded(row, expanded) {
989
- const key = this.getRowSelectionKey(row);
990
- this.expandedKeys.update(set => (expanded ? set.add(key) : set.remove(key)));
1248
+ this.expandedKeys.update(keys => (expanded ? keys.add(row.uid) : keys.remove(row.uid)));
1249
+ }
1250
+ setRowReorderableOptions(options) {
1251
+ this.#rowReorderableOptions.set(options);
991
1252
  }
992
1253
  setRows(value, rowKey = null) {
993
- this.rows.set(ImmutableSet.create(select(value, r => new Row(r, this.getRowUid(r, rowKey)))));
1254
+ this.rows.set(ImmutableList.create(select(value, r => new Row(r, this.getRowUid(r, rowKey)))));
994
1255
  }
995
1256
  setSelectableOptions(options) {
996
1257
  this.selectableOptions.update(v => ({ ...v, ...options }));
997
1258
  }
1259
+ setRowSelected(row, selected) {
1260
+ const key = this.getRowSelectionKey(row);
1261
+ const mode = this.selectableOptions().mode;
1262
+ if (selected) {
1263
+ if (mode === "single") {
1264
+ this.selectedKeys.set(ImmutableSet.create([key]));
1265
+ }
1266
+ else {
1267
+ this.selectedKeys.update(keys => keys.add(key));
1268
+ }
1269
+ return;
1270
+ }
1271
+ this.selectedKeys.update(keys => keys.remove(key));
1272
+ }
998
1273
  setSortableOptions(options) {
999
1274
  this.sortableOptions.update(v => ({ ...v, ...options }));
1000
1275
  }
@@ -1135,6 +1410,16 @@ class GridService {
1135
1410
  this.clearEditSession();
1136
1411
  return true;
1137
1412
  }
1413
+ structuralColumnOffset(kind, groupPrefixWidth) {
1414
+ let offset = groupPrefixWidth;
1415
+ for (const column of this.visibleStructuralColumns()) {
1416
+ if (column.kind === kind) {
1417
+ return offset;
1418
+ }
1419
+ offset += column.width;
1420
+ }
1421
+ return offset;
1422
+ }
1138
1423
  toggleGroupCollapse(groupKey) {
1139
1424
  this.collapsedGroupKeys.update(keys => (keys.contains(groupKey) ? keys.remove(groupKey) : keys.add(groupKey)));
1140
1425
  }
@@ -1383,6 +1668,30 @@ class GridService {
1383
1668
  sortIndex: previous?.sortIndex ?? null
1384
1669
  };
1385
1670
  }
1671
+ // Range selection is scoped to bulkSelectionRows() (current page, or full view when virtualized/
1672
+ // view-scoped) since that's the same click-reachable ordering used for the select-all checkbox.
1673
+ selectRowRange(row) {
1674
+ const anchorKey = this.#anchorRowKey();
1675
+ const targetKey = this.getRowSelectionKey(row);
1676
+ if (anchorKey == null) {
1677
+ this.deselectAllRows();
1678
+ this.selectRow(row);
1679
+ this.#anchorRowKey.set(targetKey);
1680
+ return;
1681
+ }
1682
+ const rows = this.bulkSelectionRows().toArray();
1683
+ const anchorIndex = rows.findIndex(r => this.getRowSelectionKey(r) === anchorKey);
1684
+ const targetIndex = rows.findIndex(r => this.getRowSelectionKey(r) === targetKey);
1685
+ if (anchorIndex === -1 || targetIndex === -1) {
1686
+ this.deselectAllRows();
1687
+ this.selectRow(row);
1688
+ this.#anchorRowKey.set(targetKey);
1689
+ return;
1690
+ }
1691
+ const [start, end] = anchorIndex <= targetIndex ? [anchorIndex, targetIndex] : [targetIndex, anchorIndex];
1692
+ const rangeKeys = rows.slice(start, end + 1).map(r => this.getRowSelectionKey(r));
1693
+ this.selectedKeys.set(ImmutableSet.create(rangeKeys));
1694
+ }
1386
1695
  clearEditSession() {
1387
1696
  this.#editContext.set(null);
1388
1697
  this.#editSession.set(null);
@@ -1770,11 +2079,6 @@ class GridEditableDirective {
1770
2079
  * @description Emitted when a row edit is committed (row mode only).
1771
2080
  */
1772
2081
  this.rowEdit = output();
1773
- /**
1774
- * @description Field name or selector used to keep edited row identity stable when data is rebound.
1775
- */
1776
- this.rowKey = input(null, /* @ts-ignore */
1777
- ...(ngDevMode ? [{ debugName: "rowKey" }] : /* istanbul ignore next */ []));
1778
2082
  /**
1779
2083
  * @description Emitted before an edited or new row is saved.
1780
2084
  */
@@ -1790,10 +2094,6 @@ class GridEditableDirective {
1790
2094
  }
1791
2095
  });
1792
2096
  });
1793
- effect(() => {
1794
- const rowKey = this.rowKey();
1795
- untracked(() => this.#gridService.editableRowKey.set(rowKey));
1796
- });
1797
2097
  effect(() => {
1798
2098
  const factory = this.newRowFactory();
1799
2099
  untracked(() => this.#gridService.setNewRowFactory(factory));
@@ -1820,14 +2120,14 @@ class GridEditableDirective {
1820
2120
  this.#gridService.save$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(event => this.save.emit(event));
1821
2121
  }
1822
2122
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridEditableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1823
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: GridEditableDirective, isStandalone: true, selector: "mona-grid[monaGridEditable]", inputs: { newRowFactory: { classPropertyName: "newRowFactory", publicName: "newRowFactory", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "monaGridEditable", isSignal: true, isRequired: false, transformFunction: null }, rowKey: { classPropertyName: "rowKey", publicName: "rowKey", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { add: "add", cancel: "cancel", cellEdit: "cellEdit", edit: "edit", remove: "remove", rowEdit: "rowEdit", save: "save" }, ngImport: i0 }); }
2123
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: GridEditableDirective, isStandalone: true, selector: "mona-grid[monaGridEditable]", inputs: { newRowFactory: { classPropertyName: "newRowFactory", publicName: "newRowFactory", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "monaGridEditable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { add: "add", cancel: "cancel", cellEdit: "cellEdit", edit: "edit", remove: "remove", rowEdit: "rowEdit", save: "save" }, ngImport: i0 }); }
1824
2124
  }
1825
2125
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridEditableDirective, decorators: [{
1826
2126
  type: Directive,
1827
2127
  args: [{
1828
2128
  selector: "mona-grid[monaGridEditable]"
1829
2129
  }]
1830
- }], ctorParameters: () => [], propDecorators: { add: [{ type: i0.Output, args: ["add"] }], cancel: [{ type: i0.Output, args: ["cancel"] }], cellEdit: [{ type: i0.Output, args: ["cellEdit"] }], edit: [{ type: i0.Output, args: ["edit"] }], newRowFactory: [{ type: i0.Input, args: [{ isSignal: true, alias: "newRowFactory", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaGridEditable", required: false }] }], remove: [{ type: i0.Output, args: ["remove"] }], rowEdit: [{ type: i0.Output, args: ["rowEdit"] }], rowKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowKey", required: false }] }], save: [{ type: i0.Output, args: ["save"] }] } });
2130
+ }], ctorParameters: () => [], propDecorators: { add: [{ type: i0.Output, args: ["add"] }], cancel: [{ type: i0.Output, args: ["cancel"] }], cellEdit: [{ type: i0.Output, args: ["cellEdit"] }], edit: [{ type: i0.Output, args: ["edit"] }], newRowFactory: [{ type: i0.Input, args: [{ isSignal: true, alias: "newRowFactory", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaGridEditable", required: false }] }], remove: [{ type: i0.Output, args: ["remove"] }], rowEdit: [{ type: i0.Output, args: ["rowEdit"] }], save: [{ type: i0.Output, args: ["save"] }] } });
1831
2131
 
1832
2132
  class GridFilterableDirective {
1833
2133
  #destroyRef;
@@ -2091,6 +2391,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
2091
2391
  }]
2092
2392
  }], ctorParameters: () => [], propDecorators: { columnResize: [{ type: i0.Output, args: ["columnResize"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaGridResizable", required: false }] }] } });
2093
2393
 
2394
+ class GridRowReorderableDirective {
2395
+ #destroyRef;
2396
+ #gridService;
2397
+ #hasWarnedMissingRowKey;
2398
+ constructor() {
2399
+ this.#destroyRef = inject(DestroyRef);
2400
+ this.#gridService = inject(GridService);
2401
+ this.#hasWarnedMissingRowKey = false;
2402
+ /**
2403
+ * @description Enables row reordering via the reorder-handle column. Pass a `RowReorderableOptions`
2404
+ * object to configure it explicitly.
2405
+ * @default ""
2406
+ */
2407
+ this.options = input("", { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), alias: "monaGridRowReorderable" });
2408
+ /**
2409
+ * @description Emitted when a row is moved to a new position. The event carries the moved row,
2410
+ * source- and page-relative indices, and the complete reordered application data.
2411
+ */
2412
+ this.rowReorder = output();
2413
+ effect(() => {
2414
+ const options = this.options();
2415
+ const enabled = options === "" || options.enabled !== false;
2416
+ const missingRowKey = enabled && this.#gridService.rowKey() == null;
2417
+ untracked(() => {
2418
+ if (options === "") {
2419
+ this.#gridService.setRowReorderableOptions({ enabled: true });
2420
+ }
2421
+ else {
2422
+ this.#gridService.setRowReorderableOptions(options);
2423
+ }
2424
+ if (missingRowKey && isDevMode() && !this.#hasWarnedMissingRowKey) {
2425
+ this.#hasWarnedMissingRowKey = true;
2426
+ console.warn("[mona-ui] Row reordering is enabled on <mona-grid> but no [rowKey] is set. " +
2427
+ "Row identity may not stay stable when data is rebound after a reorder; set [rowKey] " +
2428
+ "or ensure the consumer reuses the same object references when applying reorderedData.");
2429
+ }
2430
+ });
2431
+ });
2432
+ afterNextRender({
2433
+ read: () => this.#setSubscriptions()
2434
+ });
2435
+ }
2436
+ #setSubscriptions() {
2437
+ this.#gridService.rowReorder$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(event => {
2438
+ this.rowReorder.emit(event);
2439
+ });
2440
+ }
2441
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridRowReorderableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2442
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: GridRowReorderableDirective, isStandalone: true, selector: "mona-grid[monaGridRowReorderable]", inputs: { options: { classPropertyName: "options", publicName: "monaGridRowReorderable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rowReorder: "rowReorder" }, ngImport: i0 }); }
2443
+ }
2444
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridRowReorderableDirective, decorators: [{
2445
+ type: Directive,
2446
+ args: [{
2447
+ selector: "mona-grid[monaGridRowReorderable]"
2448
+ }]
2449
+ }], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaGridRowReorderable", required: false }] }], rowReorder: [{ type: i0.Output, args: ["rowReorder"] }] } });
2450
+
2094
2451
  class GridSelectableDirective {
2095
2452
  #destroyRef;
2096
2453
  #gridService;
@@ -2139,7 +2496,7 @@ class GridSelectableDirective {
2139
2496
  const selectedKeys = this.selectedKeys();
2140
2497
  untracked(() => {
2141
2498
  const alreadySelectedKeys = this.#gridService.selectedKeys();
2142
- if (sequenceEqual(orderBy(alreadySelectedKeys, k => k), orderBy(selectedKeys, k => k))) {
2499
+ if (setsEqual(alreadySelectedKeys, ImmutableSet.create(selectedKeys))) {
2143
2500
  return;
2144
2501
  }
2145
2502
  this.#gridService.loadSelectedKeys(selectedKeys);
@@ -2153,7 +2510,7 @@ class GridSelectableDirective {
2153
2510
  this.#gridService.selectedKeysChange$
2154
2511
  .pipe(startWith(this.#gridService.selectedKeys()), pairwise(), takeUntilDestroyed(this.#destroyRef))
2155
2512
  .subscribe(([oldKeys, newKeys]) => {
2156
- if (oldKeys.order().sequenceEqual(newKeys.order())) {
2513
+ if (setsEqual(oldKeys, newKeys)) {
2157
2514
  return;
2158
2515
  }
2159
2516
  this.selectedKeysChange.emit(newKeys.toArray());
@@ -2168,6 +2525,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
2168
2525
  selector: "mona-grid[monaGridSelectable]"
2169
2526
  }]
2170
2527
  }], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaGridSelectable", required: false }] }], selectBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectBy", required: false }] }], selectedKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedKeys", required: false }] }], selectedKeysChange: [{ type: i0.Output, args: ["selectedKeysChange"] }] } });
2528
+ function setsEqual(left, right) {
2529
+ return left.size() === right.size() && left.all(value => right.contains(value));
2530
+ }
2171
2531
 
2172
2532
  class GridSortableDirective {
2173
2533
  #destroyRef;
@@ -2879,12 +3239,25 @@ class GridLockedCellDirective {
2879
3239
  if (column != null) {
2880
3240
  return this.#gridService.lockedColumnStates().get(column.id) ?? null;
2881
3241
  }
3242
+ const structuralColumn = this.structuralColumn();
3243
+ if (structuralColumn != null) {
3244
+ if (!this.#gridService.hasLeftLockedColumns()) {
3245
+ return null;
3246
+ }
3247
+ const groupPrefixWidth = this.groupPrefixWidth() ?? this.#gridService.groupStructuralWidth();
3248
+ const offset = this.#gridService.structuralColumnOffset(structuralColumn, groupPrefixWidth);
3249
+ return {
3250
+ edge: offset === this.#gridService.lastLeftStructuralOffset(),
3251
+ offset,
3252
+ side: "left"
3253
+ };
3254
+ }
2882
3255
  const structuralOffset = this.lockedStructuralOffset();
2883
3256
  if (structuralOffset == null || !this.#gridService.hasLeftLockedColumns()) {
2884
3257
  return null;
2885
3258
  }
2886
3259
  return {
2887
- edge: false,
3260
+ edge: structuralOffset === this.#gridService.lastLeftStructuralOffset(),
2888
3261
  offset: structuralOffset,
2889
3262
  side: "left"
2890
3263
  };
@@ -2899,15 +3272,19 @@ class GridLockedCellDirective {
2899
3272
  ...(ngDevMode ? [{ debugName: "zIndex" }] : /* istanbul ignore next */ []));
2900
3273
  this.column = input(/* @ts-ignore */
2901
3274
  ...(ngDevMode ? [undefined, { debugName: "column" }] : /* istanbul ignore next */ []));
3275
+ this.groupPrefixWidth = input(null, /* @ts-ignore */
3276
+ ...(ngDevMode ? [{ debugName: "groupPrefixWidth" }] : /* istanbul ignore next */ []));
2902
3277
  this.lockedCellHeader = input(false, /* @ts-ignore */
2903
3278
  ...(ngDevMode ? [{ debugName: "lockedCellHeader" }] : /* istanbul ignore next */ []));
2904
3279
  this.lockedStructuralOffset = input(null, /* @ts-ignore */
2905
3280
  ...(ngDevMode ? [{ debugName: "lockedStructuralOffset" }] : /* istanbul ignore next */ []));
3281
+ this.structuralColumn = input(null, /* @ts-ignore */
3282
+ ...(ngDevMode ? [{ debugName: "structuralColumn" }] : /* istanbul ignore next */ []));
2906
3283
  }
2907
3284
  #hostElementRef;
2908
3285
  #gridService;
2909
3286
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridLockedCellDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2910
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: GridLockedCellDirective, isStandalone: true, selector: "td[monaGridLockedCell], th[monaGridLockedCell]", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: false, transformFunction: null }, lockedCellHeader: { classPropertyName: "lockedCellHeader", publicName: "lockedCellHeader", isSignal: true, isRequired: false, transformFunction: null }, lockedStructuralOffset: { classPropertyName: "lockedStructuralOffset", publicName: "lockedStructuralOffset", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.position": "position()", "style.left.px": "leftOffset()", "style.right.px": "rightOffset()", "style.z-index": "zIndex()", "class.bg-header-background": "headerLocked() || footerCell", "class.bg-inherit": "bodyLocked()", "style.border-left": "borderLeft()", "style.border-right": "borderRight()" } }, ngImport: i0 }); }
3287
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: GridLockedCellDirective, isStandalone: true, selector: "td[monaGridLockedCell], th[monaGridLockedCell]", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: false, transformFunction: null }, groupPrefixWidth: { classPropertyName: "groupPrefixWidth", publicName: "groupPrefixWidth", isSignal: true, isRequired: false, transformFunction: null }, lockedCellHeader: { classPropertyName: "lockedCellHeader", publicName: "lockedCellHeader", isSignal: true, isRequired: false, transformFunction: null }, lockedStructuralOffset: { classPropertyName: "lockedStructuralOffset", publicName: "lockedStructuralOffset", isSignal: true, isRequired: false, transformFunction: null }, structuralColumn: { classPropertyName: "structuralColumn", publicName: "structuralColumn", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.position": "position()", "style.left.px": "leftOffset()", "style.right.px": "rightOffset()", "style.z-index": "zIndex()", "class.bg-header-background": "headerLocked() || footerCell", "class.bg-inherit": "bodyLocked()", "style.border-left": "borderLeft()", "style.border-right": "borderRight()" } }, ngImport: i0 }); }
2911
3288
  }
2912
3289
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridLockedCellDirective, decorators: [{
2913
3290
  type: Directive,
@@ -2924,7 +3301,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
2924
3301
  "[style.border-right]": "borderRight()"
2925
3302
  }
2926
3303
  }]
2927
- }], propDecorators: { column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: false }] }], lockedCellHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "lockedCellHeader", required: false }] }], lockedStructuralOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "lockedStructuralOffset", required: false }] }] } });
3304
+ }], propDecorators: { column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: false }] }], groupPrefixWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupPrefixWidth", required: false }] }], lockedCellHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "lockedCellHeader", required: false }] }], lockedStructuralOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "lockedStructuralOffset", required: false }] }], structuralColumn: [{ type: i0.Input, args: [{ isSignal: true, alias: "structuralColumn", required: false }] }] } });
2928
3305
 
2929
3306
  class GridNavigationService {
2930
3307
  #cellElementDict = signal(ImmutableDictionary.create(), /* @ts-ignore */
@@ -3283,7 +3660,6 @@ const gridBaseThemeVariants = cva(`
3283
3660
  const gridCellBaseThemeVariants = cva(`
3284
3661
  absolute inset-0
3285
3662
  flex w-full
3286
- shadow-[inset_0_-1px_0_0_var(--color-border-subtle)]
3287
3663
  `);
3288
3664
  const gridCellContainerThemeVariants = cva(`
3289
3665
  flex h-full w-full items-center
@@ -3318,6 +3694,12 @@ const gridCellEditorInputThemeVariants = cva(`
3318
3694
  const gridCellTextThemeVariants = cva(`
3319
3695
  truncate cursor-default select-none
3320
3696
  `);
3697
+ const gridSelectAllCellThemeVariants = cva(`
3698
+ absolute inset-0 flex h-full w-full items-center justify-center
3699
+ `);
3700
+ const gridSelectionCellThemeVariants = cva(`
3701
+ absolute inset-0 flex h-full w-full items-center justify-center
3702
+ `);
3321
3703
  const gridColumnActionsThemeVariants = cva(`
3322
3704
  flex items-center justify-center
3323
3705
  text-xs [&_i]:text-xs
@@ -3352,8 +3734,25 @@ const gridDetailIndentCellThemeVariants = cva(`
3352
3734
  }
3353
3735
  }
3354
3736
  });
3355
- const gridDetailRowThemeVariants = cva(`
3356
- border-b border-b-border-subtle
3737
+ const gridDetailRowThemeVariants = cva(``);
3738
+ const gridRowReorderHandleThemeVariants = cva(`
3739
+ flex h-full w-full items-center justify-center
3740
+ cursor-grab select-none touch-none
3741
+ text-muted-foreground
3742
+ hover:text-foreground
3743
+ active:cursor-grabbing
3744
+ focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-indicator/50
3745
+ disabled:cursor-not-allowed disabled:text-muted-foreground/35 disabled:hover:text-muted-foreground/35
3746
+ `);
3747
+ const gridRowDragPreviewThemeVariants = cva(`
3748
+ flex items-center gap-2
3749
+ px-2! py-1!
3750
+ bg-surface-raised! text-foreground!
3751
+ border! border-border! rounded-md shadow-(--shadow-overlay)!
3752
+ `);
3753
+ const gridRowDragPlaceholderThemeVariants = cva(`
3754
+ opacity-40
3755
+ [&>td]:bg-hover! [&>td]:border-dashed! [&>td]:border-border!
3357
3756
  `);
3358
3757
  const gridFilterRowCellThemeVariants = cva(`flex items-center px-1 py-0.5 w-full`);
3359
3758
  const gridFooterThemeVariants = cva(`
@@ -3425,6 +3824,8 @@ const gridListBaseThemeVariants = cva(`
3425
3824
  });
3426
3825
  const gridListTableThemeVariants = cva(`
3427
3826
  border-separate border-spacing-0 w-full table-fixed
3827
+ [&_.cdk-drag-dragging]:z-10! [&_.cdk-drag-dragging]:shadow-(--shadow-overlay)
3828
+ [&_.cdk-drag-animating]:transition-transform
3428
3829
  `);
3429
3830
  const gridListTableRowThemeVariants = cva(``, {
3430
3831
  variants: {
@@ -3442,6 +3843,7 @@ const gridListTableCellThemeVariants = cva(`
3442
3843
  ${gridRowHeightClass}
3443
3844
  outline-none z-1
3444
3845
  align-top
3846
+ border-b border-b-border-subtle
3445
3847
  after:content-[''] after:block
3446
3848
  after:absolute after:inset-0 after:pointer-events-none
3447
3849
  focus:after:ring-1 focus:after:ring-inset focus:after:ring-focus-indicator/35
@@ -3518,12 +3920,12 @@ const gridListTableCellThemeVariants = cva(`
3518
3920
  {
3519
3921
  grouped: true,
3520
3922
  indentCell: true,
3521
- class: "bg-surface-muted shadow-[inset_0_-1px_0_0_var(--color-border-subtle)]"
3923
+ class: "bg-surface-muted"
3522
3924
  },
3523
3925
  {
3524
3926
  grouped: true,
3525
3927
  indentCell: false,
3526
- class: "shadow-[inset_0_-1px_0_0_var(--color-border-subtle)]"
3928
+ class: ""
3527
3929
  },
3528
3930
  {
3529
3931
  grouped: true,
@@ -3788,6 +4190,9 @@ class GridLogicalCellDirective {
3788
4190
  this.edit.emit();
3789
4191
  }
3790
4192
  #onHostKeydown(event) {
4193
+ if (event.defaultPrevented) {
4194
+ return;
4195
+ }
3791
4196
  const target = event.target;
3792
4197
  const host = this.#hostElementRef.nativeElement;
3793
4198
  if (target && target !== host) {
@@ -4452,6 +4857,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
4452
4857
  }, template: "@let dataType = column().dataType;\n\n@switch (dataType) {\n @case (\"string\") {\n <div class=\"flex gap-0.5 w-full\">\n <mona-text-box\n size=\"small\"\n [ngModel]=\"stringValue()\"\n (ngModelChange)=\"onStringChange($event)\"\n placeholder=\"Filter...\" />\n <button monaButton look=\"ghost\" [iconOnly]=\"true\" [size]=\"'small'\" #filterButton>\n <svg lucideFunnel [size]=\"14\" [class.text-info]=\"isFilterActive()\"></svg>\n </button>\n <ng-container\n *ngTemplateOutlet=\"clearFilterButtonTemplate; context: { $implicit: isFilterActive() }\"></ng-container>\n </div>\n <mona-popup-menu [target]=\"filterButton\" [size]=\"'small'\">\n @for (item of stringFilterMenuItems; track item) {\n <mona-popup-menu-checkbox-item\n size=\"small\"\n [label]=\"item.text\"\n (menuClick)=\"onOperatorChange(item.value)\"\n [checked]=\"selectedOperator() === item.value\"></mona-popup-menu-checkbox-item>\n }\n </mona-popup-menu>\n }\n @case (\"number\") {\n <div class=\"flex gap-0.5 w-full\">\n <mona-numeric-text-box\n size=\"small\"\n [ngModel]=\"numberValue()\"\n (ngModelChange)=\"onNumberChange($event)\"\n [style.width.%]=\"100\" />\n\n <button monaButton look=\"ghost\" [iconOnly]=\"true\" [size]=\"'small'\" #filterButton>\n <svg lucideFunnel [size]=\"14\" [class.text-info]=\"isFilterActive()\"></svg>\n </button>\n <mona-popup-menu [target]=\"filterButton\" [size]=\"'small'\">\n @for (item of numericFilterMenuItems; track item) {\n <mona-popup-menu-checkbox-item\n size=\"small\"\n [label]=\"item.text\"\n (menuClick)=\"onOperatorChange(item.value)\"\n [checked]=\"selectedOperator() === item.value\"></mona-popup-menu-checkbox-item>\n }\n </mona-popup-menu>\n <ng-container\n *ngTemplateOutlet=\"clearFilterButtonTemplate; context: { $implicit: isFilterActive() }\"></ng-container>\n </div>\n }\n @case (\"date\") {\n <div class=\"flex gap-0.5 w-full\">\n @if (dataType === \"date\") {\n <mona-date-picker\n size=\"small\"\n [ngModel]=\"dateValue()\"\n (ngModelChange)=\"onDateChange($event)\"\n [style.width.%]=\"100\" />\n }\n <button monaButton look=\"ghost\" [iconOnly]=\"true\" [size]=\"'small'\" #filterButton>\n <svg lucideFunnel [size]=\"14\" [class.text-info]=\"isFilterActive()\"></svg>\n </button>\n <ng-container\n *ngTemplateOutlet=\"clearFilterButtonTemplate; context: { $implicit: isFilterActive() }\"></ng-container>\n </div>\n <mona-popup-menu [target]=\"filterButton\" [size]=\"'small'\">\n @for (item of dateFilterMenuItems; track item) {\n <mona-popup-menu-checkbox-item\n size=\"small\"\n [label]=\"item.text\"\n (menuClick)=\"onOperatorChange(item.value)\"\n [checked]=\"selectedOperator() === item.value\"></mona-popup-menu-checkbox-item>\n }\n </mona-popup-menu>\n }\n @case (\"boolean\") {\n <div class=\"flex gap-0.5 w-full\">\n <mona-dropdown-list\n size=\"small\"\n [data]=\"booleanFilterMenuItems\"\n textField=\"text\"\n valueField=\"value\"\n placeholder=\"(All)\"\n [ngModel]=\"booleanValue()\"\n (ngModelChange)=\"onBooleanChange($event)\"\n [style.width.%]=\"100\" />\n <ng-container\n *ngTemplateOutlet=\"clearFilterButtonTemplate; context: { $implicit: isFilterActive() }\"></ng-container>\n </div>\n }\n}\n\n<ng-template #clearFilterButtonTemplate let-hasValue>\n @if (selectedOperator() != null && hasValue) {\n <button monaButton look=\"ghost\" [iconOnly]=\"true\" [size]=\"'small'\" (click)=\"onClear()\">\n <svg lucideFunnelX [size]=\"14\" class=\"text-error\"></svg>\n </button>\n }\n</ng-template>\n" }]
4453
4858
  }], ctorParameters: () => [], propDecorators: { apply: [{ type: i0.Output, args: ["apply"] }], column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: true }] }] } });
4454
4859
 
4860
+ class GridSelectAllCheckboxComponent {
4861
+ constructor() {
4862
+ this.#gridService = inject(GridService);
4863
+ this.checked = computed(() => this.#gridService.allBulkSelectionRowsSelected(), /* @ts-ignore */
4864
+ ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
4865
+ this.hostClass = computed(() => gridSelectAllCellThemeVariants(), /* @ts-ignore */
4866
+ ...(ngDevMode ? [{ debugName: "hostClass" }] : /* istanbul ignore next */ []));
4867
+ this.indeterminate = computed(() => this.#gridService.someBulkSelectionRowsSelected(), /* @ts-ignore */
4868
+ ...(ngDevMode ? [{ debugName: "indeterminate" }] : /* istanbul ignore next */ []));
4869
+ }
4870
+ #gridService;
4871
+ onCheckedChange(checked) {
4872
+ this.#gridService.setBulkSelection(checked);
4873
+ }
4874
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridSelectAllCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4875
+ 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\">Select all rows</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"] }] }); }
4876
+ }
4877
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridSelectAllCheckboxComponent, decorators: [{
4878
+ type: Component,
4879
+ args: [{ selector: "mona-grid-select-all-checkbox", imports: [CheckBoxComponent], host: {
4880
+ "[class]": "hostClass()",
4881
+ "(click)": "$event.stopPropagation()"
4882
+ }, template: "<mona-check-box\n [checked]=\"checked()\"\n [indeterminate]=\"indeterminate()\"\n (checkedChange)=\"onCheckedChange($event)\">\n <span class=\"sr-only\">Select all rows</span>\n</mona-check-box>\n" }]
4883
+ }] });
4884
+
4455
4885
  const FOCUSABLE_TARGET_SELECTOR = "button, input, select, textarea, a[href], [tabindex]";
4456
4886
  class GridComponent {
4457
4887
  #destroyRef;
@@ -4638,6 +5068,13 @@ class GridComponent {
4638
5068
  */
4639
5069
  this.resizeMethod = input("fitView", /* @ts-ignore */
4640
5070
  ...(ngDevMode ? [{ debugName: "resizeMethod" }] : /* istanbul ignore next */ []));
5071
+ /**
5072
+ * @description Field name or selector used to derive a stable identity for each row.
5073
+ * The resolved value must be unique within the grid data.
5074
+ * @default null
5075
+ */
5076
+ this.rowKey = input(null, /* @ts-ignore */
5077
+ ...(ngDevMode ? [{ debugName: "rowKey" }] : /* istanbul ignore next */ []));
4641
5078
  /**
4642
5079
  * @description Whether the pager is responsive.
4643
5080
  * If set to `true`, the pager will be displayed as a dropdown when the grid width gets smaller.
@@ -4905,9 +5342,15 @@ class GridComponent {
4905
5342
  }
4906
5343
  const thList = headerElement.nativeElement.querySelectorAll("thead > tr:first-child > th");
4907
5344
  const headerCells = Array.from(thList);
5345
+ if (this.gridService.rowReorderColumnVisible()) {
5346
+ headerCells.shift();
5347
+ }
4908
5348
  if (this.gridService.masterDetailTemplate()) {
4909
5349
  headerCells.shift();
4910
5350
  }
5351
+ if (this.gridService.selectionColumnVisible()) {
5352
+ headerCells.shift();
5353
+ }
4911
5354
  for (const _ of this.gridService.groupColumns()) {
4912
5355
  headerCells.shift();
4913
5356
  }
@@ -4940,9 +5383,12 @@ class GridComponent {
4940
5383
  setDataEffect() {
4941
5384
  effect(() => {
4942
5385
  const data = this.data();
4943
- const rowKey = this.gridService.editableRowKey();
5386
+ const rowKey = this.rowKey();
4944
5387
  const shouldRestoreGridFocus = this.#hostElementRef.nativeElement.contains(this.#hostElementRef.nativeElement.ownerDocument.activeElement);
4945
- untracked(() => this.gridService.setRows(data, rowKey));
5388
+ untracked(() => {
5389
+ this.gridService.setRows(data, rowKey);
5390
+ this.gridService.rowKey.set(rowKey);
5391
+ });
4946
5392
  if (shouldRestoreGridFocus) {
4947
5393
  afterNextRender({
4948
5394
  read: () => {
@@ -5014,9 +5460,15 @@ class GridComponent {
5014
5460
  if (columnsWithWidth.any()) {
5015
5461
  headerWidth -= columnsWithWidth.sum(c => c.width ?? 0);
5016
5462
  }
5463
+ if (this.gridService.rowReorderColumnVisible()) {
5464
+ headerWidth -= this.gridService.rowReorderColumnWidth;
5465
+ }
5017
5466
  if (this.gridService.masterDetailTemplate()) {
5018
5467
  headerWidth -= this.gridService.detailColumnWidth;
5019
5468
  }
5469
+ if (this.gridService.selectionColumnVisible()) {
5470
+ headerWidth -= this.gridService.selectionColumnWidth;
5471
+ }
5020
5472
  headerWidth -= this.gridService.groupColumnWidth * this.gridService.groupColumns().length;
5021
5473
  const fitViewWidthByColumn = this.resizeMethod() === "fitView" ? this.createFitViewWidthMap(headerWidth) : new Map();
5022
5474
  const visibleColumns = this.gridService.visibleColumns().toArray();
@@ -5078,17 +5530,17 @@ class GridComponent {
5078
5530
  }
5079
5531
  }
5080
5532
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5081
- 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 }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "grid" }, properties: { "class": "baseClass()", "attr.data-uid": "uid" } }, providers: [GridService, GridNavigationService, GridRowFlattenerService, FilterService], queries: [{ propertyName: "columnDefinitions", predicate: GRID_COLUMN_DEFINITION, isSignal: true }, { propertyName: "gridDetailTemplate", first: true, predicate: GridDetailTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: GridNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "toolbarTemplate", first: true, predicate: GridToolbarTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "footerScrollElement", first: true, predicate: ["footerScrollElement"], descendants: true, isSignal: true }, { propertyName: "gridHeaderElement", first: true, predicate: ["gridHeaderElement"], descendants: true, isSignal: true }, { propertyName: "gridHeaderTableElement", first: true, predicate: ["headerTable"], descendants: true, isSignal: true }, { propertyName: "groupColumnList", first: true, predicate: ["groupColumnList"], descendants: true, isSignal: true }, { propertyName: "toolbarElement", first: true, predicate: ["toolbarElement"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (toolbarTemplate()) {\n <div\n class=\"flex min-h-10 items-center gap-2 border-b border-border p-2\"\n #toolbarElement\n (keydown)=\"onToolbarKeydown($event)\">\n <ng-container\n [ngTemplateOutlet]=\"toolbarTemplate() ?? null\"\n [ngTemplateOutletContext]=\"toolbarContext()\"></ng-container>\n <button monaButton size=\"small\" #columnsButton>Columns</button>\n <mona-popup\n [anchor]=\"columnsButton\"\n [animation]=\"{ leave: [] }\"\n [width]=\"'max-content'\"\n [anchorConnectionPoint]=\"'bottomleft'\"\n [popupConnectionPoint]=\"'topleft'\"\n #popup>\n <mona-grid-column-chooser\n (apply)=\"popup.closePopup()\"\n (cancel)=\"popup.closePopup()\"></mona-grid-column-chooser>\n </mona-popup>\n </div>\n}\n\n@if (groupable()) {\n <div\n [class]=\"groupPanelClass()\"\n cdkDropList\n #groupColumnList=\"cdkDropList\"\n cdkDropListOrientation=\"horizontal\"\n (cdkDropListEntered)=\"onColumnDragEnterForGrouping()\"\n (cdkDropListExited)=\"onColumnDragExitForGrouping()\"\n (cdkDropListDropped)=\"onColumnDropForGrouping($event)\">\n @if (gridService.groupColumns().length !== 0) {\n @for (groupColumn of gridService.groupColumns(); track $index) {\n <mona-chip\n [removable]=\"true\"\n size=\"small\"\n [rounded]=\"rounded()\"\n (click)=\"onGroupingColumnSort(groupColumn)\"\n (remove)=\"onGroupingColumnRemove($event, groupColumn)\">\n @if (groupColumn.groupSortDirection === \"asc\") {\n <i class=\"ri-arrow-down-line\"></i>\n } @else if (groupColumn.groupSortDirection === \"desc\") {\n <i class=\"ri-arrow-up-line\"></i>\n }\n <span>{{ groupColumn.title }}</span>\n <span class=\"ml-2\" (click)=\"$event.stopPropagation()\" #groupReorder>\n <i class=\"ri-more-2-fill\"></i>\n </span>\n <mona-popup-menu size=\"small\" [target]=\"groupReorder\">\n <mona-popup-menu-item\n [disabled]=\"$first\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'prev')\">\n <ng-template monaPopupMenuTextTemplate>\n <i class=\"ri-arrow-left-fill\"></i> Move as previous\n </ng-template>\n </mona-popup-menu-item>\n <mona-popup-menu-item\n [disabled]=\"$last\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'next')\">\n <ng-template monaPopupMenuTextTemplate>\n <i class=\"ri-arrow-right-fill\"></i> Move as next\n </ng-template>\n </mona-popup-menu-item>\n </mona-popup-menu>\n </mona-chip>\n }\n } @else if (groupPanelPlaceholderVisible()) {\n <span [class]=\"groupPanelPlaceholderClass()\">Drag a column header here to group</span>\n }\n </div>\n}\n<div [class]=\"headerClass()\" [style.margin-right.px]=\"headerMarginRight()\" #gridHeaderElement>\n <div>\n <table #headerTable [class]=\"headerTableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @for (col of gridService.visibleColumns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <thead role=\"rowgroup\" [style.visibility]=\"!gridWidthSet() ? 'hidden' : undefined\">\n <tr\n cdkDropList\n [cdkDropListConnectedTo]=\"groupable() ? [groupColumnList()!] : []\"\n (cdkDropListDropped)=\"onColumnDrop()\"\n [class]=\"headerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-r border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.groupColumnWidth\"></th>\n }\n @if (gridService.masterDetailTemplate()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"gridService.groupColumns().length * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-r border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.detailColumnWidth\"></th>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n @let colIndex = gridService.masterDetailTemplate() ? $index + 1 : $index;\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 === 0\"\n [lastInRow]=\"\n colIndex ===\n gridService.visibleColumns().length - (gridService.masterDetailTemplate() ? 0 : 1)\n \"\n (toggle)=\"onColumnSort(column)\"\n [cdkDragData]=\"column\"\n [cdkDragDisabled]=\"isColumnDragDisabled(column)\"\n [class]=\"headerTableCellClass()\"\n (mouseenter)=\"onColumnMouseEnter(column)\"\n (cdkDragEntered)=\"onColumnDragEnter($event)\"\n (cdkDragStarted)=\"onColumnDragStart($event)\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\"\n [attr.colspan]=\"1\"\n [attr.aria-sort]=\"\n gridService.sortableOptions().enabled\n ? (column.columnSortDirection | columnAriaSort)\n : null\n \">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: column, column }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n\n <div [class]=\"columnActionsClass()\" [attr.data-column-actions]=\"true\">\n @if (gridService.sortableOptions().showIndices && column.sortIndex !== null) {\n <span>{{ column.sortIndex }}</span>\n }\n @if (column.columnSortDirection === \"asc\") {\n <i class=\"ri-arrow-down-line\"></i>\n } @else if (column.columnSortDirection === \"desc\") {\n <i class=\"ri-arrow-up-line\"></i>\n }\n @if (filterMenuEnabled()) {\n @if (column.kind === \"data\") {\n <mona-grid-filter-menu\n [column]=\"column\"\n [type]=\"column.dataType\"\n (apply)=\"onColumnFilter(column, $event)\"></mona-grid-filter-menu>\n }\n }\n </div>\n </div>\n @if (\n dropColumn() === column &&\n dragColumn() &&\n gridService.reorderableOptions().enabled &&\n !groupingInProgress()\n ) {\n <span [class]=\"columnDropHintClass()\"> </span>\n }\n @if (gridService.resizableOptions().enabled && !columnDragging()) {\n <div\n monaGridColumnResizeHandler\n [column]=\"column\"\n [class]=\"columnResizerClass()\"\n (resizeStart)=\"onColumnResizeStart()\"\n (resizeEnd)=\"onColumnResizeEnd($event)\"></div>\n }\n <ng-template cdkDragPreview>\n <div [class]=\"columnDragPreviewClass()\">\n <span>{{ column.title }}</span>\n </div>\n </ng-template>\n <ng-template cdkDragPlaceholder>\n @if (groupingInProgress()) {\n <mona-chip\n style=\"z-index: 10; pointer-events: none\"\n [removable]=\"true\"\n [rounded]=\"rounded()\"\n >{{ column.title }}</mona-chip\n >\n }\n </ng-template>\n </th>\n @if (columnDragging() && dragColumn() === column) {\n <th\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [class]=\"headerTableCellClass()\"\n [style.min-width.px]=\"column.minWidth\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"column.calculatedWidth\">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: column, column }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n </div>\n </th>\n }\n }\n </tr>\n @if (filterRowEnabled()) {\n <tr role=\"row\" [class]=\"headerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-r border-border\"\n [style.width.px]=\"gridService.groupColumnWidth\"></th>\n }\n @if (gridService.masterDetailTemplate()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"\n gridService.groupColumns().length * gridService.groupColumnWidth\n \"\n scope=\"col\"\n class=\"border-r border-border\"\n [style.width.px]=\"gridService.detailColumnWidth\"></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-r border-border overflow-hidden\"\n [style.width.px]=\"column.calculatedWidth\"\n [attr.aria-label]=\"'Filter by ' + column.title\">\n @if (column.kind === \"data\" && column.field) {\n <mona-grid-filter-row-cell\n [column]=\"column\"\n (apply)=\"onColumnFilter(column, $event)\" />\n }\n </th>\n }\n </tr>\n }\n </thead>\n </table>\n </div>\n</div>\n\n@defer (when gridWidthSet()) {\n @if (gridService.virtualScrollOptions().enabled) {\n @if (gridService.viewRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-virtual-list\n [columns]=\"gridService.visibleColumns()\"\n [data]=\"gridService.viewRows()\"></mona-grid-virtual-list>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\"></ng-container>\n }\n } @else {\n @if (gridService.viewPageRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-list\n [columns]=\"gridService.visibleColumns()\"\n [data]=\"gridService.viewPageRows()\"></mona-grid-list>\n @if (footerVisible()) {\n <div\n [class]=\"footerClass()\"\n [style.margin-right.px]=\"gridService.scrollbarGutterWidth()\"\n #footerScrollElement\n data-grid-footer-scroll>\n <div>\n <table [class]=\"footerTableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @for (col of gridService.visibleColumns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <tfoot role=\"rowgroup\">\n <tr [class]=\"footerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [footerCellWidth]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"\n gridService.groupColumns().length * gridService.groupColumnWidth\n \"\n [footerCellWidth]=\"gridService.detailColumnWidth\"></td>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [footerColumn]=\"column\">\n <mona-grid-footer-cell\n [column]=\"column\"\n [columnIndex]=\"$index\"></mona-grid-footer-cell>\n </td>\n }\n </tr>\n </tfoot>\n </table>\n </div>\n </div>\n }\n <mona-pager\n class=\"border-0 border-t border-t-border rounded-tl-none rounded-tr-none\"\n [skip]=\"gridService.paginationState().skip\"\n [pageSize]=\"gridService.paginationState().take\"\n [total]=\"gridService.viewRowCount()\"\n [size]=\"'small'\"\n [rounded]=\"rounded()\"\n [pageInput]=\"true\"\n [pageSizeValues]=\"pageSizeValues()\"\n [responsive]=\"responsivePager()\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n (pageChange)=\"onPageChange($event)\"></mona-pager>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\"></ng-container>\n }\n }\n} @placeholder {\n <mona-placeholder text=\"Loading...\"></mona-placeholder>\n}\n\n<ng-template #emptyGridTemplate>\n <div [class]=\"noDataClass()\">\n @if (noDataTemplate()) {\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n } @else {\n <mona-placeholder text=\"No data\"></mona-placeholder>\n }\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "component", type: ChipComponent, selector: "mona-chip", inputs: ["aria-label", "disabled", "label", "look", "removable", "removeLabel", "removeTabIndex", "rounded", "selected", "size", "tabindex", "toggleable", "class", "value"], outputs: ["contentClick", "remove", "selectedChange"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: GridFilterMenuComponent, selector: "mona-grid-filter-menu", inputs: ["column", "type"], outputs: ["apply"] }, { kind: "component", type: GridFilterRowCellComponent, selector: "mona-grid-filter-row-cell", inputs: ["column"], outputs: ["apply"] }, { kind: "directive", type: GridColumnResizeHandlerDirective, selector: "[monaGridColumnResizeHandler]", inputs: ["column"], outputs: ["resizeEnd", "resizeStart"] }, { kind: "directive", type: CdkDragPreview, selector: "ng-template[cdkDragPreview]", inputs: ["data", "matchSize"] }, { kind: "directive", type: CdkDragPlaceholder, selector: "ng-template[cdkDragPlaceholder]", inputs: ["data"] }, { kind: "component", type: PlaceholderComponent, selector: "mona-placeholder", inputs: ["text", "class"] }, { kind: "component", type: PopupMenuComponent, selector: "mona-popup-menu", inputs: ["anchor", "anchorConnectionPoint", "items", "id", "minWidth", "offset", "popupConnectionPoint", "precise", "rounded", "size", "target", "trigger", "width", "class"], outputs: ["close", "menuClick", "navigate", "open"] }, { kind: "component", type: PopupMenuItemComponent, selector: "mona-popup-menu-item", inputs: ["disabled", "label"], outputs: ["menuClick"] }, { kind: "directive", type: PopupMenuTextTemplateDirective, selector: "ng-template[monaPopupMenuTextTemplate]" }, { kind: "directive", type: GridLogicalCellDirective, selector: "td[monaGridLogicalCell], th[monaGridLogicalCell]", inputs: ["cellKind", "colIndex", "columnId", "editable", "firstInRow", "groupHeader", "groupKey", "lastInRow", "rowIndex", "rowUid", "section"], outputs: ["edit", "toggle"] }, { kind: "directive", type: GridLockedCellDirective, selector: "td[monaGridLockedCell], th[monaGridLockedCell]", inputs: ["column", "lockedCellHeader", "lockedStructuralOffset"] }, { 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: "pipe", type: ColumnAriaSortPipe, name: "columnAriaSort" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [NgTemplateOutlet, /* @ts-ignore */
5082
- import('./nanahoshi-mona-ui-grid-grid-footer-cell.component-BbBPZj7t.mjs').then(m => m.GridFooterCellComponent), /* @ts-ignore */
5083
- import('./nanahoshi-mona-ui-grid-grid-list.component-DReEfWfG.mjs').then(m => m.GridListComponent), PagerComponent, /* @ts-ignore */
5084
- import('./nanahoshi-mona-ui-grid-grid-virtual-list.component-BCIs_lmz.mjs').then(m => m.GridVirtualListComponent), /* @ts-ignore */
5085
- import('./nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-BkISJoqL.mjs').then(m => m.GridFooterTableCellDirective), GridLockedCellDirective]] }); }
5533
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridComponent, isStandalone: true, selector: "mona-grid", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, pageSizeValues: { classPropertyName: "pageSizeValues", publicName: "pageSizeValues", isSignal: true, isRequired: false, transformFunction: null }, resizeMethod: { classPropertyName: "resizeMethod", publicName: "resizeMethod", isSignal: true, isRequired: false, transformFunction: null }, rowKey: { classPropertyName: "rowKey", publicName: "rowKey", isSignal: true, isRequired: false, transformFunction: null }, responsivePager: { classPropertyName: "responsivePager", publicName: "responsivePager", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "grid" }, properties: { "class": "baseClass()", "attr.data-uid": "uid" } }, providers: [GridService, GridNavigationService, GridRowFlattenerService, FilterService], queries: [{ propertyName: "columnDefinitions", predicate: GRID_COLUMN_DEFINITION, isSignal: true }, { propertyName: "gridDetailTemplate", first: true, predicate: GridDetailTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: GridNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "toolbarTemplate", first: true, predicate: GridToolbarTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "footerScrollElement", first: true, predicate: ["footerScrollElement"], descendants: true, isSignal: true }, { propertyName: "gridHeaderElement", first: true, predicate: ["gridHeaderElement"], descendants: true, isSignal: true }, { propertyName: "gridHeaderTableElement", first: true, predicate: ["headerTable"], descendants: true, isSignal: true }, { propertyName: "groupColumnList", first: true, predicate: ["groupColumnList"], descendants: true, isSignal: true }, { propertyName: "toolbarElement", first: true, predicate: ["toolbarElement"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (toolbarTemplate()) {\n <div\n class=\"flex min-h-10 items-center gap-2 border-b border-border p-2\"\n #toolbarElement\n (keydown)=\"onToolbarKeydown($event)\">\n <ng-container\n [ngTemplateOutlet]=\"toolbarTemplate() ?? null\"\n [ngTemplateOutletContext]=\"toolbarContext()\"></ng-container>\n <button monaButton size=\"small\" #columnsButton>Columns</button>\n <mona-popup\n [anchor]=\"columnsButton\"\n [animation]=\"{ leave: [] }\"\n [width]=\"'max-content'\"\n [anchorConnectionPoint]=\"'bottomleft'\"\n [popupConnectionPoint]=\"'topleft'\"\n #popup>\n <mona-grid-column-chooser\n (apply)=\"popup.closePopup()\"\n (cancel)=\"popup.closePopup()\"></mona-grid-column-chooser>\n </mona-popup>\n </div>\n}\n\n@if (groupable()) {\n <div\n [class]=\"groupPanelClass()\"\n cdkDropList\n #groupColumnList=\"cdkDropList\"\n cdkDropListOrientation=\"horizontal\"\n (cdkDropListEntered)=\"onColumnDragEnterForGrouping()\"\n (cdkDropListExited)=\"onColumnDragExitForGrouping()\"\n (cdkDropListDropped)=\"onColumnDropForGrouping($event)\">\n @if (gridService.groupColumns().length !== 0) {\n @for (groupColumn of gridService.groupColumns(); track $index) {\n <mona-chip\n [removable]=\"true\"\n size=\"small\"\n [rounded]=\"rounded()\"\n (click)=\"onGroupingColumnSort(groupColumn)\"\n (remove)=\"onGroupingColumnRemove($event, groupColumn)\">\n @if (groupColumn.groupSortDirection === \"asc\") {\n <i class=\"ri-arrow-down-line\"></i>\n } @else if (groupColumn.groupSortDirection === \"desc\") {\n <i class=\"ri-arrow-up-line\"></i>\n }\n <span>{{ groupColumn.title }}</span>\n <span class=\"ml-2\" (click)=\"$event.stopPropagation()\" #groupReorder>\n <i class=\"ri-more-2-fill\"></i>\n </span>\n <mona-popup-menu size=\"small\" [target]=\"groupReorder\">\n <mona-popup-menu-item\n [disabled]=\"$first\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'prev')\">\n <ng-template monaPopupMenuTextTemplate>\n <i class=\"ri-arrow-left-fill\"></i> Move as previous\n </ng-template>\n </mona-popup-menu-item>\n <mona-popup-menu-item\n [disabled]=\"$last\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'next')\">\n <ng-template monaPopupMenuTextTemplate>\n <i class=\"ri-arrow-right-fill\"></i> Move as next\n </ng-template>\n </mona-popup-menu-item>\n </mona-popup-menu>\n </mona-chip>\n }\n } @else if (groupPanelPlaceholderVisible()) {\n <span [class]=\"groupPanelPlaceholderClass()\">Drag a column header here to group</span>\n }\n </div>\n}\n<div [class]=\"headerClass()\" [style.margin-right.px]=\"headerMarginRight()\" #gridHeaderElement>\n <div>\n <table #headerTable [class]=\"headerTableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of gridService.visibleColumns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <thead role=\"rowgroup\" [style.visibility]=\"!gridWidthSet() ? 'hidden' : undefined\">\n <tr\n cdkDropList\n [cdkDropListConnectedTo]=\"groupable() ? [groupColumnList()!] : []\"\n (cdkDropListDropped)=\"onColumnDrop()\"\n [class]=\"headerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-r 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 aria-label=\"Row reorder\"\n class=\"border-r 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-r 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-r border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.selectionColumnWidth\">\n @if (\n gridService.selectableOptions().mode === \"multiple\" &&\n gridService.selectableOptions().showSelectAll !== false\n ) {\n <mona-grid-select-all-checkbox />\n }\n </th>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n @let colIndex = $index + gridService.leadingLogicalColumnCount();\n <th\n scope=\"col\"\n role=\"columnheader\"\n cdkDrag\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'header'\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [colIndex]=\"colIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"colIndex === gridService.leadingLogicalColumnCount()\"\n [lastInRow]=\"\n colIndex ===\n gridService.leadingLogicalColumnCount() +\n gridService.visibleColumns().length -\n 1\n \"\n (toggle)=\"onColumnSort(column)\"\n [cdkDragData]=\"column\"\n [cdkDragDisabled]=\"isColumnDragDisabled(column)\"\n [class]=\"headerTableCellClass()\"\n (mouseenter)=\"onColumnMouseEnter(column)\"\n (cdkDragEntered)=\"onColumnDragEnter($event)\"\n (cdkDragStarted)=\"onColumnDragStart($event)\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\"\n [attr.colspan]=\"1\"\n [attr.aria-sort]=\"\n gridService.sortableOptions().enabled\n ? (column.columnSortDirection | columnAriaSort)\n : null\n \">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: column, column }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n\n <div [class]=\"columnActionsClass()\" [attr.data-column-actions]=\"true\">\n @if (gridService.sortableOptions().showIndices && column.sortIndex !== null) {\n <span>{{ column.sortIndex }}</span>\n }\n @if (column.columnSortDirection === \"asc\") {\n <i class=\"ri-arrow-down-line\"></i>\n } @else if (column.columnSortDirection === \"desc\") {\n <i class=\"ri-arrow-up-line\"></i>\n }\n @if (filterMenuEnabled()) {\n @if (column.kind === \"data\") {\n <mona-grid-filter-menu\n [column]=\"column\"\n [type]=\"column.dataType\"\n (apply)=\"onColumnFilter(column, $event)\"></mona-grid-filter-menu>\n }\n }\n </div>\n </div>\n @if (\n dropColumn() === column &&\n dragColumn() &&\n gridService.reorderableOptions().enabled &&\n !groupingInProgress()\n ) {\n <span [class]=\"columnDropHintClass()\"> </span>\n }\n @if (gridService.resizableOptions().enabled && !columnDragging()) {\n <div\n monaGridColumnResizeHandler\n [column]=\"column\"\n [class]=\"columnResizerClass()\"\n (resizeStart)=\"onColumnResizeStart()\"\n (resizeEnd)=\"onColumnResizeEnd($event)\"></div>\n }\n <ng-template cdkDragPreview>\n <div [class]=\"columnDragPreviewClass()\">\n <span>{{ column.title }}</span>\n </div>\n </ng-template>\n <ng-template cdkDragPlaceholder>\n @if (groupingInProgress()) {\n <mona-chip\n style=\"z-index: 10; pointer-events: none\"\n [removable]=\"true\"\n [rounded]=\"rounded()\"\n >{{ column.title }}</mona-chip\n >\n }\n </ng-template>\n </th>\n @if (columnDragging() && dragColumn() === column) {\n <th\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [class]=\"headerTableCellClass()\"\n [style.min-width.px]=\"column.minWidth\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"column.calculatedWidth\">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: column, column }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n </div>\n </th>\n }\n }\n </tr>\n @if (filterRowEnabled()) {\n <tr role=\"row\" [class]=\"headerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-r 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-r 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-r 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-r 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-r border-border overflow-hidden\"\n [style.width.px]=\"column.calculatedWidth\"\n [attr.aria-label]=\"'Filter by ' + column.title\">\n @if (column.kind === \"data\" && column.field) {\n <mona-grid-filter-row-cell\n [column]=\"column\"\n (apply)=\"onColumnFilter(column, $event)\" />\n }\n </th>\n }\n </tr>\n }\n </thead>\n </table>\n </div>\n</div>\n\n@defer (when gridWidthSet()) {\n @if (gridService.virtualScrollOptions().enabled) {\n @if (gridService.viewRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-virtual-list\n [columns]=\"gridService.visibleColumns()\"\n [data]=\"gridService.viewRows()\"></mona-grid-virtual-list>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\"></ng-container>\n }\n } @else {\n @if (gridService.viewPageRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-list\n [columns]=\"gridService.visibleColumns()\"\n [data]=\"gridService.viewPageRows()\"></mona-grid-list>\n @if (footerVisible()) {\n <div\n [class]=\"footerClass()\"\n [style.margin-right.px]=\"gridService.scrollbarGutterWidth()\"\n #footerScrollElement\n data-grid-footer-scroll>\n <div>\n <table [class]=\"footerTableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of gridService.visibleColumns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <tfoot role=\"rowgroup\">\n <tr [class]=\"footerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [footerCellWidth]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n [footerCellWidth]=\"gridService.rowReorderColumnWidth\"></td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n [footerCellWidth]=\"gridService.detailColumnWidth\"></td>\n }\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n [footerCellWidth]=\"gridService.selectionColumnWidth\"></td>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [footerColumn]=\"column\">\n <mona-grid-footer-cell\n [column]=\"column\"\n [columnIndex]=\"$index\"></mona-grid-footer-cell>\n </td>\n }\n </tr>\n </tfoot>\n </table>\n </div>\n </div>\n }\n <mona-pager\n class=\"border-0 border-t border-t-border rounded-tl-none rounded-tr-none\"\n [skip]=\"gridService.paginationState().skip\"\n [pageSize]=\"gridService.paginationState().take\"\n [total]=\"gridService.viewRowCount()\"\n [size]=\"'small'\"\n [rounded]=\"rounded()\"\n [pageInput]=\"true\"\n [pageSizeValues]=\"pageSizeValues()\"\n [responsive]=\"responsivePager()\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n (pageChange)=\"onPageChange($event)\"></mona-pager>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\"></ng-container>\n }\n }\n} @placeholder {\n <mona-placeholder text=\"Loading...\"></mona-placeholder>\n}\n\n<ng-template #emptyGridTemplate>\n <div [class]=\"noDataClass()\">\n @if (noDataTemplate()) {\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n } @else {\n <mona-placeholder text=\"No data\"></mona-placeholder>\n }\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "component", type: ChipComponent, selector: "mona-chip", inputs: ["aria-label", "disabled", "label", "look", "removable", "removeLabel", "removeTabIndex", "rounded", "selected", "size", "tabindex", "toggleable", "class", "value"], outputs: ["contentClick", "remove", "selectedChange"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: GridFilterMenuComponent, selector: "mona-grid-filter-menu", inputs: ["column", "type"], outputs: ["apply"] }, { kind: "component", type: GridFilterRowCellComponent, selector: "mona-grid-filter-row-cell", inputs: ["column"], outputs: ["apply"] }, { kind: "directive", type: GridColumnResizeHandlerDirective, selector: "[monaGridColumnResizeHandler]", inputs: ["column"], outputs: ["resizeEnd", "resizeStart"] }, { kind: "directive", type: CdkDragPreview, selector: "ng-template[cdkDragPreview]", inputs: ["data", "matchSize"] }, { kind: "directive", type: CdkDragPlaceholder, selector: "ng-template[cdkDragPlaceholder]", inputs: ["data"] }, { kind: "component", type: PlaceholderComponent, selector: "mona-placeholder", inputs: ["text", "class"] }, { kind: "component", type: PopupMenuComponent, selector: "mona-popup-menu", inputs: ["anchor", "anchorConnectionPoint", "items", "id", "minWidth", "offset", "popupConnectionPoint", "precise", "rounded", "size", "target", "trigger", "width", "class"], outputs: ["close", "menuClick", "navigate", "open"] }, { kind: "component", type: PopupMenuItemComponent, selector: "mona-popup-menu-item", inputs: ["disabled", "label"], outputs: ["menuClick"] }, { kind: "directive", type: PopupMenuTextTemplateDirective, selector: "ng-template[monaPopupMenuTextTemplate]" }, { kind: "directive", type: GridLogicalCellDirective, selector: "td[monaGridLogicalCell], th[monaGridLogicalCell]", inputs: ["cellKind", "colIndex", "columnId", "editable", "firstInRow", "groupHeader", "groupKey", "lastInRow", "rowIndex", "rowUid", "section"], outputs: ["edit", "toggle"] }, { kind: "directive", type: GridLockedCellDirective, selector: "td[monaGridLockedCell], th[monaGridLockedCell]", inputs: ["column", "groupPrefixWidth", "lockedCellHeader", "lockedStructuralOffset", "structuralColumn"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: PopupComponent, selector: "mona-popup", inputs: ["anchor", "anchorConnectionPoint", "animation", "backdropClass", "closeOnBackdropClick", "closeOnEscape", "closeOnMouseLeave", "closeOnOutsideClick", "data", "hasBackdrop", "height", "maxHeight", "maxWidth", "minHeight", "minWidth", "offset", "popupClass", "popupConnectionPoint", "popupWrapperClass", "positionStrategy", "positions", "preventClose", "providers", "trigger", "width", "withPush", "closeOnScroll", "restoreFocus", "withScrollTracking"], outputs: ["close", "open"] }, { kind: "component", type: GridColumnChooserComponent, selector: "mona-grid-column-chooser", outputs: ["apply", "cancel"] }, { kind: "component", type: GridSelectAllCheckboxComponent, selector: "mona-grid-select-all-checkbox" }, { kind: "pipe", type: ColumnAriaSortPipe, name: "columnAriaSort" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [NgTemplateOutlet, /* @ts-ignore */
5534
+ import('./nanahoshi-mona-ui-grid-grid-footer-cell.component-CJmjLl7R.mjs').then(m => m.GridFooterCellComponent), /* @ts-ignore */
5535
+ import('./nanahoshi-mona-ui-grid-grid-list.component-BhnFFIOl.mjs').then(m => m.GridListComponent), PagerComponent, /* @ts-ignore */
5536
+ import('./nanahoshi-mona-ui-grid-grid-virtual-list.component-7acNUovW.mjs').then(m => m.GridVirtualListComponent), /* @ts-ignore */
5537
+ import('./nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-pGhsAcVA.mjs').then(m => m.GridFooterTableCellDirective), GridLockedCellDirective]] }); }
5086
5538
  }
5087
5539
  i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.0.6", ngImport: i0, type: GridComponent, resolveDeferredDeps: () => [/* @ts-ignore */
5088
- import('./nanahoshi-mona-ui-grid-grid-footer-cell.component-BbBPZj7t.mjs').then(m => m.GridFooterCellComponent), /* @ts-ignore */
5089
- import('./nanahoshi-mona-ui-grid-grid-list.component-DReEfWfG.mjs').then(m => m.GridListComponent), /* @ts-ignore */
5090
- import('./nanahoshi-mona-ui-grid-grid-virtual-list.component-BCIs_lmz.mjs').then(m => m.GridVirtualListComponent), /* @ts-ignore */
5091
- import('./nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-BkISJoqL.mjs').then(m => m.GridFooterTableCellDirective)], resolveMetadata: (GridFooterCellComponent, GridListComponent, GridVirtualListComponent, GridFooterTableCellDirective) => ({ decorators: [{
5540
+ import('./nanahoshi-mona-ui-grid-grid-footer-cell.component-CJmjLl7R.mjs').then(m => m.GridFooterCellComponent), /* @ts-ignore */
5541
+ import('./nanahoshi-mona-ui-grid-grid-list.component-BhnFFIOl.mjs').then(m => m.GridListComponent), /* @ts-ignore */
5542
+ import('./nanahoshi-mona-ui-grid-grid-virtual-list.component-7acNUovW.mjs').then(m => m.GridVirtualListComponent), /* @ts-ignore */
5543
+ import('./nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-pGhsAcVA.mjs').then(m => m.GridFooterTableCellDirective)], resolveMetadata: (GridFooterCellComponent, GridListComponent, GridVirtualListComponent, GridFooterTableCellDirective) => ({ decorators: [{
5092
5544
  type: Component,
5093
5545
  args: [{ selector: "mona-grid", changeDetection: ChangeDetectionStrategy.OnPush, providers: [GridService, GridNavigationService, GridRowFlattenerService, FilterService], imports: [
5094
5546
  CdkDropList,
@@ -5114,13 +5566,14 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.0.6", ng
5114
5566
  GridLockedCellDirective,
5115
5567
  ButtonDirective,
5116
5568
  PopupComponent,
5117
- GridColumnChooserComponent
5569
+ GridColumnChooserComponent,
5570
+ GridSelectAllCheckboxComponent
5118
5571
  ], host: {
5119
5572
  "[class]": "baseClass()",
5120
5573
  "[attr.data-uid]": "uid",
5121
5574
  role: "grid"
5122
- }, 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>Columns</button>\n <mona-popup\n [anchor]=\"columnsButton\"\n [animation]=\"{ leave: [] }\"\n [width]=\"'max-content'\"\n [anchorConnectionPoint]=\"'bottomleft'\"\n [popupConnectionPoint]=\"'topleft'\"\n #popup>\n <mona-grid-column-chooser\n (apply)=\"popup.closePopup()\"\n (cancel)=\"popup.closePopup()\"></mona-grid-column-chooser>\n </mona-popup>\n </div>\n}\n\n@if (groupable()) {\n <div\n [class]=\"groupPanelClass()\"\n cdkDropList\n #groupColumnList=\"cdkDropList\"\n cdkDropListOrientation=\"horizontal\"\n (cdkDropListEntered)=\"onColumnDragEnterForGrouping()\"\n (cdkDropListExited)=\"onColumnDragExitForGrouping()\"\n (cdkDropListDropped)=\"onColumnDropForGrouping($event)\">\n @if (gridService.groupColumns().length !== 0) {\n @for (groupColumn of gridService.groupColumns(); track $index) {\n <mona-chip\n [removable]=\"true\"\n size=\"small\"\n [rounded]=\"rounded()\"\n (click)=\"onGroupingColumnSort(groupColumn)\"\n (remove)=\"onGroupingColumnRemove($event, groupColumn)\">\n @if (groupColumn.groupSortDirection === \"asc\") {\n <i class=\"ri-arrow-down-line\"></i>\n } @else if (groupColumn.groupSortDirection === \"desc\") {\n <i class=\"ri-arrow-up-line\"></i>\n }\n <span>{{ groupColumn.title }}</span>\n <span class=\"ml-2\" (click)=\"$event.stopPropagation()\" #groupReorder>\n <i class=\"ri-more-2-fill\"></i>\n </span>\n <mona-popup-menu size=\"small\" [target]=\"groupReorder\">\n <mona-popup-menu-item\n [disabled]=\"$first\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'prev')\">\n <ng-template monaPopupMenuTextTemplate>\n <i class=\"ri-arrow-left-fill\"></i> Move as previous\n </ng-template>\n </mona-popup-menu-item>\n <mona-popup-menu-item\n [disabled]=\"$last\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'next')\">\n <ng-template monaPopupMenuTextTemplate>\n <i class=\"ri-arrow-right-fill\"></i> Move as next\n </ng-template>\n </mona-popup-menu-item>\n </mona-popup-menu>\n </mona-chip>\n }\n } @else if (groupPanelPlaceholderVisible()) {\n <span [class]=\"groupPanelPlaceholderClass()\">Drag a column header here to group</span>\n }\n </div>\n}\n<div [class]=\"headerClass()\" [style.margin-right.px]=\"headerMarginRight()\" #gridHeaderElement>\n <div>\n <table #headerTable [class]=\"headerTableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @for (col of gridService.visibleColumns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <thead role=\"rowgroup\" [style.visibility]=\"!gridWidthSet() ? 'hidden' : undefined\">\n <tr\n cdkDropList\n [cdkDropListConnectedTo]=\"groupable() ? [groupColumnList()!] : []\"\n (cdkDropListDropped)=\"onColumnDrop()\"\n [class]=\"headerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-r border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.groupColumnWidth\"></th>\n }\n @if (gridService.masterDetailTemplate()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"gridService.groupColumns().length * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-r border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.detailColumnWidth\"></th>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n @let colIndex = gridService.masterDetailTemplate() ? $index + 1 : $index;\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 === 0\"\n [lastInRow]=\"\n colIndex ===\n gridService.visibleColumns().length - (gridService.masterDetailTemplate() ? 0 : 1)\n \"\n (toggle)=\"onColumnSort(column)\"\n [cdkDragData]=\"column\"\n [cdkDragDisabled]=\"isColumnDragDisabled(column)\"\n [class]=\"headerTableCellClass()\"\n (mouseenter)=\"onColumnMouseEnter(column)\"\n (cdkDragEntered)=\"onColumnDragEnter($event)\"\n (cdkDragStarted)=\"onColumnDragStart($event)\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\"\n [attr.colspan]=\"1\"\n [attr.aria-sort]=\"\n gridService.sortableOptions().enabled\n ? (column.columnSortDirection | columnAriaSort)\n : null\n \">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: column, column }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n\n <div [class]=\"columnActionsClass()\" [attr.data-column-actions]=\"true\">\n @if (gridService.sortableOptions().showIndices && column.sortIndex !== null) {\n <span>{{ column.sortIndex }}</span>\n }\n @if (column.columnSortDirection === \"asc\") {\n <i class=\"ri-arrow-down-line\"></i>\n } @else if (column.columnSortDirection === \"desc\") {\n <i class=\"ri-arrow-up-line\"></i>\n }\n @if (filterMenuEnabled()) {\n @if (column.kind === \"data\") {\n <mona-grid-filter-menu\n [column]=\"column\"\n [type]=\"column.dataType\"\n (apply)=\"onColumnFilter(column, $event)\"></mona-grid-filter-menu>\n }\n }\n </div>\n </div>\n @if (\n dropColumn() === column &&\n dragColumn() &&\n gridService.reorderableOptions().enabled &&\n !groupingInProgress()\n ) {\n <span [class]=\"columnDropHintClass()\"> </span>\n }\n @if (gridService.resizableOptions().enabled && !columnDragging()) {\n <div\n monaGridColumnResizeHandler\n [column]=\"column\"\n [class]=\"columnResizerClass()\"\n (resizeStart)=\"onColumnResizeStart()\"\n (resizeEnd)=\"onColumnResizeEnd($event)\"></div>\n }\n <ng-template cdkDragPreview>\n <div [class]=\"columnDragPreviewClass()\">\n <span>{{ column.title }}</span>\n </div>\n </ng-template>\n <ng-template cdkDragPlaceholder>\n @if (groupingInProgress()) {\n <mona-chip\n style=\"z-index: 10; pointer-events: none\"\n [removable]=\"true\"\n [rounded]=\"rounded()\"\n >{{ column.title }}</mona-chip\n >\n }\n </ng-template>\n </th>\n @if (columnDragging() && dragColumn() === column) {\n <th\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [class]=\"headerTableCellClass()\"\n [style.min-width.px]=\"column.minWidth\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"column.calculatedWidth\">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: column, column }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n </div>\n </th>\n }\n }\n </tr>\n @if (filterRowEnabled()) {\n <tr role=\"row\" [class]=\"headerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-r border-border\"\n [style.width.px]=\"gridService.groupColumnWidth\"></th>\n }\n @if (gridService.masterDetailTemplate()) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"\n gridService.groupColumns().length * gridService.groupColumnWidth\n \"\n scope=\"col\"\n class=\"border-r border-border\"\n [style.width.px]=\"gridService.detailColumnWidth\"></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-r border-border overflow-hidden\"\n [style.width.px]=\"column.calculatedWidth\"\n [attr.aria-label]=\"'Filter by ' + column.title\">\n @if (column.kind === \"data\" && column.field) {\n <mona-grid-filter-row-cell\n [column]=\"column\"\n (apply)=\"onColumnFilter(column, $event)\" />\n }\n </th>\n }\n </tr>\n }\n </thead>\n </table>\n </div>\n</div>\n\n@defer (when gridWidthSet()) {\n @if (gridService.virtualScrollOptions().enabled) {\n @if (gridService.viewRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-virtual-list\n [columns]=\"gridService.visibleColumns()\"\n [data]=\"gridService.viewRows()\"></mona-grid-virtual-list>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\"></ng-container>\n }\n } @else {\n @if (gridService.viewPageRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-list\n [columns]=\"gridService.visibleColumns()\"\n [data]=\"gridService.viewPageRows()\"></mona-grid-list>\n @if (footerVisible()) {\n <div\n [class]=\"footerClass()\"\n [style.margin-right.px]=\"gridService.scrollbarGutterWidth()\"\n #footerScrollElement\n data-grid-footer-scroll>\n <div>\n <table [class]=\"footerTableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @for (col of gridService.visibleColumns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <tfoot role=\"rowgroup\">\n <tr [class]=\"footerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [footerCellWidth]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"\n gridService.groupColumns().length * gridService.groupColumnWidth\n \"\n [footerCellWidth]=\"gridService.detailColumnWidth\"></td>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [footerColumn]=\"column\">\n <mona-grid-footer-cell\n [column]=\"column\"\n [columnIndex]=\"$index\"></mona-grid-footer-cell>\n </td>\n }\n </tr>\n </tfoot>\n </table>\n </div>\n </div>\n }\n <mona-pager\n class=\"border-0 border-t border-t-border rounded-tl-none rounded-tr-none\"\n [skip]=\"gridService.paginationState().skip\"\n [pageSize]=\"gridService.paginationState().take\"\n [total]=\"gridService.viewRowCount()\"\n [size]=\"'small'\"\n [rounded]=\"rounded()\"\n [pageInput]=\"true\"\n [pageSizeValues]=\"pageSizeValues()\"\n [responsive]=\"responsivePager()\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n (pageChange)=\"onPageChange($event)\"></mona-pager>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\"></ng-container>\n }\n }\n} @placeholder {\n <mona-placeholder text=\"Loading...\"></mona-placeholder>\n}\n\n<ng-template #emptyGridTemplate>\n <div [class]=\"noDataClass()\">\n @if (noDataTemplate()) {\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n } @else {\n <mona-placeholder text=\"No data\"></mona-placeholder>\n }\n </div>\n</ng-template>\n" }]
5123
- }], 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 }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } }) });
5575
+ }, 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>Columns</button>\n <mona-popup\n [anchor]=\"columnsButton\"\n [animation]=\"{ leave: [] }\"\n [width]=\"'max-content'\"\n [anchorConnectionPoint]=\"'bottomleft'\"\n [popupConnectionPoint]=\"'topleft'\"\n #popup>\n <mona-grid-column-chooser\n (apply)=\"popup.closePopup()\"\n (cancel)=\"popup.closePopup()\"></mona-grid-column-chooser>\n </mona-popup>\n </div>\n}\n\n@if (groupable()) {\n <div\n [class]=\"groupPanelClass()\"\n cdkDropList\n #groupColumnList=\"cdkDropList\"\n cdkDropListOrientation=\"horizontal\"\n (cdkDropListEntered)=\"onColumnDragEnterForGrouping()\"\n (cdkDropListExited)=\"onColumnDragExitForGrouping()\"\n (cdkDropListDropped)=\"onColumnDropForGrouping($event)\">\n @if (gridService.groupColumns().length !== 0) {\n @for (groupColumn of gridService.groupColumns(); track $index) {\n <mona-chip\n [removable]=\"true\"\n size=\"small\"\n [rounded]=\"rounded()\"\n (click)=\"onGroupingColumnSort(groupColumn)\"\n (remove)=\"onGroupingColumnRemove($event, groupColumn)\">\n @if (groupColumn.groupSortDirection === \"asc\") {\n <i class=\"ri-arrow-down-line\"></i>\n } @else if (groupColumn.groupSortDirection === \"desc\") {\n <i class=\"ri-arrow-up-line\"></i>\n }\n <span>{{ groupColumn.title }}</span>\n <span class=\"ml-2\" (click)=\"$event.stopPropagation()\" #groupReorder>\n <i class=\"ri-more-2-fill\"></i>\n </span>\n <mona-popup-menu size=\"small\" [target]=\"groupReorder\">\n <mona-popup-menu-item\n [disabled]=\"$first\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'prev')\">\n <ng-template monaPopupMenuTextTemplate>\n <i class=\"ri-arrow-left-fill\"></i> Move as previous\n </ng-template>\n </mona-popup-menu-item>\n <mona-popup-menu-item\n [disabled]=\"$last\"\n (menuClick)=\"onGroupColumnReorder(groupColumn, 'next')\">\n <ng-template monaPopupMenuTextTemplate>\n <i class=\"ri-arrow-right-fill\"></i> Move as next\n </ng-template>\n </mona-popup-menu-item>\n </mona-popup-menu>\n </mona-chip>\n }\n } @else if (groupPanelPlaceholderVisible()) {\n <span [class]=\"groupPanelPlaceholderClass()\">Drag a column header here to group</span>\n }\n </div>\n}\n<div [class]=\"headerClass()\" [style.margin-right.px]=\"headerMarginRight()\" #gridHeaderElement>\n <div>\n <table #headerTable [class]=\"headerTableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of gridService.visibleColumns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <thead role=\"rowgroup\" [style.visibility]=\"!gridWidthSet() ? 'hidden' : undefined\">\n <tr\n cdkDropList\n [cdkDropListConnectedTo]=\"groupable() ? [groupColumnList()!] : []\"\n (cdkDropListDropped)=\"onColumnDrop()\"\n [class]=\"headerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-r 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 aria-label=\"Row reorder\"\n class=\"border-r 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-r 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-r border-border\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.selectionColumnWidth\">\n @if (\n gridService.selectableOptions().mode === \"multiple\" &&\n gridService.selectableOptions().showSelectAll !== false\n ) {\n <mona-grid-select-all-checkbox />\n }\n </th>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n @let colIndex = $index + gridService.leadingLogicalColumnCount();\n <th\n scope=\"col\"\n role=\"columnheader\"\n cdkDrag\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"'header'\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [colIndex]=\"colIndex\"\n [section]=\"'header'\"\n [firstInRow]=\"colIndex === gridService.leadingLogicalColumnCount()\"\n [lastInRow]=\"\n colIndex ===\n gridService.leadingLogicalColumnCount() +\n gridService.visibleColumns().length -\n 1\n \"\n (toggle)=\"onColumnSort(column)\"\n [cdkDragData]=\"column\"\n [cdkDragDisabled]=\"isColumnDragDisabled(column)\"\n [class]=\"headerTableCellClass()\"\n (mouseenter)=\"onColumnMouseEnter(column)\"\n (cdkDragEntered)=\"onColumnDragEnter($event)\"\n (cdkDragStarted)=\"onColumnDragStart($event)\"\n [style.min-width.px]=\"column.minWidth\"\n [style.width.px]=\"column.calculatedWidth\"\n [attr.colspan]=\"1\"\n [attr.aria-sort]=\"\n gridService.sortableOptions().enabled\n ? (column.columnSortDirection | columnAriaSort)\n : null\n \">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: column, column }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n\n <div [class]=\"columnActionsClass()\" [attr.data-column-actions]=\"true\">\n @if (gridService.sortableOptions().showIndices && column.sortIndex !== null) {\n <span>{{ column.sortIndex }}</span>\n }\n @if (column.columnSortDirection === \"asc\") {\n <i class=\"ri-arrow-down-line\"></i>\n } @else if (column.columnSortDirection === \"desc\") {\n <i class=\"ri-arrow-up-line\"></i>\n }\n @if (filterMenuEnabled()) {\n @if (column.kind === \"data\") {\n <mona-grid-filter-menu\n [column]=\"column\"\n [type]=\"column.dataType\"\n (apply)=\"onColumnFilter(column, $event)\"></mona-grid-filter-menu>\n }\n }\n </div>\n </div>\n @if (\n dropColumn() === column &&\n dragColumn() &&\n gridService.reorderableOptions().enabled &&\n !groupingInProgress()\n ) {\n <span [class]=\"columnDropHintClass()\"> </span>\n }\n @if (gridService.resizableOptions().enabled && !columnDragging()) {\n <div\n monaGridColumnResizeHandler\n [column]=\"column\"\n [class]=\"columnResizerClass()\"\n (resizeStart)=\"onColumnResizeStart()\"\n (resizeEnd)=\"onColumnResizeEnd($event)\"></div>\n }\n <ng-template cdkDragPreview>\n <div [class]=\"columnDragPreviewClass()\">\n <span>{{ column.title }}</span>\n </div>\n </ng-template>\n <ng-template cdkDragPlaceholder>\n @if (groupingInProgress()) {\n <mona-chip\n style=\"z-index: 10; pointer-events: none\"\n [removable]=\"true\"\n [rounded]=\"rounded()\"\n >{{ column.title }}</mona-chip\n >\n }\n </ng-template>\n </th>\n @if (columnDragging() && dragColumn() === column) {\n <th\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [class]=\"headerTableCellClass()\"\n [style.min-width.px]=\"column.minWidth\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"column.calculatedWidth\">\n <div [class]=\"headerTableColumnWrapClass()\">\n @if (column.headerTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: column, column }\"></ng-container>\n } @else if (column.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"column.titleTemplate\"></ng-container>\n } @else {\n <span\n [class]=\"headerTableColumnTitleClass()\"\n (click)=\"onColumnSort(column)\"\n [title]=\"column.title\"\n >{{ column.title }}</span\n >\n }\n </div>\n </th>\n }\n }\n </tr>\n @if (filterRowEnabled()) {\n <tr role=\"row\" [class]=\"headerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <th\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n scope=\"col\"\n class=\"border-r 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-r 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-r 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-r 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-r border-border overflow-hidden\"\n [style.width.px]=\"column.calculatedWidth\"\n [attr.aria-label]=\"'Filter by ' + column.title\">\n @if (column.kind === \"data\" && column.field) {\n <mona-grid-filter-row-cell\n [column]=\"column\"\n (apply)=\"onColumnFilter(column, $event)\" />\n }\n </th>\n }\n </tr>\n }\n </thead>\n </table>\n </div>\n</div>\n\n@defer (when gridWidthSet()) {\n @if (gridService.virtualScrollOptions().enabled) {\n @if (gridService.viewRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-virtual-list\n [columns]=\"gridService.visibleColumns()\"\n [data]=\"gridService.viewRows()\"></mona-grid-virtual-list>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\"></ng-container>\n }\n } @else {\n @if (gridService.viewPageRows().length !== 0 || gridService.addRowVisible()) {\n <mona-grid-list\n [columns]=\"gridService.visibleColumns()\"\n [data]=\"gridService.viewPageRows()\"></mona-grid-list>\n @if (footerVisible()) {\n <div\n [class]=\"footerClass()\"\n [style.margin-right.px]=\"gridService.scrollbarGutterWidth()\"\n #footerScrollElement\n data-grid-footer-scroll>\n <div>\n <table [class]=\"footerTableClass()\" [style.width.px]=\"gridService.tableWidth()\">\n <colgroup>\n @for (_ of gridService.groupColumns(); track $index) {\n <col [style.width.px]=\"gridService.groupColumnWidth\" />\n }\n @if (gridService.rowReorderColumnVisible()) {\n <col [style.width.px]=\"gridService.rowReorderColumnWidth\" />\n }\n @if (gridService.masterDetailTemplate()) {\n <col [style.width.px]=\"gridService.detailColumnWidth\" />\n }\n @if (gridService.selectionColumnVisible()) {\n <col [style.width.px]=\"gridService.selectionColumnWidth\" />\n }\n @for (col of gridService.visibleColumns(); track $index) {\n <col [style.width.px]=\"col.calculatedWidth\" />\n }\n </colgroup>\n <tfoot role=\"rowgroup\">\n <tr [class]=\"footerTableRowClass()\">\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [footerCellWidth]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'reorder'\"\n [footerCellWidth]=\"gridService.rowReorderColumnWidth\"></td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'detail'\"\n [footerCellWidth]=\"gridService.detailColumnWidth\"></td>\n }\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [structuralColumn]=\"'selection'\"\n [footerCellWidth]=\"gridService.selectionColumnWidth\"></td>\n }\n @for (column of gridService.visibleColumns(); track $index) {\n <td\n monaGridFooterTableCell\n monaGridLockedCell\n [column]=\"column\"\n [lockedCellHeader]=\"true\"\n [footerColumn]=\"column\">\n <mona-grid-footer-cell\n [column]=\"column\"\n [columnIndex]=\"$index\"></mona-grid-footer-cell>\n </td>\n }\n </tr>\n </tfoot>\n </table>\n </div>\n </div>\n }\n <mona-pager\n class=\"border-0 border-t border-t-border rounded-tl-none rounded-tr-none\"\n [skip]=\"gridService.paginationState().skip\"\n [pageSize]=\"gridService.paginationState().take\"\n [total]=\"gridService.viewRowCount()\"\n [size]=\"'small'\"\n [rounded]=\"rounded()\"\n [pageInput]=\"true\"\n [pageSizeValues]=\"pageSizeValues()\"\n [responsive]=\"responsivePager()\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n (pageChange)=\"onPageChange($event)\"></mona-pager>\n } @else {\n <ng-container [ngTemplateOutlet]=\"emptyGridTemplate\"></ng-container>\n }\n }\n} @placeholder {\n <mona-placeholder text=\"Loading...\"></mona-placeholder>\n}\n\n<ng-template #emptyGridTemplate>\n <div [class]=\"noDataClass()\">\n @if (noDataTemplate()) {\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n } @else {\n <mona-placeholder text=\"No data\"></mona-placeholder>\n }\n </div>\n</ng-template>\n" }]
5576
+ }], ctorParameters: () => [], propDecorators: { columnDefinitions: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => GRID_COLUMN_DEFINITION), { isSignal: true }] }], footerScrollElement: [{ type: i0.ViewChild, args: ["footerScrollElement", { isSignal: true }] }], gridDetailTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridDetailTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], gridHeaderElement: [{ type: i0.ViewChild, args: ["gridHeaderElement", { isSignal: true }] }], gridHeaderTableElement: [{ type: i0.ViewChild, args: ["headerTable", { isSignal: true }] }], groupColumnList: [{ type: i0.ViewChild, args: ["groupColumnList", { isSignal: true }] }], noDataTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridNoDataTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], toolbarElement: [{ type: i0.ViewChild, args: ["toolbarElement", { isSignal: true }] }], toolbarTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GridToolbarTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], pageSizeValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeValues", required: false }] }], resizeMethod: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizeMethod", required: false }] }], rowKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowKey", required: false }] }], responsivePager: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsivePager", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } }) });
5124
5577
 
5125
5578
  /*
5126
5579
  * Public API Surface of @nanahoshi/mona-ui/grid
@@ -5130,5 +5583,5 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.0.6", ng
5130
5583
  * Generated bundle index. Do not edit.
5131
5584
  */
5132
5585
 
5133
- export { GridSortableDirective as $, GridCellTemplateDirective as A, GridColumnComponent as B, CellEditEvent as C, GridColumnTitleTemplateDirective as D, GridCommandColumnComponent as E, GridComponent as F, GridNavigationService as G, GridContextMenuDirective as H, GridDetailTemplateDirective as I, GridEditCommandDirective as J, GridEditEvent as K, GridEditTemplateDirective as L, GridEditableDirective as M, GridExportDirective as N, GridFilterableDirective as O, GridFooterTemplateDirective as P, GridGroupFooterTemplateDirective as Q, GridGroupableDirective as R, GridHeaderTemplateDirective as S, GridNoDataTemplateDirective as T, GridRemoveCommandDirective as U, GridRemoveEvent as V, GridReorderableDirective as W, GridResizableDirective as X, GridSaveCommandDirective as Y, GridSaveEvent as Z, GridSelectableDirective as _, GridRowFlattenerService as a, GridStatePersistenceDirective as a0, GridToolbarTemplateDirective as a1, GridVirtualScrollDirective as a2, RowEditEvent as a3, gridFooterTableRowThemeVariants as b, GridService as c, gridGroupRowThemeVariants as d, gridListTableThemeVariants as e, GridLogicalCellDirective as f, gridListBaseThemeVariants as g, GridLockedCellDirective as h, gridFooterThemeVariants as i, gridFooterTableThemeVariants as j, gridListTableCellThemeVariants as k, gridDetailContentCellThemeVariants as l, gridDetailIndentCellThemeVariants as m, gridDetailRowThemeVariants as n, gridListTableRowThemeVariants as o, gridCellEditorBaseThemeVariants as p, gridCellEditorInputThemeVariants as q, gridCellBaseThemeVariants as r, gridCellContainerThemeVariants as s, gridCellDirtyIndicatorThemeVariants as t, gridCellTextThemeVariants as u, gridFooterTableCellThemeVariants as v, GridAddCommandDirective as w, GridAddEvent as x, GridCancelCommandDirective as y, GridCancelEvent as z };
5134
- //# sourceMappingURL=nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-DWzYyGnb.mjs.map
5586
+ export { GridResizableDirective as $, GridAddCommandDirective as A, GridAddEvent as B, CellEditEvent as C, GridCancelCommandDirective as D, GridCancelEvent as E, GridCellTemplateDirective as F, GridNavigationService as G, GridColumnComponent as H, GridColumnTitleTemplateDirective as I, GridCommandColumnComponent as J, GridComponent as K, GridContextMenuDirective as L, GridDetailTemplateDirective as M, GridEditCommandDirective as N, GridEditEvent as O, GridEditTemplateDirective as P, GridEditableDirective as Q, GridExportDirective as R, GridFilterableDirective as S, GridFooterTemplateDirective as T, GridGroupFooterTemplateDirective as U, GridGroupableDirective as V, GridHeaderTemplateDirective as W, GridNoDataTemplateDirective as X, GridRemoveCommandDirective as Y, GridRemoveEvent as Z, GridReorderableDirective as _, GridRowFlattenerService as a, GridRowReorderableDirective as a0, GridSaveCommandDirective as a1, GridSaveEvent as a2, GridSelectableDirective as a3, GridSortableDirective as a4, GridStatePersistenceDirective as a5, GridToolbarTemplateDirective as a6, GridVirtualScrollDirective as a7, RowEditEvent as a8, RowReorderEvent as a9, gridFooterTableRowThemeVariants as b, GridService as c, gridGroupRowThemeVariants as d, gridRowDragPlaceholderThemeVariants as e, gridRowDragPreviewThemeVariants as f, gridListBaseThemeVariants as g, gridListTableThemeVariants as h, GridLogicalCellDirective as i, GridLockedCellDirective as j, gridFooterThemeVariants as k, gridFooterTableThemeVariants as l, gridListTableCellThemeVariants as m, gridDetailContentCellThemeVariants as n, gridDetailIndentCellThemeVariants as o, gridDetailRowThemeVariants as p, gridListTableRowThemeVariants as q, gridCellEditorBaseThemeVariants as r, gridCellEditorInputThemeVariants as s, gridCellBaseThemeVariants as t, gridCellContainerThemeVariants as u, gridCellDirtyIndicatorThemeVariants as v, gridCellTextThemeVariants as w, gridRowReorderHandleThemeVariants as x, gridSelectionCellThemeVariants as y, gridFooterTableCellThemeVariants as z };
5587
+ //# sourceMappingURL=nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-DaOemy_G.mjs.map