@coolon/angular-ui-powerups 16.1.0-alpha.338 → 16.1.0-alpha.339
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/assets/table.scss +9 -7
- package/esm2022/lib/components/tables/renderer/table-body/kept-column-offsets.mjs +84 -0
- package/esm2022/lib/components/tables/renderer/table-body/table-body.component.mjs +20 -3
- package/fesm2022/coolon-angular-ui-powerups.mjs +101 -2
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/tables/renderer/table-body/kept-column-offsets.d.ts +38 -0
- package/lib/components/tables/renderer/table-body/table-body.component.d.ts +7 -0
- package/package.json +1 -1
|
@@ -7585,6 +7585,89 @@ function heightOf(element) {
|
|
|
7585
7585
|
return element?.getBoundingClientRect().height ?? 0;
|
|
7586
7586
|
}
|
|
7587
7587
|
|
|
7588
|
+
/**
|
|
7589
|
+
* Where each column kept in view holds while it is stuck, so that two kept columns never stick in the same place. A
|
|
7590
|
+
* column held at the left edge sits inside the kept columns before it, and one held at the right edge inside the kept
|
|
7591
|
+
* columns after it. The offsets follow the widths of the kept header cells, and a table that shows no header keeps
|
|
7592
|
+
* every kept column at the edge itself.
|
|
7593
|
+
*
|
|
7594
|
+
* The offsets are custom properties on the table body, which each kept cell reads in its `left` and `right`. A cell
|
|
7595
|
+
* keeps the same reference for its whole life, so a resize changes no binding and checks no view, and a row drawn
|
|
7596
|
+
* later by the virtual scroller reads the current offsets at once. The reference is a custom property of the cell, not
|
|
7597
|
+
* an inline `left` and `right`: the CDK table clears every cell's inline `left` and `right` when its columns change.
|
|
7598
|
+
*/
|
|
7599
|
+
class KeptColumnOffsets {
|
|
7600
|
+
body;
|
|
7601
|
+
columnOf;
|
|
7602
|
+
resizeObserver = new ResizeObserver(() => this.measure());
|
|
7603
|
+
cells = [];
|
|
7604
|
+
propertiesSet = [];
|
|
7605
|
+
disposed = false;
|
|
7606
|
+
/**
|
|
7607
|
+
* @param body the table body whose kept header cells are measured. A table nested in a cell has its own.
|
|
7608
|
+
* @param columnOf finds the column a header cell's `column-id` names.
|
|
7609
|
+
*/
|
|
7610
|
+
constructor(body, columnOf) {
|
|
7611
|
+
this.body = body;
|
|
7612
|
+
this.columnOf = columnOf;
|
|
7613
|
+
}
|
|
7614
|
+
/** Measures the kept header cells the body draws now. Call it once the body has drawn a change of columns. */
|
|
7615
|
+
watchCells() {
|
|
7616
|
+
if (this.disposed) {
|
|
7617
|
+
return;
|
|
7618
|
+
}
|
|
7619
|
+
this.resizeObserver.disconnect();
|
|
7620
|
+
this.cells = Array.from(this.body.querySelectorAll("th.keep-in-view"))
|
|
7621
|
+
.filter(cell => cell.closest("aup-table-body") === this.body);
|
|
7622
|
+
this.cells.forEach(cell => this.resizeObserver.observe(cell));
|
|
7623
|
+
this.measure();
|
|
7624
|
+
}
|
|
7625
|
+
dispose() {
|
|
7626
|
+
this.disposed = true;
|
|
7627
|
+
this.resizeObserver.disconnect();
|
|
7628
|
+
}
|
|
7629
|
+
measure() {
|
|
7630
|
+
const widths = this.cells.map(cell => cell.getBoundingClientRect().width);
|
|
7631
|
+
const total = widths.reduce((sum, width) => sum + width, 0);
|
|
7632
|
+
const properties = new Map();
|
|
7633
|
+
let before = 0;
|
|
7634
|
+
this.cells.forEach((cell, index) => {
|
|
7635
|
+
const columnId = cell.querySelector("[column-id]")?.getAttribute("column-id");
|
|
7636
|
+
const column = columnId ? this.columnOf(columnId) : undefined;
|
|
7637
|
+
if (column) {
|
|
7638
|
+
properties.set(KeptColumnOffsets.leftProperty(column), `${before}px`);
|
|
7639
|
+
properties.set(KeptColumnOffsets.rightProperty(column), `${total - before - widths[index]}px`);
|
|
7640
|
+
}
|
|
7641
|
+
before += widths[index];
|
|
7642
|
+
});
|
|
7643
|
+
this.propertiesSet
|
|
7644
|
+
.filter(name => !properties.has(name))
|
|
7645
|
+
.forEach(name => this.body.style.removeProperty(name));
|
|
7646
|
+
properties.forEach((value, name) => this.body.style.setProperty(name, value));
|
|
7647
|
+
this.propertiesSet = [...properties.keys()];
|
|
7648
|
+
}
|
|
7649
|
+
}
|
|
7650
|
+
(function (KeptColumnOffsets) {
|
|
7651
|
+
function leftProperty(column) {
|
|
7652
|
+
return `--aup-keep-in-view-left-${column.dasherisedColumnId}`;
|
|
7653
|
+
}
|
|
7654
|
+
KeptColumnOffsets.leftProperty = leftProperty;
|
|
7655
|
+
function rightProperty(column) {
|
|
7656
|
+
return `--aup-keep-in-view-right-${column.dasherisedColumnId}`;
|
|
7657
|
+
}
|
|
7658
|
+
KeptColumnOffsets.rightProperty = rightProperty;
|
|
7659
|
+
/** A kept cell's offset from the left, 0 until the body has measured the kept columns. */
|
|
7660
|
+
function leftOf(column) {
|
|
7661
|
+
return `var(${leftProperty(column)}, 0px)`;
|
|
7662
|
+
}
|
|
7663
|
+
KeptColumnOffsets.leftOf = leftOf;
|
|
7664
|
+
/** A kept cell's offset from the right, 0 until the body has measured the kept columns. */
|
|
7665
|
+
function rightOf(column) {
|
|
7666
|
+
return `var(${rightProperty(column)}, 0px)`;
|
|
7667
|
+
}
|
|
7668
|
+
KeptColumnOffsets.rightOf = rightOf;
|
|
7669
|
+
})(KeptColumnOffsets || (KeptColumnOffsets = {}));
|
|
7670
|
+
|
|
7588
7671
|
class TableCellComponent extends DisposableComponent {
|
|
7589
7672
|
row;
|
|
7590
7673
|
column;
|
|
@@ -7822,6 +7905,8 @@ class TableBodyComponent extends ResizeAwareComponent {
|
|
|
7822
7905
|
animationsResetRafId = null;
|
|
7823
7906
|
scrollEndAbortController = null;
|
|
7824
7907
|
optimisedChangeDetectionEnabled;
|
|
7908
|
+
/** Where each column kept in view holds, so that kept columns stuck to the same edge sit side by side. */
|
|
7909
|
+
keptColumnOffsets = this.registerDisposable(new KeptColumnOffsets(this.elementRef.nativeElement, columnId => this.columnsById$?.get(columnId)));
|
|
7825
7910
|
viewInitialized = false;
|
|
7826
7911
|
markForCheck() {
|
|
7827
7912
|
if (this.optimisedChangeDetectionEnabled) {
|
|
@@ -7892,6 +7977,11 @@ class TableBodyComponent extends ResizeAwareComponent {
|
|
|
7892
7977
|
this.footerRowDefs$ = chain(this.columnIds$).reduceAll(ids => (this.footerRows ?? []).map((row, i) => row.resolve(i, [...ids])));
|
|
7893
7978
|
this.registerDisposable(this.tableModel._onScrollToTop(() => this.scrollToTop()));
|
|
7894
7979
|
this.setUpEndOfRowsAndLoadingRow();
|
|
7980
|
+
// The kept cells are measured once drawn, and a change of columns or of scroll mode draws new ones.
|
|
7981
|
+
const measureKeptCells = () => requestAnimationFrame(() => this.keptColumnOffsets.watchCells());
|
|
7982
|
+
when(this.tableModel.visibleColumns$).changes(measureKeptCells);
|
|
7983
|
+
when(this.tableModel.columnsKeptInView$).changes(measureKeptCells);
|
|
7984
|
+
when(this.scrollMode$).changes(measureKeptCells);
|
|
7895
7985
|
if (this.tableModel._topOfRows) {
|
|
7896
7986
|
// A table moving between classic scrolling and none keeps its container, which scrolls only in the first. The
|
|
7897
7987
|
// mode changes while Angular checks the view, so the report waits until after the check.
|
|
@@ -7908,6 +7998,7 @@ class TableBodyComponent extends ResizeAwareComponent {
|
|
|
7908
7998
|
ngAfterViewInit() {
|
|
7909
7999
|
super.ngAfterViewInit();
|
|
7910
8000
|
this.viewInitialized = true;
|
|
8001
|
+
this.keptColumnOffsets.watchCells();
|
|
7911
8002
|
if (this.scrollViewport) {
|
|
7912
8003
|
const { observe } = Dsl.disposeWith(this);
|
|
7913
8004
|
this.scrollViewport.elementScrolled().subscribe(() => this.notifyScrolled());
|
|
@@ -7952,6 +8043,14 @@ class TableBodyComponent extends ResizeAwareComponent {
|
|
|
7952
8043
|
highlightTextFor(column) {
|
|
7953
8044
|
return column.highlightsSearch && this.highlightText ? this.highlightText.aupHighlightTextModel : this.noHighlightText$;
|
|
7954
8045
|
}
|
|
8046
|
+
/** Where a column kept in view holds from the left; null for any other column. */
|
|
8047
|
+
keptLeftOf(column) {
|
|
8048
|
+
return column.isKeptInView() ? KeptColumnOffsets.leftOf(column) : null;
|
|
8049
|
+
}
|
|
8050
|
+
/** Where a column kept in view holds from the right; null for any other column. */
|
|
8051
|
+
keptRightOf(column) {
|
|
8052
|
+
return column.isKeptInView() ? KeptColumnOffsets.rightOf(column) : null;
|
|
8053
|
+
}
|
|
7955
8054
|
notifyCellClicked(columnModel, row) {
|
|
7956
8055
|
this.tableModel._notifyCellClicked(columnModel, row);
|
|
7957
8056
|
}
|
|
@@ -8173,7 +8272,7 @@ class TableBodyComponent extends ResizeAwareComponent {
|
|
|
8173
8272
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: TableBodyComponent, deps: [{ token: AUP_TABLE_VIRTUAL_SCROLL_BUFFER_MULTIPLIER, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
8174
8273
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: TableBodyComponent, selector: "aup-table-body", inputs: { data$: "data$", tableModel: "tableModel", footerRows: "footerRows", showHeader$: "showHeader$", showHeader: "showHeader", trackBy: "trackBy", scrollMode$: "scrollMode$", scrollMode: "scrollMode", holdScrollPosition: "holdScrollPosition" }, host: { properties: { "attr.scrollMode": "this.scrollMode", "class.hold-scroll-position": "this.holdScrollPosition", "class": "this.baseCssClass", "class.aup-animations-disabled": "this.animationsDisabledClass", "class.hide-header": "this.hideHeader", "style.--aup-table-header-height": "this.headerHeightCssVar", "style.--aup-table-row-height": "this.rowHeightCssVar" } }, providers: [
|
|
8175
8274
|
{ provide: AUP_DETACHED_PARENT_CDR, useFactory: () => inject(AUP_TABLE_OPTIMIZED_CHANGE_DETECTION, { optional: true }) ? inject(ChangeDetectorRef) : null }
|
|
8176
|
-
], viewQueries: [{ propertyName: "scrollViewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true }, { propertyName: "classicScrollContainerRef", first: true, predicate: ["classicScrollContainer"], descendants: true }, { propertyName: "endOfRowsMarker", first: true, predicate: ["endOfRowsMarker"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<!-- Reads the loading row's message to screen readers. It is in the page before the message appears in it, as a\n screen reader announces only a change to a status region it already knows, and the loading row is hidden while\n no chunk is on its way. -->\n<div *ngIf=\"tableModel._loadingRow as loadingRow\" role=\"status\" class=\"loading-status\">{{ loadingRowShown$.value ? loadingRow.message() : '' }}</div>\n\n<div #classicScrollContainer class=\"classic-scroll-container\" aup-table-scroller *ngIf=\"scrollMode$.value !== 'virtual'\">\n <table mat-table [dataSource]=\"data$.value\" [trackBy]=\"trackBy\" [multiTemplateDataRows]>\n\n <ng-container *ngFor=\"let column of columns$.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\"\n [class.keep-in-view]=\"column.isKeptInView()\">\n <aup-table-header-cell [column]=\"$any(column)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"tableModel.isCursorEnabledForRow(column, row)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n [class.keep-in-view]=\"column.isKeptInView()\"\n >\n <aup-table-cell [column]=\"$any(column)\"\n [row]=\"row\"\n [tableModel]=\"$any(tableModel)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n [aupHighlightTextModel]=\"highlightTextFor($any(column))\"\n ></aup-table-cell>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds$.value; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds$.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\"\n [class.enable-hover]=\"tableModel.isHoverEnabledForRow(row)\"\n [aupTableRowAttributes]=\"tableModel.getRowAttributes(row)\"\n [attr.aup-row-id]=\"trackBy(i, row)\"\n ></tr>\n\n <!-- The loading row, pinned to the bottom of the table above any other footer row. The status region outside the\n table reads its message to screen readers, so the row itself is hidden from them. -->\n <ng-container *ngIf=\"tableModel._loadingRow as loadingRow\" matColumnDef=\"aup-loading-row\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"columnIds$.value.length\" class=\"footer-cell loading-row-cell\">\n <div *ngIf=\"loadingRowShown$.value\" class=\"loading-row\" aup-loading-row aria-hidden=\"true\">\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"20\"></mat-progress-spinner>\n <span>{{ loadingRow.message() }}</span>\n </div>\n </td>\n <tr mat-footer-row *matFooterRowDef=\"['aup-loading-row']; sticky: true\" class=\"loading-footer-row\"\n [class.aup-footer-row-hidden]=\"!loadingRowShown$.value\"></tr>\n </ng-container>\n\n <ng-container *ngFor=\"let footer of footerRowDefs$.value\">\n <ng-container *ngFor=\"let cell of footer.cells\" [matColumnDef]=\"cell.defId\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"cell.colspan\"\n [attr.column-id]=\"cell.columnId\" class=\"footer-cell\">\n <aup-table-footer-row *ngIf=\"!cell.filler\" [cell]=\"cell\"></aup-table-footer-row>\n </td>\n </ng-container>\n <tr mat-footer-row *matFooterRowDef=\"footer.defIds; sticky: true\" [ngClass]=\"footer.rowClasses\"\n [class.aup-footer-row-hidden]=\"footer.visible$ && !footer.visible$.value\"></tr>\n </ng-container>\n\n </table>\n <!-- The marker after the last row, watched to tell when the end of the rows is in view. -->\n <div #endOfRowsMarker *ngIf=\"tableModel._endOfRows && scrollMode$.value === 'classic'\" class=\"end-of-rows\" aria-hidden=\"true\"></div>\n</div>\n\n<cdk-virtual-scroll-viewport *ngIf=\"scrollMode$.value === 'virtual'\" aup-table-scroller\n [@.disabled]=\"animationsDisabled$.value\"\n [tvsItemSize]=\"rowHeight$.value\"\n [headerHeight]=\"headerHeight$.value\"\n [footerEnabled]=\"(footerRowDefs$?.value?.length ?? 0) > 0\"\n [footerHeight]=\"48 * (footerRowDefs$?.value?.length ?? 0)\"\n [bufferMultiplier]=\"bufferMultiplier\"\n>\n <table mat-table [dataSource]=\"virtualScrollDataSource\" [trackBy]=\"trackBy\">\n\n <ng-container *ngFor=\"let column of columns$.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\"\n [class.keep-in-view]=\"column.isKeptInView()\">\n <aup-table-header-cell [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"tableModel.isCursorEnabledForRow(column, row)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n [class.keep-in-view]=\"column.isKeptInView()\"\n >\n <aup-table-cell [column]=\"$any(column)\"\n [row]=\"row\"\n [tableModel]=\"$any(tableModel)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n [aupHighlightTextModel]=\"highlightTextFor($any(column))\"\n ></aup-table-cell>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds$.value; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds$.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\"\n [class.enable-hover]=\"tableModel.isHoverEnabledForRow(row)\"\n [aupTableRowAttributes]=\"tableModel.getRowAttributes(row)\"\n [attr.aup-row-id]=\"trackBy(i, row)\"\n ></tr>\n\n <!-- The loading row, pinned to the bottom of the table above any other footer row. The status region outside the\n table reads its message to screen readers, so the row itself is hidden from them. -->\n <ng-container *ngIf=\"tableModel._loadingRow as loadingRow\" matColumnDef=\"aup-loading-row\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"columnIds$.value.length\" class=\"footer-cell loading-row-cell\">\n <div *ngIf=\"loadingRowShown$.value\" class=\"loading-row\" aup-loading-row aria-hidden=\"true\">\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"20\"></mat-progress-spinner>\n <span>{{ loadingRow.message() }}</span>\n </div>\n </td>\n <tr mat-footer-row *matFooterRowDef=\"['aup-loading-row']; sticky: true\" class=\"loading-footer-row\"\n [class.aup-footer-row-hidden]=\"!loadingRowShown$.value\"></tr>\n </ng-container>\n\n <ng-container *ngFor=\"let footer of footerRowDefs$.value\">\n <ng-container *ngFor=\"let cell of footer.cells\" [matColumnDef]=\"cell.defId\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"cell.colspan\"\n [attr.column-id]=\"cell.columnId\" class=\"footer-cell\">\n <aup-table-footer-row *ngIf=\"!cell.filler\" [cell]=\"cell\"></aup-table-footer-row>\n </td>\n </ng-container>\n <tr mat-footer-row *matFooterRowDef=\"footer.defIds; sticky: true\" [ngClass]=\"footer.rowClasses\"\n [class.aup-footer-row-hidden]=\"footer.visible$ && !footer.visible$.value\"></tr>\n </ng-container>\n\n\n </table>\n</cdk-virtual-scroll-viewport>\n\n", styles: [":host{--enter-animation-duration: .1s;display:flex;flex-direction:column;align-items:stretch}:host.aup-animations-disabled{--enter-animation-duration: 0ms}:host table{width:100%}:host tr.aup-footer-row-hidden{display:none}:host td.footer-cell{border-top:0!important;box-shadow:0 -1px 0 0 var(--mat-table-row-item-outline-color, rgba(0, 0, 0, .12))}:host[scrollMode=virtual] cdk-virtual-scroll-viewport{flex:1}:host[scrollMode=virtual] table th{height:var(--aup-table-header-height);max-height:var(--aup-table-header-height);min-height:var(--aup-table-header-height)}:host[scrollMode=virtual] table td{height:var(--aup-table-row-height);max-height:var(--aup-table-row-height);min-height:var(--aup-table-row-height)}:host[scrollMode=classic]{min-height:0}:host[scrollMode=classic] .classic-scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}:host.hold-scroll-position .classic-scroll-container{overflow-anchor:none}td.loading-row-cell{padding:0}.loading-row{display:flex;align-items:center;justify-content:center;gap:12px;height:var(--aup-table-row-height);color:var(--aup-table-loading-row-color, inherit)}.loading-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.end-of-rows{height:1px;flex-shrink:0;pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: HighlightTextModelDirective, selector: "[aupHighlightTextModel]", inputs: ["aupHighlightTextModel"] }, { kind: "component", type: i3$3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3$3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3$3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3$3.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i3$3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3$3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3$3.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i3$3.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i3$3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3$3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i3$3.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i3$3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3$3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i3$3.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "component", type: i2$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i5.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: i6.TableItemSizeDirective, selector: "cdk-virtual-scroll-viewport[tvsItemSize]", inputs: ["tvsItemSize", "headerEnabled", "headerHeight", "footerEnabled", "footerHeight", "bufferMultiplier"] }, { kind: "directive", type: TableRowAttributesDirective, selector: "[aupTableRowAttributes]", inputs: ["aupTableRowAttributes"] }, { kind: "component", type: TableCellComponent, selector: "aup-table-cell", inputs: ["row", "column", "tableModel"] }, { kind: "component", type: TableHeaderCellComponent, selector: "aup-table-header-cell", inputs: ["column"] }, { kind: "component", type: TableFooterRow, selector: "aup-table-footer-row", inputs: ["cell"] }] });
|
|
8275
|
+
], viewQueries: [{ propertyName: "scrollViewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true }, { propertyName: "classicScrollContainerRef", first: true, predicate: ["classicScrollContainer"], descendants: true }, { propertyName: "endOfRowsMarker", first: true, predicate: ["endOfRowsMarker"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<!-- Reads the loading row's message to screen readers. It is in the page before the message appears in it, as a\n screen reader announces only a change to a status region it already knows, and the loading row is hidden while\n no chunk is on its way. -->\n<div *ngIf=\"tableModel._loadingRow as loadingRow\" role=\"status\" class=\"loading-status\">{{ loadingRowShown$.value ? loadingRow.message() : '' }}</div>\n\n<div #classicScrollContainer class=\"classic-scroll-container\" aup-table-scroller *ngIf=\"scrollMode$.value !== 'virtual'\">\n <table mat-table [dataSource]=\"data$.value\" [trackBy]=\"trackBy\" [multiTemplateDataRows]>\n\n <ng-container *ngFor=\"let column of columns$.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\"\n [class.keep-in-view]=\"column.isKeptInView()\"\n [style.--aup-keep-in-view-left]=\"keptLeftOf($any(column))\" [style.--aup-keep-in-view-right]=\"keptRightOf($any(column))\">\n <aup-table-header-cell [column]=\"$any(column)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"tableModel.isCursorEnabledForRow(column, row)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n [class.keep-in-view]=\"column.isKeptInView()\"\n [style.--aup-keep-in-view-left]=\"keptLeftOf($any(column))\" [style.--aup-keep-in-view-right]=\"keptRightOf($any(column))\"\n >\n <aup-table-cell [column]=\"$any(column)\"\n [row]=\"row\"\n [tableModel]=\"$any(tableModel)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n [aupHighlightTextModel]=\"highlightTextFor($any(column))\"\n ></aup-table-cell>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds$.value; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds$.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\"\n [class.enable-hover]=\"tableModel.isHoverEnabledForRow(row)\"\n [aupTableRowAttributes]=\"tableModel.getRowAttributes(row)\"\n [attr.aup-row-id]=\"trackBy(i, row)\"\n ></tr>\n\n <!-- The loading row, pinned to the bottom of the table above any other footer row. The status region outside the\n table reads its message to screen readers, so the row itself is hidden from them. -->\n <ng-container *ngIf=\"tableModel._loadingRow as loadingRow\" matColumnDef=\"aup-loading-row\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"columnIds$.value.length\" class=\"footer-cell loading-row-cell\">\n <div *ngIf=\"loadingRowShown$.value\" class=\"loading-row\" aup-loading-row aria-hidden=\"true\">\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"20\"></mat-progress-spinner>\n <span>{{ loadingRow.message() }}</span>\n </div>\n </td>\n <tr mat-footer-row *matFooterRowDef=\"['aup-loading-row']; sticky: true\" class=\"loading-footer-row\"\n [class.aup-footer-row-hidden]=\"!loadingRowShown$.value\"></tr>\n </ng-container>\n\n <ng-container *ngFor=\"let footer of footerRowDefs$.value\">\n <ng-container *ngFor=\"let cell of footer.cells\" [matColumnDef]=\"cell.defId\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"cell.colspan\"\n [attr.column-id]=\"cell.columnId\" class=\"footer-cell\">\n <aup-table-footer-row *ngIf=\"!cell.filler\" [cell]=\"cell\"></aup-table-footer-row>\n </td>\n </ng-container>\n <tr mat-footer-row *matFooterRowDef=\"footer.defIds; sticky: true\" [ngClass]=\"footer.rowClasses\"\n [class.aup-footer-row-hidden]=\"footer.visible$ && !footer.visible$.value\"></tr>\n </ng-container>\n\n </table>\n <!-- The marker after the last row, watched to tell when the end of the rows is in view. -->\n <div #endOfRowsMarker *ngIf=\"tableModel._endOfRows && scrollMode$.value === 'classic'\" class=\"end-of-rows\" aria-hidden=\"true\"></div>\n</div>\n\n<cdk-virtual-scroll-viewport *ngIf=\"scrollMode$.value === 'virtual'\" aup-table-scroller\n [@.disabled]=\"animationsDisabled$.value\"\n [tvsItemSize]=\"rowHeight$.value\"\n [headerHeight]=\"headerHeight$.value\"\n [footerEnabled]=\"(footerRowDefs$?.value?.length ?? 0) > 0\"\n [footerHeight]=\"48 * (footerRowDefs$?.value?.length ?? 0)\"\n [bufferMultiplier]=\"bufferMultiplier\"\n>\n <table mat-table [dataSource]=\"virtualScrollDataSource\" [trackBy]=\"trackBy\">\n\n <ng-container *ngFor=\"let column of columns$.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\"\n [class.keep-in-view]=\"column.isKeptInView()\"\n [style.--aup-keep-in-view-left]=\"keptLeftOf($any(column))\" [style.--aup-keep-in-view-right]=\"keptRightOf($any(column))\">\n <aup-table-header-cell [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"tableModel.isCursorEnabledForRow(column, row)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n [class.keep-in-view]=\"column.isKeptInView()\"\n [style.--aup-keep-in-view-left]=\"keptLeftOf($any(column))\" [style.--aup-keep-in-view-right]=\"keptRightOf($any(column))\"\n >\n <aup-table-cell [column]=\"$any(column)\"\n [row]=\"row\"\n [tableModel]=\"$any(tableModel)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n [aupHighlightTextModel]=\"highlightTextFor($any(column))\"\n ></aup-table-cell>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds$.value; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds$.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\"\n [class.enable-hover]=\"tableModel.isHoverEnabledForRow(row)\"\n [aupTableRowAttributes]=\"tableModel.getRowAttributes(row)\"\n [attr.aup-row-id]=\"trackBy(i, row)\"\n ></tr>\n\n <!-- The loading row, pinned to the bottom of the table above any other footer row. The status region outside the\n table reads its message to screen readers, so the row itself is hidden from them. -->\n <ng-container *ngIf=\"tableModel._loadingRow as loadingRow\" matColumnDef=\"aup-loading-row\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"columnIds$.value.length\" class=\"footer-cell loading-row-cell\">\n <div *ngIf=\"loadingRowShown$.value\" class=\"loading-row\" aup-loading-row aria-hidden=\"true\">\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"20\"></mat-progress-spinner>\n <span>{{ loadingRow.message() }}</span>\n </div>\n </td>\n <tr mat-footer-row *matFooterRowDef=\"['aup-loading-row']; sticky: true\" class=\"loading-footer-row\"\n [class.aup-footer-row-hidden]=\"!loadingRowShown$.value\"></tr>\n </ng-container>\n\n <ng-container *ngFor=\"let footer of footerRowDefs$.value\">\n <ng-container *ngFor=\"let cell of footer.cells\" [matColumnDef]=\"cell.defId\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"cell.colspan\"\n [attr.column-id]=\"cell.columnId\" class=\"footer-cell\">\n <aup-table-footer-row *ngIf=\"!cell.filler\" [cell]=\"cell\"></aup-table-footer-row>\n </td>\n </ng-container>\n <tr mat-footer-row *matFooterRowDef=\"footer.defIds; sticky: true\" [ngClass]=\"footer.rowClasses\"\n [class.aup-footer-row-hidden]=\"footer.visible$ && !footer.visible$.value\"></tr>\n </ng-container>\n\n\n </table>\n</cdk-virtual-scroll-viewport>\n\n", styles: [":host{--enter-animation-duration: .1s;display:flex;flex-direction:column;align-items:stretch}:host.aup-animations-disabled{--enter-animation-duration: 0ms}:host table{width:100%}:host tr.aup-footer-row-hidden{display:none}:host td.footer-cell{border-top:0!important;box-shadow:0 -1px 0 0 var(--mat-table-row-item-outline-color, rgba(0, 0, 0, .12))}:host[scrollMode=virtual] cdk-virtual-scroll-viewport{flex:1}:host[scrollMode=virtual] table th{height:var(--aup-table-header-height);max-height:var(--aup-table-header-height);min-height:var(--aup-table-header-height)}:host[scrollMode=virtual] table td{height:var(--aup-table-row-height);max-height:var(--aup-table-row-height);min-height:var(--aup-table-row-height)}:host[scrollMode=classic]{min-height:0}:host[scrollMode=classic] .classic-scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}:host.hold-scroll-position .classic-scroll-container{overflow-anchor:none}td.loading-row-cell{padding:0}.loading-row{display:flex;align-items:center;justify-content:center;gap:12px;height:var(--aup-table-row-height);color:var(--aup-table-loading-row-color, inherit)}.loading-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.end-of-rows{height:1px;flex-shrink:0;pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: HighlightTextModelDirective, selector: "[aupHighlightTextModel]", inputs: ["aupHighlightTextModel"] }, { kind: "component", type: i3$3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3$3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3$3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3$3.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i3$3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3$3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3$3.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i3$3.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i3$3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3$3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i3$3.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i3$3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3$3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i3$3.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "component", type: i2$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i5.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: i6.TableItemSizeDirective, selector: "cdk-virtual-scroll-viewport[tvsItemSize]", inputs: ["tvsItemSize", "headerEnabled", "headerHeight", "footerEnabled", "footerHeight", "bufferMultiplier"] }, { kind: "directive", type: TableRowAttributesDirective, selector: "[aupTableRowAttributes]", inputs: ["aupTableRowAttributes"] }, { kind: "component", type: TableCellComponent, selector: "aup-table-cell", inputs: ["row", "column", "tableModel"] }, { kind: "component", type: TableHeaderCellComponent, selector: "aup-table-header-cell", inputs: ["column"] }, { kind: "component", type: TableFooterRow, selector: "aup-table-footer-row", inputs: ["cell"] }] });
|
|
8177
8276
|
}
|
|
8178
8277
|
__decorate([
|
|
8179
8278
|
Proxify(),
|
|
@@ -8203,7 +8302,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImpor
|
|
|
8203
8302
|
type: Component,
|
|
8204
8303
|
args: [{ selector: "aup-table-body", providers: [
|
|
8205
8304
|
{ provide: AUP_DETACHED_PARENT_CDR, useFactory: () => inject(AUP_TABLE_OPTIMIZED_CHANGE_DETECTION, { optional: true }) ? inject(ChangeDetectorRef) : null }
|
|
8206
|
-
], template: "<!-- Reads the loading row's message to screen readers. It is in the page before the message appears in it, as a\n screen reader announces only a change to a status region it already knows, and the loading row is hidden while\n no chunk is on its way. -->\n<div *ngIf=\"tableModel._loadingRow as loadingRow\" role=\"status\" class=\"loading-status\">{{ loadingRowShown$.value ? loadingRow.message() : '' }}</div>\n\n<div #classicScrollContainer class=\"classic-scroll-container\" aup-table-scroller *ngIf=\"scrollMode$.value !== 'virtual'\">\n <table mat-table [dataSource]=\"data$.value\" [trackBy]=\"trackBy\" [multiTemplateDataRows]>\n\n <ng-container *ngFor=\"let column of columns$.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\"\n [class.keep-in-view]=\"column.isKeptInView()\">\n <aup-table-header-cell [column]=\"$any(column)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"tableModel.isCursorEnabledForRow(column, row)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n [class.keep-in-view]=\"column.isKeptInView()\"\n >\n <aup-table-cell [column]=\"$any(column)\"\n [row]=\"row\"\n [tableModel]=\"$any(tableModel)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n [aupHighlightTextModel]=\"highlightTextFor($any(column))\"\n ></aup-table-cell>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds$.value; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds$.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\"\n [class.enable-hover]=\"tableModel.isHoverEnabledForRow(row)\"\n [aupTableRowAttributes]=\"tableModel.getRowAttributes(row)\"\n [attr.aup-row-id]=\"trackBy(i, row)\"\n ></tr>\n\n <!-- The loading row, pinned to the bottom of the table above any other footer row. The status region outside the\n table reads its message to screen readers, so the row itself is hidden from them. -->\n <ng-container *ngIf=\"tableModel._loadingRow as loadingRow\" matColumnDef=\"aup-loading-row\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"columnIds$.value.length\" class=\"footer-cell loading-row-cell\">\n <div *ngIf=\"loadingRowShown$.value\" class=\"loading-row\" aup-loading-row aria-hidden=\"true\">\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"20\"></mat-progress-spinner>\n <span>{{ loadingRow.message() }}</span>\n </div>\n </td>\n <tr mat-footer-row *matFooterRowDef=\"['aup-loading-row']; sticky: true\" class=\"loading-footer-row\"\n [class.aup-footer-row-hidden]=\"!loadingRowShown$.value\"></tr>\n </ng-container>\n\n <ng-container *ngFor=\"let footer of footerRowDefs$.value\">\n <ng-container *ngFor=\"let cell of footer.cells\" [matColumnDef]=\"cell.defId\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"cell.colspan\"\n [attr.column-id]=\"cell.columnId\" class=\"footer-cell\">\n <aup-table-footer-row *ngIf=\"!cell.filler\" [cell]=\"cell\"></aup-table-footer-row>\n </td>\n </ng-container>\n <tr mat-footer-row *matFooterRowDef=\"footer.defIds; sticky: true\" [ngClass]=\"footer.rowClasses\"\n [class.aup-footer-row-hidden]=\"footer.visible$ && !footer.visible$.value\"></tr>\n </ng-container>\n\n </table>\n <!-- The marker after the last row, watched to tell when the end of the rows is in view. -->\n <div #endOfRowsMarker *ngIf=\"tableModel._endOfRows && scrollMode$.value === 'classic'\" class=\"end-of-rows\" aria-hidden=\"true\"></div>\n</div>\n\n<cdk-virtual-scroll-viewport *ngIf=\"scrollMode$.value === 'virtual'\" aup-table-scroller\n [@.disabled]=\"animationsDisabled$.value\"\n [tvsItemSize]=\"rowHeight$.value\"\n [headerHeight]=\"headerHeight$.value\"\n [footerEnabled]=\"(footerRowDefs$?.value?.length ?? 0) > 0\"\n [footerHeight]=\"48 * (footerRowDefs$?.value?.length ?? 0)\"\n [bufferMultiplier]=\"bufferMultiplier\"\n>\n <table mat-table [dataSource]=\"virtualScrollDataSource\" [trackBy]=\"trackBy\">\n\n <ng-container *ngFor=\"let column of columns$.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\"\n [class.keep-in-view]=\"column.isKeptInView()\">\n <aup-table-header-cell [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"tableModel.isCursorEnabledForRow(column, row)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n [class.keep-in-view]=\"column.isKeptInView()\"\n >\n <aup-table-cell [column]=\"$any(column)\"\n [row]=\"row\"\n [tableModel]=\"$any(tableModel)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n [aupHighlightTextModel]=\"highlightTextFor($any(column))\"\n ></aup-table-cell>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds$.value; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds$.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\"\n [class.enable-hover]=\"tableModel.isHoverEnabledForRow(row)\"\n [aupTableRowAttributes]=\"tableModel.getRowAttributes(row)\"\n [attr.aup-row-id]=\"trackBy(i, row)\"\n ></tr>\n\n <!-- The loading row, pinned to the bottom of the table above any other footer row. The status region outside the\n table reads its message to screen readers, so the row itself is hidden from them. -->\n <ng-container *ngIf=\"tableModel._loadingRow as loadingRow\" matColumnDef=\"aup-loading-row\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"columnIds$.value.length\" class=\"footer-cell loading-row-cell\">\n <div *ngIf=\"loadingRowShown$.value\" class=\"loading-row\" aup-loading-row aria-hidden=\"true\">\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"20\"></mat-progress-spinner>\n <span>{{ loadingRow.message() }}</span>\n </div>\n </td>\n <tr mat-footer-row *matFooterRowDef=\"['aup-loading-row']; sticky: true\" class=\"loading-footer-row\"\n [class.aup-footer-row-hidden]=\"!loadingRowShown$.value\"></tr>\n </ng-container>\n\n <ng-container *ngFor=\"let footer of footerRowDefs$.value\">\n <ng-container *ngFor=\"let cell of footer.cells\" [matColumnDef]=\"cell.defId\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"cell.colspan\"\n [attr.column-id]=\"cell.columnId\" class=\"footer-cell\">\n <aup-table-footer-row *ngIf=\"!cell.filler\" [cell]=\"cell\"></aup-table-footer-row>\n </td>\n </ng-container>\n <tr mat-footer-row *matFooterRowDef=\"footer.defIds; sticky: true\" [ngClass]=\"footer.rowClasses\"\n [class.aup-footer-row-hidden]=\"footer.visible$ && !footer.visible$.value\"></tr>\n </ng-container>\n\n\n </table>\n</cdk-virtual-scroll-viewport>\n\n", styles: [":host{--enter-animation-duration: .1s;display:flex;flex-direction:column;align-items:stretch}:host.aup-animations-disabled{--enter-animation-duration: 0ms}:host table{width:100%}:host tr.aup-footer-row-hidden{display:none}:host td.footer-cell{border-top:0!important;box-shadow:0 -1px 0 0 var(--mat-table-row-item-outline-color, rgba(0, 0, 0, .12))}:host[scrollMode=virtual] cdk-virtual-scroll-viewport{flex:1}:host[scrollMode=virtual] table th{height:var(--aup-table-header-height);max-height:var(--aup-table-header-height);min-height:var(--aup-table-header-height)}:host[scrollMode=virtual] table td{height:var(--aup-table-row-height);max-height:var(--aup-table-row-height);min-height:var(--aup-table-row-height)}:host[scrollMode=classic]{min-height:0}:host[scrollMode=classic] .classic-scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}:host.hold-scroll-position .classic-scroll-container{overflow-anchor:none}td.loading-row-cell{padding:0}.loading-row{display:flex;align-items:center;justify-content:center;gap:12px;height:var(--aup-table-row-height);color:var(--aup-table-loading-row-color, inherit)}.loading-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.end-of-rows{height:1px;flex-shrink:0;pointer-events:none}\n"] }]
|
|
8305
|
+
], template: "<!-- Reads the loading row's message to screen readers. It is in the page before the message appears in it, as a\n screen reader announces only a change to a status region it already knows, and the loading row is hidden while\n no chunk is on its way. -->\n<div *ngIf=\"tableModel._loadingRow as loadingRow\" role=\"status\" class=\"loading-status\">{{ loadingRowShown$.value ? loadingRow.message() : '' }}</div>\n\n<div #classicScrollContainer class=\"classic-scroll-container\" aup-table-scroller *ngIf=\"scrollMode$.value !== 'virtual'\">\n <table mat-table [dataSource]=\"data$.value\" [trackBy]=\"trackBy\" [multiTemplateDataRows]>\n\n <ng-container *ngFor=\"let column of columns$.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\"\n [class.keep-in-view]=\"column.isKeptInView()\"\n [style.--aup-keep-in-view-left]=\"keptLeftOf($any(column))\" [style.--aup-keep-in-view-right]=\"keptRightOf($any(column))\">\n <aup-table-header-cell [column]=\"$any(column)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"tableModel.isCursorEnabledForRow(column, row)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n [class.keep-in-view]=\"column.isKeptInView()\"\n [style.--aup-keep-in-view-left]=\"keptLeftOf($any(column))\" [style.--aup-keep-in-view-right]=\"keptRightOf($any(column))\"\n >\n <aup-table-cell [column]=\"$any(column)\"\n [row]=\"row\"\n [tableModel]=\"$any(tableModel)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n [aupHighlightTextModel]=\"highlightTextFor($any(column))\"\n ></aup-table-cell>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds$.value; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds$.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\"\n [class.enable-hover]=\"tableModel.isHoverEnabledForRow(row)\"\n [aupTableRowAttributes]=\"tableModel.getRowAttributes(row)\"\n [attr.aup-row-id]=\"trackBy(i, row)\"\n ></tr>\n\n <!-- The loading row, pinned to the bottom of the table above any other footer row. The status region outside the\n table reads its message to screen readers, so the row itself is hidden from them. -->\n <ng-container *ngIf=\"tableModel._loadingRow as loadingRow\" matColumnDef=\"aup-loading-row\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"columnIds$.value.length\" class=\"footer-cell loading-row-cell\">\n <div *ngIf=\"loadingRowShown$.value\" class=\"loading-row\" aup-loading-row aria-hidden=\"true\">\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"20\"></mat-progress-spinner>\n <span>{{ loadingRow.message() }}</span>\n </div>\n </td>\n <tr mat-footer-row *matFooterRowDef=\"['aup-loading-row']; sticky: true\" class=\"loading-footer-row\"\n [class.aup-footer-row-hidden]=\"!loadingRowShown$.value\"></tr>\n </ng-container>\n\n <ng-container *ngFor=\"let footer of footerRowDefs$.value\">\n <ng-container *ngFor=\"let cell of footer.cells\" [matColumnDef]=\"cell.defId\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"cell.colspan\"\n [attr.column-id]=\"cell.columnId\" class=\"footer-cell\">\n <aup-table-footer-row *ngIf=\"!cell.filler\" [cell]=\"cell\"></aup-table-footer-row>\n </td>\n </ng-container>\n <tr mat-footer-row *matFooterRowDef=\"footer.defIds; sticky: true\" [ngClass]=\"footer.rowClasses\"\n [class.aup-footer-row-hidden]=\"footer.visible$ && !footer.visible$.value\"></tr>\n </ng-container>\n\n </table>\n <!-- The marker after the last row, watched to tell when the end of the rows is in view. -->\n <div #endOfRowsMarker *ngIf=\"tableModel._endOfRows && scrollMode$.value === 'classic'\" class=\"end-of-rows\" aria-hidden=\"true\"></div>\n</div>\n\n<cdk-virtual-scroll-viewport *ngIf=\"scrollMode$.value === 'virtual'\" aup-table-scroller\n [@.disabled]=\"animationsDisabled$.value\"\n [tvsItemSize]=\"rowHeight$.value\"\n [headerHeight]=\"headerHeight$.value\"\n [footerEnabled]=\"(footerRowDefs$?.value?.length ?? 0) > 0\"\n [footerHeight]=\"48 * (footerRowDefs$?.value?.length ?? 0)\"\n [bufferMultiplier]=\"bufferMultiplier\"\n>\n <table mat-table [dataSource]=\"virtualScrollDataSource\" [trackBy]=\"trackBy\">\n\n <ng-container *ngFor=\"let column of columns$.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\"\n [class.keep-in-view]=\"column.isKeptInView()\"\n [style.--aup-keep-in-view-left]=\"keptLeftOf($any(column))\" [style.--aup-keep-in-view-right]=\"keptRightOf($any(column))\">\n <aup-table-header-cell [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"tableModel.isCursorEnabledForRow(column, row)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n [class.keep-in-view]=\"column.isKeptInView()\"\n [style.--aup-keep-in-view-left]=\"keptLeftOf($any(column))\" [style.--aup-keep-in-view-right]=\"keptRightOf($any(column))\"\n >\n <aup-table-cell [column]=\"$any(column)\"\n [row]=\"row\"\n [tableModel]=\"$any(tableModel)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n [aupHighlightTextModel]=\"highlightTextFor($any(column))\"\n ></aup-table-cell>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds$.value; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds$.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\"\n [class.enable-hover]=\"tableModel.isHoverEnabledForRow(row)\"\n [aupTableRowAttributes]=\"tableModel.getRowAttributes(row)\"\n [attr.aup-row-id]=\"trackBy(i, row)\"\n ></tr>\n\n <!-- The loading row, pinned to the bottom of the table above any other footer row. The status region outside the\n table reads its message to screen readers, so the row itself is hidden from them. -->\n <ng-container *ngIf=\"tableModel._loadingRow as loadingRow\" matColumnDef=\"aup-loading-row\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"columnIds$.value.length\" class=\"footer-cell loading-row-cell\">\n <div *ngIf=\"loadingRowShown$.value\" class=\"loading-row\" aup-loading-row aria-hidden=\"true\">\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"20\"></mat-progress-spinner>\n <span>{{ loadingRow.message() }}</span>\n </div>\n </td>\n <tr mat-footer-row *matFooterRowDef=\"['aup-loading-row']; sticky: true\" class=\"loading-footer-row\"\n [class.aup-footer-row-hidden]=\"!loadingRowShown$.value\"></tr>\n </ng-container>\n\n <ng-container *ngFor=\"let footer of footerRowDefs$.value\">\n <ng-container *ngFor=\"let cell of footer.cells\" [matColumnDef]=\"cell.defId\">\n <td mat-footer-cell *matFooterCellDef [attr.colspan]=\"cell.colspan\"\n [attr.column-id]=\"cell.columnId\" class=\"footer-cell\">\n <aup-table-footer-row *ngIf=\"!cell.filler\" [cell]=\"cell\"></aup-table-footer-row>\n </td>\n </ng-container>\n <tr mat-footer-row *matFooterRowDef=\"footer.defIds; sticky: true\" [ngClass]=\"footer.rowClasses\"\n [class.aup-footer-row-hidden]=\"footer.visible$ && !footer.visible$.value\"></tr>\n </ng-container>\n\n\n </table>\n</cdk-virtual-scroll-viewport>\n\n", styles: [":host{--enter-animation-duration: .1s;display:flex;flex-direction:column;align-items:stretch}:host.aup-animations-disabled{--enter-animation-duration: 0ms}:host table{width:100%}:host tr.aup-footer-row-hidden{display:none}:host td.footer-cell{border-top:0!important;box-shadow:0 -1px 0 0 var(--mat-table-row-item-outline-color, rgba(0, 0, 0, .12))}:host[scrollMode=virtual] cdk-virtual-scroll-viewport{flex:1}:host[scrollMode=virtual] table th{height:var(--aup-table-header-height);max-height:var(--aup-table-header-height);min-height:var(--aup-table-header-height)}:host[scrollMode=virtual] table td{height:var(--aup-table-row-height);max-height:var(--aup-table-row-height);min-height:var(--aup-table-row-height)}:host[scrollMode=classic]{min-height:0}:host[scrollMode=classic] .classic-scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}:host.hold-scroll-position .classic-scroll-container{overflow-anchor:none}td.loading-row-cell{padding:0}.loading-row{display:flex;align-items:center;justify-content:center;gap:12px;height:var(--aup-table-row-height);color:var(--aup-table-loading-row-color, inherit)}.loading-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.end-of-rows{height:1px;flex-shrink:0;pointer-events:none}\n"] }]
|
|
8207
8306
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
8208
8307
|
type: Inject,
|
|
8209
8308
|
args: [AUP_TABLE_VIRTUAL_SCROLL_BUFFER_MULTIPLIER]
|