@vaadin/checkbox-group 22.0.0-alpha7 → 22.0.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/README.md
CHANGED
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
A web component that allows the user to choose several items from a group of binary choices.
|
|
4
4
|
|
|
5
|
-
[Live Demo ↗](https://vaadin.com/docs/latest/ds/components/checkbox)
|
|
5
|
+
[Documentation + Live Demo ↗](https://vaadin.com/docs/latest/ds/components/checkbox)
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@vaadin/checkbox-group)
|
|
8
|
+
[](https://discord.gg/PHmkCKC)
|
|
6
9
|
|
|
7
10
|
```html
|
|
8
11
|
<vaadin-checkbox-group label="Export data">
|
|
9
|
-
<vaadin-checkbox value="0"
|
|
10
|
-
<vaadin-checkbox value="1"
|
|
11
|
-
<vaadin-checkbox value="2"
|
|
12
|
-
<vaadin-checkbox value="3"
|
|
12
|
+
<vaadin-checkbox value="0" label="Order ID"></vaadin-checkbox>
|
|
13
|
+
<vaadin-checkbox value="1" label="Product name"></vaadin-checkbox>
|
|
14
|
+
<vaadin-checkbox value="2" label="Customer"></vaadin-checkbox>
|
|
15
|
+
<vaadin-checkbox value="3" label="Status"></vaadin-checkbox>
|
|
13
16
|
</vaadin-checkbox-group>
|
|
14
17
|
```
|
|
15
18
|
|
|
@@ -18,7 +21,7 @@ A web component that allows the user to choose several items from a group of bin
|
|
|
18
21
|
Install the component:
|
|
19
22
|
|
|
20
23
|
```sh
|
|
21
|
-
npm i @vaadin/checkbox-group
|
|
24
|
+
npm i @vaadin/checkbox-group
|
|
22
25
|
```
|
|
23
26
|
|
|
24
27
|
Once installed, import the component in your application:
|
|
@@ -29,9 +32,8 @@ import '@vaadin/checkbox-group';
|
|
|
29
32
|
|
|
30
33
|
## Themes
|
|
31
34
|
|
|
32
|
-
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes),
|
|
33
|
-
|
|
34
|
-
of the package uses the Lumo theme.
|
|
35
|
+
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes), Lumo and Material.
|
|
36
|
+
The [main entrypoint](https://github.com/vaadin/web-components/blob/master/packages/checkbox-group/vaadin-checkbox-group.js) of the package uses the Lumo theme.
|
|
35
37
|
|
|
36
38
|
To use the Material theme, import the component from the `theme/material` folder:
|
|
37
39
|
|
|
@@ -51,9 +53,13 @@ Finally, you can import the un-themed component from the `src` folder to get a m
|
|
|
51
53
|
import '@vaadin/checkbox-group/src/vaadin-checkbox-group.js';
|
|
52
54
|
```
|
|
53
55
|
|
|
56
|
+
## Contributing
|
|
57
|
+
|
|
58
|
+
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.
|
|
59
|
+
|
|
54
60
|
## License
|
|
55
61
|
|
|
56
62
|
Apache License 2.0
|
|
57
63
|
|
|
58
|
-
Vaadin collects development time
|
|
64
|
+
Vaadin collects usage statistics at development time to improve this product.
|
|
59
65
|
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/checkbox-group",
|
|
3
|
-
"version": "22.0.0-
|
|
3
|
+
"version": "22.0.0-beta2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@polymer/polymer": "^3.0.0",
|
|
36
|
-
"@vaadin/checkbox": "22.0.0-
|
|
37
|
-
"@vaadin/component-base": "22.0.0-
|
|
38
|
-
"@vaadin/vaadin-lumo-styles": "22.0.0-
|
|
39
|
-
"@vaadin/vaadin-material-styles": "22.0.0-
|
|
40
|
-
"@vaadin/vaadin-themable-mixin": "22.0.0-
|
|
36
|
+
"@vaadin/checkbox": "22.0.0-beta2",
|
|
37
|
+
"@vaadin/component-base": "22.0.0-beta2",
|
|
38
|
+
"@vaadin/vaadin-lumo-styles": "22.0.0-beta2",
|
|
39
|
+
"@vaadin/vaadin-material-styles": "22.0.0-beta2",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "22.0.0-beta2"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@esm-bundle/chai": "^4.3.4",
|
|
44
44
|
"@vaadin/testing-helpers": "^0.3.0",
|
|
45
45
|
"sinon": "^9.2.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "f13833683e6667f6ca6678452db14aa6b7eac4a4"
|
|
48
48
|
}
|
|
@@ -32,9 +32,9 @@ export interface CheckboxGroupEventMap extends HTMLElementEventMap, CheckboxGrou
|
|
|
32
32
|
*
|
|
33
33
|
* ```html
|
|
34
34
|
* <vaadin-checkbox-group label="Preferred language of contact:">
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* <vaadin-checkbox value="en" label="English"></vaadin-checkbox>
|
|
36
|
+
* <vaadin-checkbox value="fr" label="Français"></vaadin-checkbox>
|
|
37
|
+
* <vaadin-checkbox value="de" label="Deutsch"></vaadin-checkbox>
|
|
38
38
|
* </vaadin-checkbox-group>
|
|
39
39
|
* ```
|
|
40
40
|
*
|
|
@@ -3,23 +3,23 @@
|
|
|
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
|
+
import { Checkbox } from '@vaadin/checkbox/src/vaadin-checkbox.js';
|
|
8
9
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
10
|
import { DisabledMixin } from '@vaadin/component-base/src/disabled-mixin.js';
|
|
10
11
|
import { FocusMixin } from '@vaadin/component-base/src/focus-mixin.js';
|
|
11
12
|
import { FieldMixin } from '@vaadin/field-base/src/field-mixin.js';
|
|
12
13
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
-
import { Checkbox } from '@vaadin/checkbox/src/vaadin-checkbox.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* `<vaadin-checkbox-group>` is a web component that allows the user to choose several items from a group of binary choices.
|
|
17
17
|
*
|
|
18
18
|
* ```html
|
|
19
19
|
* <vaadin-checkbox-group label="Preferred language of contact:">
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* <vaadin-checkbox value="en" label="English"></vaadin-checkbox>
|
|
21
|
+
* <vaadin-checkbox value="fr" label="Français"></vaadin-checkbox>
|
|
22
|
+
* <vaadin-checkbox value="de" label="Deutsch"></vaadin-checkbox>
|
|
23
23
|
* </vaadin-checkbox-group>
|
|
24
24
|
* ```
|
|
25
25
|
*
|
|
@@ -84,6 +84,7 @@ class CheckboxGroup extends FieldMixin(FocusMixin(DisabledMixin(DirMixin(Themabl
|
|
|
84
84
|
.vaadin-group-field-container {
|
|
85
85
|
display: flex;
|
|
86
86
|
flex-direction: column;
|
|
87
|
+
width: 100%;
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
:host(:not([has-label])) [part='label'] {
|
|
@@ -160,6 +161,15 @@ class CheckboxGroup extends FieldMixin(FocusMixin(DisabledMixin(DirMixin(Themabl
|
|
|
160
161
|
});
|
|
161
162
|
}
|
|
162
163
|
|
|
164
|
+
/**
|
|
165
|
+
* @return {string}
|
|
166
|
+
* @override
|
|
167
|
+
* @protected
|
|
168
|
+
*/
|
|
169
|
+
get _ariaAttr() {
|
|
170
|
+
return 'aria-labelledby';
|
|
171
|
+
}
|
|
172
|
+
|
|
163
173
|
/**
|
|
164
174
|
* Override method inherited from `ValidateMixin`
|
|
165
175
|
* to validate the value array.
|
|
@@ -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 checkboxGroup = css`
|
|
11
11
|
:host {
|
|
@@ -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 checkboxGroup = css`
|
|
7
7
|
:host {
|