@vaadin/component-base 24.9.0-alpha1 → 24.9.0-alpha2

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/component-base",
3
- "version": "24.9.0-alpha1",
3
+ "version": "24.9.0-alpha2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,10 +38,10 @@
38
38
  "lit": "^3.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@vaadin/chai-plugins": "24.9.0-alpha1",
42
- "@vaadin/test-runner-commands": "24.9.0-alpha1",
41
+ "@vaadin/chai-plugins": "24.9.0-alpha2",
42
+ "@vaadin/test-runner-commands": "24.9.0-alpha2",
43
43
  "@vaadin/testing-helpers": "^1.1.0",
44
44
  "sinon": "^18.0.0"
45
45
  },
46
- "gitHead": "cc13d59f0e3cd1a3b0c19c1a900a5308446fe7ac"
46
+ "gitHead": "dd99dece1b54942ab0e421892b089e506822c5f5"
47
47
  }
package/src/define.js CHANGED
@@ -13,7 +13,7 @@ function dashToCamelCase(dash) {
13
13
 
14
14
  const experimentalMap = {};
15
15
 
16
- export function defineCustomElement(CustomElement, version = '24.9.0-alpha1') {
16
+ export function defineCustomElement(CustomElement, version = '24.9.0-alpha2') {
17
17
  Object.defineProperty(CustomElement, 'version', {
18
18
  get() {
19
19
  return version;
@@ -14,6 +14,7 @@ export class TooltipController extends SlotController {
14
14
  super(host, 'tooltip');
15
15
 
16
16
  this.setTarget(host);
17
+ this.__onContentChange = this.__onContentChange.bind(this);
17
18
  }
18
19
 
19
20
  /**
@@ -50,7 +51,8 @@ export class TooltipController extends SlotController {
50
51
  tooltipNode.shouldShow = this.shouldShow;
51
52
  }
52
53
 
53
- this.__notifyChange();
54
+ this.__notifyChange(tooltipNode);
55
+ tooltipNode.addEventListener('content-changed', this.__onContentChange);
54
56
  }
55
57
 
56
58
  /**
@@ -60,8 +62,10 @@ export class TooltipController extends SlotController {
60
62
  * @protected
61
63
  * @override
62
64
  */
63
- teardownNode() {
64
- this.__notifyChange();
65
+ teardownNode(tooltipNode) {
66
+ tooltipNode.removeEventListener('content-changed', this.__onContentChange);
67
+
68
+ this.__notifyChange(null);
65
69
  }
66
70
 
67
71
  /**
@@ -160,7 +164,12 @@ export class TooltipController extends SlotController {
160
164
  }
161
165
 
162
166
  /** @private */
163
- __notifyChange() {
164
- this.dispatchEvent(new CustomEvent('tooltip-changed', { detail: { node: this.node } }));
167
+ __onContentChange(event) {
168
+ this.__notifyChange(event.target);
169
+ }
170
+
171
+ /** @private */
172
+ __notifyChange(node) {
173
+ this.dispatchEvent(new CustomEvent('tooltip-changed', { detail: { node } }));
165
174
  }
166
175
  }