@coolon/angular-ui-powerups 16.1.0-alpha.345 → 16.1.0-alpha.346

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.
@@ -30,6 +30,10 @@ export declare class CommandComponent extends PopupAwareComponent {
30
30
  * The edge of its container this command's button sits at, if it ends a padded row such as a header or a toolbar.
31
31
  * An icon button there gives back the transparent inset round its icon, so its icon lines up with the content edge
32
32
  * as text there would. A text button is unaffected. Leave it unset for a button with something after it.
33
+ *
34
+ * A container that marks its ends with `aup-edge-start` or `aup-edge-end` lines up its first or last command, more-menu
35
+ * or popup-menu itself, so a command placed straight in it needs no `edge`; an activity's title marks both its ends.
36
+ * One inside a wrapper there still says so with `edge` (assets/commands.scss).
33
37
  */
34
38
  edge?: Edge;
35
39
  /** What the label does in a box narrower than it: 'ellipsis' lets the button shrink and cuts the label short with "…". */
@@ -0,0 +1,24 @@
1
+ import { Disposable } from "@coolon/pectin";
2
+ /**
3
+ * Keeps a row that is scrolled into view clear of the table's sticky header and footer rows. A row they cover is still
4
+ * inside the scroller, so scrolling it into view, by a keyboard focus move or `scrollIntoView`, used to leave it under
5
+ * them, and a click there landed on the footer. The scroller's scroll padding follows the heights of the header and
6
+ * the footer, so the browser stops short of them.
7
+ *
8
+ * The padding is set on each scroller of the table body (`aup-table-scroller`), not on a table nested in a cell, which
9
+ * has its own.
10
+ */
11
+ export declare class StickyRowsScrollPadding implements Disposable {
12
+ private readonly body;
13
+ private readonly resizeObserver;
14
+ private sections;
15
+ private disposed;
16
+ /** @param body the table body whose sticky header and footer are measured. */
17
+ constructor(body: HTMLElement);
18
+ /** Measures the header and footer the body draws now. Call it once the body has drawn new ones. */
19
+ watch(): void;
20
+ dispose(): void;
21
+ private measure;
22
+ /** The elements matching [selectors] that belong to this body, not to a table nested in one of its cells. */
23
+ private own;
24
+ }
@@ -93,6 +93,8 @@ export declare class TableBodyComponent<Row extends object> extends ResizeAwareC
93
93
  protected readonly optimisedChangeDetectionEnabled: boolean;
94
94
  /** Where each column kept in view holds, so that kept columns stuck to the same edge sit side by side. */
95
95
  protected readonly keptColumnOffsets: KeptColumnOffsets;
96
+ /** Keeps a row scrolled into view clear of the sticky header and footer rows. */
97
+ private readonly stickyRowsScrollPadding;
96
98
  private viewInitialized;
97
99
  protected markForCheck(): void;
98
100
  constructor(bufferMultiplier?: number);
@@ -4,6 +4,10 @@ export declare class TreeExpansionModel<T> extends GarbageCollector implements O
4
4
  readonly [OneTimeBinding.brand]: true;
5
5
  private readonly _source$;
6
6
  private readonly collapsedIds;
7
+ /** The nodes the user opened or closed themselves (see ChangeOptions.byUser). */
8
+ private readonly chosenIds;
9
+ /** Whether the user expanded or collapsed every node themselves. */
10
+ private allChosenByUser;
7
11
  private readonly _isExpandedPredicate$;
8
12
  private readonly _visibleRows$;
9
13
  private readonly _identityOf;
@@ -22,17 +26,28 @@ export declare class TreeExpansionModel<T> extends GarbageCollector implements O
22
26
  * stored node would match no row. The choice used to be lost that way.
23
27
  */
24
28
  private keyCollapsedNodesByTheTablesIdentity;
29
+ /** Stores each node in [ids] by the table's identity; true when any key changed. */
30
+ private rekey;
25
31
  get isExpandedPredicate$(): import("@coolon/pectin").ValueModel<(node: T) => boolean>;
26
- expand(node: T): void;
27
- collapse(node: T): void;
32
+ expand(node: T, options?: TreeExpansionModel.ChangeOptions): void;
33
+ collapse(node: T, options?: TreeExpansionModel.ChangeOptions): void;
28
34
  canExpand(node: T): boolean;
29
35
  canCollapse(node: T): boolean;
30
36
  isCollapsed(node: T): boolean;
31
37
  isExpanded(node: T): boolean;
32
38
  /** Shows the children of every node, in one change however many nodes were collapsed. */
33
- expandAll(): void;
39
+ expandAll(options?: TreeExpansionModel.ChangeOptions): void;
34
40
  /** Hides the children of every node that has any, in one change, so the table redraws once. */
35
- collapseAll(): void;
41
+ collapseAll(options?: TreeExpansionModel.ChangeOptions): void;
42
+ /**
43
+ * Whether the user opened or closed [node] themselves, or expanded or collapsed every node, since the choices were
44
+ * last forgotten. A page that opens nodes for its own reasons, such as the ones with news, leaves these alone, so
45
+ * the user's choice holds.
46
+ */
47
+ isChosenByUser(node: T): boolean;
48
+ /** Forgets what the user opened and closed, so the page decides every node again, as for a new set of rows. */
49
+ forgetUserChoices(): void;
50
+ private noteChoice;
36
51
  /**
37
52
  * Expands every ancestor of [node], so the node shows. Its own children stay as they were.
38
53
  */
@@ -47,4 +62,11 @@ export declare class TreeExpansionModel<T> extends GarbageCollector implements O
47
62
  export declare namespace TreeExpansionModel {
48
63
  interface Options<T> extends DisposedWith, CanIdentify.Options<T> {
49
64
  }
65
+ interface ChangeOptions {
66
+ /**
67
+ * The user asked for the change, by a node's toggle or a control of the page's own such as Expand all, rather than
68
+ * the page deciding it. The tree's toggle passes it; a call without it is the page's. isChosenByUser reads it.
69
+ */
70
+ readonly byUser?: boolean;
71
+ }
50
72
  }
@@ -18,12 +18,12 @@ export declare class TreeTableModel<Row extends object> extends AbstractTableMod
18
18
  treeControlColumn(builder: (column: TreeLabelColumnModel<Row>) => void): void;
19
19
  /** Whether the tree column draws lines from each node to its parent (TreeLabelColumnModel.hideConnectors). */
20
20
  get showsConnectors(): boolean;
21
- expand(node: Row): void;
22
- collapse(node: Row): void;
21
+ expand(node: Row, options?: TreeExpansionModel.ChangeOptions): void;
22
+ collapse(node: Row, options?: TreeExpansionModel.ChangeOptions): void;
23
23
  isCollapsed(node: Row): boolean;
24
24
  ensureAncestorsAndSelfVisible(node: Row): void;
25
- expandAll(): void;
26
- collapseAll(): void;
25
+ expandAll(options?: TreeExpansionModel.ChangeOptions): void;
26
+ collapseAll(options?: TreeExpansionModel.ChangeOptions): void;
27
27
  isExpanded(row: Row): boolean;
28
28
  }
29
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.345",
3
+ "version": "16.1.0-alpha.346",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^16.2.9",
6
6
  "@angular/common": "^16.2.9",