@vaadin/tooltip 24.2.0-beta3 → 24.2.0-beta4
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/package.json +8 -12
- package/src/vaadin-tooltip-overlay.js +111 -5
- package/src/vaadin-tooltip.d.ts +125 -3
- package/src/vaadin-tooltip.js +796 -3
- package/web-types.json +13 -13
- package/web-types.lit.json +9 -9
- package/src/vaadin-tooltip-mixin.d.ts +0 -140
- package/src/vaadin-tooltip-mixin.js +0 -812
- package/src/vaadin-tooltip-overlay-mixin.js +0 -86
- package/src/vaadin-tooltip-overlay-styles.d.ts +0 -8
- package/src/vaadin-tooltip-overlay-styles.js +0 -42
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/tooltip",
|
|
4
|
-
"version": "24.2.0-
|
|
4
|
+
"version": "24.2.0-beta4",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-tooltip",
|
|
11
|
-
"description": "`<vaadin-tooltip>` is a Web Component for creating tooltips.\n\n```html\n<button id=\"confirm\">Confirm</button>\n<vaadin-tooltip text=\"Click to save changes\" for=\"confirm\"></vaadin-tooltip>\n```\n\n### Styling\n\n`<vaadin-tooltip>` uses `<vaadin-tooltip-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-
|
|
11
|
+
"description": "`<vaadin-tooltip>` is a Web Component for creating tooltips.\n\n```html\n<button id=\"confirm\">Confirm</button>\n<vaadin-tooltip text=\"Click to save changes\" for=\"confirm\"></vaadin-tooltip>\n```\n\n### Styling\n\n`<vaadin-tooltip>` uses `<vaadin-tooltip-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-beta4/#/elements/vaadin-overlay) documentation\nfor `<vaadin-tooltip-overlay>` parts.\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|----------------------------------------\n`position` | Reflects the `position` property value.\n\nNote: the `theme` attribute value set on `<vaadin-tooltip>` is\npropagated to the internal `<vaadin-tooltip-overlay>` component.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-tooltip>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-tooltip-offset-top` | Used as an offset when the tooltip is aligned vertically below the target\n`--vaadin-tooltip-offset-bottom` | Used as an offset when the tooltip is aligned vertically above the target\n`--vaadin-tooltip-offset-start` | Used as an offset when the tooltip is aligned horizontally after the target\n`--vaadin-tooltip-offset-end` | Used as an offset when the tooltip is aligned horizontally before the target\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "overlay-class",
|
|
@@ -178,17 +178,6 @@
|
|
|
178
178
|
]
|
|
179
179
|
}
|
|
180
180
|
},
|
|
181
|
-
{
|
|
182
|
-
"name": "generator",
|
|
183
|
-
"description": "Function used to generate the tooltip content.\nWhen provided, it overrides the `text` property.\nUse the `context` property to provide argument\nthat can be passed to the generator function.",
|
|
184
|
-
"value": {
|
|
185
|
-
"type": [
|
|
186
|
-
"Object",
|
|
187
|
-
"null",
|
|
188
|
-
"undefined"
|
|
189
|
-
]
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
181
|
{
|
|
193
182
|
"name": "hideDelay",
|
|
194
183
|
"description": "The delay in milliseconds before the tooltip\nis closed on losing hover, when not in manual mode.\nOn blur, the tooltip is closed immediately.",
|
|
@@ -276,6 +265,17 @@
|
|
|
276
265
|
"undefined"
|
|
277
266
|
]
|
|
278
267
|
}
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"name": "generator",
|
|
271
|
+
"description": "Function used to generate the tooltip content.\nWhen provided, it overrides the `text` property.\nUse the `context` property to provide argument\nthat can be passed to the generator function.",
|
|
272
|
+
"value": {
|
|
273
|
+
"type": [
|
|
274
|
+
"Object",
|
|
275
|
+
"null",
|
|
276
|
+
"undefined"
|
|
277
|
+
]
|
|
278
|
+
}
|
|
279
279
|
}
|
|
280
280
|
],
|
|
281
281
|
"events": []
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/tooltip",
|
|
4
|
-
"version": "24.2.0-
|
|
4
|
+
"version": "24.2.0-beta4",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
18
|
"name": "vaadin-tooltip",
|
|
19
|
-
"description": "`<vaadin-tooltip>` is a Web Component for creating tooltips.\n\n```html\n<button id=\"confirm\">Confirm</button>\n<vaadin-tooltip text=\"Click to save changes\" for=\"confirm\"></vaadin-tooltip>\n```\n\n### Styling\n\n`<vaadin-tooltip>` uses `<vaadin-tooltip-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-
|
|
19
|
+
"description": "`<vaadin-tooltip>` is a Web Component for creating tooltips.\n\n```html\n<button id=\"confirm\">Confirm</button>\n<vaadin-tooltip text=\"Click to save changes\" for=\"confirm\"></vaadin-tooltip>\n```\n\n### Styling\n\n`<vaadin-tooltip>` uses `<vaadin-tooltip-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-beta4/#/elements/vaadin-overlay) documentation\nfor `<vaadin-tooltip-overlay>` parts.\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|----------------------------------------\n`position` | Reflects the `position` property value.\n\nNote: the `theme` attribute value set on `<vaadin-tooltip>` is\npropagated to the internal `<vaadin-tooltip-overlay>` component.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-tooltip>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-tooltip-offset-top` | Used as an offset when the tooltip is aligned vertically below the target\n`--vaadin-tooltip-offset-bottom` | Used as an offset when the tooltip is aligned vertically above the target\n`--vaadin-tooltip-offset-start` | Used as an offset when the tooltip is aligned horizontally after the target\n`--vaadin-tooltip-offset-end` | Used as an offset when the tooltip is aligned horizontally before the target\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
@@ -68,13 +68,6 @@
|
|
|
68
68
|
"kind": "expression"
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
{
|
|
72
|
-
"name": ".generator",
|
|
73
|
-
"description": "Function used to generate the tooltip content.\nWhen provided, it overrides the `text` property.\nUse the `context` property to provide argument\nthat can be passed to the generator function.",
|
|
74
|
-
"value": {
|
|
75
|
-
"kind": "expression"
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
71
|
{
|
|
79
72
|
"name": ".hideDelay",
|
|
80
73
|
"description": "The delay in milliseconds before the tooltip\nis closed on losing hover, when not in manual mode.\nOn blur, the tooltip is closed immediately.",
|
|
@@ -116,6 +109,13 @@
|
|
|
116
109
|
"value": {
|
|
117
110
|
"kind": "expression"
|
|
118
111
|
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": ".generator",
|
|
115
|
+
"description": "Function used to generate the tooltip content.\nWhen provided, it overrides the `text` property.\nUse the `context` property to provide argument\nthat can be passed to the generator function.",
|
|
116
|
+
"value": {
|
|
117
|
+
"kind": "expression"
|
|
118
|
+
}
|
|
119
119
|
}
|
|
120
120
|
]
|
|
121
121
|
}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2022 - 2023 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
|
-
import type { OverlayClassMixinClass } from '@vaadin/component-base/src/overlay-class-mixin.js';
|
|
8
|
-
|
|
9
|
-
export type TooltipPosition =
|
|
10
|
-
| 'bottom-end'
|
|
11
|
-
| 'bottom-start'
|
|
12
|
-
| 'bottom'
|
|
13
|
-
| 'end-bottom'
|
|
14
|
-
| 'end-top'
|
|
15
|
-
| 'end'
|
|
16
|
-
| 'start-bottom'
|
|
17
|
-
| 'start-top'
|
|
18
|
-
| 'start'
|
|
19
|
-
| 'top-end'
|
|
20
|
-
| 'top-start'
|
|
21
|
-
| 'top';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* A mixin providing common tooltip functionality.
|
|
25
|
-
*/
|
|
26
|
-
export declare function TooltipMixin<T extends Constructor<HTMLElement>>(
|
|
27
|
-
base: T,
|
|
28
|
-
): Constructor<OverlayClassMixinClass> & Constructor<TooltipMixinClass> & T;
|
|
29
|
-
|
|
30
|
-
export declare class TooltipMixinClass {
|
|
31
|
-
/**
|
|
32
|
-
* Sets the default focus delay to be used by all tooltip instances,
|
|
33
|
-
* except for those that have focus delay configured using property.
|
|
34
|
-
*/
|
|
35
|
-
static setDefaultFocusDelay(focusDelay: number): void;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Sets the default hide delay to be used by all tooltip instances,
|
|
39
|
-
* except for those that have hide delay configured using property.
|
|
40
|
-
*/
|
|
41
|
-
static setDefaultHideDelay(hideDelay: number): void;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Sets the default hover delay to be used by all tooltip instances,
|
|
45
|
-
* except for those that have hover delay configured using property.
|
|
46
|
-
*/
|
|
47
|
-
static setDefaultHoverDelay(delay: number): void;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Element used to link with the `aria-describedby`
|
|
51
|
-
* attribute. Supports array of multiple elements.
|
|
52
|
-
* When not set, defaults to `target`.
|
|
53
|
-
*/
|
|
54
|
-
ariaTarget: HTMLElement | HTMLElement[] | undefined;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Object with properties passed to `generator` and
|
|
58
|
-
* `shouldShow` functions for generating tooltip text
|
|
59
|
-
* or detecting whether to show the tooltip or not.
|
|
60
|
-
*/
|
|
61
|
-
context: Record<string, unknown>;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* The delay in milliseconds before the tooltip
|
|
65
|
-
* is opened on keyboard focus, when not in manual mode.
|
|
66
|
-
* @attr {number} focus-delay
|
|
67
|
-
*/
|
|
68
|
-
focusDelay: number;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* The id of the element used as a tooltip trigger.
|
|
72
|
-
* The element should be in the DOM by the time when
|
|
73
|
-
* the attribute is set, otherwise a warning is shown.
|
|
74
|
-
*/
|
|
75
|
-
for: string | undefined;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Function used to generate the tooltip content.
|
|
79
|
-
* When provided, it overrides the `text` property.
|
|
80
|
-
* Use the `context` property to provide argument
|
|
81
|
-
* that can be passed to the generator function.
|
|
82
|
-
*/
|
|
83
|
-
generator: (context: Record<string, unknown>) => string;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* The delay in milliseconds before the tooltip
|
|
87
|
-
* is closed on losing hover, when not in manual mode.
|
|
88
|
-
* On blur, the tooltip is closed immediately.
|
|
89
|
-
* @attr {number} hide-delay
|
|
90
|
-
*/
|
|
91
|
-
hideDelay: number;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* The delay in milliseconds before the tooltip
|
|
95
|
-
* is opened on hover, when not in manual mode.
|
|
96
|
-
* @attr {number} hover-delay
|
|
97
|
-
*/
|
|
98
|
-
hoverDelay: number;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* When true, the tooltip is controlled programmatically
|
|
102
|
-
* instead of reacting to focus and mouse events.
|
|
103
|
-
*/
|
|
104
|
-
manual: boolean;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* When true, the tooltip is opened programmatically.
|
|
108
|
-
* Only works if `manual` is set to `true`.
|
|
109
|
-
*/
|
|
110
|
-
opened: boolean;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Position of the tooltip with respect to its target.
|
|
114
|
-
* Supported values: `top-start`, `top`, `top-end`,
|
|
115
|
-
* `bottom-start`, `bottom`, `bottom-end`, `start-top`,
|
|
116
|
-
* `start`, `start-bottom`, `end-top`, `end`, `end-bottom`.
|
|
117
|
-
*/
|
|
118
|
-
position: TooltipPosition;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Function used to detect whether to show the tooltip based on a condition,
|
|
122
|
-
* called every time the tooltip is about to be shown on hover and focus.
|
|
123
|
-
* The function takes two parameters: `target` and `context`, which contain
|
|
124
|
-
* values of the corresponding tooltip properties at the time of calling.
|
|
125
|
-
* The tooltip is only shown when the function invocation returns `true`.
|
|
126
|
-
*/
|
|
127
|
-
shouldShow: (target: HTMLElement, context?: Record<string, unknown>) => boolean;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Reference to the element used as a tooltip trigger.
|
|
131
|
-
* The target must be placed in the same shadow scope.
|
|
132
|
-
* Defaults to an element referenced with `for`.
|
|
133
|
-
*/
|
|
134
|
-
target: HTMLElement | undefined;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* String used as a tooltip content.
|
|
138
|
-
*/
|
|
139
|
-
text: string | null | undefined;
|
|
140
|
-
}
|