@vaadin/checkbox 23.2.16 → 23.2.17

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
@@ -13,7 +13,7 @@ An input field representing a binary choice.
13
13
  <vaadin-checkbox label="Indeterminate" indeterminate></vaadin-checkbox>
14
14
  ```
15
15
 
16
- [<img src="https://raw.githubusercontent.com/vaadin/web-components/main/packages/checkbox/screenshot.png" width="400" alt="Screenshot of vaadin-checkbox">](https://vaadin.com/docs/latest/components/checkbox)
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/components/checkbox)
17
17
 
18
18
  ## Installation
19
19
 
@@ -32,7 +32,7 @@ import '@vaadin/checkbox';
32
32
  ## Themes
33
33
 
34
34
  Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
35
- The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/checkbox/vaadin-checkbox.js) of the package uses the Lumo theme.
35
+ The [main entrypoint](https://github.com/vaadin/web-components/blob/master/packages/checkbox/vaadin-checkbox.js) of the package uses the Lumo theme.
36
36
 
37
37
  To use the Material theme, import the component from the `theme/material` folder:
38
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/checkbox",
3
- "version": "23.2.16",
3
+ "version": "23.2.17",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,20 +36,20 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/component-base": "~23.2.16",
40
- "@vaadin/field-base": "~23.2.16",
41
- "@vaadin/vaadin-lumo-styles": "~23.2.16",
42
- "@vaadin/vaadin-material-styles": "~23.2.16",
43
- "@vaadin/vaadin-themable-mixin": "~23.2.16"
39
+ "@vaadin/component-base": "~23.2.17",
40
+ "@vaadin/field-base": "~23.2.17",
41
+ "@vaadin/vaadin-lumo-styles": "~23.2.17",
42
+ "@vaadin/vaadin-material-styles": "~23.2.17",
43
+ "@vaadin/vaadin-themable-mixin": "~23.2.17"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@esm-bundle/chai": "^4.3.4",
47
- "@vaadin/testing-helpers": "^0.4.0",
47
+ "@vaadin/testing-helpers": "^0.3.2",
48
48
  "sinon": "^13.0.2"
49
49
  },
50
50
  "web-types": [
51
51
  "web-types.json",
52
52
  "web-types.lit.json"
53
53
  ],
54
- "gitHead": "57010013e59a3ecdc70ceef4377dbc3b1ac03fb3"
54
+ "gitHead": "60bf51d55e8b93a30536ebb4966248ba256c9b5d"
55
55
  }
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2022 Vaadin Ltd.
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
7
  import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
8
- import { DelegateFocusMixin } from '@vaadin/component-base/src/delegate-focus-mixin.js';
9
8
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
10
9
  import { CheckedMixin } from '@vaadin/field-base/src/checked-mixin.js';
10
+ import { DelegateFocusMixin } from '@vaadin/field-base/src/delegate-focus-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
 
@@ -1,18 +1,18 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2022 Vaadin Ltd.
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
7
  import { ActiveMixin } from '@vaadin/component-base/src/active-mixin.js';
8
8
  import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
9
- import { DelegateFocusMixin } from '@vaadin/component-base/src/delegate-focus-mixin.js';
10
9
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
11
- import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
12
10
  import { CheckedMixin } from '@vaadin/field-base/src/checked-mixin.js';
11
+ import { DelegateFocusMixin } from '@vaadin/field-base/src/delegate-focus-mixin.js';
13
12
  import { InputController } from '@vaadin/field-base/src/input-controller.js';
14
13
  import { LabelMixin } from '@vaadin/field-base/src/label-mixin.js';
15
14
  import { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';
15
+ import { SlotTargetController } from '@vaadin/field-base/src/slot-target-controller.js';
16
16
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
17
17
 
18
18
  /**
@@ -117,11 +117,14 @@ class Checkbox extends LabelMixin(
117
117
  }
118
118
  </style>
119
119
  <div class="vaadin-checkbox-container">
120
- <div part="checkbox" aria-hidden="true"></div>
120
+ <div part="checkbox"></div>
121
121
  <slot name="input"></slot>
122
122
  <slot name="label"></slot>
123
+
124
+ <div style="display: none !important">
125
+ <slot id="noop"></slot>
126
+ </div>
123
127
  </div>
124
- <slot name="tooltip"></slot>
125
128
  `;
126
129
  }
127
130
 
@@ -188,8 +191,21 @@ class Checkbox extends LabelMixin(
188
191
  }),
189
192
  );
190
193
  this.addController(new LabelledInputController(this.inputElement, this._labelController));
191
- this._tooltipController = new TooltipController(this);
192
- this.addController(this._tooltipController);
194
+ this.addController(
195
+ new SlotTargetController(
196
+ this.$.noop,
197
+ () => this._labelController.node,
198
+ () => this.__warnDeprecated(),
199
+ ),
200
+ );
201
+ }
202
+
203
+ /** @private */
204
+ __warnDeprecated() {
205
+ console.warn(
206
+ `WARNING: Since Vaadin 22, placing the label as a direct child of a <vaadin-checkbox> is deprecated.
207
+ Please use <label slot="label"> wrapper or the label property instead.`,
208
+ );
193
209
  }
194
210
 
195
211
  /**
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": "23.2.16",
4
+ "version": "23.2.17",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/checkbox",
4
- "version": "23.2.16",
4
+ "version": "23.2.17",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {