@vaadin/component-base 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/component-base",
3
- "version": "24.9.0-alpha1",
3
+ "version": "24.9.0-beta1",
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-beta1",
42
+ "@vaadin/test-runner-commands": "24.9.0-beta1",
43
43
  "@vaadin/testing-helpers": "^1.1.0",
44
44
  "sinon": "^18.0.0"
45
45
  },
46
- "gitHead": "cc13d59f0e3cd1a3b0c19c1a900a5308446fe7ac"
46
+ "gitHead": "5f6e6e33217fef06e5d5cc52baa4d760969ef1e4"
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-beta1') {
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,11 @@ export class TooltipController extends SlotController {
50
51
  tooltipNode.shouldShow = this.shouldShow;
51
52
  }
52
53
 
53
- this.__notifyChange();
54
+ if (!this.manual) {
55
+ this.host.setAttribute('has-tooltip', '');
56
+ }
57
+ this.__notifyChange(tooltipNode);
58
+ tooltipNode.addEventListener('content-changed', this.__onContentChange);
54
59
  }
55
60
 
56
61
  /**
@@ -60,8 +65,12 @@ export class TooltipController extends SlotController {
60
65
  * @protected
61
66
  * @override
62
67
  */
63
- teardownNode() {
64
- this.__notifyChange();
68
+ teardownNode(tooltipNode) {
69
+ if (!this.manual) {
70
+ this.host.removeAttribute('has-tooltip');
71
+ }
72
+ tooltipNode.removeEventListener('content-changed', this.__onContentChange);
73
+ this.__notifyChange(null);
65
74
  }
66
75
 
67
76
  /**
@@ -160,7 +169,12 @@ export class TooltipController extends SlotController {
160
169
  }
161
170
 
162
171
  /** @private */
163
- __notifyChange() {
164
- this.dispatchEvent(new CustomEvent('tooltip-changed', { detail: { node: this.node } }));
172
+ __onContentChange(event) {
173
+ this.__notifyChange(event.target);
174
+ }
175
+
176
+ /** @private */
177
+ __notifyChange(node) {
178
+ this.dispatchEvent(new CustomEvent('tooltip-changed', { detail: { node } }));
165
179
  }
166
180
  }