@coolon/angular-ui-powerups 16.1.0-alpha.223 → 16.1.0-alpha.225
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 +24 -6
- package/esm2022/lib/components/tables/abstract-table-model.mjs +11 -7
- package/esm2022/lib/components/tables/footer/footer-row-model.mjs +106 -9
- package/esm2022/lib/components/tables/renderer/table-body/table-body.component.mjs +12 -19
- package/esm2022/lib/components/tables/renderer/table-footer-row/table-footer-row.component.mjs +17 -15
- package/esm2022/lib/components/tables/table/table.component.mjs +3 -3
- package/esm2022/lib/components/tables/tree-table/tree-table-component.mjs +1 -1
- package/esm2022/lib/place/navigation/session/navigation-session.mjs +10 -1
- package/esm2022/lib/place/place-component.mjs +17 -13
- package/esm2022/lib/place/place-router.mjs +90 -15
- package/fesm2022/coolon-angular-ui-powerups.mjs +255 -71
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/tables/abstract-table-model.d.ts +6 -3
- package/lib/components/tables/footer/footer-row-model.d.ts +58 -8
- package/lib/components/tables/renderer/table-body/table-body.component.d.ts +5 -7
- package/lib/components/tables/renderer/table-footer-row/table-footer-row.component.d.ts +4 -5
- package/lib/place/navigation/session/navigation-session.d.ts +7 -0
- package/lib/place/place-router.d.ts +17 -0
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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
|
-
|
|
88
|
+
/** A footer row spanning the full table width (the row component lays out its own content). */
|
|
89
|
+
addFooterRow<C>(component: ComponentType<C>, initialiseCallback?: (component: C) => void): FooterRowModel.Impl;
|
|
90
|
+
/** A column-aligned footer row whose cells anchor to specific columns. */
|
|
91
|
+
addFooterRow(builder: (row: FooterRowCellsBuilder) => 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
|
-
|
|
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():
|
|
11
|
-
addClass(className: string, condition?: () => boolean):
|
|
52
|
+
noPadding(): this;
|
|
53
|
+
addClass(className: string, condition?: () => boolean): this;
|
|
12
54
|
}
|
|
13
55
|
export declare namespace FooterRowModel {
|
|
14
|
-
class Impl
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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,
|
|
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
|
-
|
|
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; }; "
|
|
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 {
|
|
2
|
+
import type { ResolvedFooterCell } from "../../footer/footer-row-model";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class TableFooterRow {
|
|
5
|
-
|
|
6
|
-
|
|
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, { "
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableFooterRow, "aup-table-footer-row", never, { "cell": { "alias": "cell"; "required": false; }; }, {}, never, never, false, never>;
|
|
11
10
|
}
|
|
@@ -22,6 +22,13 @@ export declare abstract class NavigationSession extends GarbageCollector {
|
|
|
22
22
|
private _interactionContext;
|
|
23
23
|
constructor(context: NavigationContext, startingUrl: string);
|
|
24
24
|
get isInteractionSync(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Interruptible sessions are internal housekeeping navigations (e.g. interaction-id
|
|
27
|
+
* synchronisation) that a real user- or model-driven navigation is allowed to queue behind
|
|
28
|
+
* and supersede, rather than being rejected. Real navigations (Navigating, PopState) are not
|
|
29
|
+
* interruptible.
|
|
30
|
+
*/
|
|
31
|
+
get isInterruptible(): boolean;
|
|
25
32
|
get name(): string;
|
|
26
33
|
get urlService(): UrlService;
|
|
27
34
|
get interactionServiceAdapter(): InteractionServiceRoutingAdapter;
|
|
@@ -26,6 +26,9 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
26
26
|
private readonly _activeVisit$;
|
|
27
27
|
private readonly routerInteractionAdapter;
|
|
28
28
|
private sessionFinishedJobs;
|
|
29
|
+
private pendingNavigation?;
|
|
30
|
+
private queuedNavigationDepth;
|
|
31
|
+
private static readonly MAX_QUEUED_NAVIGATION_DEPTH;
|
|
29
32
|
readonly authService: PlaceAuthService;
|
|
30
33
|
private readonly _ready$;
|
|
31
34
|
readonly ready$: ValueModel<boolean>;
|
|
@@ -48,6 +51,20 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
48
51
|
navigate(visit: Visit): any;
|
|
49
52
|
navigate(placeComponent: Constructable<PlaceComponent>, params?: Record<string, unknown>): any;
|
|
50
53
|
doNavigation(visit: Visit, runNavigationCommands: (router: Router) => unknown): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Handles a navigation triggered while another is already in flight.
|
|
56
|
+
*
|
|
57
|
+
* This used to throw `illegalState('Navigation already in progress')`, which killed the
|
|
58
|
+
* triggering action - occasionally seen in production when a user click collided with an
|
|
59
|
+
* in-flight interaction-id sync. Instead we warn with diagnostic context and decide based on the
|
|
60
|
+
* in-progress session:
|
|
61
|
+
* - interruptible session in progress (internal housekeeping, e.g. interaction-id sync) -> queue
|
|
62
|
+
* the incoming navigation and run it once the current session finishes (coalescing to latest).
|
|
63
|
+
* - real navigation in progress -> keep it and drop the incoming one (logging full context).
|
|
64
|
+
*/
|
|
65
|
+
private handleOverlappingNavigation;
|
|
66
|
+
private queueNavigation;
|
|
67
|
+
private flushPendingNavigation;
|
|
51
68
|
navigateByUrl(urlSnapshot: UrlSnapshot, navigationExtras?: NavigationExtras): Promise<boolean>;
|
|
52
69
|
get activeVisit$(): ValueModel<Visit>;
|
|
53
70
|
filterAuthorizedPlaces(places: ReadonlyArray<Constructable<PlaceComponent>>, options: DisposedWith): ListModel<Constructable<PlaceComponent>>;
|