@vaadin/radio-group 22.0.0-beta1 → 22.0.1
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/README.md +14 -9
- package/package.json +8 -8
- package/src/vaadin-radio-button.d.ts +2 -1
- package/src/vaadin-radio-button.js +6 -4
- package/src/vaadin-radio-group.d.ts +1 -1
- package/src/vaadin-radio-group.js +2 -11
- package/theme/lumo/vaadin-radio-button-styles.js +1 -1
- package/theme/lumo/vaadin-radio-group-styles.js +1 -1
- package/theme/material/vaadin-radio-button-styles.js +1 -1
- package/theme/material/vaadin-radio-group-styles.js +1 -1
package/README.md
CHANGED
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
A web component that allows the user to choose one item from a group of choices.
|
|
4
4
|
|
|
5
|
-
[Live Demo ↗](https://vaadin.com/docs/latest/ds/components/radio-button)
|
|
5
|
+
[Documentation + Live Demo ↗](https://vaadin.com/docs/latest/ds/components/radio-button)
|
|
6
6
|
|
|
7
7
|
```html
|
|
8
8
|
<vaadin-radio-group label="Travel class">
|
|
9
|
-
<vaadin-radio-button value="economy"
|
|
10
|
-
<vaadin-radio-button value="business"
|
|
11
|
-
<vaadin-radio-button value="firstClass"
|
|
9
|
+
<vaadin-radio-button value="economy" label="Economy"></vaadin-radio-button>
|
|
10
|
+
<vaadin-radio-button value="business" label="Business"></vaadin-radio-button>
|
|
11
|
+
<vaadin-radio-button value="firstClass" label="First Class"></vaadin-radio-button>
|
|
12
12
|
</vaadin-radio-group>
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
[<img src="https://raw.githubusercontent.com/vaadin/web-components/master/packages/radio-group/screenshot.png" width="370" alt="Screenshot of vaadin-radio-group">](https://vaadin.com/docs/latest/ds/components/radio-button)
|
|
16
|
+
|
|
15
17
|
## Installation
|
|
16
18
|
|
|
17
19
|
Install the component:
|
|
18
20
|
|
|
19
21
|
```sh
|
|
20
|
-
npm i @vaadin/radio-group
|
|
22
|
+
npm i @vaadin/radio-group
|
|
21
23
|
```
|
|
22
24
|
|
|
23
25
|
Once installed, import the component in your application:
|
|
@@ -28,9 +30,8 @@ import '@vaadin/radio-group';
|
|
|
28
30
|
|
|
29
31
|
## Themes
|
|
30
32
|
|
|
31
|
-
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes),
|
|
32
|
-
|
|
33
|
-
of the package uses the Lumo theme.
|
|
33
|
+
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes), Lumo and Material.
|
|
34
|
+
The [main entrypoint](https://github.com/vaadin/web-components/blob/master/packages/radio-group/vaadin-radio-group.js) of the package uses the Lumo theme.
|
|
34
35
|
|
|
35
36
|
To use the Material theme, import the component from the `theme/material` folder:
|
|
36
37
|
|
|
@@ -50,9 +51,13 @@ Finally, you can import the un-themed component from the `src` folder to get a m
|
|
|
50
51
|
import '@vaadin/radio-group/src/vaadin-radio-group.js';
|
|
51
52
|
```
|
|
52
53
|
|
|
54
|
+
## Contributing
|
|
55
|
+
|
|
56
|
+
Read the [contributing guide](https://vaadin.com/docs/latest/guide/contributing/overview) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
|
|
57
|
+
|
|
53
58
|
## License
|
|
54
59
|
|
|
55
60
|
Apache License 2.0
|
|
56
61
|
|
|
57
|
-
Vaadin collects development time
|
|
62
|
+
Vaadin collects usage statistics at development time to improve this product.
|
|
58
63
|
For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/radio-group",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@polymer/polymer": "^3.0.0",
|
|
38
|
-
"@vaadin/component-base": "22.0.
|
|
39
|
-
"@vaadin/field-base": "22.0.
|
|
40
|
-
"@vaadin/vaadin-lumo-styles": "22.0.
|
|
41
|
-
"@vaadin/vaadin-material-styles": "22.0.
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "22.0.
|
|
38
|
+
"@vaadin/component-base": "^22.0.1",
|
|
39
|
+
"@vaadin/field-base": "^22.0.1",
|
|
40
|
+
"@vaadin/vaadin-lumo-styles": "^22.0.1",
|
|
41
|
+
"@vaadin/vaadin-material-styles": "^22.0.1",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "^22.0.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@esm-bundle/chai": "^4.3.4",
|
|
46
|
-
"@vaadin/testing-helpers": "^0.3.
|
|
46
|
+
"@vaadin/testing-helpers": "^0.3.2",
|
|
47
47
|
"sinon": "^9.2.1"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "2b0a2bff0369d6020f7cc33ad35506aa2d1f6f68"
|
|
50
50
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { ActiveMixin } from '@vaadin/component-base/src/active-mixin.js';
|
|
7
|
+
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
7
8
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
8
9
|
import { CheckedMixin } from '@vaadin/field-base/src/checked-mixin.js';
|
|
9
10
|
import { DelegateFocusMixin } from '@vaadin/field-base/src/delegate-focus-mixin.js';
|
|
@@ -57,7 +58,7 @@ export interface RadioButtonEventMap extends HTMLElementEventMap, RadioButtonCus
|
|
|
57
58
|
* @fires {CustomEvent} checked-changed - Fired when the `checked` property changes.
|
|
58
59
|
*/
|
|
59
60
|
declare class RadioButton extends SlotLabelMixin(
|
|
60
|
-
CheckedMixin(DelegateFocusMixin(ActiveMixin(ElementMixin(ThemableMixin(HTMLElement)))))
|
|
61
|
+
CheckedMixin(DelegateFocusMixin(ActiveMixin(ElementMixin(ThemableMixin(ControllerMixin(HTMLElement))))))
|
|
61
62
|
) {
|
|
62
63
|
/**
|
|
63
64
|
* The name of the radio button.
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
* Copyright (c) 2021 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
7
7
|
import { ActiveMixin } from '@vaadin/component-base/src/active-mixin.js';
|
|
8
|
+
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
8
9
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
9
|
-
import { AriaLabelController } from '@vaadin/field-base/src/aria-label-controller.js';
|
|
10
10
|
import { CheckedMixin } from '@vaadin/field-base/src/checked-mixin.js';
|
|
11
11
|
import { DelegateFocusMixin } from '@vaadin/field-base/src/delegate-focus-mixin.js';
|
|
12
12
|
import { InputController } from '@vaadin/field-base/src/input-controller.js';
|
|
13
|
+
import { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';
|
|
13
14
|
import { SlotLabelMixin } from '@vaadin/field-base/src/slot-label-mixin.js';
|
|
14
15
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
15
16
|
|
|
@@ -49,6 +50,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
49
50
|
* @fires {CustomEvent} checked-changed - Fired when the `checked` property changes.
|
|
50
51
|
*
|
|
51
52
|
* @extends HTMLElement
|
|
53
|
+
* @mixes ControllerMixin
|
|
52
54
|
* @mixes ThemableMixin
|
|
53
55
|
* @mixes ElementMixin
|
|
54
56
|
* @mixes ActiveMixin
|
|
@@ -56,7 +58,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
56
58
|
* @mixes SlotLabelMixin
|
|
57
59
|
*/
|
|
58
60
|
class RadioButton extends SlotLabelMixin(
|
|
59
|
-
CheckedMixin(DelegateFocusMixin(ActiveMixin(ElementMixin(ThemableMixin(PolymerElement)))))
|
|
61
|
+
CheckedMixin(DelegateFocusMixin(ActiveMixin(ElementMixin(ThemableMixin(ControllerMixin(PolymerElement))))))
|
|
60
62
|
) {
|
|
61
63
|
static get is() {
|
|
62
64
|
return 'vaadin-radio-button';
|
|
@@ -182,7 +184,7 @@ class RadioButton extends SlotLabelMixin(
|
|
|
182
184
|
this.ariaTarget = input;
|
|
183
185
|
})
|
|
184
186
|
);
|
|
185
|
-
this.addController(new
|
|
187
|
+
this.addController(new LabelledInputController(this.inputElement, this._labelNode));
|
|
186
188
|
}
|
|
187
189
|
}
|
|
188
190
|
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
7
7
|
import { DisabledMixin } from '@vaadin/component-base/src/disabled-mixin.js';
|
|
8
|
-
import { FieldMixin } from '@vaadin/field-base/src/field-mixin.js';
|
|
9
8
|
import { FocusMixin } from '@vaadin/component-base/src/focus-mixin.js';
|
|
10
9
|
import { KeyboardMixin } from '@vaadin/component-base/src/keyboard-mixin.js';
|
|
10
|
+
import { FieldMixin } from '@vaadin/field-base/src/field-mixin.js';
|
|
11
11
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* Copyright (c) 2021 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
|
|
7
6
|
import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
|
|
7
|
+
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
8
8
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
9
|
import { DisabledMixin } from '@vaadin/component-base/src/disabled-mixin.js';
|
|
10
|
-
import { FieldMixin } from '@vaadin/field-base/src/field-mixin.js';
|
|
11
10
|
import { FocusMixin } from '@vaadin/component-base/src/focus-mixin.js';
|
|
12
11
|
import { KeyboardMixin } from '@vaadin/component-base/src/keyboard-mixin.js';
|
|
12
|
+
import { FieldMixin } from '@vaadin/field-base/src/field-mixin.js';
|
|
13
13
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
14
|
import { RadioButton } from './vaadin-radio-button.js';
|
|
15
15
|
|
|
@@ -221,15 +221,6 @@ class RadioGroup extends FieldMixin(FocusMixin(DisabledMixin(KeyboardMixin(DirMi
|
|
|
221
221
|
return this.getAttribute('dir') === 'rtl' && this.theme !== 'vertical';
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
/**
|
|
225
|
-
* @return {string}
|
|
226
|
-
* @override
|
|
227
|
-
* @protected
|
|
228
|
-
*/
|
|
229
|
-
get _ariaAttr() {
|
|
230
|
-
return 'aria-labelledby';
|
|
231
|
-
}
|
|
232
|
-
|
|
233
224
|
/**
|
|
234
225
|
* Override method inherited from `KeyboardMixin`
|
|
235
226
|
* to implement the custom keyboard navigation as a replacement for the native one
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
2
1
|
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
3
2
|
import '@vaadin/vaadin-lumo-styles/sizing.js';
|
|
4
3
|
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
5
4
|
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
6
5
|
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
6
|
+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
7
7
|
|
|
8
8
|
registerStyles(
|
|
9
9
|
'vaadin-radio-button',
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
2
1
|
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
3
2
|
import '@vaadin/vaadin-lumo-styles/sizing.js';
|
|
4
3
|
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
@@ -6,6 +5,7 @@ import '@vaadin/vaadin-lumo-styles/style.js';
|
|
|
6
5
|
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
7
6
|
import { helper } from '@vaadin/vaadin-lumo-styles/mixins/helper.js';
|
|
8
7
|
import { requiredField } from '@vaadin/vaadin-lumo-styles/mixins/required-field.js';
|
|
8
|
+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
9
|
|
|
10
10
|
const radioGroup = css`
|
|
11
11
|
:host {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
2
1
|
import '@vaadin/vaadin-material-styles/color.js';
|
|
2
|
+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
3
3
|
|
|
4
4
|
registerStyles(
|
|
5
5
|
'vaadin-radio-button',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
2
1
|
import '@vaadin/vaadin-material-styles/color.js';
|
|
3
2
|
import { helper } from '@vaadin/vaadin-material-styles/mixins/helper.js';
|
|
4
3
|
import { requiredField } from '@vaadin/vaadin-material-styles/mixins/required-field.js';
|
|
4
|
+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
5
5
|
|
|
6
6
|
const radioGroup = css`
|
|
7
7
|
:host {
|