@vaadin/vaadin-select 2.3.0 → 2.4.2
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/README.md +10 -13
- package/package.json +7 -5
- package/src/vaadin-select.d.ts +6 -0
- package/src/vaadin-select.js +21 -10
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.
|
|
13
|
+
"version": "2.4.2",
|
|
14
14
|
"main": "vaadin-select.js",
|
|
15
15
|
"author": "Vaadin Ltd",
|
|
16
16
|
"license": "Apache-2.0",
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
"theme"
|
|
26
26
|
],
|
|
27
27
|
"resolutions": {
|
|
28
|
+
"es-abstract": "1.17.6",
|
|
29
|
+
"@types/doctrine": "0.0.3",
|
|
28
30
|
"inherits": "2.0.3",
|
|
29
31
|
"samsam": "1.1.3",
|
|
30
32
|
"supports-color": "3.1.2",
|
|
@@ -36,7 +38,7 @@
|
|
|
36
38
|
"@polymer/iron-resizable-behavior": "^3.0.0",
|
|
37
39
|
"@vaadin/vaadin-control-state-mixin": "^2.2.1",
|
|
38
40
|
"@vaadin/vaadin-themable-mixin": "^1.6.1",
|
|
39
|
-
"@vaadin/vaadin-text-field": "^2.
|
|
41
|
+
"@vaadin/vaadin-text-field": "^2.8.0",
|
|
40
42
|
"@vaadin/vaadin-list-box": "^1.4.0",
|
|
41
43
|
"@vaadin/vaadin-list-mixin": "^2.5.0",
|
|
42
44
|
"@vaadin/vaadin-item": "^2.3.0",
|
|
@@ -46,9 +48,9 @@
|
|
|
46
48
|
"@vaadin/vaadin-element-mixin": "^2.4.1"
|
|
47
49
|
},
|
|
48
50
|
"scripts": {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
"generate-typings": "gen-typescript-declarations --outDir . --verify"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
52
54
|
"@polymer/iron-test-helpers": "^3.0.0",
|
|
53
55
|
"@polymer/iron-component-page": "^4.0.0",
|
|
54
56
|
"@polymer/iron-form": "^3.0.0",
|
package/src/vaadin-select.d.ts
CHANGED
|
@@ -192,6 +192,12 @@ declare class SelectElement extends
|
|
|
192
192
|
*/
|
|
193
193
|
placeholder: string|null|undefined;
|
|
194
194
|
|
|
195
|
+
/**
|
|
196
|
+
* String used for the helper text.
|
|
197
|
+
* @attr {string} helper-text
|
|
198
|
+
*/
|
|
199
|
+
helperText: string|null|undefined;
|
|
200
|
+
|
|
195
201
|
/**
|
|
196
202
|
* When present, it specifies that the element is read-only.
|
|
197
203
|
*/
|
package/src/vaadin-select.js
CHANGED
|
@@ -161,8 +161,9 @@ class SelectElement extends
|
|
|
161
161
|
}
|
|
162
162
|
</style>
|
|
163
163
|
|
|
164
|
-
<vaadin-select-text-field placeholder="[[placeholder]]" label="[[label]]" required="[[required]]" invalid="[[invalid]]" error-message="[[errorMessage]]" readonly\$="[[readonly]]" theme\$="[[theme]]">
|
|
164
|
+
<vaadin-select-text-field placeholder="[[placeholder]]" label="[[label]]" required="[[required]]" invalid="[[invalid]]" error-message="[[errorMessage]]" readonly\$="[[readonly]]" helper-text="[[helperText]]" theme\$="[[theme]]">
|
|
165
165
|
<slot name="prefix" slot="prefix"></slot>
|
|
166
|
+
<slot name="helper" slot="helper">[[helperText]]</slot>
|
|
166
167
|
<div part="value"></div>
|
|
167
168
|
<div part="toggle-button" slot="suffix" role="button" aria-haspopup="listbox" aria-label="Toggle"></div>
|
|
168
169
|
</vaadin-select-text-field>
|
|
@@ -177,7 +178,7 @@ class SelectElement extends
|
|
|
177
178
|
}
|
|
178
179
|
|
|
179
180
|
static get version() {
|
|
180
|
-
return '2.
|
|
181
|
+
return '2.4.2';
|
|
181
182
|
}
|
|
182
183
|
|
|
183
184
|
static get properties() {
|
|
@@ -282,6 +283,15 @@ class SelectElement extends
|
|
|
282
283
|
type: String
|
|
283
284
|
},
|
|
284
285
|
|
|
286
|
+
/**
|
|
287
|
+
* String used for the helper text.
|
|
288
|
+
* @attr {string} helper-text
|
|
289
|
+
*/
|
|
290
|
+
helperText: {
|
|
291
|
+
type: String,
|
|
292
|
+
value: ''
|
|
293
|
+
},
|
|
294
|
+
|
|
285
295
|
/**
|
|
286
296
|
* When present, it specifies that the element is read-only.
|
|
287
297
|
* @type {boolean}
|
|
@@ -354,7 +364,12 @@ class SelectElement extends
|
|
|
354
364
|
this._nativeInput.setAttribute('tabindex', -1);
|
|
355
365
|
this._nativeInput.style.pointerEvents = 'none';
|
|
356
366
|
|
|
357
|
-
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
|
+
});
|
|
358
373
|
this.focusElement.addEventListener('keydown', e => this._onKeyDown(e));
|
|
359
374
|
|
|
360
375
|
this._observer = new FlattenedNodesObserver(this, info => this._setTemplateFromNodes(info.addedNodes));
|
|
@@ -547,13 +562,9 @@ class SelectElement extends
|
|
|
547
562
|
this._setPosition();
|
|
548
563
|
window.addEventListener('scroll', this._boundSetPosition, true);
|
|
549
564
|
} else if (wasOpened) {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
this.focusElement.focus();
|
|
554
|
-
if (this._openedWithFocusRing) {
|
|
555
|
-
this.focusElement.setAttribute('focus-ring', '');
|
|
556
|
-
}
|
|
565
|
+
this.focusElement.focus();
|
|
566
|
+
if (this._openedWithFocusRing) {
|
|
567
|
+
this.focusElement.setAttribute('focus-ring', '');
|
|
557
568
|
}
|
|
558
569
|
this.validate();
|
|
559
570
|
window.removeEventListener('scroll', this._boundSetPosition, true);
|