@vaadin/select 23.0.10 → 23.0.13
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.d.ts +4 -1
- package/src/vaadin-select.js +23 -12
- package/theme/lumo/vaadin-select.js +1 -0
- package/theme/material/vaadin-select.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/select",
|
|
3
|
-
"version": "23.0.
|
|
3
|
+
"version": "23.0.13",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,24 +34,24 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@polymer/polymer": "^3.2.0",
|
|
37
|
-
"@vaadin/button": "^23.0.
|
|
38
|
-
"@vaadin/component-base": "^23.0.
|
|
39
|
-
"@vaadin/field-base": "^23.0.
|
|
40
|
-
"@vaadin/input-container": "^23.0.
|
|
41
|
-
"@vaadin/item": "^23.0.
|
|
42
|
-
"@vaadin/list-box": "^23.0.
|
|
43
|
-
"@vaadin/vaadin-list-mixin": "^23.0.
|
|
44
|
-
"@vaadin/vaadin-lumo-styles": "^23.0.
|
|
45
|
-
"@vaadin/vaadin-material-styles": "^23.0.
|
|
46
|
-
"@vaadin/vaadin-overlay": "^23.0.
|
|
47
|
-
"@vaadin/vaadin-themable-mixin": "^23.0.
|
|
37
|
+
"@vaadin/button": "^23.0.13",
|
|
38
|
+
"@vaadin/component-base": "^23.0.13",
|
|
39
|
+
"@vaadin/field-base": "^23.0.13",
|
|
40
|
+
"@vaadin/input-container": "^23.0.13",
|
|
41
|
+
"@vaadin/item": "^23.0.13",
|
|
42
|
+
"@vaadin/list-box": "^23.0.13",
|
|
43
|
+
"@vaadin/vaadin-list-mixin": "^23.0.13",
|
|
44
|
+
"@vaadin/vaadin-lumo-styles": "^23.0.13",
|
|
45
|
+
"@vaadin/vaadin-material-styles": "^23.0.13",
|
|
46
|
+
"@vaadin/vaadin-overlay": "^23.0.13",
|
|
47
|
+
"@vaadin/vaadin-themable-mixin": "^23.0.13"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@esm-bundle/chai": "^4.3.4",
|
|
51
|
-
"@vaadin/polymer-legacy-adapter": "^23.0.
|
|
51
|
+
"@vaadin/polymer-legacy-adapter": "^23.0.13",
|
|
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": "e915550ec6400b5eae6c779fe0afeb1931399312"
|
|
57
57
|
}
|
package/src/vaadin-select.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
7
7
|
import { SlotMixin } from '@vaadin/component-base/src/slot-mixin.js';
|
|
8
8
|
import { DelegateFocusMixin } from '@vaadin/field-base/src/delegate-focus-mixin.js';
|
|
9
|
+
import { DelegateStateMixin } from '@vaadin/field-base/src/delegate-state-mixin.js';
|
|
9
10
|
import { FieldMixin } from '@vaadin/field-base/src/field-mixin.js';
|
|
10
11
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
12
|
|
|
@@ -164,7 +165,9 @@ export interface SelectEventMap extends HTMLElementEventMap, SelectCustomEventMa
|
|
|
164
165
|
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
165
166
|
* @fires {CustomEvent} value-changed - Fired when the `value` property changes.
|
|
166
167
|
*/
|
|
167
|
-
declare class Select extends DelegateFocusMixin(
|
|
168
|
+
declare class Select extends DelegateFocusMixin(
|
|
169
|
+
DelegateStateMixin(FieldMixin(SlotMixin(ElementMixin(ThemableMixin(HTMLElement))))),
|
|
170
|
+
) {
|
|
168
171
|
/**
|
|
169
172
|
* An array containing items that will be rendered as the options of the select.
|
|
170
173
|
*
|
package/src/vaadin-select.js
CHANGED
|
@@ -14,6 +14,7 @@ import { MediaQueryController } from '@vaadin/component-base/src/media-query-con
|
|
|
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';
|
|
17
|
+
import { DelegateStateMixin } from '@vaadin/field-base/src/delegate-state-mixin.js';
|
|
17
18
|
import { FieldMixin } from '@vaadin/field-base/src/field-mixin.js';
|
|
18
19
|
import { fieldShared } from '@vaadin/field-base/src/styles/field-shared-styles.js';
|
|
19
20
|
import { inputFieldContainer } from '@vaadin/field-base/src/styles/input-field-container-styles.js';
|
|
@@ -131,8 +132,11 @@ registerStyles('vaadin-select', [fieldShared, inputFieldContainer], { moduleId:
|
|
|
131
132
|
* @mixes SlotMixin
|
|
132
133
|
* @mixes FieldMixin
|
|
133
134
|
* @mixes DelegateFocusMixin
|
|
135
|
+
* @mixes DelegateStateMixin
|
|
134
136
|
*/
|
|
135
|
-
class Select extends DelegateFocusMixin(
|
|
137
|
+
class Select extends DelegateFocusMixin(
|
|
138
|
+
DelegateStateMixin(FieldMixin(SlotMixin(ElementMixin(ThemableMixin(PolymerElement))))),
|
|
139
|
+
) {
|
|
136
140
|
static get is() {
|
|
137
141
|
return 'vaadin-select';
|
|
138
142
|
}
|
|
@@ -162,7 +166,7 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
162
166
|
>
|
|
163
167
|
<slot name="prefix" slot="prefix"></slot>
|
|
164
168
|
<slot name="value"></slot>
|
|
165
|
-
<div part="toggle-button" slot="suffix" aria-hidden="true"></div>
|
|
169
|
+
<div part="toggle-button" slot="suffix" aria-hidden="true" on-mousedown="_onToggleMouseDown"></div>
|
|
166
170
|
</vaadin-input-container>
|
|
167
171
|
|
|
168
172
|
<div part="helper-text">
|
|
@@ -303,10 +307,13 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
303
307
|
};
|
|
304
308
|
}
|
|
305
309
|
|
|
310
|
+
static get delegateAttrs() {
|
|
311
|
+
return [...super.delegateAttrs, 'invalid'];
|
|
312
|
+
}
|
|
313
|
+
|
|
306
314
|
static get observers() {
|
|
307
315
|
return [
|
|
308
316
|
'_updateAriaExpanded(opened)',
|
|
309
|
-
'_updateAriaRequired(required)',
|
|
310
317
|
'_updateSelectedItem(value, _items, placeholder)',
|
|
311
318
|
'_rendererChanged(renderer, _overlayElement)',
|
|
312
319
|
];
|
|
@@ -346,11 +353,11 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
346
353
|
if (this._valueButton) {
|
|
347
354
|
this._valueButton.setAttribute('aria-labelledby', `${this._labelId} ${this._fieldId}`);
|
|
348
355
|
|
|
349
|
-
this._updateAriaRequired(this.required);
|
|
350
356
|
this._updateAriaExpanded(this.opened);
|
|
351
357
|
|
|
352
358
|
this._setFocusElement(this._valueButton);
|
|
353
359
|
this.ariaTarget = this._valueButton;
|
|
360
|
+
this.stateTarget = this._valueButton;
|
|
354
361
|
|
|
355
362
|
this._valueButton.addEventListener('keydown', this._boundOnKeyDown);
|
|
356
363
|
}
|
|
@@ -485,10 +492,21 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
485
492
|
*
|
|
486
493
|
* @private
|
|
487
494
|
*/
|
|
488
|
-
_onClick() {
|
|
495
|
+
_onClick(event) {
|
|
496
|
+
// Prevent parent components such as `vaadin-grid`
|
|
497
|
+
// from handling the click event after it bubbles.
|
|
498
|
+
event.preventDefault();
|
|
499
|
+
|
|
489
500
|
this.opened = !this.readonly;
|
|
490
501
|
}
|
|
491
502
|
|
|
503
|
+
/** @private */
|
|
504
|
+
_onToggleMouseDown(event) {
|
|
505
|
+
// Prevent mousedown event to avoid blur and preserve focused state
|
|
506
|
+
// while opening, and to restore focus-ring attribute on closing.
|
|
507
|
+
event.preventDefault();
|
|
508
|
+
}
|
|
509
|
+
|
|
492
510
|
/**
|
|
493
511
|
* @param {!KeyboardEvent} e
|
|
494
512
|
* @protected
|
|
@@ -565,13 +583,6 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
565
583
|
}
|
|
566
584
|
}
|
|
567
585
|
|
|
568
|
-
/** @private */
|
|
569
|
-
_updateAriaRequired(required) {
|
|
570
|
-
if (this._valueButton) {
|
|
571
|
-
this._valueButton.setAttribute('aria-required', required ? 'true' : 'false');
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
|
|
575
586
|
/** @private */
|
|
576
587
|
_updateAriaLive(ariaLive) {
|
|
577
588
|
if (this._valueButton) {
|
|
@@ -7,5 +7,6 @@ import '@vaadin/button/theme/lumo/vaadin-button.js';
|
|
|
7
7
|
import '@vaadin/input-container/theme/lumo/vaadin-input-container.js';
|
|
8
8
|
import '@vaadin/item/theme/lumo/vaadin-item.js';
|
|
9
9
|
import '@vaadin/list-box/theme/lumo/vaadin-list-box.js';
|
|
10
|
+
import '@vaadin/vaadin-overlay/theme/lumo/vaadin-overlay.js';
|
|
10
11
|
import './vaadin-select-styles.js';
|
|
11
12
|
import '../../src/vaadin-select.js';
|
|
@@ -7,5 +7,6 @@ import '@vaadin/button/theme/material/vaadin-button.js';
|
|
|
7
7
|
import '@vaadin/input-container/theme/material/vaadin-input-container.js';
|
|
8
8
|
import '@vaadin/item/theme/material/vaadin-item.js';
|
|
9
9
|
import '@vaadin/list-box/theme/material/vaadin-list-box.js';
|
|
10
|
+
import '@vaadin/vaadin-overlay/theme/material/vaadin-overlay.js';
|
|
10
11
|
import './vaadin-select-styles.js';
|
|
11
12
|
import '../../src/vaadin-select.js';
|