@vaadin/vaadin-select 2.4.0-alpha1 → 2.4.3
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/@types/interfaces.d.ts +1 -1
- package/README.md +10 -13
- package/package.json +11 -8
- package/src/vaadin-select.d.ts +2 -0
- package/src/vaadin-select.js +16 -9
- package/vaadin-select.d.ts +1 -0
package/@types/interfaces.d.ts
CHANGED
package/README.md
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
[](https://github.com/vaadin/vaadin-select/releases)
|
|
3
|
-
[](https://www.webcomponents.org/element/vaadin/vaadin-select)
|
|
4
|
-
[](https://travis-ci.org/vaadin/vaadin-select)
|
|
5
|
-
[](https://coveralls.io/github/vaadin/vaadin-select?branch=master)
|
|
6
|
-
[](https://gitter.im/vaadin/web-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
|
1
|
+
# <vaadin-select>
|
|
7
2
|
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
> ⚠️ Starting from Vaadin 20, the source code and issues for this component are migrated to the [`vaadin/web-components`](https://github.com/vaadin/web-components/tree/master/packages/vaadin-select) monorepository.
|
|
4
|
+
> This repository contains the source code and releases of `<vaadin-select>` for the Vaadin versions 10 to 19.
|
|
10
5
|
|
|
11
|
-
|
|
6
|
+
[<vaadin-select>](https://vaadin.com/components/vaadin-select) is a Web Component similar to a native browser select element, part of the [Vaadin components](https://vaadin.com/components).
|
|
12
7
|
|
|
13
|
-
[Live Demo ↗](https://
|
|
8
|
+
[Live Demo ↗](https://vaadin.com/components/vaadin-select/html-examples)
|
|
14
9
|
|
|
|
15
|
-
[API documentation ↗](https://
|
|
10
|
+
[API documentation ↗](https://vaadin.com/components/vaadin-select/html-api)
|
|
16
11
|
|
|
17
|
-
|
|
18
|
-
[
|
|
12
|
+
[](https://www.npmjs.com/package/@vaadin/vaadin-select)
|
|
13
|
+
[](https://www.webcomponents.org/element/vaadin/vaadin-select)
|
|
14
|
+
[](https://vaadin.com/directory/component/vaadinvaadin-select)
|
|
15
|
+
[](https://discord.gg/PHmkCKC)
|
|
19
16
|
|
|
20
17
|
<!--
|
|
21
18
|
```
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"repository": "vaadin/vaadin-select",
|
|
11
11
|
"homepage": "https://vaadin.com/components",
|
|
12
12
|
"name": "@vaadin/vaadin-select",
|
|
13
|
-
"version": "2.4.
|
|
13
|
+
"version": "2.4.3",
|
|
14
14
|
"main": "vaadin-select.js",
|
|
15
15
|
"author": "Vaadin Ltd",
|
|
16
16
|
"license": "Apache-2.0",
|
|
@@ -36,19 +36,18 @@
|
|
|
36
36
|
"@polymer/iron-resizable-behavior": "^3.0.0",
|
|
37
37
|
"@vaadin/vaadin-control-state-mixin": "^2.2.1",
|
|
38
38
|
"@vaadin/vaadin-themable-mixin": "^1.6.1",
|
|
39
|
-
"@vaadin/vaadin-text-field": "^2.8.0
|
|
40
|
-
"@vaadin/vaadin-list-box": "^1.4.0
|
|
39
|
+
"@vaadin/vaadin-text-field": "^2.8.0",
|
|
40
|
+
"@vaadin/vaadin-list-box": "^1.4.0",
|
|
41
41
|
"@vaadin/vaadin-list-mixin": "^2.5.0",
|
|
42
|
-
"@vaadin/vaadin-item": "^2.3.0
|
|
42
|
+
"@vaadin/vaadin-item": "^2.3.0",
|
|
43
43
|
"@vaadin/vaadin-overlay": "^3.5.0",
|
|
44
44
|
"@vaadin/vaadin-lumo-styles": "^1.6.0",
|
|
45
45
|
"@vaadin/vaadin-material-styles": "^1.3.2",
|
|
46
46
|
"@vaadin/vaadin-element-mixin": "^2.4.1"
|
|
47
47
|
},
|
|
48
|
-
"scripts": {
|
|
49
|
-
"generate-typings": "gen-typescript-declarations --outDir . --verify"
|
|
50
|
-
},
|
|
51
48
|
"devDependencies": {
|
|
49
|
+
"@web-padawan/gen-typescript-declarations": "^1.6.2",
|
|
50
|
+
"web-component-tester": "6.9.2",
|
|
52
51
|
"@polymer/iron-test-helpers": "^3.0.0",
|
|
53
52
|
"@polymer/iron-component-page": "^4.0.0",
|
|
54
53
|
"@polymer/iron-form": "^3.0.0",
|
|
@@ -56,7 +55,11 @@
|
|
|
56
55
|
"@webcomponents/webcomponentsjs": "^2.0.0",
|
|
57
56
|
"wct-browser-legacy": "^1.0.1",
|
|
58
57
|
"@vaadin/vaadin-demo-helpers": "^3.1.0",
|
|
59
|
-
"@vaadin/vaadin-button": "^2.4.0
|
|
58
|
+
"@vaadin/vaadin-button": "^2.4.0",
|
|
60
59
|
"@vaadin/vaadin-icons": "^4.3.1"
|
|
60
|
+
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"generate-typings": "gen-typescript-declarations --outDir . --verify",
|
|
63
|
+
"test": "wct --npm"
|
|
61
64
|
}
|
|
62
65
|
}
|
package/src/vaadin-select.d.ts
CHANGED
|
@@ -144,6 +144,7 @@ declare class SelectElement extends
|
|
|
144
144
|
|
|
145
145
|
/**
|
|
146
146
|
* The error message to display when the select value is invalid
|
|
147
|
+
* @attr {string} error-message
|
|
147
148
|
*/
|
|
148
149
|
errorMessage: string;
|
|
149
150
|
|
|
@@ -193,6 +194,7 @@ declare class SelectElement extends
|
|
|
193
194
|
|
|
194
195
|
/**
|
|
195
196
|
* String used for the helper text.
|
|
197
|
+
* @attr {string} helper-text
|
|
196
198
|
*/
|
|
197
199
|
helperText: string|null|undefined;
|
|
198
200
|
|
package/src/vaadin-select.js
CHANGED
|
@@ -178,7 +178,7 @@ class SelectElement extends
|
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
static get version() {
|
|
181
|
-
return '2.4.
|
|
181
|
+
return '2.4.3';
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
static get properties() {
|
|
@@ -208,6 +208,7 @@ class SelectElement extends
|
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
210
|
* The error message to display when the select value is invalid
|
|
211
|
+
* @attr {string} error-message
|
|
211
212
|
* @type {string}
|
|
212
213
|
*/
|
|
213
214
|
errorMessage: {
|
|
@@ -284,6 +285,7 @@ class SelectElement extends
|
|
|
284
285
|
|
|
285
286
|
/**
|
|
286
287
|
* String used for the helper text.
|
|
288
|
+
* @attr {string} helper-text
|
|
287
289
|
*/
|
|
288
290
|
helperText: {
|
|
289
291
|
type: String,
|
|
@@ -362,7 +364,12 @@ class SelectElement extends
|
|
|
362
364
|
this._nativeInput.setAttribute('tabindex', -1);
|
|
363
365
|
this._nativeInput.style.pointerEvents = 'none';
|
|
364
366
|
|
|
365
|
-
this.focusElement.addEventListener('click', e =>
|
|
367
|
+
this.focusElement.addEventListener('click', (e) => {
|
|
368
|
+
const isHelperClick = Array.from(e.composedPath()).some((node) => {
|
|
369
|
+
return node.nodeType === Node.ELEMENT_NODE && node.getAttribute('slot') === 'helper';
|
|
370
|
+
});
|
|
371
|
+
this.opened = !this.readonly && !isHelperClick;
|
|
372
|
+
});
|
|
366
373
|
this.focusElement.addEventListener('keydown', e => this._onKeyDown(e));
|
|
367
374
|
|
|
368
375
|
this._observer = new FlattenedNodesObserver(this, info => this._setTemplateFromNodes(info.addedNodes));
|
|
@@ -398,6 +405,10 @@ class SelectElement extends
|
|
|
398
405
|
* Manually invoke existing renderer.
|
|
399
406
|
*/
|
|
400
407
|
render() {
|
|
408
|
+
if (!this._overlayElement) {
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
|
|
401
412
|
this._overlayElement.render();
|
|
402
413
|
if (this._menuElement && this._menuElement.items) {
|
|
403
414
|
this._updateSelectedItem(this.value, this._menuElement.items);
|
|
@@ -555,13 +566,9 @@ class SelectElement extends
|
|
|
555
566
|
this._setPosition();
|
|
556
567
|
window.addEventListener('scroll', this._boundSetPosition, true);
|
|
557
568
|
} else if (wasOpened) {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
this.focusElement.focus();
|
|
562
|
-
if (this._openedWithFocusRing) {
|
|
563
|
-
this.focusElement.setAttribute('focus-ring', '');
|
|
564
|
-
}
|
|
569
|
+
this.focusElement.focus();
|
|
570
|
+
if (this._openedWithFocusRing) {
|
|
571
|
+
this.focusElement.setAttribute('focus-ring', '');
|
|
565
572
|
}
|
|
566
573
|
this.validate();
|
|
567
574
|
window.removeEventListener('scroll', this._boundSetPosition, true);
|
package/vaadin-select.d.ts
CHANGED