@vaadin/select 23.0.0-beta1 → 23.0.0-beta5
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 -15
- package/src/vaadin-select.js +22 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/select",
|
|
3
|
-
"version": "23.0.0-
|
|
3
|
+
"version": "23.0.0-beta5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,26 +33,25 @@
|
|
|
33
33
|
"polymer"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@polymer/iron-media-query": "^3.0.0",
|
|
37
36
|
"@polymer/polymer": "^3.2.0",
|
|
38
|
-
"@vaadin/button": "23.0.0-
|
|
39
|
-
"@vaadin/component-base": "23.0.0-
|
|
40
|
-
"@vaadin/field-base": "23.0.0-
|
|
41
|
-
"@vaadin/input-container": "23.0.0-
|
|
42
|
-
"@vaadin/item": "23.0.0-
|
|
43
|
-
"@vaadin/list-box": "23.0.0-
|
|
44
|
-
"@vaadin/vaadin-list-mixin": "23.0.0-
|
|
45
|
-
"@vaadin/vaadin-lumo-styles": "23.0.0-
|
|
46
|
-
"@vaadin/vaadin-material-styles": "23.0.0-
|
|
47
|
-
"@vaadin/vaadin-overlay": "23.0.0-
|
|
48
|
-
"@vaadin/vaadin-themable-mixin": "23.0.0-
|
|
37
|
+
"@vaadin/button": "23.0.0-beta5",
|
|
38
|
+
"@vaadin/component-base": "23.0.0-beta5",
|
|
39
|
+
"@vaadin/field-base": "23.0.0-beta5",
|
|
40
|
+
"@vaadin/input-container": "23.0.0-beta5",
|
|
41
|
+
"@vaadin/item": "23.0.0-beta5",
|
|
42
|
+
"@vaadin/list-box": "23.0.0-beta5",
|
|
43
|
+
"@vaadin/vaadin-list-mixin": "23.0.0-beta5",
|
|
44
|
+
"@vaadin/vaadin-lumo-styles": "23.0.0-beta5",
|
|
45
|
+
"@vaadin/vaadin-material-styles": "23.0.0-beta5",
|
|
46
|
+
"@vaadin/vaadin-overlay": "23.0.0-beta5",
|
|
47
|
+
"@vaadin/vaadin-themable-mixin": "23.0.0-beta5"
|
|
49
48
|
},
|
|
50
49
|
"devDependencies": {
|
|
51
50
|
"@esm-bundle/chai": "^4.3.4",
|
|
52
|
-
"@vaadin/polymer-legacy-adapter": "23.0.0-
|
|
51
|
+
"@vaadin/polymer-legacy-adapter": "23.0.0-beta5",
|
|
53
52
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
54
53
|
"lit": "^2.0.0",
|
|
55
54
|
"sinon": "^9.2.0"
|
|
56
55
|
},
|
|
57
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "4c388aeec6623869c70896c909799804fc95d0f9"
|
|
58
57
|
}
|
package/src/vaadin-select.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
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
|
-
import '@polymer/iron-media-query/iron-media-query.js';
|
|
7
6
|
import '@vaadin/input-container/src/vaadin-input-container.js';
|
|
8
7
|
import './vaadin-select-item.js';
|
|
9
8
|
import './vaadin-select-list-box.js';
|
|
@@ -11,6 +10,7 @@ import './vaadin-select-overlay.js';
|
|
|
11
10
|
import './vaadin-select-value-button.js';
|
|
12
11
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
13
12
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
13
|
+
import { MediaQueryController } from '@vaadin/component-base/src/media-query-controller.js';
|
|
14
14
|
import { SlotMixin } from '@vaadin/component-base/src/slot-mixin.js';
|
|
15
15
|
import { processTemplates } from '@vaadin/component-base/src/templates.js';
|
|
16
16
|
import { DelegateFocusMixin } from '@vaadin/field-base/src/delegate-focus-mixin.js';
|
|
@@ -162,7 +162,7 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
162
162
|
>
|
|
163
163
|
<slot name="prefix" slot="prefix"></slot>
|
|
164
164
|
<slot name="value"></slot>
|
|
165
|
-
<div part="toggle-button" slot="suffix"></div>
|
|
165
|
+
<div part="toggle-button" slot="suffix" aria-hidden="true"></div>
|
|
166
166
|
</vaadin-input-container>
|
|
167
167
|
|
|
168
168
|
<div part="helper-text">
|
|
@@ -181,8 +181,6 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
181
181
|
phone$="[[_phone]]"
|
|
182
182
|
theme$="[[theme]]"
|
|
183
183
|
></vaadin-select-overlay>
|
|
184
|
-
|
|
185
|
-
<iron-media-query query="[[_phoneMediaQuery]]" query-matches="{{_phone}}"></iron-media-query>
|
|
186
184
|
`;
|
|
187
185
|
}
|
|
188
186
|
|
|
@@ -297,9 +295,6 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
297
295
|
/** @private */
|
|
298
296
|
_overlayElement: Object,
|
|
299
297
|
|
|
300
|
-
/** @private */
|
|
301
|
-
_inputElement: Object,
|
|
302
|
-
|
|
303
298
|
/** @private */
|
|
304
299
|
_inputContainer: Object,
|
|
305
300
|
|
|
@@ -378,6 +373,12 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
378
373
|
this._overlayElement = this.shadowRoot.querySelector('vaadin-select-overlay');
|
|
379
374
|
this._inputContainer = this.shadowRoot.querySelector('[part~="input-field"]');
|
|
380
375
|
|
|
376
|
+
this.addController(
|
|
377
|
+
new MediaQueryController(this._phoneMediaQuery, (matches) => {
|
|
378
|
+
this._phone = matches;
|
|
379
|
+
})
|
|
380
|
+
);
|
|
381
|
+
|
|
381
382
|
processTemplates(this);
|
|
382
383
|
}
|
|
383
384
|
|
|
@@ -432,10 +433,14 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
432
433
|
_assignMenuElement(menuElement) {
|
|
433
434
|
if (menuElement && menuElement !== this.__lastMenuElement) {
|
|
434
435
|
this._menuElement = menuElement;
|
|
436
|
+
|
|
437
|
+
// Ensure items are initialized
|
|
438
|
+
this.__initMenuItems(menuElement);
|
|
439
|
+
|
|
435
440
|
menuElement.addEventListener('items-changed', () => {
|
|
436
|
-
this.
|
|
437
|
-
this._items.forEach((item) => item.setAttribute('role', 'option'));
|
|
441
|
+
this.__initMenuItems(menuElement);
|
|
438
442
|
});
|
|
443
|
+
|
|
439
444
|
menuElement.addEventListener('selected-changed', () => this.__updateValueButton());
|
|
440
445
|
// Use capture phase to make it possible for `<vaadin-grid-pro-edit-select>`
|
|
441
446
|
// to override and handle the keydown event before the value change happens.
|
|
@@ -456,6 +461,14 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
456
461
|
}
|
|
457
462
|
}
|
|
458
463
|
|
|
464
|
+
/** @private */
|
|
465
|
+
__initMenuItems(menuElement) {
|
|
466
|
+
if (menuElement.items) {
|
|
467
|
+
this._items = menuElement.items;
|
|
468
|
+
this._items.forEach((item) => item.setAttribute('role', 'option'));
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
459
472
|
/** @private */
|
|
460
473
|
_valueChanged(value, oldValue) {
|
|
461
474
|
this.toggleAttribute('has-value', Boolean(value));
|