@vaadin/select 24.2.3 → 24.3.0-alpha10

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/select",
3
- "version": "24.2.3",
3
+ "version": "24.3.0-alpha10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -47,28 +47,28 @@
47
47
  "dependencies": {
48
48
  "@open-wc/dedupe-mixin": "^1.3.0",
49
49
  "@polymer/polymer": "^3.2.0",
50
- "@vaadin/a11y-base": "~24.2.3",
51
- "@vaadin/button": "~24.2.3",
52
- "@vaadin/component-base": "~24.2.3",
53
- "@vaadin/field-base": "~24.2.3",
54
- "@vaadin/input-container": "~24.2.3",
55
- "@vaadin/item": "~24.2.3",
56
- "@vaadin/list-box": "~24.2.3",
57
- "@vaadin/lit-renderer": "~24.2.3",
58
- "@vaadin/overlay": "~24.2.3",
59
- "@vaadin/vaadin-lumo-styles": "~24.2.3",
60
- "@vaadin/vaadin-material-styles": "~24.2.3",
61
- "@vaadin/vaadin-themable-mixin": "~24.2.3"
50
+ "@vaadin/a11y-base": "24.3.0-alpha10",
51
+ "@vaadin/button": "24.3.0-alpha10",
52
+ "@vaadin/component-base": "24.3.0-alpha10",
53
+ "@vaadin/field-base": "24.3.0-alpha10",
54
+ "@vaadin/input-container": "24.3.0-alpha10",
55
+ "@vaadin/item": "24.3.0-alpha10",
56
+ "@vaadin/list-box": "24.3.0-alpha10",
57
+ "@vaadin/lit-renderer": "24.3.0-alpha10",
58
+ "@vaadin/overlay": "24.3.0-alpha10",
59
+ "@vaadin/vaadin-lumo-styles": "24.3.0-alpha10",
60
+ "@vaadin/vaadin-material-styles": "24.3.0-alpha10",
61
+ "@vaadin/vaadin-themable-mixin": "24.3.0-alpha10"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@esm-bundle/chai": "^4.3.4",
65
- "@vaadin/testing-helpers": "^0.5.0",
66
- "lit": "^2.0.0",
65
+ "@vaadin/testing-helpers": "^0.6.0",
66
+ "lit": "^3.0.0",
67
67
  "sinon": "^13.0.2"
68
68
  },
69
69
  "web-types": [
70
70
  "web-types.json",
71
71
  "web-types.lit.json"
72
72
  ],
73
- "gitHead": "72e557e765e72559e9c6a525e257d185ad186dc5"
73
+ "gitHead": "0271523d93fe5df0425ff64206886614f3c6f401"
74
74
  }
@@ -40,8 +40,8 @@ export declare class SelectBaseMixinClass {
40
40
  * select.items = [
41
41
  * { label: 'Most recent first', value: 'recent' },
42
42
  * { component: 'hr' },
43
- * { label: 'Rating: low to high', value: 'rating-asc' },
44
- * { label: 'Rating: high to low', value: 'rating-desc' },
43
+ * { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },
44
+ * { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },
45
45
  * { component: 'hr' },
46
46
  * { label: 'Price: low to high', value: 'price-asc', disabled: true },
47
47
  * { label: 'Price: high to low', value: 'price-desc', disabled: true }
@@ -37,8 +37,8 @@ export const SelectBaseMixin = (superClass) =>
37
37
  * select.items = [
38
38
  * { label: 'Most recent first', value: 'recent' },
39
39
  * { component: 'hr' },
40
- * { label: 'Rating: low to high', value: 'rating-asc' },
41
- * { label: 'Rating: high to low', value: 'rating-desc' },
40
+ * { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },
41
+ * { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },
42
42
  * { component: 'hr' },
43
43
  * { label: 'Price: low to high', value: 'price-asc', disabled: true },
44
44
  * { label: 'Price: high to low', value: 'price-desc', disabled: true }
@@ -436,6 +436,9 @@ export const SelectBaseMixin = (superClass) =>
436
436
  if (item.disabled) {
437
437
  itemElement.disabled = item.disabled;
438
438
  }
439
+ if (item.className) {
440
+ itemElement.className = item.className;
441
+ }
439
442
  return itemElement;
440
443
  }
441
444
 
@@ -12,6 +12,7 @@ export interface SelectItem {
12
12
  value?: string;
13
13
  component?: string;
14
14
  disabled?: boolean;
15
+ className?: string;
15
16
  }
16
17
 
17
18
  /**
@@ -80,8 +81,8 @@ export interface SelectEventMap extends HTMLElementEventMap, SelectCustomEventMa
80
81
  * select.items = [
81
82
  * { label: 'Most recent first', value: 'recent' },
82
83
  * { component: 'hr' },
83
- * { label: 'Rating: low to high', value: 'rating-asc' },
84
- * { label: 'Rating: high to low', value: 'rating-desc' },
84
+ * { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },
85
+ * { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },
85
86
  * { component: 'hr' },
86
87
  * { label: 'Price: low to high', value: 'price-asc', disabled: true },
87
88
  * { label: 'Price: high to low', value: 'price-desc', disabled: true }
@@ -37,8 +37,8 @@ registerStyles('vaadin-select', [fieldShared, inputFieldContainer, screenReaderO
37
37
  * select.items = [
38
38
  * { label: 'Most recent first', value: 'recent' },
39
39
  * { component: 'hr' },
40
- * { label: 'Rating: low to high', value: 'rating-asc' },
41
- * { label: 'Rating: high to low', value: 'rating-desc' },
40
+ * { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },
41
+ * { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },
42
42
  * { component: 'hr' },
43
43
  * { label: 'Price: low to high', value: 'price-asc', disabled: true },
44
44
  * { label: 'Price: high to low', value: 'price-desc', disabled: true }
@@ -3,6 +3,7 @@
3
3
  * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
6
7
  import '@vaadin/vaadin-lumo-styles/sizing.js';
7
8
  import '@vaadin/vaadin-lumo-styles/style.js';
8
9
  import '@vaadin/vaadin-lumo-styles/font-icons.js';
@@ -30,7 +31,7 @@ const select = css`
30
31
  }
31
32
 
32
33
  [part='input-field'] ::slotted([slot='value']:not([placeholder])) {
33
- color: var(--lumo-body-text-color);
34
+ color: var(--vaadin-input-field-value-color, var(--lumo-body-text-color));
34
35
  }
35
36
 
36
37
  :host([readonly]) [part='input-field'] ::slotted([slot='value']:not([placeholder])) {
@@ -39,7 +40,7 @@ const select = css`
39
40
 
40
41
  /* placeholder styles */
41
42
  [part='input-field'] ::slotted([slot='value'][placeholder]) {
42
- color: var(--lumo-secondary-text-color);
43
+ color: var(--vaadin-input-field-placeholder-color, var(--lumo-secondary-text-color));
43
44
  }
44
45
 
45
46
  :host(:is([readonly], [disabled])) ::slotted([slot='value'][placeholder]) {
@@ -68,7 +69,7 @@ registerStyles(
68
69
  css`
69
70
  :host {
70
71
  font-family: var(--lumo-font-family);
71
- font-size: var(--lumo-font-size-m);
72
+ font-size: var(--vaadin-input-field-value-font-size, var(--lumo-font-size-m));
72
73
  padding: 0 0.25em;
73
74
  --_lumo-selected-item-height: var(--lumo-size-m);
74
75
  --_lumo-selected-item-padding: 0.5em;
@@ -3,6 +3,5 @@
3
3
  * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import '@vaadin/input-container/theme/lumo/vaadin-input-container.js';
7
6
  import './vaadin-select-styles.js';
8
7
  import '../../src/vaadin-select.js';
@@ -3,6 +3,7 @@
3
3
  * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import '@vaadin/input-container/theme/material/vaadin-input-container-styles.js';
6
7
  import '@vaadin/vaadin-material-styles/font-icons.js';
7
8
  import { item } from '@vaadin/item/theme/material/vaadin-item-styles.js';
8
9
  import { listBox } from '@vaadin/list-box/theme/material/vaadin-list-box-styles.js';
@@ -3,6 +3,5 @@
3
3
  * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import '@vaadin/input-container/theme/material/vaadin-input-container.js';
7
6
  import './vaadin-select-styles.js';
8
7
  import '../../src/vaadin-select.js';
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/select",
4
- "version": "24.2.3",
4
+ "version": "24.3.0-alpha10",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-select",
11
- "description": "`<vaadin-select>` is a Web Component for selecting values from a list of items.\n\n### Items\n\nUse the `items` property to define possible options for the select:\n\n```html\n<vaadin-select id=\"select\"></vaadin-select>\n```\n```js\nconst select = document.querySelector('#select');\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc' },\n { label: 'Rating: high to low', value: 'rating-desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\n### Rendering\n\nAlternatively, the content of the select can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `select` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `select`.\n\n```js\nconst select = document.querySelector('#select');\nselect.renderer = function(root, select) {\n const listBox = document.createElement('vaadin-list-box');\n // append 3 <vaadin-item> elements\n ['Jose', 'Manolo', 'Pedro'].forEach(function(name) {\n const item = document.createElement('vaadin-item');\n item.textContent = name;\n item.setAttribute('label', name)\n listBox.appendChild(item);\n });\n\n // update the content\n root.appendChild(listBox);\n};\n```\n\nRenderer is called on initialization of new select and on its opening.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n* Hint: By setting the `label` property of inner vaadin-items you will\nbe able to change the visual representation of the selected value in the input part.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Target element | Default\n-----------------------------------|------------------------------|----------------------------------\n`--vaadin-field-default-width` | Default width of the field | :host | `12em`\n`--vaadin-select-text-field-width` | Effective width of the field | `vaadin-select-overlay` |\n\n`<vaadin-select>` provides mostly 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/24.2.3/#/elements/vaadin-text-field) for the styling documentation.\n\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 select is open | :host\n\nThere are two exceptions in terms of styling compared to `<vaadin-text-field>`:\n- the `clear-button` shadow DOM part does not exist in `<vaadin-select>`.\n- the `input-prevented` state attribute is not supported by `<vaadin-select>`.\n\n### Internal components\n\nIn addition to `<vaadin-select>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-select-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.2.3/#/elements/vaadin-overlay).\n- `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/24.2.3/#/elements/vaadin-button).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.2.3/#/elements/vaadin-input-container) - an internal element wrapping the button.\n\nNote: the `theme` attribute value set on `<vaadin-select>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
11
+ "description": "`<vaadin-select>` is a Web Component for selecting values from a list of items.\n\n### Items\n\nUse the `items` property to define possible options for the select:\n\n```html\n<vaadin-select id=\"select\"></vaadin-select>\n```\n```js\nconst select = document.querySelector('#select');\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },\n { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\n### Rendering\n\nAlternatively, the content of the select can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `select` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `select`.\n\n```js\nconst select = document.querySelector('#select');\nselect.renderer = function(root, select) {\n const listBox = document.createElement('vaadin-list-box');\n // append 3 <vaadin-item> elements\n ['Jose', 'Manolo', 'Pedro'].forEach(function(name) {\n const item = document.createElement('vaadin-item');\n item.textContent = name;\n item.setAttribute('label', name)\n listBox.appendChild(item);\n });\n\n // update the content\n root.appendChild(listBox);\n};\n```\n\nRenderer is called on initialization of new select and on its opening.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n* Hint: By setting the `label` property of inner vaadin-items you will\nbe able to change the visual representation of the selected value in the input part.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Target element | Default\n-----------------------------------|------------------------------|----------------------------------\n`--vaadin-field-default-width` | Default width of the field | :host | `12em`\n`--vaadin-select-text-field-width` | Effective width of the field | `vaadin-select-overlay` |\n\n`<vaadin-select>` provides mostly 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/24.3.0-alpha10/#/elements/vaadin-text-field) for the styling documentation.\n\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 select is open | :host\n\nThere are two exceptions in terms of styling compared to `<vaadin-text-field>`:\n- the `clear-button` shadow DOM part does not exist in `<vaadin-select>`.\n- the `input-prevented` state attribute is not supported by `<vaadin-select>`.\n\n### Internal components\n\nIn addition to `<vaadin-select>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-select-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha10/#/elements/vaadin-overlay).\n- `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha10/#/elements/vaadin-button).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha10/#/elements/vaadin-input-container) - an internal element wrapping the button.\n\nNote: the `theme` attribute value set on `<vaadin-select>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "disabled",
@@ -295,7 +295,7 @@
295
295
  },
296
296
  {
297
297
  "name": "items",
298
- "description": "An array containing items that will be rendered as the options of the select.\n\n#### Example\n```js\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc' },\n { label: 'Rating: high to low', value: 'rating-desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\nNote: each item is rendered by default as the internal `<vaadin-select-item>` that is an extension of `<vaadin-item>`.\nTo render the item with a custom component, provide a tag name by the `component` property.",
298
+ "description": "An array containing items that will be rendered as the options of the select.\n\n#### Example\n```js\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },\n { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\nNote: each item is rendered by default as the internal `<vaadin-select-item>` that is an extension of `<vaadin-item>`.\nTo render the item with a custom component, provide a tag name by the `component` property.",
299
299
  "value": {
300
300
  "type": [
301
301
  "Array.<SelectItem>"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/select",
4
- "version": "24.2.3",
4
+ "version": "24.3.0-alpha10",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -16,7 +16,7 @@
16
16
  "elements": [
17
17
  {
18
18
  "name": "vaadin-select",
19
- "description": "`<vaadin-select>` is a Web Component for selecting values from a list of items.\n\n### Items\n\nUse the `items` property to define possible options for the select:\n\n```html\n<vaadin-select id=\"select\"></vaadin-select>\n```\n```js\nconst select = document.querySelector('#select');\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc' },\n { label: 'Rating: high to low', value: 'rating-desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\n### Rendering\n\nAlternatively, the content of the select can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `select` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `select`.\n\n```js\nconst select = document.querySelector('#select');\nselect.renderer = function(root, select) {\n const listBox = document.createElement('vaadin-list-box');\n // append 3 <vaadin-item> elements\n ['Jose', 'Manolo', 'Pedro'].forEach(function(name) {\n const item = document.createElement('vaadin-item');\n item.textContent = name;\n item.setAttribute('label', name)\n listBox.appendChild(item);\n });\n\n // update the content\n root.appendChild(listBox);\n};\n```\n\nRenderer is called on initialization of new select and on its opening.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n* Hint: By setting the `label` property of inner vaadin-items you will\nbe able to change the visual representation of the selected value in the input part.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Target element | Default\n-----------------------------------|------------------------------|----------------------------------\n`--vaadin-field-default-width` | Default width of the field | :host | `12em`\n`--vaadin-select-text-field-width` | Effective width of the field | `vaadin-select-overlay` |\n\n`<vaadin-select>` provides mostly 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/24.2.3/#/elements/vaadin-text-field) for the styling documentation.\n\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 select is open | :host\n\nThere are two exceptions in terms of styling compared to `<vaadin-text-field>`:\n- the `clear-button` shadow DOM part does not exist in `<vaadin-select>`.\n- the `input-prevented` state attribute is not supported by `<vaadin-select>`.\n\n### Internal components\n\nIn addition to `<vaadin-select>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-select-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.2.3/#/elements/vaadin-overlay).\n- `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/24.2.3/#/elements/vaadin-button).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.2.3/#/elements/vaadin-input-container) - an internal element wrapping the button.\n\nNote: the `theme` attribute value set on `<vaadin-select>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
19
+ "description": "`<vaadin-select>` is a Web Component for selecting values from a list of items.\n\n### Items\n\nUse the `items` property to define possible options for the select:\n\n```html\n<vaadin-select id=\"select\"></vaadin-select>\n```\n```js\nconst select = document.querySelector('#select');\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },\n { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\n### Rendering\n\nAlternatively, the content of the select can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `select` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `select`.\n\n```js\nconst select = document.querySelector('#select');\nselect.renderer = function(root, select) {\n const listBox = document.createElement('vaadin-list-box');\n // append 3 <vaadin-item> elements\n ['Jose', 'Manolo', 'Pedro'].forEach(function(name) {\n const item = document.createElement('vaadin-item');\n item.textContent = name;\n item.setAttribute('label', name)\n listBox.appendChild(item);\n });\n\n // update the content\n root.appendChild(listBox);\n};\n```\n\nRenderer is called on initialization of new select and on its opening.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n* Hint: By setting the `label` property of inner vaadin-items you will\nbe able to change the visual representation of the selected value in the input part.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Target element | Default\n-----------------------------------|------------------------------|----------------------------------\n`--vaadin-field-default-width` | Default width of the field | :host | `12em`\n`--vaadin-select-text-field-width` | Effective width of the field | `vaadin-select-overlay` |\n\n`<vaadin-select>` provides mostly 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/24.3.0-alpha10/#/elements/vaadin-text-field) for the styling documentation.\n\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 select is open | :host\n\nThere are two exceptions in terms of styling compared to `<vaadin-text-field>`:\n- the `clear-button` shadow DOM part does not exist in `<vaadin-select>`.\n- the `input-prevented` state attribute is not supported by `<vaadin-select>`.\n\n### Internal components\n\nIn addition to `<vaadin-select>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-select-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha10/#/elements/vaadin-overlay).\n- `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha10/#/elements/vaadin-button).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha10/#/elements/vaadin-input-container) - an internal element wrapping the button.\n\nNote: the `theme` attribute value set on `<vaadin-select>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
@@ -105,7 +105,7 @@
105
105
  },
106
106
  {
107
107
  "name": ".items",
108
- "description": "An array containing items that will be rendered as the options of the select.\n\n#### Example\n```js\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc' },\n { label: 'Rating: high to low', value: 'rating-desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\nNote: each item is rendered by default as the internal `<vaadin-select-item>` that is an extension of `<vaadin-item>`.\nTo render the item with a custom component, provide a tag name by the `component` property.",
108
+ "description": "An array containing items that will be rendered as the options of the select.\n\n#### Example\n```js\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },\n { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\nNote: each item is rendered by default as the internal `<vaadin-select-item>` that is an extension of `<vaadin-item>`.\nTo render the item with a custom component, provide a tag name by the `component` property.",
109
109
  "value": {
110
110
  "kind": "expression"
111
111
  }