@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.
- package/esm2022/lib/directives/aup-tooltip.directive.mjs +84 -0
- package/esm2022/lib/directives/directives.module.mjs +14 -5
- package/esm2022/lib/directives/exports.mjs +2 -1
- package/fesm2022/coolon-angular-ui-powerups.mjs +95 -7
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/directives/aup-tooltip.directive.d.ts +53 -0
- package/lib/directives/directives.module.d.ts +15 -13
- package/lib/directives/exports.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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 "./
|
|
3
|
-
import * as i2 from "./
|
|
4
|
-
import * as i3 from "./
|
|
5
|
-
import * as i4 from "./highlight
|
|
6
|
-
import * as i5 from "./
|
|
7
|
-
import * as i6 from "
|
|
8
|
-
import * as i7 from "@angular/
|
|
9
|
-
import * as i8 from "@angular/
|
|
10
|
-
import * as i9 from "@angular/
|
|
11
|
-
import * as i10 from "@angular/material/
|
|
12
|
-
import * as i11 from "@angular/material/
|
|
13
|
-
import * as i12 from "@angular/material/
|
|
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.
|
|
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
|
}
|