@coolon/angular-ui-powerups 16.1.0-alpha.314 → 16.1.0-alpha.315

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.
@@ -70,6 +70,17 @@ export declare abstract class AbstractTableModel<Row extends object> extends Gar
70
70
  get visibleRows$(): ListModel<Row>;
71
71
  get columns$(): ListModel<ColumnModel<Row>>;
72
72
  get visibleColumns$(): ListModel<ColumnModel<Row>>;
73
+ /** The columns a search covers: those the default display scope shows, whichever scope the table is in. */
74
+ get searchedColumns$(): ListModel<ColumnModel<Row>>;
75
+ /** Whether each column flexes, so a view can redraw when one starts or stops. */
76
+ get columnFlexes$(): ListModel<boolean>;
77
+ /**
78
+ * Shows the columns of a display scope in place of the default ones, such as a phone layout's. Undefined is the
79
+ * default scope. A column shows in the default scope only, until it is given scopes with
80
+ * {@link ColumnModel.onlyDisplayIn}, {@link ColumnModel.alsoDisplayIn} or {@link ColumnModel.displayInEveryScope}.
81
+ */
82
+ useDisplayScope(scope$: ValueModel<string | undefined>): this;
83
+ get displayScope$(): ValueModel<string | undefined>;
73
84
  pluck<P extends Types.ValuePropertiesOf<Row>>(property: P, options?: {
74
85
  columnId: string;
75
86
  }): PropertyColumnModel<Row, P>;
@@ -1,4 +1,4 @@
1
- import { GarbageCollector, ListModel, WatchList } from '@coolon/pectin';
1
+ import { GarbageCollector, ListModel, ValueModel, WatchList } from '@coolon/pectin';
2
2
  import type { ColumnModel } from './column-model';
3
3
  import { ColumnOrderManager } from "./column-order-manager";
4
4
  export declare class ColumnManager<Row extends object> extends GarbageCollector implements ColumnOrderManager {
@@ -7,8 +7,19 @@ export declare class ColumnManager<Row extends object> extends GarbageCollector
7
7
  private readonly _columnsById$;
8
8
  readonly allColumns$: ListModel<ColumnModel<Row>>;
9
9
  readonly columnVisibilities$: WatchList<boolean>;
10
+ readonly columnDisplayScopes$: WatchList<ColumnModel.DisplayScopes>;
11
+ readonly columnFlexes$: WatchList<boolean>;
12
+ private readonly _displayScope$;
13
+ /** The columns shown: those visible in their own right and shown in the table's display scope. */
10
14
  readonly visibleColumns$: ListModel<ColumnModel<Row>>;
15
+ /**
16
+ * The columns a search covers: those the default scope shows. A display scope is another way of showing
17
+ * the same rows, so a search finds the same rows whichever scope the table is in.
18
+ */
19
+ readonly searchedColumns$: ListModel<ColumnModel<Row>>;
11
20
  constructor();
21
+ useDisplayScope(scope$: ValueModel<string | undefined>): void;
22
+ get displayScope$(): ValueModel<string | undefined>;
12
23
  position(column: ColumnModel<any>, newPosition: ColumnOrderManager.Position): void;
13
24
  getColumn(id: string): ColumnModel<Row>;
14
25
  hasColumn(id: string): boolean;
@@ -28,7 +28,8 @@ export declare class ColumnModel<Row extends object> extends GarbageCollector {
28
28
  private _columnHeaderPortalRef;
29
29
  private _cellRendererPortalRef;
30
30
  private _enableRowSelection;
31
- private _flex;
31
+ private readonly _flex$;
32
+ private readonly _displayScopes$;
32
33
  private _defaultVisibility$;
33
34
  private _masterVisibility$;
34
35
  private _userVisible$;
@@ -42,6 +43,20 @@ export declare class ColumnModel<Row extends object> extends GarbageCollector {
42
43
  getHeaderText(): string;
43
44
  isVisible(): boolean;
44
45
  visibleWhile(visible: ValueModel<boolean>): this;
46
+ /**
47
+ * Shows the column only while the table's display scope is one of these, and never in the default scope.
48
+ * For example, a phone's one-line summary of a row: `onlyDisplayIn('handset')`.
49
+ */
50
+ onlyDisplayIn(...scopes: string[]): this;
51
+ /** Shows the column in the default scope, as every column is, and also while the display scope is one of these. */
52
+ alsoDisplayIn(...scopes: string[]): this;
53
+ /** Shows the column whatever the table's display scope, including scopes added later. */
54
+ displayInEveryScope(): this;
55
+ /**
56
+ * The scopes the column shows in. A column shows in the default scope, and only there, until it says
57
+ * otherwise. Its own visibility ({@link visible$}) applies in every scope.
58
+ */
59
+ get displayScopes$(): ValueModel<ColumnModel.DisplayScopes>;
45
60
  protected setDefaultVisibility(visible: ValueModel<boolean>): void;
46
61
  protected setMasterVisibility(visible: ValueModel<boolean>): void;
47
62
  protected getDefaultHeaderText(): string;
@@ -64,7 +79,9 @@ export declare class ColumnModel<Row extends object> extends GarbageCollector {
64
79
  protected configureHeaderRenderer<C>(config: CellHeaderPortalRef<Row, unknown>): void;
65
80
  protected configureCellRenderer<C>(config: CellRendererPortalRef<Row, unknown>): void;
66
81
  cellHeaderRenderer<C>(componentType: ComponentType<C>, initialiser: (component: C, column: ColumnModel<Row>) => void): this;
67
- flex(flex?: boolean): void;
82
+ /** Gives the column the table's spare width. A model makes it follow a condition, such as a layout. */
83
+ flex(flex?: boolean | ValueModel<boolean>): void;
84
+ get flex$(): ValueModel<boolean>;
68
85
  isFlex(): boolean;
69
86
  attachHeaderCell(host: any): void;
70
87
  attachCell(host: any): void;
@@ -80,4 +97,14 @@ export declare class ColumnModel<Row extends object> extends GarbageCollector {
80
97
  export declare namespace ColumnModel {
81
98
  const CELL_RENDERER_COMPONENT_ROW_CACHE: unique symbol;
82
99
  type TextPropertiesProvider = () => ColumnTextProperties;
100
+ /** The display scopes a column shows in. Undefined is the default scope, the one a table has until it is given another. */
101
+ class DisplayScopes {
102
+ readonly inDefault: boolean;
103
+ readonly scopes: readonly string[];
104
+ readonly inEvery: boolean;
105
+ static readonly DEFAULT_ONLY: DisplayScopes;
106
+ static readonly EVERY: DisplayScopes;
107
+ constructor(inDefault: boolean, scopes: readonly string[], inEvery: boolean);
108
+ includes(scope: string | undefined): boolean;
109
+ }
83
110
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "16.1.0-alpha.314",
3
+ "version": "16.1.0-alpha.315",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^16.2.9",
6
6
  "@angular/common": "^16.2.9",