@vaadin/tooltip 24.6.0-beta1 → 24.7.0-alpha1
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 +10 -10
- package/src/vaadin-lit-tooltip.js +1 -7
- package/src/vaadin-tooltip-mixin.js +2 -0
- package/src/vaadin-tooltip-overlay-styles.js +4 -4
- package/src/vaadin-tooltip-overlay.js +0 -11
- package/src/vaadin-tooltip.js +13 -0
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/tooltip",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.7.0-alpha1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,17 +36,17 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
38
|
"@polymer/polymer": "^3.0.0",
|
|
39
|
-
"@vaadin/a11y-base": "24.
|
|
40
|
-
"@vaadin/component-base": "24.
|
|
41
|
-
"@vaadin/overlay": "24.
|
|
42
|
-
"@vaadin/popover": "24.
|
|
43
|
-
"@vaadin/vaadin-lumo-styles": "24.
|
|
44
|
-
"@vaadin/vaadin-material-styles": "24.
|
|
45
|
-
"@vaadin/vaadin-themable-mixin": "24.
|
|
39
|
+
"@vaadin/a11y-base": "24.7.0-alpha1",
|
|
40
|
+
"@vaadin/component-base": "24.7.0-alpha1",
|
|
41
|
+
"@vaadin/overlay": "24.7.0-alpha1",
|
|
42
|
+
"@vaadin/popover": "24.7.0-alpha1",
|
|
43
|
+
"@vaadin/vaadin-lumo-styles": "24.7.0-alpha1",
|
|
44
|
+
"@vaadin/vaadin-material-styles": "24.7.0-alpha1",
|
|
45
|
+
"@vaadin/vaadin-themable-mixin": "24.7.0-alpha1",
|
|
46
46
|
"lit": "^3.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@vaadin/chai-plugins": "24.
|
|
49
|
+
"@vaadin/chai-plugins": "24.7.0-alpha1",
|
|
50
50
|
"@vaadin/testing-helpers": "^1.0.0",
|
|
51
51
|
"sinon": "^18.0.0"
|
|
52
52
|
},
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"web-types.json",
|
|
55
55
|
"web-types.lit.json"
|
|
56
56
|
],
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "04be941c9a7b659871c97f31b9cc3ffd7528087b"
|
|
58
58
|
}
|
|
@@ -45,6 +45,7 @@ class Tooltip extends TooltipMixin(ThemePropertyMixin(ElementMixin(PolylitMixin(
|
|
|
45
45
|
|
|
46
46
|
return html`
|
|
47
47
|
<vaadin-tooltip-overlay
|
|
48
|
+
id="overlay"
|
|
48
49
|
.renderer="${this._renderer}"
|
|
49
50
|
.owner="${this}"
|
|
50
51
|
theme="${ifDefined(this._theme)}"
|
|
@@ -63,13 +64,6 @@ class Tooltip extends TooltipMixin(ThemePropertyMixin(ElementMixin(PolylitMixin(
|
|
|
63
64
|
<slot name="sr-label"></slot>
|
|
64
65
|
`;
|
|
65
66
|
}
|
|
66
|
-
|
|
67
|
-
/** @protected */
|
|
68
|
-
ready() {
|
|
69
|
-
super.ready();
|
|
70
|
-
|
|
71
|
-
this._overlayElement = this.shadowRoot.querySelector('vaadin-tooltip-overlay');
|
|
72
|
-
}
|
|
73
67
|
}
|
|
74
68
|
|
|
75
69
|
defineCustomElement(Tooltip);
|
|
@@ -465,6 +465,8 @@ export const TooltipMixin = (superClass) =>
|
|
|
465
465
|
ready() {
|
|
466
466
|
super.ready();
|
|
467
467
|
|
|
468
|
+
this._overlayElement = this.$.overlay;
|
|
469
|
+
|
|
468
470
|
this._srLabelController = new SlotController(this, 'sr-label', 'div', {
|
|
469
471
|
initializer: (element) => {
|
|
470
472
|
element.id = this._uniqueId;
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
7
7
|
|
|
8
8
|
export const tooltipOverlayStyles = css`
|
|
9
|
-
:host {
|
|
10
|
-
z-index: 1100;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
9
|
[part='overlay'] {
|
|
14
10
|
max-width: 40ch;
|
|
15
11
|
}
|
|
16
12
|
|
|
13
|
+
[part='content'] {
|
|
14
|
+
white-space: pre-wrap;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
17
|
:host([position^='top'][top-aligned]) [part='overlay'],
|
|
18
18
|
:host([position^='bottom'][top-aligned]) [part='overlay'] {
|
|
19
19
|
margin-top: var(--vaadin-tooltip-offset-top, 0);
|
|
@@ -48,17 +48,6 @@ class TooltipOverlay extends PopoverOverlayMixin(DirMixin(ThemableMixin(PolymerE
|
|
|
48
48
|
return 'vaadin-tooltip';
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
/** @protected */
|
|
52
|
-
ready() {
|
|
53
|
-
super.ready();
|
|
54
|
-
|
|
55
|
-
// When setting `manual` and `opened` attributes, the overlay is already moved to body
|
|
56
|
-
// by the time when `ready()` callback of the `vaadin-tooltip` is executed by Polymer,
|
|
57
|
-
// so querySelector() would return null. So we use this workaround to set properties.
|
|
58
|
-
this.owner = this.__dataHost;
|
|
59
|
-
this.owner._overlayElement = this;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
51
|
requestContentUpdate() {
|
|
63
52
|
super.requestContentUpdate();
|
|
64
53
|
|
package/src/vaadin-tooltip.js
CHANGED
|
@@ -69,6 +69,8 @@ class Tooltip extends TooltipMixin(ThemePropertyMixin(ElementMixin(ControllerMix
|
|
|
69
69
|
}
|
|
70
70
|
</style>
|
|
71
71
|
<vaadin-tooltip-overlay
|
|
72
|
+
id="overlay"
|
|
73
|
+
owner="[[__overlayOwner]]"
|
|
72
74
|
renderer="[[_renderer]]"
|
|
73
75
|
theme$="[[_theme]]"
|
|
74
76
|
opened="[[__computeOpened(manual, opened, _autoOpened, _isConnected)]]"
|
|
@@ -86,6 +88,17 @@ class Tooltip extends TooltipMixin(ThemePropertyMixin(ElementMixin(ControllerMix
|
|
|
86
88
|
<slot name="sr-label"></slot>
|
|
87
89
|
`;
|
|
88
90
|
}
|
|
91
|
+
|
|
92
|
+
static get properties() {
|
|
93
|
+
return {
|
|
94
|
+
/** @private */
|
|
95
|
+
__overlayOwner: {
|
|
96
|
+
value() {
|
|
97
|
+
return this;
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
89
102
|
}
|
|
90
103
|
|
|
91
104
|
defineCustomElement(Tooltip);
|
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.
|
|
4
|
+
"version": "24.7.0-alpha1",
|
|
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.
|
|
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.7.0-alpha1/#/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",
|
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.
|
|
4
|
+
"version": "24.7.0-alpha1",
|
|
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.
|
|
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.7.0-alpha1/#/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
|
{
|