@coolon/angular-ui-powerups 16.1.0-alpha.255 → 16.1.0-alpha.256

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,53 @@
1
+ import { MatTooltip } from '@angular/material/tooltip';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * `matTooltip` that also renders inside a detached change-detection subtree — i.e. inside an
5
+ * `aup-table` body with `AUP_TABLE_OPTIMIZED_CHANGE_DETECTION`.
6
+ *
7
+ * MatTooltip creates its overlay component with `new ComponentPortal(component, this._viewContainerRef)`,
8
+ * so the CDK takes the `portal.viewContainerRef` branch of `attachComponentPortal` and skips
9
+ * `ApplicationRef.attachView`: only the DOM node is relocated to the overlay container, while the
10
+ * component itself stays a change-detection child of the view that hosts the trigger. MatTooltip then
11
+ * merely calls `markForCheck()` on it, twice:
12
+ *
13
+ * - in `_updateTooltipMessage()`, right after attaching — the message;
14
+ * - in `TooltipComponent._onShow()`, `showDelay` later — `_isMultiline`, which drives
15
+ * `mdc-tooltip--multiline` and therefore `text-align: left`.
16
+ *
17
+ * Neither reaches a detached subtree, so the tooltip opens EMPTY and, once text does appear, is
18
+ * centred until some unrelated check runs — a visible layout shift, or no text at all if the pointer
19
+ * is held still. Both were measured in a device table before this existed.
20
+ *
21
+ * `_viewContainerRef` and `_portal` are private in `_MatTooltipBase`, so the cause cannot be fixed
22
+ * from a subclass; the honest fix belongs upstream. What a subclass CAN do is force the checks that
23
+ * MatTooltip only requests. Hooking `show()` — rather than a hover event — is what makes this
24
+ * reliable: `super.show()` has attached the overlay and set the message by the time it returns, so
25
+ * there is no ordering to race. (A listener on an ancestor element loses that race unpredictably: the
26
+ * trigger's own `mouseenter` is a separate event dispatch.)
27
+ *
28
+ * Inherited options keep their Material names, e.g.
29
+ * `<span [aupTooltip]="text" matTooltipPosition="above">`.
30
+ */
31
+ export declare class AupTooltipDirective extends MatTooltip {
32
+ /**
33
+ * The very container MatTooltip inserts its overlay component into, so the inserted ViewRefs ARE the
34
+ * tooltip's views. Measured in a browser: after `super.show()` this holds exactly 1 view, and
35
+ * checking it turns the overlay's text from "" into the message. Preferred over the injected
36
+ * `ChangeDetectorRef` (which also works) because it targets the tooltip's own view rather than
37
+ * whichever enclosing view the node injector happens to resolve to.
38
+ */
39
+ private readonly container;
40
+ set text(value: string);
41
+ get text(): string;
42
+ show(delay?: number, origin?: {
43
+ x: number;
44
+ y: number;
45
+ }): void;
46
+ private check;
47
+ static ɵfac: i0.ɵɵFactoryDeclaration<AupTooltipDirective, never>;
48
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AupTooltipDirective, "[aupTooltip]", ["aupTooltip"], { "text": { "alias": "aupTooltip"; "required": false; }; }, {}, never, never, false, never>;
49
+ }
50
+ export declare namespace AupTooltipDirective {
51
+ /** Enough to land after `_onShow()` has set `_isMultiline`, small enough to be imperceptible. */
52
+ const LAYOUT_CHECK_GRACE_MS = 20;
53
+ }
@@ -1,18 +1,20 @@
1
1
  import * as i0 from "@angular/core";
2
- import * as i1 from "./command.directive";
3
- import * as i2 from "./focus-binding.directive";
4
- import * as i3 from "./highlight.pipe";
5
- import * as i4 from "./highlight-text-model.directive";
6
- import * as i5 from "./garbage-collector.directive";
7
- import * as i6 from "@angular/common";
8
- import * as i7 from "@angular/platform-browser/animations";
9
- import * as i8 from "@angular/forms";
10
- import * as i9 from "@angular/material/input";
11
- import * as i10 from "@angular/material/form-field";
12
- import * as i11 from "@angular/material/select";
13
- import * as i12 from "@angular/material/tabs";
2
+ import * as i1 from "./aup-tooltip.directive";
3
+ import * as i2 from "./command.directive";
4
+ import * as i3 from "./focus-binding.directive";
5
+ import * as i4 from "./highlight.pipe";
6
+ import * as i5 from "./highlight-text-model.directive";
7
+ import * as i6 from "./garbage-collector.directive";
8
+ import * as i7 from "@angular/common";
9
+ import * as i8 from "@angular/platform-browser/animations";
10
+ import * as i9 from "@angular/forms";
11
+ import * as i10 from "@angular/material/input";
12
+ import * as i11 from "@angular/material/form-field";
13
+ import * as i12 from "@angular/material/select";
14
+ import * as i13 from "@angular/material/tabs";
15
+ import * as i14 from "@angular/material/tooltip";
14
16
  export declare class DirectivesModule {
15
17
  static ɵfac: i0.ɵɵFactoryDeclaration<DirectivesModule, never>;
16
- static ɵmod: i0.ɵɵNgModuleDeclaration<DirectivesModule, [typeof i1.CommandDirective, typeof i2.FocusBindingDirective, typeof i3.HighlightPipe, typeof i4.HighlightTextModelDirective, typeof i5.GarbageCollectorDirective], [typeof i6.CommonModule, typeof i7.BrowserAnimationsModule, typeof i8.FormsModule, typeof i9.MatInputModule, typeof i10.MatFormFieldModule, typeof i11.MatSelectModule, typeof i12.MatTabsModule], [typeof i1.CommandDirective, typeof i2.FocusBindingDirective, typeof i3.HighlightPipe, typeof i4.HighlightTextModelDirective, typeof i5.GarbageCollectorDirective]>;
18
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DirectivesModule, [typeof i1.AupTooltipDirective, typeof i2.CommandDirective, typeof i3.FocusBindingDirective, typeof i4.HighlightPipe, typeof i5.HighlightTextModelDirective, typeof i6.GarbageCollectorDirective], [typeof i7.CommonModule, typeof i8.BrowserAnimationsModule, typeof i9.FormsModule, typeof i10.MatInputModule, typeof i11.MatFormFieldModule, typeof i12.MatSelectModule, typeof i13.MatTabsModule, typeof i14.MatTooltipModule], [typeof i1.AupTooltipDirective, typeof i2.CommandDirective, typeof i3.FocusBindingDirective, typeof i4.HighlightPipe, typeof i5.HighlightTextModelDirective, typeof i6.GarbageCollectorDirective]>;
17
19
  static ɵinj: i0.ɵɵInjectorDeclaration<DirectivesModule>;
18
20
  }
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @file Automatically generated by barrelsby.
3
3
  */
4
+ export * from "./aup-tooltip.directive";
4
5
  export * from "./command.directive";
5
6
  export * from "./directives.module";
6
7
  export * from "./focus-binding-factory";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "16.1.0-alpha.255",
3
+ "version": "16.1.0-alpha.256",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^16.2.9",
6
6
  "@angular/common": "^16.2.9",