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

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.
Files changed (33) hide show
  1. package/esm2022/lib/components/exports.mjs +6 -1
  2. package/esm2022/lib/components/tables/abstract-table-model.mjs +94 -2
  3. package/esm2022/lib/components/tables/column/column-model.mjs +51 -1
  4. package/esm2022/lib/components/tables/column/custom-value-column-model.mjs +3 -1
  5. package/esm2022/lib/components/tables/column/list-propery-column-model.mjs +3 -1
  6. package/esm2022/lib/components/tables/column/property-column-model.mjs +3 -1
  7. package/esm2022/lib/components/tables/filter/cell-search.mjs +2 -0
  8. package/esm2022/lib/components/tables/filter/search-criteria.decorator.mjs +33 -0
  9. package/esm2022/lib/components/tables/filter/server-search-model.mjs +41 -0
  10. package/esm2022/lib/components/tables/filter/table-filter-model.mjs +11 -23
  11. package/esm2022/lib/components/tables/filter/table-search-model.mjs +44 -0
  12. package/esm2022/lib/components/tables/filter/table-search.mjs +2 -0
  13. package/esm2022/lib/components/tables/renderer/table-body/table-body.component.mjs +22 -9
  14. package/esm2022/lib/components/tables/table/table.component.mjs +4 -3
  15. package/esm2022/lib/interaction/services/interaction.service.mjs +19 -12
  16. package/esm2022/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.mjs +5 -3
  17. package/esm2022/lib/place/place-router.mjs +50 -27
  18. package/fesm2022/coolon-angular-ui-powerups.mjs +392 -104
  19. package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
  20. package/lib/components/exports.d.ts +5 -0
  21. package/lib/components/tables/abstract-table-model.d.ts +48 -1
  22. package/lib/components/tables/column/column-model.d.ts +31 -1
  23. package/lib/components/tables/filter/cell-search.d.ts +52 -0
  24. package/lib/components/tables/filter/search-criteria.decorator.d.ts +21 -0
  25. package/lib/components/tables/filter/server-search-model.d.ts +29 -0
  26. package/lib/components/tables/filter/table-filter-model.d.ts +9 -9
  27. package/lib/components/tables/filter/table-search-model.d.ts +39 -0
  28. package/lib/components/tables/filter/table-search.d.ts +10 -0
  29. package/lib/components/tables/renderer/table-body/table-body.component.d.ts +9 -0
  30. package/lib/components/tables/table/table.component.d.ts +2 -2
  31. package/lib/interaction/services/interaction.service.d.ts +12 -0
  32. package/lib/place/place-router.d.ts +19 -1
  33. package/package.json +2 -2
@@ -67,9 +67,14 @@ export * from "./tables/column/list-propery-column-model";
67
67
  export * from "./tables/column/property-column-model";
68
68
  export * from "./tables/column/selection-column-model";
69
69
  export * from "./tables/column/column-template/column-template.directive";
70
+ export * from "./tables/filter/cell-search";
70
71
  export * from "./tables/filter/column-text-search-formatter";
71
72
  export * from "./tables/filter/enable-cell-text-search.decorator";
73
+ export * from "./tables/filter/search-criteria.decorator";
74
+ export * from "./tables/filter/server-search-model";
72
75
  export * from "./tables/filter/table-filter-model";
76
+ export * from "./tables/filter/table-search-model";
77
+ export * from "./tables/filter/table-search";
73
78
  export * from "./tables/filter/text-search-predicate";
74
79
  export * from "./tables/footer/footer-row-model";
75
80
  export * from "./tables/paginator/paginator.component";
@@ -1,6 +1,6 @@
1
1
  import { ComponentType } from '@angular/cdk/overlay';
2
2
  import { Injector } from '@angular/core';
3
- import { BooleanValueModelChain, Constructable, DelegatingListModel, DependsOnOptions, Disposable, GarbageCollector, HasValue, ListModel, OneTimeBinding, SelectionModel, Types, ValueModel } from '@coolon/pectin';
3
+ import { BooleanValueModelChain, Constructable, DelegatingListModel, DependsOnOptions, Disposable, GarbageCollector, HasValue, ListModel, OneTimeBinding, SelectionModel, Types, ValueModel, ValueModelChain } from '@coolon/pectin';
4
4
  import { ColumnManager } from './column/column-manager';
5
5
  import type { CellRendererOptions, ColumnModel, OnComponentInit } from './column/column-model';
6
6
  import type { ColumnOrderManager } from './column/column-order-manager';
@@ -10,6 +10,8 @@ import { CustomValueColumnModel } from './column/custom-value-column-model';
10
10
  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
+ import type { SearchCriteriaPlacement } from './filter/cell-search';
14
+ import type { TableSearch } from './filter/table-search';
13
15
  import type { TextSearchPredicate } from './filter/text-search-predicate';
14
16
  import { FooterRowCellsBuilder, FooterRowModel } from './footer/footer-row-model';
15
17
  import type { CellRenderer } from './renderer/cell-renderer';
@@ -40,6 +42,13 @@ export declare abstract class AbstractTableModel<Row extends object> extends Gar
40
42
  readonly hasSelection$: BooleanValueModelChain;
41
43
  readonly footerRowModels: FooterRowModel.Impl[];
42
44
  private readonly _viewDependencies;
45
+ /** The table's settled search, once a table with a filter model binds (`useSearch`). */
46
+ private readonly _search$;
47
+ /** True once the table has initialised its columns, and with them their search classes. */
48
+ private readonly _searchClassesResolved$;
49
+ /** Counts changes to the models the search classes depend on, so the criteria can depend on one model. */
50
+ private readonly _searchDependencyChanges$;
51
+ private _criteriaPlacement?;
43
52
  constructor();
44
53
  protected setDataSource(dataSource$: any): void;
45
54
  /**
@@ -49,6 +58,44 @@ export declare abstract class AbstractTableModel<Row extends object> extends Gar
49
58
  * @param rest
50
59
  */
51
60
  initialise(injector: Injector, identityOf: (item: Row) => any): void;
61
+ /**
62
+ * Takes the table's settled search, which `useCriteria` turns into criteria. The table component calls
63
+ * it with its filter model's search when it binds.
64
+ */
65
+ useSearch(search$: ValueModel<TableSearch | undefined>): void;
66
+ /**
67
+ * Turns the table's search into server criteria: the page's base criteria, holding search criteria
68
+ * that each visible column's search class has written into (see `CellSearch`). Send the result with
69
+ * the page's request, and give the table a `ServerSearchModel` as its filter model, so it shows the
70
+ * rows the server found rather than filtering them again.
71
+ *
72
+ * Four rules govern it:
73
+ *
74
+ * 1. Without a search, the criteria are the base criteria. With one, each search starts from empty
75
+ * search criteria, `new placement.searchCriteriaClass({})`, so a search nothing matches still sends
76
+ * search criteria, and search criteria carrying no fields match no rows.
77
+ * 2. A column takes part through its search class for the page's search criteria. A hidden column
78
+ * takes no part, and a column with no search class for them is not searched and does not highlight.
79
+ * 3. A column that names search classes, none of them for the page's search criteria, fails when the
80
+ * table initialises, naming the column and the search criteria class. The check runs then, so a
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.
86
+ *
87
+ * The criteria are worked out again when the base criteria, the search, the visible columns or any
88
+ * search class's `dependsOn` change.
89
+ *
90
+ * @example
91
+ * const criteria$ = this.table.useCriteria(base$, {
92
+ * searchCriteriaClass: AlarmSearchCriteriaDto,
93
+ * withSearchCriteria: (criteria, searchCriteria) => criteria.copy({searchCriteria}),
94
+ * });
95
+ * this.history.useCriteria(criteria$);
96
+ */
97
+ useCriteria<Criteria, S>(base$: ValueModel<Criteria>, placement: SearchCriteriaPlacement<Criteria, S>): ValueModelChain<Criteria>;
98
+ private initialiseSearchCriteria;
52
99
  /**
53
100
  * Adds additional models that will trigger a table repaint. This is required if the table
54
101
  * needs to be redrawn outside of changes to the rows of filters. i.e. some eternal state is used
@@ -1,7 +1,8 @@
1
1
  import { ComponentType } from "@angular/cdk/overlay";
2
2
  import { CdkPortalOutletAttachedRef } from "@angular/cdk/portal";
3
3
  import { Injector } from "@angular/core";
4
- import { GarbageCollector, ValueModel } from "@coolon/pectin";
4
+ import { Constructable, GarbageCollector, HasValue, ValueModel } from "@coolon/pectin";
5
+ import type { CellSearch } from "../filter/cell-search";
5
6
  import { ColumnTextSearchFormatter } from "../filter/column-text-search-formatter";
6
7
  import type { ColumnTextMatcher } from "../filter/text-search-predicate";
7
8
  import { CellHeaderPortalRef, type CellRendererPortalRef } from "../renderer/cell-portal-ref";
@@ -37,6 +38,10 @@ export declare class ColumnModel<Row extends object> extends GarbageCollector {
37
38
  private readonly textSearchDelegate;
38
39
  private _textMatcher;
39
40
  private _textMatcherMap;
41
+ private _rendererSearchClasses;
42
+ private _searchOverride;
43
+ private _searches;
44
+ private _highlightsSearch;
40
45
  readonly visible$: ValueModel<boolean>;
41
46
  constructor(columnId: string, order: ColumnOrderManager, textPropertiesProvider: ColumnModel.TextPropertiesProvider);
42
47
  protected installHeaderRenderer(): void;
@@ -76,6 +81,31 @@ export declare class ColumnModel<Row extends object> extends GarbageCollector {
76
81
  matchesSearchFor(row: Row, searchText: string): boolean;
77
82
  configureColumnTextMatch(matcher: ColumnTextMatcher<Row>): this;
78
83
  configureColumnTextMatch<T>(matcher: ColumnTextMatcher<T>, mapper: (row: Row) => T): this;
84
+ /** Takes the search classes the column's renderer names with `@SearchCriteria`. */
85
+ protected configureSearchClasses(searchClasses: readonly CellSearch.Class[]): void;
86
+ /**
87
+ * Gives the column a search class other than its renderer's, or, with `false`, leaves it out of a
88
+ * server search. Either takes precedence over the renderer's `@SearchCriteria`.
89
+ */
90
+ searchCriteria(searchClass: CellSearch.Class | false): this;
91
+ /** Whether the column names a search class, its own or its renderer's. A column left out of the search names none. */
92
+ get namesSearchClasses(): boolean;
93
+ private get searchClasses();
94
+ /**
95
+ * The column's search class for a kind of search criteria, or undefined when it has none. Search
96
+ * classes are resolved when the table initialises the column, so before then there is none.
97
+ */
98
+ searchFor<S>(searchCriteriaClass: Constructable<S>): CellSearch<S> | undefined;
99
+ /** The models the column's search classes depend on beyond the search text. */
100
+ get searchDependencies(): readonly HasValue<unknown>[];
101
+ /**
102
+ * Whether the column's cells highlight the search. A table whose search becomes server criteria
103
+ * highlights only the columns the server is asked about (`AbstractTableModel.useCriteria`), so it
104
+ * never highlights a match the server was not asked for.
105
+ */
106
+ get highlightsSearch(): boolean;
107
+ /** Set by the table model; see {@link highlightsSearch}. */
108
+ useSearchHighlight(highlights: boolean): void;
79
109
  protected configureHeaderRenderer<C>(config: CellHeaderPortalRef<Row, unknown>): void;
80
110
  protected configureCellRenderer<C>(config: CellRendererPortalRef<Row, unknown>): void;
81
111
  cellHeaderRenderer<C>(componentType: ComponentType<C>, initialiser: (component: C, column: ColumnModel<Row>) => void): this;
@@ -0,0 +1,52 @@
1
+ import type { Constructable, HasValue } from "@coolon/pectin";
2
+ import type { TableSearch } from "./table-search";
3
+ /**
4
+ * What a search means for one column, written into search criteria: the part of a server request's
5
+ * criteria that carries the search, shared by every resource that lists the same kind of thing (for
6
+ * example `AlarmSearchCriteriaDto`, which the Alarm history page's criteria hold as `searchCriteria`).
7
+ *
8
+ * A cell renderer names its search classes with {@link SearchCriteria}. The table resolves them through
9
+ * the injector, so a search class may inject what it needs to match against, such as the manager that
10
+ * holds the names a cell shows. When the table has a search, it starts from empty search criteria and
11
+ * passes them through each visible column's search class, then puts the result into the page's criteria
12
+ * (`AbstractTableModel.useCriteria`). A row matches search criteria when it matches any field they
13
+ * carry, and search criteria carrying none match no rows, so a search class returns them unchanged when
14
+ * nothing matches.
15
+ *
16
+ * @example
17
+ * @Injectable({providedIn: 'root'})
18
+ * export class AlarmTypeSearch implements CellSearch<AlarmSearchCriteriaDto> {
19
+ * readonly searchCriteriaClass = AlarmSearchCriteriaDto;
20
+ * criteriaFor(searchCriteria: AlarmSearchCriteriaDto, search: TableSearch): AlarmSearchCriteriaDto {
21
+ * const types = AlarmType.values().filter(type => search.regex.test(type.label));
22
+ * return types.length ? searchCriteria.copy(c => c.types = types) : searchCriteria;
23
+ * }
24
+ * }
25
+ */
26
+ export interface CellSearch<S> {
27
+ /** The search criteria this class writes. The table uses the column's search class whose search criteria are the page's. */
28
+ readonly searchCriteriaClass: Constructable<S>;
29
+ /** Writes what the search means for this column into the search criteria, or returns them unchanged when nothing matches. */
30
+ criteriaFor(searchCriteria: S, search: TableSearch): S;
31
+ /** Models the search depends on beyond the search text, so a change to one runs the search again. */
32
+ readonly dependsOn?: readonly HasValue<unknown>[];
33
+ }
34
+ export declare namespace CellSearch {
35
+ /** A search class, as a renderer or a column names it. */
36
+ type Class = Constructable<CellSearch<unknown>>;
37
+ }
38
+ /**
39
+ * Where a page's criteria keep their search criteria, as `AbstractTableModel.useCriteria` needs to know.
40
+ *
41
+ * @example
42
+ * table.useCriteria(base$, {
43
+ * searchCriteriaClass: AlarmSearchCriteriaDto,
44
+ * withSearchCriteria: (criteria, searchCriteria) => criteria.copy({searchCriteria}),
45
+ * });
46
+ */
47
+ export interface SearchCriteriaPlacement<Criteria, S> {
48
+ /** The class of the search criteria the page's criteria carry. Each search starts from `new searchCriteriaClass({})`. */
49
+ readonly searchCriteriaClass: Constructable<S>;
50
+ /** The criteria with the finished search criteria in place. */
51
+ withSearchCriteria(criteria: Criteria, searchCriteria: S): Criteria;
52
+ }
@@ -0,0 +1,21 @@
1
+ import { ComponentType } from "@angular/cdk/overlay";
2
+ import type { CellSearch } from "./cell-search";
3
+ /**
4
+ * Names the search classes of a cell renderer: what a search means for the column it draws, as criteria
5
+ * for a server request (see {@link CellSearch}). A renderer shown in tables of different kinds of
6
+ * resource names one search class per kind of search criteria, and the table uses the one whose search
7
+ * criteria are the page's.
8
+ *
9
+ * It sits beside `@EnableCellTextSearch`, which describes the text a column offers client search, under
10
+ * its own metadata key, so a renderer may carry both.
11
+ *
12
+ * @example
13
+ * @SearchCriteria(AlarmSourceSearch, DeviceNameSearch)
14
+ * @Component({selector: 'frontend-alarm-source-cell-renderer', ...})
15
+ * export class AlarmSourceCellRendererComponent { ... }
16
+ */
17
+ export declare function SearchCriteria(...searchClasses: CellSearch.Class[]): ClassDecorator;
18
+ export declare namespace SearchCriteria {
19
+ /** The search classes a renderer names, or none. */
20
+ function getSearchClasses(renderer: ComponentType<unknown>): readonly CellSearch.Class[];
21
+ }
@@ -0,0 +1,29 @@
1
+ import { Disposable, ListModel, ValueModel } from "@coolon/pectin";
2
+ import { TableSearchModel } from "./table-search-model";
3
+ import type { TextSearchPredicate } from "./text-search-predicate";
4
+ /**
5
+ * The search model of a table whose rows the server finds, such as one that loads them a step at a
6
+ * time. The rows a table holds are what the server found for the search and the filters, so it shows
7
+ * them all. Its settled search
8
+ * ({@link search$}) becomes the server request's criteria through `AbstractTableModel.useCriteria`, and
9
+ * the cells highlight the search text as usual.
10
+ *
11
+ * It has no row predicate, so a page's filters cannot filter the rows held: they reach the server as
12
+ * criteria, as the search does.
13
+ *
14
+ * @example
15
+ * this.search = new ServerSearchModel<DecoratedAlarm>({disposedWith: this, searchText$: this.searchText$});
16
+ * const criteria$ = this.table.useCriteria(base$, {
17
+ * searchCriteriaClass: AlarmSearchCriteriaDto,
18
+ * withSearchCriteria: (criteria, searchCriteria) => criteria.copy({searchCriteria}),
19
+ * });
20
+ *
21
+ * <aup-table [tableModel]="table" [filterModel]="search"></aup-table>
22
+ */
23
+ export declare class ServerSearchModel<Row> extends TableSearchModel<Row> {
24
+ private readonly _source$;
25
+ readonly filteredRows$: ListModel<Row>;
26
+ constructor(options: TableSearchModel.Configuration);
27
+ /** The table's columns' text search is for searching in the browser, so it goes unused. */
28
+ bindToTable(source$: ListModel<Row>, _textSearchPredicate$: ValueModel<TextSearchPredicate<Row>>): Disposable;
29
+ }
@@ -1,11 +1,14 @@
1
- import { Disposable, DisposedWith, GarbageCollector, ListModel, OneTimeBinding, Predicate, ValueModel } from "@coolon/pectin";
1
+ import { Disposable, ListModel, Predicate, ValueModel } from "@coolon/pectin";
2
+ import { TableSearchModel } from "./table-search-model";
2
3
  import type { TextSearchPredicate } from "./text-search-predicate";
3
- export declare class TableFilterModel<Row> extends GarbageCollector implements OneTimeBinding {
4
- /** A proxied table filter model is a one-time binding: it cannot be read before its input is set. */
5
- readonly [OneTimeBinding.brand]: true;
4
+ /**
5
+ * The search model of a table that holds all its rows: it searches and filters them in the browser. A row
6
+ * is shown when it matches the search, through the columns' text search, and the row predicate, which a
7
+ * page's filters supply. A table whose rows the server finds uses `ServerSearchModel` instead.
8
+ */
9
+ export declare class TableFilterModel<Row> extends TableSearchModel<Row> {
6
10
  private readonly _source$;
7
11
  private readonly _rowPredicate$;
8
- private readonly _searchText$;
9
12
  private readonly _textSearchPredicate$;
10
13
  private readonly _rowPredicate;
11
14
  private readonly inUpdate;
@@ -16,14 +19,11 @@ export declare class TableFilterModel<Row> extends GarbageCollector implements O
16
19
  */
17
20
  readonly searchedRows$: ListModel<Row>;
18
21
  constructor(options: TableFilterModel.Configuration<Row>);
19
- get highlightText$(): ValueModel<string>;
20
- useSearchText(searchText$: ValueModel<string>): void;
21
22
  useRowPredicate(rowPredicate$: ValueModel<(row: Row) => boolean>): void;
22
23
  bindToTable(source$: ListModel<Row>, textSearchPredicate$: ValueModel<TextSearchPredicate<Row>>): Disposable;
23
24
  }
24
25
  export declare namespace TableFilterModel {
25
- interface Configuration<Row> extends DisposedWith {
26
+ interface Configuration<Row> extends TableSearchModel.Configuration {
26
27
  predicate$?: ValueModel<Predicate<Row>>;
27
- searchText$?: ValueModel<string>;
28
28
  }
29
29
  }
@@ -0,0 +1,39 @@
1
+ import { Disposable, DisposedWith, GarbageCollector, ListModel, OneTimeBinding, ValueModel } from "@coolon/pectin";
2
+ import type { TableSearch } from "./table-search";
3
+ import type { TextSearchPredicate } from "./text-search-predicate";
4
+ /**
5
+ * A table's search box, as a table reads it, whichever side does the searching. It debounces the search
6
+ * text, offers the settled search ({@link search$}) and the text to highlight ({@link highlightText$}),
7
+ * and gives the table the rows to show ({@link filteredRows$}).
8
+ *
9
+ * Two kinds exist, and a page picks one by what holds its rows:
10
+ *
11
+ * - `TableFilterModel` searches and filters the rows a table holds, in the browser.
12
+ * - `ServerSearchModel` leaves both to the server: the rows a table holds are what the server found,
13
+ * so it shows them all, and its search becomes criteria (`AbstractTableModel.useCriteria`). It has no
14
+ * row predicate, so a page's filters can reach the rows only as criteria too.
15
+ */
16
+ export declare abstract class TableSearchModel<Row> extends GarbageCollector implements OneTimeBinding {
17
+ /** A proxied table search model is a one-time binding: it cannot be read before its input is set. */
18
+ readonly [OneTimeBinding.brand]: true;
19
+ private readonly _searchText$;
20
+ /**
21
+ * The search once the debounce has passed: the text and its escaped, case-insensitive regular
22
+ * expression, or undefined while there is none. The text and the regular expression travel together,
23
+ * so nothing can see the regular expression of one search with the text of another.
24
+ */
25
+ readonly search$: ValueModel<TableSearch | undefined>;
26
+ /** The rows the table shows, once it has bound this model to its rows (`bindToTable`). */
27
+ abstract readonly filteredRows$: ListModel<Row>;
28
+ constructor(options: TableSearchModel.Configuration);
29
+ /** The search text as typed, before the debounce, which the cells highlight. */
30
+ get highlightText$(): ValueModel<string>;
31
+ useSearchText(searchText$: ValueModel<string> | undefined): void;
32
+ /** Called by the table with the rows it holds and its columns' text search. */
33
+ abstract bindToTable(source$: ListModel<Row>, textSearchPredicate$: ValueModel<TextSearchPredicate<Row>>): Disposable;
34
+ }
35
+ export declare namespace TableSearchModel {
36
+ interface Configuration extends DisposedWith {
37
+ searchText$?: ValueModel<string>;
38
+ }
39
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The search a table has settled on: the text the user typed, once the table's debounce has passed, and
3
+ * its escaped, case-insensitive regular expression. The regular expression is the one the highlight
4
+ * matches, so a search class that tests it against the text a cell shows asks for exactly what the cell
5
+ * would highlight.
6
+ */
7
+ export interface TableSearch {
8
+ readonly text: string;
9
+ readonly regex: RegExp;
10
+ }
@@ -48,6 +48,10 @@ export declare class TableBodyComponent<Row extends object> extends ResizeAwareC
48
48
  protected readonly rowHeight$: MutableValueModel<number>;
49
49
  baseCssClass: string;
50
50
  get animationsDisabledClass(): boolean;
51
+ /** The search text the table highlights, from the directive the table puts on this body. */
52
+ private readonly highlightText;
53
+ /** What a column that does not highlight the search highlights: nothing. */
54
+ private readonly noHighlightText$;
51
55
  protected readonly virtualScrollDataSource: TableVirtualScrollDataSource<Row>;
52
56
  protected readonly virtualScrollActive$: MutableValueModel<boolean>;
53
57
  protected readonly animationsDisabled$: MutableValueModel<boolean>;
@@ -62,6 +66,11 @@ export declare class TableBodyComponent<Row extends object> extends ResizeAwareC
62
66
  get hideHeader(): boolean;
63
67
  get headerHeightCssVar(): string;
64
68
  get rowHeightCssVar(): string;
69
+ /**
70
+ * The search text a column's cells highlight. A table whose search becomes server criteria highlights
71
+ * only the columns the server is asked about (`ColumnModel.highlightsSearch`).
72
+ */
73
+ protected highlightTextFor(column: ColumnModel<Row>): ValueModel<string>;
65
74
  notifyCellClicked(columnModel: ColumnModel<Row>, row: Row): void;
66
75
  isFirstVisibleColumn(columnId: string): boolean;
67
76
  isLastVisibleColumn(columnId: string): boolean;
@@ -2,7 +2,7 @@ import { Injector, OnInit } from "@angular/core";
2
2
  import { ValueModel } from "@coolon/pectin";
3
3
  import type { AbstractTableModel } from '../abstract-table-model';
4
4
  import { AbstractTableComponent } from '../abstract-table.component';
5
- import { TableFilterModel } from "../filter/table-filter-model";
5
+ import { TableSearchModel } from "../filter/table-search-model";
6
6
  import { TableBodyComponent } from "../renderer/table-body/table-body.component";
7
7
  import { TableModel } from "./table-model";
8
8
  import * as i0 from "@angular/core";
@@ -76,7 +76,7 @@ import * as i0 from "@angular/core";
76
76
  */
77
77
  export declare class TableComponent<Row extends object> extends AbstractTableComponent<Row> implements OnInit {
78
78
  accessor tableModel: TableModel<Row>;
79
- accessor filterModel: TableFilterModel<Row>;
79
+ accessor filterModel: TableSearchModel<Row>;
80
80
  tableBody: TableBodyComponent<Row>;
81
81
  private readonly emptyContent;
82
82
  /**
@@ -86,5 +86,17 @@ export declare namespace InteractionService {
86
86
  notifyActive(context: InteractionContext): Promise<any>;
87
87
  private isNavigationInProgress;
88
88
  notifyFinished(context: InteractionContext): Promise<any>;
89
+ /**
90
+ * Brings the url's interaction ids up to date. During a navigation the router runs the sync once
91
+ * that navigation lands; skipping it instead left the url with the old ids, so Back left the place
92
+ * rather than closing a dialog opened then, or kept the id of one closed then.
93
+ *
94
+ * :: Important ::
95
+ * Only an idle router's sync is waited for. This is traversed by both the place router (during
96
+ * canDeactivate guards) and user land code (both when routing is idle and while it is active in
97
+ * PlaceComponent.canDeactivate()). A sync asked for during a navigation won't start until that
98
+ * navigation finishes, and the navigation won't finish until this promise settles: deadlock.
99
+ */
100
+ private syncIdsWithRouter;
89
101
  }
90
102
  }
@@ -59,7 +59,13 @@ export declare class PlaceRouter extends GarbageCollector {
59
59
  onRouterEnd(event: NavigationEnd): void;
60
60
  navigate(visit: Visit): any;
61
61
  navigate(placeComponent: Constructable<PlaceComponent>, params?: Record<string, unknown>): any;
62
- doNavigation(visit: Visit, runNavigationCommands: (router: Router) => unknown): Promise<void>;
62
+ /**
63
+ * Runs a navigation, or queues it behind the one in flight. The returned promise settles once the
64
+ * navigation has landed (or been refused): a caller may treat it as the route being current, as
65
+ * the place outlet does. A {@link PlaceRouter.NavigationTarget} given as a function is resolved
66
+ * when the navigation runs, so a queued one is built from the visit it runs after.
67
+ */
68
+ doNavigation(target: PlaceRouter.NavigationTarget, runNavigationCommands: PlaceRouter.NavigationCommands): Promise<void>;
63
69
  /**
64
70
  * Handles a navigation triggered while another is already in flight: queue it (coalescing to the
65
71
  * latest) and run it once the in-flight session finishes.
@@ -75,6 +81,14 @@ export declare class PlaceRouter extends GarbageCollector {
75
81
  * preserves user-intent ordering.
76
82
  */
77
83
  private handleOverlappingNavigation;
84
+ /**
85
+ * Coalesces to the latest target, but a superseded caller is NOT settled here: it waits for the
86
+ * navigation that replaced it. Settling it at once told the caller its navigation had landed while
87
+ * the route was unchanged. The place outlet then wrote that route back to its place; a selection
88
+ * that couldn't hold it selected again and navigated again, superseding the next one, and that
89
+ * cycle ran on microtasks alone, so the session in flight never finished (mars-v2's groups pages
90
+ * hung after a create).
91
+ */
78
92
  private queueNavigation;
79
93
  private flushPendingNavigation;
80
94
  navigateByUrl(urlSnapshot: UrlSnapshot, navigationExtras?: NavigationExtras): Promise<boolean>;
@@ -107,6 +121,10 @@ export declare class PlaceRouter extends GarbageCollector {
107
121
  static ɵprov: i0.ɵɵInjectableDeclaration<PlaceRouter>;
108
122
  }
109
123
  export declare namespace PlaceRouter {
124
+ /** A navigation's visit, or a function that builds it when the navigation runs. */
125
+ type NavigationTarget = Visit | (() => Visit);
126
+ /** Starts the Angular navigation for the visit {@link PlaceRouter.doNavigation} resolved. */
127
+ type NavigationCommands = (router: Router, visit: Visit) => unknown;
110
128
  interface Redirections {
111
129
  /**
112
130
  * NOTE: for now this only supports top level places. Support for child places will require a more fundamental
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "16.1.0-alpha.325",
3
+ "version": "16.1.0-alpha.327",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^16.2.9",
6
6
  "@angular/common": "^16.2.9",
@@ -12,7 +12,7 @@
12
12
  "@angular/platform-browser-dynamic": "^16.2.9",
13
13
  "@angular/material-moment-adapter": "^16.2.10",
14
14
  "@angular/router": "^16.2.9",
15
- "@coolon/pectin": "^5.0.0-alpha.149",
15
+ "@coolon/pectin": "^5.0.0-alpha.150",
16
16
  "fast-typescript-memoize": "^1.1.1",
17
17
  "lodash-es": "^4.17.21",
18
18
  "marked": "4.0.10",