@coolon/angular-ui-powerups 13.7.12 → 13.7.14

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.
@@ -46,6 +46,7 @@ export * from "./section-header/section-header.component";
46
46
  export * from "./switch-case/switch-case.component";
47
47
  export * from "./tables/abstract-table-model";
48
48
  export * from "./tables/abstract-table.component";
49
+ export * from "./tables/filter-strategy";
49
50
  export * from "./tables/column/column-list-model";
50
51
  export * from "./tables/column/column-model";
51
52
  export * from "./tables/column/column-text-properties";
@@ -1,6 +1,6 @@
1
1
  import { ComponentType } from "@angular/cdk/overlay";
2
2
  import { Injector } from "@angular/core";
3
- import { BooleanValueModelChain, Command, DelegatingListModel, DirtyTrackingForm, Disposable, GarbageCollector, ListModel, SelectionModel, Types, ValueModel, ValueModelChain } from "@coolon/pectin";
3
+ import { BooleanValueModelChain, Command, DelegatingListModel, DelegatingValueModel, DirtyTrackingForm, Disposable, GarbageCollector, ListModel, SelectionModel, Types, ValueModel, ValueModelChain } from "@coolon/pectin";
4
4
  import { CustomTemplateColumnModel } from "./column/custom-template-column-model";
5
5
  import { CustomValueColumnModel } from "./column/custom-value-column-model";
6
6
  import { EditorControlColumnModel } from "./column/editor-controls-column-model";
@@ -8,6 +8,7 @@ import { ListPropertyColumnModel } from "./column/list-propery-column-model";
8
8
  import { PropertyColumnModel } from "./column/property-column-model";
9
9
  import { SelectionColumnModel } from "./column/selection-column-model";
10
10
  import { EditSession } from "./editor/edit-session";
11
+ import { FilterStrategy } from "./filter-strategy";
11
12
  import { CellRenderer } from "./renderer/cell-renderer";
12
13
  import { CellRendererOptions, ColumnModel, OnComponentInit } from "./column/column-model";
13
14
  import { ColumnTextProperties } from "./column/column-text-properties";
@@ -28,17 +29,15 @@ export declare class AbstractTableModel<Row> extends GarbageCollector {
28
29
  private readonly rowClickListeners;
29
30
  readonly firstVisibleColumn$: ValueModel<ColumnModel<Row>>;
30
31
  readonly lastVisibleColumn$: ValueModel<ColumnModel<Row>>;
31
- private readonly _searchText$;
32
32
  private _createForm;
33
- private _textSearchPredicate$;
34
- private _filteredRows$;
33
+ private readonly _filteredRows$;
34
+ private readonly filterManager;
35
35
  constructor();
36
- findMatchingColumns(row: Row, regex: RegExp): ColumnModel<Row>[];
37
- hasMatchingColumn(row: Row, regex: RegExp): boolean;
38
36
  initialise(injector: Injector): void;
39
37
  get visibleRows$(): ListModel<Row>;
40
38
  protected setDataSource(sourceOfTruth: ListModel<Row>): void;
41
- setTextSearch(searchText$: ValueModel<string>, throttleDelayMilliseconds?: number): void;
39
+ registerFilterStrategy(builder: (strategy: FilterStrategy.Builder<Row>) => void): Disposable;
40
+ get searchText$(): DelegatingValueModel<string>;
42
41
  identityOf(row: Row): any;
43
42
  get rowsBeingEdited$(): ListModel<Row>;
44
43
  readonly trackBy: (index: number, item: Row) => any;
@@ -7,6 +7,7 @@ export declare class ColumnListModel<Row> extends AbstractComputedListModel<Colu
7
7
  get allColumns$(): ListModel<ColumnModel<Row>>;
8
8
  getColumn(id: string): ColumnModel<Row>;
9
9
  hasColumn(id: string): boolean;
10
+ hasMatchingColumn(row: Row, regex: RegExp): boolean;
10
11
  addColumn<C extends ColumnModel<Row>>(column: C, index?: number): C;
11
12
  doComputeValue(): ColumnModel<Row>[];
12
13
  }
@@ -0,0 +1,19 @@
1
+ import { GarbageCollector, Predicate, ValueModel } from "@coolon/pectin";
2
+ export declare class FilterStrategy<T> extends GarbageCollector {
3
+ readonly rowPredicate$: ValueModel<Predicate<T>>;
4
+ readonly searchText$: ValueModel<string>;
5
+ constructor(rowPredicate$: ValueModel<Predicate<T>>, searchText$: ValueModel<string>);
6
+ static create<T>(build: (builder: FilterStrategy.Builder<T>) => void): FilterStrategy<T>;
7
+ }
8
+ export declare namespace FilterStrategy {
9
+ interface Builder<Row> {
10
+ usePredicate(predicate$: ValueModel<Predicate<Row>>): this;
11
+ useSearchText(searchText$: ValueModel<string>): this;
12
+ }
13
+ class BuilderImp<Row> implements Builder<Row> {
14
+ rowPredicate: ValueModel<Predicate<Row>>;
15
+ searchText$: ValueModel<string>;
16
+ usePredicate(predicate$: ValueModel<Predicate<Row>>): this;
17
+ useSearchText(searchText$: ValueModel<string>): this;
18
+ }
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "13.7.12",
3
+ "version": "13.7.14",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^13.3.4",
@@ -9,7 +9,7 @@
9
9
  "@angular/forms": "^13.3.4",
10
10
  "@angular/material": "^13.3.4",
11
11
  "@angular/router": "^13.3.4",
12
- "@coolon/pectin": "^3.17.3",
12
+ "@coolon/pectin": "^3.17.4",
13
13
  "@coolon/typescript-utilities": "^2.5.1",
14
14
  "@typescript-plus/fast-memoize-decorator": "^0.2.1",
15
15
  "lodash-es": "^4.17.21",