@vaadin/radio-group 24.8.4 → 25.0.0-alpha10
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 +0 -23
- package/package.json +13 -14
- package/src/styles/vaadin-radio-button-base-styles.js +25 -0
- package/src/styles/vaadin-radio-button-core-styles.d.ts +8 -0
- package/src/styles/vaadin-radio-button-core-styles.js +26 -0
- package/src/styles/vaadin-radio-group-base-styles.js +9 -0
- package/src/styles/vaadin-radio-group-core-styles.d.ts +8 -0
- package/src/styles/vaadin-radio-group-core-styles.js +8 -0
- package/src/vaadin-radio-button.d.ts +1 -2
- package/src/vaadin-radio-button.js +12 -8
- package/src/vaadin-radio-group-mixin.d.ts +1 -3
- package/src/vaadin-radio-group.js +12 -7
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
- package/src/vaadin-lit-radio-button.js +0 -46
- package/src/vaadin-lit-radio-group.js +0 -62
- package/src/vaadin-radio-button-styles.js +0 -77
- package/src/vaadin-radio-group-styles.js +0 -37
- package/theme/lumo/vaadin-lit-radio-button.d.ts +0 -2
- package/theme/lumo/vaadin-lit-radio-button.js +0 -2
- package/theme/lumo/vaadin-lit-radio-group.d.ts +0 -3
- package/theme/lumo/vaadin-lit-radio-group.js +0 -3
- package/theme/material/vaadin-lit-radio-button.d.ts +0 -2
- package/theme/material/vaadin-lit-radio-button.js +0 -2
- package/theme/material/vaadin-lit-radio-group.d.ts +0 -3
- package/theme/material/vaadin-lit-radio-group.js +0 -3
- package/theme/material/vaadin-radio-button-styles.d.ts +0 -1
- package/theme/material/vaadin-radio-button-styles.js +0 -113
- package/theme/material/vaadin-radio-button.d.ts +0 -2
- package/theme/material/vaadin-radio-button.js +0 -2
- package/theme/material/vaadin-radio-group-styles.d.ts +0 -1
- package/theme/material/vaadin-radio-group-styles.js +0 -43
- package/theme/material/vaadin-radio-group.d.ts +0 -3
- package/theme/material/vaadin-radio-group.js +0 -3
- package/vaadin-lit-radio-button.d.ts +0 -1
- package/vaadin-lit-radio-button.js +0 -2
- package/vaadin-lit-radio-group.d.ts +0 -1
- package/vaadin-lit-radio-group.js +0 -2
- /package/src/{vaadin-radio-button-styles.d.ts → styles/vaadin-radio-button-base-styles.d.ts} +0 -0
- /package/src/{vaadin-radio-group-styles.d.ts → styles/vaadin-radio-group-base-styles.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -28,29 +28,6 @@ Once installed, import the component in your application:
|
|
|
28
28
|
import '@vaadin/radio-group';
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
## Themes
|
|
32
|
-
|
|
33
|
-
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
|
|
34
|
-
The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/radio-group/vaadin-radio-group.js) of the package uses the Lumo theme.
|
|
35
|
-
|
|
36
|
-
To use the Material theme, import the component from the `theme/material` folder:
|
|
37
|
-
|
|
38
|
-
```js
|
|
39
|
-
import '@vaadin/radio-group/theme/material/vaadin-radio-group.js';
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
You can also import the Lumo version of the component explicitly:
|
|
43
|
-
|
|
44
|
-
```js
|
|
45
|
-
import '@vaadin/radio-group/theme/lumo/vaadin-radio-group.js';
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
|
|
49
|
-
|
|
50
|
-
```js
|
|
51
|
-
import '@vaadin/radio-group/src/vaadin-radio-group.js';
|
|
52
|
-
```
|
|
53
|
-
|
|
54
31
|
## Contributing
|
|
55
32
|
|
|
56
33
|
Read the [contributing guide](https://vaadin.com/docs/latest/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/radio-group",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0-alpha10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
+
"!src/styles/*-base-styles.d.ts",
|
|
25
|
+
"!src/styles/*-base-styles.js",
|
|
24
26
|
"theme",
|
|
25
27
|
"vaadin-*.d.ts",
|
|
26
28
|
"vaadin-*.js",
|
|
@@ -33,29 +35,26 @@
|
|
|
33
35
|
"vaadin-radio-button",
|
|
34
36
|
"web-components",
|
|
35
37
|
"web-component",
|
|
36
|
-
"radio button"
|
|
37
|
-
"polymer"
|
|
38
|
+
"radio button"
|
|
38
39
|
],
|
|
39
40
|
"dependencies": {
|
|
40
41
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
41
|
-
"@
|
|
42
|
-
"@vaadin/
|
|
43
|
-
"@vaadin/
|
|
44
|
-
"@vaadin/
|
|
45
|
-
"@vaadin/vaadin-
|
|
46
|
-
"@vaadin/vaadin-material-styles": "~24.8.4",
|
|
47
|
-
"@vaadin/vaadin-themable-mixin": "~24.8.4",
|
|
42
|
+
"@vaadin/a11y-base": "25.0.0-alpha10",
|
|
43
|
+
"@vaadin/component-base": "25.0.0-alpha10",
|
|
44
|
+
"@vaadin/field-base": "25.0.0-alpha10",
|
|
45
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha10",
|
|
46
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha10",
|
|
48
47
|
"lit": "^3.0.0"
|
|
49
48
|
},
|
|
50
49
|
"devDependencies": {
|
|
51
|
-
"@vaadin/chai-plugins": "
|
|
52
|
-
"@vaadin/test-runner-commands": "
|
|
53
|
-
"@vaadin/testing-helpers": "^
|
|
50
|
+
"@vaadin/chai-plugins": "25.0.0-alpha10",
|
|
51
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha10",
|
|
52
|
+
"@vaadin/testing-helpers": "^2.0.0",
|
|
54
53
|
"sinon": "^18.0.0"
|
|
55
54
|
},
|
|
56
55
|
"web-types": [
|
|
57
56
|
"web-types.json",
|
|
58
57
|
"web-types.lit.json"
|
|
59
58
|
],
|
|
60
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
|
|
61
60
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { css } from 'lit';
|
|
7
|
+
import { checkable } from '@vaadin/field-base/src/styles/checkable-base-styles.js';
|
|
8
|
+
import { field } from '@vaadin/field-base/src/styles/field-base-styles.js';
|
|
9
|
+
|
|
10
|
+
const radioButton = css`
|
|
11
|
+
[part='radio'] {
|
|
12
|
+
border-radius: 50%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
[part='radio']::after {
|
|
16
|
+
top: 50%;
|
|
17
|
+
left: 50%;
|
|
18
|
+
translate: -50% -50%;
|
|
19
|
+
width: var(--vaadin-radio-button-dot-size, 50%);
|
|
20
|
+
height: var(--vaadin-radio-button-dot-size, 50%);
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
export const radioButtonStyles = [field, checkable('radio', 'radio-button'), radioButton];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { css } from 'lit';
|
|
7
|
+
import { checkable } from '@vaadin/field-base/src/styles/checkable-core-styles.js';
|
|
8
|
+
|
|
9
|
+
const radioButton = css`
|
|
10
|
+
@media (forced-colors: active) {
|
|
11
|
+
[part='radio'] {
|
|
12
|
+
outline: 1px solid;
|
|
13
|
+
outline-offset: -1px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([focused]) [part='radio'] {
|
|
17
|
+
outline-width: 2px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host([disabled]) [part='radio'] {
|
|
21
|
+
outline-color: GrayText;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
export const radioButtonStyles = [checkable('radio', 'radio-button'), radioButton];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { field } from '@vaadin/field-base/src/styles/field-base-styles.js';
|
|
7
|
+
import { group } from '@vaadin/field-base/src/styles/group-base-styles.js';
|
|
8
|
+
|
|
9
|
+
export const radioGroupStyles = [field, group('radio')];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { group } from '@vaadin/field-base/src/styles/group-core-styles.js';
|
|
7
|
+
|
|
8
|
+
export const radioGroupStyles = group('radio');
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
7
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
8
7
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
8
|
import { type RadioButtonEventMap, RadioButtonMixin } from './vaadin-radio-button-mixin.js';
|
|
@@ -45,7 +44,7 @@ export * from './vaadin-radio-button-mixin.js';
|
|
|
45
44
|
*
|
|
46
45
|
* @fires {CustomEvent} checked-changed - Fired when the `checked` property changes.
|
|
47
46
|
*/
|
|
48
|
-
declare class RadioButton extends RadioButtonMixin(ElementMixin(ThemableMixin(
|
|
47
|
+
declare class RadioButton extends RadioButtonMixin(ElementMixin(ThemableMixin(HTMLElement))) {
|
|
49
48
|
addEventListener<K extends keyof RadioButtonEventMap>(
|
|
50
49
|
type: K,
|
|
51
50
|
listener: (this: RadioButton, ev: RadioButtonEventMap[K]) => void,
|
|
@@ -3,15 +3,14 @@
|
|
|
3
3
|
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { html,
|
|
7
|
-
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
6
|
+
import { html, LitElement } from 'lit';
|
|
8
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
8
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
10
|
-
import {
|
|
9
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
11
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
|
+
import { radioButtonStyles } from './styles/vaadin-radio-button-core-styles.js';
|
|
11
13
|
import { RadioButtonMixin } from './vaadin-radio-button-mixin.js';
|
|
12
|
-
import { radioButtonStyles } from './vaadin-radio-button-styles.js';
|
|
13
|
-
|
|
14
|
-
registerStyles('vaadin-radio-button', radioButtonStyles, { moduleId: 'vaadin-radio-button-styles' });
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* `<vaadin-radio-button>` is a web component representing a choice in a radio group.
|
|
@@ -54,12 +53,17 @@ registerStyles('vaadin-radio-button', radioButtonStyles, { moduleId: 'vaadin-rad
|
|
|
54
53
|
* @mixes ElementMixin
|
|
55
54
|
* @mixes RadioButtonMixin
|
|
56
55
|
*/
|
|
57
|
-
class RadioButton extends RadioButtonMixin(ElementMixin(ThemableMixin(
|
|
56
|
+
class RadioButton extends RadioButtonMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
58
57
|
static get is() {
|
|
59
58
|
return 'vaadin-radio-button';
|
|
60
59
|
}
|
|
61
60
|
|
|
62
|
-
static get
|
|
61
|
+
static get styles() {
|
|
62
|
+
return radioButtonStyles;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** @protected */
|
|
66
|
+
render() {
|
|
63
67
|
return html`
|
|
64
68
|
<div class="vaadin-radio-button-container">
|
|
65
69
|
<div part="radio" aria-hidden="true"></div>
|
|
@@ -7,7 +7,6 @@ import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
|
7
7
|
import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js';
|
|
8
8
|
import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
9
9
|
import type { KeyboardMixinClass } from '@vaadin/a11y-base/src/keyboard-mixin.js';
|
|
10
|
-
import type { ControllerMixinClass } from '@vaadin/component-base/src/controller-mixin.js';
|
|
11
10
|
import type { FieldMixinClass } from '@vaadin/field-base/src/field-mixin.js';
|
|
12
11
|
import type { LabelMixinClass } from '@vaadin/field-base/src/label-mixin.js';
|
|
13
12
|
import type { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.js';
|
|
@@ -42,8 +41,7 @@ export interface RadioGroupEventMap extends HTMLElementEventMap, RadioGroupCusto
|
|
|
42
41
|
*/
|
|
43
42
|
export declare function RadioGroupMixin<T extends Constructor<HTMLElement>>(
|
|
44
43
|
base: T,
|
|
45
|
-
): Constructor<
|
|
46
|
-
Constructor<DisabledMixinClass> &
|
|
44
|
+
): Constructor<DisabledMixinClass> &
|
|
47
45
|
Constructor<FieldMixinClass> &
|
|
48
46
|
Constructor<FocusMixinClass> &
|
|
49
47
|
Constructor<KeyboardMixinClass> &
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import './vaadin-radio-button.js';
|
|
7
|
-
import { html,
|
|
7
|
+
import { html, LitElement } from 'lit';
|
|
8
8
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
9
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
10
|
-
import {
|
|
10
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
12
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
+
import { radioGroupStyles } from './styles/vaadin-radio-group-core-styles.js';
|
|
11
14
|
import { RadioGroupMixin } from './vaadin-radio-group-mixin.js';
|
|
12
|
-
import { radioGroupStyles } from './vaadin-radio-group-styles.js';
|
|
13
|
-
|
|
14
|
-
registerStyles('vaadin-radio-group', radioGroupStyles, { moduleId: 'vaadin-radio-group-styles' });
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* `<vaadin-radio-group>` is a web component that allows the user to choose one item from a group of choices.
|
|
@@ -61,12 +61,17 @@ registerStyles('vaadin-radio-group', radioGroupStyles, { moduleId: 'vaadin-radio
|
|
|
61
61
|
* @mixes ElementMixin
|
|
62
62
|
* @mixes RadioGroupMixin
|
|
63
63
|
*/
|
|
64
|
-
class RadioGroup extends RadioGroupMixin(ElementMixin(ThemableMixin(
|
|
64
|
+
class RadioGroup extends RadioGroupMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
65
65
|
static get is() {
|
|
66
66
|
return 'vaadin-radio-group';
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
static get
|
|
69
|
+
static get styles() {
|
|
70
|
+
return radioGroupStyles;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** @protected */
|
|
74
|
+
render() {
|
|
70
75
|
return html`
|
|
71
76
|
<div class="vaadin-group-field-container">
|
|
72
77
|
<div part="label">
|
package/web-types.json
CHANGED
package/web-types.lit.json
CHANGED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { html, LitElement } from 'lit';
|
|
7
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
9
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
|
-
import { RadioButtonMixin } from './vaadin-radio-button-mixin.js';
|
|
12
|
-
import { radioButtonStyles } from './vaadin-radio-button-styles.js';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* LitElement based version of `<vaadin-radio-button>` web component.
|
|
16
|
-
*
|
|
17
|
-
* ## Disclaimer
|
|
18
|
-
*
|
|
19
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
20
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
21
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
22
|
-
*/
|
|
23
|
-
class RadioButton extends RadioButtonMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
24
|
-
static get is() {
|
|
25
|
-
return 'vaadin-radio-button';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
static get styles() {
|
|
29
|
-
return radioButtonStyles;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/** @protected */
|
|
33
|
-
render() {
|
|
34
|
-
return html`
|
|
35
|
-
<div class="vaadin-radio-button-container">
|
|
36
|
-
<div part="radio" aria-hidden="true"></div>
|
|
37
|
-
<slot name="input"></slot>
|
|
38
|
-
<slot name="label"></slot>
|
|
39
|
-
</div>
|
|
40
|
-
`;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
defineCustomElement(RadioButton);
|
|
45
|
-
|
|
46
|
-
export { RadioButton };
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import './vaadin-lit-radio-button.js';
|
|
7
|
-
import { html, LitElement } from 'lit';
|
|
8
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
|
-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
10
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
|
-
import { RadioGroupMixin } from './vaadin-radio-group-mixin.js';
|
|
13
|
-
import { radioGroupStyles } from './vaadin-radio-group-styles.js';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* LitElement based version of `<vaadin-radio-group>` web component.
|
|
17
|
-
*
|
|
18
|
-
* ## Disclaimer
|
|
19
|
-
*
|
|
20
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
21
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
22
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
23
|
-
*/
|
|
24
|
-
class RadioGroup extends RadioGroupMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
25
|
-
static get is() {
|
|
26
|
-
return 'vaadin-radio-group';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
static get styles() {
|
|
30
|
-
return radioGroupStyles;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** @protected */
|
|
34
|
-
render() {
|
|
35
|
-
return html`
|
|
36
|
-
<div class="vaadin-group-field-container">
|
|
37
|
-
<div part="label">
|
|
38
|
-
<slot name="label"></slot>
|
|
39
|
-
<span part="required-indicator" aria-hidden="true"></span>
|
|
40
|
-
</div>
|
|
41
|
-
|
|
42
|
-
<div part="group-field">
|
|
43
|
-
<slot></slot>
|
|
44
|
-
</div>
|
|
45
|
-
|
|
46
|
-
<div part="helper-text">
|
|
47
|
-
<slot name="helper"></slot>
|
|
48
|
-
</div>
|
|
49
|
-
|
|
50
|
-
<div part="error-message">
|
|
51
|
-
<slot name="error-message"></slot>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
<slot name="tooltip"></slot>
|
|
56
|
-
`;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
defineCustomElement(RadioGroup);
|
|
61
|
-
|
|
62
|
-
export { RadioGroup };
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
7
|
-
|
|
8
|
-
export const radioButtonStyles = css`
|
|
9
|
-
:host {
|
|
10
|
-
display: inline-block;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
:host([hidden]) {
|
|
14
|
-
display: none !important;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
:host([disabled]) {
|
|
18
|
-
-webkit-tap-highlight-color: transparent;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.vaadin-radio-button-container {
|
|
22
|
-
display: grid;
|
|
23
|
-
grid-template-columns: auto 1fr;
|
|
24
|
-
align-items: baseline;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
[part='radio'],
|
|
28
|
-
::slotted(input),
|
|
29
|
-
::slotted(label) {
|
|
30
|
-
grid-row: 1;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
[part='radio'],
|
|
34
|
-
::slotted(input) {
|
|
35
|
-
grid-column: 1;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
[part='radio'] {
|
|
39
|
-
width: var(--vaadin-radio-button-size, 1em);
|
|
40
|
-
height: var(--vaadin-radio-button-size, 1em);
|
|
41
|
-
--_input-border-width: var(--vaadin-input-field-border-width, 0);
|
|
42
|
-
--_input-border-color: var(--vaadin-input-field-border-color, transparent);
|
|
43
|
-
box-shadow: inset 0 0 0 var(--_input-border-width, 0) var(--_input-border-color);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
[part='radio']::before {
|
|
47
|
-
display: block;
|
|
48
|
-
content: '\\202F';
|
|
49
|
-
line-height: var(--vaadin-radio-button-size, 1em);
|
|
50
|
-
contain: paint;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/* visually hidden */
|
|
54
|
-
::slotted(input) {
|
|
55
|
-
cursor: inherit;
|
|
56
|
-
margin: 0;
|
|
57
|
-
align-self: stretch;
|
|
58
|
-
-webkit-appearance: none;
|
|
59
|
-
width: initial;
|
|
60
|
-
height: initial;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@media (forced-colors: active) {
|
|
64
|
-
[part='radio'] {
|
|
65
|
-
outline: 1px solid;
|
|
66
|
-
outline-offset: -1px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
:host([focused]) [part='radio'] {
|
|
70
|
-
outline-width: 2px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
:host([disabled]) [part='radio'] {
|
|
74
|
-
outline-color: GrayText;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
`;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
7
|
-
|
|
8
|
-
export const radioGroupStyles = css`
|
|
9
|
-
:host {
|
|
10
|
-
display: inline-flex;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
:host::before {
|
|
14
|
-
content: '\\2003';
|
|
15
|
-
width: 0;
|
|
16
|
-
display: inline-block;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
:host([hidden]) {
|
|
20
|
-
display: none !important;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.vaadin-group-field-container {
|
|
24
|
-
display: flex;
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
width: 100%;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
[part='group-field'] {
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-wrap: wrap;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
:host(:not([has-label])) [part='label'] {
|
|
35
|
-
display: none;
|
|
36
|
-
}
|
|
37
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-material-styles/color.js';
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-material-styles/color.js';
|
|
2
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
3
|
-
|
|
4
|
-
registerStyles(
|
|
5
|
-
'vaadin-radio-button',
|
|
6
|
-
css`
|
|
7
|
-
:host {
|
|
8
|
-
display: inline-block;
|
|
9
|
-
-webkit-user-select: none;
|
|
10
|
-
user-select: none;
|
|
11
|
-
outline: none;
|
|
12
|
-
-webkit-tap-highlight-color: transparent;
|
|
13
|
-
--_radio-button-size: var(--vaadin-radio-button-size, 16px);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
:host([has-label]) ::slotted(label) {
|
|
17
|
-
padding: 4px 0.875em 4px 0.375em;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
[part='radio'] {
|
|
21
|
-
width: var(--_radio-button-size);
|
|
22
|
-
height: var(--_radio-button-size);
|
|
23
|
-
margin: 4px;
|
|
24
|
-
position: relative;
|
|
25
|
-
border: 2px solid;
|
|
26
|
-
border-radius: 50%;
|
|
27
|
-
background-color: transparent;
|
|
28
|
-
transition:
|
|
29
|
-
transform 0.2s cubic-bezier(0.12, 0.32, 0.54, 2),
|
|
30
|
-
background-color 0.15s;
|
|
31
|
-
will-change: transform;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/* Used for activation "halo" */
|
|
35
|
-
[part='radio']::before {
|
|
36
|
-
pointer-events: none;
|
|
37
|
-
color: transparent;
|
|
38
|
-
width: 100%;
|
|
39
|
-
height: 100%;
|
|
40
|
-
line-height: var(--_radio-button-size);
|
|
41
|
-
border-radius: inherit;
|
|
42
|
-
background-color: var(--material-primary-color);
|
|
43
|
-
transform: scale(2.5);
|
|
44
|
-
opacity: 0;
|
|
45
|
-
transition:
|
|
46
|
-
transform 0.1s,
|
|
47
|
-
opacity 0.8s;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
:host([checked]) [part='radio'] {
|
|
51
|
-
border-color: var(--material-primary-color);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/* Used for the selection dot */
|
|
55
|
-
[part='radio']::after {
|
|
56
|
-
content: '';
|
|
57
|
-
pointer-events: none;
|
|
58
|
-
width: 10px;
|
|
59
|
-
height: 10px;
|
|
60
|
-
border-radius: 50%;
|
|
61
|
-
background-color: var(--material-primary-color);
|
|
62
|
-
position: absolute;
|
|
63
|
-
top: 50%;
|
|
64
|
-
left: 50%;
|
|
65
|
-
transform: translate(-50%, -50%) scale(0);
|
|
66
|
-
transition: transform 0.2s;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
:host([checked]) [part='radio']::after {
|
|
70
|
-
transform: translate(-50%, -50%) scale(1);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
:host(:not([checked]):not([disabled])) [part='radio'] {
|
|
74
|
-
border-color: var(--material-secondary-text-color);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
:host([active][checked]) [part='radio']::before,
|
|
78
|
-
:host([active]:not([checked])) [part='radio']::before {
|
|
79
|
-
transition-duration: 0.01s, 0.01s;
|
|
80
|
-
transform: scale(0);
|
|
81
|
-
opacity: 0.2;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
:host([focus-ring]) [part='radio']::before {
|
|
85
|
-
transform: scale(2.5);
|
|
86
|
-
transition-duration: 0s;
|
|
87
|
-
opacity: 0.15;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
:host([disabled]) {
|
|
91
|
-
pointer-events: none;
|
|
92
|
-
color: var(--material-disabled-text-color);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
:host([disabled]) ::slotted(label) {
|
|
96
|
-
color: inherit;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
:host([disabled]) [part='radio'] {
|
|
100
|
-
border-color: var(--material-disabled-color);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
:host([disabled]) [part='radio']::after {
|
|
104
|
-
background-color: var(--material-disabled-color);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/* RTL specific styles */
|
|
108
|
-
:host([dir='rtl'][has-label]) ::slotted(label) {
|
|
109
|
-
padding: 4px 0.375em 4px 0.875em;
|
|
110
|
-
}
|
|
111
|
-
`,
|
|
112
|
-
{ moduleId: 'material-radio-button' },
|
|
113
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-material-styles/color.js';
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-material-styles/color.js';
|
|
2
|
-
import { helper } from '@vaadin/vaadin-material-styles/mixins/helper.js';
|
|
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
|
-
|
|
6
|
-
const radioGroup = css`
|
|
7
|
-
:host {
|
|
8
|
-
display: inline-flex;
|
|
9
|
-
position: relative;
|
|
10
|
-
padding-top: 8px;
|
|
11
|
-
margin-bottom: 8px;
|
|
12
|
-
outline: none;
|
|
13
|
-
color: var(--material-body-text-color);
|
|
14
|
-
font-size: var(--material-body-font-size);
|
|
15
|
-
line-height: 24px;
|
|
16
|
-
font-family: var(--material-font-family);
|
|
17
|
-
-webkit-font-smoothing: antialiased;
|
|
18
|
-
-moz-osx-font-smoothing: grayscale;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
:host::before {
|
|
22
|
-
line-height: 32px;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
:host([has-label]) {
|
|
26
|
-
padding-top: 24px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
:host([theme~='vertical']) [part='group-field'] {
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
:host([disabled]) [part='label'] {
|
|
34
|
-
color: var(--material-disabled-text-color);
|
|
35
|
-
-webkit-text-fill-color: var(--material-disabled-text-color);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
:host([focused]:not([invalid])) [part='label'] {
|
|
39
|
-
color: var(--material-primary-text-color);
|
|
40
|
-
}
|
|
41
|
-
`;
|
|
42
|
-
|
|
43
|
-
registerStyles('vaadin-radio-group', [requiredField, helper, radioGroup], { moduleId: 'material-radio-group' });
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/vaadin-radio-button.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/vaadin-radio-group.js';
|
/package/src/{vaadin-radio-button-styles.d.ts → styles/vaadin-radio-button-base-styles.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|