@zambon-dev/ui 1.8.0 → 1.9.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,19 +1,21 @@
1
1
  import * as i0 from "@angular/core";
2
- import { ChangeDetectionStrategy, Component, ContentChildren, DestroyRef, Directive, ElementRef, EventEmitter, HostListener, Injectable, InjectionToken, Injector, Input, KeyValueDiffers, LOCALE_ID, NgModule, NgZone, Output, Pipe, Renderer2, TemplateRef, ViewChild, ViewContainerRef, afterNextRender, computed, contentChildren, effect, forwardRef, inject, input, linkedSignal, model, output, signal, viewChild } from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, ContentChildren, DestroyRef, Directive, ElementRef, EventEmitter, HostListener, Injectable, InjectionToken, Injector, Input, KeyValueDiffers, LOCALE_ID, NgModule, NgZone, Output, PLATFORM_ID, Pipe, Renderer2, TemplateRef, ViewChild, ViewContainerRef, afterEveryRender, afterNextRender, computed, contentChildren, effect, forwardRef, inject, input, linkedSignal, model, output, signal, viewChild } from "@angular/core";
3
3
  import { Observable, ReplaySubject, Subject, debounceTime, delay, filter, forkJoin, fromEvent, map, merge, of, pairwise, startWith, switchMap, take, takeUntil, tap, throwError } from "rxjs";
4
4
  import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
5
5
  import { TranslatePipe, TranslateService } from "@ngx-translate/core";
6
6
  import { Overlay, OverlayPositionBuilder } from "@angular/cdk/overlay";
7
7
  import { ComponentPortal, TemplatePortal } from "@angular/cdk/portal";
8
- import * as i2$1 from "@angular/forms";
8
+ import * as i2$2 from "@angular/forms";
9
9
  import { ControlContainer, FormArray, FormControl, FormGroup, FormGroupDirective, FormGroupName, FormsModule, NG_VALIDATORS, NG_VALUE_ACCESSOR, ReactiveFormsModule } from "@angular/forms";
10
10
  import { HttpClient } from "@angular/common/http";
11
11
  import { ActivatedRoute, NavigationEnd, NavigationStart, Router } from "@angular/router";
12
12
  import * as i1$1 from "@angular/common";
13
- import { CommonModule, KeyValuePipe, NgClass, NgStyle, NgTemplateOutlet, formatDate } from "@angular/common";
14
- import * as i1 from "@angular/cdk/scrolling";
13
+ import { CommonModule, DOCUMENT, KeyValuePipe, NgClass, NgStyle, NgTemplateOutlet, formatDate, isPlatformBrowser } from "@angular/common";
14
+ import * as i1 from "@angular/cdk/a11y";
15
+ import { A11yModule } from "@angular/cdk/a11y";
16
+ import * as i2 from "@angular/cdk/scrolling";
15
17
  import { CdkVirtualScrollViewport, ScrollingModule } from "@angular/cdk/scrolling";
16
- import * as i2 from "ngx-resize-observer";
18
+ import * as i2$1 from "ngx-resize-observer";
17
19
  import { NgxResizeObserverModule } from "ngx-resize-observer";
18
20
  var BadgeComponent = class BadgeComponent {
19
21
  intent = input("neutral", ...ngDevMode ? [{ debugName: "intent" }] : /* istanbul ignore next */ []);
@@ -1441,12 +1443,23 @@ i0.ɵɵngDeclareClassMetadata({
1441
1443
  decorators: [{ type: Injectable }],
1442
1444
  ctorParameters: () => []
1443
1445
  });
1446
+ const MIN_GRID_COLUMN_WIDTH = 48;
1447
+ const COLUMNS_STATE_PREFIX = "zambon-dev.grid.";
1448
+ function columnsStorage() {
1449
+ try {
1450
+ return typeof localStorage === "undefined" ? null : localStorage;
1451
+ } catch {
1452
+ return null;
1453
+ }
1454
+ }
1444
1455
  var DataGridDataset = class DataGridDataset extends GridDataset {
1445
1456
  rowActivated = new EventEmitter();
1446
1457
  selectedRowsChanged = new EventEmitter();
1447
1458
  configs;
1448
1459
  columns;
1449
1460
  _selectedRowKeys = [];
1461
+ hiddenFields = signal(null, ...ngDevMode ? [{ debugName: "hiddenFields" }] : /* istanbul ignore next */ []);
1462
+ columnWidths = signal({}, ...ngDevMode ? [{ debugName: "columnWidths" }] : /* istanbul ignore next */ []);
1450
1463
  get selectedRowKeys() {
1451
1464
  this.tracked();
1452
1465
  return this._selectedRowKeys;
@@ -1458,9 +1471,16 @@ var DataGridDataset = class DataGridDataset extends GridDataset {
1458
1471
  get columnsSize() {
1459
1472
  const sizes = [];
1460
1473
  if (this.configs.multiSelect) sizes.push(this.configs.multiSelectSize ?? "min-content");
1461
- sizes.push(...this.columns.map((col) => col.size ?? (col.type === "actions" ? "min-content" : "minmax(0,1fr)")));
1474
+ sizes.push(...this.visibleColumns.map((col) => {
1475
+ const width = this.getColumnWidth(col.field);
1476
+ if (width !== void 0 && col.type !== "actions") return `${width}px`;
1477
+ return col.size ?? (col.type === "actions" ? "min-content" : "minmax(0,1fr)");
1478
+ }));
1462
1479
  return sizes.join(" ");
1463
1480
  }
1481
+ get visibleColumns() {
1482
+ return (this.columns ?? []).filter((column) => !this.isColumnHidden(column));
1483
+ }
1464
1484
  get hasSelectedRows() {
1465
1485
  return this.selectedRowKeys.length > 0;
1466
1486
  }
@@ -1481,6 +1501,84 @@ var DataGridDataset = class DataGridDataset extends GridDataset {
1481
1501
  return keys;
1482
1502
  }, {}));
1483
1503
  }
1504
+ isColumnHideable(column) {
1505
+ return column.hideable ?? column.type !== "actions";
1506
+ }
1507
+ isColumnHidden(column) {
1508
+ if (!this.isColumnHideable(column)) return false;
1509
+ const hidden = this.hiddenFields?.() ?? null;
1510
+ return hidden === null ? column.hidden === true : hidden.includes(column.field);
1511
+ }
1512
+ canHideColumn(column) {
1513
+ return this.isColumnHideable(column) && !this.isColumnHidden(column) && this.visibleColumns.some((other) => other.field !== column.field && other.type !== "actions");
1514
+ }
1515
+ setColumnHidden(field, hidden) {
1516
+ const column = (this.columns ?? []).find((col) => col.field === field);
1517
+ if (!column || !this.isColumnHideable(column) || this.isColumnHidden(column) === hidden) return;
1518
+ if (hidden && !this.canHideColumn(column)) return;
1519
+ const current = this.hiddenColumnFields();
1520
+ this.hiddenFields.set(hidden ? [...current, field] : current.filter((other) => other !== field));
1521
+ this.saveColumnsState();
1522
+ }
1523
+ getColumnWidth(field) {
1524
+ return this.columnWidths?.()[field];
1525
+ }
1526
+ setColumnWidth(field, width, save = true) {
1527
+ const column = (this.columns ?? []).find((col) => col.field === field);
1528
+ if (!column || column.type === "actions") return;
1529
+ const widths = { ...this.columnWidths() };
1530
+ if (width === null) {
1531
+ if (!(field in widths)) return;
1532
+ delete widths[field];
1533
+ } else {
1534
+ const next = Math.max(48, Math.round(width));
1535
+ if (widths[field] === next) return;
1536
+ widths[field] = next;
1537
+ }
1538
+ this.columnWidths.set(widths);
1539
+ if (save) this.saveColumnsState();
1540
+ }
1541
+ resetColumns() {
1542
+ this.hiddenFields.set(null);
1543
+ this.columnWidths.set({});
1544
+ const key = this.columnsStorageKey;
1545
+ if (key) try {
1546
+ columnsStorage()?.removeItem(key);
1547
+ } catch {}
1548
+ }
1549
+ restoreColumnsState() {
1550
+ const key = this.columnsStorageKey;
1551
+ if (!key) return;
1552
+ let state;
1553
+ try {
1554
+ const stored = columnsStorage()?.getItem(key);
1555
+ state = stored ? JSON.parse(stored) : null;
1556
+ } catch {
1557
+ state = null;
1558
+ }
1559
+ if (!state || typeof state !== "object") return;
1560
+ const columns = this.columns ?? [];
1561
+ if (Array.isArray(state.hidden)) {
1562
+ const hidden = state.hidden.filter((field) => typeof field === "string" && columns.some((column) => column.field === field && this.isColumnHideable(column)));
1563
+ if (columns.some((column) => column.type !== "actions" && (!this.isColumnHideable(column) || !hidden.includes(column.field)))) this.hiddenFields.set(hidden);
1564
+ }
1565
+ if (state.widths && typeof state.widths === "object" && !Array.isArray(state.widths)) {
1566
+ const widths = {};
1567
+ for (const [field, width] of Object.entries(state.widths)) if (columns.some((column) => column.field === field && column.type !== "actions") && typeof width === "number" && Number.isFinite(width) && width > 0) widths[field] = Math.max(48, Math.round(width));
1568
+ this.columnWidths.set(widths);
1569
+ }
1570
+ }
1571
+ saveColumnsState() {
1572
+ const key = this.columnsStorageKey;
1573
+ if (!key) return;
1574
+ const state = {
1575
+ hidden: this.hiddenColumnFields(),
1576
+ widths: { ...this.columnWidths() }
1577
+ };
1578
+ try {
1579
+ columnsStorage()?.setItem(key, JSON.stringify(state));
1580
+ } catch {}
1581
+ }
1484
1582
  export(_format, _parameters) {
1485
1583
  return throwError(() => /* @__PURE__ */ new Error(`Export is not implemented for ${this.constructor.name}.`));
1486
1584
  }
@@ -1555,6 +1653,10 @@ var DataGridDataset = class DataGridDataset extends GridDataset {
1555
1653
  }, {}));
1556
1654
  }
1557
1655
  }
1656
+ moveFocusedRow(key) {
1657
+ if (this.configs.multiSelect) super.setFocusedRow(key);
1658
+ else this.setFocusedRow(key);
1659
+ }
1558
1660
  setFocusedRow(key) {
1559
1661
  super.setFocusedRow(key);
1560
1662
  if (!this.configs.multiSelect) this.selectRow(key);
@@ -1563,6 +1665,13 @@ var DataGridDataset = class DataGridDataset extends GridDataset {
1563
1665
  else this.selectRow(key);
1564
1666
  }
1565
1667
  }
1668
+ get columnsStorageKey() {
1669
+ const key = this.configs?.columnsStateKey;
1670
+ return key ? `${COLUMNS_STATE_PREFIX}${key}` : null;
1671
+ }
1672
+ hiddenColumnFields() {
1673
+ return (this.columns ?? []).filter((column) => this.isColumnHidden(column)).map((column) => column.field).filter((field, index, fields) => fields.indexOf(field) === index);
1674
+ }
1566
1675
  removeSelectedRow(key) {
1567
1676
  const index = this.selectedRowKeys.indexOf(key);
1568
1677
  if (index >= 0) {
@@ -3282,22 +3391,22 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
3282
3391
  },
3283
3392
  {
3284
3393
  kind: "directive",
3285
- type: i2$1.DefaultValueAccessor,
3394
+ type: i2$2.DefaultValueAccessor,
3286
3395
  selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
3287
3396
  },
3288
3397
  {
3289
3398
  kind: "directive",
3290
- type: i2$1.CheckboxControlValueAccessor,
3399
+ type: i2$2.CheckboxControlValueAccessor,
3291
3400
  selector: "input[type=checkbox]:not([ngNoCva])[formControlName],input[type=checkbox]:not([ngNoCva])[formControl],input[type=checkbox]:not([ngNoCva])[ngModel]"
3292
3401
  },
3293
3402
  {
3294
3403
  kind: "directive",
3295
- type: i2$1.NgControlStatus,
3404
+ type: i2$2.NgControlStatus,
3296
3405
  selector: "[formControlName],[ngModel],[formControl]"
3297
3406
  },
3298
3407
  {
3299
3408
  kind: "directive",
3300
- type: i2$1.NgModel,
3409
+ type: i2$2.NgModel,
3301
3410
  selector: "[ngModel]:not([formControlName]):not([formControl])",
3302
3411
  inputs: [
3303
3412
  "name",
@@ -3338,7 +3447,7 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
3338
3447
  },
3339
3448
  {
3340
3449
  kind: "directive",
3341
- type: i2$1.FormControlName,
3450
+ type: i2$2.FormControlName,
3342
3451
  selector: "[formControlName]",
3343
3452
  inputs: [
3344
3453
  "formControlName",
@@ -5317,8 +5426,10 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
5317
5426
  this.refreshSelection();
5318
5427
  }
5319
5428
  rowIndex = input(0, ...ngDevMode ? [{ debugName: "rowIndex" }] : /* istanbul ignore next */ []);
5429
+ tabbable = input(false, ...ngDevMode ? [{ debugName: "tabbable" }] : /* istanbul ignore next */ []);
5320
5430
  selectionResized = new EventEmitter();
5321
- setFocus() {
5431
+ setFocus(event) {
5432
+ if (event?.target instanceof HTMLLabelElement && event.target.classList.contains("selection-target")) return;
5322
5433
  if (!this.disabled) {
5323
5434
  this.dataGridDataset.setFocusedRow(this.rowKey);
5324
5435
  if (this.dataGridDataset.configs.multiSelect && (this.dataGridDataset.configs.selectOnClick ?? true)) this.selected.set(this.isRowDataSelected);
@@ -5335,8 +5446,11 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
5335
5446
  get rowData() {
5336
5447
  return this._rowData;
5337
5448
  }
5449
+ get ariaRowIndex() {
5450
+ return this.rowIndex() + (this.dataGridDataset.configs.hideColumnHeaders ? 1 : 2);
5451
+ }
5338
5452
  get columns() {
5339
- return this.dataGridDataset.columns;
5453
+ return this.dataGridDataset.visibleColumns;
5340
5454
  }
5341
5455
  get isLaidOut() {
5342
5456
  return (this.elementRef.nativeElement?.getBoundingClientRect().width ?? 0) > 0;
@@ -5364,16 +5478,17 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
5364
5478
  if (this.disabled || this.isActionDisabled(action)) return;
5365
5479
  action.handler(this.rowData);
5366
5480
  }
5367
- onResize(colIndex, event) {
5481
+ onResize(column, event) {
5368
5482
  const width = event.contentRect.width;
5369
5483
  if (width <= 0 && !this.isLaidOut) return;
5370
- if (this.columns[colIndex].realSize !== width) this.columns[colIndex].realSize = width;
5484
+ if (column.realSize !== width) column.realSize = width;
5371
5485
  }
5372
5486
  onResizeSelection(event) {
5373
5487
  const width = event.contentRect.width;
5374
5488
  this.selectionResized.emit(width);
5375
5489
  }
5376
- onToggleSelection() {
5490
+ onToggleSelection(event) {
5491
+ if (!(event.target instanceof HTMLInputElement)) return;
5377
5492
  if (this.disabled || this.dataGridDataset.configs.multiSelect && (this.dataGridDataset.configs.selectOnClick ?? true)) return;
5378
5493
  this.selected.update((isSelected) => !isSelected);
5379
5494
  if (this.selected()) this.dataGridDataset.selectRow(this.rowKey);
@@ -5446,24 +5561,36 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
5446
5561
  isSignal: true,
5447
5562
  isRequired: false,
5448
5563
  transformFunction: null
5564
+ },
5565
+ tabbable: {
5566
+ classPropertyName: "tabbable",
5567
+ publicName: "tabbable",
5568
+ isSignal: true,
5569
+ isRequired: false,
5570
+ transformFunction: null
5449
5571
  }
5450
5572
  },
5451
5573
  outputs: { selectionResized: "selectionResized" },
5452
5574
  host: {
5575
+ attributes: { "role": "row" },
5453
5576
  listeners: {
5454
- "click": "setFocus()",
5577
+ "click": "setFocus($event)",
5455
5578
  "dblclick": "activate()"
5456
5579
  },
5457
5580
  properties: {
5458
- "class.focused": "dataGridDataset.focusedRowKey === rowData",
5581
+ "attr.aria-rowindex": "ariaRowIndex",
5582
+ "attr.aria-selected": "dataGridDataset.isKeySelected(rowKey)",
5583
+ "attr.data-row-index": "rowIndex()",
5584
+ "attr.tabindex": "disabled ? null : tabbable() ? 0 : -1",
5585
+ "class.focused": "dataGridDataset.focusedRowKey === rowKey",
5459
5586
  "class.selected": "dataGridDataset.isKeySelected(rowKey)",
5460
5587
  "class.striped": "rowIndex() % 2 === 1"
5461
5588
  }
5462
5589
  },
5463
5590
  usesInheritance: true,
5464
5591
  ngImport: i0,
5465
- template: "<!-- A <label> rather than a clickable <div>: clicking anywhere in the cell still\nreaches the checkbox, natively. The click handler is a mouse-only convenience;\nthe keyboard path is the nested checkbox, which is focusable and toggles with\nSpace on its own. -->\n@if (dataGridDataset.configs.multiSelect) {\n <!-- A quick second click on the checkbox undoes the first one; it must not open the record. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <label\n class=\"cell selection\"\n (click)=\"onToggleSelection()\"\n (dblclick)=\"$event.stopPropagation()\"\n (onResize)=\"onResizeSelection($event)\"\n >\n <!-- Null, not false: an attribute binding writes disabled=\"false\" for false, and any value at\n all disables a control, so every checkbox rendered disabled and faded. -->\n <input\n class=\"form-input\"\n type=\"checkbox\"\n [attr.aria-label]=\"selectRowText | translate\"\n [attr.disabled]=\"disabled ? true : null\"\n [(ngModel)]=\"selected\"\n />\n </label>\n}\n@for (column of columns; track column; let i = $index) {\n <div\n #cell\n class=\"cell\"\n [class.actions]=\"column.type === 'actions' && !column.template\"\n [class.align-center]=\"alignOf(column) === 'center'\"\n [class.align-end]=\"alignOf(column) === 'end'\"\n [class.disabled]=\"disabled\"\n [class.numeric]=\"isNumeric(column)\"\n [ngClass]=\"column.customClass\"\n >\n @if (isFirstRow) {\n <div class=\"spacer\" (onResize)=\"onResize(i, $event)\"></div>\n }\n <ng-container\n *ngTemplateOutlet=\"\n column.template ? column.template : column.type === 'actions' ? actionsTemplate : simpleTemplate;\n context: { rowData: rowData, column: column }\n \"\n >\n </ng-container>\n </div>\n}\n\n<!-- An actions column: an icon-only button per visible action. The click stops at the button, so\nit neither focuses nor selects the row, and a quick second click does not open it. -->\n<ng-template #actionsTemplate let-column=\"column\">\n @for (action of visibleActions(column); track action) {\n <button\n class=\"row-action\"\n type=\"button\"\n [attr.aria-label]=\"action.label | translate\"\n [class.danger]=\"action.intent === 'danger'\"\n [disabled]=\"disabled || isActionDisabled(action)\"\n [libTooltip]=\"action.label\"\n (click)=\"onActionClicked($event, action)\"\n (dblclick)=\"$event.stopPropagation()\"\n >\n <i aria-hidden=\"true\" [class]=\"action.icon\"></i>\n </button>\n }\n</ng-template>\n\n<!-- A column without a template. The column's type decides the formatting; with no type the\nvalue shows as it is. The translate pipe sits only in the branches that hold a translation key, so a\nplain cell renders as it always did. -->\n<ng-template #simpleTemplate let-column=\"column\">\n @let cell = formatCell(column);\n @switch (cell.kind) {\n @case ('boolean') {\n @if (cell.checked) {\n <i class=\"fa-solid fa-check\" aria-hidden=\"true\"></i>\n }\n @if (cell.translate) {\n <span class=\"visually-hidden\">{{ cell.text | translate }}</span>\n }\n }\n @case ('badge') {\n <lib-badge [intent]=\"cell.intent ?? 'neutral'\">\n @if (cell.translate) {\n {{ cell.text | translate }}\n } @else {\n {{ cell.text }}\n }\n </lib-badge>\n }\n @default {\n @if (cell.translate) {\n <span>{{ cell.text | translate }}</span>\n } @else {\n <span>{{ cell.text }}</span>\n }\n }\n }\n</ng-template>\n",
5466
- styles: ["@layer properties;:host{grid-column:1 / -1;display:grid;grid-template-columns:subgrid}.cell{position:relative;align-content:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell.disabled{pointer-events:none;cursor:default;overflow:hidden;text-overflow:ellipsis;opacity:.6}.cell input{vertical-align:super}.cell.selection{display:flex;align-items:center}.cell.align-center{text-align:center}.cell.align-end{text-align:end}.cell.numeric{font-variant-numeric:tabular-nums}.cell.actions{overflow:visible}.row-action{display:inline-flex;height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);cursor:pointer;align-items:center;justify-content:center;border-style:var(--tw-border-style);border-width:1px;border-color:transparent;vertical-align:middle;border-radius:var(--radius-control);color:var(--color-content-secondary);transition-property:background-color,color;transition-duration:var(--duration-instant);transition-timing-function:var(--ease-standard)}.row-action+.row-action{margin-inline-start:var(--spacing, .25rem)}.row-action:hover:not(:disabled){background-color:var(--state-hover);color:var(--color-content-primary)}.row-action:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(var(--focus-ring-width) + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style: none;outline-style:none;--tw-ring-color: var(--color-focus-ring)}@media(forced-colors:active){.row-action:focus-visible{outline:2px solid transparent;outline-offset:2px}}.row-action:disabled{cursor:default;opacity:var(--opacity-disabled)}.row-action.danger,.row-action.danger:hover:not(:disabled){color:var(--color-danger)}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border-width:0}.spacer{position:absolute;inset:0;z-index:-1;height:0px}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
5592
+ template: "<!-- The cell is a gridcell and the <label> inside it fills it: clicking anywhere in\nthe cell still reaches the checkbox, natively. A <label> cannot take the gridcell\nrole itself. The click handler is a mouse-only convenience. The checkbox is out of\nthe Tab order (tabindex -1), because the row is the grid's one Tab stop; Space on\nthe focused row toggles the selection instead. -->\n@if (dataGridDataset.configs.multiSelect) {\n <!-- A quick second click on the checkbox undoes the first one; it must not open the record. -->\n <div\n class=\"cell selection\"\n role=\"gridcell\"\n (dblclick)=\"$event.stopPropagation()\"\n (onResize)=\"onResizeSelection($event)\"\n >\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <label class=\"selection-target\" (click)=\"onToggleSelection($event)\">\n <!-- Null, not false: an attribute binding writes disabled=\"false\" for false, and any value at\n all disables a control, so every checkbox rendered disabled and faded. -->\n <input\n class=\"form-input\"\n tabindex=\"-1\"\n type=\"checkbox\"\n [attr.aria-label]=\"selectRowText | translate\"\n [attr.disabled]=\"disabled ? true : null\"\n [(ngModel)]=\"selected\"\n />\n </label>\n </div>\n}\n@for (column of columns; track column) {\n <div\n #cell\n class=\"cell\"\n role=\"gridcell\"\n [class.actions]=\"column.type === 'actions' && !column.template\"\n [class.align-center]=\"alignOf(column) === 'center'\"\n [class.align-end]=\"alignOf(column) === 'end'\"\n [class.disabled]=\"disabled\"\n [class.numeric]=\"isNumeric(column)\"\n [ngClass]=\"column.customClass\"\n >\n @if (isFirstRow) {\n <div class=\"spacer\" (onResize)=\"onResize(column, $event)\"></div>\n }\n <ng-container\n *ngTemplateOutlet=\"\n column.template ? column.template : column.type === 'actions' ? actionsTemplate : simpleTemplate;\n context: { rowData: rowData, column: column }\n \"\n >\n </ng-container>\n </div>\n}\n\n<!-- An actions column: an icon-only button per visible action. The click stops at the button, so\nit neither focuses nor selects the row, and a quick second click does not open it. The buttons are\nTab stops only in the grid's tabbable row: Tab goes from that row to its actions, then out of the\ngrid. In every other row they are out of the Tab order, so the grid stays one stop wide. -->\n<ng-template #actionsTemplate let-column=\"column\">\n @for (action of visibleActions(column); track action) {\n <button\n class=\"row-action\"\n type=\"button\"\n [attr.tabindex]=\"tabbable() ? 0 : -1\"\n [attr.aria-label]=\"action.label | translate\"\n [class.danger]=\"action.intent === 'danger'\"\n [disabled]=\"disabled || isActionDisabled(action)\"\n [libTooltip]=\"action.label\"\n (click)=\"onActionClicked($event, action)\"\n (dblclick)=\"$event.stopPropagation()\"\n >\n <i aria-hidden=\"true\" [class]=\"action.icon\"></i>\n </button>\n }\n</ng-template>\n\n<!-- A column without a template. The column's type decides the formatting; with no type the\nvalue shows as it is. The translate pipe sits only in the branches that hold a translation key, so a\nplain cell renders as it always did. -->\n<ng-template #simpleTemplate let-column=\"column\">\n @let cell = formatCell(column);\n @switch (cell.kind) {\n @case ('boolean') {\n @if (cell.checked) {\n <i class=\"fa-solid fa-check\" aria-hidden=\"true\"></i>\n }\n @if (cell.translate) {\n <span class=\"visually-hidden\">{{ cell.text | translate }}</span>\n }\n }\n @case ('badge') {\n <lib-badge [intent]=\"cell.intent ?? 'neutral'\">\n @if (cell.translate) {\n {{ cell.text | translate }}\n } @else {\n {{ cell.text }}\n }\n </lib-badge>\n }\n @default {\n @if (cell.translate) {\n <span>{{ cell.text | translate }}</span>\n } @else {\n <span>{{ cell.text }}</span>\n }\n }\n }\n</ng-template>\n",
5593
+ styles: ["@layer properties;:host{grid-column:1 / -1;display:grid;grid-template-columns:subgrid}.cell{position:relative;align-content:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell.disabled{pointer-events:none;cursor:default;overflow:hidden;text-overflow:ellipsis;opacity:.6}.cell input{vertical-align:super}.cell.selection{display:flex;align-items:center}.cell .selection-target{display:flex;flex-grow:1;align-items:center;align-self:stretch}.cell.align-center{text-align:center}.cell.align-end{text-align:end}.cell.numeric{font-variant-numeric:tabular-nums}.cell.actions{overflow:visible}.row-action{display:inline-flex;height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);cursor:pointer;align-items:center;justify-content:center;border-style:var(--tw-border-style);border-width:1px;border-color:transparent;vertical-align:middle;border-radius:var(--radius-control);color:var(--color-content-secondary);transition-property:background-color,color;transition-duration:var(--duration-instant);transition-timing-function:var(--ease-standard)}.row-action+.row-action{margin-inline-start:var(--spacing, .25rem)}.row-action:hover:not(:disabled){background-color:var(--state-hover);color:var(--color-content-primary)}.row-action:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(var(--focus-ring-width) + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style: none;outline-style:none;--tw-ring-color: var(--color-focus-ring)}@media(forced-colors:active){.row-action:focus-visible{outline:2px solid transparent;outline-offset:2px}}.row-action:disabled{cursor:default;opacity:var(--opacity-disabled)}.row-action.danger,.row-action.danger:hover:not(:disabled){color:var(--color-danger)}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border-width:0}.spacer{position:absolute;inset:0;z-index:-1;height:0px}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
5467
5594
  dependencies: [
5468
5595
  {
5469
5596
  kind: "component",
@@ -5481,17 +5608,17 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
5481
5608
  },
5482
5609
  {
5483
5610
  kind: "directive",
5484
- type: i2$1.CheckboxControlValueAccessor,
5611
+ type: i2$2.CheckboxControlValueAccessor,
5485
5612
  selector: "input[type=checkbox]:not([ngNoCva])[formControlName],input[type=checkbox]:not([ngNoCva])[formControl],input[type=checkbox]:not([ngNoCva])[ngModel]"
5486
5613
  },
5487
5614
  {
5488
5615
  kind: "directive",
5489
- type: i2$1.NgControlStatus,
5616
+ type: i2$2.NgControlStatus,
5490
5617
  selector: "[formControlName],[ngModel],[formControl]"
5491
5618
  },
5492
5619
  {
5493
5620
  kind: "directive",
5494
- type: i2$1.NgModel,
5621
+ type: i2$2.NgModel,
5495
5622
  selector: "[ngModel]:not([formControlName]):not([formControl])",
5496
5623
  inputs: [
5497
5624
  "name",
@@ -5524,7 +5651,7 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
5524
5651
  },
5525
5652
  {
5526
5653
  kind: "directive",
5527
- type: i2.NgxResizeObserverDirective,
5654
+ type: i2$1.NgxResizeObserverDirective,
5528
5655
  selector: "[onResize]",
5529
5656
  inputs: ["resizeBoxModel"],
5530
5657
  outputs: ["onResize"]
@@ -5559,7 +5686,12 @@ i0.ɵɵngDeclareClassMetadata({
5559
5686
  args: [{
5560
5687
  selector: "lib-data-grid-row",
5561
5688
  host: {
5562
- "[class.focused]": "dataGridDataset.focusedRowKey === rowData",
5689
+ role: "row",
5690
+ "[attr.aria-rowindex]": "ariaRowIndex",
5691
+ "[attr.aria-selected]": "dataGridDataset.isKeySelected(rowKey)",
5692
+ "[attr.data-row-index]": "rowIndex()",
5693
+ "[attr.tabindex]": "disabled ? null : tabbable() ? 0 : -1",
5694
+ "[class.focused]": "dataGridDataset.focusedRowKey === rowKey",
5563
5695
  "[class.selected]": "dataGridDataset.isKeySelected(rowKey)",
5564
5696
  "[class.striped]": "rowIndex() % 2 === 1"
5565
5697
  },
@@ -5573,8 +5705,8 @@ i0.ɵɵngDeclareClassMetadata({
5573
5705
  TooltipDirective,
5574
5706
  TranslatePipe
5575
5707
  ],
5576
- template: "<!-- A <label> rather than a clickable <div>: clicking anywhere in the cell still\nreaches the checkbox, natively. The click handler is a mouse-only convenience;\nthe keyboard path is the nested checkbox, which is focusable and toggles with\nSpace on its own. -->\n@if (dataGridDataset.configs.multiSelect) {\n <!-- A quick second click on the checkbox undoes the first one; it must not open the record. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <label\n class=\"cell selection\"\n (click)=\"onToggleSelection()\"\n (dblclick)=\"$event.stopPropagation()\"\n (onResize)=\"onResizeSelection($event)\"\n >\n <!-- Null, not false: an attribute binding writes disabled=\"false\" for false, and any value at\n all disables a control, so every checkbox rendered disabled and faded. -->\n <input\n class=\"form-input\"\n type=\"checkbox\"\n [attr.aria-label]=\"selectRowText | translate\"\n [attr.disabled]=\"disabled ? true : null\"\n [(ngModel)]=\"selected\"\n />\n </label>\n}\n@for (column of columns; track column; let i = $index) {\n <div\n #cell\n class=\"cell\"\n [class.actions]=\"column.type === 'actions' && !column.template\"\n [class.align-center]=\"alignOf(column) === 'center'\"\n [class.align-end]=\"alignOf(column) === 'end'\"\n [class.disabled]=\"disabled\"\n [class.numeric]=\"isNumeric(column)\"\n [ngClass]=\"column.customClass\"\n >\n @if (isFirstRow) {\n <div class=\"spacer\" (onResize)=\"onResize(i, $event)\"></div>\n }\n <ng-container\n *ngTemplateOutlet=\"\n column.template ? column.template : column.type === 'actions' ? actionsTemplate : simpleTemplate;\n context: { rowData: rowData, column: column }\n \"\n >\n </ng-container>\n </div>\n}\n\n<!-- An actions column: an icon-only button per visible action. The click stops at the button, so\nit neither focuses nor selects the row, and a quick second click does not open it. -->\n<ng-template #actionsTemplate let-column=\"column\">\n @for (action of visibleActions(column); track action) {\n <button\n class=\"row-action\"\n type=\"button\"\n [attr.aria-label]=\"action.label | translate\"\n [class.danger]=\"action.intent === 'danger'\"\n [disabled]=\"disabled || isActionDisabled(action)\"\n [libTooltip]=\"action.label\"\n (click)=\"onActionClicked($event, action)\"\n (dblclick)=\"$event.stopPropagation()\"\n >\n <i aria-hidden=\"true\" [class]=\"action.icon\"></i>\n </button>\n }\n</ng-template>\n\n<!-- A column without a template. The column's type decides the formatting; with no type the\nvalue shows as it is. The translate pipe sits only in the branches that hold a translation key, so a\nplain cell renders as it always did. -->\n<ng-template #simpleTemplate let-column=\"column\">\n @let cell = formatCell(column);\n @switch (cell.kind) {\n @case ('boolean') {\n @if (cell.checked) {\n <i class=\"fa-solid fa-check\" aria-hidden=\"true\"></i>\n }\n @if (cell.translate) {\n <span class=\"visually-hidden\">{{ cell.text | translate }}</span>\n }\n }\n @case ('badge') {\n <lib-badge [intent]=\"cell.intent ?? 'neutral'\">\n @if (cell.translate) {\n {{ cell.text | translate }}\n } @else {\n {{ cell.text }}\n }\n </lib-badge>\n }\n @default {\n @if (cell.translate) {\n <span>{{ cell.text | translate }}</span>\n } @else {\n <span>{{ cell.text }}</span>\n }\n }\n }\n</ng-template>\n",
5577
- styles: ["@layer properties;:host{grid-column:1 / -1;display:grid;grid-template-columns:subgrid}.cell{position:relative;align-content:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell.disabled{pointer-events:none;cursor:default;overflow:hidden;text-overflow:ellipsis;opacity:.6}.cell input{vertical-align:super}.cell.selection{display:flex;align-items:center}.cell.align-center{text-align:center}.cell.align-end{text-align:end}.cell.numeric{font-variant-numeric:tabular-nums}.cell.actions{overflow:visible}.row-action{display:inline-flex;height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);cursor:pointer;align-items:center;justify-content:center;border-style:var(--tw-border-style);border-width:1px;border-color:transparent;vertical-align:middle;border-radius:var(--radius-control);color:var(--color-content-secondary);transition-property:background-color,color;transition-duration:var(--duration-instant);transition-timing-function:var(--ease-standard)}.row-action+.row-action{margin-inline-start:var(--spacing, .25rem)}.row-action:hover:not(:disabled){background-color:var(--state-hover);color:var(--color-content-primary)}.row-action:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(var(--focus-ring-width) + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style: none;outline-style:none;--tw-ring-color: var(--color-focus-ring)}@media(forced-colors:active){.row-action:focus-visible{outline:2px solid transparent;outline-offset:2px}}.row-action:disabled{cursor:default;opacity:var(--opacity-disabled)}.row-action.danger,.row-action.danger:hover:not(:disabled){color:var(--color-danger)}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border-width:0}.spacer{position:absolute;inset:0;z-index:-1;height:0px}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
5708
+ template: "<!-- The cell is a gridcell and the <label> inside it fills it: clicking anywhere in\nthe cell still reaches the checkbox, natively. A <label> cannot take the gridcell\nrole itself. The click handler is a mouse-only convenience. The checkbox is out of\nthe Tab order (tabindex -1), because the row is the grid's one Tab stop; Space on\nthe focused row toggles the selection instead. -->\n@if (dataGridDataset.configs.multiSelect) {\n <!-- A quick second click on the checkbox undoes the first one; it must not open the record. -->\n <div\n class=\"cell selection\"\n role=\"gridcell\"\n (dblclick)=\"$event.stopPropagation()\"\n (onResize)=\"onResizeSelection($event)\"\n >\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <label class=\"selection-target\" (click)=\"onToggleSelection($event)\">\n <!-- Null, not false: an attribute binding writes disabled=\"false\" for false, and any value at\n all disables a control, so every checkbox rendered disabled and faded. -->\n <input\n class=\"form-input\"\n tabindex=\"-1\"\n type=\"checkbox\"\n [attr.aria-label]=\"selectRowText | translate\"\n [attr.disabled]=\"disabled ? true : null\"\n [(ngModel)]=\"selected\"\n />\n </label>\n </div>\n}\n@for (column of columns; track column) {\n <div\n #cell\n class=\"cell\"\n role=\"gridcell\"\n [class.actions]=\"column.type === 'actions' && !column.template\"\n [class.align-center]=\"alignOf(column) === 'center'\"\n [class.align-end]=\"alignOf(column) === 'end'\"\n [class.disabled]=\"disabled\"\n [class.numeric]=\"isNumeric(column)\"\n [ngClass]=\"column.customClass\"\n >\n @if (isFirstRow) {\n <div class=\"spacer\" (onResize)=\"onResize(column, $event)\"></div>\n }\n <ng-container\n *ngTemplateOutlet=\"\n column.template ? column.template : column.type === 'actions' ? actionsTemplate : simpleTemplate;\n context: { rowData: rowData, column: column }\n \"\n >\n </ng-container>\n </div>\n}\n\n<!-- An actions column: an icon-only button per visible action. The click stops at the button, so\nit neither focuses nor selects the row, and a quick second click does not open it. The buttons are\nTab stops only in the grid's tabbable row: Tab goes from that row to its actions, then out of the\ngrid. In every other row they are out of the Tab order, so the grid stays one stop wide. -->\n<ng-template #actionsTemplate let-column=\"column\">\n @for (action of visibleActions(column); track action) {\n <button\n class=\"row-action\"\n type=\"button\"\n [attr.tabindex]=\"tabbable() ? 0 : -1\"\n [attr.aria-label]=\"action.label | translate\"\n [class.danger]=\"action.intent === 'danger'\"\n [disabled]=\"disabled || isActionDisabled(action)\"\n [libTooltip]=\"action.label\"\n (click)=\"onActionClicked($event, action)\"\n (dblclick)=\"$event.stopPropagation()\"\n >\n <i aria-hidden=\"true\" [class]=\"action.icon\"></i>\n </button>\n }\n</ng-template>\n\n<!-- A column without a template. The column's type decides the formatting; with no type the\nvalue shows as it is. The translate pipe sits only in the branches that hold a translation key, so a\nplain cell renders as it always did. -->\n<ng-template #simpleTemplate let-column=\"column\">\n @let cell = formatCell(column);\n @switch (cell.kind) {\n @case ('boolean') {\n @if (cell.checked) {\n <i class=\"fa-solid fa-check\" aria-hidden=\"true\"></i>\n }\n @if (cell.translate) {\n <span class=\"visually-hidden\">{{ cell.text | translate }}</span>\n }\n }\n @case ('badge') {\n <lib-badge [intent]=\"cell.intent ?? 'neutral'\">\n @if (cell.translate) {\n {{ cell.text | translate }}\n } @else {\n {{ cell.text }}\n }\n </lib-badge>\n }\n @default {\n @if (cell.translate) {\n <span>{{ cell.text | translate }}</span>\n } @else {\n <span>{{ cell.text }}</span>\n }\n }\n }\n</ng-template>\n",
5709
+ styles: ["@layer properties;:host{grid-column:1 / -1;display:grid;grid-template-columns:subgrid}.cell{position:relative;align-content:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell.disabled{pointer-events:none;cursor:default;overflow:hidden;text-overflow:ellipsis;opacity:.6}.cell input{vertical-align:super}.cell.selection{display:flex;align-items:center}.cell .selection-target{display:flex;flex-grow:1;align-items:center;align-self:stretch}.cell.align-center{text-align:center}.cell.align-end{text-align:end}.cell.numeric{font-variant-numeric:tabular-nums}.cell.actions{overflow:visible}.row-action{display:inline-flex;height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);cursor:pointer;align-items:center;justify-content:center;border-style:var(--tw-border-style);border-width:1px;border-color:transparent;vertical-align:middle;border-radius:var(--radius-control);color:var(--color-content-secondary);transition-property:background-color,color;transition-duration:var(--duration-instant);transition-timing-function:var(--ease-standard)}.row-action+.row-action{margin-inline-start:var(--spacing, .25rem)}.row-action:hover:not(:disabled){background-color:var(--state-hover);color:var(--color-content-primary)}.row-action:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(var(--focus-ring-width) + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style: none;outline-style:none;--tw-ring-color: var(--color-focus-ring)}@media(forced-colors:active){.row-action:focus-visible{outline:2px solid transparent;outline-offset:2px}}.row-action:disabled{cursor:default;opacity:var(--opacity-disabled)}.row-action.danger,.row-action.danger:hover:not(:disabled){color:var(--color-danger)}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border-width:0}.spacer{position:absolute;inset:0;z-index:-1;height:0px}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
5578
5710
  }]
5579
5711
  }],
5580
5712
  ctorParameters: () => [],
@@ -5590,10 +5722,18 @@ i0.ɵɵngDeclareClassMetadata({
5590
5722
  required: false
5591
5723
  }]
5592
5724
  }],
5725
+ tabbable: [{
5726
+ type: i0.Input,
5727
+ args: [{
5728
+ isSignal: true,
5729
+ alias: "tabbable",
5730
+ required: false
5731
+ }]
5732
+ }],
5593
5733
  selectionResized: [{ type: Output }],
5594
5734
  setFocus: [{
5595
5735
  type: HostListener,
5596
- args: ["click"]
5736
+ args: ["click", ["$event"]]
5597
5737
  }],
5598
5738
  activate: [{
5599
5739
  type: HostListener,
@@ -5604,9 +5744,17 @@ i0.ɵɵngDeclareClassMetadata({
5604
5744
  const DEFAULT_TOTAL_ROWS_TEXT = "{{ count }} records";
5605
5745
  const DEFAULT_TOTAL_ROW_TEXT = "{{ count }} record";
5606
5746
  const DEFAULT_SELECT_ALL_TEXT = "Select all rows";
5747
+ const DEFAULT_COLUMN_CHOOSER_TEXT = "Choose columns";
5748
+ const DEFAULT_RESET_COLUMNS_TEXT = "Reset columns";
5749
+ const DEFAULT_RESIZE_COLUMN_TEXT = "Resize {{ column }}";
5750
+ const RESIZE_STEP = 16;
5751
+ const ROW_CELL_GAP = 16;
5752
+ let nextColumnChooserId = 0;
5607
5753
  var DataGridComponent = class DataGridComponent extends BaseComponent {
5608
5754
  bodyElement = viewChild("body", ...ngDevMode ? [{ debugName: "bodyElement" }] : /* istanbul ignore next */ []);
5609
5755
  viewport = viewChild(CdkVirtualScrollViewport, ...ngDevMode ? [{ debugName: "viewport" }] : /* istanbul ignore next */ []);
5756
+ columnChooserButton = viewChild("columnChooserButton", ...ngDevMode ? [{ debugName: "columnChooserButton" }] : /* istanbul ignore next */ []);
5757
+ columnChooserTemplate = viewChild("columnChooserTemplate", ...ngDevMode ? [{ debugName: "columnChooserTemplate" }] : /* istanbul ignore next */ []);
5610
5758
  disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
5611
5759
  lazyLoadRows = input(false, ...ngDevMode ? [{ debugName: "lazyLoadRows" }] : /* istanbul ignore next */ []);
5612
5760
  showButtons = input(false, ...ngDevMode ? [{ debugName: "showButtons" }] : /* istanbul ignore next */ []);
@@ -5615,8 +5763,19 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
5615
5763
  headerRightMargin = signal(0, ...ngDevMode ? [{ debugName: "headerRightMargin" }] : /* istanbul ignore next */ []);
5616
5764
  headerScrollLeft = signal(0, ...ngDevMode ? [{ debugName: "headerScrollLeft" }] : /* istanbul ignore next */ []);
5617
5765
  loading = signal(false, ...ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []);
5766
+ columnChooserOpen = signal(false, ...ngDevMode ? [{ debugName: "columnChooserOpen" }] : /* istanbul ignore next */ []);
5767
+ columnChooserId = `lib-data-grid-columns-${nextColumnChooserId++}`;
5768
+ minColumnWidth = 48;
5618
5769
  bodyResized$ = new Subject();
5770
+ pendingFocusKey = null;
5619
5771
  bodyResizeObserver;
5772
+ columnChooserRef;
5773
+ document = inject(DOCUMENT);
5774
+ injector = inject(Injector);
5775
+ overlay = inject(Overlay);
5776
+ platformId = inject(PLATFORM_ID);
5777
+ stopColumnResize;
5778
+ viewContainerRef = inject(ViewContainerRef);
5620
5779
  gridRoute = "";
5621
5780
  isGridCurrentUrl = false;
5622
5781
  lastPosition = 0;
@@ -5631,8 +5790,33 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
5631
5790
  if (rowsCount < rowsToDisplay) rowsToDisplay = rowsCount;
5632
5791
  return rowsToDisplay * this.configs.rowHeight;
5633
5792
  }
5793
+ get ariaRowCount() {
5794
+ const headerRows = this.isHideColumns ? 0 : 1;
5795
+ const totalRows = this.dataGridDataset.totalRows;
5796
+ if (typeof totalRows === "number") return totalRows + headerRows;
5797
+ if (this.dataGridDataset.loadedLastRow) return (this.dataGridDataset.loadedRows?.length ?? 0) + headerRows;
5798
+ return -1;
5799
+ }
5634
5800
  get columns() {
5635
- return this.dataGridDataset.columns;
5801
+ return this.dataGridDataset.visibleColumns;
5802
+ }
5803
+ get hideableColumns() {
5804
+ return this.dataGridDataset.columns.filter((column) => this.dataGridDataset.isColumnHideable(column));
5805
+ }
5806
+ get showColumnChooser() {
5807
+ return this.configs.columnChooser ?? false;
5808
+ }
5809
+ get columnChooserText() {
5810
+ return this.configs.columnChooserText ?? DEFAULT_COLUMN_CHOOSER_TEXT;
5811
+ }
5812
+ get resetColumnsText() {
5813
+ return this.configs.resetColumnsText ?? DEFAULT_RESET_COLUMNS_TEXT;
5814
+ }
5815
+ get resizeColumnText() {
5816
+ return this.configs.resizeColumnText ?? DEFAULT_RESIZE_COLUMN_TEXT;
5817
+ }
5818
+ get gridLabel() {
5819
+ return this.configs.gridLabel || null;
5636
5820
  }
5637
5821
  get configs() {
5638
5822
  return this.dataGridDataset.configs;
@@ -5692,13 +5876,37 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
5692
5876
  get shouldDisplayMessageWhenEmpty() {
5693
5877
  return this.dataGridDataset?.configs?.showMessageOnEmpty ?? true;
5694
5878
  }
5879
+ get statusText() {
5880
+ if (this.loading()) return this.configs.loadingDisplayText ?? "";
5881
+ if (!this.hasBeenLoaded && !this.hasFailed() && this.lazyLoadRows()) return this.messageToDisplayWhenLazyLoad;
5882
+ if (this.hasFailed()) return this.messageToDisplayWhenFailed;
5883
+ if (this.hasBeenLoaded && !this.hasLoadedRows && this.hasMessageToDisplayWhenEmpty && this.shouldDisplayMessageWhenEmpty) return this.messageToDisplayWhenEmpty;
5884
+ return "";
5885
+ }
5886
+ get tabbableRowKey() {
5887
+ const loadedKeys = this.dataGridDataset.loadedKeys ?? [];
5888
+ if (loadedKeys.length === 0) return;
5889
+ const range = this.viewport()?.getRenderedRange();
5890
+ const renderedRange = range && range.end > range.start ? range : void 0;
5891
+ const focusedKey = this.dataGridDataset.focusedRowKey;
5892
+ const focusedIndex = focusedKey === null ? -1 : loadedKeys.indexOf(focusedKey);
5893
+ if (focusedIndex >= 0 && (!renderedRange || focusedIndex >= renderedRange.start && focusedIndex < renderedRange.end)) return loadedKeys[focusedIndex];
5894
+ return loadedKeys[renderedRange && renderedRange.start < loadedKeys.length ? renderedRange.start : 0];
5895
+ }
5896
+ get pageSize() {
5897
+ const viewportHeight = this.viewport()?.measureViewportSize("vertical") ?? 0;
5898
+ const rows = Math.floor(viewportHeight / this.configs.rowHeight);
5899
+ return Math.max(1, rows > 0 ? rows : this.configs.rowsToDisplay ?? 1);
5900
+ }
5695
5901
  get isBodyAttached() {
5696
5902
  return this.bodyElement()?.nativeElement?.isConnected ?? false;
5697
5903
  }
5698
5904
  constructor() {
5699
5905
  super();
5906
+ afterEveryRender(() => this.focusPendingRow());
5700
5907
  }
5701
5908
  ngOnInit() {
5909
+ if (isPlatformBrowser(this.platformId)) this.dataGridDataset.restoreColumnsState();
5702
5910
  this.gridRoute = this.router.url;
5703
5911
  this.isGridCurrentUrl = true;
5704
5912
  this.router.events.pipe(takeUntil(this.destroy$), filter((events) => events instanceof NavigationStart || events instanceof NavigationEnd)).subscribe((event) => {
@@ -5741,10 +5949,7 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
5741
5949
  });
5742
5950
  this.viewport()?.renderedRangeStream.pipe(takeUntil(this.destroy$)).subscribe((listRange) => {
5743
5951
  const loadedRows = this.dataGridDataset.loadedRows?.length ?? 0;
5744
- if (this.hasLoadedRows && !this.loading() && listRange.end >= loadedRows && !this.dataGridDataset.loadedLastRow) {
5745
- this.loading.set(true);
5746
- this.dataGridDataset.loadRows();
5747
- }
5952
+ if (listRange.end >= loadedRows) this.loadNextBlock();
5748
5953
  });
5749
5954
  this.bodyResized$.pipe(debounceTime(150), takeUntil(this.destroy$)).subscribe(() => {
5750
5955
  if (!this.isBodyAttached) return;
@@ -5762,6 +5967,9 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
5762
5967
  }
5763
5968
  ngOnDestroy() {
5764
5969
  this.bodyResizeObserver?.disconnect();
5970
+ this.stopColumnResize?.();
5971
+ this.columnChooserRef?.dispose();
5972
+ this.columnChooserRef = void 0;
5765
5973
  super.ngOnDestroy();
5766
5974
  }
5767
5975
  onToggleSelectAll() {
@@ -5769,6 +5977,108 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
5769
5977
  if (this.allRowsSelected) this.dataGridDataset.clearSelection();
5770
5978
  else this.dataGridDataset.selectRows(this.dataGridDataset.loadedKeys ?? []);
5771
5979
  }
5980
+ onKeydown(event) {
5981
+ if (this.disabled() || event.altKey || event.ctrlKey || event.metaKey) return;
5982
+ const target = event.target;
5983
+ if (!(target instanceof HTMLElement) || target.tagName !== "LIB-DATA-GRID-ROW") return;
5984
+ const loadedKeys = this.dataGridDataset.loadedKeys ?? [];
5985
+ const index = Number(target.dataset["rowIndex"]);
5986
+ if (!Number.isInteger(index) || index < 0 || index >= loadedKeys.length) return;
5987
+ const lastIndex = loadedKeys.length - 1;
5988
+ let targetIndex;
5989
+ switch (event.key) {
5990
+ case "ArrowDown":
5991
+ targetIndex = Math.min(index + 1, lastIndex);
5992
+ break;
5993
+ case "ArrowUp":
5994
+ targetIndex = Math.max(index - 1, 0);
5995
+ break;
5996
+ case "Home":
5997
+ targetIndex = 0;
5998
+ break;
5999
+ case "End":
6000
+ targetIndex = lastIndex;
6001
+ break;
6002
+ case "PageDown":
6003
+ targetIndex = Math.min(index + this.pageSize, lastIndex);
6004
+ break;
6005
+ case "PageUp":
6006
+ targetIndex = Math.max(index - this.pageSize, 0);
6007
+ break;
6008
+ case " ":
6009
+ if (this.isShowMultiSelect) {
6010
+ event.preventDefault();
6011
+ this.toggleRowSelection(loadedKeys[index]);
6012
+ }
6013
+ return;
6014
+ case "Enter":
6015
+ event.preventDefault();
6016
+ this.dataGridDataset.rowActivated.emit(this.dataGridDataset.getRowData(loadedKeys[index]));
6017
+ return;
6018
+ default: return;
6019
+ }
6020
+ event.preventDefault();
6021
+ this.moveFocusTo(targetIndex, loadedKeys);
6022
+ }
6023
+ onToggleColumnChooser() {
6024
+ if (this.columnChooserOpen()) this.closeColumnChooser(true);
6025
+ else this.openColumnChooser();
6026
+ }
6027
+ onColumnChooserKeydown(event) {
6028
+ if (event.key === "Escape") {
6029
+ event.preventDefault();
6030
+ event.stopPropagation();
6031
+ this.closeColumnChooser(true);
6032
+ }
6033
+ }
6034
+ onToggleColumn(column, event) {
6035
+ const checkbox = event.target;
6036
+ this.dataGridDataset.setColumnHidden(column.field, !checkbox.checked);
6037
+ checkbox.checked = !this.dataGridDataset.isColumnHidden(column);
6038
+ }
6039
+ onResetColumns() {
6040
+ this.dataGridDataset.resetColumns();
6041
+ }
6042
+ onResizeStart(event, column) {
6043
+ if (event.button !== 0) return;
6044
+ event.preventDefault();
6045
+ event.stopPropagation();
6046
+ this.stopColumnResize?.();
6047
+ const handle = event.currentTarget;
6048
+ const rtl = this.document.defaultView?.getComputedStyle(handle).direction === "rtl";
6049
+ const startX = event.clientX;
6050
+ const startWidth = this.currentColumnWidth(column, handle.parentElement);
6051
+ const field = column.field;
6052
+ const onMove = (moveEvent) => {
6053
+ const delta = (moveEvent.clientX - startX) * (rtl ? -1 : 1);
6054
+ this.dataGridDataset.setColumnWidth(field, startWidth + delta, false);
6055
+ };
6056
+ const onEnd = () => {
6057
+ this.document.removeEventListener("pointermove", onMove);
6058
+ this.document.removeEventListener("pointerup", onEnd);
6059
+ this.document.removeEventListener("pointercancel", onEnd);
6060
+ this.stopColumnResize = void 0;
6061
+ this.dataGridDataset.saveColumnsState();
6062
+ };
6063
+ this.ngZone.runOutsideAngular(() => {
6064
+ this.document.addEventListener("pointermove", onMove);
6065
+ this.document.addEventListener("pointerup", onEnd);
6066
+ this.document.addEventListener("pointercancel", onEnd);
6067
+ });
6068
+ this.stopColumnResize = onEnd;
6069
+ }
6070
+ onResizeKeydown(event, column) {
6071
+ if (event.key !== "ArrowRight" && event.key !== "ArrowLeft") return;
6072
+ event.preventDefault();
6073
+ event.stopPropagation();
6074
+ const handle = event.currentTarget;
6075
+ const step = event.key === "ArrowRight" ? RESIZE_STEP : -16;
6076
+ this.dataGridDataset.setColumnWidth(column.field, this.currentColumnWidth(column, handle.parentElement) + step);
6077
+ }
6078
+ onResizeReset(event, column) {
6079
+ event.stopPropagation();
6080
+ this.dataGridDataset.setColumnWidth(column.field, null);
6081
+ }
5772
6082
  onSelectionResized(newSize) {
5773
6083
  if (this.selectionColRealSize != newSize) this.selectionColRealSize = newSize;
5774
6084
  }
@@ -5778,11 +6088,95 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
5778
6088
  fillCount(text) {
5779
6089
  return text.replace(/\{\{\s*count\s*\}\}/g, this.formattedTotalRows);
5780
6090
  }
6091
+ headerWidth(column) {
6092
+ if (column.realSize !== void 0) return column.realSize;
6093
+ return column.type === "actions" ? null : this.dataGridDataset.getColumnWidth(column.field) ?? null;
6094
+ }
6095
+ isResizable(column) {
6096
+ return (this.configs.resizableColumns ?? false) && column.type !== "actions";
6097
+ }
6098
+ resizeValue(column) {
6099
+ return Math.round(this.currentColumnWidth(column, null));
6100
+ }
6101
+ fillColumn(text, columnName) {
6102
+ return text.replace(/\{\{\s*column\s*\}\}/g, columnName);
6103
+ }
5781
6104
  isFirstVisibleRow(rowIndex) {
5782
6105
  const renderedRange = this.viewport()?.getRenderedRange();
5783
6106
  if (renderedRange) return rowIndex === renderedRange.start;
5784
6107
  return false;
5785
6108
  }
6109
+ openColumnChooser() {
6110
+ const button = this.columnChooserButton()?.nativeElement;
6111
+ const template = this.columnChooserTemplate();
6112
+ if (this.columnChooserOpen() || !button || !template) return;
6113
+ this.columnChooserRef = this.overlay.create({
6114
+ hasBackdrop: true,
6115
+ backdropClass: "cdk-overlay-transparent-backdrop",
6116
+ scrollStrategy: this.overlay.scrollStrategies.reposition(),
6117
+ positionStrategy: this.overlay.position().flexibleConnectedTo(button).withPush(true).withViewportMargin(8).withPositions([{
6118
+ originX: "end",
6119
+ originY: "bottom",
6120
+ overlayX: "end",
6121
+ overlayY: "top",
6122
+ offsetY: 4
6123
+ }, {
6124
+ originX: "end",
6125
+ originY: "top",
6126
+ overlayX: "end",
6127
+ overlayY: "bottom",
6128
+ offsetY: -4
6129
+ }])
6130
+ });
6131
+ this.columnChooserRef.backdropClick().subscribe(() => this.closeColumnChooser(true));
6132
+ this.columnChooserRef.attach(new TemplatePortal(template, this.viewContainerRef));
6133
+ this.columnChooserOpen.set(true);
6134
+ const overlayElement = this.columnChooserRef.overlayElement;
6135
+ afterNextRender(() => overlayElement.querySelector("input:not([disabled]), button:not([disabled])")?.focus(), { injector: this.injector });
6136
+ }
6137
+ closeColumnChooser(returnFocus) {
6138
+ if (!this.columnChooserOpen()) return;
6139
+ this.columnChooserRef?.dispose();
6140
+ this.columnChooserRef = void 0;
6141
+ this.columnChooserOpen.set(false);
6142
+ if (returnFocus) this.columnChooserButton()?.nativeElement.focus();
6143
+ }
6144
+ currentColumnWidth(column, headerCell) {
6145
+ const width = this.dataGridDataset.getColumnWidth(column.field);
6146
+ if (width !== void 0) return width;
6147
+ const cellWidth = column.realSize ?? headerCell?.getBoundingClientRect().width ?? 0;
6148
+ return Math.max(48, cellWidth + ROW_CELL_GAP);
6149
+ }
6150
+ focusPendingRow() {
6151
+ if (this.pendingFocusKey === null) return false;
6152
+ const index = this.dataGridDataset.loadedKeys?.indexOf(this.pendingFocusKey) ?? -1;
6153
+ if (index < 0) {
6154
+ this.pendingFocusKey = null;
6155
+ return false;
6156
+ }
6157
+ const rowElement = this.bodyElement()?.nativeElement.querySelector(`lib-data-grid-row[data-row-index="${index}"]`);
6158
+ if (!rowElement) return false;
6159
+ this.pendingFocusKey = null;
6160
+ rowElement.focus();
6161
+ return true;
6162
+ }
6163
+ loadNextBlock() {
6164
+ if (this.hasLoadedRows && !this.loading() && !this.dataGridDataset.loadedLastRow) {
6165
+ this.loading.set(true);
6166
+ this.dataGridDataset.loadRows();
6167
+ }
6168
+ }
6169
+ moveFocusTo(index, loadedKeys) {
6170
+ const key = loadedKeys[index];
6171
+ if (this.dataGridDataset.focusedRowKey !== key) this.dataGridDataset.moveFocusedRow(key);
6172
+ if (index >= loadedKeys.length - this.pageSize) this.loadNextBlock();
6173
+ this.pendingFocusKey = key;
6174
+ if (!this.focusPendingRow()) this.viewport()?.scrollToIndex(index);
6175
+ }
6176
+ toggleRowSelection(key) {
6177
+ if (this.dataGridDataset.isKeySelected(key)) this.dataGridDataset.deselectRow(key);
6178
+ else this.dataGridDataset.selectRow(key);
6179
+ }
5786
6180
  syncHeaderScroll() {
5787
6181
  const scrollLeft = this.viewport()?.elementRef?.nativeElement?.scrollLeft ?? 0;
5788
6182
  if (this.headerScrollLeft() !== scrollLeft) this.headerScrollLeft.set(scrollLeft);
@@ -5829,26 +6223,55 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
5829
6223
  },
5830
6224
  host: { properties: {
5831
6225
  "class.no-borders": "showButtons()",
5832
- "class.hide-borders": "configs.hideBorders === true"
6226
+ "class.hide-borders": "configs.hideBorders === true",
6227
+ "class.has-column-chooser": "showColumnChooser && !isHideColumns"
5833
6228
  } },
5834
- viewQueries: [{
5835
- propertyName: "bodyElement",
5836
- first: true,
5837
- predicate: ["body"],
5838
- descendants: true,
5839
- isSignal: true
5840
- }, {
5841
- propertyName: "viewport",
5842
- first: true,
5843
- predicate: CdkVirtualScrollViewport,
5844
- descendants: true,
5845
- isSignal: true
5846
- }],
6229
+ viewQueries: [
6230
+ {
6231
+ propertyName: "bodyElement",
6232
+ first: true,
6233
+ predicate: ["body"],
6234
+ descendants: true,
6235
+ isSignal: true
6236
+ },
6237
+ {
6238
+ propertyName: "viewport",
6239
+ first: true,
6240
+ predicate: CdkVirtualScrollViewport,
6241
+ descendants: true,
6242
+ isSignal: true
6243
+ },
6244
+ {
6245
+ propertyName: "columnChooserButton",
6246
+ first: true,
6247
+ predicate: ["columnChooserButton"],
6248
+ descendants: true,
6249
+ isSignal: true
6250
+ },
6251
+ {
6252
+ propertyName: "columnChooserTemplate",
6253
+ first: true,
6254
+ predicate: ["columnChooserTemplate"],
6255
+ descendants: true,
6256
+ isSignal: true
6257
+ }
6258
+ ],
5847
6259
  usesInheritance: true,
5848
6260
  ngImport: i0,
5849
- template: "@if (showButtons()) {\n <div class=\"buttons\">\n <ng-content select=\"[buttons]\"></ng-content>\n </div>\n}\n\n<div class=\"header\" [class.hide]=\"isHideColumns\" [style.padding-right.px]=\"headerRightMargin()\">\n <!-- Translated by however far the body is scrolled sideways. The rows scroll inside the CDK\n viewport and the header sits outside it, so without this the headings simply stay put\n while the cells move away from them. -->\n <div class=\"header-row\" [style.transform]=\"headerScrollLeft() ? 'translateX(-' + headerScrollLeft() + 'px)' : null\">\n @if (isShowMultiSelect) {\n <div\n class=\"header-cell selection\"\n [ngStyle]=\"{\n width: selectionColWidth ? selectionColWidth : null,\n }\"\n >\n <!-- Selects or clears every loaded row. Rows a paged grid has not loaded yet are not part\n of it. A native checkbox, so it is focusable and toggles with Space. -->\n <input\n class=\"form-input\"\n type=\"checkbox\"\n [attr.aria-label]=\"selectAllText | translate\"\n [attr.disabled]=\"disabled() || !hasLoadedRows ? true : null\"\n [checked]=\"allRowsSelected\"\n [indeterminate]=\"someRowsSelected\"\n (change)=\"onToggleSelectAll()\"\n />\n </div>\n }\n\n <!-- A measured zero is a width, not the absence of one: it is a 1fr column that collapsed,\n and its heading has to collapse too.\n\n Such a heading is removed rather than merely made zero wide, because a flex item still\n takes a gap on each side while the body grid allows the collapsed track only one, and\n that spare gap pushed every heading to its right out by 16px. -->\n @for (column of columns; track column) {\n <div\n class=\"header-cell\"\n [class.align-center]=\"alignOf(column) === 'center'\"\n [class.align-end]=\"alignOf(column) === 'end'\"\n [ngStyle]=\"{\n display: column.realSize === 0 ? 'none' : null,\n 'width.px': column.realSize ?? null,\n }\"\n >\n <span>{{ column.headerName | translate }}</span>\n </div>\n }\n </div>\n</div>\n\n<div #body class=\"body\" [style.min-height.px]=\"bodyMinHeight\">\n <cdk-virtual-scroll-viewport [itemSize]=\"configs.rowHeight\" [style.grid-template-columns]=\"gridColumns\">\n <lib-data-grid-row\n #row\n *cdkVirtualFor=\"let row of dataGridDataset.loadedRows; index as i; trackBy: trackByFn\"\n [disabled]=\"disabled()\"\n [isFirstRow]=\"isFirstVisibleRow(i)\"\n [rowData]=\"row\"\n [rowIndex]=\"i\"\n [style.height.px]=\"configs.rowHeight\"\n (selectionResized)=\"onSelectionResized($event)\"\n >\n </lib-data-grid-row>\n\n @if (loading()) {\n <div class=\"loading\" [style.height.px]=\"configs.rowHeight\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>\n {{ dataGridDataset.configs.loadingDisplayText ?? '' | translate }}\n </span>\n </div>\n }\n @if (!loading() && !hasBeenLoaded && !hasFailed() && lazyLoadRows()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenLazyLoad | translate }}\n </span>\n </div>\n }\n <!-- A failed load shows its message even when no load has succeeded yet: the first one failing\n used to leave the grid blank. -->\n @if (!loading() && (hasFailed() || (hasBeenLoaded && !hasLoadedRows))) {\n @if (!hasFailed() && !hasLoadedRows && hasMessageToDisplayWhenEmpty && shouldDisplayMessageWhenEmpty) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenEmpty | translate }}\n </span>\n </div>\n }\n @if (hasFailed()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n <i class=\"fas fa-exclamation-triangle mr-2 text-yellow-600\"></i>{{ messageToDisplayWhenFailed | translate }}\n </span>\n </div>\n }\n }\n </cdk-virtual-scroll-viewport>\n</div>\n\n@if (shouldShowTotalRows) {\n <div class=\"footer\">\n {{ fillCount(totalRowsText | translate: { count: formattedTotalRows }) }}\n </div>\n}\n",
5850
- styles: ["@charset \"UTF-8\";@layer properties;:host{display:flex;flex-direction:column;overflow:hidden;-webkit-user-select:none;user-select:none}:host:not(.no-borders){background-color:var(--color-surface-solid)}:host:not(.no-borders):not(.hide-borders){border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);border-radius:var(--surface-radius, .5rem)}:host.no-borders .header .header-row{padding-block:calc(var(--spacing, .25rem) * 1.5)}:host.no-borders .body lib-data-grid-row{padding-block:var(--spacing, .25rem)}.header-row,lib-data-grid-row,.loading,.message{gap:calc(var(--spacing, .25rem) * 4);padding-inline:calc(var(--spacing, .25rem) * 4)}.header{overflow:hidden;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;--tw-font-weight: var(--font-weight-bold, 700);font-weight:var(--font-weight-bold, 700);background-color:color-mix(in srgb,oklch(21% .034 264.665) 14%,transparent);border-color:var(--color-line)}@supports (color: color-mix(in lab,red,red)){.header{background-color:color-mix(in srgb,var(--color-content-primary) 14%,transparent)}}.header.hide{display:none}.header .header-row{display:flex;flex-direction:row;padding-block:calc(var(--spacing, .25rem) * 3)}.header .header-cell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header .header-cell:not(.selection){flex:none}.header .header-cell.selection{display:flex;align-items:center}.header .header-cell.align-center{text-align:center}.header .header-cell.align-end{text-align:end}.footer{overflow:hidden;border-top-style:var(--tw-border-style);border-top-width:1px;padding-inline:calc(var(--spacing, .25rem) * 4);padding-block:calc(var(--spacing, .25rem) * 1.5);text-overflow:ellipsis;white-space:nowrap;border-color:var(--color-line);color:var(--color-content-secondary);font-size:var(--text-caption);font-variant-numeric:tabular-nums}.body{position:relative;flex-grow:1}.body cdk-virtual-scroll-viewport{position:absolute;inset:0}.body cdk-virtual-scroll-viewport ::ng-deep .cdk-virtual-scroll-content-wrapper{display:grid;grid-template-columns:inherit}.body lib-data-grid-row{margin-top:-1px;cursor:pointer;border-block-style:var(--tw-border-style);border-block-width:1px;padding-block:calc(var(--spacing, .25rem) * 2);border-color:var(--color-line)}.body lib-data-grid-row.striped{background-color:var(--state-hover)}.body lib-data-grid-row:hover{background-color:var(--state-selected)}.body lib-data-grid-row.focused{z-index:1;border-color:var(--color-line-strong)}.body lib-data-grid-row.selected{position:relative;z-index:10;background-color:var(--state-selected);border-color:var(--color-line-selected)}.body lib-data-grid-row.selected:hover{background-color:var(--state-selected)}.body .loading,.body .message{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);white-space:nowrap;height:calc(var(--spacing, .25rem) * 10);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-line);grid-column:1 / -1}.body .loading span,.body .message span{overflow:hidden;text-overflow:ellipsis}.body .loading svg{height:calc(var(--spacing, .25rem) * 6);min-height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);min-width:calc(var(--spacing, .25rem) * 6);animation:var(--animate-spin, spin 1s linear infinite);transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s));transition-duration:var(--duration-short);transition-timing-function:var(--ease-standard)}.buttons{display:flex;border-top-style:var(--tw-border-style);border-top-width:1px;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;padding:var(--spacing, .25rem);border-color:var(--color-line)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
6261
+ template: "@if (showButtons()) {\n <div class=\"buttons\">\n <ng-content select=\"[buttons]\"></ng-content>\n </div>\n}\n\n<!-- The WAI-ARIA grid pattern at row level: the header and the rows are the grid. The toolbar\nabove and the footer below are not rows, so they stay outside it. The keys are handled here, for\nthe row that has the focus; see onKeydown. The grid element itself takes no focus: its rows do,\nand their keydown bubbles up to it. -->\n<div class=\"grid-frame\">\n <!-- The column chooser button sits over the end of the header. It is not part of the grid: a\n row may hold only cells, so a control between them would break the grid's role tree. It comes\n before the grid in the Tab order, a Tab stop of its own as the select-all checkbox is. -->\n @if (showColumnChooser && !isHideColumns) {\n <div class=\"column-chooser-slot\">\n <button\n #columnChooserButton\n class=\"column-chooser-button\"\n aria-haspopup=\"dialog\"\n type=\"button\"\n [attr.aria-controls]=\"columnChooserOpen() ? columnChooserId : null\"\n [attr.aria-expanded]=\"columnChooserOpen()\"\n [attr.aria-label]=\"columnChooserText | translate\"\n [libTooltip]=\"columnChooserOpen() ? null : columnChooserText\"\n (click)=\"onToggleColumnChooser()\"\n >\n <i class=\"fa-solid fa-table-columns\" aria-hidden=\"true\"></i>\n </button>\n </div>\n }\n\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"grid\"\n role=\"grid\"\n [attr.aria-disabled]=\"disabled() ? true : null\"\n [attr.aria-label]=\"gridLabel ? (gridLabel | translate) : null\"\n [attr.aria-multiselectable]=\"isShowMultiSelect ? true : null\"\n [attr.aria-rowcount]=\"ariaRowCount\"\n (keydown)=\"onKeydown($event)\"\n >\n <div class=\"header\" role=\"rowgroup\" [class.hide]=\"isHideColumns\" [style.padding-right.px]=\"headerRightMargin()\">\n <!-- Translated by however far the body is scrolled sideways. The rows scroll inside the CDK\n viewport and the header sits outside it, so without this the headings simply stay put\n while the cells move away from them. -->\n <div\n class=\"header-row\"\n aria-rowindex=\"1\"\n role=\"row\"\n [style.transform]=\"headerScrollLeft() ? 'translateX(-' + headerScrollLeft() + 'px)' : null\"\n >\n @if (isShowMultiSelect) {\n <div\n class=\"header-cell selection\"\n role=\"columnheader\"\n [ngStyle]=\"{\n width: selectionColWidth ? selectionColWidth : null,\n }\"\n >\n <!-- Selects or clears every loaded row. Rows a paged grid has not loaded yet are not part\n of it. A native checkbox, so it is focusable and toggles with Space. -->\n <input\n class=\"form-input\"\n type=\"checkbox\"\n [attr.aria-label]=\"selectAllText | translate\"\n [attr.disabled]=\"disabled() || !hasLoadedRows ? true : null\"\n [checked]=\"allRowsSelected\"\n [indeterminate]=\"someRowsSelected\"\n (change)=\"onToggleSelectAll()\"\n />\n </div>\n }\n\n <!-- A measured zero is a width, not the absence of one: it is a 1fr column that collapsed,\n and its heading has to collapse too.\n\n Such a heading is removed rather than merely made zero wide, because a flex item still\n takes a gap on each side while the body grid allows the collapsed track only one, and\n that spare gap pushed every heading to its right out by 16px. -->\n @for (column of columns; track column) {\n @let width = headerWidth(column);\n <div\n class=\"header-cell\"\n role=\"columnheader\"\n [class.align-center]=\"alignOf(column) === 'center'\"\n [class.align-end]=\"alignOf(column) === 'end'\"\n [ngStyle]=\"{\n display: width === 0 ? 'none' : null,\n 'width.px': width,\n }\"\n >\n <span class=\"header-text\">{{ column.headerName | translate }}</span>\n <!-- The width sets the column's track in the rows' template. The header then copies the\n cell measured in the first row, as for any column. ArrowLeft and ArrowRight change the\n width; a double click gives the column its declared size back. -->\n @if (isResizable(column)) {\n @let columnName = column.headerName | translate;\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -->\n <div\n class=\"resize-handle\"\n aria-orientation=\"vertical\"\n role=\"separator\"\n tabindex=\"0\"\n [attr.aria-label]=\"fillColumn(resizeColumnText | translate: { column: columnName }, columnName)\"\n [attr.aria-valuemin]=\"minColumnWidth\"\n [attr.aria-valuenow]=\"resizeValue(column)\"\n (click)=\"$event.stopPropagation()\"\n (dblclick)=\"onResizeReset($event, column)\"\n (keydown)=\"onResizeKeydown($event, column)\"\n (pointerdown)=\"onResizeStart($event, column)\"\n ></div>\n }\n </div>\n }\n </div>\n </div>\n\n <div #body class=\"body\" role=\"rowgroup\" [style.min-height.px]=\"bodyMinHeight\">\n <cdk-virtual-scroll-viewport [itemSize]=\"configs.rowHeight\" [style.grid-template-columns]=\"gridColumns\">\n @let tabbableKey = tabbableRowKey;\n <lib-data-grid-row\n #row\n *cdkVirtualFor=\"let row of dataGridDataset.loadedRows; index as i; trackBy: trackByFn\"\n [disabled]=\"disabled()\"\n [isFirstRow]=\"isFirstVisibleRow(i)\"\n [rowData]=\"row\"\n [rowIndex]=\"i\"\n [style.height.px]=\"configs.rowHeight\"\n [tabbable]=\"dataGridDataset.getRowInternalKey(row) === tabbableKey\"\n (selectionResized)=\"onSelectionResized($event)\"\n >\n </lib-data-grid-row>\n\n <!-- The messages below are not rows, so assistive technology does not see them here: the\n status region after the grid announces the same text. -->\n @if (loading()) {\n <div class=\"loading\" aria-hidden=\"true\" [style.height.px]=\"configs.rowHeight\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>\n {{ dataGridDataset.configs.loadingDisplayText ?? '' | translate }}\n </span>\n </div>\n }\n @if (!loading() && !hasBeenLoaded && !hasFailed() && lazyLoadRows()) {\n <div class=\"message\" aria-hidden=\"true\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenLazyLoad | translate }}\n </span>\n </div>\n }\n <!-- A failed load shows its message even when no load has succeeded yet: the first one failing\n used to leave the grid blank. -->\n @if (!loading() && (hasFailed() || (hasBeenLoaded && !hasLoadedRows))) {\n @if (!hasFailed() && !hasLoadedRows && hasMessageToDisplayWhenEmpty && shouldDisplayMessageWhenEmpty) {\n <div class=\"message\" aria-hidden=\"true\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenEmpty | translate }}\n </span>\n </div>\n }\n @if (hasFailed()) {\n <div class=\"message\" aria-hidden=\"true\" [style.height.px]=\"configs.rowHeight\">\n <span>\n <i class=\"fas fa-exclamation-triangle mr-2 text-yellow-600\"></i\n >{{ messageToDisplayWhenFailed | translate }}\n </span>\n </div>\n }\n }\n </cdk-virtual-scroll-viewport>\n </div>\n </div>\n</div>\n\n<!-- Polite: screen readers hear the loading, lazy-load, empty and failure messages without losing\ntheir place. Always in the page, so a change of text is announced. -->\n<div class=\"status\" role=\"status\">{{ statusText | translate }}</div>\n\n@if (shouldShowTotalRows) {\n <div class=\"footer\">\n {{ fillCount(totalRowsText | translate: { count: formattedTotalRows }) }}\n </div>\n}\n\n<!-- The column chooser, opened in a CDK overlay under its button. The focus is trapped inside;\nEscape and a click outside close it and give the focus back to the button. -->\n<ng-template #columnChooserTemplate>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"column-chooser\"\n cdkTrapFocus\n role=\"dialog\"\n [attr.aria-label]=\"columnChooserText | translate\"\n [attr.id]=\"columnChooserId\"\n (keydown)=\"onColumnChooserKeydown($event)\"\n >\n <ul class=\"column-chooser-list\">\n @for (column of hideableColumns; track column) {\n <li>\n <label class=\"column-chooser-option\">\n <input\n class=\"form-input\"\n type=\"checkbox\"\n [checked]=\"!dataGridDataset.isColumnHidden(column)\"\n [disabled]=\"!dataGridDataset.isColumnHidden(column) && !dataGridDataset.canHideColumn(column)\"\n (change)=\"onToggleColumn(column, $event)\"\n />\n <span>{{ column.headerName || column.field | translate }}</span>\n </label>\n </li>\n }\n </ul>\n <button class=\"column-chooser-reset\" type=\"button\" (click)=\"onResetColumns()\">\n {{ resetColumnsText | translate }}\n </button>\n </div>\n</ng-template>\n",
6262
+ styles: ["@charset \"UTF-8\";@layer properties;:host{display:flex;flex-direction:column;overflow:hidden;-webkit-user-select:none;user-select:none}:host:not(.no-borders){background-color:var(--color-surface-solid)}:host:not(.no-borders):not(.hide-borders){border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);border-radius:var(--surface-radius, .5rem)}:host.no-borders .header .header-row{padding-block:calc(var(--spacing, .25rem) * 1.5)}:host.no-borders .column-chooser-slot{padding-block:calc(var(--spacing, .25rem) * 1.5)}:host.no-borders .body lib-data-grid-row{padding-block:var(--spacing, .25rem)}.grid-frame{position:relative;display:flex;min-height:0px;flex-grow:1;flex-direction:column}.grid{display:flex;min-height:0px;flex-grow:1;flex-direction:column;overflow:hidden}.column-chooser-slot{position:absolute;inset-inline-end:calc(var(--spacing, .25rem) * 0);top:0;z-index:2;display:flex;align-items:center;padding-block:calc(var(--spacing, .25rem) * 3);padding-inline-start:var(--spacing, .25rem);padding-inline-end:calc(var(--spacing, .25rem) * 2);background:linear-gradient(color-mix(in srgb,oklch(21% .034 264.665) 14%,transparent),color-mix(in srgb,oklch(21% .034 264.665) 14%,transparent)),var(--color-surface-solid)}@supports (color: color-mix(in lab,red,red)){.column-chooser-slot{background:linear-gradient(color-mix(in srgb,var(--color-content-primary) 14%,transparent),color-mix(in srgb,var(--color-content-primary) 14%,transparent)),var(--color-surface-solid)}}.column-chooser-button{display:inline-flex;height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);cursor:pointer;align-items:center;justify-content:center;border-style:var(--tw-border-style);border-width:1px;border-color:transparent;border-radius:var(--radius-control);color:var(--color-content-secondary)}.column-chooser-button:hover{background-color:var(--state-hover);color:var(--color-content-primary)}.column-chooser-button:focus-visible{outline:var(--focus-ring-width) solid var(--color-focus-ring);outline-offset:0}:host.has-column-chooser .header-row,:host.has-column-chooser .body lib-data-grid-row{padding-inline-end:2.5rem}.status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border-width:0}.header-row,lib-data-grid-row,.loading,.message{gap:calc(var(--spacing, .25rem) * 4);padding-inline:calc(var(--spacing, .25rem) * 4)}.header{overflow:hidden;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;--tw-font-weight: var(--font-weight-bold, 700);font-weight:var(--font-weight-bold, 700);background-color:color-mix(in srgb,oklch(21% .034 264.665) 14%,transparent);border-color:var(--color-line)}@supports (color: color-mix(in lab,red,red)){.header{background-color:color-mix(in srgb,var(--color-content-primary) 14%,transparent)}}.header.hide{display:none}.header .header-row{display:flex;flex-direction:row;padding-block:calc(var(--spacing, .25rem) * 3)}.header .header-cell{position:relative;display:flex;align-items:center;white-space:nowrap}.header .header-cell .header-text{min-width:0px;flex-grow:1;overflow:hidden;text-overflow:ellipsis}.header .header-cell:not(.selection){flex:none}.header .header-cell.selection{display:flex;align-items:center}.header .header-cell.align-center{text-align:center}.header .header-cell.align-end{text-align:end}.header .resize-handle{position:absolute;top:0;bottom:0;z-index:1;cursor:col-resize;touch-action:none;inset-inline-end:-.875rem;width:.75rem}.header .resize-handle:after{position:absolute;top:0;bottom:0;opacity:0%;content:\"\";inset-inline-start:calc(50% - 1px);width:2px;background-color:var(--color-line-strong);transition:opacity var(--duration-short) var(--ease-standard)}.header .resize-handle:hover:after,.header .resize-handle:active:after,.header .resize-handle:focus-visible:after{opacity:100%}.header .resize-handle:focus-visible{outline:var(--focus-ring-width) solid var(--color-focus-ring);outline-offset:calc(-1 * var(--focus-ring-width))}.column-chooser{display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 2);border-style:var(--tw-border-style);border-width:1px;padding:calc(var(--spacing, .25rem) * 2);min-width:12rem;max-height:20rem;border-color:var(--color-line);border-radius:var(--radius-control);background-color:var(--color-surface-solid);color:var(--color-content-primary);box-shadow:var(--shadow-overlay);font-size:var(--text-body)}.column-chooser-list{display:flex;flex-direction:column;overflow-y:auto}.column-chooser-option{display:flex;cursor:pointer;align-items:center;gap:calc(var(--spacing, .25rem) * 2);padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:var(--spacing, .25rem);white-space:nowrap;border-radius:var(--radius-control)}.column-chooser-option:hover{background-color:var(--state-hover)}.column-chooser-option:has(input:disabled){cursor:default;opacity:var(--opacity-disabled)}.column-chooser-reset{cursor:pointer;border-style:var(--tw-border-style);border-width:1px;padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:var(--spacing, .25rem);text-align:start;border-color:var(--color-line);border-radius:var(--radius-control)}.column-chooser-reset:hover{background-color:var(--state-hover)}.column-chooser-reset:focus-visible{outline:var(--focus-ring-width) solid var(--color-focus-ring);outline-offset:0}.footer{overflow:hidden;border-top-style:var(--tw-border-style);border-top-width:1px;padding-inline:calc(var(--spacing, .25rem) * 4);padding-block:calc(var(--spacing, .25rem) * 1.5);text-overflow:ellipsis;white-space:nowrap;border-color:var(--color-line);color:var(--color-content-secondary);font-size:var(--text-caption);font-variant-numeric:tabular-nums}.body{position:relative;flex-grow:1}.body cdk-virtual-scroll-viewport{position:absolute;inset:0}.body cdk-virtual-scroll-viewport ::ng-deep .cdk-virtual-scroll-content-wrapper{display:grid;grid-template-columns:inherit}.body lib-data-grid-row{margin-top:-1px;cursor:pointer;border-block-style:var(--tw-border-style);border-block-width:1px;padding-block:calc(var(--spacing, .25rem) * 2);border-color:var(--color-line)}.body lib-data-grid-row.striped{background-color:var(--state-hover)}.body lib-data-grid-row:hover{background-color:var(--state-selected)}.body lib-data-grid-row.focused{z-index:1;border-color:var(--color-line-strong)}.body lib-data-grid-row:focus-visible{position:relative;z-index:20;outline:var(--focus-ring-width) solid var(--color-focus-ring);outline-offset:calc(-1 * var(--focus-ring-width))}.body lib-data-grid-row.selected{position:relative;z-index:10;background-color:var(--state-selected);border-color:var(--color-line-selected)}.body lib-data-grid-row.selected:hover{background-color:var(--state-selected)}.body .loading,.body .message{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);white-space:nowrap;height:calc(var(--spacing, .25rem) * 10);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-line);grid-column:1 / -1}.body .loading span,.body .message span{overflow:hidden;text-overflow:ellipsis}.body .loading svg{height:calc(var(--spacing, .25rem) * 6);min-height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);min-width:calc(var(--spacing, .25rem) * 6);animation:var(--animate-spin, spin 1s linear infinite);transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s));transition-duration:var(--duration-short);transition-timing-function:var(--ease-standard)}.buttons{display:flex;border-top-style:var(--tw-border-style);border-top-width:1px;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;padding:var(--spacing, .25rem);border-color:var(--color-line)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
5851
6263
  dependencies: [
6264
+ {
6265
+ kind: "ngmodule",
6266
+ type: A11yModule
6267
+ },
6268
+ {
6269
+ kind: "directive",
6270
+ type: i1.CdkTrapFocus,
6271
+ selector: "[cdkTrapFocus]",
6272
+ inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"],
6273
+ exportAs: ["cdkTrapFocus"]
6274
+ },
5852
6275
  {
5853
6276
  kind: "component",
5854
6277
  type: DataGridRowComponent,
@@ -5857,7 +6280,8 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
5857
6280
  "disabled",
5858
6281
  "isFirstRow",
5859
6282
  "rowData",
5860
- "rowIndex"
6283
+ "rowIndex",
6284
+ "tabbable"
5861
6285
  ],
5862
6286
  outputs: ["selectionResized"]
5863
6287
  },
@@ -5873,7 +6297,7 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
5873
6297
  },
5874
6298
  {
5875
6299
  kind: "directive",
5876
- type: i1.CdkFixedSizeVirtualScroll,
6300
+ type: i2.CdkFixedSizeVirtualScroll,
5877
6301
  selector: "cdk-virtual-scroll-viewport[itemSize]",
5878
6302
  inputs: [
5879
6303
  "itemSize",
@@ -5883,7 +6307,7 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
5883
6307
  },
5884
6308
  {
5885
6309
  kind: "directive",
5886
- type: i1.CdkVirtualForOf,
6310
+ type: i2.CdkVirtualForOf,
5887
6311
  selector: "[cdkVirtualFor][cdkVirtualForOf]",
5888
6312
  inputs: [
5889
6313
  "cdkVirtualForOf",
@@ -5894,11 +6318,22 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
5894
6318
  },
5895
6319
  {
5896
6320
  kind: "component",
5897
- type: i1.CdkVirtualScrollViewport,
6321
+ type: i2.CdkVirtualScrollViewport,
5898
6322
  selector: "cdk-virtual-scroll-viewport",
5899
6323
  inputs: ["orientation", "appendOnly"],
5900
6324
  outputs: ["scrolledIndexChange"]
5901
6325
  },
6326
+ {
6327
+ kind: "directive",
6328
+ type: TooltipDirective,
6329
+ selector: "[libTooltip]",
6330
+ inputs: [
6331
+ "libTooltip",
6332
+ "tooltipPosition",
6333
+ "tooltipDisabled",
6334
+ "tooltipDelay"
6335
+ ]
6336
+ },
5902
6337
  {
5903
6338
  kind: "pipe",
5904
6339
  type: TranslatePipe,
@@ -5918,16 +6353,19 @@ i0.ɵɵngDeclareClassMetadata({
5918
6353
  selector: "lib-data-grid",
5919
6354
  host: {
5920
6355
  "[class.no-borders]": "showButtons()",
5921
- "[class.hide-borders]": "configs.hideBorders === true"
6356
+ "[class.hide-borders]": "configs.hideBorders === true",
6357
+ "[class.has-column-chooser]": "showColumnChooser && !isHideColumns"
5922
6358
  },
5923
6359
  imports: [
6360
+ A11yModule,
5924
6361
  DataGridRowComponent,
5925
6362
  NgStyle,
5926
6363
  ScrollingModule,
6364
+ TooltipDirective,
5927
6365
  TranslatePipe
5928
6366
  ],
5929
- template: "@if (showButtons()) {\n <div class=\"buttons\">\n <ng-content select=\"[buttons]\"></ng-content>\n </div>\n}\n\n<div class=\"header\" [class.hide]=\"isHideColumns\" [style.padding-right.px]=\"headerRightMargin()\">\n <!-- Translated by however far the body is scrolled sideways. The rows scroll inside the CDK\n viewport and the header sits outside it, so without this the headings simply stay put\n while the cells move away from them. -->\n <div class=\"header-row\" [style.transform]=\"headerScrollLeft() ? 'translateX(-' + headerScrollLeft() + 'px)' : null\">\n @if (isShowMultiSelect) {\n <div\n class=\"header-cell selection\"\n [ngStyle]=\"{\n width: selectionColWidth ? selectionColWidth : null,\n }\"\n >\n <!-- Selects or clears every loaded row. Rows a paged grid has not loaded yet are not part\n of it. A native checkbox, so it is focusable and toggles with Space. -->\n <input\n class=\"form-input\"\n type=\"checkbox\"\n [attr.aria-label]=\"selectAllText | translate\"\n [attr.disabled]=\"disabled() || !hasLoadedRows ? true : null\"\n [checked]=\"allRowsSelected\"\n [indeterminate]=\"someRowsSelected\"\n (change)=\"onToggleSelectAll()\"\n />\n </div>\n }\n\n <!-- A measured zero is a width, not the absence of one: it is a 1fr column that collapsed,\n and its heading has to collapse too.\n\n Such a heading is removed rather than merely made zero wide, because a flex item still\n takes a gap on each side while the body grid allows the collapsed track only one, and\n that spare gap pushed every heading to its right out by 16px. -->\n @for (column of columns; track column) {\n <div\n class=\"header-cell\"\n [class.align-center]=\"alignOf(column) === 'center'\"\n [class.align-end]=\"alignOf(column) === 'end'\"\n [ngStyle]=\"{\n display: column.realSize === 0 ? 'none' : null,\n 'width.px': column.realSize ?? null,\n }\"\n >\n <span>{{ column.headerName | translate }}</span>\n </div>\n }\n </div>\n</div>\n\n<div #body class=\"body\" [style.min-height.px]=\"bodyMinHeight\">\n <cdk-virtual-scroll-viewport [itemSize]=\"configs.rowHeight\" [style.grid-template-columns]=\"gridColumns\">\n <lib-data-grid-row\n #row\n *cdkVirtualFor=\"let row of dataGridDataset.loadedRows; index as i; trackBy: trackByFn\"\n [disabled]=\"disabled()\"\n [isFirstRow]=\"isFirstVisibleRow(i)\"\n [rowData]=\"row\"\n [rowIndex]=\"i\"\n [style.height.px]=\"configs.rowHeight\"\n (selectionResized)=\"onSelectionResized($event)\"\n >\n </lib-data-grid-row>\n\n @if (loading()) {\n <div class=\"loading\" [style.height.px]=\"configs.rowHeight\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>\n {{ dataGridDataset.configs.loadingDisplayText ?? '' | translate }}\n </span>\n </div>\n }\n @if (!loading() && !hasBeenLoaded && !hasFailed() && lazyLoadRows()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenLazyLoad | translate }}\n </span>\n </div>\n }\n <!-- A failed load shows its message even when no load has succeeded yet: the first one failing\n used to leave the grid blank. -->\n @if (!loading() && (hasFailed() || (hasBeenLoaded && !hasLoadedRows))) {\n @if (!hasFailed() && !hasLoadedRows && hasMessageToDisplayWhenEmpty && shouldDisplayMessageWhenEmpty) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenEmpty | translate }}\n </span>\n </div>\n }\n @if (hasFailed()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n <i class=\"fas fa-exclamation-triangle mr-2 text-yellow-600\"></i>{{ messageToDisplayWhenFailed | translate }}\n </span>\n </div>\n }\n }\n </cdk-virtual-scroll-viewport>\n</div>\n\n@if (shouldShowTotalRows) {\n <div class=\"footer\">\n {{ fillCount(totalRowsText | translate: { count: formattedTotalRows }) }}\n </div>\n}\n",
5930
- styles: ["@charset \"UTF-8\";@layer properties;:host{display:flex;flex-direction:column;overflow:hidden;-webkit-user-select:none;user-select:none}:host:not(.no-borders){background-color:var(--color-surface-solid)}:host:not(.no-borders):not(.hide-borders){border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);border-radius:var(--surface-radius, .5rem)}:host.no-borders .header .header-row{padding-block:calc(var(--spacing, .25rem) * 1.5)}:host.no-borders .body lib-data-grid-row{padding-block:var(--spacing, .25rem)}.header-row,lib-data-grid-row,.loading,.message{gap:calc(var(--spacing, .25rem) * 4);padding-inline:calc(var(--spacing, .25rem) * 4)}.header{overflow:hidden;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;--tw-font-weight: var(--font-weight-bold, 700);font-weight:var(--font-weight-bold, 700);background-color:color-mix(in srgb,oklch(21% .034 264.665) 14%,transparent);border-color:var(--color-line)}@supports (color: color-mix(in lab,red,red)){.header{background-color:color-mix(in srgb,var(--color-content-primary) 14%,transparent)}}.header.hide{display:none}.header .header-row{display:flex;flex-direction:row;padding-block:calc(var(--spacing, .25rem) * 3)}.header .header-cell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header .header-cell:not(.selection){flex:none}.header .header-cell.selection{display:flex;align-items:center}.header .header-cell.align-center{text-align:center}.header .header-cell.align-end{text-align:end}.footer{overflow:hidden;border-top-style:var(--tw-border-style);border-top-width:1px;padding-inline:calc(var(--spacing, .25rem) * 4);padding-block:calc(var(--spacing, .25rem) * 1.5);text-overflow:ellipsis;white-space:nowrap;border-color:var(--color-line);color:var(--color-content-secondary);font-size:var(--text-caption);font-variant-numeric:tabular-nums}.body{position:relative;flex-grow:1}.body cdk-virtual-scroll-viewport{position:absolute;inset:0}.body cdk-virtual-scroll-viewport ::ng-deep .cdk-virtual-scroll-content-wrapper{display:grid;grid-template-columns:inherit}.body lib-data-grid-row{margin-top:-1px;cursor:pointer;border-block-style:var(--tw-border-style);border-block-width:1px;padding-block:calc(var(--spacing, .25rem) * 2);border-color:var(--color-line)}.body lib-data-grid-row.striped{background-color:var(--state-hover)}.body lib-data-grid-row:hover{background-color:var(--state-selected)}.body lib-data-grid-row.focused{z-index:1;border-color:var(--color-line-strong)}.body lib-data-grid-row.selected{position:relative;z-index:10;background-color:var(--state-selected);border-color:var(--color-line-selected)}.body lib-data-grid-row.selected:hover{background-color:var(--state-selected)}.body .loading,.body .message{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);white-space:nowrap;height:calc(var(--spacing, .25rem) * 10);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-line);grid-column:1 / -1}.body .loading span,.body .message span{overflow:hidden;text-overflow:ellipsis}.body .loading svg{height:calc(var(--spacing, .25rem) * 6);min-height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);min-width:calc(var(--spacing, .25rem) * 6);animation:var(--animate-spin, spin 1s linear infinite);transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s));transition-duration:var(--duration-short);transition-timing-function:var(--ease-standard)}.buttons{display:flex;border-top-style:var(--tw-border-style);border-top-width:1px;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;padding:var(--spacing, .25rem);border-color:var(--color-line)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
6367
+ template: "@if (showButtons()) {\n <div class=\"buttons\">\n <ng-content select=\"[buttons]\"></ng-content>\n </div>\n}\n\n<!-- The WAI-ARIA grid pattern at row level: the header and the rows are the grid. The toolbar\nabove and the footer below are not rows, so they stay outside it. The keys are handled here, for\nthe row that has the focus; see onKeydown. The grid element itself takes no focus: its rows do,\nand their keydown bubbles up to it. -->\n<div class=\"grid-frame\">\n <!-- The column chooser button sits over the end of the header. It is not part of the grid: a\n row may hold only cells, so a control between them would break the grid's role tree. It comes\n before the grid in the Tab order, a Tab stop of its own as the select-all checkbox is. -->\n @if (showColumnChooser && !isHideColumns) {\n <div class=\"column-chooser-slot\">\n <button\n #columnChooserButton\n class=\"column-chooser-button\"\n aria-haspopup=\"dialog\"\n type=\"button\"\n [attr.aria-controls]=\"columnChooserOpen() ? columnChooserId : null\"\n [attr.aria-expanded]=\"columnChooserOpen()\"\n [attr.aria-label]=\"columnChooserText | translate\"\n [libTooltip]=\"columnChooserOpen() ? null : columnChooserText\"\n (click)=\"onToggleColumnChooser()\"\n >\n <i class=\"fa-solid fa-table-columns\" aria-hidden=\"true\"></i>\n </button>\n </div>\n }\n\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"grid\"\n role=\"grid\"\n [attr.aria-disabled]=\"disabled() ? true : null\"\n [attr.aria-label]=\"gridLabel ? (gridLabel | translate) : null\"\n [attr.aria-multiselectable]=\"isShowMultiSelect ? true : null\"\n [attr.aria-rowcount]=\"ariaRowCount\"\n (keydown)=\"onKeydown($event)\"\n >\n <div class=\"header\" role=\"rowgroup\" [class.hide]=\"isHideColumns\" [style.padding-right.px]=\"headerRightMargin()\">\n <!-- Translated by however far the body is scrolled sideways. The rows scroll inside the CDK\n viewport and the header sits outside it, so without this the headings simply stay put\n while the cells move away from them. -->\n <div\n class=\"header-row\"\n aria-rowindex=\"1\"\n role=\"row\"\n [style.transform]=\"headerScrollLeft() ? 'translateX(-' + headerScrollLeft() + 'px)' : null\"\n >\n @if (isShowMultiSelect) {\n <div\n class=\"header-cell selection\"\n role=\"columnheader\"\n [ngStyle]=\"{\n width: selectionColWidth ? selectionColWidth : null,\n }\"\n >\n <!-- Selects or clears every loaded row. Rows a paged grid has not loaded yet are not part\n of it. A native checkbox, so it is focusable and toggles with Space. -->\n <input\n class=\"form-input\"\n type=\"checkbox\"\n [attr.aria-label]=\"selectAllText | translate\"\n [attr.disabled]=\"disabled() || !hasLoadedRows ? true : null\"\n [checked]=\"allRowsSelected\"\n [indeterminate]=\"someRowsSelected\"\n (change)=\"onToggleSelectAll()\"\n />\n </div>\n }\n\n <!-- A measured zero is a width, not the absence of one: it is a 1fr column that collapsed,\n and its heading has to collapse too.\n\n Such a heading is removed rather than merely made zero wide, because a flex item still\n takes a gap on each side while the body grid allows the collapsed track only one, and\n that spare gap pushed every heading to its right out by 16px. -->\n @for (column of columns; track column) {\n @let width = headerWidth(column);\n <div\n class=\"header-cell\"\n role=\"columnheader\"\n [class.align-center]=\"alignOf(column) === 'center'\"\n [class.align-end]=\"alignOf(column) === 'end'\"\n [ngStyle]=\"{\n display: width === 0 ? 'none' : null,\n 'width.px': width,\n }\"\n >\n <span class=\"header-text\">{{ column.headerName | translate }}</span>\n <!-- The width sets the column's track in the rows' template. The header then copies the\n cell measured in the first row, as for any column. ArrowLeft and ArrowRight change the\n width; a double click gives the column its declared size back. -->\n @if (isResizable(column)) {\n @let columnName = column.headerName | translate;\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -->\n <div\n class=\"resize-handle\"\n aria-orientation=\"vertical\"\n role=\"separator\"\n tabindex=\"0\"\n [attr.aria-label]=\"fillColumn(resizeColumnText | translate: { column: columnName }, columnName)\"\n [attr.aria-valuemin]=\"minColumnWidth\"\n [attr.aria-valuenow]=\"resizeValue(column)\"\n (click)=\"$event.stopPropagation()\"\n (dblclick)=\"onResizeReset($event, column)\"\n (keydown)=\"onResizeKeydown($event, column)\"\n (pointerdown)=\"onResizeStart($event, column)\"\n ></div>\n }\n </div>\n }\n </div>\n </div>\n\n <div #body class=\"body\" role=\"rowgroup\" [style.min-height.px]=\"bodyMinHeight\">\n <cdk-virtual-scroll-viewport [itemSize]=\"configs.rowHeight\" [style.grid-template-columns]=\"gridColumns\">\n @let tabbableKey = tabbableRowKey;\n <lib-data-grid-row\n #row\n *cdkVirtualFor=\"let row of dataGridDataset.loadedRows; index as i; trackBy: trackByFn\"\n [disabled]=\"disabled()\"\n [isFirstRow]=\"isFirstVisibleRow(i)\"\n [rowData]=\"row\"\n [rowIndex]=\"i\"\n [style.height.px]=\"configs.rowHeight\"\n [tabbable]=\"dataGridDataset.getRowInternalKey(row) === tabbableKey\"\n (selectionResized)=\"onSelectionResized($event)\"\n >\n </lib-data-grid-row>\n\n <!-- The messages below are not rows, so assistive technology does not see them here: the\n status region after the grid announces the same text. -->\n @if (loading()) {\n <div class=\"loading\" aria-hidden=\"true\" [style.height.px]=\"configs.rowHeight\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>\n {{ dataGridDataset.configs.loadingDisplayText ?? '' | translate }}\n </span>\n </div>\n }\n @if (!loading() && !hasBeenLoaded && !hasFailed() && lazyLoadRows()) {\n <div class=\"message\" aria-hidden=\"true\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenLazyLoad | translate }}\n </span>\n </div>\n }\n <!-- A failed load shows its message even when no load has succeeded yet: the first one failing\n used to leave the grid blank. -->\n @if (!loading() && (hasFailed() || (hasBeenLoaded && !hasLoadedRows))) {\n @if (!hasFailed() && !hasLoadedRows && hasMessageToDisplayWhenEmpty && shouldDisplayMessageWhenEmpty) {\n <div class=\"message\" aria-hidden=\"true\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenEmpty | translate }}\n </span>\n </div>\n }\n @if (hasFailed()) {\n <div class=\"message\" aria-hidden=\"true\" [style.height.px]=\"configs.rowHeight\">\n <span>\n <i class=\"fas fa-exclamation-triangle mr-2 text-yellow-600\"></i\n >{{ messageToDisplayWhenFailed | translate }}\n </span>\n </div>\n }\n }\n </cdk-virtual-scroll-viewport>\n </div>\n </div>\n</div>\n\n<!-- Polite: screen readers hear the loading, lazy-load, empty and failure messages without losing\ntheir place. Always in the page, so a change of text is announced. -->\n<div class=\"status\" role=\"status\">{{ statusText | translate }}</div>\n\n@if (shouldShowTotalRows) {\n <div class=\"footer\">\n {{ fillCount(totalRowsText | translate: { count: formattedTotalRows }) }}\n </div>\n}\n\n<!-- The column chooser, opened in a CDK overlay under its button. The focus is trapped inside;\nEscape and a click outside close it and give the focus back to the button. -->\n<ng-template #columnChooserTemplate>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"column-chooser\"\n cdkTrapFocus\n role=\"dialog\"\n [attr.aria-label]=\"columnChooserText | translate\"\n [attr.id]=\"columnChooserId\"\n (keydown)=\"onColumnChooserKeydown($event)\"\n >\n <ul class=\"column-chooser-list\">\n @for (column of hideableColumns; track column) {\n <li>\n <label class=\"column-chooser-option\">\n <input\n class=\"form-input\"\n type=\"checkbox\"\n [checked]=\"!dataGridDataset.isColumnHidden(column)\"\n [disabled]=\"!dataGridDataset.isColumnHidden(column) && !dataGridDataset.canHideColumn(column)\"\n (change)=\"onToggleColumn(column, $event)\"\n />\n <span>{{ column.headerName || column.field | translate }}</span>\n </label>\n </li>\n }\n </ul>\n <button class=\"column-chooser-reset\" type=\"button\" (click)=\"onResetColumns()\">\n {{ resetColumnsText | translate }}\n </button>\n </div>\n</ng-template>\n",
6368
+ styles: ["@charset \"UTF-8\";@layer properties;:host{display:flex;flex-direction:column;overflow:hidden;-webkit-user-select:none;user-select:none}:host:not(.no-borders){background-color:var(--color-surface-solid)}:host:not(.no-borders):not(.hide-borders){border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);border-radius:var(--surface-radius, .5rem)}:host.no-borders .header .header-row{padding-block:calc(var(--spacing, .25rem) * 1.5)}:host.no-borders .column-chooser-slot{padding-block:calc(var(--spacing, .25rem) * 1.5)}:host.no-borders .body lib-data-grid-row{padding-block:var(--spacing, .25rem)}.grid-frame{position:relative;display:flex;min-height:0px;flex-grow:1;flex-direction:column}.grid{display:flex;min-height:0px;flex-grow:1;flex-direction:column;overflow:hidden}.column-chooser-slot{position:absolute;inset-inline-end:calc(var(--spacing, .25rem) * 0);top:0;z-index:2;display:flex;align-items:center;padding-block:calc(var(--spacing, .25rem) * 3);padding-inline-start:var(--spacing, .25rem);padding-inline-end:calc(var(--spacing, .25rem) * 2);background:linear-gradient(color-mix(in srgb,oklch(21% .034 264.665) 14%,transparent),color-mix(in srgb,oklch(21% .034 264.665) 14%,transparent)),var(--color-surface-solid)}@supports (color: color-mix(in lab,red,red)){.column-chooser-slot{background:linear-gradient(color-mix(in srgb,var(--color-content-primary) 14%,transparent),color-mix(in srgb,var(--color-content-primary) 14%,transparent)),var(--color-surface-solid)}}.column-chooser-button{display:inline-flex;height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);cursor:pointer;align-items:center;justify-content:center;border-style:var(--tw-border-style);border-width:1px;border-color:transparent;border-radius:var(--radius-control);color:var(--color-content-secondary)}.column-chooser-button:hover{background-color:var(--state-hover);color:var(--color-content-primary)}.column-chooser-button:focus-visible{outline:var(--focus-ring-width) solid var(--color-focus-ring);outline-offset:0}:host.has-column-chooser .header-row,:host.has-column-chooser .body lib-data-grid-row{padding-inline-end:2.5rem}.status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border-width:0}.header-row,lib-data-grid-row,.loading,.message{gap:calc(var(--spacing, .25rem) * 4);padding-inline:calc(var(--spacing, .25rem) * 4)}.header{overflow:hidden;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;--tw-font-weight: var(--font-weight-bold, 700);font-weight:var(--font-weight-bold, 700);background-color:color-mix(in srgb,oklch(21% .034 264.665) 14%,transparent);border-color:var(--color-line)}@supports (color: color-mix(in lab,red,red)){.header{background-color:color-mix(in srgb,var(--color-content-primary) 14%,transparent)}}.header.hide{display:none}.header .header-row{display:flex;flex-direction:row;padding-block:calc(var(--spacing, .25rem) * 3)}.header .header-cell{position:relative;display:flex;align-items:center;white-space:nowrap}.header .header-cell .header-text{min-width:0px;flex-grow:1;overflow:hidden;text-overflow:ellipsis}.header .header-cell:not(.selection){flex:none}.header .header-cell.selection{display:flex;align-items:center}.header .header-cell.align-center{text-align:center}.header .header-cell.align-end{text-align:end}.header .resize-handle{position:absolute;top:0;bottom:0;z-index:1;cursor:col-resize;touch-action:none;inset-inline-end:-.875rem;width:.75rem}.header .resize-handle:after{position:absolute;top:0;bottom:0;opacity:0%;content:\"\";inset-inline-start:calc(50% - 1px);width:2px;background-color:var(--color-line-strong);transition:opacity var(--duration-short) var(--ease-standard)}.header .resize-handle:hover:after,.header .resize-handle:active:after,.header .resize-handle:focus-visible:after{opacity:100%}.header .resize-handle:focus-visible{outline:var(--focus-ring-width) solid var(--color-focus-ring);outline-offset:calc(-1 * var(--focus-ring-width))}.column-chooser{display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 2);border-style:var(--tw-border-style);border-width:1px;padding:calc(var(--spacing, .25rem) * 2);min-width:12rem;max-height:20rem;border-color:var(--color-line);border-radius:var(--radius-control);background-color:var(--color-surface-solid);color:var(--color-content-primary);box-shadow:var(--shadow-overlay);font-size:var(--text-body)}.column-chooser-list{display:flex;flex-direction:column;overflow-y:auto}.column-chooser-option{display:flex;cursor:pointer;align-items:center;gap:calc(var(--spacing, .25rem) * 2);padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:var(--spacing, .25rem);white-space:nowrap;border-radius:var(--radius-control)}.column-chooser-option:hover{background-color:var(--state-hover)}.column-chooser-option:has(input:disabled){cursor:default;opacity:var(--opacity-disabled)}.column-chooser-reset{cursor:pointer;border-style:var(--tw-border-style);border-width:1px;padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:var(--spacing, .25rem);text-align:start;border-color:var(--color-line);border-radius:var(--radius-control)}.column-chooser-reset:hover{background-color:var(--state-hover)}.column-chooser-reset:focus-visible{outline:var(--focus-ring-width) solid var(--color-focus-ring);outline-offset:0}.footer{overflow:hidden;border-top-style:var(--tw-border-style);border-top-width:1px;padding-inline:calc(var(--spacing, .25rem) * 4);padding-block:calc(var(--spacing, .25rem) * 1.5);text-overflow:ellipsis;white-space:nowrap;border-color:var(--color-line);color:var(--color-content-secondary);font-size:var(--text-caption);font-variant-numeric:tabular-nums}.body{position:relative;flex-grow:1}.body cdk-virtual-scroll-viewport{position:absolute;inset:0}.body cdk-virtual-scroll-viewport ::ng-deep .cdk-virtual-scroll-content-wrapper{display:grid;grid-template-columns:inherit}.body lib-data-grid-row{margin-top:-1px;cursor:pointer;border-block-style:var(--tw-border-style);border-block-width:1px;padding-block:calc(var(--spacing, .25rem) * 2);border-color:var(--color-line)}.body lib-data-grid-row.striped{background-color:var(--state-hover)}.body lib-data-grid-row:hover{background-color:var(--state-selected)}.body lib-data-grid-row.focused{z-index:1;border-color:var(--color-line-strong)}.body lib-data-grid-row:focus-visible{position:relative;z-index:20;outline:var(--focus-ring-width) solid var(--color-focus-ring);outline-offset:calc(-1 * var(--focus-ring-width))}.body lib-data-grid-row.selected{position:relative;z-index:10;background-color:var(--state-selected);border-color:var(--color-line-selected)}.body lib-data-grid-row.selected:hover{background-color:var(--state-selected)}.body .loading,.body .message{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);white-space:nowrap;height:calc(var(--spacing, .25rem) * 10);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-line);grid-column:1 / -1}.body .loading span,.body .message span{overflow:hidden;text-overflow:ellipsis}.body .loading svg{height:calc(var(--spacing, .25rem) * 6);min-height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);min-width:calc(var(--spacing, .25rem) * 6);animation:var(--animate-spin, spin 1s linear infinite);transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s));transition-duration:var(--duration-short);transition-timing-function:var(--ease-standard)}.buttons{display:flex;border-top-style:var(--tw-border-style);border-top-width:1px;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;padding:var(--spacing, .25rem);border-color:var(--color-line)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
5931
6369
  }]
5932
6370
  }],
5933
6371
  ctorParameters: () => [],
@@ -5940,6 +6378,14 @@ i0.ɵɵngDeclareClassMetadata({
5940
6378
  type: i0.ViewChild,
5941
6379
  args: [i0.forwardRef(() => CdkVirtualScrollViewport), { isSignal: true }]
5942
6380
  }],
6381
+ columnChooserButton: [{
6382
+ type: i0.ViewChild,
6383
+ args: ["columnChooserButton", { isSignal: true }]
6384
+ }],
6385
+ columnChooserTemplate: [{
6386
+ type: i0.ViewChild,
6387
+ args: ["columnChooserTemplate", { isSignal: true }]
6388
+ }],
5943
6389
  disabled: [{
5944
6390
  type: i0.Input,
5945
6391
  args: [{
@@ -7181,17 +7627,17 @@ var MultiSelectComponent = class MultiSelectComponent extends ModalComponent {
7181
7627
  },
7182
7628
  {
7183
7629
  kind: "directive",
7184
- type: i2$1.DefaultValueAccessor,
7630
+ type: i2$2.DefaultValueAccessor,
7185
7631
  selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
7186
7632
  },
7187
7633
  {
7188
7634
  kind: "directive",
7189
- type: i2$1.NgControlStatus,
7635
+ type: i2$2.NgControlStatus,
7190
7636
  selector: "[formControlName],[ngModel],[formControl]"
7191
7637
  },
7192
7638
  {
7193
7639
  kind: "directive",
7194
- type: i2$1.NgModel,
7640
+ type: i2$2.NgModel,
7195
7641
  selector: "[ngModel]:not([formControlName]):not([formControl])",
7196
7642
  inputs: [
7197
7643
  "name",
@@ -8379,7 +8825,12 @@ var DataGridConfigsProvider = class DataGridConfigsProvider extends GridConfigsP
8379
8825
  totalRowsText: "{{ count }} records",
8380
8826
  totalRowText: "{{ count }} record",
8381
8827
  booleanTrueText: "Yes",
8382
- booleanFalseText: "No"
8828
+ booleanFalseText: "No",
8829
+ columnChooser: false,
8830
+ columnChooserText: "Choose columns",
8831
+ resetColumnsText: "Reset columns",
8832
+ resizableColumns: false,
8833
+ resizeColumnText: "Resize {{ column }}"
8383
8834
  };
8384
8835
  }
8385
8836
  static ɵfac = i0.ɵɵngDeclareFactory({
@@ -8467,6 +8918,6 @@ var DateValidators = class {
8467
8918
  };
8468
8919
  }
8469
8920
  };
8470
- export { BadgeComponent, BaseComponent, BaseDataset, ButtonComponent, CalendarComponent, CatalogSelectComponent, CatalogService, DataGridComponent, DataGridConfigsProvider, DataGridDataset, DataGridRowComponent, DataProviderService, DateHelpers, DateInputComponent, DateValidators, DisplayControls, EnumTranslatePipe, FormGroupComponent, FormGroupService, FormInputComponent, FormInputGroupComponent, FormService, GridConfigsProvider, GridDataset, GroupAccordionComponent, GroupContainerComponent, GroupScrollSpyComponent, GuidHelper, LibraryModule, LocaleService, ModalComponent, MultiEditorComponent, MultiEditorDataset, MultiSelectComponent, MultiSelectResultDataset, MultiSelectResultGridComponent, NumberInputComponent, ReplaceManyPipe, ReplacePipe, RibbonButtonComponent, RibbonComponent, RibbonGroupChild, RibbonGroupComponent, RouterFormatter, SIDEBAR_CONFIGS, ScrollSpyDirective, SidebarComponent, SidebarConfigs, SidebarMenu, SidebarMenuOpenMode, SidebarService, SkeletonComponent, TooltipDirective, formatDateText, formatGridCellValue, formatLocaleNumber, formatTimeText, getDatePattern, getFirstDayOfWeek, getGridColumnAlign, getNumberSeparators, isNumericGridColumn, isValidLocale, parseDateText, parseDigitsInfo, parseIsoValue, parseLocaleNumber, parseTimeText, toIsoDate, toIsoDateTime, toSidebarMenuOpenMode, uses12HourClock };
8921
+ export { BadgeComponent, BaseComponent, BaseDataset, ButtonComponent, CalendarComponent, CatalogSelectComponent, CatalogService, DataGridComponent, DataGridConfigsProvider, DataGridDataset, DataGridRowComponent, DataProviderService, DateHelpers, DateInputComponent, DateValidators, DisplayControls, EnumTranslatePipe, FormGroupComponent, FormGroupService, FormInputComponent, FormInputGroupComponent, FormService, GridConfigsProvider, GridDataset, GroupAccordionComponent, GroupContainerComponent, GroupScrollSpyComponent, GuidHelper, LibraryModule, LocaleService, MIN_GRID_COLUMN_WIDTH, ModalComponent, MultiEditorComponent, MultiEditorDataset, MultiSelectComponent, MultiSelectResultDataset, MultiSelectResultGridComponent, NumberInputComponent, ReplaceManyPipe, ReplacePipe, RibbonButtonComponent, RibbonComponent, RibbonGroupChild, RibbonGroupComponent, RouterFormatter, SIDEBAR_CONFIGS, ScrollSpyDirective, SidebarComponent, SidebarConfigs, SidebarMenu, SidebarMenuOpenMode, SidebarService, SkeletonComponent, TooltipDirective, formatDateText, formatGridCellValue, formatLocaleNumber, formatTimeText, getDatePattern, getFirstDayOfWeek, getGridColumnAlign, getNumberSeparators, isNumericGridColumn, isValidLocale, parseDateText, parseDigitsInfo, parseIsoValue, parseLocaleNumber, parseTimeText, toIsoDate, toIsoDateTime, toSidebarMenuOpenMode, uses12HourClock };
8471
8922
 
8472
8923
  //# sourceMappingURL=zambon-dev-ui-library.mjs.map