@coolon/angular-ui-powerups 16.1.0-alpha.224 → 16.1.0-alpha.226

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.
@@ -11,7 +11,7 @@ import { ListPropertyColumnModel } from './column/list-propery-column-model';
11
11
  import { PropertyColumnModel } from './column/property-column-model';
12
12
  import { SelectionColumnModel } from './column/selection-column-model';
13
13
  import type { TextSearchPredicate } from './filter/text-search-predicate';
14
- import { FooterRowModel } from './footer/footer-row-model';
14
+ import { FooterRowCellsBuilder, FooterRowModel } from './footer/footer-row-model';
15
15
  import type { CellRenderer } from './renderer/cell-renderer';
16
16
  import type { MenuBuilder } from './renderer/table-action-column/menu-builder';
17
17
  import { TableActionColumnComponent } from './renderer/table-action-column/table-action-column.component';
@@ -35,7 +35,7 @@ export declare abstract class AbstractTableModel<Row extends object> extends Gar
35
35
  readonly selectedItems$: ListModel<Row>;
36
36
  readonly leadSelection$: ValueModel<Row>;
37
37
  readonly hasSelection$: BooleanValueModelChain;
38
- footerRowModel: FooterRowModel.Impl<any>;
38
+ readonly footerRowModels: FooterRowModel.Impl[];
39
39
  private readonly _viewDependencies;
40
40
  constructor();
41
41
  protected setDataSource(dataSource$: any): void;
@@ -85,7 +85,10 @@ export declare abstract class AbstractTableModel<Row extends object> extends Gar
85
85
  */
86
86
  addCustomMoreMenu<C extends TableCustomMoreMenuPopupComponent<Row>>(componentClass: Constructable<C>, initialiseCallback?: (component: C) => void): CustomValueColumnModel<Row, Row>;
87
87
  addActionColumn(builder: (menu: TableActionColumnComponent<Row>) => void): CustomValueColumnModel<Row, Row>;
88
- addFooterRow<C>(component: ComponentType<C>, initialiseCallback?: (component: C) => void): FooterRowModel<C>;
88
+ /** A column-aligned footer row whose cells anchor to specific columns. */
89
+ addFooterRow(builder: (row: FooterRowCellsBuilder) => void): FooterRowModel.Impl;
90
+ /** A footer row spanning the full table width (the row component lays out its own content). */
91
+ addFooterRow<C>(component: ComponentType<C>, initialiseCallback?: (component: C) => void): FooterRowModel.Impl;
89
92
  addTemplateColumn<V>(columnId: string): CustomTemplateColumnModel<Row>;
90
93
  addRowClass(className: string, predicate: (row: Row) => boolean, options?: DependsOnOptions): void;
91
94
  addRowAttribute(attributeName: string, getValue: (row: Row) => string): void;
@@ -5,18 +5,68 @@ declare class RowClass {
5
5
  readonly matches: () => boolean;
6
6
  constructor(className: string, matches: () => boolean);
7
7
  }
8
- export declare abstract class FooterRowModel<C> {
8
+ /**
9
+ * A single cell within a footer row.
10
+ * - `span: 'all'` — the legacy full-width footer (one cell spanning every column).
11
+ * - `span: 'rest'` — anchored after the previous cell, spanning all remaining columns.
12
+ * - `span: <n>` — anchored at `columnId`, covering `n` columns.
13
+ */
14
+ export interface FooterCell {
15
+ readonly portal: ComponentPortal<any>;
16
+ readonly onInit?: (component: any) => void;
17
+ /** Visible column this cell anchors to. Undefined => placed immediately after the previous cell. */
18
+ readonly columnId?: string;
19
+ readonly span: number | 'rest' | 'all';
20
+ }
21
+ /** Builds the cells of a column-aligned footer row. */
22
+ export declare class FooterRowCellsBuilder {
23
+ readonly cells: FooterCell[];
24
+ /** A cell occupying the single column `columnId`. */
25
+ cell<C>(columnId: string, component: ComponentType<C>, onInit?: (component: C) => void): this;
26
+ /** A cell anchored at `columnId`, spanning `span` columns. */
27
+ cellSpanning<C>(columnId: string, span: number, component: ComponentType<C>, onInit?: (component: C) => void): this;
28
+ /** A cell anchored immediately after the previous cell, spanning every remaining column. */
29
+ cellSpanningRest<C>(component: ComponentType<C>, onInit?: (component: C) => void): this;
30
+ private add;
31
+ }
32
+ /** A footer cell resolved against the current visible columns — ready to render. */
33
+ export interface ResolvedFooterCell {
34
+ readonly defId: string;
35
+ readonly portal?: ComponentPortal<any>;
36
+ readonly onInit?: (component: any) => void;
37
+ readonly colspan: number;
38
+ readonly columnId?: string;
39
+ readonly filler: boolean;
40
+ readonly fullWidth: boolean;
41
+ readonly firstColumn: boolean;
42
+ readonly lastColumn: boolean;
43
+ }
44
+ export interface ResolvedFooterRow {
45
+ readonly rowIndex: number;
46
+ readonly defIds: string[];
47
+ readonly cells: ResolvedFooterCell[];
48
+ readonly rowClasses: string;
49
+ }
50
+ export declare abstract class FooterRowModel {
9
51
  protected readonly _rowClasses: RowClass[];
10
- noPadding(): void;
11
- addClass(className: string, condition?: () => boolean): void;
52
+ noPadding(): this;
53
+ addClass(className: string, condition?: () => boolean): this;
12
54
  }
13
55
  export declare namespace FooterRowModel {
14
- class Impl<C> extends FooterRowModel<C> {
15
- protected readonly component: ComponentType<C>;
16
- readonly onInit?: (component: C) => void;
17
- readonly portal: ComponentPortal<C>;
18
- constructor(component: ComponentType<C>, onInit?: (component: C) => void);
56
+ class Impl extends FooterRowModel {
57
+ readonly cells: FooterCell[];
58
+ constructor(cells: FooterCell[]);
59
+ /** Legacy footer: one component spanning the full table width. */
60
+ static fullWidth<C>(component: ComponentType<C>, onInit?: (component: C) => void): Impl;
61
+ static fromBuilder(build: (row: FooterRowCellsBuilder) => void): Impl;
19
62
  getActiveRowClasses(): string;
63
+ /**
64
+ * Resolve this row's cells against the current visible column ids: anchor each cell,
65
+ * fill unanchored gaps with empty cells, and drop cells whose anchor column is hidden
66
+ * (their space folds into the surrounding fillers). The colspans always sum to the
67
+ * column count so the footer aligns with the body columns.
68
+ */
69
+ resolve(rowIndex: number, visibleColumnIds: string[]): ResolvedFooterRow;
20
70
  }
21
71
  }
22
72
  export {};
@@ -1,12 +1,11 @@
1
- import { CdkPortalOutletAttachedRef } from "@angular/cdk/portal";
2
1
  import { CdkVirtualScrollViewport } from "@angular/cdk/scrolling";
3
2
  import { AfterViewInit, ElementRef, InjectionToken, OnDestroy, OnInit } from "@angular/core";
4
- import { ListModel, ListModelChain, MutableValueModel, Proxify, ValueModel } from "@coolon/pectin";
3
+ import { ListModel, ListModelChain, MutableValueModel, ValueModel } from "@coolon/pectin";
5
4
  import { TableVirtualScrollDataSource } from "ng-table-virtual-scroll";
6
5
  import { ResizeAwareComponent } from "../../../resize-aware.component";
7
6
  import { AbstractTableModel } from "../../abstract-table-model";
8
7
  import type { ColumnModel } from "../../column/column-model";
9
- import { FooterRowModel } from "../../footer/footer-row-model";
8
+ import { FooterRowModel, ResolvedFooterRow } from "../../footer/footer-row-model";
10
9
  import * as i0 from "@angular/core";
11
10
  export declare const AUP_TABLE_VIRTUAL_SCROLL_BUFFER_MULTIPLIER: InjectionToken<number>;
12
11
  export declare const AUP_TABLE_OPTIMIZED_CHANGE_DETECTION: InjectionToken<boolean>;
@@ -22,7 +21,7 @@ export declare class TableBodyComponent<Row extends object> extends ResizeAwareC
22
21
  protected bufferMultiplier: number;
23
22
  accessor data$: ListModel<Row>;
24
23
  accessor tableModel: AbstractTableModel<Row>;
25
- accessor footerRow: FooterRowModel.Impl<any>;
24
+ footerRows: FooterRowModel.Impl[];
26
25
  accessor showHeader$: ValueModel<boolean>;
27
26
  accessor showHeader: boolean;
28
27
  trackBy: (index: number, item: Row) => any;
@@ -31,6 +30,7 @@ export declare class TableBodyComponent<Row extends object> extends ResizeAwareC
31
30
  scrollViewport: CdkVirtualScrollViewport;
32
31
  columns$: ListModelChain<ColumnModel<Row>>;
33
32
  columnIds$: ListModelChain<string>;
33
+ footerRowDefs$: ValueModel<ResolvedFooterRow[]>;
34
34
  private columnsById$;
35
35
  protected readonly headerHeight$: MutableValueModel<number>;
36
36
  protected rowHeight$: MutableValueModel<number>;
@@ -60,10 +60,8 @@ export declare class TableBodyComponent<Row extends object> extends ResizeAwareC
60
60
  ngOnDestroy(): void;
61
61
  private resetAnimationsAfterFrame;
62
62
  private clearScrollTimeout;
63
- initialiseFooter($event: CdkPortalOutletAttachedRef): void;
64
- protected readonly Proxify: typeof Proxify;
65
63
  static ɵfac: i0.ɵɵFactoryDeclaration<TableBodyComponent<any>, [{ optional: true; }]>;
66
- static ɵcmp: i0.ɵɵComponentDeclaration<TableBodyComponent<any>, "aup-table-body", never, { "data$": { "alias": "data$"; "required": false; }; "tableModel": { "alias": "tableModel"; "required": false; }; "footerRow": { "alias": "footerRow"; "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>;
64
+ 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>;
67
65
  }
68
66
  export declare namespace TableBodyComponent {
69
67
  type ScrollMode = "none" | "classic" | "virtual";
@@ -1,11 +1,10 @@
1
1
  import { CdkPortalOutletAttachedRef } from "@angular/cdk/portal";
2
- import { FooterRowModel } from "../../footer/footer-row-model";
2
+ import type { ResolvedFooterCell } from "../../footer/footer-row-model";
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class TableFooterRow {
5
- row: FooterRowModel.Impl<any>;
6
- defaultClassNames: string;
7
- get rowClasses(): string;
5
+ cell: ResolvedFooterCell;
6
+ get cssClasses(): string;
8
7
  initialise($event: CdkPortalOutletAttachedRef): void;
9
8
  static ɵfac: i0.ɵɵFactoryDeclaration<TableFooterRow, never>;
10
- static ɵcmp: i0.ɵɵComponentDeclaration<TableFooterRow, "aup-table-footer-row", never, { "row": { "alias": "row"; "required": false; }; }, {}, never, never, false, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableFooterRow, "aup-table-footer-row", never, { "cell": { "alias": "cell"; "required": false; }; }, {}, never, never, false, never>;
11
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "16.1.0-alpha.224",
3
+ "version": "16.1.0-alpha.226",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^16.2.9",
6
6
  "@angular/common": "^16.2.9",