@vaadin/radio-group 24.2.0-alpha9 → 24.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/radio-group",
3
- "version": "24.2.0-alpha9",
3
+ "version": "24.2.0-beta2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,12 +38,12 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@polymer/polymer": "^3.0.0",
41
- "@vaadin/a11y-base": "24.2.0-alpha9",
42
- "@vaadin/component-base": "24.2.0-alpha9",
43
- "@vaadin/field-base": "24.2.0-alpha9",
44
- "@vaadin/vaadin-lumo-styles": "24.2.0-alpha9",
45
- "@vaadin/vaadin-material-styles": "24.2.0-alpha9",
46
- "@vaadin/vaadin-themable-mixin": "24.2.0-alpha9"
41
+ "@vaadin/a11y-base": "24.2.0-beta2",
42
+ "@vaadin/component-base": "24.2.0-beta2",
43
+ "@vaadin/field-base": "24.2.0-beta2",
44
+ "@vaadin/vaadin-lumo-styles": "24.2.0-beta2",
45
+ "@vaadin/vaadin-material-styles": "24.2.0-beta2",
46
+ "@vaadin/vaadin-themable-mixin": "24.2.0-beta2"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@esm-bundle/chai": "^4.3.4",
@@ -54,5 +54,5 @@
54
54
  "web-types.json",
55
55
  "web-types.lit.json"
56
56
  ],
57
- "gitHead": "e9765733fea96542e379e02e6f42b07145893140"
57
+ "gitHead": "4b852f9a12d4dade7f0fb3c73b7212436cebf310"
58
58
  }
@@ -7,6 +7,7 @@ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
7
7
  import { ActiveMixin } from '@vaadin/a11y-base/src/active-mixin.js';
8
8
  import { DelegateFocusMixin } from '@vaadin/a11y-base/src/delegate-focus-mixin.js';
9
9
  import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
10
+ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
10
11
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
11
12
  import { CheckedMixin } from '@vaadin/field-base/src/checked-mixin.js';
12
13
  import { InputController } from '@vaadin/field-base/src/input-controller.js';
@@ -50,6 +51,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
50
51
  * @fires {CustomEvent} checked-changed - Fired when the `checked` property changes.
51
52
  * @fires {CustomEvent} dirty-changed - Fired when the `dirty` property changes.
52
53
  *
54
+ * @customElement
53
55
  * @extends HTMLElement
54
56
  * @mixes ControllerMixin
55
57
  * @mixes ThemableMixin
@@ -119,6 +121,8 @@ class RadioButton extends LabelMixin(
119
121
  margin: 0;
120
122
  align-self: stretch;
121
123
  -webkit-appearance: none;
124
+ width: initial;
125
+ height: initial;
122
126
  }
123
127
 
124
128
  @media (forced-colors: active) {
@@ -187,6 +191,6 @@ class RadioButton extends LabelMixin(
187
191
  }
188
192
  }
189
193
 
190
- customElements.define(RadioButton.is, RadioButton);
194
+ defineCustomElement(RadioButton);
191
195
 
192
196
  export { RadioButton };
@@ -7,6 +7,7 @@ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
7
7
  import { DisabledMixin } from '@vaadin/a11y-base/src/disabled-mixin.js';
8
8
  import { FocusMixin } from '@vaadin/a11y-base/src/focus-mixin.js';
9
9
  import { KeyboardMixin } from '@vaadin/a11y-base/src/keyboard-mixin.js';
10
+ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
10
11
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
11
12
  import { SlotObserver } from '@vaadin/component-base/src/slot-observer.js';
12
13
  import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
@@ -57,6 +58,7 @@ import { RadioButton } from './vaadin-radio-button.js';
57
58
  * @fires {CustomEvent} value-changed - Fired when the `value` property changes.
58
59
  * @fires {CustomEvent} validated - Fired whenever the field is validated.
59
60
  *
61
+ * @customElement
60
62
  * @extends HTMLElement
61
63
  * @mixes ThemableMixin
62
64
  * @mixes DisabledMixin
@@ -186,6 +188,19 @@ class RadioGroup extends FieldMixin(
186
188
  this.__unregisterRadioButton = this.__unregisterRadioButton.bind(this);
187
189
  this.__onRadioButtonChange = this.__onRadioButtonChange.bind(this);
188
190
  this.__onRadioButtonCheckedChange = this.__onRadioButtonCheckedChange.bind(this);
191
+
192
+ this._tooltipController = new TooltipController(this);
193
+ this._tooltipController.addEventListener('tooltip-changed', (event) => {
194
+ const tooltip = event.detail.node;
195
+ if (tooltip && tooltip.isConnected) {
196
+ // Tooltip element has been added to the DOM
197
+ const inputs = this.__radioButtons.map((radio) => radio.inputElement);
198
+ this._tooltipController.setAriaTarget(inputs);
199
+ } else {
200
+ // Tooltip element is no longer connected
201
+ this._tooltipController.setAriaTarget([]);
202
+ }
203
+ });
189
204
  }
190
205
 
191
206
  /**
@@ -235,9 +250,11 @@ class RadioGroup extends FieldMixin(
235
250
 
236
251
  // Unregisters the removed radio buttons.
237
252
  this.__filterRadioButtons(removedNodes).forEach(this.__unregisterRadioButton);
253
+
254
+ const inputs = this.__radioButtons.map((radio) => radio.inputElement);
255
+ this._tooltipController.setAriaTarget(inputs);
238
256
  });
239
257
 
240
- this._tooltipController = new TooltipController(this);
241
258
  this.addController(this._tooltipController);
242
259
  }
243
260
 
@@ -532,6 +549,6 @@ class RadioGroup extends FieldMixin(
532
549
  }
533
550
  }
534
551
 
535
- customElements.define(RadioGroup.is, RadioGroup);
552
+ defineCustomElement(RadioGroup);
536
553
 
537
554
  export { RadioGroup };
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/radio-group",
4
- "version": "24.2.0-alpha9",
4
+ "version": "24.2.0-beta2",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/radio-group",
4
- "version": "24.2.0-alpha9",
4
+ "version": "24.2.0-beta2",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {