@coolon/angular-ui-powerups 16.1.0-alpha.338 → 16.1.0-alpha.340
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/esm2022/lib/components/tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.mjs +4 -1
- package/fesm2022/coolon-angular-ui-powerups.mjs +104 -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
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Disposable } from "@coolon/pectin";
|
|
2
|
+
import type { ColumnModel } from "../../column/column-model";
|
|
3
|
+
/**
|
|
4
|
+
* Where each column kept in view holds while it is stuck, so that two kept columns never stick in the same place. A
|
|
5
|
+
* column held at the left edge sits inside the kept columns before it, and one held at the right edge inside the kept
|
|
6
|
+
* columns after it. The offsets follow the widths of the kept header cells, and a table that shows no header keeps
|
|
7
|
+
* every kept column at the edge itself.
|
|
8
|
+
*
|
|
9
|
+
* The offsets are custom properties on the table body, which each kept cell reads in its `left` and `right`. A cell
|
|
10
|
+
* keeps the same reference for its whole life, so a resize changes no binding and checks no view, and a row drawn
|
|
11
|
+
* later by the virtual scroller reads the current offsets at once. The reference is a custom property of the cell, not
|
|
12
|
+
* an inline `left` and `right`: the CDK table clears every cell's inline `left` and `right` when its columns change.
|
|
13
|
+
*/
|
|
14
|
+
export declare class KeptColumnOffsets implements Disposable {
|
|
15
|
+
private readonly body;
|
|
16
|
+
private readonly columnOf;
|
|
17
|
+
private readonly resizeObserver;
|
|
18
|
+
private cells;
|
|
19
|
+
private propertiesSet;
|
|
20
|
+
private disposed;
|
|
21
|
+
/**
|
|
22
|
+
* @param body the table body whose kept header cells are measured. A table nested in a cell has its own.
|
|
23
|
+
* @param columnOf finds the column a header cell's `column-id` names.
|
|
24
|
+
*/
|
|
25
|
+
constructor(body: HTMLElement, columnOf: (columnId: string) => ColumnModel<any> | undefined);
|
|
26
|
+
/** Measures the kept header cells the body draws now. Call it once the body has drawn a change of columns. */
|
|
27
|
+
watchCells(): void;
|
|
28
|
+
dispose(): void;
|
|
29
|
+
private measure;
|
|
30
|
+
}
|
|
31
|
+
export declare namespace KeptColumnOffsets {
|
|
32
|
+
function leftProperty(column: ColumnModel<any>): string;
|
|
33
|
+
function rightProperty(column: ColumnModel<any>): string;
|
|
34
|
+
/** A kept cell's offset from the left, 0 until the body has measured the kept columns. */
|
|
35
|
+
function leftOf(column: ColumnModel<any>): string;
|
|
36
|
+
/** A kept cell's offset from the right, 0 until the body has measured the kept columns. */
|
|
37
|
+
function rightOf(column: ColumnModel<any>): string;
|
|
38
|
+
}
|
|
@@ -6,6 +6,7 @@ import { ResizeAwareComponent } from "../../../resize-aware.component";
|
|
|
6
6
|
import { AbstractTableModel } from "../../abstract-table-model";
|
|
7
7
|
import type { ColumnModel } from "../../column/column-model";
|
|
8
8
|
import { FooterRowModel, ResolvedFooterRow } from "../../footer/footer-row-model";
|
|
9
|
+
import { KeptColumnOffsets } from "./kept-column-offsets";
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
export declare const AUP_TABLE_VIRTUAL_SCROLL_BUFFER_MULTIPLIER: InjectionToken<number>;
|
|
11
12
|
export declare const AUP_TABLE_OPTIMIZED_CHANGE_DETECTION: InjectionToken<boolean>;
|
|
@@ -90,6 +91,8 @@ export declare class TableBodyComponent<Row extends object> extends ResizeAwareC
|
|
|
90
91
|
private animationsResetRafId;
|
|
91
92
|
private scrollEndAbortController;
|
|
92
93
|
protected readonly optimisedChangeDetectionEnabled: boolean;
|
|
94
|
+
/** Where each column kept in view holds, so that kept columns stuck to the same edge sit side by side. */
|
|
95
|
+
protected readonly keptColumnOffsets: KeptColumnOffsets;
|
|
93
96
|
private viewInitialized;
|
|
94
97
|
protected markForCheck(): void;
|
|
95
98
|
constructor(bufferMultiplier?: number);
|
|
@@ -102,6 +105,10 @@ export declare class TableBodyComponent<Row extends object> extends ResizeAwareC
|
|
|
102
105
|
* only the columns the server is asked about (`ColumnModel.highlightsSearch`).
|
|
103
106
|
*/
|
|
104
107
|
protected highlightTextFor(column: ColumnModel<Row>): ValueModel<string>;
|
|
108
|
+
/** Where a column kept in view holds from the left; null for any other column. */
|
|
109
|
+
protected keptLeftOf(column: ColumnModel<Row>): string | null;
|
|
110
|
+
/** Where a column kept in view holds from the right; null for any other column. */
|
|
111
|
+
protected keptRightOf(column: ColumnModel<Row>): string | null;
|
|
105
112
|
notifyCellClicked(columnModel: ColumnModel<Row>, row: Row): void;
|
|
106
113
|
isFirstVisibleColumn(columnId: string): boolean;
|
|
107
114
|
isLastVisibleColumn(columnId: string): boolean;
|