@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.
@@ -1,3 +1,3 @@
1
1
  import { SelectElement } from '../src/vaadin-select.js';
2
2
 
3
- export type SelectRenderer = (root: HTMLElement, select: SelectElement) => void;
3
+ export type SelectRenderer = (root: HTMLElement, select?: SelectElement) => void;
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.4.0-alpha1",
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-alpha1",
40
- "@vaadin/vaadin-list-box": "^1.4.0-alpha1",
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-alpha1",
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-alpha1",
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
  }
@@ -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
 
@@ -178,7 +178,7 @@ class SelectElement extends
178
178
  }
179
179
 
180
180
  static get version() {
181
- return '2.4.0-alpha1';
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 => 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
+ });
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
- if (this._phone) {
559
- this._setFocused(false);
560
- } else {
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);
@@ -12,3 +12,4 @@
12
12
  // tslint:disable:variable-name Describing an API that's defined elsewhere.
13
13
 
14
14
  export * from './src/vaadin-select.js';
15
+ export * from './@types/interfaces';