@vaadin/checkbox 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
CHANGED
|
@@ -2,18 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
An input field representing a binary choice.
|
|
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)
|
|
8
|
+
[](https://discord.gg/PHmkCKC)
|
|
6
9
|
|
|
7
10
|
```html
|
|
8
|
-
<vaadin-checkbox
|
|
11
|
+
<vaadin-checkbox label="Checked" checked></vaadin-checkbox>
|
|
12
|
+
<vaadin-checkbox label="Unchecked"></vaadin-checkbox>
|
|
13
|
+
<vaadin-checkbox label="Indeterminate" indeterminate></vaadin-checkbox>
|
|
9
14
|
```
|
|
10
15
|
|
|
16
|
+
[<img src="https://raw.githubusercontent.com/vaadin/web-components/master/packages/checkbox/screenshot.png" width="400" alt="Screenshot of vaadin-checkbox">](https://vaadin.com/docs/latest/ds/components/checkbox)
|
|
17
|
+
|
|
11
18
|
## Installation
|
|
12
19
|
|
|
13
20
|
Install the component:
|
|
14
21
|
|
|
15
22
|
```sh
|
|
16
|
-
npm i @vaadin/checkbox
|
|
23
|
+
npm i @vaadin/checkbox
|
|
17
24
|
```
|
|
18
25
|
|
|
19
26
|
Once installed, import the component in your application:
|
|
@@ -24,9 +31,8 @@ import '@vaadin/checkbox';
|
|
|
24
31
|
|
|
25
32
|
## Themes
|
|
26
33
|
|
|
27
|
-
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes),
|
|
28
|
-
|
|
29
|
-
of the package uses the Lumo theme.
|
|
34
|
+
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes), Lumo and Material.
|
|
35
|
+
The [main entrypoint](https://github.com/vaadin/web-components/blob/master/packages/checkbox/vaadin-checkbox.js) of the package uses the Lumo theme.
|
|
30
36
|
|
|
31
37
|
To use the Material theme, import the component from the `theme/material` folder:
|
|
32
38
|
|
|
@@ -46,9 +52,13 @@ Finally, you can import the un-themed component from the `src` folder to get a m
|
|
|
46
52
|
import '@vaadin/checkbox/src/vaadin-checkbox.js';
|
|
47
53
|
```
|
|
48
54
|
|
|
55
|
+
## Contributing
|
|
56
|
+
|
|
57
|
+
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.
|
|
58
|
+
|
|
49
59
|
## License
|
|
50
60
|
|
|
51
61
|
Apache License 2.0
|
|
52
62
|
|
|
53
|
-
Vaadin collects development time
|
|
63
|
+
Vaadin collects usage statistics at development time to improve this product.
|
|
54
64
|
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",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.1",
|
|
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/component-base": "22.0.
|
|
37
|
-
"@vaadin/field-base": "22.0.
|
|
38
|
-
"@vaadin/vaadin-lumo-styles": "22.0.
|
|
39
|
-
"@vaadin/vaadin-material-styles": "22.0.
|
|
40
|
-
"@vaadin/vaadin-themable-mixin": "22.0.
|
|
36
|
+
"@vaadin/component-base": "^22.0.1",
|
|
37
|
+
"@vaadin/field-base": "^22.0.1",
|
|
38
|
+
"@vaadin/vaadin-lumo-styles": "^22.0.1",
|
|
39
|
+
"@vaadin/vaadin-material-styles": "^22.0.1",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "^22.0.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@esm-bundle/chai": "^4.3.4",
|
|
44
|
-
"@vaadin/testing-helpers": "^0.3.
|
|
44
|
+
"@vaadin/testing-helpers": "^0.3.2",
|
|
45
45
|
"sinon": "^9.2.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "2b0a2bff0369d6020f7cc33ad35506aa2d1f6f68"
|
|
48
48
|
}
|
package/src/vaadin-checkbox.d.ts
CHANGED
|
@@ -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';
|
|
@@ -61,7 +62,7 @@ export interface CheckboxEventMap extends HTMLElementEventMap, CheckboxCustomEve
|
|
|
61
62
|
* @fires {CustomEvent} indeterminate-changed - Fired when the `indeterminate` property changes.
|
|
62
63
|
*/
|
|
63
64
|
declare class Checkbox extends SlotLabelMixin(
|
|
64
|
-
CheckedMixin(DelegateFocusMixin(ActiveMixin(ElementMixin(ThemableMixin(HTMLElement)))))
|
|
65
|
+
CheckedMixin(DelegateFocusMixin(ActiveMixin(ElementMixin(ThemableMixin(ControllerMixin(HTMLElement))))))
|
|
65
66
|
) {
|
|
66
67
|
/**
|
|
67
68
|
* True if the checkbox is in the indeterminate state which means
|
package/src/vaadin-checkbox.js
CHANGED
|
@@ -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
|
|
|
@@ -46,6 +47,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
46
47
|
* @fires {CustomEvent} indeterminate-changed - Fired when the `indeterminate` property changes.
|
|
47
48
|
*
|
|
48
49
|
* @extends HTMLElement
|
|
50
|
+
* @mixes ControllerMixin
|
|
49
51
|
* @mixes ThemableMixin
|
|
50
52
|
* @mixes ElementMixin
|
|
51
53
|
* @mixes ActiveMixin
|
|
@@ -54,7 +56,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
54
56
|
* @mixes SlotLabelMixin
|
|
55
57
|
*/
|
|
56
58
|
class Checkbox extends SlotLabelMixin(
|
|
57
|
-
CheckedMixin(DelegateFocusMixin(ActiveMixin(ElementMixin(ThemableMixin(PolymerElement)))))
|
|
59
|
+
CheckedMixin(DelegateFocusMixin(ActiveMixin(ElementMixin(ThemableMixin(ControllerMixin(PolymerElement))))))
|
|
58
60
|
) {
|
|
59
61
|
static get is() {
|
|
60
62
|
return 'vaadin-checkbox';
|
|
@@ -174,7 +176,7 @@ class Checkbox extends SlotLabelMixin(
|
|
|
174
176
|
this.stateTarget = input;
|
|
175
177
|
})
|
|
176
178
|
);
|
|
177
|
-
this.addController(new
|
|
179
|
+
this.addController(new LabelledInputController(this.inputElement, this._labelNode));
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
/**
|
|
@@ -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-checkbox',
|
|
@@ -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-checkbox',
|