@vaadin/tooltip 24.2.0-alpha14 → 24.2.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/tooltip",
3
- "version": "24.2.0-alpha14",
3
+ "version": "24.2.0-alpha16",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,12 +35,12 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@polymer/polymer": "^3.0.0",
38
- "@vaadin/a11y-base": "24.2.0-alpha14",
39
- "@vaadin/component-base": "24.2.0-alpha14",
40
- "@vaadin/overlay": "24.2.0-alpha14",
41
- "@vaadin/vaadin-lumo-styles": "24.2.0-alpha14",
42
- "@vaadin/vaadin-material-styles": "24.2.0-alpha14",
43
- "@vaadin/vaadin-themable-mixin": "24.2.0-alpha14"
38
+ "@vaadin/a11y-base": "24.2.0-alpha16",
39
+ "@vaadin/component-base": "24.2.0-alpha16",
40
+ "@vaadin/overlay": "24.2.0-alpha16",
41
+ "@vaadin/vaadin-lumo-styles": "24.2.0-alpha16",
42
+ "@vaadin/vaadin-material-styles": "24.2.0-alpha16",
43
+ "@vaadin/vaadin-themable-mixin": "24.2.0-alpha16"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@esm-bundle/chai": "^4.3.4",
@@ -51,5 +51,5 @@
51
51
  "web-types.json",
52
52
  "web-types.lit.json"
53
53
  ],
54
- "gitHead": "203a2fda8d879db6ee8bccd7cf5b915de3e5008b"
54
+ "gitHead": "133d3aeb00dedc8be975affa81c7af4b4d22acf6"
55
55
  }
@@ -80,9 +80,10 @@ declare class Tooltip extends OverlayClassMixin(ThemePropertyMixin(ElementMixin(
80
80
 
81
81
  /**
82
82
  * Element used to link with the `aria-describedby`
83
- * attribute. When not set, defaults to `target`.
83
+ * attribute. Supports array of multiple elements.
84
+ * When not set, defaults to `target`.
84
85
  */
85
- ariaTarget: HTMLElement | undefined;
86
+ ariaTarget: HTMLElement | HTMLElement[] | undefined;
86
87
 
87
88
  /**
88
89
  * Object with properties passed to `generator` and
@@ -292,7 +292,8 @@ class Tooltip extends OverlayClassMixin(ThemePropertyMixin(ElementMixin(PolymerE
292
292
  return {
293
293
  /**
294
294
  * Element used to link with the `aria-describedby`
295
- * attribute. When not set, defaults to `target`.
295
+ * attribute. Supports array of multiple elements.
296
+ * When not set, defaults to `target`.
296
297
  */
297
298
  ariaTarget: {
298
299
  type: Object,
@@ -548,7 +549,9 @@ class Tooltip extends OverlayClassMixin(ThemePropertyMixin(ElementMixin(PolymerE
548
549
 
549
550
  /** @private */
550
551
  __computeAriaTarget(ariaTarget, target) {
551
- return ariaTarget || target;
552
+ const isElementNode = (el) => el && el.nodeType === Node.ELEMENT_NODE;
553
+ const isAriaTargetSet = Array.isArray(ariaTarget) ? ariaTarget.some(isElementNode) : ariaTarget;
554
+ return isAriaTargetSet ? ariaTarget : target;
552
555
  }
553
556
 
554
557
  /** @private */
@@ -589,11 +592,15 @@ class Tooltip extends OverlayClassMixin(ThemePropertyMixin(ElementMixin(PolymerE
589
592
  /** @private */
590
593
  __effectiveAriaTargetChanged(ariaTarget, oldAriaTarget) {
591
594
  if (oldAriaTarget) {
592
- removeValueFromAttribute(oldAriaTarget, 'aria-describedby', this._uniqueId);
595
+ [oldAriaTarget].flat().forEach((target) => {
596
+ removeValueFromAttribute(target, 'aria-describedby', this._uniqueId);
597
+ });
593
598
  }
594
599
 
595
600
  if (ariaTarget) {
596
- addValueToAttribute(ariaTarget, 'aria-describedby', this._uniqueId);
601
+ [ariaTarget].flat().forEach((target) => {
602
+ addValueToAttribute(target, 'aria-describedby', this._uniqueId);
603
+ });
597
604
  }
598
605
  }
599
606
 
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-alpha14",
4
+ "version": "24.2.0-alpha16",
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-alpha14/#/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.",
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-alpha16/#/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",
@@ -136,7 +136,7 @@
136
136
  },
137
137
  {
138
138
  "name": "ariaTarget",
139
- "description": "Element used to link with the `aria-describedby`\nattribute. When not set, defaults to `target`.",
139
+ "description": "Element used to link with the `aria-describedby`\nattribute. Supports array of multiple elements.\nWhen not set, defaults to `target`.",
140
140
  "value": {
141
141
  "type": [
142
142
  "Object",
@@ -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-alpha14",
4
+ "version": "24.2.0-alpha16",
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-alpha14/#/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.",
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-alpha16/#/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
  {
@@ -42,7 +42,7 @@
42
42
  },
43
43
  {
44
44
  "name": ".ariaTarget",
45
- "description": "Element used to link with the `aria-describedby`\nattribute. When not set, defaults to `target`.",
45
+ "description": "Element used to link with the `aria-describedby`\nattribute. Supports array of multiple elements.\nWhen not set, defaults to `target`.",
46
46
  "value": {
47
47
  "kind": "expression"
48
48
  }