@coolon/angular-ui-powerups 16.1.0-alpha.327 → 16.1.0-alpha.329

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.
@@ -79,10 +79,10 @@ export declare abstract class AbstractTableModel<Row extends object> extends Gar
79
79
  * 3. A column that names search classes, none of them for the page's search criteria, fails when the
80
80
  * table initialises, naming the column and the search criteria class. The check runs then, so a
81
81
  * page calls this before the table initialises, and a later call throws.
82
- * 4. New criteria are offered only when they differ in value from the last. Generated DTOs compare by
83
- * identity, so a search class's dependency can change, or a column be shown, without changing what
84
- * the search writes, and a page that starts its list again on every new criteria would restart it
85
- * for nothing.
82
+ * 4. New criteria are offered only when they differ in value from the last. A search class's
83
+ * dependency can change, or a column be shown, without changing what the search writes, and a page
84
+ * that starts its list again on every new criteria would restart it for nothing. Criteria with an
85
+ * `equals` method, as generated DTOs have, are compared with it; any others are compared deeply.
86
86
  *
87
87
  * The criteria are worked out again when the base criteria, the search, the visible columns or any
88
88
  * search class's `dependsOn` change.
@@ -29,7 +29,10 @@ export declare class TableBodyComponent<Row extends object> extends ResizeAwareC
29
29
  trackBy: (index: number, item: Row) => any;
30
30
  accessor scrollMode$: ValueModel<TableBodyComponent.ScrollMode>;
31
31
  accessor scrollMode: TableBodyComponent.ScrollMode;
32
+ /** Keeps the rows in view where they are when rows change above them: see `TableComponent.holdScrollPosition`. */
33
+ holdScrollPosition: boolean;
32
34
  scrollViewport: CdkVirtualScrollViewport;
35
+ private classicScrollContainer?;
33
36
  columns$: ListModelChain<ColumnModel<Row>>;
34
37
  columnIds$: ListModelChain<string>;
35
38
  footerRowDefs$: ValueModel<ResolvedFooterRow[]>;
@@ -82,6 +85,17 @@ export declare class TableBodyComponent<Row extends object> extends ResizeAwareC
82
85
  protected takeHeightsFromTheme(): void;
83
86
  /** A length custom property as resolved on an element, in px; undefined when unset or not a length. */
84
87
  private readCssPixels;
88
+ /**
89
+ * Where each row in view sits, by its id, when [holdScrollPosition] applies and the table is scrolled down;
90
+ * otherwise undefined. A row behind the sticky header is not in view.
91
+ */
92
+ private rowsInViewToHold;
93
+ /**
94
+ * Renders the new rows now, then scrolls by however far the first of [rowsInView] still in the table has
95
+ * moved, so it is drawn where it was. Both happen before the browser paints, so the reader never sees the
96
+ * rows move.
97
+ */
98
+ private holdInView;
85
99
  private scheduleTableHeightCheck;
86
100
  private notifyScrolled;
87
101
  private notifyScrollEnded;
@@ -89,8 +103,13 @@ export declare class TableBodyComponent<Row extends object> extends ResizeAwareC
89
103
  private resetAnimationsAfterFrame;
90
104
  private clearScrollTimeout;
91
105
  static ɵfac: i0.ɵɵFactoryDeclaration<TableBodyComponent<any>, [{ optional: true; }]>;
92
- static ɵcmp: i0.ɵɵComponentDeclaration<TableBodyComponent<any>, "aup-table-body", never, { "data$": { "alias": "data$"; "required": false; }; "tableModel": { "alias": "tableModel"; "required": false; }; "footerRows": { "alias": "footerRows"; "required": false; }; "showHeader$": { "alias": "showHeader$"; "required": false; }; "showHeader": { "alias": "showHeader"; "required": false; }; "trackBy": { "alias": "trackBy"; "required": false; }; "scrollMode$": { "alias": "scrollMode$"; "required": false; }; "scrollMode": { "alias": "scrollMode"; "required": false; }; }, {}, never, never, false, never>;
106
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableBodyComponent<any>, "aup-table-body", never, { "data$": { "alias": "data$"; "required": false; }; "tableModel": { "alias": "tableModel"; "required": false; }; "footerRows": { "alias": "footerRows"; "required": false; }; "showHeader$": { "alias": "showHeader$"; "required": false; }; "showHeader": { "alias": "showHeader"; "required": false; }; "trackBy": { "alias": "trackBy"; "required": false; }; "scrollMode$": { "alias": "scrollMode$"; "required": false; }; "scrollMode": { "alias": "scrollMode"; "required": false; }; "holdScrollPosition": { "alias": "holdScrollPosition"; "required": false; }; }, {}, never, never, false, never>;
93
107
  }
94
108
  export declare namespace TableBodyComponent {
95
109
  type ScrollMode = "none" | "classic" | "virtual";
110
+ /** A row in view, by the id it is drawn with, and the top of its box in the viewport. */
111
+ interface RowInView {
112
+ readonly id: string;
113
+ readonly top: number;
114
+ }
96
115
  }
@@ -85,6 +85,13 @@ export declare class TableComponent<Row extends object> extends AbstractTableCom
85
85
  */
86
86
  accessor scrollMode$: ValueModel<TableComponent.ScrollMode>;
87
87
  accessor scrollMode: TableComponent.ScrollMode;
88
+ /**
89
+ * Set to true to keep the rows in view where they are when rows are inserted, removed or resized above
90
+ * them, so a reader scrolled down the table is not moved. At the top of the table nothing is held, so a
91
+ * row inserted there comes into view. Applies with `scrollMode="classic"` only, and only to rows with an
92
+ * identity of their own (a list `identifiedBy` an id), because a row is found again by its id.
93
+ */
94
+ holdScrollPosition: boolean;
88
95
  private _footerContentAdded;
89
96
  private readonly _filteredRows$;
90
97
  protected readonly tableBodyScrollMode$: ValueModel<TableBodyComponent.ScrollMode>;
@@ -99,7 +106,7 @@ export declare class TableComponent<Row extends object> extends AbstractTableCom
99
106
  protected get showsEmptyContent(): boolean;
100
107
  footerContentChanged($event: unknown): void;
101
108
  static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent<any>, never>;
102
- static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent<any>, "aup-table", never, { "tableModel": { "alias": "tableModel"; "required": false; }; "filterModel": { "alias": "filterModel"; "required": false; }; "scrollMode$": { "alias": "scrollMode$"; "required": false; }; "scrollMode": { "alias": "scrollMode"; "required": false; }; }, {}, never, ["[empty], [slot=empty]", "[footer], [slot=footer]"], false, never>;
109
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent<any>, "aup-table", never, { "tableModel": { "alias": "tableModel"; "required": false; }; "filterModel": { "alias": "filterModel"; "required": false; }; "scrollMode$": { "alias": "scrollMode$"; "required": false; }; "scrollMode": { "alias": "scrollMode"; "required": false; }; "holdScrollPosition": { "alias": "holdScrollPosition"; "required": false; }; }, {}, never, ["[empty], [slot=empty]", "[footer], [slot=footer]"], false, never>;
103
110
  }
104
111
  export declare namespace TableComponent {
105
112
  type ScrollMode = Omit<TableBodyComponent.ScrollMode, 'none'>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "16.1.0-alpha.327",
3
+ "version": "16.1.0-alpha.329",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^16.2.9",
6
6
  "@angular/common": "^16.2.9",