@vaadin/tooltip 24.9.0-alpha1 → 24.9.0-beta1

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.9.0-alpha1",
3
+ "version": "24.9.0-beta1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,18 +36,18 @@
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
38
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/a11y-base": "24.9.0-alpha1",
40
- "@vaadin/component-base": "24.9.0-alpha1",
41
- "@vaadin/overlay": "24.9.0-alpha1",
42
- "@vaadin/popover": "24.9.0-alpha1",
43
- "@vaadin/vaadin-lumo-styles": "24.9.0-alpha1",
44
- "@vaadin/vaadin-material-styles": "24.9.0-alpha1",
45
- "@vaadin/vaadin-themable-mixin": "24.9.0-alpha1",
39
+ "@vaadin/a11y-base": "24.9.0-beta1",
40
+ "@vaadin/component-base": "24.9.0-beta1",
41
+ "@vaadin/overlay": "24.9.0-beta1",
42
+ "@vaadin/popover": "24.9.0-beta1",
43
+ "@vaadin/vaadin-lumo-styles": "24.9.0-beta1",
44
+ "@vaadin/vaadin-material-styles": "24.9.0-beta1",
45
+ "@vaadin/vaadin-themable-mixin": "24.9.0-beta1",
46
46
  "lit": "^3.0.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@vaadin/chai-plugins": "24.9.0-alpha1",
50
- "@vaadin/test-runner-commands": "24.9.0-alpha1",
49
+ "@vaadin/chai-plugins": "24.9.0-beta1",
50
+ "@vaadin/test-runner-commands": "24.9.0-beta1",
51
51
  "@vaadin/testing-helpers": "^1.1.0",
52
52
  "sinon": "^18.0.0"
53
53
  },
@@ -55,5 +55,5 @@
55
55
  "web-types.json",
56
56
  "web-types.lit.json"
57
57
  ],
58
- "gitHead": "cc13d59f0e3cd1a3b0c19c1a900a5308446fe7ac"
58
+ "gitHead": "5f6e6e33217fef06e5d5cc52baa4d760969ef1e4"
59
59
  }
@@ -700,6 +700,8 @@ export const TooltipMixin = (superClass) =>
700
700
 
701
701
  // Update the sr-only label text content
702
702
  this._overlayContent = root.textContent;
703
+
704
+ this.dispatchEvent(new CustomEvent('content-changed', { detail: { content: root.textContent } }));
703
705
  }
704
706
 
705
707
  /** @private */
@@ -742,4 +744,10 @@ export const TooltipMixin = (superClass) =>
742
744
  srLabel.textContent = textContent;
743
745
  }
744
746
  }
747
+
748
+ /**
749
+ * Fired when the tooltip text content is changed.
750
+ *
751
+ * @event content-changed
752
+ */
745
753
  };
@@ -10,6 +10,17 @@ import { TooltipMixin } from './vaadin-tooltip-mixin.js';
10
10
 
11
11
  export { TooltipPosition } from './vaadin-tooltip-mixin.js';
12
12
 
13
+ /**
14
+ * Fired when the tooltip text content is changed.
15
+ */
16
+ export type TooltipContentChangedEvent = CustomEvent<{ content: string }>;
17
+
18
+ export interface TooltipCustomEventMap {
19
+ 'content-changed': TooltipContentChangedEvent;
20
+ }
21
+
22
+ export interface TooltipEventMap extends HTMLElementEventMap, TooltipCustomEventMap {}
23
+
13
24
  /**
14
25
  * `<vaadin-tooltip>` is a Web Component for creating tooltips.
15
26
  *
@@ -47,6 +58,8 @@ export { TooltipPosition } from './vaadin-tooltip-mixin.js';
47
58
  * `--vaadin-tooltip-offset-end` | Used as an offset when the tooltip is aligned horizontally before the target
48
59
  *
49
60
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
61
+ *
62
+ * @fires {CustomEvent} content-changed - Fired when the tooltip text content is changed.
50
63
  */
51
64
  declare class Tooltip extends TooltipMixin(ThemePropertyMixin(ControllerMixin(ElementMixin(HTMLElement)))) {
52
65
  /**
@@ -66,6 +79,18 @@ declare class Tooltip extends TooltipMixin(ThemePropertyMixin(ControllerMixin(El
66
79
  * except for those that have hover delay configured using property.
67
80
  */
68
81
  static setDefaultHoverDelay(hoverDelay: number): void;
82
+
83
+ addEventListener<K extends keyof TooltipEventMap>(
84
+ type: K,
85
+ listener: (this: Tooltip, ev: TooltipEventMap[K]) => void,
86
+ options?: AddEventListenerOptions | boolean,
87
+ ): void;
88
+
89
+ removeEventListener<K extends keyof TooltipEventMap>(
90
+ type: K,
91
+ listener: (this: Tooltip, ev: TooltipEventMap[K]) => void,
92
+ options?: EventListenerOptions | boolean,
93
+ ): void;
69
94
  }
70
95
 
71
96
  declare global {
@@ -49,6 +49,8 @@ import { TooltipMixin } from './vaadin-tooltip-mixin.js';
49
49
  *
50
50
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
51
51
  *
52
+ * @fires {CustomEvent} content-changed - Fired when the tooltip text content is changed.
53
+ *
52
54
  * @customElement
53
55
  * @extends HTMLElement
54
56
  * @mixes ControllerMixin
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.9.0-alpha1",
4
+ "version": "24.9.0-beta1",
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.9.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.",
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.9.0-beta1/#/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",
@@ -278,7 +278,12 @@
278
278
  }
279
279
  }
280
280
  ],
281
- "events": []
281
+ "events": [
282
+ {
283
+ "name": "content-changed",
284
+ "description": "Fired when the tooltip text content is changed."
285
+ }
286
+ ]
282
287
  }
283
288
  }
284
289
  ]
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/tooltip",
4
- "version": "24.9.0-alpha1",
4
+ "version": "24.9.0-beta1",
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.9.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.",
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.9.0-beta1/#/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
  {
@@ -116,6 +116,13 @@
116
116
  "value": {
117
117
  "kind": "expression"
118
118
  }
119
+ },
120
+ {
121
+ "name": "@content-changed",
122
+ "description": "Fired when the tooltip text content is changed.",
123
+ "value": {
124
+ "kind": "expression"
125
+ }
119
126
  }
120
127
  ]
121
128
  }