@coolon/angular-ui-powerups 16.1.0-alpha.314 → 16.1.0-alpha.316
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/esm2022/lib/components/tables/abstract-table-model.mjs +17 -1
- package/esm2022/lib/components/tables/column/column-manager.mjs +21 -5
- package/esm2022/lib/components/tables/column/column-model.mjs +54 -5
- package/esm2022/lib/components/tables/column/selection-column-model.mjs +2 -1
- package/esm2022/lib/components/tables/renderer/table-body/table-body.component.mjs +2 -2
- package/fesm2022/coolon-angular-ui-powerups.mjs +89 -7
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/tables/abstract-table-model.d.ts +9 -0
- package/lib/components/tables/column/column-manager.d.ts +10 -1
- package/lib/components/tables/column/column-model.d.ts +29 -2
- package/package.json +1 -1
|
@@ -70,6 +70,15 @@ 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
|
+
/** Whether each column flexes, so a view can redraw when one starts or stops. */
|
|
74
|
+
get columnFlexes$(): ListModel<boolean>;
|
|
75
|
+
/**
|
|
76
|
+
* Shows the columns of a display scope in place of the default ones, such as a phone layout's, and searches those
|
|
77
|
+
* columns only. Undefined is the default scope. A column shows in the default scope only, until it is given scopes with
|
|
78
|
+
* {@link ColumnModel.onlyDisplayIn}, {@link ColumnModel.alsoDisplayIn} or {@link ColumnModel.displayInEveryScope}.
|
|
79
|
+
*/
|
|
80
|
+
useDisplayScope(scope$: ValueModel<string | undefined>): this;
|
|
81
|
+
get displayScope$(): ValueModel<string | undefined>;
|
|
73
82
|
pluck<P extends Types.ValuePropertiesOf<Row>>(property: P, options?: {
|
|
74
83
|
columnId: string;
|
|
75
84
|
}): 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,17 @@ 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
|
+
/**
|
|
14
|
+
* The columns shown: those visible in their own right and shown in the table's display scope. A search covers these
|
|
15
|
+
* and no others, so a row is never found by a column the user cannot see.
|
|
16
|
+
*/
|
|
10
17
|
readonly visibleColumns$: ListModel<ColumnModel<Row>>;
|
|
11
18
|
constructor();
|
|
19
|
+
useDisplayScope(scope$: ValueModel<string | undefined>): void;
|
|
20
|
+
get displayScope$(): ValueModel<string | undefined>;
|
|
12
21
|
position(column: ColumnModel<any>, newPosition: ColumnOrderManager.Position): void;
|
|
13
22
|
getColumn(id: string): ColumnModel<Row>;
|
|
14
23
|
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
|
-
|
|
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
|
}
|