@vaadin/checkbox-group 24.2.0-alpha9 → 24.2.0-beta1
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 +9 -9
- package/src/vaadin-checkbox-group.js +19 -2
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/checkbox-group",
|
|
3
|
-
"version": "24.2.0-
|
|
3
|
+
"version": "24.2.0-beta1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@polymer/polymer": "^3.0.0",
|
|
39
|
-
"@vaadin/a11y-base": "24.2.0-
|
|
40
|
-
"@vaadin/checkbox": "24.2.0-
|
|
41
|
-
"@vaadin/component-base": "24.2.0-
|
|
42
|
-
"@vaadin/field-base": "24.2.0-
|
|
43
|
-
"@vaadin/vaadin-lumo-styles": "24.2.0-
|
|
44
|
-
"@vaadin/vaadin-material-styles": "24.2.0-
|
|
45
|
-
"@vaadin/vaadin-themable-mixin": "24.2.0-
|
|
39
|
+
"@vaadin/a11y-base": "24.2.0-beta1",
|
|
40
|
+
"@vaadin/checkbox": "24.2.0-beta1",
|
|
41
|
+
"@vaadin/component-base": "24.2.0-beta1",
|
|
42
|
+
"@vaadin/field-base": "24.2.0-beta1",
|
|
43
|
+
"@vaadin/vaadin-lumo-styles": "24.2.0-beta1",
|
|
44
|
+
"@vaadin/vaadin-material-styles": "24.2.0-beta1",
|
|
45
|
+
"@vaadin/vaadin-themable-mixin": "24.2.0-beta1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@esm-bundle/chai": "^4.3.4",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"web-types.json",
|
|
54
54
|
"web-types.lit.json"
|
|
55
55
|
],
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "67c8eef57d1c59e7476e29adaf003cf4548878f2"
|
|
57
57
|
}
|
|
@@ -7,6 +7,7 @@ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
|
7
7
|
import { DisabledMixin } from '@vaadin/a11y-base/src/disabled-mixin.js';
|
|
8
8
|
import { FocusMixin } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
9
9
|
import { Checkbox } from '@vaadin/checkbox/src/vaadin-checkbox.js';
|
|
10
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
11
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
11
12
|
import { SlotObserver } from '@vaadin/component-base/src/slot-observer.js';
|
|
12
13
|
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
@@ -55,6 +56,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
55
56
|
* @fires {CustomEvent} value-changed - Fired when the `value` property changes.
|
|
56
57
|
* @fires {CustomEvent} validated - Fired whenever the field is validated.
|
|
57
58
|
*
|
|
59
|
+
* @customElement
|
|
58
60
|
* @extends HTMLElement
|
|
59
61
|
* @mixes ThemableMixin
|
|
60
62
|
* @mixes DisabledMixin
|
|
@@ -162,6 +164,19 @@ class CheckboxGroup extends FieldMixin(FocusMixin(DisabledMixin(ElementMixin(The
|
|
|
162
164
|
this.__unregisterCheckbox = this.__unregisterCheckbox.bind(this);
|
|
163
165
|
this.__onCheckboxChange = this.__onCheckboxChange.bind(this);
|
|
164
166
|
this.__onCheckboxCheckedChanged = this.__onCheckboxCheckedChanged.bind(this);
|
|
167
|
+
|
|
168
|
+
this._tooltipController = new TooltipController(this);
|
|
169
|
+
this._tooltipController.addEventListener('tooltip-changed', (event) => {
|
|
170
|
+
const tooltip = event.detail.node;
|
|
171
|
+
if (tooltip && tooltip.isConnected) {
|
|
172
|
+
// Tooltip element has been added to the DOM
|
|
173
|
+
const inputs = this.__checkboxes.map((checkbox) => checkbox.inputElement);
|
|
174
|
+
this._tooltipController.setAriaTarget(inputs);
|
|
175
|
+
} else {
|
|
176
|
+
// Tooltip element is no longer connected
|
|
177
|
+
this._tooltipController.setAriaTarget([]);
|
|
178
|
+
}
|
|
179
|
+
});
|
|
165
180
|
}
|
|
166
181
|
|
|
167
182
|
/**
|
|
@@ -191,10 +206,12 @@ class CheckboxGroup extends FieldMixin(FocusMixin(DisabledMixin(ElementMixin(The
|
|
|
191
206
|
addedCheckboxes.forEach(this.__registerCheckbox);
|
|
192
207
|
removedCheckboxes.forEach(this.__unregisterCheckbox);
|
|
193
208
|
|
|
209
|
+
const inputs = this.__checkboxes.map((checkbox) => checkbox.inputElement);
|
|
210
|
+
this._tooltipController.setAriaTarget(inputs);
|
|
211
|
+
|
|
194
212
|
this.__warnOfCheckboxesWithoutValue(addedCheckboxes);
|
|
195
213
|
});
|
|
196
214
|
|
|
197
|
-
this._tooltipController = new TooltipController(this);
|
|
198
215
|
this.addController(this._tooltipController);
|
|
199
216
|
}
|
|
200
217
|
|
|
@@ -389,6 +406,6 @@ class CheckboxGroup extends FieldMixin(FocusMixin(DisabledMixin(ElementMixin(The
|
|
|
389
406
|
}
|
|
390
407
|
}
|
|
391
408
|
|
|
392
|
-
|
|
409
|
+
defineCustomElement(CheckboxGroup);
|
|
393
410
|
|
|
394
411
|
export { CheckboxGroup };
|
package/web-types.json
CHANGED
package/web-types.lit.json
CHANGED