@coolon/angular-ui-powerups 16.1.0-alpha.240 → 16.1.0-alpha.242

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.
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Pure algorithm behind PopupMenuRendererComponent.renderableChildren, extracted so it
3
+ * can be exercised in isolation. See collapse-orphan-separators.spec.ts.
4
+ *
5
+ * Given the raw popup children[] and predicates for "this is a separator" and "this will
6
+ * actually paint", returns the subset that should feed the *ngFor: separators are kept only
7
+ * where they divide two elements that actually render, and every non-rendering entry
8
+ * (hidden commands or bookkeeping children with no template branch) is dropped.
9
+ *
10
+ * Concretely, filters out:
11
+ * 1. entries where `willRender(child)` is false (hidden commands + framework entries)
12
+ * 2. leading separators (nothing to divide above)
13
+ * 3. consecutive separators (all but the first collapse into one)
14
+ * 4. trailing separators (nothing to divide below)
15
+ */
16
+ export declare function collapseOrphanSeparators<T>(children: readonly T[], isSeparator: (child: T) => boolean, willRender: (child: T) => boolean): T[];
@@ -23,13 +23,14 @@ export declare class PopupMenuRendererComponent extends DisposableComponent {
23
23
  TrackBy: typeof Track;
24
24
  constructor();
25
25
  get children(): readonly PopupAwareComponent[];
26
- /** Children with orphan separators collapsed. When `visibleWhile(...)` hides a command,
27
- * a separator sitting between hidden items — or at the top/bottom of the resulting
28
- * menu — would render as an empty visual gap. This filters out (1) leading separators,
29
- * (2) consecutive separators (all but the first), and (3) trailing separators, treating
30
- * hidden commands as if they weren't there. Separators are kept only where they actually
31
- * divide two visible items.
26
+ /** True when the child matches one of the template's four `*ngIf` branches and will
27
+ * actually produce a rendered element. Everything else — notably `ButtonRendererComponent`
28
+ * entries that appear in `children` for other purposes — renders as nothing, so must be
29
+ * ignored when deciding whether a neighbouring separator has content to divide.
32
30
  */
31
+ private willRender;
32
+ /** Children with orphan separators collapsed — see collapse-orphan-separators.ts for the
33
+ * algorithm and its unit tests. */
33
34
  get renderableChildren(): readonly PopupAwareComponent[];
34
35
  executeCommand(data: PopupAwareComponent): void;
35
36
  isCommandEnabled(data: PopupAwareComponent): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "16.1.0-alpha.240",
3
+ "version": "16.1.0-alpha.242",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^16.2.9",
6
6
  "@angular/common": "^16.2.9",