@coolon/angular-ui-powerups 16.1.0-alpha.241 → 16.1.0-alpha.244

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[];
@@ -29,12 +29,8 @@ export declare class PopupMenuRendererComponent extends DisposableComponent {
29
29
  * ignored when deciding whether a neighbouring separator has content to divide.
30
30
  */
31
31
  private willRender;
32
- /** Children with orphan separators collapsed. When `visibleWhile(...)` hides a command,
33
- * a separator sitting between hidden items — or at the top/bottom of the resulting
34
- * menu — would render as an empty visual gap. This filters out (1) non-rendering
35
- * entries, (2) leading separators, (3) consecutive separators, and (4) trailing
36
- * separators, so separators appear only between two elements that actually paint.
37
- */
32
+ /** Children with orphan separators collapsed — see collapse-orphan-separators.ts for the
33
+ * algorithm and its unit tests. */
38
34
  get renderableChildren(): readonly PopupAwareComponent[];
39
35
  executeCommand(data: PopupAwareComponent): void;
40
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.241",
3
+ "version": "16.1.0-alpha.244",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^16.2.9",
6
6
  "@angular/common": "^16.2.9",