@coolon/angular-ui-powerups 16.1.0-alpha.335 → 16.1.0-alpha.337

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.
@@ -217,7 +217,11 @@ export declare abstract class AbstractTableModel<Row extends object> extends Gar
217
217
  addFooterRow<C>(component: ComponentType<C>, initialiseCallback?: (component: C) => void): FooterRowModel.Impl;
218
218
  addTemplateColumn<V>(columnId: string): CustomTemplateColumnModel<Row>;
219
219
  addRowClass(className: string, predicate: (row: Row) => boolean, options?: DependsOnOptions): void;
220
- addRowAttribute(attributeName: string, getValue: (row: Row) => string): void;
220
+ /**
221
+ * Gives each row an attribute named [attributeName]. A row whose value is nil goes without the
222
+ * attribute, rather than carrying the text "undefined".
223
+ */
224
+ addRowAttribute(attributeName: string, getValue: (row: Row) => string | undefined): void;
221
225
  getRowClasses(row: Row): string[];
222
226
  getRowAttributes(row: Row): Record<string, string>;
223
227
  protected addColumn<C extends ColumnModel<Row>>(column: C, position?: ColumnOrderManager.Position): C;
@@ -246,5 +250,9 @@ export declare abstract class AbstractTableModel<Row extends object> extends Gar
246
250
  scrollToTop(): void;
247
251
  /** Called by the table body, which scrolls when a page asks with {@link scrollToTop}. */
248
252
  _onScrollToTop(scroll: () => void): Disposable;
253
+ /**
254
+ * A click selects its row only when the selection model accepts that row, as the row's hover and
255
+ * cursor already say. Row click listeners hear of every click.
256
+ */
249
257
  _notifyCellClicked(columnModel: ColumnModel<Row>, row: Row): void;
250
258
  }
@@ -17,6 +17,18 @@ export declare class TreeExpansionModel<T> extends GarbageCollector implements O
17
17
  canCollapse(node: T): boolean;
18
18
  isCollapsed(node: T): boolean;
19
19
  isExpanded(node: T): boolean;
20
+ /** Shows the children of every node, in one change however many nodes were collapsed. */
21
+ expandAll(): void;
22
+ /** Hides the children of every node that has any, in one change, so the table redraws once. */
23
+ collapseAll(): void;
24
+ /**
25
+ * Expands every ancestor of [node], so the node shows. Its own children stay as they were.
26
+ */
20
27
  ensureAncestorsAndSelfVisible(node: T): void;
28
+ /**
29
+ * Visits every node of the tree, collapsed or not. A node under a collapsed parent has not been
30
+ * shown, so it has no decorator until its parent's children are read; walking from the roots reads them.
31
+ */
32
+ private forEachNode;
21
33
  private updatePredicate;
22
34
  }
@@ -9,6 +9,9 @@ export declare class TreeLabelCellRendererComponent<T extends object> extends Di
9
9
  private node$;
10
10
  accessor value: T;
11
11
  label: string;
12
+ secondaryLabel: string | undefined;
13
+ /** Without connectors, each level is a blank of the same width, so the indent stays the same. */
14
+ showsConnectors: boolean;
12
15
  iconFactory: TreeTableModel.IconFactory<T>;
13
16
  treeTableModel: TreeTableModel<T>;
14
17
  readonly iconList: ListModelChain<TreeInheritanceIconComponent.Type>;
@@ -22,7 +25,7 @@ export declare class TreeLabelCellRendererComponent<T extends object> extends Di
22
25
  get node(): T;
23
26
  expandOrCollapse($event: MouseEvent, node: T): void;
24
27
  static ɵfac: i0.ɵɵFactoryDeclaration<TreeLabelCellRendererComponent<any>, never>;
25
- static ɵcmp: i0.ɵɵComponentDeclaration<TreeLabelCellRendererComponent<any>, "aup-tree-label-cell-renderer", never, { "value": { "alias": "value"; "required": false; }; "label": { "alias": "label"; "required": false; }; "iconFactory": { "alias": "iconFactory"; "required": false; }; "treeTableModel": { "alias": "treeTableModel"; "required": false; }; }, {}, never, never, false, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<TreeLabelCellRendererComponent<any>, "aup-tree-label-cell-renderer", never, { "value": { "alias": "value"; "required": false; }; "label": { "alias": "label"; "required": false; }; "secondaryLabel": { "alias": "secondaryLabel"; "required": false; }; "showsConnectors": { "alias": "showsConnectors"; "required": false; }; "iconFactory": { "alias": "iconFactory"; "required": false; }; "treeTableModel": { "alias": "treeTableModel"; "required": false; }; }, {}, never, never, false, never>;
26
29
  }
27
30
  export declare namespace TreeLabelCellRendererComponent {
28
31
  const DEFAULT_ICON_FACTORY: TreeTableModel.IconFactory<any>;
@@ -7,10 +7,21 @@ import type { TreeTableModel } from './tree-table-model';
7
7
  export declare class TreeLabelColumnModel<Row extends object> extends ColumnModel<Row> {
8
8
  readonly expansionModel: TreeTableModel<Row>;
9
9
  private labelFactory;
10
+ private secondaryLabelFactory;
10
11
  private iconFactory;
12
+ private _showsConnectors;
11
13
  constructor(columnId: string, order: ColumnOrderManager, textPropertiesProvider: ColumnModel.TextPropertiesProvider, expansionModel: TreeTableModel<Row>);
12
14
  pluck<P extends Types.StringValuePropertiesOf<Row>>(property: P): void;
13
15
  useLabel(factory: (row: Row) => string): void;
16
+ /** A smaller second line under a node's label. A node whose factory returns nil has one line. */
17
+ useSecondaryLabel(factory: (row: Row) => string | undefined): void;
18
+ /**
19
+ * Draws no lines from a node to its parent; each level is indented by the same width instead. The
20
+ * lines run to a cell's top and bottom edges, so a tree that draws them leaves its rows unruled, and
21
+ * one that hides them is ruled like a flat table.
22
+ */
23
+ hideConnectors(): this;
24
+ get showsConnectors(): boolean;
14
25
  /**
15
26
  * @deprecated use #useIcon instead.
16
27
  * @param factory
@@ -73,6 +73,8 @@ export declare class TreeTableComponent<T extends TreeNode<T>> extends AbstractT
73
73
  protected readonly scrollMode$: ValueModel<TableBodyComponent.ScrollMode>;
74
74
  constructor(injector: Injector);
75
75
  ngOnInit(): void;
76
+ /** A tree that draws connectors leaves its rows unruled, so the lines run unbroken from row to row. */
77
+ get showsConnectors(): boolean;
76
78
  getModel(): AbstractTableModel<T>;
77
79
  static ɵfac: i0.ɵɵFactoryDeclaration<TreeTableComponent<any>, never>;
78
80
  static ɵcmp: i0.ɵɵComponentDeclaration<TreeTableComponent<any>, "aup-tree-table", never, { "treeTableModel": { "alias": "treeTableModel"; "required": false; }; "expansionModel": { "alias": "expansionModel"; "required": false; }; }, {}, never, never, false, never>;
@@ -8,6 +8,7 @@ export type ChildArrayPropertiesOf<T> = {
8
8
  }[keyof T];
9
9
  export declare class TreeTableModel<Row extends object> extends AbstractTableModel<Row> {
10
10
  private treeExpansionModel;
11
+ private treeColumn;
11
12
  private readonly flattenedDataSource;
12
13
  readonly childExtractor: (row: Row) => Row[];
13
14
  private _isExpandedPredicate$;
@@ -15,10 +16,14 @@ export declare class TreeTableModel<Row extends object> extends AbstractTableMod
15
16
  get isExpandedPredicate$(): ValueModel<(node: Row) => boolean>;
16
17
  bindToTable(expansionModel: TreeExpansionModel<Row>, filteredRows$: ListModel<Row>, visibleRows$: ListModel<Row>, cdr: ChangeDetectorRef): void;
17
18
  treeControlColumn(builder: (column: TreeLabelColumnModel<Row>) => void): void;
19
+ /** Whether the tree column draws lines from each node to its parent (TreeLabelColumnModel.hideConnectors). */
20
+ get showsConnectors(): boolean;
18
21
  expand(node: Row): void;
19
22
  collapse(node: Row): void;
20
23
  isCollapsed(node: Row): boolean;
21
24
  ensureAncestorsAndSelfVisible(node: Row): void;
25
+ expandAll(): void;
26
+ collapseAll(): void;
22
27
  isExpanded(row: Row): boolean;
23
28
  }
24
29
  export declare namespace TreeTableModel {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "16.1.0-alpha.335",
3
+ "version": "16.1.0-alpha.337",
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.150",
15
+ "@coolon/pectin": "^5.0.0-alpha.151",
16
16
  "fast-typescript-memoize": "^1.1.1",
17
17
  "lodash-es": "^4.17.21",
18
18
  "marked": "4.0.10",