@coolon/angular-ui-powerups 16.1.0-alpha.330 → 16.1.0-alpha.331
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/esm2022/lib/components/tables/abstract-table-model.mjs +16 -1
- package/esm2022/lib/components/tables/renderer/table-body/table-body.component.mjs +41 -4
- package/fesm2022/coolon-angular-ui-powerups.mjs +54 -2
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/tables/abstract-table-model.d.ts +11 -0
- package/lib/components/tables/renderer/table-body/table-body.component.d.ts +13 -0
- package/package.json +1 -1
|
@@ -40,6 +40,15 @@ export declare abstract class AbstractTableModel<Row extends object> extends Gar
|
|
|
40
40
|
readonly selectableRows$: ListModel<Row>;
|
|
41
41
|
readonly leadSelection$: ValueModel<Row>;
|
|
42
42
|
readonly hasSelection$: BooleanValueModelChain;
|
|
43
|
+
private readonly _endInView$;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the end of a classic-scrolling table's rows is in view: the reader has scrolled to within a
|
|
46
|
+
* few rows of the last, or the rows do not fill the table. A page that loads its rows a step at a time
|
|
47
|
+
* loads the next step while it is true. Once the rows fill the table and the reader is above their
|
|
48
|
+
* end, it turns false; while they still do not, it stays true, so the page loads again when its step
|
|
49
|
+
* lands. A table that does not scroll, or scrolls virtually, leaves it false.
|
|
50
|
+
*/
|
|
51
|
+
readonly endInView$: ValueModel<boolean>;
|
|
43
52
|
readonly footerRowModels: FooterRowModel.Impl[];
|
|
44
53
|
private readonly _viewDependencies;
|
|
45
54
|
/** The table's settled search, once a table with a filter model binds (`useSearch`). */
|
|
@@ -175,5 +184,7 @@ export declare abstract class AbstractTableModel<Row extends object> extends Gar
|
|
|
175
184
|
isCursorEnabledForRow(column: ColumnModel<Row>, row: Row): boolean;
|
|
176
185
|
selectRow(row: Row): void;
|
|
177
186
|
onRowClicked(callback: (row: Row) => void): Disposable;
|
|
187
|
+
/** Called by the table body as the end of its rows comes into view or leaves it. */
|
|
188
|
+
_notifyEndInView(inView: boolean): void;
|
|
178
189
|
_notifyCellClicked(columnModel: ColumnModel<Row>, row: Row): void;
|
|
179
190
|
}
|
|
@@ -33,6 +33,11 @@ export declare class TableBodyComponent<Row extends object> extends ResizeAwareC
|
|
|
33
33
|
holdScrollPosition: boolean;
|
|
34
34
|
scrollViewport: CdkVirtualScrollViewport;
|
|
35
35
|
private classicScrollContainer?;
|
|
36
|
+
/** The marker after the last row, watched so the table model knows when the end of the rows is in view. */
|
|
37
|
+
private set endOfRows(value);
|
|
38
|
+
private endOfRowsMarker?;
|
|
39
|
+
private endOfRowsObserver?;
|
|
40
|
+
private readonly zone;
|
|
36
41
|
columns$: ListModelChain<ColumnModel<Row>>;
|
|
37
42
|
columnIds$: ListModelChain<string>;
|
|
38
43
|
footerRowDefs$: ValueModel<ResolvedFooterRow[]>;
|
|
@@ -100,6 +105,12 @@ export declare class TableBodyComponent<Row extends object> extends ResizeAwareC
|
|
|
100
105
|
private notifyScrolled;
|
|
101
106
|
private notifyScrollEnded;
|
|
102
107
|
ngOnDestroy(): void;
|
|
108
|
+
/**
|
|
109
|
+
* Watches the marker after the last row while the table scrolls classically, and tells the table model
|
|
110
|
+
* whether it is in view (`AbstractTableModel.endInView$`). The marker counts as in view from a few rows
|
|
111
|
+
* below the visible bottom, so a page that loads more has the rows ready by the time they are reached.
|
|
112
|
+
*/
|
|
113
|
+
private watchEndOfRows;
|
|
103
114
|
private resetAnimationsAfterFrame;
|
|
104
115
|
private clearScrollTimeout;
|
|
105
116
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableBodyComponent<any>, [{ optional: true; }]>;
|
|
@@ -107,6 +118,8 @@ export declare class TableBodyComponent<Row extends object> extends ResizeAwareC
|
|
|
107
118
|
}
|
|
108
119
|
export declare namespace TableBodyComponent {
|
|
109
120
|
type ScrollMode = "none" | "classic" | "virtual";
|
|
121
|
+
/** How far below the visible bottom the end of the rows counts as in view: about four rows. */
|
|
122
|
+
const END_OF_ROWS_MARGIN_PIXELS = 200;
|
|
110
123
|
/** A row in view, by the id it is drawn with, and the top of its box in the viewport. */
|
|
111
124
|
interface RowInView {
|
|
112
125
|
readonly id: string;
|