@coolon/angular-ui-powerups 16.1.0-alpha.323 → 16.1.0-alpha.325

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.
Files changed (22) hide show
  1. package/esm2022/lib/components/cards/card-container/card-container.component.mjs +1 -1
  2. package/esm2022/lib/components/commands/button-renderer/button-renderer.component.mjs +3 -3
  3. package/esm2022/lib/components/commands/command/command.component.mjs +1 -1
  4. package/esm2022/lib/components/forms/number-input/number-input.component.mjs +1 -1
  5. package/esm2022/lib/components/forms/search-input/search-input.component.mjs +1 -1
  6. package/esm2022/lib/components/tables/paginator/paginator.component.mjs +1 -1
  7. package/esm2022/lib/directives/command.directive.mjs +17 -26
  8. package/esm2022/lib/interaction/activity-ref.mjs +14 -1
  9. package/esm2022/lib/interaction/components/activity-container/activity-container.component.mjs +9 -1
  10. package/esm2022/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.mjs +2 -1
  11. package/esm2022/lib/interaction/components/add-card-activity/add-card-activity.component.mjs +1 -1
  12. package/esm2022/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.mjs +1 -1
  13. package/esm2022/lib/interaction/components/slide-down-interaction-context/slide-down-interaction-context.component.mjs +9 -1
  14. package/esm2022/lib/place/components/list-place-nav/list-place-nav.component.mjs +1 -1
  15. package/esm2022/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.mjs +2 -2
  16. package/fesm2022/coolon-angular-ui-powerups.mjs +89 -68
  17. package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
  18. package/lib/directives/command.directive.d.ts +8 -10
  19. package/lib/interaction/activity-ref.d.ts +9 -0
  20. package/lib/interaction/components/activity-container/activity-container.component.d.ts +6 -0
  21. package/lib/interaction/components/slide-down-interaction-context/slide-down-interaction-context.component.d.ts +6 -0
  22. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  import { AfterViewInit, ChangeDetectorRef, ElementRef, OnDestroy, OnInit } from '@angular/core';
2
2
  import { MatButton } from '@angular/material/button';
3
- import { MatMenu, MatMenuItem } from '@angular/material/menu';
3
+ import { MatMenuItem } from '@angular/material/menu';
4
4
  import { Command, GarbageCollector, UnaryCommand } from '@coolon/pectin';
5
5
  import * as i0 from "@angular/core";
6
6
  /**
@@ -9,9 +9,10 @@ import * as i0 from "@angular/core";
9
9
  * 1. A click runs the command, with [commandParameter] for a UnaryCommand.
10
10
  * 2. The element is disabled while the command is, Material buttons and menu items included.
11
11
  * 3. The element is hidden while the command is invisible, as `aup-command` hides itself, so a
12
- * `visibleWhile` gate hides the element without an `*ngIf` of its own. [hideWhenInvisible] false
13
- * keeps it shown.
14
- * 4. A click is kept from the element's ancestors, except a menu item's, whose menu closes on it.
12
+ * `visibleWhile` gate hides the element without an `*ngIf` of its own. It is disabled while hidden
13
+ * too, so the keyboard cannot reach it either: Material's menu moves the arrow keys and type-ahead
14
+ * past disabled items, but not past hidden ones.
15
+ * 4. A click is kept from the element's ancestors, except inside a menu, which closes on it.
15
16
  */
16
17
  export declare class CommandDirective<P = any> extends GarbageCollector implements OnInit, OnDestroy, AfterViewInit {
17
18
  private elementRef;
@@ -22,7 +23,6 @@ export declare class CommandDirective<P = any> extends GarbageCollector implemen
22
23
  /** The element's own inline display, put back when the command shows again. */
23
24
  private displayWhenVisible?;
24
25
  private matControl;
25
- private isInPopupMenu;
26
26
  set pectinCommand(command: Command<any> | UnaryCommand<P>);
27
27
  get pectinCommand(): Command<any> | UnaryCommand<P>;
28
28
  private _commandParameter;
@@ -30,9 +30,7 @@ export declare class CommandDirective<P = any> extends GarbageCollector implemen
30
30
  set commandParameter(value: P);
31
31
  get commandParameter(): P;
32
32
  preventDefault: boolean;
33
- /** False to keep the element shown, though disabled, while its command is invisible. */
34
- hideWhenInvisible: boolean;
35
- constructor(elementRef: ElementRef, changeDetector: ChangeDetectorRef, matButton: MatButton, matMenuItem: MatMenuItem, matMenu?: MatMenu);
33
+ constructor(elementRef: ElementRef, changeDetector: ChangeDetectorRef, matButton: MatButton, matMenuItem: MatMenuItem);
36
34
  ngOnInit(): void;
37
35
  /**
38
36
  * Hides the element with an inline `display: none`, which a component's own `display` rule cannot
@@ -43,6 +41,6 @@ export declare class CommandDirective<P = any> extends GarbageCollector implemen
43
41
  updateEnabledState(enabled: boolean): void;
44
42
  ngOnDestroy(): void;
45
43
  notifyClick($event: Event): void;
46
- static ɵfac: i0.ɵɵFactoryDeclaration<CommandDirective<any>, [null, null, { optional: true; host: true; }, { optional: true; host: true; }, { optional: true; }]>;
47
- static ɵdir: i0.ɵɵDirectiveDeclaration<CommandDirective<any>, "[pectinCommand]", never, { "pectinCommand": { "alias": "pectinCommand"; "required": false; }; "commandParameter": { "alias": "commandParameter"; "required": false; }; "preventDefault": { "alias": "preventDefault"; "required": false; }; "hideWhenInvisible": { "alias": "hideWhenInvisible"; "required": false; }; }, {}, never, never, false, never>;
44
+ static ɵfac: i0.ɵɵFactoryDeclaration<CommandDirective<any>, [null, null, { optional: true; host: true; }, { optional: true; host: true; }]>;
45
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CommandDirective<any>, "[pectinCommand]", never, { "pectinCommand": { "alias": "pectinCommand"; "required": false; }; "commandParameter": { "alias": "commandParameter"; "required": false; }; "preventDefault": { "alias": "preventDefault"; "required": false; }; }, {}, never, never, false, never>;
48
46
  }
@@ -8,6 +8,7 @@ export declare class ActivityRef<D, R, E> {
8
8
  private _complete;
9
9
  private _activity;
10
10
  private deferredResult;
11
+ private readonly destroyed;
11
12
  private readonly focusedModel;
12
13
  private readonly _activityBusy;
13
14
  constructor(activityClass: Constructable<Activity<D, R, E>>, activityData: D, onComplete: (activityRef: ActivityRef<D, R, E>) => void);
@@ -21,4 +22,12 @@ export declare class ActivityRef<D, R, E> {
21
22
  cancel(): void;
22
23
  get activityResult(): Promise<R>;
23
24
  get activityBusy(): import("@coolon/pectin").ValueModel<boolean>;
25
+ /**
26
+ * Resolves once the activity's component has been destroyed. The result settles first, and the
27
+ * component can stay on the page after it, as a slide-down's activity does while the slide-down
28
+ * closes. So the models an activity reads are disposed after this, not after the result.
29
+ */
30
+ get whenDestroyed(): Promise<void>;
31
+ /** The outlet calls this once it has destroyed the activity's component. */
32
+ notifyActivityDestroyed(): void;
24
33
  }
@@ -62,6 +62,12 @@ export declare class ActivityContainerComponent<D, R, E> extends AbstractInterac
62
62
  */
63
63
  isCleaningUp(): boolean;
64
64
  waitForInteractionContextCleanupToFinish(): Promise<any>;
65
+ /**
66
+ * Resolves once every activity the container holds has been destroyed, the finished ones included.
67
+ * An activity's result settles before its component leaves the page, so an owner disposes the
68
+ * models it gave the activity after this, not after the result.
69
+ */
70
+ whenClosed(): Promise<void>;
65
71
  /**
66
72
  * Register a one-shot callback invoked the moment the container has no active activity left
67
73
  * (the last activity completed via done()/cancel()). It fires BEFORE route synchronisation, so
@@ -51,6 +51,12 @@ export declare class SlideDownInteractionContextComponent<D, R, E> extends Dispo
51
51
  confirmThenExecute<R1>(confirm: Confirm, operation: (interactionContext: InteractionContext) => (Promise<R1> | R1)): Promise<R1>;
52
52
  isActive(): boolean;
53
53
  startActivity<D1, R1, E1>(activityType: Constructable<Activity<D1, R1, E1>>, data?: D1, options?: InteractionContext.Options): Promise<R1>;
54
+ /**
55
+ * Resolves once the slide-down's activities have left the page. An activity's result settles while
56
+ * it is still shown, as the slide-down closes, so models given to it are disposed after this:
57
+ * `try { await slideDown.startActivity(...) } finally { slideDown.whenClosed().then(() => garbage.dispose()) }`.
58
+ */
59
+ whenClosed(): Promise<void>;
54
60
  onAnimationDone(): void;
55
61
  static ɵfac: i0.ɵɵFactoryDeclaration<SlideDownInteractionContextComponent<any, any, any>, [{ optional: true; }]>;
56
62
  static ɵcmp: i0.ɵɵComponentDeclaration<SlideDownInteractionContextComponent<any, any, any>, "aup-slide-down-interaction-context", never, { "opensChoicesAs": { "alias": "opensChoicesAs"; "required": false; }; "dynamicHeight": { "alias": "dynamicHeight"; "required": false; }; }, {}, never, never, false, never>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "16.1.0-alpha.323",
3
+ "version": "16.1.0-alpha.325",
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.147",
15
+ "@coolon/pectin": "^5.0.0-alpha.149",
16
16
  "fast-typescript-memoize": "^1.1.1",
17
17
  "lodash-es": "^4.17.21",
18
18
  "marked": "4.0.10",