@vaadin/checkbox 22.0.1 → 22.0.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.
- package/package.json +7 -7
- package/src/vaadin-checkbox.d.ts +3 -3
- package/src/vaadin-checkbox.js +26 -33
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/checkbox",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.5",
|
|
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.5",
|
|
37
|
+
"@vaadin/field-base": "^22.0.5",
|
|
38
|
+
"@vaadin/vaadin-lumo-styles": "^22.0.5",
|
|
39
|
+
"@vaadin/vaadin-material-styles": "^22.0.5",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "^22.0.5"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@esm-bundle/chai": "^4.3.4",
|
|
44
44
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
45
45
|
"sinon": "^9.2.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "3e1990867670f3de2dec6fa1200d945623b2710c"
|
|
48
48
|
}
|
package/src/vaadin-checkbox.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
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';
|
|
@@ -8,7 +8,7 @@ import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js'
|
|
|
8
8
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
9
9
|
import { CheckedMixin } from '@vaadin/field-base/src/checked-mixin.js';
|
|
10
10
|
import { DelegateFocusMixin } from '@vaadin/field-base/src/delegate-focus-mixin.js';
|
|
11
|
-
import {
|
|
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
14
|
/**
|
|
@@ -61,7 +61,7 @@ export interface CheckboxEventMap extends HTMLElementEventMap, CheckboxCustomEve
|
|
|
61
61
|
* @fires {CustomEvent} checked-changed - Fired when the `checked` property changes.
|
|
62
62
|
* @fires {CustomEvent} indeterminate-changed - Fired when the `indeterminate` property changes.
|
|
63
63
|
*/
|
|
64
|
-
declare class Checkbox extends
|
|
64
|
+
declare class Checkbox extends LabelMixin(
|
|
65
65
|
CheckedMixin(DelegateFocusMixin(ActiveMixin(ElementMixin(ThemableMixin(ControllerMixin(HTMLElement))))))
|
|
66
66
|
) {
|
|
67
67
|
/**
|
package/src/vaadin-checkbox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
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';
|
|
@@ -10,8 +10,9 @@ import { ElementMixin } from '@vaadin/component-base/src/element-mixin.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 { LabelMixin } from '@vaadin/field-base/src/label-mixin.js';
|
|
13
14
|
import { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';
|
|
14
|
-
import {
|
|
15
|
+
import { SlotTargetController } from '@vaadin/field-base/src/slot-target-controller.js';
|
|
15
16
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
16
17
|
|
|
17
18
|
/**
|
|
@@ -53,9 +54,9 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
53
54
|
* @mixes ActiveMixin
|
|
54
55
|
* @mixes DelegateFocusMixin
|
|
55
56
|
* @mixes CheckedMixin
|
|
56
|
-
* @mixes
|
|
57
|
+
* @mixes LabelMixin
|
|
57
58
|
*/
|
|
58
|
-
class Checkbox extends
|
|
59
|
+
class Checkbox extends LabelMixin(
|
|
59
60
|
CheckedMixin(DelegateFocusMixin(ActiveMixin(ElementMixin(ThemableMixin(ControllerMixin(PolymerElement))))))
|
|
60
61
|
) {
|
|
61
62
|
static get is() {
|
|
@@ -78,13 +79,14 @@ class Checkbox extends SlotLabelMixin(
|
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
.vaadin-checkbox-container {
|
|
81
|
-
display:
|
|
82
|
+
display: grid;
|
|
83
|
+
grid-template-columns: auto 1fr;
|
|
82
84
|
align-items: baseline;
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
.vaadin-checkbox-wrapper {
|
|
86
88
|
position: relative;
|
|
87
|
-
|
|
89
|
+
height: 100%;
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
/* visually hidden */
|
|
@@ -166,39 +168,30 @@ class Checkbox extends SlotLabelMixin(
|
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
/** @protected */
|
|
169
|
-
|
|
170
|
-
super.
|
|
171
|
+
connectedCallback() {
|
|
172
|
+
super.connectedCallback();
|
|
171
173
|
|
|
172
|
-
this.
|
|
173
|
-
new InputController(this, (input) => {
|
|
174
|
+
if (!this._inputController) {
|
|
175
|
+
this._inputController = new InputController(this, (input) => {
|
|
174
176
|
this._setInputElement(input);
|
|
175
177
|
this._setFocusElement(input);
|
|
176
178
|
this.stateTarget = input;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
get _sourceSlot() {
|
|
190
|
-
return this.$.noop;
|
|
179
|
+
this.ariaTarget = input;
|
|
180
|
+
});
|
|
181
|
+
this.addController(this._inputController);
|
|
182
|
+
this.addController(new LabelledInputController(this.inputElement, this._labelController));
|
|
183
|
+
this.addController(
|
|
184
|
+
new SlotTargetController(
|
|
185
|
+
this.$.noop,
|
|
186
|
+
() => this._labelController.node,
|
|
187
|
+
() => this.__warnDeprecated()
|
|
188
|
+
)
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
/**
|
|
194
|
-
|
|
195
|
-
* @override
|
|
196
|
-
* @protected
|
|
197
|
-
* @param {!Array<!Node>} nodes
|
|
198
|
-
**/
|
|
199
|
-
__copyNodesToSlotTarget(nodes) {
|
|
200
|
-
super.__copyNodesToSlotTarget(nodes);
|
|
201
|
-
|
|
193
|
+
/** @private */
|
|
194
|
+
__warnDeprecated() {
|
|
202
195
|
console.warn(
|
|
203
196
|
`WARNING: Since Vaadin 22, placing the label as a direct child of a <vaadin-checkbox> is deprecated.
|
|
204
197
|
Please use <label slot="label"> wrapper or the label property instead.`
|