@ieeesa-npm/dashboard 0.0.2 → 0.0.3

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.
@@ -1,19 +1,24 @@
1
1
  import { EventEmitter } from '@angular/core';
2
2
  import { PageEvent } from '@angular/material/paginator';
3
+ import { IconButton } from '@ieeesa-npm/presentation';
3
4
  import { DashboardSectionState } from '../../models/dashboard-section-state.model';
4
5
  import { GroupHierarchyNode, GroupRow } from '../../models/group-row.model';
5
6
  import { PageChange } from '../../models/page-change.model';
6
7
  import * as i0 from "@angular/core";
7
8
  /**
8
9
  * A single rendered table row. Either a top-level group row (`kind: 'group'`,
9
- * carrying the full {@link GroupRow}) or a hierarchy (ancestor) row revealed
10
- * when a group is expanded (`kind: 'hierarchy'`, carrying the ancestor node and
11
- * its depth for indentation).
10
+ * carrying the full {@link GroupRow}) or a hierarchy node row (`kind:
11
+ * 'hierarchy'`) revealed step-by-step as the user drills down. `nodeIndex` is
12
+ * the node's position in the group's `hierarchy[]`, used to drive the next
13
+ * drill-down level and the per-node toggle (matching the Groups module, where
14
+ * each level reveals only its next child and that child carries its own +/−).
12
15
  */
13
16
  interface TableRow {
14
17
  kind: 'group' | 'hierarchy';
15
18
  group?: GroupRow;
16
19
  node?: GroupHierarchyNode;
20
+ /** Index of this node within the group's hierarchy[] (hierarchy rows only). */
21
+ nodeIndex?: number;
17
22
  level: number;
18
23
  }
19
24
  /**
@@ -42,6 +47,24 @@ export declare class YourGroupsComponent {
42
47
  readonly indentPerLevel = 28;
43
48
  /** Selectable "Items per page" page sizes. */
44
49
  readonly pageSizeOptions: number[];
50
+ /**
51
+ * Expand (+) icon button — the SAME sprite icon the Groups package uses for
52
+ * its tree expand toggle (icon-expand-collapse-plus), rendered via the shared
53
+ * IconButtonComponent for a consistent look across the app.
54
+ */
55
+ readonly expandIconButton: IconButton;
56
+ /** Collapse (−) icon button — the Groups package's icon-expand-collapse-minus. */
57
+ readonly collapseIconButton: IconButton;
58
+ /**
59
+ * Returns the +/- toggle icon button for a level, matching the Groups tree:
60
+ * the minus (collapse) icon when that level is expanded, otherwise the plus
61
+ * (expand) icon.
62
+ * @param {GroupRow} group
63
+ * @param {number} index - -1 for the group row, else the node index.
64
+ * @return {IconButton}
65
+ * @memberof YourGroupsComponent
66
+ */
67
+ getToggleButton(group: GroupRow, index: number): IconButton;
45
68
  private groupsValue;
46
69
  /** The groups rendered in the table. */
47
70
  set groups(value: GroupRow[]);
@@ -80,9 +103,15 @@ export declare class YourGroupsComponent {
80
103
  */
81
104
  set expanded(value: boolean);
82
105
  get expanded(): boolean;
83
- /** GroupIds of the top-level groups whose hierarchy is currently expanded. */
84
- private readonly expandedGroupIds;
85
- /** The flattened rows currently rendered (group rows + any expanded hierarchy rows). */
106
+ /**
107
+ * Keys of the hierarchy levels currently expanded, each `"<groupId>:<index>"`.
108
+ * Index -1 is the group row itself (its toggle reveals the first hierarchy
109
+ * node); index N is the Nth hierarchy node (its toggle reveals node N+1). A
110
+ * level only reveals the NEXT node, matching the Groups module's step-by-step
111
+ * drill-down.
112
+ */
113
+ private readonly expandedKeys;
114
+ /** The flattened rows currently rendered (group rows + any revealed hierarchy rows). */
86
115
  visibleRows: TableRow[];
87
116
  /**
88
117
  * The count shown in the header subtitle — the server total when provided,
@@ -92,26 +121,53 @@ export declare class YourGroupsComponent {
92
121
  */
93
122
  get groupCount(): number;
94
123
  /**
95
- * Whether a group row can expand: it has an ancestor hierarchy (more than the
96
- * group's own node). A single-node hierarchy (the group itself) is a leaf.
124
+ * Builds the expand/collapse key for a hierarchy level. Index -1 is the group
125
+ * row itself; index N is the Nth hierarchy node.
126
+ * @param {GroupRow} group
127
+ * @param {number} index
128
+ * @return {string}
129
+ * @memberof YourGroupsComponent
130
+ */
131
+ private levelKey;
132
+ /**
133
+ * Whether a level shows a +/- toggle.
134
+ *
135
+ * - Group row (index -1): expandable when it has ANY hierarchy node, matching
136
+ * the Groups module which shows the toggle on every group that has related
137
+ * hierarchy (driven by hasChildren, true for all these groups).
138
+ * - Hierarchy node (index N): expandable only when there is a further node
139
+ * after it (step-by-step drill-down); the deepest node is a leaf, no toggle.
140
+ * @param {GroupRow} group
141
+ * @param {number} index - -1 for the group row, else the node index.
142
+ * @return {boolean}
143
+ * @memberof YourGroupsComponent
144
+ */
145
+ isLevelExpandable(group: GroupRow, index: number): boolean;
146
+ /**
147
+ * Whether the group row shows a toggle (has related hierarchy to drill into).
97
148
  * @param {GroupRow} group
98
149
  * @return {boolean}
99
150
  * @memberof YourGroupsComponent
100
151
  */
101
152
  hasHierarchy(group: GroupRow): boolean;
102
153
  /**
103
- * Whether the given group row is currently expanded.
154
+ * Whether a given level is currently expanded (its next node is revealed).
104
155
  * @param {GroupRow} group
156
+ * @param {number} index
105
157
  * @return {boolean}
106
158
  * @memberof YourGroupsComponent
107
159
  */
160
+ isLevelExpanded(group: GroupRow, index: number): boolean;
161
+ /** Convenience for the group row (level -1). */
108
162
  isGroupExpanded(group: GroupRow): boolean;
109
163
  /**
110
- * Toggles a group's hierarchy expansion and rebuilds the visible rows.
164
+ * Toggles a level's expansion (reveals/hides its next node). Collapsing a
165
+ * level also collapses everything deeper under it so re-opening starts fresh.
111
166
  * @param {GroupRow} group
167
+ * @param {number} index - -1 for the group row, else the node index.
112
168
  * @memberof YourGroupsComponent
113
169
  */
114
- onToggleHierarchy(group: GroupRow): void;
170
+ onToggleLevel(group: GroupRow, index: number): void;
115
171
  /**
116
172
  * Toggles the card's expanded/collapsed state (whole table visibility) and
117
173
  * emits the new state so the host's two-way binding stays in sync.
@@ -147,9 +203,11 @@ export declare class YourGroupsComponent {
147
203
  */
148
204
  trackByRow(index: number, row: TableRow): string;
149
205
  /**
150
- * Rebuilds the flat list of visible rows: the current page of top-level group
151
- * rows, each optionally followed by its hierarchy (ancestor) rows when the
152
- * group is expanded. The hierarchy path is shown root→leaf, indented by depth.
206
+ * Rebuilds the visible rows for the current page. Each group reveals its
207
+ * hierarchy ONE level at a time (Groups-module style): the group row reveals
208
+ * node 0 only when its own level (-1) is expanded; node 0 reveals node 1 only
209
+ * when node 0's level is expanded; and so on. Each revealed node that still
210
+ * has a child carries its own +/- toggle.
153
211
  * @memberof YourGroupsComponent
154
212
  */
155
213
  private rebuildRows;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ieeesa-npm/dashboard",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.1.0",
6
6
  "@angular/core": "^16.1.0",