@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 CHANGED
@@ -1,21 +1,18 @@
1
- [![npm version](https://badgen.net/npm/v/@vaadin/vaadin-select)](https://www.npmjs.com/package/@vaadin/vaadin-select)
2
- [![Bower version](https://badgen.net/github/release/vaadin/vaadin-select)](https://github.com/vaadin/vaadin-select/releases)
3
- [![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/vaadin/vaadin-select)
4
- [![Build Status](https://travis-ci.org/vaadin/vaadin-select.svg?branch=master)](https://travis-ci.org/vaadin/vaadin-select)
5
- [![Coverage Status](https://coveralls.io/repos/github/vaadin/vaadin-select/badge.svg?branch=master)](https://coveralls.io/github/vaadin/vaadin-select?branch=master)
6
- [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/vaadin/web-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
1
+ # <vaadin-select>
7
2
 
8
- [![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-select)
9
- [![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/vaadinvaadin-select.svg)](https://vaadin.com/directory/component/vaadinvaadin-select)
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
- # &lt;vaadin-select&gt;
6
+ [&lt;vaadin-select&gt;](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://cdn.vaadin.com/vaadin-select/2.0.0-beta1/demo)
8
+ [Live Demo ↗](https://vaadin.com/components/vaadin-select/html-examples)
14
9
  |
15
- [API documentation ↗](https://cdn.vaadin.com/vaadin-select/2.0.0-beta1/#/elements/vaadin-select)
10
+ [API documentation ↗](https://vaadin.com/components/vaadin-select/html-api)
16
11
 
17
-
18
- [&lt;vaadin-select&gt;](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
+ [![npm version](https://badgen.net/npm/v/@vaadin/vaadin-select)](https://www.npmjs.com/package/@vaadin/vaadin-select)
13
+ [![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/vaadin/vaadin-select)
14
+ [![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-select)
15
+ [![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](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.3.0",
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.7.0",
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
- "generate-typings": "gen-typescript-declarations --outDir . --verify"
50
- },
51
- "devDependencies": {
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",
@@ -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
  */
@@ -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.3.0';
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 => this.opened = !this.readonly);
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
- if (this._phone) {
551
- this._setFocused(false);
552
- } else {
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);