@vaadin/select 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 +14 -14
- package/src/vaadin-select-overlay.js +16 -1
- package/src/vaadin-select-value-button.js +2 -1
- package/src/vaadin-select.d.ts +1 -1
- package/src/vaadin-select.js +18 -21
- package/theme/lumo/vaadin-select-styles.js +1 -1
- package/theme/lumo/vaadin-select.js +1 -1
- package/theme/material/vaadin-select-styles.js +1 -1
- package/theme/material/vaadin-select.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/select",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,24 +34,24 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@polymer/iron-media-query": "^3.0.0",
|
|
36
36
|
"@polymer/polymer": "^3.2.0",
|
|
37
|
-
"@vaadin/button": "^22.0.
|
|
38
|
-
"@vaadin/component-base": "^22.0.
|
|
39
|
-
"@vaadin/field-base": "^22.0.
|
|
40
|
-
"@vaadin/input-container": "^22.0.
|
|
41
|
-
"@vaadin/item": "^22.0.
|
|
42
|
-
"@vaadin/list-box": "^22.0.
|
|
43
|
-
"@vaadin/vaadin-list-mixin": "^22.0.
|
|
44
|
-
"@vaadin/vaadin-lumo-styles": "^22.0.
|
|
45
|
-
"@vaadin/vaadin-material-styles": "^22.0.
|
|
46
|
-
"@vaadin/vaadin-overlay": "^22.0.
|
|
47
|
-
"@vaadin/vaadin-themable-mixin": "^22.0.
|
|
37
|
+
"@vaadin/button": "^22.0.5",
|
|
38
|
+
"@vaadin/component-base": "^22.0.5",
|
|
39
|
+
"@vaadin/field-base": "^22.0.5",
|
|
40
|
+
"@vaadin/input-container": "^22.0.5",
|
|
41
|
+
"@vaadin/item": "^22.0.5",
|
|
42
|
+
"@vaadin/list-box": "^22.0.5",
|
|
43
|
+
"@vaadin/vaadin-list-mixin": "^22.0.5",
|
|
44
|
+
"@vaadin/vaadin-lumo-styles": "^22.0.5",
|
|
45
|
+
"@vaadin/vaadin-material-styles": "^22.0.5",
|
|
46
|
+
"@vaadin/vaadin-overlay": "^22.0.5",
|
|
47
|
+
"@vaadin/vaadin-themable-mixin": "^22.0.5"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@esm-bundle/chai": "^4.3.4",
|
|
51
|
-
"@vaadin/polymer-legacy-adapter": "^22.0.
|
|
51
|
+
"@vaadin/polymer-legacy-adapter": "^22.0.5",
|
|
52
52
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
53
53
|
"lit": "^2.0.0",
|
|
54
54
|
"sinon": "^9.2.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "3e1990867670f3de2dec6fa1200d945623b2710c"
|
|
57
57
|
}
|
|
@@ -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 { OverlayElement } from '@vaadin/vaadin-overlay/src/vaadin-overlay.js';
|
|
@@ -28,6 +28,21 @@ class SelectOverlay extends PositionMixin(OverlayElement) {
|
|
|
28
28
|
static get is() {
|
|
29
29
|
return 'vaadin-select-overlay';
|
|
30
30
|
}
|
|
31
|
+
|
|
32
|
+
requestContentUpdate() {
|
|
33
|
+
super.requestContentUpdate();
|
|
34
|
+
|
|
35
|
+
if (this.owner) {
|
|
36
|
+
// Ensure menuElement reference is correct.
|
|
37
|
+
const menuElement = this._getMenuElement();
|
|
38
|
+
this.owner._assignMenuElement(menuElement);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** @protected */
|
|
43
|
+
_getMenuElement() {
|
|
44
|
+
return Array.from(this.children).find((el) => el.localName !== 'style');
|
|
45
|
+
}
|
|
31
46
|
}
|
|
32
47
|
|
|
33
48
|
customElements.define(SelectOverlay.is, SelectOverlay);
|
|
@@ -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 { Button } from '@vaadin/button/src/vaadin-button.js';
|
|
@@ -12,6 +12,7 @@ registerStyles(
|
|
|
12
12
|
:host {
|
|
13
13
|
margin: 0;
|
|
14
14
|
min-width: 0;
|
|
15
|
+
width: 0;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
::slotted(vaadin-item) {
|
package/src/vaadin-select.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 { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
package/src/vaadin-select.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 '@polymer/iron-media-query/iron-media-query.js';
|
|
@@ -143,7 +143,7 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
143
143
|
>
|
|
144
144
|
<slot name="prefix" slot="prefix"></slot>
|
|
145
145
|
<slot name="value"></slot>
|
|
146
|
-
<div part="toggle-button" slot="suffix"></div>
|
|
146
|
+
<div part="toggle-button" slot="suffix" aria-hidden="true"></div>
|
|
147
147
|
</vaadin-input-container>
|
|
148
148
|
|
|
149
149
|
<div part="helper-text">
|
|
@@ -252,9 +252,6 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
252
252
|
/** @private */
|
|
253
253
|
_overlayElement: Object,
|
|
254
254
|
|
|
255
|
-
/** @private */
|
|
256
|
-
_inputElement: Object,
|
|
257
|
-
|
|
258
255
|
/** @private */
|
|
259
256
|
_inputContainer: Object,
|
|
260
257
|
|
|
@@ -349,9 +346,6 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
349
346
|
|
|
350
347
|
this._overlayElement.requestContentUpdate();
|
|
351
348
|
|
|
352
|
-
// Ensure menu element is set
|
|
353
|
-
this._assignMenuElement();
|
|
354
|
-
|
|
355
349
|
if (this._menuElement && this._menuElement.items) {
|
|
356
350
|
this._updateSelectedItem(this.value, this._menuElement.items);
|
|
357
351
|
}
|
|
@@ -366,22 +360,23 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
366
360
|
overlay.setProperties({ owner: this, renderer });
|
|
367
361
|
|
|
368
362
|
this.requestContentUpdate();
|
|
369
|
-
|
|
370
|
-
if (renderer) {
|
|
371
|
-
this._assignMenuElement();
|
|
372
|
-
}
|
|
373
363
|
}
|
|
374
364
|
|
|
375
|
-
/**
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
365
|
+
/**
|
|
366
|
+
* @param {HTMLElement} menuElement
|
|
367
|
+
* @protected
|
|
368
|
+
*/
|
|
369
|
+
_assignMenuElement(menuElement) {
|
|
379
370
|
if (menuElement && menuElement !== this.__lastMenuElement) {
|
|
380
371
|
this._menuElement = menuElement;
|
|
372
|
+
|
|
373
|
+
// Ensure items are initialized
|
|
374
|
+
this.__initMenuItems(menuElement);
|
|
375
|
+
|
|
381
376
|
menuElement.addEventListener('items-changed', () => {
|
|
382
|
-
this.
|
|
383
|
-
this._items.forEach((item) => item.setAttribute('role', 'option'));
|
|
377
|
+
this.__initMenuItems(menuElement);
|
|
384
378
|
});
|
|
379
|
+
|
|
385
380
|
menuElement.addEventListener('selected-changed', () => this.__updateValueButton());
|
|
386
381
|
// Use capture phase to make it possible for `<vaadin-grid-pro-edit-select>`
|
|
387
382
|
// to override and handle the keydown event before the value change happens.
|
|
@@ -403,9 +398,11 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
403
398
|
}
|
|
404
399
|
|
|
405
400
|
/** @private */
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
401
|
+
__initMenuItems(menuElement) {
|
|
402
|
+
if (menuElement.items) {
|
|
403
|
+
this._items = menuElement.items;
|
|
404
|
+
this._items.forEach((item) => item.setAttribute('role', 'option'));
|
|
405
|
+
}
|
|
409
406
|
}
|
|
410
407
|
|
|
411
408
|
/** @private */
|