@su-labs/tooltip 0.0.0-stage → 20.0.0
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/CHANGELOG.md +21 -0
- package/LICENSE +21 -0
- package/README.md +130 -2
- package/fesm2022/su-labs-tooltip.mjs +498 -0
- package/fesm2022/su-labs-tooltip.mjs.map +1 -0
- package/index.d.ts +115 -0
- package/package.json +49 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [22.0.0] - 2026-11-18
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `su-lib-tooltip`: its content is the trigger and `text` (a string or an `<ng-template>`) is what the tooltip shows
|
|
13
|
+
- `openOn`: `hover` (and keyboard focus), closing once the pointer or focus leaves, or `click`, staying open until clicked again, a click outside or Escape
|
|
14
|
+
- `interactive`: the pointer can move onto a hover tooltip, over an invisible bridge across the gap, e.g. to click a link; otherwise the pointer goes through it so it never covers what the user moves to
|
|
15
|
+
- `trigger="icon"`: a "?" button after the content; the tooltip grows out of the icon to `width`, as tall as its text, and the "?" turns into its close button; `icon` replaces the "?" with a short text or an `<ng-template>`
|
|
16
|
+
- `placement`: `top`, `right`, `bottom` or `left`, each with `-start` and `-end`; it moves to the other side when the asked one has no room and stays inside the screen, with an arrow pointing at the trigger (`arrow`, `offset`)
|
|
17
|
+
- `animated`: grows out of the trigger and back into it, off when the user prefers less motion
|
|
18
|
+
- `showDelay`, `hideDelay`, `disabled`, `[(open)]`, and `show()`, `hide()`, `toggle()`
|
|
19
|
+
- A hover tooltip is `role="tooltip"` and describes its trigger with `aria-describedby`; a click or icon tooltip's button has `aria-expanded` and `aria-controls`; plain text content becomes focusable; Escape closes it and focus goes back to the trigger
|
|
20
|
+
- The top layer (`popover`), so no `overflow: hidden` or `z-index` around it cuts it off
|
|
21
|
+
- `label` and `labels` to replace the texts (`SU_TOOLTIP_LABELS`), and `--su-tooltip-*` CSS variables for the look
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Yevheniy Alekseyev <yev.alekseyev@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,131 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Tooltip
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@su-labs/tooltip`
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
Tooltips for Angular:
|
|
9
|
+
|
|
10
|
+
- **On your content**: whatever you put between the tags is the trigger: a word, a button, a link.
|
|
11
|
+
- **Or a "?" icon**: the tooltip grows out of the icon, as wide as you ask and as tall as its text, and the "?" turns into its close button.
|
|
12
|
+
- **Hover or click**: opens on hover and keyboard focus and closes once they leave, or opens on click and stays until it's closed.
|
|
13
|
+
- **Interactive or not**: by default the pointer goes through the tooltip, so it never covers what the user moves to; interactive ones let the pointer move onto them, e.g. to click a link.
|
|
14
|
+
- **Twelve placements**: top, right, bottom or left, each centred or lined up with the start or end, with an arrow pointing at the trigger. It moves to the other side when there's no room and stays on screen.
|
|
15
|
+
- **Animated**: grows out of the trigger and back into it, or not at all; off when the user prefers less motion.
|
|
16
|
+
- **Accessible**: `role="tooltip"` with `aria-describedby`, or a button with `aria-expanded`; Escape closes it.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @su-labs/tooltip@ng20
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
This is the Angular 20 version. For the newest Angular, install `@su-labs/tooltip` without a tag.
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { SuTooltipComponent } from '@su-labs/tooltip';
|
|
30
|
+
|
|
31
|
+
@Component({
|
|
32
|
+
imports: [SuTooltipComponent],
|
|
33
|
+
})
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<su-lib-tooltip text="Saves a draft">Save</su-lib-tooltip>
|
|
38
|
+
|
|
39
|
+
<su-lib-tooltip text="Saves a draft" placement="bottom-start">
|
|
40
|
+
<button type="button">Save</button>
|
|
41
|
+
</su-lib-tooltip>
|
|
42
|
+
|
|
43
|
+
<su-lib-tooltip openOn="click" interactive [text]="help">Shipping</su-lib-tooltip>
|
|
44
|
+
<ng-template #help>Free over 50 €. <a href="/shipping">Read more</a></ng-template>
|
|
45
|
+
|
|
46
|
+
<su-lib-tooltip trigger="icon" width="18rem" text="Prices include VAT." />
|
|
47
|
+
<su-lib-tooltip trigger="icon" text="Prices include VAT.">Price</su-lib-tooltip>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```html
|
|
51
|
+
<su-lib-tooltip trigger="icon" icon="i" text="Good to know" />
|
|
52
|
+
|
|
53
|
+
<su-lib-tooltip trigger="icon" [icon]="info" text="Good to know" />
|
|
54
|
+
<ng-template #info><svg viewBox="0 0 24 24" width="60%" height="60%">…</svg></ng-template>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The content is the trigger and `text` is what the tooltip shows: a string, or an `<ng-template>` for links and markup. With `trigger="icon"`, the content is a label shown before the "?".
|
|
58
|
+
|
|
59
|
+
| Input | Default | |
|
|
60
|
+
|---|---|---|
|
|
61
|
+
| `text` | `''` | What the tooltip shows: a string or a `TemplateRef` |
|
|
62
|
+
| `trigger` | `'content'` | `'content'` (the content between the tags) or `'icon'` (a "?" button after it) |
|
|
63
|
+
| `icon` | the "?" | Your own icon: a short text such as `'i'`, or an `<ng-template>` with an SVG; it turns into the "×" too |
|
|
64
|
+
| `placement` | `'top'` | `top`, `right`, `bottom`, `left`, each also with `-start` or `-end` |
|
|
65
|
+
| `openOn` | `'hover'`, `'click'` for the icon | `'hover'` (and keyboard focus) or `'click'` |
|
|
66
|
+
| `interactive` | `false` | The pointer can move onto a hover tooltip; always on with `click` |
|
|
67
|
+
| `animated` | `true` | Grows out of the trigger and back into it |
|
|
68
|
+
| `width` | — | Any CSS length; without it, the tooltip fits its text up to `--su-tooltip-max-width`, `16rem` for the icon |
|
|
69
|
+
| `arrow` | `true` | The arrow pointing at the trigger (not on icon tooltips) |
|
|
70
|
+
| `offset` | `8` | Pixels between the trigger and the tooltip |
|
|
71
|
+
| `showDelay` | `300` | Milliseconds the pointer rests on the trigger before it opens |
|
|
72
|
+
| `hideDelay` | `100` | Milliseconds before it closes once the pointer leaves |
|
|
73
|
+
| `disabled` | `false` | Doesn't open, and closes if open |
|
|
74
|
+
| `[(open)]` | `false` | Whether it's open; setting it opens or closes it at once |
|
|
75
|
+
| `label` | `'More information'` | The "?" icon's name for screen readers |
|
|
76
|
+
| `labels` | English | Texts to replace: `more`, `close` |
|
|
77
|
+
|
|
78
|
+
| Method | |
|
|
79
|
+
|---|---|
|
|
80
|
+
| `show()` / `hide()` / `toggle()` | Opens or closes it now, through a reference: `<su-lib-tooltip #tip>` and `(click)="tip.show()"` |
|
|
81
|
+
|
|
82
|
+
## Accessibility
|
|
83
|
+
|
|
84
|
+
- A hover tooltip has `role="tooltip"` and describes its trigger with `aria-describedby`: the content's first focusable element, or the tooltip itself, which becomes focusable when the content is plain text.
|
|
85
|
+
- With `openOn="click"`, the trigger has `aria-expanded` and `aria-controls`; plain text content gets `role="button"` and opens with Enter or Space.
|
|
86
|
+
- The "?" icon is a button with `aria-expanded`; opening moves focus to the close button in the tooltip, and closing moves it back to the "?".
|
|
87
|
+
- Escape closes any open tooltip; a click outside closes it too. Focus goes back to the trigger when it was inside.
|
|
88
|
+
- Animation is off when the user prefers reduced motion.
|
|
89
|
+
|
|
90
|
+
The tooltip opens in the top layer (`popover="manual"`), so no `overflow: hidden` or `z-index` around it cuts it off.
|
|
91
|
+
|
|
92
|
+
## Theming
|
|
93
|
+
|
|
94
|
+
| Variable | Default | |
|
|
95
|
+
|---|---|---|
|
|
96
|
+
| `--su-tooltip-background` | `#1f2937` | |
|
|
97
|
+
| `--su-tooltip-text-color` | `#f9fafb` | |
|
|
98
|
+
| `--su-tooltip-border` | `0` | |
|
|
99
|
+
| `--su-tooltip-radius` | `0.375rem` | |
|
|
100
|
+
| `--su-tooltip-padding` | `0.375rem 0.625rem` | |
|
|
101
|
+
| `--su-tooltip-shadow` | `0 6px 20px rgb(0 0 0 / 0.18)` | |
|
|
102
|
+
| `--su-tooltip-font-family` | `inherit` | |
|
|
103
|
+
| `--su-tooltip-font-size` | `0.875rem` | |
|
|
104
|
+
| `--su-tooltip-line-height` | `1.45` | |
|
|
105
|
+
| `--su-tooltip-max-width` | `20rem` | Without `width` |
|
|
106
|
+
| `--su-tooltip-arrow-size` | `8px` | |
|
|
107
|
+
| `--su-tooltip-z-index` | `1000` | Only in browsers without the popover API |
|
|
108
|
+
| `--su-tooltip-icon-size` | `1.375rem` | The "?" button |
|
|
109
|
+
| `--su-tooltip-icon-background` | the tooltip's background | The "?" and the tooltip it grows into |
|
|
110
|
+
| `--su-tooltip-icon-color` | the tooltip's text colour | |
|
|
111
|
+
| `--su-tooltip-icon-radius` | `0.875rem` | The icon tooltip's corners |
|
|
112
|
+
| `--su-tooltip-icon-padding` | `0.5rem 0.75rem` | |
|
|
113
|
+
| `--su-tooltip-focus-ring` | `2px solid currentColor` | The "?" and close buttons |
|
|
114
|
+
| `--su-tooltip-duration` | `200ms` | |
|
|
115
|
+
| `--su-tooltip-easing` | `cubic-bezier(0.2, 0.9, 0.3, 1.1)` | |
|
|
116
|
+
|
|
117
|
+
```css
|
|
118
|
+
su-lib-tooltip {
|
|
119
|
+
--su-tooltip-background: #fef3c7;
|
|
120
|
+
--su-tooltip-text-color: #78350f;
|
|
121
|
+
--su-tooltip-icon-background: #f59e0b;
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Without Angular
|
|
126
|
+
|
|
127
|
+
The open state, delays and placement maths come from [`@su-labs/core/tooltip`](https://www.npmjs.com/package/@su-labs/core), for vanilla JS, React, Vue or Svelte.
|
|
128
|
+
|
|
129
|
+
## License
|
|
130
|
+
|
|
131
|
+
MIT
|
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { input, booleanAttribute, numberAttribute, model, computed, TemplateRef, signal, inject, ElementRef, viewChild, DestroyRef, effect, untracked, afterRenderEffect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import { SU_TOOLTIP_LABELS, SuTooltipController, suTooltipIconPosition, suTooltipIconClip, suTooltipPosition } from '@su-labs/core/tooltip';
|
|
5
|
+
|
|
6
|
+
let nextTooltipId = 0;
|
|
7
|
+
const FOCUSABLE = 'a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"]), [contenteditable="true"]';
|
|
8
|
+
const DEFAULT_DURATION = 200;
|
|
9
|
+
/**
|
|
10
|
+
* A tooltip over `SuTooltipController` from `@su-labs/core/tooltip`. Its content is the trigger, `text` is what the
|
|
11
|
+
* tooltip shows. It opens on hover and focus or on click (`openOn`), beside the trigger with an arrow, and grows out
|
|
12
|
+
* of it. With `trigger="icon"` a "?" button follows the content and the tooltip grows out of that icon, which turns
|
|
13
|
+
* into its close button.
|
|
14
|
+
*/
|
|
15
|
+
class SuTooltipComponent {
|
|
16
|
+
/** What the tooltip shows: a text, or an `<ng-template>` for links, formatting or any other markup */
|
|
17
|
+
text = input('', ...(ngDevMode ? [{ debugName: "text" }] : []));
|
|
18
|
+
/** The trigger: the content between the tags, or a "?" icon after it that grows into the tooltip @default 'content' */
|
|
19
|
+
trigger = input('content', ...(ngDevMode ? [{ debugName: "trigger" }] : []));
|
|
20
|
+
/** The icon instead of the "?": a short text such as `i` or `!`, or an `<ng-template>` with your own SVG */
|
|
21
|
+
icon = input('', ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
22
|
+
/** The side the tooltip opens on, lined up with the trigger's start or end with `-start` and `-end` @default 'top' */
|
|
23
|
+
placement = input('top', ...(ngDevMode ? [{ debugName: "placement" }] : []));
|
|
24
|
+
/** What opens it: `hover` (and keyboard focus) or `click` @default 'hover', 'click' for the icon */
|
|
25
|
+
openOn = input(...(ngDevMode ? [undefined, { debugName: "openOn" }] : []));
|
|
26
|
+
/**
|
|
27
|
+
* The pointer can move onto the tooltip, e.g. to click a link in it; otherwise the pointer goes through it and
|
|
28
|
+
* it closes as soon as the pointer leaves the trigger. Always on with `click` @default false
|
|
29
|
+
*/
|
|
30
|
+
interactive = input(false, ...(ngDevMode ? [{ debugName: "interactive", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
31
|
+
/** Grows out of the trigger when it opens and back into it when it closes; off when the user prefers less motion @default true */
|
|
32
|
+
animated = input(true, ...(ngDevMode ? [{ debugName: "animated", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
33
|
+
/** The tooltip's width, any CSS length; without it, it fits its text up to `--su-tooltip-max-width` (`16rem` for the icon) */
|
|
34
|
+
width = input(...(ngDevMode ? [undefined, { debugName: "width" }] : []));
|
|
35
|
+
/** The arrow pointing at the trigger, beside content triggers @default true */
|
|
36
|
+
arrow = input(true, ...(ngDevMode ? [{ debugName: "arrow", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
37
|
+
/** Pixels between the trigger and the tooltip @default 8 */
|
|
38
|
+
offset = input(8, ...(ngDevMode ? [{ debugName: "offset", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
39
|
+
/** Milliseconds the pointer rests on the trigger before it opens @default 300 */
|
|
40
|
+
showDelay = input(300, ...(ngDevMode ? [{ debugName: "showDelay", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
41
|
+
/** Milliseconds before it closes once the pointer leaves @default 100 */
|
|
42
|
+
hideDelay = input(100, ...(ngDevMode ? [{ debugName: "hideDelay", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
43
|
+
/** Doesn't open, and closes if open @default false */
|
|
44
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
45
|
+
/** The icon's name for screen readers @default labels.more */
|
|
46
|
+
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
47
|
+
/** Texts to replace, e.g. in the page's language */
|
|
48
|
+
labels = input({}, ...(ngDevMode ? [{ debugName: "labels" }] : []));
|
|
49
|
+
/** Whether the tooltip is open; setting it opens or closes it at once */
|
|
50
|
+
open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
51
|
+
panelId = `su-tooltip-${nextTooltipId++}`;
|
|
52
|
+
isIcon = computed(() => this.trigger() === 'icon', ...(ngDevMode ? [{ debugName: "isIcon" }] : []));
|
|
53
|
+
opensOn = computed(() => this.openOn() ?? (this.isIcon() ? 'click' : 'hover'), ...(ngDevMode ? [{ debugName: "opensOn" }] : []));
|
|
54
|
+
isInteractive = computed(() => this.interactive() || this.opensOn() === 'click', ...(ngDevMode ? [{ debugName: "isInteractive" }] : []));
|
|
55
|
+
/** A hover tooltip describes its trigger; the others are shown and hidden by a button */
|
|
56
|
+
describes = computed(() => !this.isIcon() && this.opensOn() === 'hover', ...(ngDevMode ? [{ debugName: "describes" }] : []));
|
|
57
|
+
template = computed(() => {
|
|
58
|
+
const text = this.text();
|
|
59
|
+
return text instanceof TemplateRef ? text : null;
|
|
60
|
+
}, ...(ngDevMode ? [{ debugName: "template" }] : []));
|
|
61
|
+
plainText = computed(() => {
|
|
62
|
+
const text = this.text();
|
|
63
|
+
return typeof text === 'string' ? text : '';
|
|
64
|
+
}, ...(ngDevMode ? [{ debugName: "plainText" }] : []));
|
|
65
|
+
iconTemplate = computed(() => {
|
|
66
|
+
const icon = this.icon();
|
|
67
|
+
return icon instanceof TemplateRef ? icon : null;
|
|
68
|
+
}, ...(ngDevMode ? [{ debugName: "iconTemplate" }] : []));
|
|
69
|
+
iconText = computed(() => {
|
|
70
|
+
const icon = this.icon();
|
|
71
|
+
return typeof icon === 'string' ? icon : '';
|
|
72
|
+
}, ...(ngDevMode ? [{ debugName: "iconText" }] : []));
|
|
73
|
+
texts = computed(() => ({
|
|
74
|
+
...SU_TOOLTIP_LABELS,
|
|
75
|
+
...this.labels(),
|
|
76
|
+
}), ...(ngDevMode ? [{ debugName: "texts" }] : []));
|
|
77
|
+
/** The close button shows the "×" once the icon has opened, so the "?" turns into it */
|
|
78
|
+
morphed = signal(false, ...(ngDevMode ? [{ debugName: "morphed" }] : []));
|
|
79
|
+
host = inject(ElementRef);
|
|
80
|
+
document = inject(DOCUMENT);
|
|
81
|
+
panel = viewChild.required('panel');
|
|
82
|
+
content = viewChild.required('content');
|
|
83
|
+
iconButton = viewChild('iconButton', ...(ngDevMode ? [{ debugName: "iconButton" }] : []));
|
|
84
|
+
closeButton = viewChild('closeButton', ...(ngDevMode ? [{ debugName: "closeButton" }] : []));
|
|
85
|
+
controller = new SuTooltipController();
|
|
86
|
+
animation = null;
|
|
87
|
+
iconClip = null;
|
|
88
|
+
shown = false;
|
|
89
|
+
/** The close button takes focus once the icon tooltip opens, after the user opened it with the icon */
|
|
90
|
+
focusOnOpen = false;
|
|
91
|
+
leftWhileGrowing = false;
|
|
92
|
+
/** Focus coming back to the trigger after the tooltip closed doesn't open it again */
|
|
93
|
+
returningFocus = false;
|
|
94
|
+
linkedTrigger = null;
|
|
95
|
+
constructor() {
|
|
96
|
+
const unsubscribe = this.controller.state.subscribe(state => this.open.set(state.open));
|
|
97
|
+
const destroyRef = inject(DestroyRef);
|
|
98
|
+
destroyRef.onDestroy(() => {
|
|
99
|
+
unsubscribe();
|
|
100
|
+
this.controller.cancel();
|
|
101
|
+
this.animation?.cancel();
|
|
102
|
+
});
|
|
103
|
+
effect(() => {
|
|
104
|
+
const delays = {
|
|
105
|
+
showDelay: this.showDelay(),
|
|
106
|
+
hideDelay: this.hideDelay(),
|
|
107
|
+
};
|
|
108
|
+
untracked(() => this.controller.setDelays(delays));
|
|
109
|
+
});
|
|
110
|
+
effect(() => {
|
|
111
|
+
const open = this.open() && !this.disabled();
|
|
112
|
+
untracked(() => {
|
|
113
|
+
this.controller.setOpen(open);
|
|
114
|
+
this.open.set(open);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
effect(onCleanup => {
|
|
118
|
+
if (!this.open()) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const onKeydown = (event) => this.onDocumentKeydown(event);
|
|
122
|
+
const onPointerDown = (event) => this.onDocumentPointerDown(event);
|
|
123
|
+
const onMove = () => this.place();
|
|
124
|
+
const view = this.document.defaultView;
|
|
125
|
+
this.document.addEventListener('keydown', onKeydown);
|
|
126
|
+
this.document.addEventListener('pointerdown', onPointerDown);
|
|
127
|
+
view?.addEventListener('scroll', onMove, true);
|
|
128
|
+
view?.addEventListener('resize', onMove);
|
|
129
|
+
onCleanup(() => {
|
|
130
|
+
this.document.removeEventListener('keydown', onKeydown);
|
|
131
|
+
this.document.removeEventListener('pointerdown', onPointerDown);
|
|
132
|
+
view?.removeEventListener('scroll', onMove, true);
|
|
133
|
+
view?.removeEventListener('resize', onMove);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
afterRenderEffect(() => {
|
|
137
|
+
const open = this.open();
|
|
138
|
+
untracked(() => (open ? this.reveal() : this.conceal()));
|
|
139
|
+
});
|
|
140
|
+
afterRenderEffect(() => {
|
|
141
|
+
const trigger = this.isIcon() ? null : this.contentTrigger();
|
|
142
|
+
const describes = this.describes();
|
|
143
|
+
const open = this.open();
|
|
144
|
+
untracked(() => this.linkTrigger(trigger, describes, open));
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
/** Opens the tooltip now */
|
|
148
|
+
show() {
|
|
149
|
+
this.controller.open();
|
|
150
|
+
}
|
|
151
|
+
/** Closes the tooltip now */
|
|
152
|
+
hide() {
|
|
153
|
+
this.controller.close();
|
|
154
|
+
}
|
|
155
|
+
/** Opens or closes the tooltip now */
|
|
156
|
+
toggle() {
|
|
157
|
+
this.controller.toggle();
|
|
158
|
+
}
|
|
159
|
+
onPointerEnter(event) {
|
|
160
|
+
if (this.disabled() ||
|
|
161
|
+
event.pointerType === 'touch' ||
|
|
162
|
+
this.opensOn() !== 'hover') {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
this.controller.show();
|
|
166
|
+
}
|
|
167
|
+
onPointerLeave(event) {
|
|
168
|
+
if (event.pointerType === 'touch' || this.opensOn() !== 'hover') {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (this.isGrowing()) {
|
|
172
|
+
this.leftWhileGrowing = true;
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
this.controller.hide();
|
|
176
|
+
}
|
|
177
|
+
onFocusIn(event) {
|
|
178
|
+
if (this.inPanel(event.target)) {
|
|
179
|
+
this.controller.cancel();
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (!this.disabled() &&
|
|
183
|
+
!this.returningFocus &&
|
|
184
|
+
this.opensOn() === 'hover') {
|
|
185
|
+
this.controller.open();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
onFocusOut(event) {
|
|
189
|
+
const next = this.asNode(event.relatedTarget);
|
|
190
|
+
if (!next || this.host.nativeElement.contains(next)) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
this.controller.close();
|
|
194
|
+
}
|
|
195
|
+
onClick(event) {
|
|
196
|
+
if (this.disabled() || this.inPanel(event.target)) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (this.isIcon()) {
|
|
200
|
+
if (!this.iconButton()?.nativeElement.contains(this.asNode(event.target))) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
this.focusOnOpen = !this.open();
|
|
204
|
+
this.controller.toggle();
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
if (this.opensOn() === 'click') {
|
|
208
|
+
this.controller.toggle();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
onKeydown(event) {
|
|
212
|
+
if (event.key === 'Escape' && this.open()) {
|
|
213
|
+
event.stopPropagation();
|
|
214
|
+
this.closeAndRefocus();
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
const isHostButton = !this.isIcon() &&
|
|
218
|
+
this.opensOn() === 'click' &&
|
|
219
|
+
event.target === this.host.nativeElement &&
|
|
220
|
+
this.contentTrigger() === this.host.nativeElement;
|
|
221
|
+
if (isHostButton && (event.key === 'Enter' || event.key === ' ')) {
|
|
222
|
+
event.preventDefault();
|
|
223
|
+
this.controller.toggle();
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
onClose() {
|
|
227
|
+
this.closeAndRefocus();
|
|
228
|
+
}
|
|
229
|
+
onDocumentKeydown(event) {
|
|
230
|
+
if (event.key === 'Escape' && !event.defaultPrevented) {
|
|
231
|
+
this.closeAndRefocus();
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
onDocumentPointerDown(event) {
|
|
235
|
+
const target = this.asNode(event.target);
|
|
236
|
+
if (!target || !this.host.nativeElement.contains(target)) {
|
|
237
|
+
this.controller.close();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
closeAndRefocus() {
|
|
241
|
+
const hadFocus = this.host.nativeElement.contains(this.document.activeElement);
|
|
242
|
+
this.controller.close();
|
|
243
|
+
if (hadFocus) {
|
|
244
|
+
this.returningFocus = true;
|
|
245
|
+
this.triggerElement()?.focus({ preventScroll: true });
|
|
246
|
+
this.returningFocus = false;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
reveal() {
|
|
250
|
+
const panel = this.panel().nativeElement;
|
|
251
|
+
this.animation?.cancel();
|
|
252
|
+
this.leftWhileGrowing = false;
|
|
253
|
+
if (!this.shown) {
|
|
254
|
+
this.shown = true;
|
|
255
|
+
panel.classList.add('su-tooltip-shown');
|
|
256
|
+
if (typeof panel.showPopover === 'function' && !panel.matches(':popover-open')) {
|
|
257
|
+
panel.showPopover();
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
this.place();
|
|
261
|
+
if (this.focusOnOpen) {
|
|
262
|
+
this.focusOnOpen = false;
|
|
263
|
+
this.closeButton()?.nativeElement.focus({ preventScroll: true });
|
|
264
|
+
}
|
|
265
|
+
requestFrame(this.document, () => this.morphed.set(true));
|
|
266
|
+
if (this.moves(panel)) {
|
|
267
|
+
this.animation = this.isIcon()
|
|
268
|
+
? this.growFromIcon(panel)
|
|
269
|
+
: panel.animate([
|
|
270
|
+
{ opacity: 0, transform: 'scale(0.6)' },
|
|
271
|
+
{ opacity: 1, transform: 'none' },
|
|
272
|
+
], { duration: this.duration(panel), easing: this.easing(panel) });
|
|
273
|
+
if (this.animation) {
|
|
274
|
+
this.animation.onfinish = () => this.hideIfLeftWhileGrowing();
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
/** While it grows, only its visible part counts as under the pointer, so a pointer on the rest seems to leave it */
|
|
279
|
+
isGrowing() {
|
|
280
|
+
return this.open() && this.animation?.playState === 'running';
|
|
281
|
+
}
|
|
282
|
+
hideIfLeftWhileGrowing() {
|
|
283
|
+
this.animation = null;
|
|
284
|
+
if (this.leftWhileGrowing && !this.host.nativeElement.matches(':hover')) {
|
|
285
|
+
this.controller.hide();
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
conceal() {
|
|
289
|
+
this.morphed.set(false);
|
|
290
|
+
if (!this.shown) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
const panel = this.panel().nativeElement;
|
|
294
|
+
this.animation?.cancel();
|
|
295
|
+
if (!this.moves(panel)) {
|
|
296
|
+
this.removePanel(panel);
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
const duration = this.duration(panel) * 0.75;
|
|
300
|
+
const animation = this.isIcon() && this.iconClip
|
|
301
|
+
? panel.animate([{ clipPath: this.iconClip.to }, { clipPath: this.iconClip.from }], { duration, easing: 'ease-in' })
|
|
302
|
+
: panel.animate([
|
|
303
|
+
{ opacity: 1, transform: 'none' },
|
|
304
|
+
{ opacity: 0, transform: 'scale(0.6)' },
|
|
305
|
+
], { duration, easing: 'ease-in' });
|
|
306
|
+
animation.onfinish = () => this.removePanel(panel);
|
|
307
|
+
this.animation = animation;
|
|
308
|
+
}
|
|
309
|
+
removePanel(panel) {
|
|
310
|
+
this.shown = false;
|
|
311
|
+
this.animation = null;
|
|
312
|
+
panel.classList.remove('su-tooltip-shown');
|
|
313
|
+
if (typeof panel.hidePopover === 'function' && panel.matches(':popover-open')) {
|
|
314
|
+
panel.hidePopover();
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
growFromIcon(panel) {
|
|
318
|
+
if (!this.iconClip) {
|
|
319
|
+
return null;
|
|
320
|
+
}
|
|
321
|
+
const duration = this.duration(panel);
|
|
322
|
+
panel
|
|
323
|
+
.querySelector('.su-tooltip-body')
|
|
324
|
+
?.animate([{ opacity: 0 }, { opacity: 0, offset: 0.4 }, { opacity: 1 }], {
|
|
325
|
+
duration,
|
|
326
|
+
});
|
|
327
|
+
return panel.animate([{ clipPath: this.iconClip.from }, { clipPath: this.iconClip.to }], { duration, easing: this.easing(panel) });
|
|
328
|
+
}
|
|
329
|
+
place() {
|
|
330
|
+
if (!this.shown) {
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
const panel = this.panel().nativeElement;
|
|
334
|
+
const view = this.document.defaultView;
|
|
335
|
+
const viewport = {
|
|
336
|
+
width: this.document.documentElement.clientWidth,
|
|
337
|
+
height: view?.innerHeight ?? 0,
|
|
338
|
+
};
|
|
339
|
+
const rtl = view?.getComputedStyle(this.host.nativeElement).direction === 'rtl';
|
|
340
|
+
const size = {
|
|
341
|
+
width: panel.offsetWidth,
|
|
342
|
+
height: panel.offsetHeight,
|
|
343
|
+
};
|
|
344
|
+
const icon = this.iconButton()?.nativeElement;
|
|
345
|
+
if (this.isIcon() && icon) {
|
|
346
|
+
const iconRect = icon.getBoundingClientRect();
|
|
347
|
+
const position = suTooltipIconPosition(iconRect, size, {
|
|
348
|
+
placement: this.placement(),
|
|
349
|
+
viewport,
|
|
350
|
+
rtl,
|
|
351
|
+
});
|
|
352
|
+
panel.dataset['inline'] = position.inline;
|
|
353
|
+
panel.dataset['block'] = position.block;
|
|
354
|
+
panel.style.left = `${position.x}px`;
|
|
355
|
+
panel.style.top = `${position.y}px`;
|
|
356
|
+
panel.style.setProperty('--su-tooltip-icon-x', `${position.icon.x}px`);
|
|
357
|
+
panel.style.setProperty('--su-tooltip-icon-y', `${position.icon.y}px`);
|
|
358
|
+
const radius = parseFloat(view?.getComputedStyle(panel).borderTopLeftRadius ?? '') || 0;
|
|
359
|
+
this.iconClip = suTooltipIconClip(position, size, iconRect.width, radius);
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
const position = suTooltipPosition(this.content().nativeElement.getBoundingClientRect(), size, { placement: this.placement(), offset: this.offset(), viewport, rtl });
|
|
363
|
+
panel.dataset['side'] = position.side;
|
|
364
|
+
panel.style.left = `${position.x}px`;
|
|
365
|
+
panel.style.top = `${position.y}px`;
|
|
366
|
+
panel.style.transformOrigin = `${position.origin.x}px ${position.origin.y}px`;
|
|
367
|
+
panel.style.setProperty('--su-tooltip-arrow-offset', `${position.arrow}px`);
|
|
368
|
+
}
|
|
369
|
+
moves(panel) {
|
|
370
|
+
const view = this.document.defaultView;
|
|
371
|
+
return (this.animated() &&
|
|
372
|
+
typeof panel.animate === 'function' &&
|
|
373
|
+
!view?.matchMedia?.('(prefers-reduced-motion: reduce)').matches);
|
|
374
|
+
}
|
|
375
|
+
duration(panel) {
|
|
376
|
+
const value = this.document.defaultView
|
|
377
|
+
?.getComputedStyle(panel)
|
|
378
|
+
.getPropertyValue('--su-tooltip-duration')
|
|
379
|
+
.trim();
|
|
380
|
+
return toMilliseconds(value) ?? DEFAULT_DURATION;
|
|
381
|
+
}
|
|
382
|
+
easing(panel) {
|
|
383
|
+
const value = this.document.defaultView
|
|
384
|
+
?.getComputedStyle(panel)
|
|
385
|
+
.getPropertyValue('--su-tooltip-easing')
|
|
386
|
+
.trim();
|
|
387
|
+
return value || 'cubic-bezier(0.2, 0.9, 0.3, 1.1)';
|
|
388
|
+
}
|
|
389
|
+
/** The element that takes focus for the tooltip: the icon, the content's first focusable element, or the host */
|
|
390
|
+
triggerElement() {
|
|
391
|
+
return this.isIcon()
|
|
392
|
+
? (this.iconButton()?.nativeElement ?? null)
|
|
393
|
+
: this.contentTrigger();
|
|
394
|
+
}
|
|
395
|
+
contentTrigger() {
|
|
396
|
+
return (this.content().nativeElement.querySelector(FOCUSABLE) ??
|
|
397
|
+
this.host.nativeElement);
|
|
398
|
+
}
|
|
399
|
+
linkTrigger(trigger, describes, open) {
|
|
400
|
+
if (this.linkedTrigger && this.linkedTrigger !== trigger) {
|
|
401
|
+
this.unlink(this.linkedTrigger);
|
|
402
|
+
}
|
|
403
|
+
this.linkedTrigger = trigger;
|
|
404
|
+
if (!trigger) {
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
const isHost = trigger === this.host.nativeElement;
|
|
408
|
+
if (describes) {
|
|
409
|
+
setToken(trigger, 'aria-describedby', this.panelId, true);
|
|
410
|
+
trigger.removeAttribute('aria-expanded');
|
|
411
|
+
trigger.removeAttribute('aria-controls');
|
|
412
|
+
}
|
|
413
|
+
else {
|
|
414
|
+
setToken(trigger, 'aria-describedby', this.panelId, false);
|
|
415
|
+
trigger.setAttribute('aria-expanded', String(open));
|
|
416
|
+
trigger.setAttribute('aria-controls', this.panelId);
|
|
417
|
+
}
|
|
418
|
+
toggleAttribute(trigger, 'role', 'button', isHost && !describes);
|
|
419
|
+
toggleAttribute(trigger, 'tabindex', '0', isHost);
|
|
420
|
+
}
|
|
421
|
+
unlink(trigger) {
|
|
422
|
+
setToken(trigger, 'aria-describedby', this.panelId, false);
|
|
423
|
+
trigger.removeAttribute('aria-expanded');
|
|
424
|
+
trigger.removeAttribute('aria-controls');
|
|
425
|
+
if (trigger === this.host.nativeElement) {
|
|
426
|
+
trigger.removeAttribute('role');
|
|
427
|
+
trigger.removeAttribute('tabindex');
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
inPanel(target) {
|
|
431
|
+
const node = this.asNode(target);
|
|
432
|
+
return !!node && this.panel().nativeElement.contains(node);
|
|
433
|
+
}
|
|
434
|
+
asNode(target) {
|
|
435
|
+
return target instanceof Node ? target : null;
|
|
436
|
+
}
|
|
437
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.35", ngImport: i0, type: SuTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
438
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.35", type: SuTooltipComponent, isStandalone: true, selector: "su-lib-tooltip", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, trigger: { classPropertyName: "trigger", publicName: "trigger", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, openOn: { classPropertyName: "openOn", publicName: "openOn", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, animated: { classPropertyName: "animated", publicName: "animated", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, arrow: { classPropertyName: "arrow", publicName: "arrow", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "offset", isSignal: true, isRequired: false, transformFunction: null }, showDelay: { classPropertyName: "showDelay", publicName: "showDelay", isSignal: true, isRequired: false, transformFunction: null }, hideDelay: { classPropertyName: "hideDelay", publicName: "hideDelay", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: { listeners: { "pointerenter": "onPointerEnter($event)", "pointerleave": "onPointerLeave($event)", "focusin": "onFocusIn($event)", "focusout": "onFocusOut($event)", "click": "onClick($event)", "keydown": "onKeydown($event)" }, properties: { "class.su-tooltip-open": "open()", "style.--su-tooltip-width": "width()", "style.--su-tooltip-offset.px": "offset()" }, classAttribute: "su-tooltip" }, viewQueries: [{ propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "content", first: true, predicate: ["content"], descendants: true, isSignal: true }, { propertyName: "iconButton", first: true, predicate: ["iconButton"], descendants: true, isSignal: true }, { propertyName: "closeButton", first: true, predicate: ["closeButton"], descendants: true, isSignal: true }], ngImport: i0, template: "<span #content class=\"su-tooltip-content\"><ng-content /></span>\n@if (isIcon()) {\n <button\n #iconButton\n type=\"button\"\n class=\"su-tooltip-icon\"\n [attr.aria-label]=\"label() ?? texts().more\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"panelId\">\n <ng-container [ngTemplateOutlet]=\"iconGlyph\" />\n </button>\n}\n<ng-template #iconGlyph>\n @if (iconTemplate(); as glyph) {\n <ng-container [ngTemplateOutlet]=\"glyph\" />\n } @else if (iconText()) {\n <span class=\"su-tooltip-icon-text\" aria-hidden=\"true\">{{ iconText() }}</span>\n } @else {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M9 9a3 3 0 1 1 4.5 2.6c-.9.5-1.5 1.2-1.5 2.2V15\" />\n <path d=\"M12 19h.01\" />\n </svg>\n }\n</ng-template>\n<div\n #panel\n popover=\"manual\"\n class=\"su-tooltip-panel\"\n [id]=\"panelId\"\n [attr.role]=\"describes() ? 'tooltip' : null\"\n [class.su-tooltip-panel-icon]=\"isIcon()\"\n [class.su-tooltip-interactive]=\"isInteractive()\">\n @if (isIcon()) {\n <button\n #closeButton\n type=\"button\"\n class=\"su-tooltip-close\"\n [class.su-tooltip-morphed]=\"morphed()\"\n [attr.aria-label]=\"texts().close\"\n (click)=\"onClose()\">\n <span class=\"su-tooltip-glyph su-tooltip-glyph-icon\">\n <ng-container [ngTemplateOutlet]=\"iconGlyph\" />\n </span>\n <span class=\"su-tooltip-glyph su-tooltip-glyph-close\">\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6L6 18\" />\n </svg>\n </span>\n </button>\n } @else if (arrow()) {\n <span class=\"su-tooltip-arrow\" aria-hidden=\"true\"></span>\n }\n <div class=\"su-tooltip-body\">\n @if (template(); as body) {\n <ng-container [ngTemplateOutlet]=\"body\" />\n } @else {\n {{ plainText() }}\n }\n </div>\n</div>\n", styles: [":host{display:inline}.su-tooltip-content:not(:empty)+.su-tooltip-icon{margin-inline-start:.25em}.su-tooltip-icon,.su-tooltip-close{block-size:var(--su-tooltip-icon-size, 1.375rem);border:0;border-radius:50%;cursor:pointer;display:inline-grid;inline-size:var(--su-tooltip-icon-size, 1.375rem);padding:0;place-items:center}.su-tooltip-icon:focus-visible,.su-tooltip-close:focus-visible{outline:var(--su-tooltip-focus-ring, 2px solid currentColor);outline-offset:2px}.su-tooltip-icon svg,.su-tooltip-close svg{block-size:62%;fill:none;inline-size:62%;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:2.5}.su-tooltip-icon{background:var(--su-tooltip-icon-background, var(--su-tooltip-background, #1f2937));color:var(--su-tooltip-icon-color, var(--su-tooltip-text-color, #f9fafb));vertical-align:middle}.su-tooltip-panel{background:var(--su-tooltip-background, #1f2937);border:var(--su-tooltip-border, 0);border-radius:var(--su-tooltip-radius, .375rem);box-shadow:var(--su-tooltip-shadow, 0 6px 20px rgba(0, 0, 0, .18));box-sizing:border-box;color:var(--su-tooltip-text-color, #f9fafb);display:none;font-family:var(--su-tooltip-font-family, inherit);font-size:var(--su-tooltip-font-size, .875rem);font-weight:400;height:max-content;inset:auto;line-height:var(--su-tooltip-line-height, 1.45);margin:0;max-width:min(var(--su-tooltip-max-width, 20rem),100vw - 16px);overflow:visible;padding:var(--su-tooltip-padding, .375rem .625rem);pointer-events:none;position:fixed;text-align:start;white-space:normal;width:var(--su-tooltip-width, max-content);z-index:var(--su-tooltip-z-index, 1000)}.su-tooltip-panel.su-tooltip-shown{display:block}.su-tooltip-panel.su-tooltip-interactive{pointer-events:auto}.su-tooltip-panel.su-tooltip-interactive:before{content:\"\";position:absolute}.su-tooltip-panel[data-side=top]:before{block-size:calc(var(--su-tooltip-offset, 8px) + 2px);inset-inline:0;top:100%}.su-tooltip-panel[data-side=bottom]:before{block-size:calc(var(--su-tooltip-offset, 8px) + 2px);bottom:100%;inset-inline:0}.su-tooltip-panel[data-side=left]:before{inline-size:calc(var(--su-tooltip-offset, 8px) + 2px);inset-block:0;left:100%}.su-tooltip-panel[data-side=right]:before{inline-size:calc(var(--su-tooltip-offset, 8px) + 2px);inset-block:0;right:100%}.su-tooltip-arrow{--su-tooltip-arrow-half: calc(var(--su-tooltip-arrow-size, 8px) / -2);background:inherit;block-size:var(--su-tooltip-arrow-size, 8px);inline-size:var(--su-tooltip-arrow-size, 8px);position:absolute;rotate:45deg}[data-side=top]>.su-tooltip-arrow{bottom:var(--su-tooltip-arrow-half);left:var(--su-tooltip-arrow-offset, 50%);translate:-50% 0}[data-side=bottom]>.su-tooltip-arrow{left:var(--su-tooltip-arrow-offset, 50%);top:var(--su-tooltip-arrow-half);translate:-50% 0}[data-side=left]>.su-tooltip-arrow{right:var(--su-tooltip-arrow-half);top:var(--su-tooltip-arrow-offset, 50%);translate:0 -50%}[data-side=right]>.su-tooltip-arrow{left:var(--su-tooltip-arrow-half);top:var(--su-tooltip-arrow-offset, 50%);translate:0 -50%}.su-tooltip-panel-icon{--su-tooltip-icon-gap: .5rem;background:var(--su-tooltip-icon-background, var(--su-tooltip-background, #1f2937));border-radius:var(--su-tooltip-icon-radius, .875rem);color:var(--su-tooltip-icon-color, var(--su-tooltip-text-color, #f9fafb));max-width:calc(100vw - 16px);min-block-size:calc(var(--su-tooltip-icon-size, 1.375rem) + 12px);overflow:hidden;padding:var(--su-tooltip-icon-padding, .5rem .75rem);width:var(--su-tooltip-width, 16rem)}.su-tooltip-panel-icon:not([data-inline=right]){padding-left:calc(6px + var(--su-tooltip-icon-size, 1.375rem) + var(--su-tooltip-icon-gap))}.su-tooltip-panel-icon[data-inline=right]{padding-right:calc(6px + var(--su-tooltip-icon-size, 1.375rem) + var(--su-tooltip-icon-gap))}.su-tooltip-close{background:transparent;color:inherit;display:grid;left:var(--su-tooltip-icon-x, 6px);position:absolute;top:var(--su-tooltip-icon-y, 6px)}.su-tooltip-icon-text{font-size:calc(var(--su-tooltip-icon-size, 1.375rem) * .6);font-weight:700;line-height:1}.su-tooltip-glyph{block-size:100%;display:grid;grid-area:1/1;inline-size:100%;place-items:center;transition:opacity var(--su-tooltip-duration, .2s) ease,rotate var(--su-tooltip-duration, .2s) var(--su-tooltip-easing, cubic-bezier(.2, .9, .3, 1.1))}.su-tooltip-glyph-close,.su-tooltip-morphed .su-tooltip-glyph-icon{opacity:0;rotate:-90deg}.su-tooltip-morphed .su-tooltip-glyph-close{opacity:1;rotate:0deg}@media(prefers-reduced-motion:reduce){.su-tooltip-glyph{transition:none}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
439
|
+
}
|
|
440
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.35", ngImport: i0, type: SuTooltipComponent, decorators: [{
|
|
441
|
+
type: Component,
|
|
442
|
+
args: [{ selector: 'su-lib-tooltip', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet], host: {
|
|
443
|
+
class: 'su-tooltip',
|
|
444
|
+
'[class.su-tooltip-open]': 'open()',
|
|
445
|
+
'[style.--su-tooltip-width]': 'width()',
|
|
446
|
+
'[style.--su-tooltip-offset.px]': 'offset()',
|
|
447
|
+
'(pointerenter)': 'onPointerEnter($event)',
|
|
448
|
+
'(pointerleave)': 'onPointerLeave($event)',
|
|
449
|
+
'(focusin)': 'onFocusIn($event)',
|
|
450
|
+
'(focusout)': 'onFocusOut($event)',
|
|
451
|
+
'(click)': 'onClick($event)',
|
|
452
|
+
'(keydown)': 'onKeydown($event)',
|
|
453
|
+
}, template: "<span #content class=\"su-tooltip-content\"><ng-content /></span>\n@if (isIcon()) {\n <button\n #iconButton\n type=\"button\"\n class=\"su-tooltip-icon\"\n [attr.aria-label]=\"label() ?? texts().more\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"panelId\">\n <ng-container [ngTemplateOutlet]=\"iconGlyph\" />\n </button>\n}\n<ng-template #iconGlyph>\n @if (iconTemplate(); as glyph) {\n <ng-container [ngTemplateOutlet]=\"glyph\" />\n } @else if (iconText()) {\n <span class=\"su-tooltip-icon-text\" aria-hidden=\"true\">{{ iconText() }}</span>\n } @else {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M9 9a3 3 0 1 1 4.5 2.6c-.9.5-1.5 1.2-1.5 2.2V15\" />\n <path d=\"M12 19h.01\" />\n </svg>\n }\n</ng-template>\n<div\n #panel\n popover=\"manual\"\n class=\"su-tooltip-panel\"\n [id]=\"panelId\"\n [attr.role]=\"describes() ? 'tooltip' : null\"\n [class.su-tooltip-panel-icon]=\"isIcon()\"\n [class.su-tooltip-interactive]=\"isInteractive()\">\n @if (isIcon()) {\n <button\n #closeButton\n type=\"button\"\n class=\"su-tooltip-close\"\n [class.su-tooltip-morphed]=\"morphed()\"\n [attr.aria-label]=\"texts().close\"\n (click)=\"onClose()\">\n <span class=\"su-tooltip-glyph su-tooltip-glyph-icon\">\n <ng-container [ngTemplateOutlet]=\"iconGlyph\" />\n </span>\n <span class=\"su-tooltip-glyph su-tooltip-glyph-close\">\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6L6 18\" />\n </svg>\n </span>\n </button>\n } @else if (arrow()) {\n <span class=\"su-tooltip-arrow\" aria-hidden=\"true\"></span>\n }\n <div class=\"su-tooltip-body\">\n @if (template(); as body) {\n <ng-container [ngTemplateOutlet]=\"body\" />\n } @else {\n {{ plainText() }}\n }\n </div>\n</div>\n", styles: [":host{display:inline}.su-tooltip-content:not(:empty)+.su-tooltip-icon{margin-inline-start:.25em}.su-tooltip-icon,.su-tooltip-close{block-size:var(--su-tooltip-icon-size, 1.375rem);border:0;border-radius:50%;cursor:pointer;display:inline-grid;inline-size:var(--su-tooltip-icon-size, 1.375rem);padding:0;place-items:center}.su-tooltip-icon:focus-visible,.su-tooltip-close:focus-visible{outline:var(--su-tooltip-focus-ring, 2px solid currentColor);outline-offset:2px}.su-tooltip-icon svg,.su-tooltip-close svg{block-size:62%;fill:none;inline-size:62%;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:2.5}.su-tooltip-icon{background:var(--su-tooltip-icon-background, var(--su-tooltip-background, #1f2937));color:var(--su-tooltip-icon-color, var(--su-tooltip-text-color, #f9fafb));vertical-align:middle}.su-tooltip-panel{background:var(--su-tooltip-background, #1f2937);border:var(--su-tooltip-border, 0);border-radius:var(--su-tooltip-radius, .375rem);box-shadow:var(--su-tooltip-shadow, 0 6px 20px rgba(0, 0, 0, .18));box-sizing:border-box;color:var(--su-tooltip-text-color, #f9fafb);display:none;font-family:var(--su-tooltip-font-family, inherit);font-size:var(--su-tooltip-font-size, .875rem);font-weight:400;height:max-content;inset:auto;line-height:var(--su-tooltip-line-height, 1.45);margin:0;max-width:min(var(--su-tooltip-max-width, 20rem),100vw - 16px);overflow:visible;padding:var(--su-tooltip-padding, .375rem .625rem);pointer-events:none;position:fixed;text-align:start;white-space:normal;width:var(--su-tooltip-width, max-content);z-index:var(--su-tooltip-z-index, 1000)}.su-tooltip-panel.su-tooltip-shown{display:block}.su-tooltip-panel.su-tooltip-interactive{pointer-events:auto}.su-tooltip-panel.su-tooltip-interactive:before{content:\"\";position:absolute}.su-tooltip-panel[data-side=top]:before{block-size:calc(var(--su-tooltip-offset, 8px) + 2px);inset-inline:0;top:100%}.su-tooltip-panel[data-side=bottom]:before{block-size:calc(var(--su-tooltip-offset, 8px) + 2px);bottom:100%;inset-inline:0}.su-tooltip-panel[data-side=left]:before{inline-size:calc(var(--su-tooltip-offset, 8px) + 2px);inset-block:0;left:100%}.su-tooltip-panel[data-side=right]:before{inline-size:calc(var(--su-tooltip-offset, 8px) + 2px);inset-block:0;right:100%}.su-tooltip-arrow{--su-tooltip-arrow-half: calc(var(--su-tooltip-arrow-size, 8px) / -2);background:inherit;block-size:var(--su-tooltip-arrow-size, 8px);inline-size:var(--su-tooltip-arrow-size, 8px);position:absolute;rotate:45deg}[data-side=top]>.su-tooltip-arrow{bottom:var(--su-tooltip-arrow-half);left:var(--su-tooltip-arrow-offset, 50%);translate:-50% 0}[data-side=bottom]>.su-tooltip-arrow{left:var(--su-tooltip-arrow-offset, 50%);top:var(--su-tooltip-arrow-half);translate:-50% 0}[data-side=left]>.su-tooltip-arrow{right:var(--su-tooltip-arrow-half);top:var(--su-tooltip-arrow-offset, 50%);translate:0 -50%}[data-side=right]>.su-tooltip-arrow{left:var(--su-tooltip-arrow-half);top:var(--su-tooltip-arrow-offset, 50%);translate:0 -50%}.su-tooltip-panel-icon{--su-tooltip-icon-gap: .5rem;background:var(--su-tooltip-icon-background, var(--su-tooltip-background, #1f2937));border-radius:var(--su-tooltip-icon-radius, .875rem);color:var(--su-tooltip-icon-color, var(--su-tooltip-text-color, #f9fafb));max-width:calc(100vw - 16px);min-block-size:calc(var(--su-tooltip-icon-size, 1.375rem) + 12px);overflow:hidden;padding:var(--su-tooltip-icon-padding, .5rem .75rem);width:var(--su-tooltip-width, 16rem)}.su-tooltip-panel-icon:not([data-inline=right]){padding-left:calc(6px + var(--su-tooltip-icon-size, 1.375rem) + var(--su-tooltip-icon-gap))}.su-tooltip-panel-icon[data-inline=right]{padding-right:calc(6px + var(--su-tooltip-icon-size, 1.375rem) + var(--su-tooltip-icon-gap))}.su-tooltip-close{background:transparent;color:inherit;display:grid;left:var(--su-tooltip-icon-x, 6px);position:absolute;top:var(--su-tooltip-icon-y, 6px)}.su-tooltip-icon-text{font-size:calc(var(--su-tooltip-icon-size, 1.375rem) * .6);font-weight:700;line-height:1}.su-tooltip-glyph{block-size:100%;display:grid;grid-area:1/1;inline-size:100%;place-items:center;transition:opacity var(--su-tooltip-duration, .2s) ease,rotate var(--su-tooltip-duration, .2s) var(--su-tooltip-easing, cubic-bezier(.2, .9, .3, 1.1))}.su-tooltip-glyph-close,.su-tooltip-morphed .su-tooltip-glyph-icon{opacity:0;rotate:-90deg}.su-tooltip-morphed .su-tooltip-glyph-close{opacity:1;rotate:0deg}@media(prefers-reduced-motion:reduce){.su-tooltip-glyph{transition:none}}\n"] }]
|
|
454
|
+
}], ctorParameters: () => [], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], trigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "trigger", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], openOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "openOn", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], animated: [{ type: i0.Input, args: [{ isSignal: true, alias: "animated", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], arrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "arrow", required: false }] }], offset: [{ type: i0.Input, args: [{ isSignal: true, alias: "offset", required: false }] }], showDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDelay", required: false }] }], hideDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideDelay", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], content: [{ type: i0.ViewChild, args: ['content', { isSignal: true }] }], iconButton: [{ type: i0.ViewChild, args: ['iconButton', { isSignal: true }] }], closeButton: [{ type: i0.ViewChild, args: ['closeButton', { isSignal: true }] }] } });
|
|
455
|
+
function setToken(element, name, token, present) {
|
|
456
|
+
const tokens = (element.getAttribute(name) ?? '')
|
|
457
|
+
.split(/\s+/)
|
|
458
|
+
.filter(item => item && item !== token);
|
|
459
|
+
const next = present ? [...tokens, token] : tokens;
|
|
460
|
+
if (next.length) {
|
|
461
|
+
element.setAttribute(name, next.join(' '));
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
element.removeAttribute(name);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
function toggleAttribute(element, name, value, present) {
|
|
468
|
+
if (present) {
|
|
469
|
+
element.setAttribute(name, value);
|
|
470
|
+
}
|
|
471
|
+
else {
|
|
472
|
+
element.removeAttribute(name);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
function toMilliseconds(value) {
|
|
476
|
+
const match = value?.match(/^([\d.]+)(ms|s)$/);
|
|
477
|
+
if (!match) {
|
|
478
|
+
return null;
|
|
479
|
+
}
|
|
480
|
+
const amount = Number(match[1]);
|
|
481
|
+
return match[2] === 's' ? amount * 1000 : amount;
|
|
482
|
+
}
|
|
483
|
+
function requestFrame(document, callback) {
|
|
484
|
+
const view = document.defaultView;
|
|
485
|
+
if (view?.requestAnimationFrame) {
|
|
486
|
+
view.requestAnimationFrame(callback);
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
callback();
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Generated bundle index. Do not edit.
|
|
495
|
+
*/
|
|
496
|
+
|
|
497
|
+
export { SuTooltipComponent };
|
|
498
|
+
//# sourceMappingURL=su-labs-tooltip.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"su-labs-tooltip.mjs","sources":["../../../../compat/angular-20/build/tooltip/src/lib/tooltip/tooltip.component.ts","../../../../compat/angular-20/build/tooltip/src/lib/tooltip/tooltip.component.html","../../../../compat/angular-20/build/tooltip/src/su-labs-tooltip.ts"],"sourcesContent":["import { DOCUMENT, NgTemplateOutlet } from '@angular/common';\nimport { afterRenderEffect, booleanAttribute, ChangeDetectionStrategy, Component, computed, DestroyRef, effect, ElementRef, inject, input, model, numberAttribute, signal, TemplateRef, untracked, viewChild } from '@angular/core';\nimport { SU_TOOLTIP_LABELS, suTooltipIconClip, suTooltipIconPosition, SuTooltipLabels, SuTooltipOpenOn, SuTooltipPlacement, suTooltipPosition, SuTooltipSize, SuTooltipTrigger, SuTooltipController } from '@su-labs/core/tooltip';\n\nlet nextTooltipId = 0;\n\nconst FOCUSABLE =\n 'a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]';\n\nconst DEFAULT_DURATION = 200;\n\n/**\n * A tooltip over `SuTooltipController` from `@su-labs/core/tooltip`. Its content is the trigger, `text` is what the\n * tooltip shows. It opens on hover and focus or on click (`openOn`), beside the trigger with an arrow, and grows out\n * of it. With `trigger=\"icon\"` a \"?\" button follows the content and the tooltip grows out of that icon, which turns\n * into its close button.\n */\n@Component({\n selector: 'su-lib-tooltip',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet],\n templateUrl: './tooltip.component.html',\n styleUrl: './tooltip.component.scss',\n host: {\n class: 'su-tooltip',\n '[class.su-tooltip-open]': 'open()',\n '[style.--su-tooltip-width]': 'width()',\n '[style.--su-tooltip-offset.px]': 'offset()',\n '(pointerenter)': 'onPointerEnter($event)',\n '(pointerleave)': 'onPointerLeave($event)',\n '(focusin)': 'onFocusIn($event)',\n '(focusout)': 'onFocusOut($event)',\n '(click)': 'onClick($event)',\n '(keydown)': 'onKeydown($event)',\n },\n})\nexport class SuTooltipComponent {\n /** What the tooltip shows: a text, or an `<ng-template>` for links, formatting or any other markup */\n readonly text = input<string | TemplateRef<unknown>>('');\n /** The trigger: the content between the tags, or a \"?\" icon after it that grows into the tooltip @default 'content' */\n readonly trigger = input<SuTooltipTrigger>('content');\n /** The icon instead of the \"?\": a short text such as `i` or `!`, or an `<ng-template>` with your own SVG */\n readonly icon = input<string | TemplateRef<unknown>>('');\n /** The side the tooltip opens on, lined up with the trigger's start or end with `-start` and `-end` @default 'top' */\n readonly placement = input<SuTooltipPlacement>('top');\n /** What opens it: `hover` (and keyboard focus) or `click` @default 'hover', 'click' for the icon */\n readonly openOn = input<SuTooltipOpenOn>();\n /**\n * The pointer can move onto the tooltip, e.g. to click a link in it; otherwise the pointer goes through it and\n * it closes as soon as the pointer leaves the trigger. Always on with `click` @default false\n */\n readonly interactive = input(false, { transform: booleanAttribute });\n /** Grows out of the trigger when it opens and back into it when it closes; off when the user prefers less motion @default true */\n readonly animated = input(true, { transform: booleanAttribute });\n /** The tooltip's width, any CSS length; without it, it fits its text up to `--su-tooltip-max-width` (`16rem` for the icon) */\n readonly width = input<string>();\n /** The arrow pointing at the trigger, beside content triggers @default true */\n readonly arrow = input(true, { transform: booleanAttribute });\n /** Pixels between the trigger and the tooltip @default 8 */\n readonly offset = input(8, { transform: numberAttribute });\n /** Milliseconds the pointer rests on the trigger before it opens @default 300 */\n readonly showDelay = input(300, { transform: numberAttribute });\n /** Milliseconds before it closes once the pointer leaves @default 100 */\n readonly hideDelay = input(100, { transform: numberAttribute });\n /** Doesn't open, and closes if open @default false */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** The icon's name for screen readers @default labels.more */\n readonly label = input<string>();\n /** Texts to replace, e.g. in the page's language */\n readonly labels = input<Partial<SuTooltipLabels>>({});\n /** Whether the tooltip is open; setting it opens or closes it at once */\n readonly open = model(false);\n\n protected readonly panelId = `su-tooltip-${nextTooltipId++}`;\n protected readonly isIcon = computed(() => this.trigger() === 'icon');\n protected readonly opensOn = computed<SuTooltipOpenOn>(\n () => this.openOn() ?? (this.isIcon() ? 'click' : 'hover')\n );\n protected readonly isInteractive = computed(\n () => this.interactive() || this.opensOn() === 'click'\n );\n /** A hover tooltip describes its trigger; the others are shown and hidden by a button */\n protected readonly describes = computed(\n () => !this.isIcon() && this.opensOn() === 'hover'\n );\n protected readonly template = computed(() => {\n const text = this.text();\n return text instanceof TemplateRef ? text : null;\n });\n protected readonly plainText = computed(() => {\n const text = this.text();\n return typeof text === 'string' ? text : '';\n });\n protected readonly iconTemplate = computed(() => {\n const icon = this.icon();\n return icon instanceof TemplateRef ? icon : null;\n });\n protected readonly iconText = computed(() => {\n const icon = this.icon();\n return typeof icon === 'string' ? icon : '';\n });\n protected readonly texts = computed<SuTooltipLabels>(() => ({\n ...SU_TOOLTIP_LABELS,\n ...this.labels(),\n }));\n /** The close button shows the \"×\" once the icon has opened, so the \"?\" turns into it */\n protected readonly morphed = signal(false);\n\n private readonly host: ElementRef<HTMLElement> = inject(ElementRef);\n private readonly document = inject(DOCUMENT);\n private readonly panel =\n viewChild.required<ElementRef<HTMLElement>>('panel');\n private readonly content =\n viewChild.required<ElementRef<HTMLElement>>('content');\n private readonly iconButton =\n viewChild<ElementRef<HTMLButtonElement>>('iconButton');\n private readonly closeButton =\n viewChild<ElementRef<HTMLButtonElement>>('closeButton');\n private readonly controller = new SuTooltipController();\n private animation: Animation | null = null;\n private iconClip: { readonly from: string; readonly to: string } | null =\n null;\n private shown = false;\n /** The close button takes focus once the icon tooltip opens, after the user opened it with the icon */\n private focusOnOpen = false;\n private leftWhileGrowing = false;\n /** Focus coming back to the trigger after the tooltip closed doesn't open it again */\n private returningFocus = false;\n private linkedTrigger: HTMLElement | null = null;\n\n constructor() {\n const unsubscribe = this.controller.state.subscribe(state =>\n this.open.set(state.open)\n );\n const destroyRef = inject(DestroyRef);\n destroyRef.onDestroy(() => {\n unsubscribe();\n this.controller.cancel();\n this.animation?.cancel();\n });\n\n effect(() => {\n const delays = {\n showDelay: this.showDelay(),\n hideDelay: this.hideDelay(),\n };\n untracked(() => this.controller.setDelays(delays));\n });\n\n effect(() => {\n const open = this.open() && !this.disabled();\n untracked(() => {\n this.controller.setOpen(open);\n this.open.set(open);\n });\n });\n\n effect(onCleanup => {\n if (!this.open()) {\n return;\n }\n const onKeydown = (event: KeyboardEvent) => this.onDocumentKeydown(event);\n const onPointerDown = (event: PointerEvent) =>\n this.onDocumentPointerDown(event);\n const onMove = () => this.place();\n const view = this.document.defaultView;\n this.document.addEventListener('keydown', onKeydown);\n this.document.addEventListener('pointerdown', onPointerDown);\n view?.addEventListener('scroll', onMove, true);\n view?.addEventListener('resize', onMove);\n onCleanup(() => {\n this.document.removeEventListener('keydown', onKeydown);\n this.document.removeEventListener('pointerdown', onPointerDown);\n view?.removeEventListener('scroll', onMove, true);\n view?.removeEventListener('resize', onMove);\n });\n });\n\n afterRenderEffect(() => {\n const open = this.open();\n untracked(() => (open ? this.reveal() : this.conceal()));\n });\n\n afterRenderEffect(() => {\n const trigger = this.isIcon() ? null : this.contentTrigger();\n const describes = this.describes();\n const open = this.open();\n untracked(() => this.linkTrigger(trigger, describes, open));\n });\n }\n\n /** Opens the tooltip now */\n show(): void {\n this.controller.open();\n }\n\n /** Closes the tooltip now */\n hide(): void {\n this.controller.close();\n }\n\n /** Opens or closes the tooltip now */\n toggle(): void {\n this.controller.toggle();\n }\n\n protected onPointerEnter(event: PointerEvent): void {\n if (\n this.disabled() ||\n event.pointerType === 'touch' ||\n this.opensOn() !== 'hover'\n ) {\n return;\n }\n this.controller.show();\n }\n\n protected onPointerLeave(event: PointerEvent): void {\n if (event.pointerType === 'touch' || this.opensOn() !== 'hover') {\n return;\n }\n if (this.isGrowing()) {\n this.leftWhileGrowing = true;\n return;\n }\n this.controller.hide();\n }\n\n protected onFocusIn(event: FocusEvent): void {\n if (this.inPanel(event.target)) {\n this.controller.cancel();\n return;\n }\n if (\n !this.disabled() &&\n !this.returningFocus &&\n this.opensOn() === 'hover'\n ) {\n this.controller.open();\n }\n }\n\n protected onFocusOut(event: FocusEvent): void {\n const next = this.asNode(event.relatedTarget);\n if (!next || this.host.nativeElement.contains(next)) {\n return;\n }\n this.controller.close();\n }\n\n protected onClick(event: MouseEvent): void {\n if (this.disabled() || this.inPanel(event.target)) {\n return;\n }\n if (this.isIcon()) {\n if (!this.iconButton()?.nativeElement.contains(this.asNode(event.target))) {\n return;\n }\n this.focusOnOpen = !this.open();\n this.controller.toggle();\n return;\n }\n if (this.opensOn() === 'click') {\n this.controller.toggle();\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && this.open()) {\n event.stopPropagation();\n this.closeAndRefocus();\n return;\n }\n const isHostButton =\n !this.isIcon() &&\n this.opensOn() === 'click' &&\n event.target === this.host.nativeElement &&\n this.contentTrigger() === this.host.nativeElement;\n if (isHostButton && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault();\n this.controller.toggle();\n }\n }\n\n protected onClose(): void {\n this.closeAndRefocus();\n }\n\n private onDocumentKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && !event.defaultPrevented) {\n this.closeAndRefocus();\n }\n }\n\n private onDocumentPointerDown(event: PointerEvent): void {\n const target = this.asNode(event.target);\n if (!target || !this.host.nativeElement.contains(target)) {\n this.controller.close();\n }\n }\n\n private closeAndRefocus(): void {\n const hadFocus = this.host.nativeElement.contains(\n this.document.activeElement\n );\n this.controller.close();\n if (hadFocus) {\n this.returningFocus = true;\n this.triggerElement()?.focus({ preventScroll: true });\n this.returningFocus = false;\n }\n }\n\n private reveal(): void {\n const panel = this.panel().nativeElement;\n this.animation?.cancel();\n this.leftWhileGrowing = false;\n if (!this.shown) {\n this.shown = true;\n panel.classList.add('su-tooltip-shown');\n if (typeof panel.showPopover === 'function' && !panel.matches(':popover-open')) {\n panel.showPopover();\n }\n }\n this.place();\n if (this.focusOnOpen) {\n this.focusOnOpen = false;\n this.closeButton()?.nativeElement.focus({ preventScroll: true });\n }\n requestFrame(this.document, () => this.morphed.set(true));\n if (this.moves(panel)) {\n this.animation = this.isIcon()\n ? this.growFromIcon(panel)\n : panel.animate(\n [\n { opacity: 0, transform: 'scale(0.6)' },\n { opacity: 1, transform: 'none' },\n ],\n { duration: this.duration(panel), easing: this.easing(panel) }\n );\n if (this.animation) {\n this.animation.onfinish = () => this.hideIfLeftWhileGrowing();\n }\n }\n }\n\n /** While it grows, only its visible part counts as under the pointer, so a pointer on the rest seems to leave it */\n private isGrowing(): boolean {\n return this.open() && this.animation?.playState === 'running';\n }\n\n private hideIfLeftWhileGrowing(): void {\n this.animation = null;\n if (this.leftWhileGrowing && !this.host.nativeElement.matches(':hover')) {\n this.controller.hide();\n }\n }\n\n private conceal(): void {\n this.morphed.set(false);\n if (!this.shown) {\n return;\n }\n const panel = this.panel().nativeElement;\n this.animation?.cancel();\n if (!this.moves(panel)) {\n this.removePanel(panel);\n return;\n }\n const duration = this.duration(panel) * 0.75;\n const animation =\n this.isIcon() && this.iconClip\n ? panel.animate(\n [{ clipPath: this.iconClip.to }, { clipPath: this.iconClip.from }],\n { duration, easing: 'ease-in' }\n )\n : panel.animate(\n [\n { opacity: 1, transform: 'none' },\n { opacity: 0, transform: 'scale(0.6)' },\n ],\n { duration, easing: 'ease-in' }\n );\n animation.onfinish = () => this.removePanel(panel);\n this.animation = animation;\n }\n\n private removePanel(panel: HTMLElement): void {\n this.shown = false;\n this.animation = null;\n panel.classList.remove('su-tooltip-shown');\n if (typeof panel.hidePopover === 'function' && panel.matches(':popover-open')) {\n panel.hidePopover();\n }\n }\n\n private growFromIcon(panel: HTMLElement): Animation | null {\n if (!this.iconClip) {\n return null;\n }\n const duration = this.duration(panel);\n panel\n .querySelector('.su-tooltip-body')\n ?.animate([{ opacity: 0 }, { opacity: 0, offset: 0.4 }, { opacity: 1 }], {\n duration,\n });\n return panel.animate(\n [{ clipPath: this.iconClip.from }, { clipPath: this.iconClip.to }],\n { duration, easing: this.easing(panel) }\n );\n }\n\n private place(): void {\n if (!this.shown) {\n return;\n }\n const panel = this.panel().nativeElement;\n const view = this.document.defaultView;\n const viewport = {\n width: this.document.documentElement.clientWidth,\n height: view?.innerHeight ?? 0,\n };\n const rtl = view?.getComputedStyle(this.host.nativeElement).direction === 'rtl';\n const size: SuTooltipSize = {\n width: panel.offsetWidth,\n height: panel.offsetHeight,\n };\n const icon = this.iconButton()?.nativeElement;\n if (this.isIcon() && icon) {\n const iconRect = icon.getBoundingClientRect();\n const position = suTooltipIconPosition(iconRect, size, {\n placement: this.placement(),\n viewport,\n rtl,\n });\n panel.dataset['inline'] = position.inline;\n panel.dataset['block'] = position.block;\n panel.style.left = `${position.x}px`;\n panel.style.top = `${position.y}px`;\n panel.style.setProperty('--su-tooltip-icon-x', `${position.icon.x}px`);\n panel.style.setProperty('--su-tooltip-icon-y', `${position.icon.y}px`);\n const radius = parseFloat(view?.getComputedStyle(panel).borderTopLeftRadius ?? '') || 0;\n this.iconClip = suTooltipIconClip(position, size, iconRect.width, radius);\n return;\n }\n const position = suTooltipPosition(\n this.content().nativeElement.getBoundingClientRect(),\n size,\n { placement: this.placement(), offset: this.offset(), viewport, rtl }\n );\n panel.dataset['side'] = position.side;\n panel.style.left = `${position.x}px`;\n panel.style.top = `${position.y}px`;\n panel.style.transformOrigin = `${position.origin.x}px ${position.origin.y}px`;\n panel.style.setProperty('--su-tooltip-arrow-offset', `${position.arrow}px`);\n }\n\n private moves(panel: HTMLElement): boolean {\n const view = this.document.defaultView;\n return (\n this.animated() &&\n typeof panel.animate === 'function' &&\n !view?.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n );\n }\n\n private duration(panel: HTMLElement): number {\n const value = this.document.defaultView\n ?.getComputedStyle(panel)\n .getPropertyValue('--su-tooltip-duration')\n .trim();\n return toMilliseconds(value) ?? DEFAULT_DURATION;\n }\n\n private easing(panel: HTMLElement): string {\n const value = this.document.defaultView\n ?.getComputedStyle(panel)\n .getPropertyValue('--su-tooltip-easing')\n .trim();\n return value || 'cubic-bezier(0.2, 0.9, 0.3, 1.1)';\n }\n\n /** The element that takes focus for the tooltip: the icon, the content's first focusable element, or the host */\n private triggerElement(): HTMLElement | null {\n return this.isIcon()\n ? (this.iconButton()?.nativeElement ?? null)\n : this.contentTrigger();\n }\n\n private contentTrigger(): HTMLElement {\n return (\n this.content().nativeElement.querySelector<HTMLElement>(FOCUSABLE) ??\n this.host.nativeElement\n );\n }\n\n private linkTrigger(\n trigger: HTMLElement | null,\n describes: boolean,\n open: boolean\n ): void {\n if (this.linkedTrigger && this.linkedTrigger !== trigger) {\n this.unlink(this.linkedTrigger);\n }\n this.linkedTrigger = trigger;\n if (!trigger) {\n return;\n }\n const isHost = trigger === this.host.nativeElement;\n if (describes) {\n setToken(trigger, 'aria-describedby', this.panelId, true);\n trigger.removeAttribute('aria-expanded');\n trigger.removeAttribute('aria-controls');\n } else {\n setToken(trigger, 'aria-describedby', this.panelId, false);\n trigger.setAttribute('aria-expanded', String(open));\n trigger.setAttribute('aria-controls', this.panelId);\n }\n toggleAttribute(trigger, 'role', 'button', isHost && !describes);\n toggleAttribute(trigger, 'tabindex', '0', isHost);\n }\n\n private unlink(trigger: HTMLElement): void {\n setToken(trigger, 'aria-describedby', this.panelId, false);\n trigger.removeAttribute('aria-expanded');\n trigger.removeAttribute('aria-controls');\n if (trigger === this.host.nativeElement) {\n trigger.removeAttribute('role');\n trigger.removeAttribute('tabindex');\n }\n }\n\n private inPanel(target: EventTarget | null): boolean {\n const node = this.asNode(target);\n return !!node && this.panel().nativeElement.contains(node);\n }\n\n private asNode(target: EventTarget | null): Node | null {\n return target instanceof Node ? target : null;\n }\n}\n\nfunction setToken(\n element: HTMLElement,\n name: string,\n token: string,\n present: boolean\n): void {\n const tokens = (element.getAttribute(name) ?? '')\n .split(/\\s+/)\n .filter(item => item && item !== token);\n const next = present ? [...tokens, token] : tokens;\n if (next.length) {\n element.setAttribute(name, next.join(' '));\n } else {\n element.removeAttribute(name);\n }\n}\n\nfunction toggleAttribute(\n element: HTMLElement,\n name: string,\n value: string,\n present: boolean\n): void {\n if (present) {\n element.setAttribute(name, value);\n } else {\n element.removeAttribute(name);\n }\n}\n\nfunction toMilliseconds(value: string | undefined): number | null {\n const match = value?.match(/^([\\d.]+)(ms|s)$/);\n if (!match) {\n return null;\n }\n const amount = Number(match[1]);\n return match[2] === 's' ? amount * 1000 : amount;\n}\n\nfunction requestFrame(document: Document, callback: () => void): void {\n const view = document.defaultView;\n if (view?.requestAnimationFrame) {\n view.requestAnimationFrame(callback);\n } else {\n callback();\n }\n}\n","<span #content class=\"su-tooltip-content\"><ng-content /></span>\n@if (isIcon()) {\n <button\n #iconButton\n type=\"button\"\n class=\"su-tooltip-icon\"\n [attr.aria-label]=\"label() ?? texts().more\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"panelId\">\n <ng-container [ngTemplateOutlet]=\"iconGlyph\" />\n </button>\n}\n<ng-template #iconGlyph>\n @if (iconTemplate(); as glyph) {\n <ng-container [ngTemplateOutlet]=\"glyph\" />\n } @else if (iconText()) {\n <span class=\"su-tooltip-icon-text\" aria-hidden=\"true\">{{ iconText() }}</span>\n } @else {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M9 9a3 3 0 1 1 4.5 2.6c-.9.5-1.5 1.2-1.5 2.2V15\" />\n <path d=\"M12 19h.01\" />\n </svg>\n }\n</ng-template>\n<div\n #panel\n popover=\"manual\"\n class=\"su-tooltip-panel\"\n [id]=\"panelId\"\n [attr.role]=\"describes() ? 'tooltip' : null\"\n [class.su-tooltip-panel-icon]=\"isIcon()\"\n [class.su-tooltip-interactive]=\"isInteractive()\">\n @if (isIcon()) {\n <button\n #closeButton\n type=\"button\"\n class=\"su-tooltip-close\"\n [class.su-tooltip-morphed]=\"morphed()\"\n [attr.aria-label]=\"texts().close\"\n (click)=\"onClose()\">\n <span class=\"su-tooltip-glyph su-tooltip-glyph-icon\">\n <ng-container [ngTemplateOutlet]=\"iconGlyph\" />\n </span>\n <span class=\"su-tooltip-glyph su-tooltip-glyph-close\">\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6L6 18\" />\n </svg>\n </span>\n </button>\n } @else if (arrow()) {\n <span class=\"su-tooltip-arrow\" aria-hidden=\"true\"></span>\n }\n <div class=\"su-tooltip-body\">\n @if (template(); as body) {\n <ng-container [ngTemplateOutlet]=\"body\" />\n } @else {\n {{ plainText() }}\n }\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAIA,IAAI,aAAa,GAAG,CAAC;AAErB,MAAM,SAAS,GACb,8GAA8G;AAEhH,MAAM,gBAAgB,GAAG,GAAG;AAE5B;;;;;AAKG;MAoBU,kBAAkB,CAAA;;AAEpB,IAAA,IAAI,GAAG,KAAK,CAAgC,EAAE,gDAAC;;AAE/C,IAAA,OAAO,GAAG,KAAK,CAAmB,SAAS,mDAAC;;AAE5C,IAAA,IAAI,GAAG,KAAK,CAAgC,EAAE,gDAAC;;AAE/C,IAAA,SAAS,GAAG,KAAK,CAAqB,KAAK,qDAAC;;IAE5C,MAAM,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,QAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAmB;AAC1C;;;AAGG;AACM,IAAA,WAAW,GAAG,KAAK,CAAC,KAAK,+CAAI,SAAS,EAAE,gBAAgB,EAAA,CAAA,GAAA,CAA7B,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAC;;AAE3D,IAAA,QAAQ,GAAG,KAAK,CAAC,IAAI,4CAAI,SAAS,EAAE,gBAAgB,EAAA,CAAA,GAAA,CAA7B,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAC;;IAEvD,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SA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AAM;AAClD;AAEA,SAAS,YAAY,CAAC,QAAkB,EAAE,QAAoB,EAAA;AAC5D,IAAA,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW;AACjC,IAAA,IAAI,IAAI,EAAE,qBAAqB,EAAE;AAC/B,QAAA,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC;IACtC;SAAO;AACL,QAAA,QAAQ,EAAE;IACZ;AACF;;AE5kBA;;AAEG;;;;"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { SuTooltipTrigger, SuTooltipPlacement, SuTooltipOpenOn, SuTooltipLabels } from '@su-labs/core/tooltip';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A tooltip over `SuTooltipController` from `@su-labs/core/tooltip`. Its content is the trigger, `text` is what the
|
|
7
|
+
* tooltip shows. It opens on hover and focus or on click (`openOn`), beside the trigger with an arrow, and grows out
|
|
8
|
+
* of it. With `trigger="icon"` a "?" button follows the content and the tooltip grows out of that icon, which turns
|
|
9
|
+
* into its close button.
|
|
10
|
+
*/
|
|
11
|
+
declare class SuTooltipComponent {
|
|
12
|
+
/** What the tooltip shows: a text, or an `<ng-template>` for links, formatting or any other markup */
|
|
13
|
+
readonly text: _angular_core.InputSignal<string | TemplateRef<unknown>>;
|
|
14
|
+
/** The trigger: the content between the tags, or a "?" icon after it that grows into the tooltip @default 'content' */
|
|
15
|
+
readonly trigger: _angular_core.InputSignal<SuTooltipTrigger>;
|
|
16
|
+
/** The icon instead of the "?": a short text such as `i` or `!`, or an `<ng-template>` with your own SVG */
|
|
17
|
+
readonly icon: _angular_core.InputSignal<string | TemplateRef<unknown>>;
|
|
18
|
+
/** The side the tooltip opens on, lined up with the trigger's start or end with `-start` and `-end` @default 'top' */
|
|
19
|
+
readonly placement: _angular_core.InputSignal<SuTooltipPlacement>;
|
|
20
|
+
/** What opens it: `hover` (and keyboard focus) or `click` @default 'hover', 'click' for the icon */
|
|
21
|
+
readonly openOn: _angular_core.InputSignal<SuTooltipOpenOn | undefined>;
|
|
22
|
+
/**
|
|
23
|
+
* The pointer can move onto the tooltip, e.g. to click a link in it; otherwise the pointer goes through it and
|
|
24
|
+
* it closes as soon as the pointer leaves the trigger. Always on with `click` @default false
|
|
25
|
+
*/
|
|
26
|
+
readonly interactive: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
27
|
+
/** Grows out of the trigger when it opens and back into it when it closes; off when the user prefers less motion @default true */
|
|
28
|
+
readonly animated: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
29
|
+
/** The tooltip's width, any CSS length; without it, it fits its text up to `--su-tooltip-max-width` (`16rem` for the icon) */
|
|
30
|
+
readonly width: _angular_core.InputSignal<string | undefined>;
|
|
31
|
+
/** The arrow pointing at the trigger, beside content triggers @default true */
|
|
32
|
+
readonly arrow: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
33
|
+
/** Pixels between the trigger and the tooltip @default 8 */
|
|
34
|
+
readonly offset: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
35
|
+
/** Milliseconds the pointer rests on the trigger before it opens @default 300 */
|
|
36
|
+
readonly showDelay: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
37
|
+
/** Milliseconds before it closes once the pointer leaves @default 100 */
|
|
38
|
+
readonly hideDelay: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
39
|
+
/** Doesn't open, and closes if open @default false */
|
|
40
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
41
|
+
/** The icon's name for screen readers @default labels.more */
|
|
42
|
+
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
43
|
+
/** Texts to replace, e.g. in the page's language */
|
|
44
|
+
readonly labels: _angular_core.InputSignal<Partial<SuTooltipLabels>>;
|
|
45
|
+
/** Whether the tooltip is open; setting it opens or closes it at once */
|
|
46
|
+
readonly open: _angular_core.ModelSignal<boolean>;
|
|
47
|
+
protected readonly panelId: string;
|
|
48
|
+
protected readonly isIcon: _angular_core.Signal<boolean>;
|
|
49
|
+
protected readonly opensOn: _angular_core.Signal<SuTooltipOpenOn>;
|
|
50
|
+
protected readonly isInteractive: _angular_core.Signal<boolean>;
|
|
51
|
+
/** A hover tooltip describes its trigger; the others are shown and hidden by a button */
|
|
52
|
+
protected readonly describes: _angular_core.Signal<boolean>;
|
|
53
|
+
protected readonly template: _angular_core.Signal<TemplateRef<unknown> | null>;
|
|
54
|
+
protected readonly plainText: _angular_core.Signal<string>;
|
|
55
|
+
protected readonly iconTemplate: _angular_core.Signal<TemplateRef<unknown> | null>;
|
|
56
|
+
protected readonly iconText: _angular_core.Signal<string>;
|
|
57
|
+
protected readonly texts: _angular_core.Signal<SuTooltipLabels>;
|
|
58
|
+
/** The close button shows the "×" once the icon has opened, so the "?" turns into it */
|
|
59
|
+
protected readonly morphed: _angular_core.WritableSignal<boolean>;
|
|
60
|
+
private readonly host;
|
|
61
|
+
private readonly document;
|
|
62
|
+
private readonly panel;
|
|
63
|
+
private readonly content;
|
|
64
|
+
private readonly iconButton;
|
|
65
|
+
private readonly closeButton;
|
|
66
|
+
private readonly controller;
|
|
67
|
+
private animation;
|
|
68
|
+
private iconClip;
|
|
69
|
+
private shown;
|
|
70
|
+
/** The close button takes focus once the icon tooltip opens, after the user opened it with the icon */
|
|
71
|
+
private focusOnOpen;
|
|
72
|
+
private leftWhileGrowing;
|
|
73
|
+
/** Focus coming back to the trigger after the tooltip closed doesn't open it again */
|
|
74
|
+
private returningFocus;
|
|
75
|
+
private linkedTrigger;
|
|
76
|
+
constructor();
|
|
77
|
+
/** Opens the tooltip now */
|
|
78
|
+
show(): void;
|
|
79
|
+
/** Closes the tooltip now */
|
|
80
|
+
hide(): void;
|
|
81
|
+
/** Opens or closes the tooltip now */
|
|
82
|
+
toggle(): void;
|
|
83
|
+
protected onPointerEnter(event: PointerEvent): void;
|
|
84
|
+
protected onPointerLeave(event: PointerEvent): void;
|
|
85
|
+
protected onFocusIn(event: FocusEvent): void;
|
|
86
|
+
protected onFocusOut(event: FocusEvent): void;
|
|
87
|
+
protected onClick(event: MouseEvent): void;
|
|
88
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
89
|
+
protected onClose(): void;
|
|
90
|
+
private onDocumentKeydown;
|
|
91
|
+
private onDocumentPointerDown;
|
|
92
|
+
private closeAndRefocus;
|
|
93
|
+
private reveal;
|
|
94
|
+
/** While it grows, only its visible part counts as under the pointer, so a pointer on the rest seems to leave it */
|
|
95
|
+
private isGrowing;
|
|
96
|
+
private hideIfLeftWhileGrowing;
|
|
97
|
+
private conceal;
|
|
98
|
+
private removePanel;
|
|
99
|
+
private growFromIcon;
|
|
100
|
+
private place;
|
|
101
|
+
private moves;
|
|
102
|
+
private duration;
|
|
103
|
+
private easing;
|
|
104
|
+
/** The element that takes focus for the tooltip: the icon, the content's first focusable element, or the host */
|
|
105
|
+
private triggerElement;
|
|
106
|
+
private contentTrigger;
|
|
107
|
+
private linkTrigger;
|
|
108
|
+
private unlink;
|
|
109
|
+
private inPanel;
|
|
110
|
+
private asNode;
|
|
111
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SuTooltipComponent, never>;
|
|
112
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SuTooltipComponent, "su-lib-tooltip", never, { "text": { "alias": "text"; "required": false; "isSignal": true; }; "trigger": { "alias": "trigger"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "placement": { "alias": "placement"; "required": false; "isSignal": true; }; "openOn": { "alias": "openOn"; "required": false; "isSignal": true; }; "interactive": { "alias": "interactive"; "required": false; "isSignal": true; }; "animated": { "alias": "animated"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "arrow": { "alias": "arrow"; "required": false; "isSignal": true; }; "offset": { "alias": "offset"; "required": false; "isSignal": true; }; "showDelay": { "alias": "showDelay"; "required": false; "isSignal": true; }; "hideDelay": { "alias": "hideDelay"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; }, { "open": "openChange"; }, never, ["*"], true, never>;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export { SuTooltipComponent };
|
package/package.json
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@su-labs/tooltip",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "20.0.0",
|
|
4
|
+
"description": "Accessible Angular tooltips: on your own content or a built-in \"?\" icon that grows into the tooltip and turns into its close button, opening on hover or click, 12 placements with an arrow, animated out of the trigger, themeable with CSS variables.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"angular",
|
|
7
|
+
"tooltip",
|
|
8
|
+
"toggletip",
|
|
9
|
+
"popover",
|
|
10
|
+
"hint",
|
|
11
|
+
"help",
|
|
12
|
+
"accessible",
|
|
13
|
+
"signals",
|
|
14
|
+
"themeable",
|
|
15
|
+
"css-variables"
|
|
16
|
+
],
|
|
17
|
+
"author": {
|
|
18
|
+
"name": "Yevheniy Alekseyev",
|
|
19
|
+
"email": "yev.alekseyev@gmail.com",
|
|
20
|
+
"url": "https://github.com/Greezaaa"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/Greezaaa/settings-utils-lib.git",
|
|
25
|
+
"directory": "projects/su-labs/tooltip"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://su-labs.dev/tooltip/",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/Greezaaa/settings-utils-lib/issues"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"@angular/common": "^20.0.0",
|
|
33
|
+
"@angular/core": "^20.0.0"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@su-labs/core": "1.12.0",
|
|
37
|
+
"tslib": "^2.3.0"
|
|
38
|
+
},
|
|
39
|
+
"sideEffects": false,
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"module": "fesm2022/su-labs-tooltip.mjs",
|
|
42
|
+
"typings": "index.d.ts",
|
|
43
|
+
"exports": {
|
|
44
|
+
"./package.json": {
|
|
45
|
+
"default": "./package.json"
|
|
46
|
+
},
|
|
47
|
+
".": {
|
|
48
|
+
"types": "./index.d.ts",
|
|
49
|
+
"default": "./fesm2022/su-labs-tooltip.mjs"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
6
52
|
}
|