@zambon-dev/ui 1.8.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -1
- package/fesm2022/zambon-dev-ui-framework.mjs +6 -1
- package/fesm2022/zambon-dev-ui-framework.mjs.map +1 -1
- package/fesm2022/zambon-dev-ui-library.mjs +648 -64
- package/fesm2022/zambon-dev-ui-library.mjs.map +1 -1
- package/i18n/framework/en.json +5 -0
- package/i18n/framework/pt.json +5 -0
- package/package.json +1 -1
- package/types/zambon-dev-ui-framework.d.ts +1 -1
- package/types/zambon-dev-ui-library.d.ts +356 -8
|
@@ -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$
|
|
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/
|
|
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 */ []);
|
|
@@ -1185,6 +1187,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1185
1187
|
decorators: [{ type: Injectable }],
|
|
1186
1188
|
ctorParameters: () => []
|
|
1187
1189
|
});
|
|
1190
|
+
const DEFAULT_GRID_ROW_HEIGHT = 41.6;
|
|
1191
|
+
const COMPACT_GRID_ROW_HEIGHT = 32;
|
|
1188
1192
|
var GridConfigsProvider = class GridConfigsProvider {
|
|
1189
1193
|
_configs;
|
|
1190
1194
|
get configs() {
|
|
@@ -1196,7 +1200,7 @@ var GridConfigsProvider = class GridConfigsProvider {
|
|
|
1196
1200
|
messageOnEmpty: "No results",
|
|
1197
1201
|
messageOnFailed: "The records could not be loaded.",
|
|
1198
1202
|
recordBlockSize: 100,
|
|
1199
|
-
rowHeight:
|
|
1203
|
+
rowHeight: DEFAULT_GRID_ROW_HEIGHT,
|
|
1200
1204
|
rowsToDisplay: 6
|
|
1201
1205
|
};
|
|
1202
1206
|
}
|
|
@@ -1441,12 +1445,23 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1441
1445
|
decorators: [{ type: Injectable }],
|
|
1442
1446
|
ctorParameters: () => []
|
|
1443
1447
|
});
|
|
1448
|
+
const MIN_GRID_COLUMN_WIDTH = 48;
|
|
1449
|
+
const COLUMNS_STATE_PREFIX = "zambon-dev.grid.";
|
|
1450
|
+
function columnsStorage() {
|
|
1451
|
+
try {
|
|
1452
|
+
return typeof localStorage === "undefined" ? null : localStorage;
|
|
1453
|
+
} catch {
|
|
1454
|
+
return null;
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1444
1457
|
var DataGridDataset = class DataGridDataset extends GridDataset {
|
|
1445
1458
|
rowActivated = new EventEmitter();
|
|
1446
1459
|
selectedRowsChanged = new EventEmitter();
|
|
1447
1460
|
configs;
|
|
1448
1461
|
columns;
|
|
1449
1462
|
_selectedRowKeys = [];
|
|
1463
|
+
hiddenFields = signal(null, ...ngDevMode ? [{ debugName: "hiddenFields" }] : /* istanbul ignore next */ []);
|
|
1464
|
+
columnWidths = signal({}, ...ngDevMode ? [{ debugName: "columnWidths" }] : /* istanbul ignore next */ []);
|
|
1450
1465
|
get selectedRowKeys() {
|
|
1451
1466
|
this.tracked();
|
|
1452
1467
|
return this._selectedRowKeys;
|
|
@@ -1458,9 +1473,21 @@ var DataGridDataset = class DataGridDataset extends GridDataset {
|
|
|
1458
1473
|
get columnsSize() {
|
|
1459
1474
|
const sizes = [];
|
|
1460
1475
|
if (this.configs.multiSelect) sizes.push(this.configs.multiSelectSize ?? "min-content");
|
|
1461
|
-
sizes.push(...this.
|
|
1476
|
+
sizes.push(...this.visibleColumns.map((col) => {
|
|
1477
|
+
const width = this.getColumnWidth(col.field);
|
|
1478
|
+
if (width !== void 0 && col.type !== "actions") return `${width}px`;
|
|
1479
|
+
return col.size ?? (col.type === "actions" ? "min-content" : "minmax(0,1fr)");
|
|
1480
|
+
}));
|
|
1462
1481
|
return sizes.join(" ");
|
|
1463
1482
|
}
|
|
1483
|
+
get visibleColumns() {
|
|
1484
|
+
return (this.columns ?? []).filter((column) => !this.isColumnHidden(column));
|
|
1485
|
+
}
|
|
1486
|
+
get effectiveRowHeight() {
|
|
1487
|
+
const rowHeight = this.configs.rowHeight ?? 41.6;
|
|
1488
|
+
if (this.configs.density === "compact" && rowHeight === 41.6) return 32;
|
|
1489
|
+
return rowHeight;
|
|
1490
|
+
}
|
|
1464
1491
|
get hasSelectedRows() {
|
|
1465
1492
|
return this.selectedRowKeys.length > 0;
|
|
1466
1493
|
}
|
|
@@ -1481,6 +1508,84 @@ var DataGridDataset = class DataGridDataset extends GridDataset {
|
|
|
1481
1508
|
return keys;
|
|
1482
1509
|
}, {}));
|
|
1483
1510
|
}
|
|
1511
|
+
isColumnHideable(column) {
|
|
1512
|
+
return column.hideable ?? column.type !== "actions";
|
|
1513
|
+
}
|
|
1514
|
+
isColumnHidden(column) {
|
|
1515
|
+
if (!this.isColumnHideable(column)) return false;
|
|
1516
|
+
const hidden = this.hiddenFields?.() ?? null;
|
|
1517
|
+
return hidden === null ? column.hidden === true : hidden.includes(column.field);
|
|
1518
|
+
}
|
|
1519
|
+
canHideColumn(column) {
|
|
1520
|
+
return this.isColumnHideable(column) && !this.isColumnHidden(column) && this.visibleColumns.some((other) => other.field !== column.field && other.type !== "actions");
|
|
1521
|
+
}
|
|
1522
|
+
setColumnHidden(field, hidden) {
|
|
1523
|
+
const column = (this.columns ?? []).find((col) => col.field === field);
|
|
1524
|
+
if (!column || !this.isColumnHideable(column) || this.isColumnHidden(column) === hidden) return;
|
|
1525
|
+
if (hidden && !this.canHideColumn(column)) return;
|
|
1526
|
+
const current = this.hiddenColumnFields();
|
|
1527
|
+
this.hiddenFields.set(hidden ? [...current, field] : current.filter((other) => other !== field));
|
|
1528
|
+
this.saveColumnsState();
|
|
1529
|
+
}
|
|
1530
|
+
getColumnWidth(field) {
|
|
1531
|
+
return this.columnWidths?.()[field];
|
|
1532
|
+
}
|
|
1533
|
+
setColumnWidth(field, width, save = true) {
|
|
1534
|
+
const column = (this.columns ?? []).find((col) => col.field === field);
|
|
1535
|
+
if (!column || column.type === "actions") return;
|
|
1536
|
+
const widths = { ...this.columnWidths() };
|
|
1537
|
+
if (width === null) {
|
|
1538
|
+
if (!(field in widths)) return;
|
|
1539
|
+
delete widths[field];
|
|
1540
|
+
} else {
|
|
1541
|
+
const next = Math.max(48, Math.round(width));
|
|
1542
|
+
if (widths[field] === next) return;
|
|
1543
|
+
widths[field] = next;
|
|
1544
|
+
}
|
|
1545
|
+
this.columnWidths.set(widths);
|
|
1546
|
+
if (save) this.saveColumnsState();
|
|
1547
|
+
}
|
|
1548
|
+
resetColumns() {
|
|
1549
|
+
this.hiddenFields.set(null);
|
|
1550
|
+
this.columnWidths.set({});
|
|
1551
|
+
const key = this.columnsStorageKey;
|
|
1552
|
+
if (key) try {
|
|
1553
|
+
columnsStorage()?.removeItem(key);
|
|
1554
|
+
} catch {}
|
|
1555
|
+
}
|
|
1556
|
+
restoreColumnsState() {
|
|
1557
|
+
const key = this.columnsStorageKey;
|
|
1558
|
+
if (!key) return;
|
|
1559
|
+
let state;
|
|
1560
|
+
try {
|
|
1561
|
+
const stored = columnsStorage()?.getItem(key);
|
|
1562
|
+
state = stored ? JSON.parse(stored) : null;
|
|
1563
|
+
} catch {
|
|
1564
|
+
state = null;
|
|
1565
|
+
}
|
|
1566
|
+
if (!state || typeof state !== "object") return;
|
|
1567
|
+
const columns = this.columns ?? [];
|
|
1568
|
+
if (Array.isArray(state.hidden)) {
|
|
1569
|
+
const hidden = state.hidden.filter((field) => typeof field === "string" && columns.some((column) => column.field === field && this.isColumnHideable(column)));
|
|
1570
|
+
if (columns.some((column) => column.type !== "actions" && (!this.isColumnHideable(column) || !hidden.includes(column.field)))) this.hiddenFields.set(hidden);
|
|
1571
|
+
}
|
|
1572
|
+
if (state.widths && typeof state.widths === "object" && !Array.isArray(state.widths)) {
|
|
1573
|
+
const widths = {};
|
|
1574
|
+
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));
|
|
1575
|
+
this.columnWidths.set(widths);
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
saveColumnsState() {
|
|
1579
|
+
const key = this.columnsStorageKey;
|
|
1580
|
+
if (!key) return;
|
|
1581
|
+
const state = {
|
|
1582
|
+
hidden: this.hiddenColumnFields(),
|
|
1583
|
+
widths: { ...this.columnWidths() }
|
|
1584
|
+
};
|
|
1585
|
+
try {
|
|
1586
|
+
columnsStorage()?.setItem(key, JSON.stringify(state));
|
|
1587
|
+
} catch {}
|
|
1588
|
+
}
|
|
1484
1589
|
export(_format, _parameters) {
|
|
1485
1590
|
return throwError(() => /* @__PURE__ */ new Error(`Export is not implemented for ${this.constructor.name}.`));
|
|
1486
1591
|
}
|
|
@@ -1555,6 +1660,10 @@ var DataGridDataset = class DataGridDataset extends GridDataset {
|
|
|
1555
1660
|
}, {}));
|
|
1556
1661
|
}
|
|
1557
1662
|
}
|
|
1663
|
+
moveFocusedRow(key) {
|
|
1664
|
+
if (this.configs.multiSelect) super.setFocusedRow(key);
|
|
1665
|
+
else this.setFocusedRow(key);
|
|
1666
|
+
}
|
|
1558
1667
|
setFocusedRow(key) {
|
|
1559
1668
|
super.setFocusedRow(key);
|
|
1560
1669
|
if (!this.configs.multiSelect) this.selectRow(key);
|
|
@@ -1563,6 +1672,13 @@ var DataGridDataset = class DataGridDataset extends GridDataset {
|
|
|
1563
1672
|
else this.selectRow(key);
|
|
1564
1673
|
}
|
|
1565
1674
|
}
|
|
1675
|
+
get columnsStorageKey() {
|
|
1676
|
+
const key = this.configs?.columnsStateKey;
|
|
1677
|
+
return key ? `${COLUMNS_STATE_PREFIX}${key}` : null;
|
|
1678
|
+
}
|
|
1679
|
+
hiddenColumnFields() {
|
|
1680
|
+
return (this.columns ?? []).filter((column) => this.isColumnHidden(column)).map((column) => column.field).filter((field, index, fields) => fields.indexOf(field) === index);
|
|
1681
|
+
}
|
|
1566
1682
|
removeSelectedRow(key) {
|
|
1567
1683
|
const index = this.selectedRowKeys.indexOf(key);
|
|
1568
1684
|
if (index >= 0) {
|
|
@@ -3282,22 +3398,22 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
|
|
|
3282
3398
|
},
|
|
3283
3399
|
{
|
|
3284
3400
|
kind: "directive",
|
|
3285
|
-
type: i2$
|
|
3401
|
+
type: i2$2.DefaultValueAccessor,
|
|
3286
3402
|
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
3403
|
},
|
|
3288
3404
|
{
|
|
3289
3405
|
kind: "directive",
|
|
3290
|
-
type: i2$
|
|
3406
|
+
type: i2$2.CheckboxControlValueAccessor,
|
|
3291
3407
|
selector: "input[type=checkbox]:not([ngNoCva])[formControlName],input[type=checkbox]:not([ngNoCva])[formControl],input[type=checkbox]:not([ngNoCva])[ngModel]"
|
|
3292
3408
|
},
|
|
3293
3409
|
{
|
|
3294
3410
|
kind: "directive",
|
|
3295
|
-
type: i2$
|
|
3411
|
+
type: i2$2.NgControlStatus,
|
|
3296
3412
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
3297
3413
|
},
|
|
3298
3414
|
{
|
|
3299
3415
|
kind: "directive",
|
|
3300
|
-
type: i2$
|
|
3416
|
+
type: i2$2.NgModel,
|
|
3301
3417
|
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
3302
3418
|
inputs: [
|
|
3303
3419
|
"name",
|
|
@@ -3338,7 +3454,7 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
|
|
|
3338
3454
|
},
|
|
3339
3455
|
{
|
|
3340
3456
|
kind: "directive",
|
|
3341
|
-
type: i2$
|
|
3457
|
+
type: i2$2.FormControlName,
|
|
3342
3458
|
selector: "[formControlName]",
|
|
3343
3459
|
inputs: [
|
|
3344
3460
|
"formControlName",
|
|
@@ -5317,13 +5433,20 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
|
|
|
5317
5433
|
this.refreshSelection();
|
|
5318
5434
|
}
|
|
5319
5435
|
rowIndex = input(0, ...ngDevMode ? [{ debugName: "rowIndex" }] : /* istanbul ignore next */ []);
|
|
5436
|
+
tabbable = input(false, ...ngDevMode ? [{ debugName: "tabbable" }] : /* istanbul ignore next */ []);
|
|
5320
5437
|
selectionResized = new EventEmitter();
|
|
5321
|
-
setFocus() {
|
|
5438
|
+
setFocus(event) {
|
|
5439
|
+
if (event?.target instanceof HTMLLabelElement && event.target.classList.contains("selection-target")) return;
|
|
5440
|
+
if (this.hasTextSelectionInGrid()) return;
|
|
5322
5441
|
if (!this.disabled) {
|
|
5323
5442
|
this.dataGridDataset.setFocusedRow(this.rowKey);
|
|
5324
5443
|
if (this.dataGridDataset.configs.multiSelect && (this.dataGridDataset.configs.selectOnClick ?? true)) this.selected.set(this.isRowDataSelected);
|
|
5325
5444
|
}
|
|
5326
5445
|
}
|
|
5446
|
+
preventMultiClickSelection(event) {
|
|
5447
|
+
const target = event.target;
|
|
5448
|
+
if (event.detail > 1 && !(target instanceof HTMLInputElement || target instanceof HTMLButtonElement)) event.preventDefault();
|
|
5449
|
+
}
|
|
5327
5450
|
activate() {
|
|
5328
5451
|
if (!this.disabled) this.dataGridDataset.rowActivated.emit(this.rowData);
|
|
5329
5452
|
}
|
|
@@ -5335,8 +5458,11 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
|
|
|
5335
5458
|
get rowData() {
|
|
5336
5459
|
return this._rowData;
|
|
5337
5460
|
}
|
|
5461
|
+
get ariaRowIndex() {
|
|
5462
|
+
return this.rowIndex() + (this.dataGridDataset.configs.hideColumnHeaders ? 1 : 2);
|
|
5463
|
+
}
|
|
5338
5464
|
get columns() {
|
|
5339
|
-
return this.dataGridDataset.
|
|
5465
|
+
return this.dataGridDataset.visibleColumns;
|
|
5340
5466
|
}
|
|
5341
5467
|
get isLaidOut() {
|
|
5342
5468
|
return (this.elementRef.nativeElement?.getBoundingClientRect().width ?? 0) > 0;
|
|
@@ -5347,6 +5473,9 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
|
|
|
5347
5473
|
get rowKey() {
|
|
5348
5474
|
return this.dataGridDataset.getRowInternalKey(this.rowData);
|
|
5349
5475
|
}
|
|
5476
|
+
get pinFirstColumn() {
|
|
5477
|
+
return this.dataGridDataset.configs.pinFirstColumn ?? false;
|
|
5478
|
+
}
|
|
5350
5479
|
get selectRowText() {
|
|
5351
5480
|
return this.dataGridDataset.configs.selectRowText ?? DEFAULT_SELECT_ROW_TEXT;
|
|
5352
5481
|
}
|
|
@@ -5364,16 +5493,17 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
|
|
|
5364
5493
|
if (this.disabled || this.isActionDisabled(action)) return;
|
|
5365
5494
|
action.handler(this.rowData);
|
|
5366
5495
|
}
|
|
5367
|
-
onResize(
|
|
5496
|
+
onResize(column, event) {
|
|
5368
5497
|
const width = event.contentRect.width;
|
|
5369
5498
|
if (width <= 0 && !this.isLaidOut) return;
|
|
5370
|
-
if (
|
|
5499
|
+
if (column.realSize !== width) column.realSize = width;
|
|
5371
5500
|
}
|
|
5372
5501
|
onResizeSelection(event) {
|
|
5373
5502
|
const width = event.contentRect.width;
|
|
5374
5503
|
this.selectionResized.emit(width);
|
|
5375
5504
|
}
|
|
5376
|
-
onToggleSelection() {
|
|
5505
|
+
onToggleSelection(event) {
|
|
5506
|
+
if (!(event.target instanceof HTMLInputElement)) return;
|
|
5377
5507
|
if (this.disabled || this.dataGridDataset.configs.multiSelect && (this.dataGridDataset.configs.selectOnClick ?? true)) return;
|
|
5378
5508
|
this.selected.update((isSelected) => !isSelected);
|
|
5379
5509
|
if (this.selected()) this.dataGridDataset.selectRow(this.rowKey);
|
|
@@ -5401,6 +5531,13 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
|
|
|
5401
5531
|
getValue(field) {
|
|
5402
5532
|
return field.split(".").reduce((value, field) => value?.[field], this.rowData);
|
|
5403
5533
|
}
|
|
5534
|
+
hasTextSelectionInGrid() {
|
|
5535
|
+
const host = this.elementRef.nativeElement;
|
|
5536
|
+
const selection = host.ownerDocument?.getSelection?.() ?? null;
|
|
5537
|
+
if (!selection || selection.isCollapsed || selection.toString().trim() === "") return false;
|
|
5538
|
+
const grid = host.closest("lib-data-grid") ?? host;
|
|
5539
|
+
return grid.contains(selection.anchorNode) || grid.contains(selection.focusNode);
|
|
5540
|
+
}
|
|
5404
5541
|
refreshSelection() {
|
|
5405
5542
|
this.selected.set(this.isRowDataSelected);
|
|
5406
5543
|
}
|
|
@@ -5446,24 +5583,37 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
|
|
|
5446
5583
|
isSignal: true,
|
|
5447
5584
|
isRequired: false,
|
|
5448
5585
|
transformFunction: null
|
|
5586
|
+
},
|
|
5587
|
+
tabbable: {
|
|
5588
|
+
classPropertyName: "tabbable",
|
|
5589
|
+
publicName: "tabbable",
|
|
5590
|
+
isSignal: true,
|
|
5591
|
+
isRequired: false,
|
|
5592
|
+
transformFunction: null
|
|
5449
5593
|
}
|
|
5450
5594
|
},
|
|
5451
5595
|
outputs: { selectionResized: "selectionResized" },
|
|
5452
5596
|
host: {
|
|
5597
|
+
attributes: { "role": "row" },
|
|
5453
5598
|
listeners: {
|
|
5454
|
-
"click": "setFocus()",
|
|
5599
|
+
"click": "setFocus($event)",
|
|
5600
|
+
"mousedown": "preventMultiClickSelection($event)",
|
|
5455
5601
|
"dblclick": "activate()"
|
|
5456
5602
|
},
|
|
5457
5603
|
properties: {
|
|
5458
|
-
"
|
|
5604
|
+
"attr.aria-rowindex": "ariaRowIndex",
|
|
5605
|
+
"attr.aria-selected": "dataGridDataset.isKeySelected(rowKey)",
|
|
5606
|
+
"attr.data-row-index": "rowIndex()",
|
|
5607
|
+
"attr.tabindex": "disabled ? null : tabbable() ? 0 : -1",
|
|
5608
|
+
"class.focused": "dataGridDataset.focusedRowKey === rowKey",
|
|
5459
5609
|
"class.selected": "dataGridDataset.isKeySelected(rowKey)",
|
|
5460
5610
|
"class.striped": "rowIndex() % 2 === 1"
|
|
5461
5611
|
}
|
|
5462
5612
|
},
|
|
5463
5613
|
usesInheritance: true,
|
|
5464
5614
|
ngImport: i0,
|
|
5465
|
-
template: "<!--
|
|
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"],
|
|
5615
|
+
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 [class.pinned]=\"pinFirstColumn\"\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; let first = $first) {\n <!-- With pinFirstColumn, the first data column, and the selection column before it, stay in place\n while the rows scroll sideways. -->\n <div\n #cell\n class=\"cell\"\n role=\"gridcell\"\n [class.pinned]=\"pinFirstColumn && first\"\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",
|
|
5616
|
+
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;-webkit-user-select:text;user-select:text}.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;-webkit-user-select:none;user-select:none}.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;-webkit-user-select:none;user-select:none}.cell.pinned{position:sticky;z-index:1;inset-inline-start:0;margin-inline-start:-1rem;padding-inline-start:1rem;background:linear-gradient(var(--grid-pinned-tint, transparent),var(--grid-pinned-tint, transparent)),var(--color-surface-solid)}.cell.selection.pinned~.cell.pinned{inset-inline-start:var(--grid-pin-offset, 0px)}.cell.pinned:not(.selection){box-shadow:1px 0 0 var(--color-line-strong)}.cell.pinned:not(.selection):dir(rtl){box-shadow:-1px 0 0 var(--color-line-strong)}:host(.striped){--grid-pinned-tint: var(--state-hover)}:host(:hover),:host(.selected){--grid-pinned-tint: var(--state-selected)}:host(:focus-visible) .cell.pinned:first-child{box-shadow:inset var(--focus-ring-width) 0 0 var(--color-focus-ring)}:host(:focus-visible) .cell.pinned:first-child:not(.selection){box-shadow:inset var(--focus-ring-width) 0 0 var(--color-focus-ring),1px 0 0 var(--color-line-strong)}.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
5617
|
dependencies: [
|
|
5468
5618
|
{
|
|
5469
5619
|
kind: "component",
|
|
@@ -5481,17 +5631,17 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
|
|
|
5481
5631
|
},
|
|
5482
5632
|
{
|
|
5483
5633
|
kind: "directive",
|
|
5484
|
-
type: i2$
|
|
5634
|
+
type: i2$2.CheckboxControlValueAccessor,
|
|
5485
5635
|
selector: "input[type=checkbox]:not([ngNoCva])[formControlName],input[type=checkbox]:not([ngNoCva])[formControl],input[type=checkbox]:not([ngNoCva])[ngModel]"
|
|
5486
5636
|
},
|
|
5487
5637
|
{
|
|
5488
5638
|
kind: "directive",
|
|
5489
|
-
type: i2$
|
|
5639
|
+
type: i2$2.NgControlStatus,
|
|
5490
5640
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
5491
5641
|
},
|
|
5492
5642
|
{
|
|
5493
5643
|
kind: "directive",
|
|
5494
|
-
type: i2$
|
|
5644
|
+
type: i2$2.NgModel,
|
|
5495
5645
|
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
5496
5646
|
inputs: [
|
|
5497
5647
|
"name",
|
|
@@ -5524,7 +5674,7 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
|
|
|
5524
5674
|
},
|
|
5525
5675
|
{
|
|
5526
5676
|
kind: "directive",
|
|
5527
|
-
type: i2.NgxResizeObserverDirective,
|
|
5677
|
+
type: i2$1.NgxResizeObserverDirective,
|
|
5528
5678
|
selector: "[onResize]",
|
|
5529
5679
|
inputs: ["resizeBoxModel"],
|
|
5530
5680
|
outputs: ["onResize"]
|
|
@@ -5559,7 +5709,12 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5559
5709
|
args: [{
|
|
5560
5710
|
selector: "lib-data-grid-row",
|
|
5561
5711
|
host: {
|
|
5562
|
-
|
|
5712
|
+
role: "row",
|
|
5713
|
+
"[attr.aria-rowindex]": "ariaRowIndex",
|
|
5714
|
+
"[attr.aria-selected]": "dataGridDataset.isKeySelected(rowKey)",
|
|
5715
|
+
"[attr.data-row-index]": "rowIndex()",
|
|
5716
|
+
"[attr.tabindex]": "disabled ? null : tabbable() ? 0 : -1",
|
|
5717
|
+
"[class.focused]": "dataGridDataset.focusedRowKey === rowKey",
|
|
5563
5718
|
"[class.selected]": "dataGridDataset.isKeySelected(rowKey)",
|
|
5564
5719
|
"[class.striped]": "rowIndex() % 2 === 1"
|
|
5565
5720
|
},
|
|
@@ -5573,8 +5728,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5573
5728
|
TooltipDirective,
|
|
5574
5729
|
TranslatePipe
|
|
5575
5730
|
],
|
|
5576
|
-
template: "<!--
|
|
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"]
|
|
5731
|
+
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 [class.pinned]=\"pinFirstColumn\"\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; let first = $first) {\n <!-- With pinFirstColumn, the first data column, and the selection column before it, stay in place\n while the rows scroll sideways. -->\n <div\n #cell\n class=\"cell\"\n role=\"gridcell\"\n [class.pinned]=\"pinFirstColumn && first\"\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",
|
|
5732
|
+
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;-webkit-user-select:text;user-select:text}.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;-webkit-user-select:none;user-select:none}.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;-webkit-user-select:none;user-select:none}.cell.pinned{position:sticky;z-index:1;inset-inline-start:0;margin-inline-start:-1rem;padding-inline-start:1rem;background:linear-gradient(var(--grid-pinned-tint, transparent),var(--grid-pinned-tint, transparent)),var(--color-surface-solid)}.cell.selection.pinned~.cell.pinned{inset-inline-start:var(--grid-pin-offset, 0px)}.cell.pinned:not(.selection){box-shadow:1px 0 0 var(--color-line-strong)}.cell.pinned:not(.selection):dir(rtl){box-shadow:-1px 0 0 var(--color-line-strong)}:host(.striped){--grid-pinned-tint: var(--state-hover)}:host(:hover),:host(.selected){--grid-pinned-tint: var(--state-selected)}:host(:focus-visible) .cell.pinned:first-child{box-shadow:inset var(--focus-ring-width) 0 0 var(--color-focus-ring)}:host(:focus-visible) .cell.pinned:first-child:not(.selection){box-shadow:inset var(--focus-ring-width) 0 0 var(--color-focus-ring),1px 0 0 var(--color-line-strong)}.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
5733
|
}]
|
|
5579
5734
|
}],
|
|
5580
5735
|
ctorParameters: () => [],
|
|
@@ -5590,10 +5745,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5590
5745
|
required: false
|
|
5591
5746
|
}]
|
|
5592
5747
|
}],
|
|
5748
|
+
tabbable: [{
|
|
5749
|
+
type: i0.Input,
|
|
5750
|
+
args: [{
|
|
5751
|
+
isSignal: true,
|
|
5752
|
+
alias: "tabbable",
|
|
5753
|
+
required: false
|
|
5754
|
+
}]
|
|
5755
|
+
}],
|
|
5593
5756
|
selectionResized: [{ type: Output }],
|
|
5594
5757
|
setFocus: [{
|
|
5595
5758
|
type: HostListener,
|
|
5596
|
-
args: ["click"]
|
|
5759
|
+
args: ["click", ["$event"]]
|
|
5760
|
+
}],
|
|
5761
|
+
preventMultiClickSelection: [{
|
|
5762
|
+
type: HostListener,
|
|
5763
|
+
args: ["mousedown", ["$event"]]
|
|
5597
5764
|
}],
|
|
5598
5765
|
activate: [{
|
|
5599
5766
|
type: HostListener,
|
|
@@ -5604,9 +5771,21 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5604
5771
|
const DEFAULT_TOTAL_ROWS_TEXT = "{{ count }} records";
|
|
5605
5772
|
const DEFAULT_TOTAL_ROW_TEXT = "{{ count }} record";
|
|
5606
5773
|
const DEFAULT_SELECT_ALL_TEXT = "Select all rows";
|
|
5774
|
+
const DEFAULT_COLUMN_CHOOSER_TEXT = "Choose columns";
|
|
5775
|
+
const DEFAULT_RESET_COLUMNS_TEXT = "Reset columns";
|
|
5776
|
+
const DEFAULT_RESIZE_COLUMN_TEXT = "Resize {{ column }}";
|
|
5777
|
+
const DEFAULT_COPIED_TEXT = "Copied {{ count }} rows";
|
|
5778
|
+
const DEFAULT_COPIED_ROW_TEXT = "Copied 1 row";
|
|
5779
|
+
const COPIED_ANNOUNCEMENT_TIME = 5e3;
|
|
5780
|
+
const RESIZE_STEP = 16;
|
|
5781
|
+
const ROW_CELL_GAP = 16;
|
|
5782
|
+
const PINNED_CELL_BLEED = 16;
|
|
5783
|
+
let nextColumnChooserId = 0;
|
|
5607
5784
|
var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
5608
5785
|
bodyElement = viewChild("body", ...ngDevMode ? [{ debugName: "bodyElement" }] : /* istanbul ignore next */ []);
|
|
5609
5786
|
viewport = viewChild(CdkVirtualScrollViewport, ...ngDevMode ? [{ debugName: "viewport" }] : /* istanbul ignore next */ []);
|
|
5787
|
+
columnChooserButton = viewChild("columnChooserButton", ...ngDevMode ? [{ debugName: "columnChooserButton" }] : /* istanbul ignore next */ []);
|
|
5788
|
+
columnChooserTemplate = viewChild("columnChooserTemplate", ...ngDevMode ? [{ debugName: "columnChooserTemplate" }] : /* istanbul ignore next */ []);
|
|
5610
5789
|
disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
5611
5790
|
lazyLoadRows = input(false, ...ngDevMode ? [{ debugName: "lazyLoadRows" }] : /* istanbul ignore next */ []);
|
|
5612
5791
|
showButtons = input(false, ...ngDevMode ? [{ debugName: "showButtons" }] : /* istanbul ignore next */ []);
|
|
@@ -5614,25 +5793,78 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
|
5614
5793
|
hasFailed = signal(false, ...ngDevMode ? [{ debugName: "hasFailed" }] : /* istanbul ignore next */ []);
|
|
5615
5794
|
headerRightMargin = signal(0, ...ngDevMode ? [{ debugName: "headerRightMargin" }] : /* istanbul ignore next */ []);
|
|
5616
5795
|
headerScrollLeft = signal(0, ...ngDevMode ? [{ debugName: "headerScrollLeft" }] : /* istanbul ignore next */ []);
|
|
5796
|
+
horizontalScrollbarHeight = signal(0, ...ngDevMode ? [{ debugName: "horizontalScrollbarHeight" }] : /* istanbul ignore next */ []);
|
|
5797
|
+
copiedCount = signal(null, ...ngDevMode ? [{ debugName: "copiedCount" }] : /* istanbul ignore next */ []);
|
|
5617
5798
|
loading = signal(false, ...ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []);
|
|
5799
|
+
columnChooserOpen = signal(false, ...ngDevMode ? [{ debugName: "columnChooserOpen" }] : /* istanbul ignore next */ []);
|
|
5800
|
+
columnChooserId = `lib-data-grid-columns-${nextColumnChooserId++}`;
|
|
5801
|
+
minColumnWidth = 48;
|
|
5618
5802
|
bodyResized$ = new Subject();
|
|
5803
|
+
copiedTimer;
|
|
5804
|
+
pendingFocusKey = null;
|
|
5619
5805
|
bodyResizeObserver;
|
|
5806
|
+
contentResizeObserver;
|
|
5807
|
+
columnChooserRef;
|
|
5808
|
+
document = inject(DOCUMENT);
|
|
5809
|
+
injector = inject(Injector);
|
|
5810
|
+
overlay = inject(Overlay);
|
|
5811
|
+
platformId = inject(PLATFORM_ID);
|
|
5812
|
+
stopColumnResize;
|
|
5813
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
5620
5814
|
gridRoute = "";
|
|
5621
5815
|
isGridCurrentUrl = false;
|
|
5622
5816
|
lastPosition = 0;
|
|
5623
5817
|
localeService = inject(LocaleService);
|
|
5624
5818
|
ngZone = inject(NgZone);
|
|
5625
5819
|
router = inject(Router);
|
|
5820
|
+
translateService = inject(TranslateService);
|
|
5626
5821
|
selectionColRealSize;
|
|
5627
5822
|
get bodyMinHeight() {
|
|
5628
5823
|
let rowsToDisplay = this.configs.rowsToDisplay ?? 3;
|
|
5629
5824
|
let rowsCount = this.dataGridDataset.loadedRows?.length ?? 0;
|
|
5630
5825
|
if (rowsCount === 0) rowsCount = 1;
|
|
5631
5826
|
if (rowsCount < rowsToDisplay) rowsToDisplay = rowsCount;
|
|
5632
|
-
return rowsToDisplay * this.
|
|
5827
|
+
return rowsToDisplay * this.rowHeight + this.horizontalScrollbarHeight();
|
|
5828
|
+
}
|
|
5829
|
+
get rowHeight() {
|
|
5830
|
+
return this.dataGridDataset.effectiveRowHeight;
|
|
5831
|
+
}
|
|
5832
|
+
get pinFirstColumn() {
|
|
5833
|
+
return this.configs.pinFirstColumn ?? false;
|
|
5834
|
+
}
|
|
5835
|
+
get firstColumn() {
|
|
5836
|
+
return this.columns[0];
|
|
5837
|
+
}
|
|
5838
|
+
get pinOffset() {
|
|
5839
|
+
return this.pinFirstColumn && this.selectionColRealSize ? `${this.selectionColRealSize + PINNED_CELL_BLEED}px` : null;
|
|
5840
|
+
}
|
|
5841
|
+
get ariaRowCount() {
|
|
5842
|
+
const headerRows = this.isHideColumns ? 0 : 1;
|
|
5843
|
+
const totalRows = this.dataGridDataset.totalRows;
|
|
5844
|
+
if (typeof totalRows === "number") return totalRows + headerRows;
|
|
5845
|
+
if (this.dataGridDataset.loadedLastRow) return (this.dataGridDataset.loadedRows?.length ?? 0) + headerRows;
|
|
5846
|
+
return -1;
|
|
5633
5847
|
}
|
|
5634
5848
|
get columns() {
|
|
5635
|
-
return this.dataGridDataset.
|
|
5849
|
+
return this.dataGridDataset.visibleColumns;
|
|
5850
|
+
}
|
|
5851
|
+
get hideableColumns() {
|
|
5852
|
+
return this.dataGridDataset.columns.filter((column) => this.dataGridDataset.isColumnHideable(column));
|
|
5853
|
+
}
|
|
5854
|
+
get showColumnChooser() {
|
|
5855
|
+
return this.configs.columnChooser ?? false;
|
|
5856
|
+
}
|
|
5857
|
+
get columnChooserText() {
|
|
5858
|
+
return this.configs.columnChooserText ?? DEFAULT_COLUMN_CHOOSER_TEXT;
|
|
5859
|
+
}
|
|
5860
|
+
get resetColumnsText() {
|
|
5861
|
+
return this.configs.resetColumnsText ?? DEFAULT_RESET_COLUMNS_TEXT;
|
|
5862
|
+
}
|
|
5863
|
+
get resizeColumnText() {
|
|
5864
|
+
return this.configs.resizeColumnText ?? DEFAULT_RESIZE_COLUMN_TEXT;
|
|
5865
|
+
}
|
|
5866
|
+
get gridLabel() {
|
|
5867
|
+
return this.configs.gridLabel || null;
|
|
5636
5868
|
}
|
|
5637
5869
|
get configs() {
|
|
5638
5870
|
return this.dataGridDataset.configs;
|
|
@@ -5676,7 +5908,8 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
|
5676
5908
|
return this.configs.selectAllText ?? DEFAULT_SELECT_ALL_TEXT;
|
|
5677
5909
|
}
|
|
5678
5910
|
get selectionColWidth() {
|
|
5679
|
-
|
|
5911
|
+
if (!this.selectionColRealSize) return this.configs.multiSelectSize ?? "min-content";
|
|
5912
|
+
return `${this.selectionColRealSize + (this.pinFirstColumn ? PINNED_CELL_BLEED : 0)}px`;
|
|
5680
5913
|
}
|
|
5681
5914
|
get shouldShowTotalRows() {
|
|
5682
5915
|
const totalRows = this.dataGridDataset.totalRows;
|
|
@@ -5692,13 +5925,39 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
|
5692
5925
|
get shouldDisplayMessageWhenEmpty() {
|
|
5693
5926
|
return this.dataGridDataset?.configs?.showMessageOnEmpty ?? true;
|
|
5694
5927
|
}
|
|
5928
|
+
get statusText() {
|
|
5929
|
+
const copiedCount = this.copiedCount();
|
|
5930
|
+
if (copiedCount !== null) return copiedCount === 1 ? this.configs.copiedRowText ?? DEFAULT_COPIED_ROW_TEXT : this.configs.copiedText ?? DEFAULT_COPIED_TEXT;
|
|
5931
|
+
if (this.loading()) return this.configs.loadingDisplayText ?? "";
|
|
5932
|
+
if (!this.hasBeenLoaded && !this.hasFailed() && this.lazyLoadRows()) return this.messageToDisplayWhenLazyLoad;
|
|
5933
|
+
if (this.hasFailed()) return this.messageToDisplayWhenFailed;
|
|
5934
|
+
if (this.hasBeenLoaded && !this.hasLoadedRows && this.hasMessageToDisplayWhenEmpty && this.shouldDisplayMessageWhenEmpty) return this.messageToDisplayWhenEmpty;
|
|
5935
|
+
return "";
|
|
5936
|
+
}
|
|
5937
|
+
get tabbableRowKey() {
|
|
5938
|
+
const loadedKeys = this.dataGridDataset.loadedKeys ?? [];
|
|
5939
|
+
if (loadedKeys.length === 0) return;
|
|
5940
|
+
const range = this.viewport()?.getRenderedRange();
|
|
5941
|
+
const renderedRange = range && range.end > range.start ? range : void 0;
|
|
5942
|
+
const focusedKey = this.dataGridDataset.focusedRowKey;
|
|
5943
|
+
const focusedIndex = focusedKey === null ? -1 : loadedKeys.indexOf(focusedKey);
|
|
5944
|
+
if (focusedIndex >= 0 && (!renderedRange || focusedIndex >= renderedRange.start && focusedIndex < renderedRange.end)) return loadedKeys[focusedIndex];
|
|
5945
|
+
return loadedKeys[renderedRange && renderedRange.start < loadedKeys.length ? renderedRange.start : 0];
|
|
5946
|
+
}
|
|
5947
|
+
get pageSize() {
|
|
5948
|
+
const viewportHeight = this.viewport()?.measureViewportSize("vertical") ?? 0;
|
|
5949
|
+
const rows = Math.floor(viewportHeight / this.rowHeight);
|
|
5950
|
+
return Math.max(1, rows > 0 ? rows : this.configs.rowsToDisplay ?? 1);
|
|
5951
|
+
}
|
|
5695
5952
|
get isBodyAttached() {
|
|
5696
5953
|
return this.bodyElement()?.nativeElement?.isConnected ?? false;
|
|
5697
5954
|
}
|
|
5698
5955
|
constructor() {
|
|
5699
5956
|
super();
|
|
5957
|
+
afterEveryRender(() => this.focusPendingRow());
|
|
5700
5958
|
}
|
|
5701
5959
|
ngOnInit() {
|
|
5960
|
+
if (isPlatformBrowser(this.platformId)) this.dataGridDataset.restoreColumnsState();
|
|
5702
5961
|
this.gridRoute = this.router.url;
|
|
5703
5962
|
this.isGridCurrentUrl = true;
|
|
5704
5963
|
this.router.events.pipe(takeUntil(this.destroy$), filter((events) => events instanceof NavigationStart || events instanceof NavigationEnd)).subscribe((event) => {
|
|
@@ -5741,10 +6000,7 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
|
5741
6000
|
});
|
|
5742
6001
|
this.viewport()?.renderedRangeStream.pipe(takeUntil(this.destroy$)).subscribe((listRange) => {
|
|
5743
6002
|
const loadedRows = this.dataGridDataset.loadedRows?.length ?? 0;
|
|
5744
|
-
if (
|
|
5745
|
-
this.loading.set(true);
|
|
5746
|
-
this.dataGridDataset.loadRows();
|
|
5747
|
-
}
|
|
6003
|
+
if (listRange.end >= loadedRows) this.loadNextBlock();
|
|
5748
6004
|
});
|
|
5749
6005
|
this.bodyResized$.pipe(debounceTime(150), takeUntil(this.destroy$)).subscribe(() => {
|
|
5750
6006
|
if (!this.isBodyAttached) return;
|
|
@@ -5752,16 +6008,27 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
|
5752
6008
|
if (viewportWidth > 0) this.headerRightMargin.set(this.bodyElement().nativeElement.clientWidth - viewportWidth);
|
|
5753
6009
|
this.viewport()?.checkViewportSize();
|
|
5754
6010
|
this.syncHeaderScroll();
|
|
6011
|
+
this.measureHorizontalScrollbar();
|
|
5755
6012
|
});
|
|
5756
6013
|
this.ngZone.runOutsideAngular(() => {
|
|
5757
6014
|
this.bodyResizeObserver = new ResizeObserver(() => {
|
|
5758
6015
|
this.bodyResized$.next();
|
|
5759
6016
|
});
|
|
5760
6017
|
this.bodyResizeObserver.observe(this.bodyElement().nativeElement);
|
|
6018
|
+
const contentWrapper = viewportElement?.querySelector(".cdk-virtual-scroll-content-wrapper");
|
|
6019
|
+
if (contentWrapper) {
|
|
6020
|
+
this.contentResizeObserver = new ResizeObserver(() => this.measureHorizontalScrollbar());
|
|
6021
|
+
this.contentResizeObserver.observe(contentWrapper);
|
|
6022
|
+
}
|
|
5761
6023
|
});
|
|
5762
6024
|
}
|
|
5763
6025
|
ngOnDestroy() {
|
|
5764
6026
|
this.bodyResizeObserver?.disconnect();
|
|
6027
|
+
this.contentResizeObserver?.disconnect();
|
|
6028
|
+
this.stopColumnResize?.();
|
|
6029
|
+
this.columnChooserRef?.dispose();
|
|
6030
|
+
this.columnChooserRef = void 0;
|
|
6031
|
+
clearTimeout(this.copiedTimer);
|
|
5765
6032
|
super.ngOnDestroy();
|
|
5766
6033
|
}
|
|
5767
6034
|
onToggleSelectAll() {
|
|
@@ -5769,6 +6036,126 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
|
5769
6036
|
if (this.allRowsSelected) this.dataGridDataset.clearSelection();
|
|
5770
6037
|
else this.dataGridDataset.selectRows(this.dataGridDataset.loadedKeys ?? []);
|
|
5771
6038
|
}
|
|
6039
|
+
onKeydown(event) {
|
|
6040
|
+
if (this.disabled()) return;
|
|
6041
|
+
if (this.isCopyShortcut(event)) {
|
|
6042
|
+
this.onCopyKeydown(event);
|
|
6043
|
+
return;
|
|
6044
|
+
}
|
|
6045
|
+
if (event.altKey || event.ctrlKey || event.metaKey) return;
|
|
6046
|
+
const target = event.target;
|
|
6047
|
+
if (!(target instanceof HTMLElement) || target.tagName !== "LIB-DATA-GRID-ROW") return;
|
|
6048
|
+
const loadedKeys = this.dataGridDataset.loadedKeys ?? [];
|
|
6049
|
+
const index = Number(target.dataset["rowIndex"]);
|
|
6050
|
+
if (!Number.isInteger(index) || index < 0 || index >= loadedKeys.length) return;
|
|
6051
|
+
const lastIndex = loadedKeys.length - 1;
|
|
6052
|
+
let targetIndex;
|
|
6053
|
+
switch (event.key) {
|
|
6054
|
+
case "ArrowDown":
|
|
6055
|
+
targetIndex = Math.min(index + 1, lastIndex);
|
|
6056
|
+
break;
|
|
6057
|
+
case "ArrowUp":
|
|
6058
|
+
targetIndex = Math.max(index - 1, 0);
|
|
6059
|
+
break;
|
|
6060
|
+
case "Home":
|
|
6061
|
+
targetIndex = 0;
|
|
6062
|
+
break;
|
|
6063
|
+
case "End":
|
|
6064
|
+
targetIndex = lastIndex;
|
|
6065
|
+
break;
|
|
6066
|
+
case "PageDown":
|
|
6067
|
+
targetIndex = Math.min(index + this.pageSize, lastIndex);
|
|
6068
|
+
break;
|
|
6069
|
+
case "PageUp":
|
|
6070
|
+
targetIndex = Math.max(index - this.pageSize, 0);
|
|
6071
|
+
break;
|
|
6072
|
+
case " ":
|
|
6073
|
+
if (this.isShowMultiSelect) {
|
|
6074
|
+
event.preventDefault();
|
|
6075
|
+
this.toggleRowSelection(loadedKeys[index]);
|
|
6076
|
+
}
|
|
6077
|
+
return;
|
|
6078
|
+
case "Enter":
|
|
6079
|
+
event.preventDefault();
|
|
6080
|
+
this.dataGridDataset.rowActivated.emit(this.dataGridDataset.getRowData(loadedKeys[index]));
|
|
6081
|
+
return;
|
|
6082
|
+
default: return;
|
|
6083
|
+
}
|
|
6084
|
+
event.preventDefault();
|
|
6085
|
+
this.moveFocusTo(targetIndex, loadedKeys);
|
|
6086
|
+
}
|
|
6087
|
+
onCopyKeydown(event) {
|
|
6088
|
+
const target = event.target;
|
|
6089
|
+
if (!(target instanceof HTMLElement) || target.tagName !== "LIB-DATA-GRID-ROW" || this.hasTextSelection()) return;
|
|
6090
|
+
const loadedKeys = this.dataGridDataset.loadedKeys ?? [];
|
|
6091
|
+
const index = Number(target.dataset["rowIndex"]);
|
|
6092
|
+
if (!Number.isInteger(index) || index < 0 || index >= loadedKeys.length) return;
|
|
6093
|
+
const clipboard = this.document.defaultView?.navigator?.clipboard;
|
|
6094
|
+
if (typeof clipboard?.writeText !== "function") return;
|
|
6095
|
+
const selectedKeys = this.isShowMultiSelect ? loadedKeys.filter((key) => this.dataGridDataset.isKeySelected(key)) : [];
|
|
6096
|
+
const keys = selectedKeys.length > 0 ? selectedKeys : [loadedKeys[index]];
|
|
6097
|
+
event.preventDefault();
|
|
6098
|
+
clipboard.writeText(this.rowsAsText(keys)).then(() => this.announceCopied(keys.length), () => void 0);
|
|
6099
|
+
}
|
|
6100
|
+
onToggleColumnChooser() {
|
|
6101
|
+
if (this.columnChooserOpen()) this.closeColumnChooser(true);
|
|
6102
|
+
else this.openColumnChooser();
|
|
6103
|
+
}
|
|
6104
|
+
onColumnChooserKeydown(event) {
|
|
6105
|
+
if (event.key === "Escape") {
|
|
6106
|
+
event.preventDefault();
|
|
6107
|
+
event.stopPropagation();
|
|
6108
|
+
this.closeColumnChooser(true);
|
|
6109
|
+
}
|
|
6110
|
+
}
|
|
6111
|
+
onToggleColumn(column, event) {
|
|
6112
|
+
const checkbox = event.target;
|
|
6113
|
+
this.dataGridDataset.setColumnHidden(column.field, !checkbox.checked);
|
|
6114
|
+
checkbox.checked = !this.dataGridDataset.isColumnHidden(column);
|
|
6115
|
+
}
|
|
6116
|
+
onResetColumns() {
|
|
6117
|
+
this.dataGridDataset.resetColumns();
|
|
6118
|
+
}
|
|
6119
|
+
onResizeStart(event, column) {
|
|
6120
|
+
if (event.button !== 0) return;
|
|
6121
|
+
event.preventDefault();
|
|
6122
|
+
event.stopPropagation();
|
|
6123
|
+
this.stopColumnResize?.();
|
|
6124
|
+
const handle = event.currentTarget;
|
|
6125
|
+
const rtl = this.document.defaultView?.getComputedStyle(handle).direction === "rtl";
|
|
6126
|
+
const startX = event.clientX;
|
|
6127
|
+
const startWidth = this.currentColumnWidth(column, handle.parentElement);
|
|
6128
|
+
const field = column.field;
|
|
6129
|
+
const onMove = (moveEvent) => {
|
|
6130
|
+
const delta = (moveEvent.clientX - startX) * (rtl ? -1 : 1);
|
|
6131
|
+
this.dataGridDataset.setColumnWidth(field, startWidth + delta, false);
|
|
6132
|
+
};
|
|
6133
|
+
const onEnd = () => {
|
|
6134
|
+
this.document.removeEventListener("pointermove", onMove);
|
|
6135
|
+
this.document.removeEventListener("pointerup", onEnd);
|
|
6136
|
+
this.document.removeEventListener("pointercancel", onEnd);
|
|
6137
|
+
this.stopColumnResize = void 0;
|
|
6138
|
+
this.dataGridDataset.saveColumnsState();
|
|
6139
|
+
};
|
|
6140
|
+
this.ngZone.runOutsideAngular(() => {
|
|
6141
|
+
this.document.addEventListener("pointermove", onMove);
|
|
6142
|
+
this.document.addEventListener("pointerup", onEnd);
|
|
6143
|
+
this.document.addEventListener("pointercancel", onEnd);
|
|
6144
|
+
});
|
|
6145
|
+
this.stopColumnResize = onEnd;
|
|
6146
|
+
}
|
|
6147
|
+
onResizeKeydown(event, column) {
|
|
6148
|
+
if (event.key !== "ArrowRight" && event.key !== "ArrowLeft") return;
|
|
6149
|
+
event.preventDefault();
|
|
6150
|
+
event.stopPropagation();
|
|
6151
|
+
const handle = event.currentTarget;
|
|
6152
|
+
const step = event.key === "ArrowRight" ? RESIZE_STEP : -16;
|
|
6153
|
+
this.dataGridDataset.setColumnWidth(column.field, this.currentColumnWidth(column, handle.parentElement) + step);
|
|
6154
|
+
}
|
|
6155
|
+
onResizeReset(event, column) {
|
|
6156
|
+
event.stopPropagation();
|
|
6157
|
+
this.dataGridDataset.setColumnWidth(column.field, null);
|
|
6158
|
+
}
|
|
5772
6159
|
onSelectionResized(newSize) {
|
|
5773
6160
|
if (this.selectionColRealSize != newSize) this.selectionColRealSize = newSize;
|
|
5774
6161
|
}
|
|
@@ -5778,11 +6165,143 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
|
5778
6165
|
fillCount(text) {
|
|
5779
6166
|
return text.replace(/\{\{\s*count\s*\}\}/g, this.formattedTotalRows);
|
|
5780
6167
|
}
|
|
6168
|
+
get formattedCopiedCount() {
|
|
6169
|
+
return formatLocaleNumber(this.copiedCount() ?? 0, this.localeService.locale(), { maxFractionDigits: 0 });
|
|
6170
|
+
}
|
|
6171
|
+
fillCopiedCount(text) {
|
|
6172
|
+
return this.copiedCount() === null ? text : text.replace(/\{\{\s*count\s*\}\}/g, this.formattedCopiedCount);
|
|
6173
|
+
}
|
|
6174
|
+
pinnedHeaderTransform() {
|
|
6175
|
+
const scrollLeft = this.headerScrollLeft();
|
|
6176
|
+
return this.pinFirstColumn && scrollLeft ? `translateX(${scrollLeft}px)` : null;
|
|
6177
|
+
}
|
|
6178
|
+
headerWidth(column) {
|
|
6179
|
+
if (column.realSize !== void 0) return column.realSize;
|
|
6180
|
+
return column.type === "actions" ? null : this.dataGridDataset.getColumnWidth(column.field) ?? null;
|
|
6181
|
+
}
|
|
6182
|
+
isResizable(column) {
|
|
6183
|
+
return (this.configs.resizableColumns ?? false) && column.type !== "actions";
|
|
6184
|
+
}
|
|
6185
|
+
resizeValue(column) {
|
|
6186
|
+
return Math.round(this.currentColumnWidth(column, null));
|
|
6187
|
+
}
|
|
6188
|
+
fillColumn(text, columnName) {
|
|
6189
|
+
return text.replace(/\{\{\s*column\s*\}\}/g, columnName);
|
|
6190
|
+
}
|
|
5781
6191
|
isFirstVisibleRow(rowIndex) {
|
|
5782
6192
|
const renderedRange = this.viewport()?.getRenderedRange();
|
|
5783
6193
|
if (renderedRange) return rowIndex === renderedRange.start;
|
|
5784
6194
|
return false;
|
|
5785
6195
|
}
|
|
6196
|
+
announceCopied(count) {
|
|
6197
|
+
clearTimeout(this.copiedTimer);
|
|
6198
|
+
if (this.copiedCount() !== null) {
|
|
6199
|
+
this.copiedCount.set(null);
|
|
6200
|
+
this.copiedTimer = setTimeout(() => this.announceCopied(count), 100);
|
|
6201
|
+
return;
|
|
6202
|
+
}
|
|
6203
|
+
this.copiedCount.set(count);
|
|
6204
|
+
this.copiedTimer = setTimeout(() => this.copiedCount.set(null), COPIED_ANNOUNCEMENT_TIME);
|
|
6205
|
+
}
|
|
6206
|
+
cellText(rowData, column) {
|
|
6207
|
+
const cell = formatGridCellValue(column.field.split(".").reduce((current, field) => current?.[field], rowData), column, this.localeService.locale(), {
|
|
6208
|
+
trueText: this.configs.booleanTrueText ?? "Yes",
|
|
6209
|
+
falseText: this.configs.booleanFalseText ?? "No"
|
|
6210
|
+
});
|
|
6211
|
+
return (cell.translate ? String(this.translateService.instant(cell.text)) : cell.text).replace(/[\t\r\n]+/g, " ");
|
|
6212
|
+
}
|
|
6213
|
+
hasTextSelection() {
|
|
6214
|
+
const selection = this.document.getSelection?.() ?? null;
|
|
6215
|
+
return !!selection && !selection.isCollapsed && selection.toString().trim() !== "";
|
|
6216
|
+
}
|
|
6217
|
+
isCopyShortcut(event) {
|
|
6218
|
+
return (event.ctrlKey || event.metaKey) && !event.altKey && !event.shiftKey && event.key?.toLowerCase() === "c";
|
|
6219
|
+
}
|
|
6220
|
+
measureHorizontalScrollbar() {
|
|
6221
|
+
const viewportElement = this.viewport()?.elementRef?.nativeElement;
|
|
6222
|
+
if (!viewportElement || !this.isBodyAttached) return;
|
|
6223
|
+
const height = viewportElement.scrollWidth > viewportElement.clientWidth ? Math.max(0, viewportElement.offsetHeight - viewportElement.clientHeight) : 0;
|
|
6224
|
+
if (this.horizontalScrollbarHeight() !== height) this.horizontalScrollbarHeight.set(height);
|
|
6225
|
+
}
|
|
6226
|
+
rowsAsText(keys) {
|
|
6227
|
+
const columns = this.columns.filter((column) => column.type !== "actions");
|
|
6228
|
+
return keys.map((key) => {
|
|
6229
|
+
const rowData = this.dataGridDataset.getRowData(key);
|
|
6230
|
+
return columns.map((column) => this.cellText(rowData, column)).join(" ");
|
|
6231
|
+
}).join("\n");
|
|
6232
|
+
}
|
|
6233
|
+
openColumnChooser() {
|
|
6234
|
+
const button = this.columnChooserButton()?.nativeElement;
|
|
6235
|
+
const template = this.columnChooserTemplate();
|
|
6236
|
+
if (this.columnChooserOpen() || !button || !template) return;
|
|
6237
|
+
this.columnChooserRef = this.overlay.create({
|
|
6238
|
+
hasBackdrop: true,
|
|
6239
|
+
backdropClass: "cdk-overlay-transparent-backdrop",
|
|
6240
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
6241
|
+
positionStrategy: this.overlay.position().flexibleConnectedTo(button).withPush(true).withViewportMargin(8).withPositions([{
|
|
6242
|
+
originX: "end",
|
|
6243
|
+
originY: "bottom",
|
|
6244
|
+
overlayX: "end",
|
|
6245
|
+
overlayY: "top",
|
|
6246
|
+
offsetY: 4
|
|
6247
|
+
}, {
|
|
6248
|
+
originX: "end",
|
|
6249
|
+
originY: "top",
|
|
6250
|
+
overlayX: "end",
|
|
6251
|
+
overlayY: "bottom",
|
|
6252
|
+
offsetY: -4
|
|
6253
|
+
}])
|
|
6254
|
+
});
|
|
6255
|
+
this.columnChooserRef.backdropClick().subscribe(() => this.closeColumnChooser(true));
|
|
6256
|
+
this.columnChooserRef.attach(new TemplatePortal(template, this.viewContainerRef));
|
|
6257
|
+
this.columnChooserOpen.set(true);
|
|
6258
|
+
const overlayElement = this.columnChooserRef.overlayElement;
|
|
6259
|
+
afterNextRender(() => overlayElement.querySelector("input:not([disabled]), button:not([disabled])")?.focus(), { injector: this.injector });
|
|
6260
|
+
}
|
|
6261
|
+
closeColumnChooser(returnFocus) {
|
|
6262
|
+
if (!this.columnChooserOpen()) return;
|
|
6263
|
+
this.columnChooserRef?.dispose();
|
|
6264
|
+
this.columnChooserRef = void 0;
|
|
6265
|
+
this.columnChooserOpen.set(false);
|
|
6266
|
+
if (returnFocus) this.columnChooserButton()?.nativeElement.focus();
|
|
6267
|
+
}
|
|
6268
|
+
currentColumnWidth(column, headerCell) {
|
|
6269
|
+
const width = this.dataGridDataset.getColumnWidth(column.field);
|
|
6270
|
+
if (width !== void 0) return width;
|
|
6271
|
+
let cellWidth = column.realSize ?? headerCell?.getBoundingClientRect().width ?? 0;
|
|
6272
|
+
if (this.pinFirstColumn && column === this.firstColumn) cellWidth -= PINNED_CELL_BLEED;
|
|
6273
|
+
return Math.max(48, cellWidth + ROW_CELL_GAP);
|
|
6274
|
+
}
|
|
6275
|
+
focusPendingRow() {
|
|
6276
|
+
if (this.pendingFocusKey === null) return false;
|
|
6277
|
+
const index = this.dataGridDataset.loadedKeys?.indexOf(this.pendingFocusKey) ?? -1;
|
|
6278
|
+
if (index < 0) {
|
|
6279
|
+
this.pendingFocusKey = null;
|
|
6280
|
+
return false;
|
|
6281
|
+
}
|
|
6282
|
+
const rowElement = this.bodyElement()?.nativeElement.querySelector(`lib-data-grid-row[data-row-index="${index}"]`);
|
|
6283
|
+
if (!rowElement) return false;
|
|
6284
|
+
this.pendingFocusKey = null;
|
|
6285
|
+
rowElement.focus();
|
|
6286
|
+
return true;
|
|
6287
|
+
}
|
|
6288
|
+
loadNextBlock() {
|
|
6289
|
+
if (this.hasLoadedRows && !this.loading() && !this.dataGridDataset.loadedLastRow) {
|
|
6290
|
+
this.loading.set(true);
|
|
6291
|
+
this.dataGridDataset.loadRows();
|
|
6292
|
+
}
|
|
6293
|
+
}
|
|
6294
|
+
moveFocusTo(index, loadedKeys) {
|
|
6295
|
+
const key = loadedKeys[index];
|
|
6296
|
+
if (this.dataGridDataset.focusedRowKey !== key) this.dataGridDataset.moveFocusedRow(key);
|
|
6297
|
+
if (index >= loadedKeys.length - this.pageSize) this.loadNextBlock();
|
|
6298
|
+
this.pendingFocusKey = key;
|
|
6299
|
+
if (!this.focusPendingRow()) this.viewport()?.scrollToIndex(index);
|
|
6300
|
+
}
|
|
6301
|
+
toggleRowSelection(key) {
|
|
6302
|
+
if (this.dataGridDataset.isKeySelected(key)) this.dataGridDataset.deselectRow(key);
|
|
6303
|
+
else this.dataGridDataset.selectRow(key);
|
|
6304
|
+
}
|
|
5786
6305
|
syncHeaderScroll() {
|
|
5787
6306
|
const scrollLeft = this.viewport()?.elementRef?.nativeElement?.scrollLeft ?? 0;
|
|
5788
6307
|
if (this.headerScrollLeft() !== scrollLeft) this.headerScrollLeft.set(scrollLeft);
|
|
@@ -5829,26 +6348,57 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
|
5829
6348
|
},
|
|
5830
6349
|
host: { properties: {
|
|
5831
6350
|
"class.no-borders": "showButtons()",
|
|
5832
|
-
"class.hide-borders": "configs.hideBorders === true"
|
|
6351
|
+
"class.hide-borders": "configs.hideBorders === true",
|
|
6352
|
+
"class.has-column-chooser": "showColumnChooser && !isHideColumns",
|
|
6353
|
+
"class.compact": "configs.density === 'compact'",
|
|
6354
|
+
"class.pin-first-column": "pinFirstColumn"
|
|
5833
6355
|
} },
|
|
5834
|
-
viewQueries: [
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
6356
|
+
viewQueries: [
|
|
6357
|
+
{
|
|
6358
|
+
propertyName: "bodyElement",
|
|
6359
|
+
first: true,
|
|
6360
|
+
predicate: ["body"],
|
|
6361
|
+
descendants: true,
|
|
6362
|
+
isSignal: true
|
|
6363
|
+
},
|
|
6364
|
+
{
|
|
6365
|
+
propertyName: "viewport",
|
|
6366
|
+
first: true,
|
|
6367
|
+
predicate: CdkVirtualScrollViewport,
|
|
6368
|
+
descendants: true,
|
|
6369
|
+
isSignal: true
|
|
6370
|
+
},
|
|
6371
|
+
{
|
|
6372
|
+
propertyName: "columnChooserButton",
|
|
6373
|
+
first: true,
|
|
6374
|
+
predicate: ["columnChooserButton"],
|
|
6375
|
+
descendants: true,
|
|
6376
|
+
isSignal: true
|
|
6377
|
+
},
|
|
6378
|
+
{
|
|
6379
|
+
propertyName: "columnChooserTemplate",
|
|
6380
|
+
first: true,
|
|
6381
|
+
predicate: ["columnChooserTemplate"],
|
|
6382
|
+
descendants: true,
|
|
6383
|
+
isSignal: true
|
|
6384
|
+
}
|
|
6385
|
+
],
|
|
5847
6386
|
usesInheritance: true,
|
|
5848
6387
|
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
|
|
6388
|
+
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 [class.pinned]=\"pinFirstColumn\"\n [style.transform]=\"pinnedHeaderTransform()\"\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 <!-- With pinFirstColumn, the first heading, and the select-all heading before it, move back by\n as much as the header row moves, so they stay in place over their pinned cells. -->\n @for (column of columns; track column; let first = $first) {\n @let width = headerWidth(column);\n <div\n class=\"header-cell\"\n role=\"columnheader\"\n [class.pinned]=\"pinFirstColumn && first\"\n [style.transform]=\"first ? pinnedHeaderTransform() : null\"\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\n [itemSize]=\"rowHeight\"\n [style.--grid-pin-offset]=\"pinOffset\"\n [style.grid-template-columns]=\"gridColumns\"\n >\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]=\"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]=\"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]=\"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]=\"rowHeight\">\n <span>\n {{ messageToDisplayWhenEmpty | translate }}\n </span>\n </div>\n }\n @if (hasFailed()) {\n <div class=\"message\" aria-hidden=\"true\" [style.height.px]=\"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, and how many rows\na copy took, without losing their place. Always in the page, so a change of text is announced. -->\n<div class=\"status\" role=\"status\">\n {{ fillCopiedCount(statusText | translate: { count: formattedCopiedCount }) }}\n</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",
|
|
6389
|
+
styles: ["@charset \"UTF-8\";@layer properties;:host{display:flex;flex-direction:column;overflow:hidden}: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.compact .header .header-row,:host.compact .column-chooser-slot{padding-block:calc(var(--spacing, .25rem) * 1.5)}:host.compact .body lib-data-grid-row{padding-block:var(--spacing, .25rem)}: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);-webkit-user-select:none;user-select:none;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);-webkit-user-select:none;user-select:none;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 .header-cell.pinned{z-index:2;margin-inline-start:-1rem;padding-inline-start:1rem;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)){.header .header-cell.pinned{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)}}.header .header-cell.pinned:not(.selection){box-shadow:1px 0 0 var(--color-line-strong)}.header .header-cell.pinned:not(.selection):dir(rtl){box-shadow:-1px 0 0 var(--color-line-strong)}.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;-webkit-user-select:none;user-select:none;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
6390
|
dependencies: [
|
|
6391
|
+
{
|
|
6392
|
+
kind: "ngmodule",
|
|
6393
|
+
type: A11yModule
|
|
6394
|
+
},
|
|
6395
|
+
{
|
|
6396
|
+
kind: "directive",
|
|
6397
|
+
type: i1.CdkTrapFocus,
|
|
6398
|
+
selector: "[cdkTrapFocus]",
|
|
6399
|
+
inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"],
|
|
6400
|
+
exportAs: ["cdkTrapFocus"]
|
|
6401
|
+
},
|
|
5852
6402
|
{
|
|
5853
6403
|
kind: "component",
|
|
5854
6404
|
type: DataGridRowComponent,
|
|
@@ -5857,7 +6407,8 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
|
5857
6407
|
"disabled",
|
|
5858
6408
|
"isFirstRow",
|
|
5859
6409
|
"rowData",
|
|
5860
|
-
"rowIndex"
|
|
6410
|
+
"rowIndex",
|
|
6411
|
+
"tabbable"
|
|
5861
6412
|
],
|
|
5862
6413
|
outputs: ["selectionResized"]
|
|
5863
6414
|
},
|
|
@@ -5873,7 +6424,7 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
|
5873
6424
|
},
|
|
5874
6425
|
{
|
|
5875
6426
|
kind: "directive",
|
|
5876
|
-
type:
|
|
6427
|
+
type: i2.CdkFixedSizeVirtualScroll,
|
|
5877
6428
|
selector: "cdk-virtual-scroll-viewport[itemSize]",
|
|
5878
6429
|
inputs: [
|
|
5879
6430
|
"itemSize",
|
|
@@ -5883,7 +6434,7 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
|
5883
6434
|
},
|
|
5884
6435
|
{
|
|
5885
6436
|
kind: "directive",
|
|
5886
|
-
type:
|
|
6437
|
+
type: i2.CdkVirtualForOf,
|
|
5887
6438
|
selector: "[cdkVirtualFor][cdkVirtualForOf]",
|
|
5888
6439
|
inputs: [
|
|
5889
6440
|
"cdkVirtualForOf",
|
|
@@ -5894,11 +6445,22 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
|
5894
6445
|
},
|
|
5895
6446
|
{
|
|
5896
6447
|
kind: "component",
|
|
5897
|
-
type:
|
|
6448
|
+
type: i2.CdkVirtualScrollViewport,
|
|
5898
6449
|
selector: "cdk-virtual-scroll-viewport",
|
|
5899
6450
|
inputs: ["orientation", "appendOnly"],
|
|
5900
6451
|
outputs: ["scrolledIndexChange"]
|
|
5901
6452
|
},
|
|
6453
|
+
{
|
|
6454
|
+
kind: "directive",
|
|
6455
|
+
type: TooltipDirective,
|
|
6456
|
+
selector: "[libTooltip]",
|
|
6457
|
+
inputs: [
|
|
6458
|
+
"libTooltip",
|
|
6459
|
+
"tooltipPosition",
|
|
6460
|
+
"tooltipDisabled",
|
|
6461
|
+
"tooltipDelay"
|
|
6462
|
+
]
|
|
6463
|
+
},
|
|
5902
6464
|
{
|
|
5903
6465
|
kind: "pipe",
|
|
5904
6466
|
type: TranslatePipe,
|
|
@@ -5918,16 +6480,21 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5918
6480
|
selector: "lib-data-grid",
|
|
5919
6481
|
host: {
|
|
5920
6482
|
"[class.no-borders]": "showButtons()",
|
|
5921
|
-
"[class.hide-borders]": "configs.hideBorders === true"
|
|
6483
|
+
"[class.hide-borders]": "configs.hideBorders === true",
|
|
6484
|
+
"[class.has-column-chooser]": "showColumnChooser && !isHideColumns",
|
|
6485
|
+
"[class.compact]": "configs.density === 'compact'",
|
|
6486
|
+
"[class.pin-first-column]": "pinFirstColumn"
|
|
5922
6487
|
},
|
|
5923
6488
|
imports: [
|
|
6489
|
+
A11yModule,
|
|
5924
6490
|
DataGridRowComponent,
|
|
5925
6491
|
NgStyle,
|
|
5926
6492
|
ScrollingModule,
|
|
6493
|
+
TooltipDirective,
|
|
5927
6494
|
TranslatePipe
|
|
5928
6495
|
],
|
|
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
|
|
6496
|
+
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 [class.pinned]=\"pinFirstColumn\"\n [style.transform]=\"pinnedHeaderTransform()\"\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 <!-- With pinFirstColumn, the first heading, and the select-all heading before it, move back by\n as much as the header row moves, so they stay in place over their pinned cells. -->\n @for (column of columns; track column; let first = $first) {\n @let width = headerWidth(column);\n <div\n class=\"header-cell\"\n role=\"columnheader\"\n [class.pinned]=\"pinFirstColumn && first\"\n [style.transform]=\"first ? pinnedHeaderTransform() : null\"\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\n [itemSize]=\"rowHeight\"\n [style.--grid-pin-offset]=\"pinOffset\"\n [style.grid-template-columns]=\"gridColumns\"\n >\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]=\"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]=\"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]=\"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]=\"rowHeight\">\n <span>\n {{ messageToDisplayWhenEmpty | translate }}\n </span>\n </div>\n }\n @if (hasFailed()) {\n <div class=\"message\" aria-hidden=\"true\" [style.height.px]=\"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, and how many rows\na copy took, without losing their place. Always in the page, so a change of text is announced. -->\n<div class=\"status\" role=\"status\">\n {{ fillCopiedCount(statusText | translate: { count: formattedCopiedCount }) }}\n</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",
|
|
6497
|
+
styles: ["@charset \"UTF-8\";@layer properties;:host{display:flex;flex-direction:column;overflow:hidden}: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.compact .header .header-row,:host.compact .column-chooser-slot{padding-block:calc(var(--spacing, .25rem) * 1.5)}:host.compact .body lib-data-grid-row{padding-block:var(--spacing, .25rem)}: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);-webkit-user-select:none;user-select:none;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);-webkit-user-select:none;user-select:none;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 .header-cell.pinned{z-index:2;margin-inline-start:-1rem;padding-inline-start:1rem;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)){.header .header-cell.pinned{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)}}.header .header-cell.pinned:not(.selection){box-shadow:1px 0 0 var(--color-line-strong)}.header .header-cell.pinned:not(.selection):dir(rtl){box-shadow:-1px 0 0 var(--color-line-strong)}.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;-webkit-user-select:none;user-select:none;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
6498
|
}]
|
|
5932
6499
|
}],
|
|
5933
6500
|
ctorParameters: () => [],
|
|
@@ -5940,6 +6507,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5940
6507
|
type: i0.ViewChild,
|
|
5941
6508
|
args: [i0.forwardRef(() => CdkVirtualScrollViewport), { isSignal: true }]
|
|
5942
6509
|
}],
|
|
6510
|
+
columnChooserButton: [{
|
|
6511
|
+
type: i0.ViewChild,
|
|
6512
|
+
args: ["columnChooserButton", { isSignal: true }]
|
|
6513
|
+
}],
|
|
6514
|
+
columnChooserTemplate: [{
|
|
6515
|
+
type: i0.ViewChild,
|
|
6516
|
+
args: ["columnChooserTemplate", { isSignal: true }]
|
|
6517
|
+
}],
|
|
5943
6518
|
disabled: [{
|
|
5944
6519
|
type: i0.Input,
|
|
5945
6520
|
args: [{
|
|
@@ -7181,17 +7756,17 @@ var MultiSelectComponent = class MultiSelectComponent extends ModalComponent {
|
|
|
7181
7756
|
},
|
|
7182
7757
|
{
|
|
7183
7758
|
kind: "directive",
|
|
7184
|
-
type: i2$
|
|
7759
|
+
type: i2$2.DefaultValueAccessor,
|
|
7185
7760
|
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
7761
|
},
|
|
7187
7762
|
{
|
|
7188
7763
|
kind: "directive",
|
|
7189
|
-
type: i2$
|
|
7764
|
+
type: i2$2.NgControlStatus,
|
|
7190
7765
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
7191
7766
|
},
|
|
7192
7767
|
{
|
|
7193
7768
|
kind: "directive",
|
|
7194
|
-
type: i2$
|
|
7769
|
+
type: i2$2.NgModel,
|
|
7195
7770
|
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
7196
7771
|
inputs: [
|
|
7197
7772
|
"name",
|
|
@@ -8379,7 +8954,16 @@ var DataGridConfigsProvider = class DataGridConfigsProvider extends GridConfigsP
|
|
|
8379
8954
|
totalRowsText: "{{ count }} records",
|
|
8380
8955
|
totalRowText: "{{ count }} record",
|
|
8381
8956
|
booleanTrueText: "Yes",
|
|
8382
|
-
booleanFalseText: "No"
|
|
8957
|
+
booleanFalseText: "No",
|
|
8958
|
+
columnChooser: false,
|
|
8959
|
+
columnChooserText: "Choose columns",
|
|
8960
|
+
resetColumnsText: "Reset columns",
|
|
8961
|
+
resizableColumns: false,
|
|
8962
|
+
resizeColumnText: "Resize {{ column }}",
|
|
8963
|
+
density: "comfortable",
|
|
8964
|
+
pinFirstColumn: false,
|
|
8965
|
+
copiedText: "Copied {{ count }} rows",
|
|
8966
|
+
copiedRowText: "Copied 1 row"
|
|
8383
8967
|
};
|
|
8384
8968
|
}
|
|
8385
8969
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
@@ -8467,6 +9051,6 @@ var DateValidators = class {
|
|
|
8467
9051
|
};
|
|
8468
9052
|
}
|
|
8469
9053
|
};
|
|
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 };
|
|
9054
|
+
export { BadgeComponent, BaseComponent, BaseDataset, ButtonComponent, COMPACT_GRID_ROW_HEIGHT, CalendarComponent, CatalogSelectComponent, CatalogService, DEFAULT_GRID_ROW_HEIGHT, 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
9055
|
|
|
8472
9056
|
//# sourceMappingURL=zambon-dev-ui-library.mjs.map
|