@vaadin/checkbox 24.2.0-dev.e9803eea7 → 24.3.0-alpha1

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/checkbox",
3
- "version": "24.2.0-dev.e9803eea7",
3
+ "version": "24.3.0-alpha1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -39,22 +39,22 @@
39
39
  "dependencies": {
40
40
  "@open-wc/dedupe-mixin": "^1.3.0",
41
41
  "@polymer/polymer": "^3.0.0",
42
- "@vaadin/a11y-base": "24.2.0-dev.e9803eea7",
43
- "@vaadin/component-base": "24.2.0-dev.e9803eea7",
44
- "@vaadin/field-base": "24.2.0-dev.e9803eea7",
45
- "@vaadin/vaadin-lumo-styles": "24.2.0-dev.e9803eea7",
46
- "@vaadin/vaadin-material-styles": "24.2.0-dev.e9803eea7",
47
- "@vaadin/vaadin-themable-mixin": "24.2.0-dev.e9803eea7",
42
+ "@vaadin/a11y-base": "24.3.0-alpha1",
43
+ "@vaadin/component-base": "24.3.0-alpha1",
44
+ "@vaadin/field-base": "24.3.0-alpha1",
45
+ "@vaadin/vaadin-lumo-styles": "24.3.0-alpha1",
46
+ "@vaadin/vaadin-material-styles": "24.3.0-alpha1",
47
+ "@vaadin/vaadin-themable-mixin": "24.3.0-alpha1",
48
48
  "lit": "^2.0.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@esm-bundle/chai": "^4.3.4",
52
- "@vaadin/testing-helpers": "^0.4.3",
52
+ "@vaadin/testing-helpers": "^0.5.0",
53
53
  "sinon": "^13.0.2"
54
54
  },
55
55
  "web-types": [
56
56
  "web-types.json",
57
57
  "web-types.lit.json"
58
58
  ],
59
- "gitHead": "a065b79b9d5a189e457fab312cc8aff0d7f2f910"
59
+ "gitHead": "9ca6f3ca220a777e8eea181a1f5717e39a732240"
60
60
  }
@@ -11,6 +11,11 @@ import { CheckedMixin } from '@vaadin/field-base/src/checked-mixin.js';
11
11
  import { LabelMixin } from '@vaadin/field-base/src/label-mixin.js';
12
12
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
13
13
 
14
+ /**
15
+ * Fired when the `dirty` property changes.
16
+ */
17
+ export type CheckboxDirtyChangedEvent = CustomEvent<{ value: boolean }>;
18
+
14
19
  /**
15
20
  * Fired when the `checked` property changes.
16
21
  */
@@ -22,6 +27,8 @@ export type CheckboxCheckedChangedEvent = CustomEvent<{ value: boolean }>;
22
27
  export type CheckboxIndeterminateChangedEvent = CustomEvent<{ value: boolean }>;
23
28
 
24
29
  export interface CheckboxCustomEventMap {
30
+ 'dirty-changed': CheckboxDirtyChangedEvent;
31
+
25
32
  'checked-changed': CheckboxCheckedChangedEvent;
26
33
 
27
34
  'indeterminate-changed': CheckboxIndeterminateChangedEvent;
@@ -58,6 +65,7 @@ export interface CheckboxEventMap extends HTMLElementEventMap, CheckboxCustomEve
58
65
  *
59
66
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
60
67
  *
68
+ * @fires {CustomEvent} dirty-changed - Fired when the `dirty` property changes.
61
69
  * @fires {CustomEvent} checked-changed - Fired when the `checked` property changes.
62
70
  * @fires {CustomEvent} indeterminate-changed - Fired when the `indeterminate` property changes.
63
71
  */
@@ -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 { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
7
+ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
7
8
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
8
9
  import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
9
10
  import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
@@ -44,6 +45,7 @@ registerStyles('vaadin-checkbox', checkboxStyles, { moduleId: 'vaadin-checkbox-s
44
45
  * @fires {CustomEvent} checked-changed - Fired when the `checked` property changes.
45
46
  * @fires {CustomEvent} indeterminate-changed - Fired when the `indeterminate` property changes.
46
47
  *
48
+ * @customElement
47
49
  * @extends HTMLElement
48
50
  * @mixes CheckboxMixin
49
51
  * @mixes ThemableMixin
@@ -70,8 +72,9 @@ export class Checkbox extends CheckboxMixin(ElementMixin(ThemableMixin(PolymerEl
70
72
  super.ready();
71
73
 
72
74
  this._tooltipController = new TooltipController(this);
75
+ this._tooltipController.setAriaTarget(this.inputElement);
73
76
  this.addController(this._tooltipController);
74
77
  }
75
78
  }
76
79
 
77
- customElements.define(Checkbox.is, Checkbox);
80
+ defineCustomElement(Checkbox);
package/web-types.json ADDED
@@ -0,0 +1,215 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@vaadin/checkbox",
4
+ "version": "24.3.0-alpha1",
5
+ "description-markup": "markdown",
6
+ "contributions": {
7
+ "html": {
8
+ "elements": [
9
+ {
10
+ "name": "vaadin-checkbox",
11
+ "description": "`<vaadin-checkbox>` is an input field representing a binary choice.\n\n```html\n<vaadin-checkbox label=\"I accept the terms and conditions\"></vaadin-checkbox>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n------------|-------------\n`checkbox` | The element representing a stylable custom checkbox.\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n----------------|-------------\n`active` | Set when the checkbox is activated with mouse, touch or the keyboard.\n`checked` | Set when the checkbox is checked.\n`disabled` | Set when the checkbox is disabled.\n`focus-ring` | Set when the checkbox is focused using the keyboard.\n`focused` | Set when the checkbox is focused.\n`indeterminate` | Set when the checkbox is in the indeterminate state.\n`has-label` | Set when the checkbox has a label.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
12
+ "attributes": [
13
+ {
14
+ "name": "disabled",
15
+ "description": "If true, the user cannot interact with this element.",
16
+ "value": {
17
+ "type": [
18
+ "boolean",
19
+ "null",
20
+ "undefined"
21
+ ]
22
+ }
23
+ },
24
+ {
25
+ "name": "value",
26
+ "description": "The value of the field.",
27
+ "value": {
28
+ "type": [
29
+ "string",
30
+ "null",
31
+ "undefined"
32
+ ]
33
+ }
34
+ },
35
+ {
36
+ "name": "dirty",
37
+ "description": "Whether the field is dirty.\n\nThe field is automatically marked as dirty once the user triggers\nan `input` or `change` event. Additionally, the field can be manually\nmarked as dirty by setting the property to `true`.",
38
+ "value": {
39
+ "type": [
40
+ "boolean",
41
+ "null",
42
+ "undefined"
43
+ ]
44
+ }
45
+ },
46
+ {
47
+ "name": "checked",
48
+ "description": "True if the element is checked.",
49
+ "value": {
50
+ "type": [
51
+ "boolean"
52
+ ]
53
+ }
54
+ },
55
+ {
56
+ "name": "autofocus",
57
+ "description": "Specify that this control should have input focus when the page loads.",
58
+ "value": {
59
+ "type": [
60
+ "boolean",
61
+ "null",
62
+ "undefined"
63
+ ]
64
+ }
65
+ },
66
+ {
67
+ "name": "label",
68
+ "description": "The label text for the input node.\nWhen no light dom defined via [slot=label], this value will be used.",
69
+ "value": {
70
+ "type": [
71
+ "string",
72
+ "null",
73
+ "undefined"
74
+ ]
75
+ }
76
+ },
77
+ {
78
+ "name": "indeterminate",
79
+ "description": "True if the checkbox is in the indeterminate state which means\nit is not possible to say whether it is checked or unchecked.\nThe state is reset once the user switches the checkbox by hand.\n\nhttps://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#Indeterminate_state_checkboxes",
80
+ "value": {
81
+ "type": [
82
+ "boolean"
83
+ ]
84
+ }
85
+ },
86
+ {
87
+ "name": "name",
88
+ "description": "The name of the checkbox.",
89
+ "value": {
90
+ "type": [
91
+ "string"
92
+ ]
93
+ }
94
+ },
95
+ {
96
+ "name": "theme",
97
+ "description": "The theme variants to apply to the component.",
98
+ "value": {
99
+ "type": [
100
+ "string",
101
+ "null",
102
+ "undefined"
103
+ ]
104
+ }
105
+ }
106
+ ],
107
+ "js": {
108
+ "properties": [
109
+ {
110
+ "name": "disabled",
111
+ "description": "If true, the user cannot interact with this element.",
112
+ "value": {
113
+ "type": [
114
+ "boolean",
115
+ "null",
116
+ "undefined"
117
+ ]
118
+ }
119
+ },
120
+ {
121
+ "name": "value",
122
+ "description": "The value of the field.",
123
+ "value": {
124
+ "type": [
125
+ "string",
126
+ "null",
127
+ "undefined"
128
+ ]
129
+ }
130
+ },
131
+ {
132
+ "name": "dirty",
133
+ "description": "Whether the field is dirty.\n\nThe field is automatically marked as dirty once the user triggers\nan `input` or `change` event. Additionally, the field can be manually\nmarked as dirty by setting the property to `true`.",
134
+ "value": {
135
+ "type": [
136
+ "boolean",
137
+ "null",
138
+ "undefined"
139
+ ]
140
+ }
141
+ },
142
+ {
143
+ "name": "checked",
144
+ "description": "True if the element is checked.",
145
+ "value": {
146
+ "type": [
147
+ "boolean"
148
+ ]
149
+ }
150
+ },
151
+ {
152
+ "name": "autofocus",
153
+ "description": "Specify that this control should have input focus when the page loads.",
154
+ "value": {
155
+ "type": [
156
+ "boolean",
157
+ "null",
158
+ "undefined"
159
+ ]
160
+ }
161
+ },
162
+ {
163
+ "name": "label",
164
+ "description": "The label text for the input node.\nWhen no light dom defined via [slot=label], this value will be used.",
165
+ "value": {
166
+ "type": [
167
+ "string",
168
+ "null",
169
+ "undefined"
170
+ ]
171
+ }
172
+ },
173
+ {
174
+ "name": "indeterminate",
175
+ "description": "True if the checkbox is in the indeterminate state which means\nit is not possible to say whether it is checked or unchecked.\nThe state is reset once the user switches the checkbox by hand.\n\nhttps://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#Indeterminate_state_checkboxes",
176
+ "value": {
177
+ "type": [
178
+ "boolean"
179
+ ]
180
+ }
181
+ },
182
+ {
183
+ "name": "name",
184
+ "description": "The name of the checkbox.",
185
+ "value": {
186
+ "type": [
187
+ "string"
188
+ ]
189
+ }
190
+ }
191
+ ],
192
+ "events": [
193
+ {
194
+ "name": "value-changed",
195
+ "description": "Fired when the `value` property changes."
196
+ },
197
+ {
198
+ "name": "dirty-changed",
199
+ "description": "Fired when the `dirty` property changes."
200
+ },
201
+ {
202
+ "name": "checked-changed",
203
+ "description": "Fired when the `checked` property changes."
204
+ },
205
+ {
206
+ "name": "indeterminate-changed",
207
+ "description": "Fired when the `indeterminate` property changes."
208
+ }
209
+ ]
210
+ }
211
+ }
212
+ ]
213
+ }
214
+ }
215
+ }
@@ -0,0 +1,111 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@vaadin/checkbox",
4
+ "version": "24.3.0-alpha1",
5
+ "description-markup": "markdown",
6
+ "framework": "lit",
7
+ "framework-config": {
8
+ "enable-when": {
9
+ "node-packages": [
10
+ "lit"
11
+ ]
12
+ }
13
+ },
14
+ "contributions": {
15
+ "html": {
16
+ "elements": [
17
+ {
18
+ "name": "vaadin-checkbox",
19
+ "description": "`<vaadin-checkbox>` is an input field representing a binary choice.\n\n```html\n<vaadin-checkbox label=\"I accept the terms and conditions\"></vaadin-checkbox>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n------------|-------------\n`checkbox` | The element representing a stylable custom checkbox.\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n----------------|-------------\n`active` | Set when the checkbox is activated with mouse, touch or the keyboard.\n`checked` | Set when the checkbox is checked.\n`disabled` | Set when the checkbox is disabled.\n`focus-ring` | Set when the checkbox is focused using the keyboard.\n`focused` | Set when the checkbox is focused.\n`indeterminate` | Set when the checkbox is in the indeterminate state.\n`has-label` | Set when the checkbox has a label.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
20
+ "extension": true,
21
+ "attributes": [
22
+ {
23
+ "name": "?disabled",
24
+ "description": "If true, the user cannot interact with this element.",
25
+ "value": {
26
+ "kind": "expression"
27
+ }
28
+ },
29
+ {
30
+ "name": "?dirty",
31
+ "description": "Whether the field is dirty.\n\nThe field is automatically marked as dirty once the user triggers\nan `input` or `change` event. Additionally, the field can be manually\nmarked as dirty by setting the property to `true`.",
32
+ "value": {
33
+ "kind": "expression"
34
+ }
35
+ },
36
+ {
37
+ "name": "?checked",
38
+ "description": "True if the element is checked.",
39
+ "value": {
40
+ "kind": "expression"
41
+ }
42
+ },
43
+ {
44
+ "name": "?autofocus",
45
+ "description": "Specify that this control should have input focus when the page loads.",
46
+ "value": {
47
+ "kind": "expression"
48
+ }
49
+ },
50
+ {
51
+ "name": "?indeterminate",
52
+ "description": "True if the checkbox is in the indeterminate state which means\nit is not possible to say whether it is checked or unchecked.\nThe state is reset once the user switches the checkbox by hand.\n\nhttps://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#Indeterminate_state_checkboxes",
53
+ "value": {
54
+ "kind": "expression"
55
+ }
56
+ },
57
+ {
58
+ "name": ".value",
59
+ "description": "The value of the field.",
60
+ "value": {
61
+ "kind": "expression"
62
+ }
63
+ },
64
+ {
65
+ "name": ".label",
66
+ "description": "The label text for the input node.\nWhen no light dom defined via [slot=label], this value will be used.",
67
+ "value": {
68
+ "kind": "expression"
69
+ }
70
+ },
71
+ {
72
+ "name": ".name",
73
+ "description": "The name of the checkbox.",
74
+ "value": {
75
+ "kind": "expression"
76
+ }
77
+ },
78
+ {
79
+ "name": "@value-changed",
80
+ "description": "Fired when the `value` property changes.",
81
+ "value": {
82
+ "kind": "expression"
83
+ }
84
+ },
85
+ {
86
+ "name": "@dirty-changed",
87
+ "description": "Fired when the `dirty` property changes.",
88
+ "value": {
89
+ "kind": "expression"
90
+ }
91
+ },
92
+ {
93
+ "name": "@checked-changed",
94
+ "description": "Fired when the `checked` property changes.",
95
+ "value": {
96
+ "kind": "expression"
97
+ }
98
+ },
99
+ {
100
+ "name": "@indeterminate-changed",
101
+ "description": "Fired when the `indeterminate` property changes.",
102
+ "value": {
103
+ "kind": "expression"
104
+ }
105
+ }
106
+ ]
107
+ }
108
+ ]
109
+ }
110
+ }
111
+ }