@vaadin/tooltip 25.2.0-alpha9 → 25.2.0-beta2
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/custom-elements.json +46 -2
- package/package.json +13 -13
- package/src/vaadin-tooltip-mixin.d.ts +16 -2
- package/src/vaadin-tooltip-mixin.js +49 -22
- package/src/vaadin-tooltip-overlay.js +4 -3
- package/src/vaadin-tooltip.js +0 -3
- package/web-types.json +43 -71
- package/web-types.lit.json +25 -18
package/custom-elements.json
CHANGED
|
@@ -26,6 +26,16 @@
|
|
|
26
26
|
"description": "A mixin providing common tooltip functionality.",
|
|
27
27
|
"name": "TooltipMixin",
|
|
28
28
|
"members": [
|
|
29
|
+
{
|
|
30
|
+
"kind": "field",
|
|
31
|
+
"name": "ariaLinkMode",
|
|
32
|
+
"privacy": "public",
|
|
33
|
+
"type": {
|
|
34
|
+
"text": "string"
|
|
35
|
+
},
|
|
36
|
+
"description": "Controls which ARIA attribute is used to link the target element(s)\nwith the tooltip content. Supported values:\n\n- `aria-describedby` - links the tooltip as a description.\n- `aria-labelledby` - links the tooltip as an accessible name.\n- `none` - does not add any ARIA linking attribute.\n\nDefaults to `aria-describedby`.",
|
|
37
|
+
"attribute": "aria-link-mode"
|
|
38
|
+
},
|
|
29
39
|
{
|
|
30
40
|
"kind": "field",
|
|
31
41
|
"name": "ariaTarget",
|
|
@@ -33,7 +43,7 @@
|
|
|
33
43
|
"type": {
|
|
34
44
|
"text": "object"
|
|
35
45
|
},
|
|
36
|
-
"description": "Element used to link with the `
|
|
46
|
+
"description": "Element used to link with the ARIA attribute controlled by the\n`ariaLinkMode` property. Supports array of multiple elements.\nWhen not set, defaults to `target`.",
|
|
37
47
|
"attribute": "aria-target"
|
|
38
48
|
},
|
|
39
49
|
{
|
|
@@ -230,6 +240,14 @@
|
|
|
230
240
|
}
|
|
231
241
|
],
|
|
232
242
|
"attributes": [
|
|
243
|
+
{
|
|
244
|
+
"name": "aria-link-mode",
|
|
245
|
+
"type": {
|
|
246
|
+
"text": "string"
|
|
247
|
+
},
|
|
248
|
+
"description": "Controls which ARIA attribute is used to link the target element(s)\nwith the tooltip content. Supported values:\n\n- `aria-describedby` - links the tooltip as a description.\n- `aria-labelledby` - links the tooltip as an accessible name.\n- `none` - does not add any ARIA linking attribute.\n\nDefaults to `aria-describedby`.",
|
|
249
|
+
"fieldName": "ariaLinkMode"
|
|
250
|
+
},
|
|
233
251
|
{
|
|
234
252
|
"name": "focus-delay",
|
|
235
253
|
"type": {
|
|
@@ -348,6 +366,20 @@
|
|
|
348
366
|
"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### Markdown Support\n\nThe tooltip supports rendering Markdown content by setting the `markdown` property:\n\n```html\n<button id=\"info\">Info</button>\n<vaadin-tooltip\n text=\"**Important:** Click to view *detailed* information\"\n markdown\n for=\"info\">\n</vaadin-tooltip>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n----------- | ---------------\n`overlay` | The overlay element\n`content` | The overlay content element\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|----------------------------------------\n`markdown` | Reflects the `markdown` property value.\n`position` | Reflects the `position` property value.\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:----------------------------------|\n| `--vaadin-tooltip-background` |\n| `--vaadin-tooltip-border-color` |\n| `--vaadin-tooltip-border-radius` |\n| `--vaadin-tooltip-border-width` |\n| `--vaadin-tooltip-font-size` |\n| `--vaadin-tooltip-font-weight` |\n| `--vaadin-tooltip-line-height` |\n| `--vaadin-tooltip-max-width` |\n| `--vaadin-tooltip-offset-bottom` |\n| `--vaadin-tooltip-offset-end` |\n| `--vaadin-tooltip-offset-start` |\n| `--vaadin-tooltip-offset-top` |\n| `--vaadin-tooltip-padding` |\n| `--vaadin-tooltip-shadow` |\n| `--vaadin-tooltip-text-color` |\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
349
367
|
"name": "Tooltip",
|
|
350
368
|
"members": [
|
|
369
|
+
{
|
|
370
|
+
"kind": "field",
|
|
371
|
+
"name": "ariaLinkMode",
|
|
372
|
+
"privacy": "public",
|
|
373
|
+
"type": {
|
|
374
|
+
"text": "string"
|
|
375
|
+
},
|
|
376
|
+
"description": "Controls which ARIA attribute is used to link the target element(s)\nwith the tooltip content. Supported values:\n\n- `aria-describedby` - links the tooltip as a description.\n- `aria-labelledby` - links the tooltip as an accessible name.\n- `none` - does not add any ARIA linking attribute.\n\nDefaults to `aria-describedby`.",
|
|
377
|
+
"attribute": "aria-link-mode",
|
|
378
|
+
"inheritedFrom": {
|
|
379
|
+
"name": "TooltipMixin",
|
|
380
|
+
"module": "src/vaadin-tooltip-mixin.js"
|
|
381
|
+
}
|
|
382
|
+
},
|
|
351
383
|
{
|
|
352
384
|
"kind": "field",
|
|
353
385
|
"name": "ariaTarget",
|
|
@@ -355,7 +387,7 @@
|
|
|
355
387
|
"type": {
|
|
356
388
|
"text": "object"
|
|
357
389
|
},
|
|
358
|
-
"description": "Element used to link with the `
|
|
390
|
+
"description": "Element used to link with the ARIA attribute controlled by the\n`ariaLinkMode` property. Supports array of multiple elements.\nWhen not set, defaults to `target`.",
|
|
359
391
|
"attribute": "aria-target",
|
|
360
392
|
"inheritedFrom": {
|
|
361
393
|
"name": "TooltipMixin",
|
|
@@ -637,6 +669,18 @@
|
|
|
637
669
|
"tagName": "vaadin-tooltip",
|
|
638
670
|
"customElement": true,
|
|
639
671
|
"attributes": [
|
|
672
|
+
{
|
|
673
|
+
"name": "aria-link-mode",
|
|
674
|
+
"type": {
|
|
675
|
+
"text": "string"
|
|
676
|
+
},
|
|
677
|
+
"description": "Controls which ARIA attribute is used to link the target element(s)\nwith the tooltip content. Supported values:\n\n- `aria-describedby` - links the tooltip as a description.\n- `aria-labelledby` - links the tooltip as an accessible name.\n- `none` - does not add any ARIA linking attribute.\n\nDefaults to `aria-describedby`.",
|
|
678
|
+
"fieldName": "ariaLinkMode",
|
|
679
|
+
"inheritedFrom": {
|
|
680
|
+
"name": "TooltipMixin",
|
|
681
|
+
"module": "src/vaadin-tooltip-mixin.js"
|
|
682
|
+
}
|
|
683
|
+
},
|
|
640
684
|
{
|
|
641
685
|
"name": "focus-delay",
|
|
642
686
|
"type": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/tooltip",
|
|
3
|
-
"version": "25.2.0-
|
|
3
|
+
"version": "25.2.0-beta2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,26 +35,26 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/a11y-base": "25.2.0-
|
|
39
|
-
"@vaadin/component-base": "25.2.0-
|
|
40
|
-
"@vaadin/markdown": "25.2.0-
|
|
41
|
-
"@vaadin/overlay": "25.2.0-
|
|
42
|
-
"@vaadin/popover": "25.2.0-
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "25.2.0-
|
|
38
|
+
"@vaadin/a11y-base": "25.2.0-beta2",
|
|
39
|
+
"@vaadin/component-base": "25.2.0-beta2",
|
|
40
|
+
"@vaadin/markdown": "25.2.0-beta2",
|
|
41
|
+
"@vaadin/overlay": "25.2.0-beta2",
|
|
42
|
+
"@vaadin/popover": "25.2.0-beta2",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "25.2.0-beta2",
|
|
44
44
|
"lit": "^3.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@vaadin/aura": "25.2.0-
|
|
48
|
-
"@vaadin/chai-plugins": "25.2.0-
|
|
49
|
-
"@vaadin/test-runner-commands": "25.2.0-
|
|
47
|
+
"@vaadin/aura": "25.2.0-beta2",
|
|
48
|
+
"@vaadin/chai-plugins": "25.2.0-beta2",
|
|
49
|
+
"@vaadin/test-runner-commands": "25.2.0-beta2",
|
|
50
50
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
51
|
-
"@vaadin/vaadin-lumo-styles": "25.2.0-
|
|
52
|
-
"sinon": "^
|
|
51
|
+
"@vaadin/vaadin-lumo-styles": "25.2.0-beta2",
|
|
52
|
+
"sinon": "^22.0.0"
|
|
53
53
|
},
|
|
54
54
|
"customElements": "custom-elements.json",
|
|
55
55
|
"web-types": [
|
|
56
56
|
"web-types.json",
|
|
57
57
|
"web-types.lit.json"
|
|
58
58
|
],
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "9e18feb8057baf278b72fec4e42657b19e48f499"
|
|
60
60
|
}
|
|
@@ -18,12 +18,26 @@ export declare function TooltipMixin<T extends Constructor<HTMLElement>>(
|
|
|
18
18
|
|
|
19
19
|
export declare class TooltipMixinClass {
|
|
20
20
|
/**
|
|
21
|
-
* Element used to link with the
|
|
22
|
-
*
|
|
21
|
+
* Element used to link with the ARIA attribute controlled by the
|
|
22
|
+
* `ariaLinkMode` property. Supports array of multiple elements.
|
|
23
23
|
* When not set, defaults to `target`.
|
|
24
24
|
*/
|
|
25
25
|
ariaTarget: HTMLElement | HTMLElement[] | null | undefined;
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Controls which ARIA attribute is used to link the target element(s)
|
|
29
|
+
* with the tooltip content. Supported values:
|
|
30
|
+
*
|
|
31
|
+
* - `aria-describedby` - links the tooltip as a description.
|
|
32
|
+
* - `aria-labelledby` - links the tooltip as an accessible name.
|
|
33
|
+
* - `none` - does not add any ARIA linking attribute.
|
|
34
|
+
*
|
|
35
|
+
* Defaults to `aria-describedby`.
|
|
36
|
+
*
|
|
37
|
+
* @attr {string} aria-link-mode
|
|
38
|
+
*/
|
|
39
|
+
ariaLinkMode: 'aria-describedby' | 'aria-labelledby' | 'none';
|
|
40
|
+
|
|
27
41
|
/**
|
|
28
42
|
* Object with properties passed to `generator` and
|
|
29
43
|
* `shouldShow` functions for generating tooltip text
|
|
@@ -216,24 +216,37 @@ class TooltipStateController {
|
|
|
216
216
|
|
|
217
217
|
/**
|
|
218
218
|
* A mixin providing common tooltip functionality.
|
|
219
|
-
*
|
|
220
|
-
* @polymerMixin
|
|
221
|
-
* @mixes PopoverPositionMixin
|
|
222
|
-
* @mixes PopoverTargetMixin
|
|
223
219
|
*/
|
|
224
220
|
export const TooltipMixin = (superClass) =>
|
|
225
221
|
class TooltipMixinClass extends PopoverPositionMixin(PopoverTargetMixin(superClass)) {
|
|
226
222
|
static get properties() {
|
|
227
223
|
return {
|
|
228
224
|
/**
|
|
229
|
-
* Element used to link with the
|
|
230
|
-
*
|
|
225
|
+
* Element used to link with the ARIA attribute controlled by the
|
|
226
|
+
* `ariaLinkMode` property. Supports array of multiple elements.
|
|
231
227
|
* When not set, defaults to `target`.
|
|
232
228
|
*/
|
|
233
229
|
ariaTarget: {
|
|
234
230
|
type: Object,
|
|
235
231
|
},
|
|
236
232
|
|
|
233
|
+
/**
|
|
234
|
+
* Controls which ARIA attribute is used to link the target element(s)
|
|
235
|
+
* with the tooltip content. Supported values:
|
|
236
|
+
*
|
|
237
|
+
* - `aria-describedby` - links the tooltip as a description.
|
|
238
|
+
* - `aria-labelledby` - links the tooltip as an accessible name.
|
|
239
|
+
* - `none` - does not add any ARIA linking attribute.
|
|
240
|
+
*
|
|
241
|
+
* Defaults to `aria-describedby`.
|
|
242
|
+
*
|
|
243
|
+
* @attr {string} aria-link-mode
|
|
244
|
+
*/
|
|
245
|
+
ariaLinkMode: {
|
|
246
|
+
type: String,
|
|
247
|
+
value: 'aria-describedby',
|
|
248
|
+
},
|
|
249
|
+
|
|
237
250
|
/**
|
|
238
251
|
* Object with properties passed to `generator` and
|
|
239
252
|
* `shouldShow` functions for generating tooltip text
|
|
@@ -241,6 +254,7 @@ export const TooltipMixin = (superClass) =>
|
|
|
241
254
|
*/
|
|
242
255
|
context: {
|
|
243
256
|
type: Object,
|
|
257
|
+
sync: true,
|
|
244
258
|
value: () => {
|
|
245
259
|
return {};
|
|
246
260
|
},
|
|
@@ -349,7 +363,6 @@ export const TooltipMixin = (superClass) =>
|
|
|
349
363
|
_effectiveAriaTarget: {
|
|
350
364
|
type: Object,
|
|
351
365
|
computed: '__computeAriaTarget(ariaTarget, target)',
|
|
352
|
-
observer: '__effectiveAriaTargetChanged',
|
|
353
366
|
},
|
|
354
367
|
|
|
355
368
|
/** @private */
|
|
@@ -463,6 +476,16 @@ export const TooltipMixin = (superClass) =>
|
|
|
463
476
|
if (props.has('text') || props.has('generator') || props.has('context') || props.has('markdown')) {
|
|
464
477
|
this.__updateContent();
|
|
465
478
|
}
|
|
479
|
+
|
|
480
|
+
const ariaTargetChanged = props.has('_effectiveAriaTarget');
|
|
481
|
+
const ariaLinkChanged = props.has('ariaLinkMode');
|
|
482
|
+
|
|
483
|
+
if (ariaTargetChanged || ariaLinkChanged) {
|
|
484
|
+
const oldTarget = ariaTargetChanged ? props.get('_effectiveAriaTarget') : this._effectiveAriaTarget;
|
|
485
|
+
const oldMode = ariaLinkChanged ? props.get('ariaLinkMode') : this.ariaLinkMode;
|
|
486
|
+
|
|
487
|
+
this.__updateAriaAttributes(oldTarget, oldMode);
|
|
488
|
+
}
|
|
466
489
|
}
|
|
467
490
|
|
|
468
491
|
/** @private */
|
|
@@ -706,6 +729,8 @@ export const TooltipMixin = (superClass) =>
|
|
|
706
729
|
async __updateContent() {
|
|
707
730
|
const content = typeof this.generator === 'function' ? this.generator(this.context) : this.text;
|
|
708
731
|
|
|
732
|
+
const oldTextContent = this.__contentNode.textContent;
|
|
733
|
+
|
|
709
734
|
if (this.markdown && content) {
|
|
710
735
|
const helpers = await this.constructor.__importMarkdownHelpers();
|
|
711
736
|
helpers.renderMarkdownToElement(this.__contentNode, content);
|
|
@@ -714,27 +739,35 @@ export const TooltipMixin = (superClass) =>
|
|
|
714
739
|
}
|
|
715
740
|
|
|
716
741
|
this.$.overlay.toggleAttribute('hidden', this.__contentNode.textContent.trim() === '');
|
|
717
|
-
|
|
742
|
+
|
|
743
|
+
const newTextContent = this.__contentNode.textContent;
|
|
744
|
+
if (newTextContent !== oldTextContent) {
|
|
745
|
+
this.dispatchEvent(new CustomEvent('content-changed', { detail: { content: newTextContent } }));
|
|
746
|
+
}
|
|
718
747
|
}
|
|
719
748
|
|
|
720
749
|
/** @private */
|
|
721
750
|
__computeAriaTarget(ariaTarget, target) {
|
|
722
|
-
const isElementNode = (el) => el
|
|
751
|
+
const isElementNode = (el) => el?.nodeType === Node.ELEMENT_NODE;
|
|
723
752
|
const isAriaTargetSet = Array.isArray(ariaTarget) ? ariaTarget.some(isElementNode) : ariaTarget;
|
|
724
753
|
return ariaTarget === null || isAriaTargetSet ? ariaTarget : target;
|
|
725
754
|
}
|
|
726
755
|
|
|
727
756
|
/** @private */
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
757
|
+
__updateAriaAttributes(oldTarget, oldMode) {
|
|
758
|
+
// Remove the previously applied attribute from the previous target(s).
|
|
759
|
+
if (oldTarget && oldMode && oldMode !== 'none') {
|
|
760
|
+
[oldTarget].flat().forEach((target) => {
|
|
761
|
+
removeValueFromAttribute(target, oldMode, this._uniqueId);
|
|
732
762
|
});
|
|
733
763
|
}
|
|
734
764
|
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
765
|
+
// Apply the current attribute to the current target(s).
|
|
766
|
+
const target = this._effectiveAriaTarget;
|
|
767
|
+
const mode = this.ariaLinkMode;
|
|
768
|
+
if (target && mode && mode !== 'none') {
|
|
769
|
+
[target].flat().forEach((el) => {
|
|
770
|
+
addValueToAttribute(el, mode, this._uniqueId);
|
|
738
771
|
});
|
|
739
772
|
}
|
|
740
773
|
}
|
|
@@ -746,10 +779,4 @@ export const TooltipMixin = (superClass) =>
|
|
|
746
779
|
}
|
|
747
780
|
return this.__markdownHelpers;
|
|
748
781
|
}
|
|
749
|
-
|
|
750
|
-
/**
|
|
751
|
-
* Fired when the tooltip text content is changed.
|
|
752
|
-
*
|
|
753
|
-
* @event content-changed
|
|
754
|
-
*/
|
|
755
782
|
};
|
|
@@ -18,9 +18,6 @@ import { tooltipOverlayStyles } from './styles/vaadin-tooltip-overlay-base-style
|
|
|
18
18
|
*
|
|
19
19
|
* @customElement vaadin-tooltip-overlay
|
|
20
20
|
* @extends HTMLElement
|
|
21
|
-
* @mixes DirMixin
|
|
22
|
-
* @mixes ThemableMixin
|
|
23
|
-
* @mixes PopoverOverlayMixin
|
|
24
21
|
* @private
|
|
25
22
|
*/
|
|
26
23
|
class TooltipOverlay extends PopoverOverlayMixin(
|
|
@@ -34,6 +31,10 @@ class TooltipOverlay extends PopoverOverlayMixin(
|
|
|
34
31
|
return [overlayStyles, tooltipOverlayStyles];
|
|
35
32
|
}
|
|
36
33
|
|
|
34
|
+
static get lumoInjector() {
|
|
35
|
+
return { ...super.lumoInjector, includeBaseStyles: true };
|
|
36
|
+
}
|
|
37
|
+
|
|
37
38
|
/** @protected */
|
|
38
39
|
render() {
|
|
39
40
|
return html`
|
package/src/vaadin-tooltip.js
CHANGED
|
@@ -75,9 +75,6 @@ import { TooltipMixin } from './vaadin-tooltip-mixin.js';
|
|
|
75
75
|
*
|
|
76
76
|
* @customElement vaadin-tooltip
|
|
77
77
|
* @extends HTMLElement
|
|
78
|
-
* @mixes ElementMixin
|
|
79
|
-
* @mixes ThemePropertyMixin
|
|
80
|
-
* @mixes TooltipMixin
|
|
81
78
|
*/
|
|
82
79
|
class Tooltip extends TooltipMixin(ThemePropertyMixin(ElementMixin(PolylitMixin(LitElement)))) {
|
|
83
80
|
static get is() {
|
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.2.0-
|
|
4
|
+
"version": "25.2.0-beta2",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -10,14 +10,21 @@
|
|
|
10
10
|
"name": "vaadin-tooltip",
|
|
11
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### Markdown Support\n\nThe tooltip supports rendering Markdown content by setting the `markdown` property:\n\n```html\n<button id=\"info\">Info</button>\n<vaadin-tooltip\n text=\"**Important:** Click to view *detailed* information\"\n markdown\n for=\"info\">\n</vaadin-tooltip>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n----------- | ---------------\n`overlay` | The overlay element\n`content` | The overlay content element\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|----------------------------------------\n`markdown` | Reflects the `markdown` property value.\n`position` | Reflects the `position` property value.\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:----------------------------------|\n| `--vaadin-tooltip-background` |\n| `--vaadin-tooltip-border-color` |\n| `--vaadin-tooltip-border-radius` |\n| `--vaadin-tooltip-border-width` |\n| `--vaadin-tooltip-font-size` |\n| `--vaadin-tooltip-font-weight` |\n| `--vaadin-tooltip-line-height` |\n| `--vaadin-tooltip-max-width` |\n| `--vaadin-tooltip-offset-bottom` |\n| `--vaadin-tooltip-offset-end` |\n| `--vaadin-tooltip-offset-start` |\n| `--vaadin-tooltip-offset-top` |\n| `--vaadin-tooltip-padding` |\n| `--vaadin-tooltip-shadow` |\n| `--vaadin-tooltip-text-color` |\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
|
+
{
|
|
14
|
+
"name": "aria-link-mode",
|
|
15
|
+
"description": "Controls which ARIA attribute is used to link the target element(s)\nwith the tooltip content. Supported values:\n\n- `aria-describedby` - links the tooltip as a description.\n- `aria-labelledby` - links the tooltip as an accessible name.\n- `none` - does not add any ARIA linking attribute.\n\nDefaults to `aria-describedby`.",
|
|
16
|
+
"value": {
|
|
17
|
+
"type": [
|
|
18
|
+
"string"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
13
22
|
{
|
|
14
23
|
"name": "focus-delay",
|
|
15
24
|
"description": "The delay in milliseconds before the tooltip\nis opened on keyboard focus, when not in manual mode.",
|
|
16
25
|
"value": {
|
|
17
26
|
"type": [
|
|
18
|
-
"number"
|
|
19
|
-
"null",
|
|
20
|
-
"undefined"
|
|
27
|
+
"number"
|
|
21
28
|
]
|
|
22
29
|
}
|
|
23
30
|
},
|
|
@@ -26,9 +33,7 @@
|
|
|
26
33
|
"description": "The id of the element to be used as `target` value.\nThe element should be in the DOM by the time when\nthe attribute is set, otherwise a warning is shown.",
|
|
27
34
|
"value": {
|
|
28
35
|
"type": [
|
|
29
|
-
"string"
|
|
30
|
-
"null",
|
|
31
|
-
"undefined"
|
|
36
|
+
"string"
|
|
32
37
|
]
|
|
33
38
|
}
|
|
34
39
|
},
|
|
@@ -37,9 +42,7 @@
|
|
|
37
42
|
"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.",
|
|
38
43
|
"value": {
|
|
39
44
|
"type": [
|
|
40
|
-
"number"
|
|
41
|
-
"null",
|
|
42
|
-
"undefined"
|
|
45
|
+
"number"
|
|
43
46
|
]
|
|
44
47
|
}
|
|
45
48
|
},
|
|
@@ -48,9 +51,7 @@
|
|
|
48
51
|
"description": "The delay in milliseconds before the tooltip\nis opened on hover, when not in manual mode.",
|
|
49
52
|
"value": {
|
|
50
53
|
"type": [
|
|
51
|
-
"number"
|
|
52
|
-
"null",
|
|
53
|
-
"undefined"
|
|
54
|
+
"number"
|
|
54
55
|
]
|
|
55
56
|
}
|
|
56
57
|
},
|
|
@@ -59,9 +60,7 @@
|
|
|
59
60
|
"description": "When true, the tooltip is controlled programmatically\ninstead of reacting to focus and mouse events.",
|
|
60
61
|
"value": {
|
|
61
62
|
"type": [
|
|
62
|
-
"boolean"
|
|
63
|
-
"null",
|
|
64
|
-
"undefined"
|
|
63
|
+
"boolean"
|
|
65
64
|
]
|
|
66
65
|
}
|
|
67
66
|
},
|
|
@@ -70,9 +69,7 @@
|
|
|
70
69
|
"description": "When enabled, the tooltip text is rendered as Markdown.\n\n**Note:** Using Markdown is discouraged if accessibility of the tooltip\ncontent is essential, as semantics of the rendered HTML content\n(headers, lists, ...) will not be conveyed to assistive technologies.",
|
|
71
70
|
"value": {
|
|
72
71
|
"type": [
|
|
73
|
-
"boolean"
|
|
74
|
-
"null",
|
|
75
|
-
"undefined"
|
|
72
|
+
"boolean"
|
|
76
73
|
]
|
|
77
74
|
}
|
|
78
75
|
},
|
|
@@ -81,9 +78,7 @@
|
|
|
81
78
|
"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
79
|
"value": {
|
|
83
80
|
"type": [
|
|
84
|
-
"boolean"
|
|
85
|
-
"null",
|
|
86
|
-
"undefined"
|
|
81
|
+
"boolean"
|
|
87
82
|
]
|
|
88
83
|
}
|
|
89
84
|
},
|
|
@@ -92,9 +87,7 @@
|
|
|
92
87
|
"description": "Position of the overlay with respect to the target.\nSupported values: `top-start`, `top`, `top-end`,\n`bottom-start`, `bottom`, `bottom-end`, `start-top`,\n`start`, `start-bottom`, `end-top`, `end`, `end-bottom`.",
|
|
93
88
|
"value": {
|
|
94
89
|
"type": [
|
|
95
|
-
"string"
|
|
96
|
-
"null",
|
|
97
|
-
"undefined"
|
|
90
|
+
"string"
|
|
98
91
|
]
|
|
99
92
|
}
|
|
100
93
|
},
|
|
@@ -103,9 +96,7 @@
|
|
|
103
96
|
"description": "String used as a tooltip content.",
|
|
104
97
|
"value": {
|
|
105
98
|
"type": [
|
|
106
|
-
"string"
|
|
107
|
-
"null",
|
|
108
|
-
"undefined"
|
|
99
|
+
"string"
|
|
109
100
|
]
|
|
110
101
|
}
|
|
111
102
|
},
|
|
@@ -123,14 +114,21 @@
|
|
|
123
114
|
],
|
|
124
115
|
"js": {
|
|
125
116
|
"properties": [
|
|
117
|
+
{
|
|
118
|
+
"name": "ariaLinkMode",
|
|
119
|
+
"description": "Controls which ARIA attribute is used to link the target element(s)\nwith the tooltip content. Supported values:\n\n- `aria-describedby` - links the tooltip as a description.\n- `aria-labelledby` - links the tooltip as an accessible name.\n- `none` - does not add any ARIA linking attribute.\n\nDefaults to `aria-describedby`.",
|
|
120
|
+
"value": {
|
|
121
|
+
"type": [
|
|
122
|
+
"string"
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
126
|
{
|
|
127
127
|
"name": "ariaTarget",
|
|
128
|
-
"description": "Element used to link with the `
|
|
128
|
+
"description": "Element used to link with the ARIA attribute controlled by the\n`ariaLinkMode` property. Supports array of multiple elements.\nWhen not set, defaults to `target`.",
|
|
129
129
|
"value": {
|
|
130
130
|
"type": [
|
|
131
|
-
"
|
|
132
|
-
"null",
|
|
133
|
-
"undefined"
|
|
131
|
+
"object"
|
|
134
132
|
]
|
|
135
133
|
}
|
|
136
134
|
},
|
|
@@ -139,9 +137,7 @@
|
|
|
139
137
|
"description": "Object with properties passed to `generator` and\n`shouldShow` functions for generating tooltip text\nor detecting whether to show the tooltip or not.",
|
|
140
138
|
"value": {
|
|
141
139
|
"type": [
|
|
142
|
-
"
|
|
143
|
-
"null",
|
|
144
|
-
"undefined"
|
|
140
|
+
"object"
|
|
145
141
|
]
|
|
146
142
|
}
|
|
147
143
|
},
|
|
@@ -150,9 +146,7 @@
|
|
|
150
146
|
"description": "The delay in milliseconds before the tooltip\nis opened on keyboard focus, when not in manual mode.",
|
|
151
147
|
"value": {
|
|
152
148
|
"type": [
|
|
153
|
-
"number"
|
|
154
|
-
"null",
|
|
155
|
-
"undefined"
|
|
149
|
+
"number"
|
|
156
150
|
]
|
|
157
151
|
}
|
|
158
152
|
},
|
|
@@ -161,9 +155,7 @@
|
|
|
161
155
|
"description": "The id of the element to be used as `target` value.\nThe element should be in the DOM by the time when\nthe attribute is set, otherwise a warning is shown.",
|
|
162
156
|
"value": {
|
|
163
157
|
"type": [
|
|
164
|
-
"string"
|
|
165
|
-
"null",
|
|
166
|
-
"undefined"
|
|
158
|
+
"string"
|
|
167
159
|
]
|
|
168
160
|
}
|
|
169
161
|
},
|
|
@@ -172,9 +164,7 @@
|
|
|
172
164
|
"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.",
|
|
173
165
|
"value": {
|
|
174
166
|
"type": [
|
|
175
|
-
"
|
|
176
|
-
"null",
|
|
177
|
-
"undefined"
|
|
167
|
+
"object"
|
|
178
168
|
]
|
|
179
169
|
}
|
|
180
170
|
},
|
|
@@ -183,9 +173,7 @@
|
|
|
183
173
|
"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.",
|
|
184
174
|
"value": {
|
|
185
175
|
"type": [
|
|
186
|
-
"number"
|
|
187
|
-
"null",
|
|
188
|
-
"undefined"
|
|
176
|
+
"number"
|
|
189
177
|
]
|
|
190
178
|
}
|
|
191
179
|
},
|
|
@@ -194,9 +182,7 @@
|
|
|
194
182
|
"description": "The delay in milliseconds before the tooltip\nis opened on hover, when not in manual mode.",
|
|
195
183
|
"value": {
|
|
196
184
|
"type": [
|
|
197
|
-
"number"
|
|
198
|
-
"null",
|
|
199
|
-
"undefined"
|
|
185
|
+
"number"
|
|
200
186
|
]
|
|
201
187
|
}
|
|
202
188
|
},
|
|
@@ -205,9 +191,7 @@
|
|
|
205
191
|
"description": "When true, the tooltip is controlled programmatically\ninstead of reacting to focus and mouse events.",
|
|
206
192
|
"value": {
|
|
207
193
|
"type": [
|
|
208
|
-
"boolean"
|
|
209
|
-
"null",
|
|
210
|
-
"undefined"
|
|
194
|
+
"boolean"
|
|
211
195
|
]
|
|
212
196
|
}
|
|
213
197
|
},
|
|
@@ -216,9 +200,7 @@
|
|
|
216
200
|
"description": "When enabled, the tooltip text is rendered as Markdown.\n\n**Note:** Using Markdown is discouraged if accessibility of the tooltip\ncontent is essential, as semantics of the rendered HTML content\n(headers, lists, ...) will not be conveyed to assistive technologies.",
|
|
217
201
|
"value": {
|
|
218
202
|
"type": [
|
|
219
|
-
"boolean"
|
|
220
|
-
"null",
|
|
221
|
-
"undefined"
|
|
203
|
+
"boolean"
|
|
222
204
|
]
|
|
223
205
|
}
|
|
224
206
|
},
|
|
@@ -227,9 +209,7 @@
|
|
|
227
209
|
"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
210
|
"value": {
|
|
229
211
|
"type": [
|
|
230
|
-
"boolean"
|
|
231
|
-
"null",
|
|
232
|
-
"undefined"
|
|
212
|
+
"boolean"
|
|
233
213
|
]
|
|
234
214
|
}
|
|
235
215
|
},
|
|
@@ -238,9 +218,7 @@
|
|
|
238
218
|
"description": "Position of the overlay with respect to the target.\nSupported values: `top-start`, `top`, `top-end`,\n`bottom-start`, `bottom`, `bottom-end`, `start-top`,\n`start`, `start-bottom`, `end-top`, `end`, `end-bottom`.",
|
|
239
219
|
"value": {
|
|
240
220
|
"type": [
|
|
241
|
-
"string"
|
|
242
|
-
"null",
|
|
243
|
-
"undefined"
|
|
221
|
+
"string"
|
|
244
222
|
]
|
|
245
223
|
}
|
|
246
224
|
},
|
|
@@ -249,9 +227,7 @@
|
|
|
249
227
|
"description": "Function used to detect whether to show the tooltip based on a condition,\ncalled every time the tooltip is about to be shown on hover and focus.\nThe function takes two parameters: `target` and `context`, which contain\nvalues of the corresponding tooltip properties at the time of calling.\nThe tooltip is only shown when the function invocation returns `true`.",
|
|
250
228
|
"value": {
|
|
251
229
|
"type": [
|
|
252
|
-
"
|
|
253
|
-
"null",
|
|
254
|
-
"undefined"
|
|
230
|
+
"object"
|
|
255
231
|
]
|
|
256
232
|
}
|
|
257
233
|
},
|
|
@@ -260,9 +236,7 @@
|
|
|
260
236
|
"description": "Reference to the DOM element used both to trigger the overlay\nby user interaction and to visually position it on the screen.\n\nDefaults to an element referenced with `for` attribute, in\nwhich case it must be located in the same shadow scope.",
|
|
261
237
|
"value": {
|
|
262
238
|
"type": [
|
|
263
|
-
"
|
|
264
|
-
"null",
|
|
265
|
-
"undefined"
|
|
239
|
+
"object"
|
|
266
240
|
]
|
|
267
241
|
}
|
|
268
242
|
},
|
|
@@ -271,9 +245,7 @@
|
|
|
271
245
|
"description": "String used as a tooltip content.",
|
|
272
246
|
"value": {
|
|
273
247
|
"type": [
|
|
274
|
-
"string"
|
|
275
|
-
"null",
|
|
276
|
-
"undefined"
|
|
248
|
+
"string"
|
|
277
249
|
]
|
|
278
250
|
}
|
|
279
251
|
}
|
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.2.0-
|
|
4
|
+
"version": "25.2.0-beta2",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -20,29 +20,15 @@
|
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
23
|
-
"name": "
|
|
24
|
-
"description": "
|
|
25
|
-
"value": {
|
|
26
|
-
"kind": "expression"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"name": "?markdown",
|
|
31
|
-
"description": "When enabled, the tooltip text is rendered as Markdown.\n\n**Note:** Using Markdown is discouraged if accessibility of the tooltip\ncontent is essential, as semantics of the rendered HTML content\n(headers, lists, ...) will not be conveyed to assistive technologies.",
|
|
32
|
-
"value": {
|
|
33
|
-
"kind": "expression"
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"name": "?opened",
|
|
38
|
-
"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.",
|
|
23
|
+
"name": ".ariaLinkMode",
|
|
24
|
+
"description": "Controls which ARIA attribute is used to link the target element(s)\nwith the tooltip content. Supported values:\n\n- `aria-describedby` - links the tooltip as a description.\n- `aria-labelledby` - links the tooltip as an accessible name.\n- `none` - does not add any ARIA linking attribute.\n\nDefaults to `aria-describedby`.",
|
|
39
25
|
"value": {
|
|
40
26
|
"kind": "expression"
|
|
41
27
|
}
|
|
42
28
|
},
|
|
43
29
|
{
|
|
44
30
|
"name": ".ariaTarget",
|
|
45
|
-
"description": "Element used to link with the `
|
|
31
|
+
"description": "Element used to link with the ARIA attribute controlled by the\n`ariaLinkMode` property. Supports array of multiple elements.\nWhen not set, defaults to `target`.",
|
|
46
32
|
"value": {
|
|
47
33
|
"kind": "expression"
|
|
48
34
|
}
|
|
@@ -89,6 +75,27 @@
|
|
|
89
75
|
"kind": "expression"
|
|
90
76
|
}
|
|
91
77
|
},
|
|
78
|
+
{
|
|
79
|
+
"name": "?manual",
|
|
80
|
+
"description": "When true, the tooltip is controlled programmatically\ninstead of reacting to focus and mouse events.",
|
|
81
|
+
"value": {
|
|
82
|
+
"kind": "expression"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "?markdown",
|
|
87
|
+
"description": "When enabled, the tooltip text is rendered as Markdown.\n\n**Note:** Using Markdown is discouraged if accessibility of the tooltip\ncontent is essential, as semantics of the rendered HTML content\n(headers, lists, ...) will not be conveyed to assistive technologies.",
|
|
88
|
+
"value": {
|
|
89
|
+
"kind": "expression"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "?opened",
|
|
94
|
+
"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.",
|
|
95
|
+
"value": {
|
|
96
|
+
"kind": "expression"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
92
99
|
{
|
|
93
100
|
"name": ".position",
|
|
94
101
|
"description": "Position of the overlay with respect to the target.\nSupported values: `top-start`, `top`, `top-end`,\n`bottom-start`, `bottom`, `bottom-end`, `start-top`,\n`start`, `start-bottom`, `end-top`, `end`, `end-bottom`.",
|