@vaadin/checkbox 25.3.0-alpha1 → 25.3.0-alpha2

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.
@@ -147,16 +147,6 @@
147
147
  "package": "@vaadin/field-base/src/field-mixin.js"
148
148
  }
149
149
  },
150
- {
151
- "kind": "field",
152
- "name": "indeterminate",
153
- "privacy": "public",
154
- "type": {
155
- "text": "boolean"
156
- },
157
- "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",
158
- "attribute": "indeterminate"
159
- },
160
150
  {
161
151
  "kind": "field",
162
152
  "name": "invalid",
@@ -348,14 +338,6 @@
348
338
  "package": "@vaadin/field-base/src/field-mixin.js"
349
339
  }
350
340
  },
351
- {
352
- "name": "indeterminate",
353
- "type": {
354
- "text": "boolean"
355
- },
356
- "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",
357
- "fieldName": "indeterminate"
358
- },
359
341
  {
360
342
  "name": "invalid",
361
343
  "type": {
@@ -621,12 +603,8 @@
621
603
  "type": {
622
604
  "text": "boolean"
623
605
  },
624
- "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",
625
- "attribute": "indeterminate",
626
- "inheritedFrom": {
627
- "name": "CheckboxMixin",
628
- "module": "src/vaadin-checkbox-mixin.js"
629
- }
606
+ "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/Reference/Elements/input/checkbox#indeterminate_state_checkboxes",
607
+ "attribute": "indeterminate"
630
608
  },
631
609
  {
632
610
  "kind": "field",
@@ -788,34 +766,6 @@
788
766
  "name": "validated"
789
767
  }
790
768
  ],
791
- "mixins": [
792
- {
793
- "name": "CheckboxMixin",
794
- "module": "src/vaadin-checkbox-mixin.js"
795
- },
796
- {
797
- "name": "ElementMixin",
798
- "package": "@vaadin/component-base/src/element-mixin.js"
799
- },
800
- {
801
- "name": "ThemableMixin",
802
- "package": "@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js"
803
- },
804
- {
805
- "name": "PolylitMixin",
806
- "package": "@vaadin/component-base/src/polylit-mixin.js"
807
- },
808
- {
809
- "name": "LumoInjectionMixin",
810
- "package": "@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js"
811
- }
812
- ],
813
- "superclass": {
814
- "name": "LitElement",
815
- "package": "lit"
816
- },
817
- "tagName": "vaadin-checkbox",
818
- "customElement": true,
819
769
  "attributes": [
820
770
  {
821
771
  "name": "accessible-name",
@@ -906,12 +856,8 @@
906
856
  "type": {
907
857
  "text": "boolean"
908
858
  },
909
- "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",
910
- "fieldName": "indeterminate",
911
- "inheritedFrom": {
912
- "name": "CheckboxMixin",
913
- "module": "src/vaadin-checkbox-mixin.js"
914
- }
859
+ "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/Reference/Elements/input/checkbox#indeterminate_state_checkboxes",
860
+ "fieldName": "indeterminate"
915
861
  },
916
862
  {
917
863
  "name": "invalid",
@@ -1009,7 +955,35 @@
1009
955
  "package": "@vaadin/field-base/src/input-mixin.js"
1010
956
  }
1011
957
  }
1012
- ]
958
+ ],
959
+ "mixins": [
960
+ {
961
+ "name": "CheckboxMixin",
962
+ "module": "src/vaadin-checkbox-mixin.js"
963
+ },
964
+ {
965
+ "name": "ElementMixin",
966
+ "package": "@vaadin/component-base/src/element-mixin.js"
967
+ },
968
+ {
969
+ "name": "ThemableMixin",
970
+ "package": "@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js"
971
+ },
972
+ {
973
+ "name": "PolylitMixin",
974
+ "package": "@vaadin/component-base/src/polylit-mixin.js"
975
+ },
976
+ {
977
+ "name": "LumoInjectionMixin",
978
+ "package": "@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js"
979
+ }
980
+ ],
981
+ "superclass": {
982
+ "name": "LitElement",
983
+ "package": "lit"
984
+ },
985
+ "tagName": "vaadin-checkbox",
986
+ "customElement": true
1013
987
  }
1014
988
  ],
1015
989
  "exports": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/checkbox",
3
- "version": "25.3.0-alpha1",
3
+ "version": "25.3.0-alpha2",
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.3.0-alpha1",
39
- "@vaadin/component-base": "25.3.0-alpha1",
40
- "@vaadin/field-base": "25.3.0-alpha1",
41
- "@vaadin/vaadin-themable-mixin": "25.3.0-alpha1",
38
+ "@vaadin/a11y-base": "25.3.0-alpha2",
39
+ "@vaadin/component-base": "25.3.0-alpha2",
40
+ "@vaadin/field-base": "25.3.0-alpha2",
41
+ "@vaadin/vaadin-themable-mixin": "25.3.0-alpha2",
42
42
  "lit": "^3.0.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@vaadin/aura": "25.3.0-alpha1",
46
- "@vaadin/chai-plugins": "25.3.0-alpha1",
47
- "@vaadin/test-runner-commands": "25.3.0-alpha1",
45
+ "@vaadin/aura": "25.3.0-alpha2",
46
+ "@vaadin/chai-plugins": "25.3.0-alpha2",
47
+ "@vaadin/test-runner-commands": "25.3.0-alpha2",
48
48
  "@vaadin/testing-helpers": "^2.0.0",
49
- "@vaadin/vaadin-lumo-styles": "25.3.0-alpha1",
49
+ "@vaadin/vaadin-lumo-styles": "25.3.0-alpha2",
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": "5824d54c995945aafd50d30edc2cb763a58a18b6"
57
+ "gitHead": "52eba6153ecf8bfaae44bcb727595e77d90b963c"
58
58
  }
@@ -38,15 +38,6 @@ export declare function CheckboxMixin<T extends Constructor<HTMLElement>>(
38
38
  T;
39
39
 
40
40
  export declare class CheckboxMixinClass {
41
- /**
42
- * True if the checkbox is in the indeterminate state which means
43
- * it is not possible to say whether it is checked or unchecked.
44
- * The state is reset once the user switches the checkbox by hand.
45
- *
46
- * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#Indeterminate_state_checkboxes
47
- */
48
- indeterminate: boolean;
49
-
50
41
  /**
51
42
  * The name of the checkbox.
52
43
  */
@@ -20,20 +20,6 @@ export const CheckboxMixin = (superclass) =>
20
20
  ) {
21
21
  static get properties() {
22
22
  return {
23
- /**
24
- * True if the checkbox is in the indeterminate state which means
25
- * it is not possible to say whether it is checked or unchecked.
26
- * The state is reset once the user switches the checkbox by hand.
27
- *
28
- * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#Indeterminate_state_checkboxes
29
- */
30
- indeterminate: {
31
- type: Boolean,
32
- notify: true,
33
- value: false,
34
- reflectToAttribute: true,
35
- },
36
-
37
23
  /**
38
24
  * The name of the checkbox.
39
25
  */
@@ -60,11 +46,6 @@ export const CheckboxMixin = (superclass) =>
60
46
  return ['__readonlyChanged(readonly, inputElement)'];
61
47
  }
62
48
 
63
- /** @override */
64
- static get delegateProps() {
65
- return [...super.delegateProps, 'indeterminate'];
66
- }
67
-
68
49
  /** @override */
69
50
  static get delegateAttrs() {
70
51
  return [...super.delegateAttrs, 'name', 'invalid', 'required'];
@@ -187,22 +168,6 @@ export const CheckboxMixin = (superclass) =>
187
168
  }
188
169
  }
189
170
 
190
- /**
191
- * Override method inherited from `CheckedMixin` to reset
192
- * `indeterminate` state checkbox is toggled by the user.
193
- *
194
- * @param {boolean} checked
195
- * @protected
196
- * @override
197
- */
198
- _toggleChecked(checked) {
199
- if (this.indeterminate) {
200
- this.indeterminate = false;
201
- }
202
-
203
- super._toggleChecked(checked);
204
- }
205
-
206
171
  /**
207
172
  * @override
208
173
  * @return {boolean}
@@ -120,6 +120,15 @@ export interface CheckboxEventMap extends HTMLElementEventMap, CheckboxCustomEve
120
120
  * @fires {CustomEvent} validated - Fired whenever the field is validated.
121
121
  */
122
122
  declare class Checkbox extends CheckboxMixin(ElementMixin(ThemableMixin(HTMLElement))) {
123
+ /**
124
+ * True if the checkbox is in the indeterminate state which means
125
+ * it is not possible to say whether it is checked or unchecked.
126
+ * The state is reset once the user switches the checkbox by hand.
127
+ *
128
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/checkbox#indeterminate_state_checkboxes
129
+ */
130
+ indeterminate: boolean;
131
+
123
132
  addEventListener<K extends keyof CheckboxEventMap>(
124
133
  type: K,
125
134
  listener: (this: Checkbox, ev: CheckboxEventMap[K]) => void,
@@ -96,6 +96,29 @@ export class Checkbox extends CheckboxMixin(ElementMixin(ThemableMixin(PolylitMi
96
96
  return checkboxStyles;
97
97
  }
98
98
 
99
+ static get properties() {
100
+ return {
101
+ /**
102
+ * True if the checkbox is in the indeterminate state which means
103
+ * it is not possible to say whether it is checked or unchecked.
104
+ * The state is reset once the user switches the checkbox by hand.
105
+ *
106
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/checkbox#indeterminate_state_checkboxes
107
+ */
108
+ indeterminate: {
109
+ type: Boolean,
110
+ notify: true,
111
+ value: false,
112
+ reflectToAttribute: true,
113
+ },
114
+ };
115
+ }
116
+
117
+ /** @override */
118
+ static get delegateProps() {
119
+ return [...super.delegateProps, 'indeterminate'];
120
+ }
121
+
99
122
  /** @protected */
100
123
  render() {
101
124
  return html`
@@ -125,6 +148,22 @@ export class Checkbox extends CheckboxMixin(ElementMixin(ThemableMixin(PolylitMi
125
148
  this._tooltipController.setAriaTarget(this.inputElement);
126
149
  this.addController(this._tooltipController);
127
150
  }
151
+
152
+ /**
153
+ * Override method inherited from `CheckedMixin` to reset
154
+ * `indeterminate` when the checkbox is toggled by the user.
155
+ *
156
+ * @param {boolean} checked
157
+ * @protected
158
+ * @override
159
+ */
160
+ _toggleChecked(checked) {
161
+ if (this.indeterminate) {
162
+ this.indeterminate = false;
163
+ }
164
+
165
+ super._toggleChecked(checked);
166
+ }
128
167
  }
129
168
 
130
169
  defineCustomElement(Checkbox);
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.3.0-alpha1",
4
+ "version": "25.3.0-alpha2",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -75,7 +75,7 @@
75
75
  },
76
76
  {
77
77
  "name": "indeterminate",
78
- "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",
78
+ "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/Reference/Elements/input/checkbox#indeterminate_state_checkboxes",
79
79
  "value": {
80
80
  "type": [
81
81
  "boolean"
@@ -233,7 +233,7 @@
233
233
  },
234
234
  {
235
235
  "name": "indeterminate",
236
- "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",
236
+ "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/Reference/Elements/input/checkbox#indeterminate_state_checkboxes",
237
237
  "value": {
238
238
  "type": [
239
239
  "boolean"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/checkbox",
4
- "version": "25.3.0-alpha1",
4
+ "version": "25.3.0-alpha2",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -70,7 +70,7 @@
70
70
  },
71
71
  {
72
72
  "name": "?indeterminate",
73
- "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",
73
+ "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/Reference/Elements/input/checkbox#indeterminate_state_checkboxes",
74
74
  "value": {
75
75
  "kind": "expression"
76
76
  }