@vaadin/tooltip 25.0.0-alpha14 → 25.0.0-alpha16
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-tooltip-mixin.d.ts +4 -3
- package/src/vaadin-tooltip-mixin.js +21 -26
- package/src/vaadin-tooltip.js +1 -1
- package/web-types.json +3 -3
- package/web-types.lit.json +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/tooltip",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha16",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,23 +34,23 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
37
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
38
|
-
"@vaadin/component-base": "25.0.0-
|
|
39
|
-
"@vaadin/overlay": "25.0.0-
|
|
40
|
-
"@vaadin/popover": "25.0.0-
|
|
41
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-
|
|
37
|
+
"@vaadin/a11y-base": "25.0.0-alpha16",
|
|
38
|
+
"@vaadin/component-base": "25.0.0-alpha16",
|
|
39
|
+
"@vaadin/overlay": "25.0.0-alpha16",
|
|
40
|
+
"@vaadin/popover": "25.0.0-alpha16",
|
|
41
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha16",
|
|
42
42
|
"lit": "^3.0.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
46
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
45
|
+
"@vaadin/chai-plugins": "25.0.0-alpha16",
|
|
46
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha16",
|
|
47
47
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
48
|
-
"@vaadin/vaadin-lumo-styles": "25.0.0-
|
|
48
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha16",
|
|
49
49
|
"sinon": "^18.0.0"
|
|
50
50
|
},
|
|
51
51
|
"web-types": [
|
|
52
52
|
"web-types.json",
|
|
53
53
|
"web-types.lit.json"
|
|
54
54
|
],
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "4b316158a4a4f702f032bc9940fc82f0faa840f4"
|
|
56
56
|
}
|
|
@@ -22,7 +22,7 @@ export declare class TooltipMixinClass {
|
|
|
22
22
|
* attribute. Supports array of multiple elements.
|
|
23
23
|
* When not set, defaults to `target`.
|
|
24
24
|
*/
|
|
25
|
-
ariaTarget: HTMLElement | HTMLElement[] | undefined;
|
|
25
|
+
ariaTarget: HTMLElement | HTMLElement[] | null | undefined;
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Object with properties passed to `generator` and
|
|
@@ -68,8 +68,9 @@ export declare class TooltipMixinClass {
|
|
|
68
68
|
manual: boolean;
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
|
-
* When true, the tooltip is opened
|
|
72
|
-
*
|
|
71
|
+
* When true, the tooltip is opened.
|
|
72
|
+
* In manual mode, this can be set programmatically.
|
|
73
|
+
* In automatic mode, this is set automatically by internal logic.
|
|
73
74
|
*/
|
|
74
75
|
opened: boolean;
|
|
75
76
|
|
|
@@ -44,11 +44,6 @@ class TooltipStateController {
|
|
|
44
44
|
this.host = host;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
/** @private */
|
|
48
|
-
get openedProp() {
|
|
49
|
-
return this.host.manual ? 'opened' : '_autoOpened';
|
|
50
|
-
}
|
|
51
|
-
|
|
52
47
|
/** @private */
|
|
53
48
|
get focusDelay() {
|
|
54
49
|
const tooltip = this.host;
|
|
@@ -114,12 +109,12 @@ class TooltipStateController {
|
|
|
114
109
|
|
|
115
110
|
/** @private */
|
|
116
111
|
_isOpened() {
|
|
117
|
-
return this.host
|
|
112
|
+
return this.host.opened;
|
|
118
113
|
}
|
|
119
114
|
|
|
120
115
|
/** @private */
|
|
121
116
|
_setOpened(opened) {
|
|
122
|
-
this.host
|
|
117
|
+
this.host.opened = opened;
|
|
123
118
|
}
|
|
124
119
|
|
|
125
120
|
/** @private */
|
|
@@ -300,12 +295,15 @@ export const TooltipMixin = (superClass) =>
|
|
|
300
295
|
},
|
|
301
296
|
|
|
302
297
|
/**
|
|
303
|
-
* When true, the tooltip is opened
|
|
304
|
-
*
|
|
298
|
+
* When true, the tooltip is opened.
|
|
299
|
+
* In manual mode, this can be set programmatically.
|
|
300
|
+
* In automatic mode, this is set automatically by internal logic.
|
|
305
301
|
*/
|
|
306
302
|
opened: {
|
|
307
303
|
type: Boolean,
|
|
308
304
|
value: false,
|
|
305
|
+
reflectToAttribute: true,
|
|
306
|
+
observer: '__openedChanged',
|
|
309
307
|
sync: true,
|
|
310
308
|
},
|
|
311
309
|
|
|
@@ -330,17 +328,6 @@ export const TooltipMixin = (superClass) =>
|
|
|
330
328
|
type: String,
|
|
331
329
|
},
|
|
332
330
|
|
|
333
|
-
/**
|
|
334
|
-
* Set to true when the overlay is opened using auto-added
|
|
335
|
-
* event listeners: mouseenter and focusin (keyboard only).
|
|
336
|
-
* @protected
|
|
337
|
-
*/
|
|
338
|
-
_autoOpened: {
|
|
339
|
-
type: Boolean,
|
|
340
|
-
observer: '__autoOpenedChanged',
|
|
341
|
-
sync: true,
|
|
342
|
-
},
|
|
343
|
-
|
|
344
331
|
/**
|
|
345
332
|
* Element used to link with the `aria-describedby`
|
|
346
333
|
* attribute. When not set, defaults to `target`.
|
|
@@ -432,7 +419,7 @@ export const TooltipMixin = (superClass) =>
|
|
|
432
419
|
disconnectedCallback() {
|
|
433
420
|
super.disconnectedCallback();
|
|
434
421
|
|
|
435
|
-
if (this.
|
|
422
|
+
if (this.opened && !this.manual) {
|
|
436
423
|
this._stateController.close(true);
|
|
437
424
|
}
|
|
438
425
|
this._isConnected = false;
|
|
@@ -467,7 +454,7 @@ export const TooltipMixin = (superClass) =>
|
|
|
467
454
|
}
|
|
468
455
|
|
|
469
456
|
/** @private */
|
|
470
|
-
|
|
457
|
+
__openedChanged(opened, oldOpened) {
|
|
471
458
|
if (opened) {
|
|
472
459
|
document.addEventListener('keydown', this.__onKeyDown, true);
|
|
473
460
|
} else if (oldOpened) {
|
|
@@ -530,7 +517,7 @@ export const TooltipMixin = (superClass) =>
|
|
|
530
517
|
|
|
531
518
|
this.__focusInside = true;
|
|
532
519
|
|
|
533
|
-
if (!this.__isTargetHidden && (!this.__hoverInside || !this.
|
|
520
|
+
if (!this.__isTargetHidden && (!this.__hoverInside || !this.opened)) {
|
|
534
521
|
this._stateController.open({ focus: true });
|
|
535
522
|
}
|
|
536
523
|
}
|
|
@@ -555,6 +542,10 @@ export const TooltipMixin = (superClass) =>
|
|
|
555
542
|
|
|
556
543
|
/** @private */
|
|
557
544
|
__onKeyDown(event) {
|
|
545
|
+
if (this.manual) {
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
|
|
558
549
|
if (event.key === 'Escape') {
|
|
559
550
|
event.stopPropagation();
|
|
560
551
|
this._stateController.close(true);
|
|
@@ -587,7 +578,7 @@ export const TooltipMixin = (superClass) =>
|
|
|
587
578
|
|
|
588
579
|
this.__hoverInside = true;
|
|
589
580
|
|
|
590
|
-
if (!this.__isTargetHidden && (!this.__focusInside || !this.
|
|
581
|
+
if (!this.__isTargetHidden && (!this.__focusInside || !this.opened)) {
|
|
591
582
|
this._stateController.open({ hover: true });
|
|
592
583
|
}
|
|
593
584
|
}
|
|
@@ -647,6 +638,10 @@ export const TooltipMixin = (superClass) =>
|
|
|
647
638
|
|
|
648
639
|
/** @private */
|
|
649
640
|
__onTargetVisibilityChange(isVisible) {
|
|
641
|
+
if (this.manual) {
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
|
|
650
645
|
const oldHidden = this.__isTargetHidden;
|
|
651
646
|
this.__isTargetHidden = !isVisible;
|
|
652
647
|
|
|
@@ -657,7 +652,7 @@ export const TooltipMixin = (superClass) =>
|
|
|
657
652
|
}
|
|
658
653
|
|
|
659
654
|
// Close the overlay when the target is no longer fully visible.
|
|
660
|
-
if (!isVisible && this.
|
|
655
|
+
if (!isVisible && this.opened) {
|
|
661
656
|
this._stateController.close(true);
|
|
662
657
|
}
|
|
663
658
|
}
|
|
@@ -680,7 +675,7 @@ export const TooltipMixin = (superClass) =>
|
|
|
680
675
|
__computeAriaTarget(ariaTarget, target) {
|
|
681
676
|
const isElementNode = (el) => el && el.nodeType === Node.ELEMENT_NODE;
|
|
682
677
|
const isAriaTargetSet = Array.isArray(ariaTarget) ? ariaTarget.some(isElementNode) : ariaTarget;
|
|
683
|
-
return isAriaTargetSet ? ariaTarget : target;
|
|
678
|
+
return ariaTarget === null || isAriaTargetSet ? ariaTarget : target;
|
|
684
679
|
}
|
|
685
680
|
|
|
686
681
|
/** @private */
|
package/src/vaadin-tooltip.js
CHANGED
|
@@ -76,7 +76,7 @@ class Tooltip extends TooltipMixin(ThemePropertyMixin(ElementMixin(PolylitMixin(
|
|
|
76
76
|
id="overlay"
|
|
77
77
|
.owner="${this}"
|
|
78
78
|
theme="${ifDefined(this._theme)}"
|
|
79
|
-
.opened="${this._isConnected &&
|
|
79
|
+
.opened="${this._isConnected && this.opened}"
|
|
80
80
|
.positionTarget="${this.target}"
|
|
81
81
|
.position="${effectivePosition}"
|
|
82
82
|
?no-horizontal-overlap="${this.__computeNoHorizontalOverlap(effectivePosition)}"
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/tooltip",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha16",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
"name": "opened",
|
|
81
|
-
"description": "When true, the tooltip is opened programmatically.\
|
|
81
|
+
"description": "When true, the tooltip is opened.\nIn manual mode, this can be set programmatically.\nIn automatic mode, this is set automatically by internal logic.",
|
|
82
82
|
"value": {
|
|
83
83
|
"type": [
|
|
84
84
|
"boolean",
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
},
|
|
225
225
|
{
|
|
226
226
|
"name": "opened",
|
|
227
|
-
"description": "When true, the tooltip is opened programmatically.\
|
|
227
|
+
"description": "When true, the tooltip is opened.\nIn manual mode, this can be set programmatically.\nIn automatic mode, this is set automatically by internal logic.",
|
|
228
228
|
"value": {
|
|
229
229
|
"type": [
|
|
230
230
|
"boolean",
|
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": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha16",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"name": "?opened",
|
|
31
|
-
"description": "When true, the tooltip is opened programmatically.\
|
|
31
|
+
"description": "When true, the tooltip is opened.\nIn manual mode, this can be set programmatically.\nIn automatic mode, this is set automatically by internal logic.",
|
|
32
32
|
"value": {
|
|
33
33
|
"kind": "expression"
|
|
34
34
|
}
|