@vaadin/radio-group 24.2.0-alpha8 → 24.2.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/radio-group",
3
- "version": "24.2.0-alpha8",
3
+ "version": "24.2.0-beta1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,21 +38,21 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@polymer/polymer": "^3.0.0",
41
- "@vaadin/a11y-base": "24.2.0-alpha8",
42
- "@vaadin/component-base": "24.2.0-alpha8",
43
- "@vaadin/field-base": "24.2.0-alpha8",
44
- "@vaadin/vaadin-lumo-styles": "24.2.0-alpha8",
45
- "@vaadin/vaadin-material-styles": "24.2.0-alpha8",
46
- "@vaadin/vaadin-themable-mixin": "24.2.0-alpha8"
41
+ "@vaadin/a11y-base": "24.2.0-beta1",
42
+ "@vaadin/component-base": "24.2.0-beta1",
43
+ "@vaadin/field-base": "24.2.0-beta1",
44
+ "@vaadin/vaadin-lumo-styles": "24.2.0-beta1",
45
+ "@vaadin/vaadin-material-styles": "24.2.0-beta1",
46
+ "@vaadin/vaadin-themable-mixin": "24.2.0-beta1"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@esm-bundle/chai": "^4.3.4",
50
- "@vaadin/testing-helpers": "^0.4.3",
50
+ "@vaadin/testing-helpers": "^0.5.0",
51
51
  "sinon": "^13.0.2"
52
52
  },
53
53
  "web-types": [
54
54
  "web-types.json",
55
55
  "web-types.lit.json"
56
56
  ],
57
- "gitHead": "2c024e8fd462d178430418f76a61f498fb549998"
57
+ "gitHead": "67c8eef57d1c59e7476e29adaf003cf4548878f2"
58
58
  }
@@ -16,8 +16,15 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
16
16
  */
17
17
  export type RadioButtonCheckedChangedEvent = CustomEvent<{ value: boolean }>;
18
18
 
19
+ /**
20
+ * Fired when the `dirty` property changes.
21
+ */
22
+ export type RadioButtonDirtyChangedEvent = CustomEvent<{ value: boolean }>;
23
+
19
24
  export interface RadioButtonCustomEventMap {
20
25
  'checked-changed': RadioButtonCheckedChangedEvent;
26
+
27
+ 'dirty-changed': RadioButtonDirtyChangedEvent;
21
28
  }
22
29
 
23
30
  export interface RadioButtonEventMap extends HTMLElementEventMap, RadioButtonCustomEventMap {}
@@ -56,6 +63,7 @@ export interface RadioButtonEventMap extends HTMLElementEventMap, RadioButtonCus
56
63
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
57
64
  *
58
65
  * @fires {CustomEvent} checked-changed - Fired when the `checked` property changes.
66
+ * @fires {CustomEvent} dirty-changed - Fired when the `dirty` property changes.
59
67
  */
60
68
  declare class RadioButton extends LabelMixin(
61
69
  CheckedMixin(DelegateFocusMixin(ActiveMixin(ElementMixin(ThemableMixin(ControllerMixin(HTMLElement)))))),
@@ -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';
@@ -48,7 +49,9 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
48
49
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
49
50
  *
50
51
  * @fires {CustomEvent} checked-changed - Fired when the `checked` property changes.
52
+ * @fires {CustomEvent} dirty-changed - Fired when the `dirty` property changes.
51
53
  *
54
+ * @customElement
52
55
  * @extends HTMLElement
53
56
  * @mixes ControllerMixin
54
57
  * @mixes ThemableMixin
@@ -186,6 +189,6 @@ class RadioButton extends LabelMixin(
186
189
  }
187
190
  }
188
191
 
189
- customElements.define(RadioButton.is, RadioButton);
192
+ defineCustomElement(RadioButton);
190
193
 
191
194
  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-alpha8",
4
+ "version": "24.2.0-beta1",
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-alpha8",
4
+ "version": "24.2.0-beta1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {