@vaadin/select 25.3.0-alpha1 → 25.3.0-alpha11

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.
@@ -7,7 +7,7 @@ import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
7
7
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
8
  import { SelectBaseMixin } from './vaadin-select-base-mixin.js';
9
9
 
10
- export interface SelectItem {
10
+ export interface SelectItemData {
11
11
  label?: string;
12
12
  value?: string;
13
13
  component?: string;
@@ -15,6 +15,11 @@ export interface SelectItem {
15
15
  className?: string;
16
16
  }
17
17
 
18
+ /**
19
+ * @deprecated Use `SelectItemData` instead.
20
+ */
21
+ export type SelectItem = SelectItemData;
22
+
18
23
  /**
19
24
  * Fired when the user commits a value change.
20
25
  */
@@ -90,7 +95,26 @@ export interface SelectEventMap extends HTMLElementEventMap, SelectCustomEventMa
90
95
  *
91
96
  * ### Rendering
92
97
  *
93
- * Alternatively, the content of the select can be populated by using the renderer callback function.
98
+ * Alternatively, the content of the select can be populated by using a slotted `<vaadin-select-list-box>`
99
+ * with `<vaadin-select-item>` children:
100
+ *
101
+ * ```html
102
+ * <vaadin-select>
103
+ * <vaadin-select-list-box slot="overlay">
104
+ * <vaadin-select-item value="recent">Most recent first</vaadin-select-item>
105
+ * <vaadin-select-item value="rating-asc">Rating: low to high</vaadin-select-item>
106
+ * <vaadin-select-item value="rating-desc">Rating: high to low</vaadin-select-item>
107
+ * </vaadin-select-list-box>
108
+ * </vaadin-select>
109
+ * ```
110
+ *
111
+ * * Hint: By setting the `label` property of inner vaadin-items you will
112
+ * be able to change the visual representation of the selected value in the input part.
113
+ *
114
+ * #### Renderer (deprecated)
115
+ *
116
+ * The content of the select can also be populated by using the renderer callback function, although
117
+ * this approach is deprecated in favor of the `items` property or a slotted `<vaadin-select-list-box>`.
94
118
  *
95
119
  * The renderer function provides `root`, `select` arguments.
96
120
  * Generate DOM content, append it to the `root` element and control the state
@@ -118,9 +142,6 @@ export interface SelectEventMap extends HTMLElementEventMap, SelectCustomEventMa
118
142
  * in the next renderer call and will be provided with the `root` argument.
119
143
  * On first call it will be empty.
120
144
  *
121
- * * Hint: By setting the `label` property of inner vaadin-items you will
122
- * be able to change the visual representation of the selected value in the input part.
123
- *
124
145
  * ### Styling
125
146
  *
126
147
  * The following custom properties are available for styling:
@@ -163,12 +184,12 @@ export interface SelectEventMap extends HTMLElementEventMap, SelectCustomEventMa
163
184
  *
164
185
  * ### Internal components
165
186
  *
166
- * In addition to `<vaadin-select>` itself, the following internal
167
- * components are themable:
187
+ * In addition to `<vaadin-select>` itself, the following internal components are used
188
+ * and themable:
168
189
  *
169
190
  * - `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](#/elements/vaadin-button).
170
- * - `<vaadin-select-list-box>` - has the same API as [`<vaadin-list-box>`](#/elements/vaadin-list-box).
171
- * - `<vaadin-select-item>` - has the same API as [`<vaadin-item>`](#/elements/vaadin-item).
191
+ * - [`<vaadin-select-list-box>`](#/elements/vaadin-select-list-box) - a list-box element.
192
+ * - [`<vaadin-select-item>`](#/elements/vaadin-select-item) - an item element.
172
193
  *
173
194
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
174
195
  *
@@ -46,7 +46,26 @@ import { SelectBaseMixin } from './vaadin-select-base-mixin.js';
46
46
  *
47
47
  * ### Rendering
48
48
  *
49
- * Alternatively, the content of the select can be populated by using the renderer callback function.
49
+ * Alternatively, the content of the select can be populated by using a slotted `<vaadin-select-list-box>`
50
+ * with `<vaadin-select-item>` children:
51
+ *
52
+ * ```html
53
+ * <vaadin-select>
54
+ * <vaadin-select-list-box slot="overlay">
55
+ * <vaadin-select-item value="recent">Most recent first</vaadin-select-item>
56
+ * <vaadin-select-item value="rating-asc">Rating: low to high</vaadin-select-item>
57
+ * <vaadin-select-item value="rating-desc">Rating: high to low</vaadin-select-item>
58
+ * </vaadin-select-list-box>
59
+ * </vaadin-select>
60
+ * ```
61
+ *
62
+ * * Hint: By setting the `label` property of inner vaadin-items you will
63
+ * be able to change the visual representation of the selected value in the input part.
64
+ *
65
+ * #### Renderer (deprecated)
66
+ *
67
+ * The content of the select can also be populated by using the renderer callback function, although
68
+ * this approach is deprecated in favor of the `items` property or a slotted `<vaadin-select-list-box>`.
50
69
  *
51
70
  * The renderer function provides `root`, `select` arguments.
52
71
  * Generate DOM content, append it to the `root` element and control the state
@@ -74,9 +93,6 @@ import { SelectBaseMixin } from './vaadin-select-base-mixin.js';
74
93
  * in the next renderer call and will be provided with the `root` argument.
75
94
  * On first call it will be empty.
76
95
  *
77
- * * Hint: By setting the `label` property of inner vaadin-items you will
78
- * be able to change the visual representation of the selected value in the input part.
79
- *
80
96
  * ### Styling
81
97
  *
82
98
  * The following custom properties are available for styling:
@@ -119,12 +135,12 @@ import { SelectBaseMixin } from './vaadin-select-base-mixin.js';
119
135
  *
120
136
  * ### Internal components
121
137
  *
122
- * In addition to `<vaadin-select>` itself, the following internal
123
- * components are themable:
138
+ * In addition to `<vaadin-select>` itself, the following internal components are used
139
+ * and themable:
124
140
  *
125
141
  * - `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](#/elements/vaadin-button).
126
- * - `<vaadin-select-list-box>` - has the same API as [`<vaadin-list-box>`](#/elements/vaadin-list-box).
127
- * - `<vaadin-select-item>` - has the same API as [`<vaadin-item>`](#/elements/vaadin-item).
142
+ * - [`<vaadin-select-list-box>`](#/elements/vaadin-select-list-box) - a list-box element.
143
+ * - [`<vaadin-select-item>`](#/elements/vaadin-select-item) - an item element.
128
144
  *
129
145
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
130
146
  *
@@ -134,6 +150,7 @@ import { SelectBaseMixin } from './vaadin-select-base-mixin.js';
134
150
  * @fires {CustomEvent} value-changed - Fired when the `value` property changes.
135
151
  * @fires {CustomEvent} validated - Fired whenever the field is validated.
136
152
  *
153
+ * @attr {string} theme - The theme variants to apply to the component.
137
154
  * @customElement vaadin-select
138
155
  * @extends HTMLElement
139
156
  */
@@ -188,7 +205,7 @@ class Select extends SelectBaseMixin(ElementMixin(ThemableMixin(PolylitMixin(Lum
188
205
  .positionTarget="${this._inputContainer}"
189
206
  .opened="${this.opened}"
190
207
  .withBackdrop="${this._phone}"
191
- .renderer="${this.renderer || this.__defaultRenderer}"
208
+ .renderer="${this.__slottedListBox ? undefined : this.renderer || this.__defaultRenderer}"
192
209
  ?phone="${this._phone}"
193
210
  theme="${ifDefined(this._theme)}"
194
211
  ?no-vertical-overlap="${this.noVerticalOverlap}"
@@ -196,7 +213,7 @@ class Select extends SelectBaseMixin(ElementMixin(ThemableMixin(PolylitMixin(Lum
196
213
  @opened-changed="${this._onOpenedChanged}"
197
214
  @vaadin-overlay-open="${this._onOverlayOpen}"
198
215
  >
199
- <slot name="overlay"></slot>
216
+ <slot name="overlay" @slotchange="${this.__onOverlaySlotChange}"></slot>
200
217
  </vaadin-select-overlay>
201
218
 
202
219
  <slot name="tooltip"></slot>
@@ -0,0 +1 @@
1
+ export * from './src/vaadin-select-item.js';
@@ -0,0 +1,2 @@
1
+ import './src/vaadin-select-item.js';
2
+ export * from './src/vaadin-select-item.js';
@@ -0,0 +1 @@
1
+ export * from './src/vaadin-select-list-box.js';
@@ -0,0 +1,2 @@
1
+ import './src/vaadin-select-list-box.js';
2
+ export * from './src/vaadin-select-list-box.js';
package/web-types.json CHANGED
@@ -1,18 +1,157 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/select",
4
- "version": "25.3.0-alpha1",
4
+ "version": "25.3.0-alpha11",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
+ {
10
+ "name": "vaadin-select-item",
11
+ "description": "`<vaadin-select-item>` is a Web Component for creating `<vaadin-select>` items.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-------------|----------------\n`checkmark` | The graphical checkmark shown for a selected item\n`content` | The element that wraps the slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-------------|-------------\n`active` | Set when the item is pressed down, either with mouse, touch or the keyboard.\n`disabled` | Set when the item is disabled.\n`focus-ring` | Set when the item is focused using the keyboard.\n`focused` | Set when the item is focused.\n`selected` | Set when the item is selected\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:----------------------------------|\n| `--vaadin-item-border-radius` |\n| `--vaadin-item-checkmark-color` |\n| `--vaadin-item-gap` |\n| `--vaadin-item-height` |\n| `--vaadin-item-padding` |\n| `--vaadin-item-text-align` |\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
12
+ "attributes": [
13
+ {
14
+ "name": "disabled",
15
+ "description": "If true, the user cannot interact with this element.",
16
+ "value": {
17
+ "type": [
18
+ "boolean"
19
+ ]
20
+ }
21
+ },
22
+ {
23
+ "name": "selected",
24
+ "description": "If true, the item is in selected state.",
25
+ "value": {
26
+ "type": [
27
+ "boolean"
28
+ ]
29
+ }
30
+ },
31
+ {
32
+ "name": "theme",
33
+ "description": "The theme variants to apply to the component.",
34
+ "value": {
35
+ "type": [
36
+ "string"
37
+ ]
38
+ }
39
+ }
40
+ ],
41
+ "js": {
42
+ "properties": [
43
+ {
44
+ "name": "disabled",
45
+ "description": "If true, the user cannot interact with this element.",
46
+ "value": {
47
+ "type": [
48
+ "boolean"
49
+ ]
50
+ }
51
+ },
52
+ {
53
+ "name": "label",
54
+ "description": "String that can be set to visually represent the selected item in `vaadin-select`.",
55
+ "value": {
56
+ "type": [
57
+ "string"
58
+ ]
59
+ }
60
+ },
61
+ {
62
+ "name": "selected",
63
+ "description": "If true, the item is in selected state.",
64
+ "value": {
65
+ "type": [
66
+ "boolean"
67
+ ]
68
+ }
69
+ },
70
+ {
71
+ "name": "value",
72
+ "description": "Submittable string value. The default value is the trimmed text content of the element.",
73
+ "value": {
74
+ "type": [
75
+ "string"
76
+ ]
77
+ }
78
+ }
79
+ ],
80
+ "events": []
81
+ }
82
+ },
83
+ {
84
+ "name": "vaadin-select-list-box",
85
+ "description": "`<vaadin-select-list-box>` is a Web Component for wrapping `<vaadin-select>` items.\n\n```html\n<vaadin-select>\n <vaadin-select-list-box slot=\"overlay\">\n <vaadin-select-item value=\"foo\">Foo</vaadin-select-item>\n <vaadin-select-item value=\"bar\">Bar</vaadin-select-item>\n </vaadin-select-list-box>\n</vaadin-select>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n------------------|------------------------\n`items` | The items container\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
86
+ "attributes": [
87
+ {
88
+ "name": "disabled",
89
+ "description": "If true, the user cannot interact with this element.\nWhen the element is disabled, the selected item is\nnot updated when `selected` property is changed.",
90
+ "value": {
91
+ "type": [
92
+ "boolean"
93
+ ]
94
+ }
95
+ },
96
+ {
97
+ "name": "selected",
98
+ "description": "The index of the item selected in the items array.\nNote: Not updated when used in `multiple` selection mode.",
99
+ "value": {
100
+ "type": [
101
+ "number"
102
+ ]
103
+ }
104
+ },
105
+ {
106
+ "name": "theme",
107
+ "description": "The theme variants to apply to the component.",
108
+ "value": {
109
+ "type": [
110
+ "string"
111
+ ]
112
+ }
113
+ }
114
+ ],
115
+ "js": {
116
+ "properties": [
117
+ {
118
+ "name": "disabled",
119
+ "description": "If true, the user cannot interact with this element.\nWhen the element is disabled, the selected item is\nnot updated when `selected` property is changed.",
120
+ "value": {
121
+ "type": [
122
+ "boolean"
123
+ ]
124
+ }
125
+ },
126
+ {
127
+ "name": "selected",
128
+ "description": "The index of the item selected in the items array.\nNote: Not updated when used in `multiple` selection mode.",
129
+ "value": {
130
+ "type": [
131
+ "number"
132
+ ]
133
+ }
134
+ }
135
+ ],
136
+ "events": []
137
+ }
138
+ },
9
139
  {
10
140
  "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', 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 | Default\n---------------------------------|-----------------------------|--------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n`--vaadin-select-overlay-width` | Width of the overlay |\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and toggle button\n`field-button` | Set on the toggle button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n`phone` | Set when the overlay is shown in phone mode\n\n### Internal components\n\nIn addition to `<vaadin-select>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha1/#/elements/vaadin-button).\n- `<vaadin-select-list-box>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha1/#/elements/vaadin-list-box).\n- `<vaadin-select-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha1/#/elements/vaadin-item).\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
141
+ "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 a slotted `<vaadin-select-list-box>`\nwith `<vaadin-select-item>` children:\n\n```html\n<vaadin-select>\n <vaadin-select-list-box slot=\"overlay\">\n <vaadin-select-item value=\"recent\">Most recent first</vaadin-select-item>\n <vaadin-select-item value=\"rating-asc\">Rating: low to high</vaadin-select-item>\n <vaadin-select-item value=\"rating-desc\">Rating: high to low</vaadin-select-item>\n </vaadin-select-list-box>\n</vaadin-select>\n```\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#### Renderer (deprecated)\n\nThe content of the select can also be populated by using the renderer callback function, although\nthis approach is deprecated in favor of the `items` property or a slotted `<vaadin-select-list-box>`.\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### 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-select-overlay-width` | Width of the overlay |\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and toggle button\n`field-button` | Set on the toggle button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n`phone` | Set when the overlay is shown in phone mode\n\n### Internal components\n\nIn addition to `<vaadin-select>` itself, the following internal components are used\nand themable:\n\n- `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha11/#/elements/vaadin-button).\n- [`<vaadin-select-list-box>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha11/#/elements/vaadin-select-list-box) - a list-box element.\n- [`<vaadin-select-item>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha11/#/elements/vaadin-select-item) - an item element.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
12
142
  "attributes": [
143
+ {
144
+ "name": "accessible-description-ref",
145
+ "description": "A space-separated list of IDs referencing the elements that\ndescribe the component for screen reader users. The referenced\nelements are announced in addition to the helper text and\nthe error message.",
146
+ "value": {
147
+ "type": [
148
+ "string"
149
+ ]
150
+ }
151
+ },
13
152
  {
14
153
  "name": "accessible-name",
15
- "description": "String used to label the component to screen reader users.",
154
+ "description": "String used to label the component for screen reader users.",
16
155
  "value": {
17
156
  "type": [
18
157
  "string"
@@ -21,7 +160,7 @@
21
160
  },
22
161
  {
23
162
  "name": "accessible-name-ref",
24
- "description": "Id of the element used as label of the component to screen reader users.",
163
+ "description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
25
164
  "value": {
26
165
  "type": [
27
166
  "string"
@@ -150,9 +289,7 @@
150
289
  "description": "The theme variants to apply to the component.",
151
290
  "value": {
152
291
  "type": [
153
- "string",
154
- "null",
155
- "undefined"
292
+ "string"
156
293
  ]
157
294
  }
158
295
  },
@@ -168,9 +305,18 @@
168
305
  ],
169
306
  "js": {
170
307
  "properties": [
308
+ {
309
+ "name": "accessibleDescriptionRef",
310
+ "description": "A space-separated list of IDs referencing the elements that\ndescribe the component for screen reader users. The referenced\nelements are announced in addition to the helper text and\nthe error message.",
311
+ "value": {
312
+ "type": [
313
+ "string"
314
+ ]
315
+ }
316
+ },
171
317
  {
172
318
  "name": "accessibleName",
173
- "description": "String used to label the component to screen reader users.",
319
+ "description": "String used to label the component for screen reader users.",
174
320
  "value": {
175
321
  "type": [
176
322
  "string"
@@ -179,7 +325,7 @@
179
325
  },
180
326
  {
181
327
  "name": "accessibleNameRef",
182
- "description": "Id of the element used as label of the component to screen reader users.",
328
+ "description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
183
329
  "value": {
184
330
  "type": [
185
331
  "string"
@@ -236,7 +382,7 @@
236
382
  "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.",
237
383
  "value": {
238
384
  "type": [
239
- "Array<SelectItem>"
385
+ "Array<SelectItemData>"
240
386
  ]
241
387
  }
242
388
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/select",
4
- "version": "25.3.0-alpha1",
4
+ "version": "25.3.0-alpha11",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -14,21 +14,84 @@
14
14
  "contributions": {
15
15
  "html": {
16
16
  "elements": [
17
+ {
18
+ "name": "vaadin-select-item",
19
+ "description": "`<vaadin-select-item>` is a Web Component for creating `<vaadin-select>` items.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-------------|----------------\n`checkmark` | The graphical checkmark shown for a selected item\n`content` | The element that wraps the slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-------------|-------------\n`active` | Set when the item is pressed down, either with mouse, touch or the keyboard.\n`disabled` | Set when the item is disabled.\n`focus-ring` | Set when the item is focused using the keyboard.\n`focused` | Set when the item is focused.\n`selected` | Set when the item is selected\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:----------------------------------|\n| `--vaadin-item-border-radius` |\n| `--vaadin-item-checkmark-color` |\n| `--vaadin-item-gap` |\n| `--vaadin-item-height` |\n| `--vaadin-item-padding` |\n| `--vaadin-item-text-align` |\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
20
+ "extension": true,
21
+ "attributes": [
22
+ {
23
+ "name": "?disabled",
24
+ "description": "If true, the user cannot interact with this element.",
25
+ "value": {
26
+ "kind": "expression"
27
+ }
28
+ },
29
+ {
30
+ "name": ".label",
31
+ "description": "String that can be set to visually represent the selected item in `vaadin-select`.",
32
+ "value": {
33
+ "kind": "expression"
34
+ }
35
+ },
36
+ {
37
+ "name": "?selected",
38
+ "description": "If true, the item is in selected state.",
39
+ "value": {
40
+ "kind": "expression"
41
+ }
42
+ },
43
+ {
44
+ "name": ".value",
45
+ "description": "Submittable string value. The default value is the trimmed text content of the element.",
46
+ "value": {
47
+ "kind": "expression"
48
+ }
49
+ }
50
+ ]
51
+ },
52
+ {
53
+ "name": "vaadin-select-list-box",
54
+ "description": "`<vaadin-select-list-box>` is a Web Component for wrapping `<vaadin-select>` items.\n\n```html\n<vaadin-select>\n <vaadin-select-list-box slot=\"overlay\">\n <vaadin-select-item value=\"foo\">Foo</vaadin-select-item>\n <vaadin-select-item value=\"bar\">Bar</vaadin-select-item>\n </vaadin-select-list-box>\n</vaadin-select>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n------------------|------------------------\n`items` | The items container\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
55
+ "extension": true,
56
+ "attributes": [
57
+ {
58
+ "name": "?disabled",
59
+ "description": "If true, the user cannot interact with this element.\nWhen the element is disabled, the selected item is\nnot updated when `selected` property is changed.",
60
+ "value": {
61
+ "kind": "expression"
62
+ }
63
+ },
64
+ {
65
+ "name": ".selected",
66
+ "description": "The index of the item selected in the items array.\nNote: Not updated when used in `multiple` selection mode.",
67
+ "value": {
68
+ "kind": "expression"
69
+ }
70
+ }
71
+ ]
72
+ },
17
73
  {
18
74
  "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', 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 | Default\n---------------------------------|-----------------------------|--------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n`--vaadin-select-overlay-width` | Width of the overlay |\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and toggle button\n`field-button` | Set on the toggle button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n`phone` | Set when the overlay is shown in phone mode\n\n### Internal components\n\nIn addition to `<vaadin-select>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha1/#/elements/vaadin-button).\n- `<vaadin-select-list-box>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha1/#/elements/vaadin-list-box).\n- `<vaadin-select-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha1/#/elements/vaadin-item).\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
75
+ "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 a slotted `<vaadin-select-list-box>`\nwith `<vaadin-select-item>` children:\n\n```html\n<vaadin-select>\n <vaadin-select-list-box slot=\"overlay\">\n <vaadin-select-item value=\"recent\">Most recent first</vaadin-select-item>\n <vaadin-select-item value=\"rating-asc\">Rating: low to high</vaadin-select-item>\n <vaadin-select-item value=\"rating-desc\">Rating: high to low</vaadin-select-item>\n </vaadin-select-list-box>\n</vaadin-select>\n```\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#### Renderer (deprecated)\n\nThe content of the select can also be populated by using the renderer callback function, although\nthis approach is deprecated in favor of the `items` property or a slotted `<vaadin-select-list-box>`.\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### 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-select-overlay-width` | Width of the overlay |\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and toggle button\n`field-button` | Set on the toggle button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n`phone` | Set when the overlay is shown in phone mode\n\n### Internal components\n\nIn addition to `<vaadin-select>` itself, the following internal components are used\nand themable:\n\n- `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha11/#/elements/vaadin-button).\n- [`<vaadin-select-list-box>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha11/#/elements/vaadin-select-list-box) - a list-box element.\n- [`<vaadin-select-item>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha11/#/elements/vaadin-select-item) - an item element.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
20
76
  "extension": true,
21
77
  "attributes": [
78
+ {
79
+ "name": ".accessibleDescriptionRef",
80
+ "description": "A space-separated list of IDs referencing the elements that\ndescribe the component for screen reader users. The referenced\nelements are announced in addition to the helper text and\nthe error message.",
81
+ "value": {
82
+ "kind": "expression"
83
+ }
84
+ },
22
85
  {
23
86
  "name": ".accessibleName",
24
- "description": "String used to label the component to screen reader users.",
87
+ "description": "String used to label the component for screen reader users.",
25
88
  "value": {
26
89
  "kind": "expression"
27
90
  }
28
91
  },
29
92
  {
30
93
  "name": ".accessibleNameRef",
31
- "description": "Id of the element used as label of the component to screen reader users.",
94
+ "description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
32
95
  "value": {
33
96
  "kind": "expression"
34
97
  }