@vaadin/combo-box 23.2.0 → 23.3.0-alpha1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/combo-box",
3
- "version": "23.2.0",
3
+ "version": "23.3.0-alpha1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,21 +38,21 @@
38
38
  "dependencies": {
39
39
  "@open-wc/dedupe-mixin": "^1.3.0",
40
40
  "@polymer/polymer": "^3.0.0",
41
- "@vaadin/component-base": "^23.2.0",
42
- "@vaadin/field-base": "^23.2.0",
43
- "@vaadin/input-container": "^23.2.0",
44
- "@vaadin/item": "^23.2.0",
45
- "@vaadin/lit-renderer": "^23.2.0",
46
- "@vaadin/vaadin-lumo-styles": "^23.2.0",
47
- "@vaadin/vaadin-material-styles": "^23.2.0",
48
- "@vaadin/vaadin-overlay": "^23.2.0",
49
- "@vaadin/vaadin-themable-mixin": "^23.2.0"
41
+ "@vaadin/component-base": "23.3.0-alpha1",
42
+ "@vaadin/field-base": "23.3.0-alpha1",
43
+ "@vaadin/input-container": "23.3.0-alpha1",
44
+ "@vaadin/item": "23.3.0-alpha1",
45
+ "@vaadin/lit-renderer": "23.3.0-alpha1",
46
+ "@vaadin/vaadin-lumo-styles": "23.3.0-alpha1",
47
+ "@vaadin/vaadin-material-styles": "23.3.0-alpha1",
48
+ "@vaadin/vaadin-overlay": "23.3.0-alpha1",
49
+ "@vaadin/vaadin-themable-mixin": "23.3.0-alpha1"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@esm-bundle/chai": "^4.3.4",
53
- "@vaadin/polymer-legacy-adapter": "^23.2.0",
53
+ "@vaadin/polymer-legacy-adapter": "23.3.0-alpha1",
54
54
  "@vaadin/testing-helpers": "^0.3.2",
55
- "@vaadin/text-field": "^23.2.0",
55
+ "@vaadin/text-field": "23.3.0-alpha1",
56
56
  "lit": "^2.0.0",
57
57
  "sinon": "^13.0.2"
58
58
  },
@@ -60,5 +60,5 @@
60
60
  "web-types.json",
61
61
  "web-types.lit.json"
62
62
  ],
63
- "gitHead": "8b1f5941f26ac41ca038e75e24c8584e331bc7a8"
63
+ "gitHead": "beabc527d4b1274eb798ff701d406fed45cfe638"
64
64
  }
@@ -169,9 +169,7 @@ export class ComboBoxScroller extends PolymerElement {
169
169
  }
170
170
 
171
171
  requestContentUpdate() {
172
- if (this.__virtualizer) {
173
- this.__virtualizer.update();
174
- }
172
+ this.__virtualizer.update();
175
173
  }
176
174
 
177
175
  scrollIntoView(index) {
@@ -249,24 +247,16 @@ export class ComboBoxScroller extends PolymerElement {
249
247
 
250
248
  /** @private */
251
249
  __loadingChanged() {
252
- if (this.__virtualizer) {
253
- setTimeout(() => this.requestContentUpdate());
254
- }
250
+ setTimeout(() => this.requestContentUpdate());
255
251
  }
256
252
 
257
253
  /** @private */
258
254
  __selectedItemChanged() {
259
- if (this.__virtualizer) {
260
- this.requestContentUpdate();
261
- }
255
+ this.requestContentUpdate();
262
256
  }
263
257
 
264
258
  /** @private */
265
259
  __focusedIndexChanged(index, oldIndex) {
266
- if (!this.__virtualizer) {
267
- return;
268
- }
269
-
270
260
  if (index !== oldIndex) {
271
261
  this.requestContentUpdate();
272
262
  }
@@ -304,7 +294,7 @@ export class ComboBoxScroller extends PolymerElement {
304
294
 
305
295
  el.setProperties({
306
296
  item,
307
- index: this.__requestItemByIndex(item, index),
297
+ index,
308
298
  label: this.getItemLabel(item),
309
299
  selected: this.__isItemSelected(item, this.selectedItem, this.itemIdPath),
310
300
  renderer: this.renderer,
@@ -321,6 +311,10 @@ export class ComboBoxScroller extends PolymerElement {
321
311
  } else {
322
312
  el.removeAttribute('theme');
323
313
  }
314
+
315
+ if (item instanceof ComboBoxPlaceholder) {
316
+ this.__requestItemByIndex(index);
317
+ }
324
318
  }
325
319
 
326
320
  /** @private */
@@ -361,19 +355,18 @@ export class ComboBoxScroller extends PolymerElement {
361
355
  }
362
356
 
363
357
  /**
364
- * If dataProvider is used, dispatch a request for the item’s index if
365
- * the item is a placeholder object.
366
- *
367
- * @return {number}
358
+ * Dispatches an `index-requested` event for the given index to notify
359
+ * the data provider that it should start loading the page containing the requested index.
368
360
  */
369
- __requestItemByIndex(item, index) {
370
- if (item instanceof ComboBoxPlaceholder && index !== undefined) {
371
- this.dispatchEvent(
372
- new CustomEvent('index-requested', { detail: { index, currentScrollerPos: this._oldScrollerPosition } }),
373
- );
374
- }
375
-
376
- return index;
361
+ __requestItemByIndex(index) {
362
+ this.dispatchEvent(
363
+ new CustomEvent('index-requested', {
364
+ detail: {
365
+ index,
366
+ currentScrollerPos: this._oldScrollerPosition,
367
+ },
368
+ }),
369
+ );
377
370
  }
378
371
 
379
372
  /** @private */
@@ -9,6 +9,7 @@ import './vaadin-combo-box-overlay.js';
9
9
  import './vaadin-combo-box-scroller.js';
10
10
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
11
11
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
12
+ import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
12
13
  import { InputControlMixin } from '@vaadin/field-base/src/input-control-mixin.js';
13
14
  import { InputController } from '@vaadin/field-base/src/input-controller.js';
14
15
  import { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';
@@ -209,6 +210,8 @@ class ComboBox extends ComboBoxDataProviderMixin(
209
210
  no-vertical-overlap
210
211
  restore-focus-node="[[inputElement]]"
211
212
  ></vaadin-combo-box-overlay>
213
+
214
+ <slot name="tooltip"></slot>
212
215
  `;
213
216
  }
214
217
 
@@ -245,6 +248,11 @@ class ComboBox extends ComboBoxDataProviderMixin(
245
248
  }),
246
249
  );
247
250
  this.addController(new LabelledInputController(this.inputElement, this._labelController));
251
+
252
+ this._tooltipController = new TooltipController(this);
253
+ this.addController(this._tooltipController);
254
+ this._tooltipController.setShouldShow((target) => !target.opened);
255
+
248
256
  this._positionTarget = this.shadowRoot.querySelector('[part="input-field"]');
249
257
  this._toggleElement = this.$.toggleButton;
250
258
  }
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/combo-box",
4
- "version": "23.2.0",
4
+ "version": "23.3.0-alpha1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -376,13 +376,29 @@
376
376
  {
377
377
  "name": "validated",
378
378
  "description": "Fired whenever the field is validated."
379
+ },
380
+ {
381
+ "name": "opened-changed",
382
+ "description": "Fired when the `opened` property changes."
383
+ },
384
+ {
385
+ "name": "filter-changed",
386
+ "description": "Fired when the `filter` property changes."
387
+ },
388
+ {
389
+ "name": "selectedItem-changed",
390
+ "description": "Fired when the `selectedItem` property changes."
391
+ },
392
+ {
393
+ "name": "invalid-changed",
394
+ "description": "Fired when the `invalid` property changes."
379
395
  }
380
396
  ]
381
397
  }
382
398
  },
383
399
  {
384
400
  "name": "vaadin-combo-box",
385
- "description": "`<vaadin-combo-box>` is a web component for choosing a value from a filterable list of options\npresented in a dropdown overlay. The options can be provided as a list of strings or objects\nby setting [`items`](https://cdn.vaadin.com/vaadin-web-components/23.2.0/#/elements/vaadin-combo-box#property-items) property on the element.\n\n```html\n<vaadin-combo-box id=\"combo-box\"></vaadin-combo-box>\n```\n```js\ndocument.querySelector('#combo-box').items = ['apple', 'orange', 'banana'];\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Item rendering\n\nTo customize the content of the `<vaadin-combo-box-item>` elements placed in the dropdown, use\n[`renderer`](https://cdn.vaadin.com/vaadin-web-components/23.2.0/#/elements/vaadin-combo-box#property-renderer) property which accepts a function.\nThe renderer function is called with `root`, `comboBox`, and `model` as arguments.\n\nGenerate DOM content by using `model` object properties if needed, and append it to the `root`\nelement. The `comboBox` reference is provided to access the combo-box element state. Do not\nset combo-box properties in a `renderer` function.\n\n```js\nconst comboBox = document.querySelector('#combo-box');\ncomboBox.items = [{'label': 'Hydrogen', 'value': 'H'}];\ncomboBox.renderer = (root, comboBox, model) => {\n const item = model.item;\n root.innerHTML = `${model.index}: ${item.label} <b>${item.value}</b>`;\n};\n```\n\nRenderer is called on the opening of the combo-box and each time the related model is updated.\nBefore creating new content, it is recommended to check if there is already an existing DOM\nelement in `root` from a previous renderer call for reusing it. Even though combo-box uses\ninfinite scrolling, reducing DOM operations might improve performance.\n\nThe following properties are available in the `model` argument:\n\nProperty | Type | Description\n-----------|------------------|-------------\n`index` | Number | Index of the item in the `items` array\n`item` | String or Object | The item reference\n`selected` | Boolean | True when item is selected\n`focused` | Boolean | True when item is focused\n\n### Lazy Loading with Function Data Provider\n\nIn addition to assigning an array to the items property, you can alternatively use the\n[`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/23.2.0/#/elements/vaadin-combo-box#property-dataProvider) function property.\nThe `<vaadin-combo-box>` calls this function lazily, only when it needs more data\nto be displayed.\n\n__Note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ncomboBox.dataProvider = function(params, callback) {\n var url = 'https://api.example/data' +\n '?page=' + params.page + // the requested page index\n '&per_page=' + params.pageSize; // number of items on the page\n var xhr = new XMLHttpRequest();\n xhr.onload = function() {\n var response = JSON.parse(xhr.responseText);\n callback(\n response.employees, // requested page of items\n response.totalSize // total number of items\n );\n };\n xhr.open('GET', url, true);\n xhr.send();\n};\n```\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n----------------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n`--vaadin-combo-box-overlay-width` | Width of the overlay | `auto`\n`--vaadin-combo-box-overlay-max-height` | Max height of the overlay | `65vh`\n\n`<vaadin-combo-box>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/23.2.0/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n----------------|----------------\n`toggle-button` | The toggle button\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description | Part name\n----------|-------------|------------\n`opened` | Set when the combo box dropdown is open | :host\n`loading` | Set when new items are expected | :host\n\nIf you want to replace the default `<input>` and its container with a custom implementation to get full control\nover the input field, consider using the [`<vaadin-combo-box-light>`](https://cdn.vaadin.com/vaadin-web-components/23.2.0/#/elements/vaadin-combo-box-light) element.\n\n### Internal components\n\nIn addition to `<vaadin-combo-box>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-combo-box-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/23.2.0/#/elements/vaadin-overlay).\n- `<vaadin-combo-box-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/23.2.0/#/elements/vaadin-item).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/23.2.0/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nNote: the `theme` attribute value set on `<vaadin-combo-box>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.",
401
+ "description": "`<vaadin-combo-box>` is a web component for choosing a value from a filterable list of options\npresented in a dropdown overlay. The options can be provided as a list of strings or objects\nby setting [`items`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-combo-box#property-items) property on the element.\n\n```html\n<vaadin-combo-box id=\"combo-box\"></vaadin-combo-box>\n```\n```js\ndocument.querySelector('#combo-box').items = ['apple', 'orange', 'banana'];\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Item rendering\n\nTo customize the content of the `<vaadin-combo-box-item>` elements placed in the dropdown, use\n[`renderer`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-combo-box#property-renderer) property which accepts a function.\nThe renderer function is called with `root`, `comboBox`, and `model` as arguments.\n\nGenerate DOM content by using `model` object properties if needed, and append it to the `root`\nelement. The `comboBox` reference is provided to access the combo-box element state. Do not\nset combo-box properties in a `renderer` function.\n\n```js\nconst comboBox = document.querySelector('#combo-box');\ncomboBox.items = [{'label': 'Hydrogen', 'value': 'H'}];\ncomboBox.renderer = (root, comboBox, model) => {\n const item = model.item;\n root.innerHTML = `${model.index}: ${item.label} <b>${item.value}</b>`;\n};\n```\n\nRenderer is called on the opening of the combo-box and each time the related model is updated.\nBefore creating new content, it is recommended to check if there is already an existing DOM\nelement in `root` from a previous renderer call for reusing it. Even though combo-box uses\ninfinite scrolling, reducing DOM operations might improve performance.\n\nThe following properties are available in the `model` argument:\n\nProperty | Type | Description\n-----------|------------------|-------------\n`index` | Number | Index of the item in the `items` array\n`item` | String or Object | The item reference\n`selected` | Boolean | True when item is selected\n`focused` | Boolean | True when item is focused\n\n### Lazy Loading with Function Data Provider\n\nIn addition to assigning an array to the items property, you can alternatively use the\n[`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-combo-box#property-dataProvider) function property.\nThe `<vaadin-combo-box>` calls this function lazily, only when it needs more data\nto be displayed.\n\n__Note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ncomboBox.dataProvider = function(params, callback) {\n var url = 'https://api.example/data' +\n '?page=' + params.page + // the requested page index\n '&per_page=' + params.pageSize; // number of items on the page\n var xhr = new XMLHttpRequest();\n xhr.onload = function() {\n var response = JSON.parse(xhr.responseText);\n callback(\n response.employees, // requested page of items\n response.totalSize // total number of items\n );\n };\n xhr.open('GET', url, true);\n xhr.send();\n};\n```\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n----------------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n`--vaadin-combo-box-overlay-width` | Width of the overlay | `auto`\n`--vaadin-combo-box-overlay-max-height` | Max height of the overlay | `65vh`\n\n`<vaadin-combo-box>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n----------------|----------------\n`toggle-button` | The toggle button\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description | Part name\n----------|-------------|------------\n`opened` | Set when the combo box dropdown is open | :host\n`loading` | Set when new items are expected | :host\n\nIf you want to replace the default `<input>` and its container with a custom implementation to get full control\nover the input field, consider using the [`<vaadin-combo-box-light>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-combo-box-light) element.\n\n### Internal components\n\nIn addition to `<vaadin-combo-box>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-combo-box-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-overlay).\n- `<vaadin-combo-box-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-item).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nNote: the `theme` attribute value set on `<vaadin-combo-box>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.",
386
402
  "attributes": [
387
403
  {
388
404
  "name": "disabled",
@@ -1044,6 +1060,22 @@
1044
1060
  {
1045
1061
  "name": "value-changed",
1046
1062
  "description": "Fired when the value changes."
1063
+ },
1064
+ {
1065
+ "name": "invalid-changed",
1066
+ "description": "Fired when the `invalid` property changes."
1067
+ },
1068
+ {
1069
+ "name": "opened-changed",
1070
+ "description": "Fired when the `opened` property changes."
1071
+ },
1072
+ {
1073
+ "name": "filter-changed",
1074
+ "description": "Fired when the `filter` property changes."
1075
+ },
1076
+ {
1077
+ "name": "selectedItem-changed",
1078
+ "description": "Fired when the `selectedItem` property changes."
1047
1079
  }
1048
1080
  ]
1049
1081
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/combo-box",
4
- "version": "23.2.0",
4
+ "version": "23.3.0-alpha1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -200,12 +200,40 @@
200
200
  "value": {
201
201
  "kind": "expression"
202
202
  }
203
+ },
204
+ {
205
+ "name": "@opened-changed",
206
+ "description": "Fired when the `opened` property changes.",
207
+ "value": {
208
+ "kind": "expression"
209
+ }
210
+ },
211
+ {
212
+ "name": "@filter-changed",
213
+ "description": "Fired when the `filter` property changes.",
214
+ "value": {
215
+ "kind": "expression"
216
+ }
217
+ },
218
+ {
219
+ "name": "@selectedItem-changed",
220
+ "description": "Fired when the `selectedItem` property changes.",
221
+ "value": {
222
+ "kind": "expression"
223
+ }
224
+ },
225
+ {
226
+ "name": "@invalid-changed",
227
+ "description": "Fired when the `invalid` property changes.",
228
+ "value": {
229
+ "kind": "expression"
230
+ }
203
231
  }
204
232
  ]
205
233
  },
206
234
  {
207
235
  "name": "vaadin-combo-box",
208
- "description": "`<vaadin-combo-box>` is a web component for choosing a value from a filterable list of options\npresented in a dropdown overlay. The options can be provided as a list of strings or objects\nby setting [`items`](https://cdn.vaadin.com/vaadin-web-components/23.2.0/#/elements/vaadin-combo-box#property-items) property on the element.\n\n```html\n<vaadin-combo-box id=\"combo-box\"></vaadin-combo-box>\n```\n```js\ndocument.querySelector('#combo-box').items = ['apple', 'orange', 'banana'];\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Item rendering\n\nTo customize the content of the `<vaadin-combo-box-item>` elements placed in the dropdown, use\n[`renderer`](https://cdn.vaadin.com/vaadin-web-components/23.2.0/#/elements/vaadin-combo-box#property-renderer) property which accepts a function.\nThe renderer function is called with `root`, `comboBox`, and `model` as arguments.\n\nGenerate DOM content by using `model` object properties if needed, and append it to the `root`\nelement. The `comboBox` reference is provided to access the combo-box element state. Do not\nset combo-box properties in a `renderer` function.\n\n```js\nconst comboBox = document.querySelector('#combo-box');\ncomboBox.items = [{'label': 'Hydrogen', 'value': 'H'}];\ncomboBox.renderer = (root, comboBox, model) => {\n const item = model.item;\n root.innerHTML = `${model.index}: ${item.label} <b>${item.value}</b>`;\n};\n```\n\nRenderer is called on the opening of the combo-box and each time the related model is updated.\nBefore creating new content, it is recommended to check if there is already an existing DOM\nelement in `root` from a previous renderer call for reusing it. Even though combo-box uses\ninfinite scrolling, reducing DOM operations might improve performance.\n\nThe following properties are available in the `model` argument:\n\nProperty | Type | Description\n-----------|------------------|-------------\n`index` | Number | Index of the item in the `items` array\n`item` | String or Object | The item reference\n`selected` | Boolean | True when item is selected\n`focused` | Boolean | True when item is focused\n\n### Lazy Loading with Function Data Provider\n\nIn addition to assigning an array to the items property, you can alternatively use the\n[`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/23.2.0/#/elements/vaadin-combo-box#property-dataProvider) function property.\nThe `<vaadin-combo-box>` calls this function lazily, only when it needs more data\nto be displayed.\n\n__Note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ncomboBox.dataProvider = function(params, callback) {\n var url = 'https://api.example/data' +\n '?page=' + params.page + // the requested page index\n '&per_page=' + params.pageSize; // number of items on the page\n var xhr = new XMLHttpRequest();\n xhr.onload = function() {\n var response = JSON.parse(xhr.responseText);\n callback(\n response.employees, // requested page of items\n response.totalSize // total number of items\n );\n };\n xhr.open('GET', url, true);\n xhr.send();\n};\n```\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n----------------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n`--vaadin-combo-box-overlay-width` | Width of the overlay | `auto`\n`--vaadin-combo-box-overlay-max-height` | Max height of the overlay | `65vh`\n\n`<vaadin-combo-box>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/23.2.0/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n----------------|----------------\n`toggle-button` | The toggle button\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description | Part name\n----------|-------------|------------\n`opened` | Set when the combo box dropdown is open | :host\n`loading` | Set when new items are expected | :host\n\nIf you want to replace the default `<input>` and its container with a custom implementation to get full control\nover the input field, consider using the [`<vaadin-combo-box-light>`](https://cdn.vaadin.com/vaadin-web-components/23.2.0/#/elements/vaadin-combo-box-light) element.\n\n### Internal components\n\nIn addition to `<vaadin-combo-box>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-combo-box-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/23.2.0/#/elements/vaadin-overlay).\n- `<vaadin-combo-box-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/23.2.0/#/elements/vaadin-item).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/23.2.0/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nNote: the `theme` attribute value set on `<vaadin-combo-box>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.",
236
+ "description": "`<vaadin-combo-box>` is a web component for choosing a value from a filterable list of options\npresented in a dropdown overlay. The options can be provided as a list of strings or objects\nby setting [`items`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-combo-box#property-items) property on the element.\n\n```html\n<vaadin-combo-box id=\"combo-box\"></vaadin-combo-box>\n```\n```js\ndocument.querySelector('#combo-box').items = ['apple', 'orange', 'banana'];\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Item rendering\n\nTo customize the content of the `<vaadin-combo-box-item>` elements placed in the dropdown, use\n[`renderer`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-combo-box#property-renderer) property which accepts a function.\nThe renderer function is called with `root`, `comboBox`, and `model` as arguments.\n\nGenerate DOM content by using `model` object properties if needed, and append it to the `root`\nelement. The `comboBox` reference is provided to access the combo-box element state. Do not\nset combo-box properties in a `renderer` function.\n\n```js\nconst comboBox = document.querySelector('#combo-box');\ncomboBox.items = [{'label': 'Hydrogen', 'value': 'H'}];\ncomboBox.renderer = (root, comboBox, model) => {\n const item = model.item;\n root.innerHTML = `${model.index}: ${item.label} <b>${item.value}</b>`;\n};\n```\n\nRenderer is called on the opening of the combo-box and each time the related model is updated.\nBefore creating new content, it is recommended to check if there is already an existing DOM\nelement in `root` from a previous renderer call for reusing it. Even though combo-box uses\ninfinite scrolling, reducing DOM operations might improve performance.\n\nThe following properties are available in the `model` argument:\n\nProperty | Type | Description\n-----------|------------------|-------------\n`index` | Number | Index of the item in the `items` array\n`item` | String or Object | The item reference\n`selected` | Boolean | True when item is selected\n`focused` | Boolean | True when item is focused\n\n### Lazy Loading with Function Data Provider\n\nIn addition to assigning an array to the items property, you can alternatively use the\n[`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-combo-box#property-dataProvider) function property.\nThe `<vaadin-combo-box>` calls this function lazily, only when it needs more data\nto be displayed.\n\n__Note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ncomboBox.dataProvider = function(params, callback) {\n var url = 'https://api.example/data' +\n '?page=' + params.page + // the requested page index\n '&per_page=' + params.pageSize; // number of items on the page\n var xhr = new XMLHttpRequest();\n xhr.onload = function() {\n var response = JSON.parse(xhr.responseText);\n callback(\n response.employees, // requested page of items\n response.totalSize // total number of items\n );\n };\n xhr.open('GET', url, true);\n xhr.send();\n};\n```\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n----------------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n`--vaadin-combo-box-overlay-width` | Width of the overlay | `auto`\n`--vaadin-combo-box-overlay-max-height` | Max height of the overlay | `65vh`\n\n`<vaadin-combo-box>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n----------------|----------------\n`toggle-button` | The toggle button\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description | Part name\n----------|-------------|------------\n`opened` | Set when the combo box dropdown is open | :host\n`loading` | Set when new items are expected | :host\n\nIf you want to replace the default `<input>` and its container with a custom implementation to get full control\nover the input field, consider using the [`<vaadin-combo-box-light>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-combo-box-light) element.\n\n### Internal components\n\nIn addition to `<vaadin-combo-box>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-combo-box-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-overlay).\n- `<vaadin-combo-box-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-item).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha1/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nNote: the `theme` attribute value set on `<vaadin-combo-box>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.",
209
237
  "extension": true,
210
238
  "attributes": [
211
239
  {
@@ -487,6 +515,34 @@
487
515
  "value": {
488
516
  "kind": "expression"
489
517
  }
518
+ },
519
+ {
520
+ "name": "@invalid-changed",
521
+ "description": "Fired when the `invalid` property changes.",
522
+ "value": {
523
+ "kind": "expression"
524
+ }
525
+ },
526
+ {
527
+ "name": "@opened-changed",
528
+ "description": "Fired when the `opened` property changes.",
529
+ "value": {
530
+ "kind": "expression"
531
+ }
532
+ },
533
+ {
534
+ "name": "@filter-changed",
535
+ "description": "Fired when the `filter` property changes.",
536
+ "value": {
537
+ "kind": "expression"
538
+ }
539
+ },
540
+ {
541
+ "name": "@selectedItem-changed",
542
+ "description": "Fired when the `selectedItem` property changes.",
543
+ "value": {
544
+ "kind": "expression"
545
+ }
490
546
  }
491
547
  ]
492
548
  }