@vaadin/select 23.0.11 → 23.0.14
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 +18 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/select",
|
|
3
|
-
"version": "23.0.
|
|
3
|
+
"version": "23.0.14",
|
|
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": "
|
|
38
|
-
"@vaadin/component-base": "
|
|
39
|
-
"@vaadin/field-base": "
|
|
40
|
-
"@vaadin/input-container": "
|
|
41
|
-
"@vaadin/item": "
|
|
42
|
-
"@vaadin/list-box": "
|
|
43
|
-
"@vaadin/vaadin-list-mixin": "
|
|
44
|
-
"@vaadin/vaadin-lumo-styles": "
|
|
45
|
-
"@vaadin/vaadin-material-styles": "
|
|
46
|
-
"@vaadin/vaadin-overlay": "
|
|
47
|
-
"@vaadin/vaadin-themable-mixin": "
|
|
37
|
+
"@vaadin/button": "~23.0.14",
|
|
38
|
+
"@vaadin/component-base": "~23.0.14",
|
|
39
|
+
"@vaadin/field-base": "~23.0.14",
|
|
40
|
+
"@vaadin/input-container": "~23.0.14",
|
|
41
|
+
"@vaadin/item": "~23.0.14",
|
|
42
|
+
"@vaadin/list-box": "~23.0.14",
|
|
43
|
+
"@vaadin/vaadin-list-mixin": "~23.0.14",
|
|
44
|
+
"@vaadin/vaadin-lumo-styles": "~23.0.14",
|
|
45
|
+
"@vaadin/vaadin-material-styles": "~23.0.14",
|
|
46
|
+
"@vaadin/vaadin-overlay": "~23.0.14",
|
|
47
|
+
"@vaadin/vaadin-themable-mixin": "~23.0.14"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@esm-bundle/chai": "^4.3.4",
|
|
51
|
-
"@vaadin/polymer-legacy-adapter": "
|
|
51
|
+
"@vaadin/polymer-legacy-adapter": "~23.0.14",
|
|
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": "4bf78ed9737b5147dfb74c802d116354caa98992"
|
|
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
|
}
|
|
@@ -493,6 +500,13 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
493
500
|
this.opened = !this.readonly;
|
|
494
501
|
}
|
|
495
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
|
+
|
|
496
510
|
/**
|
|
497
511
|
* @param {!KeyboardEvent} e
|
|
498
512
|
* @protected
|
|
@@ -569,13 +583,6 @@ class Select extends DelegateFocusMixin(FieldMixin(SlotMixin(ElementMixin(Themab
|
|
|
569
583
|
}
|
|
570
584
|
}
|
|
571
585
|
|
|
572
|
-
/** @private */
|
|
573
|
-
_updateAriaRequired(required) {
|
|
574
|
-
if (this._valueButton) {
|
|
575
|
-
this._valueButton.setAttribute('aria-required', required ? 'true' : 'false');
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
|
|
579
586
|
/** @private */
|
|
580
587
|
_updateAriaLive(ariaLive) {
|
|
581
588
|
if (this._valueButton) {
|