@vaadin/checkbox 25.2.4 → 25.2.5

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.
@@ -256,7 +256,6 @@
256
256
  },
257
257
  "description": "The value of the field.",
258
258
  "attribute": "value",
259
- "default": "'on'",
260
259
  "inheritedFrom": {
261
260
  "name": "InputMixin",
262
261
  "package": "@vaadin/field-base/src/input-mixin.js"
@@ -712,18 +711,6 @@
712
711
  "package": "@vaadin/field-base/src/validate-mixin.js"
713
712
  }
714
713
  },
715
- {
716
- "kind": "field",
717
- "name": "tabindex",
718
- "type": {
719
- "text": "number"
720
- },
721
- "default": "0",
722
- "inheritedFrom": {
723
- "name": "CheckboxMixin",
724
- "module": "src/vaadin-checkbox-mixin.js"
725
- }
726
- },
727
714
  {
728
715
  "kind": "method",
729
716
  "name": "validate",
@@ -741,13 +728,15 @@
741
728
  {
742
729
  "kind": "field",
743
730
  "name": "value",
731
+ "privacy": "public",
744
732
  "type": {
745
733
  "text": "string"
746
734
  },
747
- "default": "'on'",
735
+ "description": "The value of the field.",
736
+ "attribute": "value",
748
737
  "inheritedFrom": {
749
- "name": "CheckboxMixin",
750
- "module": "src/vaadin-checkbox-mixin.js"
738
+ "name": "InputMixin",
739
+ "package": "@vaadin/field-base/src/input-mixin.js"
751
740
  }
752
741
  }
753
742
  ],
@@ -985,18 +974,6 @@
985
974
  "package": "@vaadin/field-base/src/validate-mixin.js"
986
975
  }
987
976
  },
988
- {
989
- "name": "tabindex",
990
- "type": {
991
- "text": "number"
992
- },
993
- "description": "Indicates whether the element can be focused and where it participates in sequential keyboard navigation.",
994
- "fieldName": "tabindex",
995
- "inheritedFrom": {
996
- "name": "TabindexMixin",
997
- "package": "@vaadin/a11y-base/src/tabindex-mixin.js"
998
- }
999
- },
1000
977
  {
1001
978
  "name": "value",
1002
979
  "type": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/checkbox",
3
- "version": "25.2.4",
3
+ "version": "25.2.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,18 +35,18 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@vaadin/a11y-base": "~25.2.4",
39
- "@vaadin/component-base": "~25.2.4",
40
- "@vaadin/field-base": "~25.2.4",
41
- "@vaadin/vaadin-themable-mixin": "~25.2.4",
38
+ "@vaadin/a11y-base": "~25.2.5",
39
+ "@vaadin/component-base": "~25.2.5",
40
+ "@vaadin/field-base": "~25.2.5",
41
+ "@vaadin/vaadin-themable-mixin": "~25.2.5",
42
42
  "lit": "^3.0.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@vaadin/aura": "~25.2.4",
46
- "@vaadin/chai-plugins": "~25.2.4",
47
- "@vaadin/test-runner-commands": "~25.2.4",
45
+ "@vaadin/aura": "~25.2.5",
46
+ "@vaadin/chai-plugins": "~25.2.5",
47
+ "@vaadin/test-runner-commands": "~25.2.5",
48
48
  "@vaadin/testing-helpers": "^2.0.0",
49
- "@vaadin/vaadin-lumo-styles": "~25.2.4",
49
+ "@vaadin/vaadin-lumo-styles": "~25.2.5",
50
50
  "sinon": "^22.0.0"
51
51
  },
52
52
  "customElements": "custom-elements.json",
@@ -54,5 +54,5 @@
54
54
  "web-types.json",
55
55
  "web-types.lit.json"
56
56
  ],
57
- "gitHead": "8671e6394dd539f76cd5e3ec885c7abf133ce3e7"
57
+ "gitHead": "bfaf51d71619f34c0b00b326e6426f1cd9f7b2f5"
58
58
  }
@@ -77,12 +77,18 @@ export const CheckboxMixin = (superclass) =>
77
77
 
78
78
  this._boundOnInputClick = this._onInputClick.bind(this);
79
79
 
80
- // Set the string "on" as the default value for the checkbox following the HTML specification:
81
- // https://html.spec.whatwg.org/multipage/input.html#dom-input-value-default-on
80
+ /**
81
+ * Set the string "on" as the default value for the checkbox following the HTML specification:
82
+ * https://html.spec.whatwg.org/multipage/input.html#dom-input-value-default-on
83
+ * @internal to not document it in CEM
84
+ */
82
85
  this.value = 'on';
83
86
 
84
- // Set tabindex to 0 by default to not lose focus on click in Safari
85
- // See https://github.com/vaadin/web-components/pull/6780
87
+ /**
88
+ * Set tabindex to 0 by default to not lose focus on click in Safari
89
+ * See https://github.com/vaadin/web-components/pull/6780
90
+ * @internal to not document it in CEM
91
+ */
86
92
  this.tabindex = 0;
87
93
  }
88
94
 
@@ -119,9 +125,8 @@ export const CheckboxMixin = (superclass) =>
119
125
  }
120
126
 
121
127
  /**
122
- * Override method inherited from `ActiveMixin` to prevent setting `active`
123
- * attribute when readonly, or when clicking a link placed inside the label,
124
- * or when clicking slotted helper or error message element.
128
+ * Override method inherited from `ActiveMixin` to only set the `active`
129
+ * attribute for clicks that actually toggle the checked state.
125
130
  *
126
131
  * @param {Event} event
127
132
  * @return {boolean}
@@ -129,12 +134,14 @@ export const CheckboxMixin = (superclass) =>
129
134
  * @override
130
135
  */
131
136
  _shouldSetActive(event) {
132
- if (
133
- this.readonly ||
134
- event.target.localName === 'a' ||
135
- event.target === this._helperNode ||
136
- event.target === this._errorNode
137
- ) {
137
+ const [target] = event.composedPath();
138
+
139
+ const togglesChecked =
140
+ target === this.inputElement ||
141
+ target.part.contains('required-indicator') ||
142
+ (this._labelNode.contains(target) && !target.closest('a'));
143
+
144
+ if (this.readonly || !togglesChecked) {
138
145
  return false;
139
146
  }
140
147
 
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/checkbox",
4
- "version": "25.2.4",
4
+ "version": "25.2.5",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -136,15 +136,6 @@
136
136
  ]
137
137
  }
138
138
  },
139
- {
140
- "name": "tabindex",
141
- "description": "Indicates whether the element can be focused and where it participates in sequential keyboard navigation.",
142
- "value": {
143
- "type": [
144
- "number"
145
- ]
146
- }
147
- },
148
139
  {
149
140
  "name": "theme",
150
141
  "description": "The theme variants to apply to the component.",
@@ -294,18 +285,9 @@
294
285
  ]
295
286
  }
296
287
  },
297
- {
298
- "name": "tabindex",
299
- "description": "",
300
- "value": {
301
- "type": [
302
- "number"
303
- ]
304
- }
305
- },
306
288
  {
307
289
  "name": "value",
308
- "description": "",
290
+ "description": "The value of the field.",
309
291
  "value": {
310
292
  "type": [
311
293
  "string"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/checkbox",
4
- "version": "25.2.4",
4
+ "version": "25.2.5",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -117,16 +117,9 @@
117
117
  "kind": "expression"
118
118
  }
119
119
  },
120
- {
121
- "name": ".tabindex",
122
- "description": "",
123
- "value": {
124
- "kind": "expression"
125
- }
126
- },
127
120
  {
128
121
  "name": ".value",
129
- "description": "",
122
+ "description": "The value of the field.",
130
123
  "value": {
131
124
  "kind": "expression"
132
125
  }