@vaadin/combo-box 25.3.0-dev.1fa5a51482 → 25.3.0-rc1
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/custom-elements.json +149 -36
- package/package.json +14 -14
- package/src/vaadin-combo-box-base-mixin.js +55 -12
- package/src/vaadin-combo-box-data-provider-mixin.js +15 -9
- package/src/vaadin-combo-box-focus-index-mixin.js +5 -0
- package/src/vaadin-combo-box-item-mixin.js +1 -1
- package/src/vaadin-combo-box-item.js +3 -3
- package/src/vaadin-combo-box-items-mixin.d.ts +45 -0
- package/src/vaadin-combo-box-items-mixin.js +167 -4
- package/src/vaadin-combo-box-mixin.d.ts +0 -17
- package/src/vaadin-combo-box-mixin.js +7 -114
- package/src/vaadin-combo-box-overlay-mixin.js +10 -13
- package/src/vaadin-combo-box-overlay.js +3 -1
- package/src/vaadin-combo-box-placeholder.d.ts +20 -0
- package/src/vaadin-combo-box-scroller-mixin.d.ts +1 -6
- package/src/vaadin-combo-box-scroller-mixin.js +7 -19
- package/src/vaadin-combo-box-scroller.js +3 -1
- package/src/vaadin-combo-box.d.ts +43 -8
- package/src/vaadin-combo-box.js +42 -8
- package/web-types.json +44 -8
- package/web-types.lit.json +19 -5
|
@@ -30,6 +30,7 @@ export {
|
|
|
30
30
|
ComboBoxDataProviderCallback,
|
|
31
31
|
ComboBoxDataProviderParams,
|
|
32
32
|
} from './vaadin-combo-box-data-provider-mixin.js';
|
|
33
|
+
export { ComboBoxPartialMatchMode } from './vaadin-combo-box-items-mixin.js';
|
|
33
34
|
export { ComboBoxDefaultItem, ComboBoxItemModel, ComboBoxRenderer } from './vaadin-combo-box-mixin.js';
|
|
34
35
|
|
|
35
36
|
/**
|
|
@@ -167,14 +168,6 @@ export interface ComboBoxEventMap<TItem> extends HTMLElementEventMap {
|
|
|
167
168
|
*
|
|
168
169
|
* ### Styling
|
|
169
170
|
*
|
|
170
|
-
* The following custom properties are available for styling:
|
|
171
|
-
*
|
|
172
|
-
* Custom property | Description | Default
|
|
173
|
-
* ----------------------------------------|----------------------------|---------
|
|
174
|
-
* `--vaadin-field-default-width` | Default width of the field | `12em`
|
|
175
|
-
* `--vaadin-combo-box-overlay-width` | Width of the overlay | `auto`
|
|
176
|
-
* `--vaadin-combo-box-overlay-max-height` | Max height of the overlay | `65vh`
|
|
177
|
-
*
|
|
178
171
|
* The following shadow DOM parts are available for styling:
|
|
179
172
|
*
|
|
180
173
|
* Part name | Description
|
|
@@ -208,6 +201,48 @@ export interface ComboBoxEventMap<TItem> extends HTMLElementEventMap {
|
|
|
208
201
|
* `opened` | Set when the overlay is opened
|
|
209
202
|
* `loading` | Set when loading items from the data provider
|
|
210
203
|
*
|
|
204
|
+
* The following custom CSS properties are available for styling:
|
|
205
|
+
*
|
|
206
|
+
* Custom CSS property |
|
|
207
|
+
* :--------------------------------------------------|
|
|
208
|
+
* | `--vaadin-combo-box-overlay-max-height` |
|
|
209
|
+
* | `--vaadin-combo-box-overlay-width` |
|
|
210
|
+
* | `--vaadin-field-default-width` |
|
|
211
|
+
* | `--vaadin-input-field-background` |
|
|
212
|
+
* | `--vaadin-input-field-border-color` |
|
|
213
|
+
* | `--vaadin-input-field-border-radius` |
|
|
214
|
+
* | `--vaadin-input-field-border-width` |
|
|
215
|
+
* | `--vaadin-input-field-bottom-end-radius` |
|
|
216
|
+
* | `--vaadin-input-field-bottom-start-radius` |
|
|
217
|
+
* | `--vaadin-input-field-button-text-color` |
|
|
218
|
+
* | `--vaadin-input-field-container-gap` |
|
|
219
|
+
* | `--vaadin-input-field-disabled-background` |
|
|
220
|
+
* | `--vaadin-input-field-disabled-text-color` |
|
|
221
|
+
* | `--vaadin-input-field-error-color` |
|
|
222
|
+
* | `--vaadin-input-field-error-font-size` |
|
|
223
|
+
* | `--vaadin-input-field-error-font-weight` |
|
|
224
|
+
* | `--vaadin-input-field-error-line-height` |
|
|
225
|
+
* | `--vaadin-input-field-gap` |
|
|
226
|
+
* | `--vaadin-input-field-helper-color` |
|
|
227
|
+
* | `--vaadin-input-field-helper-font-size` |
|
|
228
|
+
* | `--vaadin-input-field-helper-font-weight` |
|
|
229
|
+
* | `--vaadin-input-field-helper-line-height` |
|
|
230
|
+
* | `--vaadin-input-field-label-color` |
|
|
231
|
+
* | `--vaadin-input-field-label-font-size` |
|
|
232
|
+
* | `--vaadin-input-field-label-font-weight` |
|
|
233
|
+
* | `--vaadin-input-field-label-line-height` |
|
|
234
|
+
* | `--vaadin-input-field-padding` |
|
|
235
|
+
* | `--vaadin-input-field-placeholder-color` |
|
|
236
|
+
* | `--vaadin-input-field-required-indicator` |
|
|
237
|
+
* | `--vaadin-input-field-required-indicator-color` |
|
|
238
|
+
* | `--vaadin-input-field-top-end-radius` |
|
|
239
|
+
* | `--vaadin-input-field-top-start-radius` |
|
|
240
|
+
* | `--vaadin-input-field-value-color` |
|
|
241
|
+
* | `--vaadin-input-field-value-font-size` |
|
|
242
|
+
* | `--vaadin-input-field-value-font-weight` |
|
|
243
|
+
* | `--vaadin-input-field-value-line-height` |
|
|
244
|
+
* | `--vaadin-item-overlay-padding` |
|
|
245
|
+
*
|
|
211
246
|
* ### Internal components
|
|
212
247
|
*
|
|
213
248
|
* In addition to `<vaadin-combo-box>` itself, the following internal
|
package/src/vaadin-combo-box.js
CHANGED
|
@@ -100,14 +100,6 @@ import { ComboBoxMixin } from './vaadin-combo-box-mixin.js';
|
|
|
100
100
|
*
|
|
101
101
|
* ### Styling
|
|
102
102
|
*
|
|
103
|
-
* The following custom properties are available for styling:
|
|
104
|
-
*
|
|
105
|
-
* Custom property | Description | Default
|
|
106
|
-
* ----------------------------------------|----------------------------|---------
|
|
107
|
-
* `--vaadin-field-default-width` | Default width of the field | `12em`
|
|
108
|
-
* `--vaadin-combo-box-overlay-width` | Width of the overlay | `auto`
|
|
109
|
-
* `--vaadin-combo-box-overlay-max-height` | Max height of the overlay | `65vh`
|
|
110
|
-
*
|
|
111
103
|
* The following shadow DOM parts are available for styling:
|
|
112
104
|
*
|
|
113
105
|
* Part name | Description
|
|
@@ -141,6 +133,48 @@ import { ComboBoxMixin } from './vaadin-combo-box-mixin.js';
|
|
|
141
133
|
* `opened` | Set when the overlay is opened
|
|
142
134
|
* `loading` | Set when loading items from the data provider
|
|
143
135
|
*
|
|
136
|
+
* The following custom CSS properties are available for styling:
|
|
137
|
+
*
|
|
138
|
+
* Custom CSS property |
|
|
139
|
+
* :--------------------------------------------------|
|
|
140
|
+
* | `--vaadin-combo-box-overlay-max-height` |
|
|
141
|
+
* | `--vaadin-combo-box-overlay-width` |
|
|
142
|
+
* | `--vaadin-field-default-width` |
|
|
143
|
+
* | `--vaadin-input-field-background` |
|
|
144
|
+
* | `--vaadin-input-field-border-color` |
|
|
145
|
+
* | `--vaadin-input-field-border-radius` |
|
|
146
|
+
* | `--vaadin-input-field-border-width` |
|
|
147
|
+
* | `--vaadin-input-field-bottom-end-radius` |
|
|
148
|
+
* | `--vaadin-input-field-bottom-start-radius` |
|
|
149
|
+
* | `--vaadin-input-field-button-text-color` |
|
|
150
|
+
* | `--vaadin-input-field-container-gap` |
|
|
151
|
+
* | `--vaadin-input-field-disabled-background` |
|
|
152
|
+
* | `--vaadin-input-field-disabled-text-color` |
|
|
153
|
+
* | `--vaadin-input-field-error-color` |
|
|
154
|
+
* | `--vaadin-input-field-error-font-size` |
|
|
155
|
+
* | `--vaadin-input-field-error-font-weight` |
|
|
156
|
+
* | `--vaadin-input-field-error-line-height` |
|
|
157
|
+
* | `--vaadin-input-field-gap` |
|
|
158
|
+
* | `--vaadin-input-field-helper-color` |
|
|
159
|
+
* | `--vaadin-input-field-helper-font-size` |
|
|
160
|
+
* | `--vaadin-input-field-helper-font-weight` |
|
|
161
|
+
* | `--vaadin-input-field-helper-line-height` |
|
|
162
|
+
* | `--vaadin-input-field-label-color` |
|
|
163
|
+
* | `--vaadin-input-field-label-font-size` |
|
|
164
|
+
* | `--vaadin-input-field-label-font-weight` |
|
|
165
|
+
* | `--vaadin-input-field-label-line-height` |
|
|
166
|
+
* | `--vaadin-input-field-padding` |
|
|
167
|
+
* | `--vaadin-input-field-placeholder-color` |
|
|
168
|
+
* | `--vaadin-input-field-required-indicator` |
|
|
169
|
+
* | `--vaadin-input-field-required-indicator-color` |
|
|
170
|
+
* | `--vaadin-input-field-top-end-radius` |
|
|
171
|
+
* | `--vaadin-input-field-top-start-radius` |
|
|
172
|
+
* | `--vaadin-input-field-value-color` |
|
|
173
|
+
* | `--vaadin-input-field-value-font-size` |
|
|
174
|
+
* | `--vaadin-input-field-value-font-weight` |
|
|
175
|
+
* | `--vaadin-input-field-value-line-height` |
|
|
176
|
+
* | `--vaadin-item-overlay-padding` |
|
|
177
|
+
*
|
|
144
178
|
* ### Internal components
|
|
145
179
|
*
|
|
146
180
|
* In addition to `<vaadin-combo-box>` itself, the following internal
|
package/web-types.json
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/combo-box",
|
|
4
|
-
"version": "25.3.0-
|
|
4
|
+
"version": "25.3.0-rc1",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-combo-box",
|
|
11
|
-
"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/25.3.0-
|
|
11
|
+
"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/25.3.0-rc1/#/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/25.3.0-rc1/#/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/25.3.0-rc1/#/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```js\ncomboBox.dataProvider = async (params, callback) => {\n const API = 'https://demo.vaadin.com/demo-data/1.0/filtered-countries';\n const { filter, page, pageSize } = params;\n const index = page * pageSize;\n\n const res = await fetch(`${API}?index=${index}&count=${pageSize}&filter=${filter}`);\n if (res.ok) {\n const { result, size } = await res.json();\n callback(result, size);\n }\n};\n```\n\n### Styling\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 buttons\n`field-button` | Set on both clear and toggle buttons\n`clear-button` | The clear 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`overlay` | The overlay container\n`content` | The overlay content\n`loader` | The loading indicator shown while loading items\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`has-tooltip` | Set when the element has a slotted tooltip\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`loading` | Set when loading items from the data provider\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------------|\n| `--vaadin-combo-box-overlay-max-height` |\n| `--vaadin-combo-box-overlay-width` |\n| `--vaadin-field-default-width` |\n| `--vaadin-input-field-background` |\n| `--vaadin-input-field-border-color` |\n| `--vaadin-input-field-border-radius` |\n| `--vaadin-input-field-border-width` |\n| `--vaadin-input-field-bottom-end-radius` |\n| `--vaadin-input-field-bottom-start-radius` |\n| `--vaadin-input-field-button-text-color` |\n| `--vaadin-input-field-container-gap` |\n| `--vaadin-input-field-disabled-background` |\n| `--vaadin-input-field-disabled-text-color` |\n| `--vaadin-input-field-error-color` |\n| `--vaadin-input-field-error-font-size` |\n| `--vaadin-input-field-error-font-weight` |\n| `--vaadin-input-field-error-line-height` |\n| `--vaadin-input-field-gap` |\n| `--vaadin-input-field-helper-color` |\n| `--vaadin-input-field-helper-font-size` |\n| `--vaadin-input-field-helper-font-weight` |\n| `--vaadin-input-field-helper-line-height` |\n| `--vaadin-input-field-label-color` |\n| `--vaadin-input-field-label-font-size` |\n| `--vaadin-input-field-label-font-weight` |\n| `--vaadin-input-field-label-line-height` |\n| `--vaadin-input-field-padding` |\n| `--vaadin-input-field-placeholder-color` |\n| `--vaadin-input-field-required-indicator` |\n| `--vaadin-input-field-required-indicator-color` |\n| `--vaadin-input-field-top-end-radius` |\n| `--vaadin-input-field-top-start-radius` |\n| `--vaadin-input-field-value-color` |\n| `--vaadin-input-field-value-font-size` |\n| `--vaadin-input-field-value-font-weight` |\n| `--vaadin-input-field-value-line-height` |\n| `--vaadin-item-overlay-padding` |\n\n### Internal components\n\nIn addition to `<vaadin-combo-box>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-combo-box-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-rc1/#/elements/vaadin-item).\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
|
+
{
|
|
14
|
+
"name": "accessible-description-ref",
|
|
15
|
+
"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.",
|
|
16
|
+
"value": {
|
|
17
|
+
"type": [
|
|
18
|
+
"string"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
13
22
|
{
|
|
14
23
|
"name": "accessible-name",
|
|
15
|
-
"description": "String used to label the component
|
|
24
|
+
"description": "String used to label the component for screen reader users.",
|
|
16
25
|
"value": {
|
|
17
26
|
"type": [
|
|
18
27
|
"string"
|
|
@@ -21,7 +30,7 @@
|
|
|
21
30
|
},
|
|
22
31
|
{
|
|
23
32
|
"name": "accessible-name-ref",
|
|
24
|
-
"description": "
|
|
33
|
+
"description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
|
|
25
34
|
"value": {
|
|
26
35
|
"type": [
|
|
27
36
|
"string"
|
|
@@ -129,7 +138,7 @@
|
|
|
129
138
|
},
|
|
130
139
|
{
|
|
131
140
|
"name": "item-id-path",
|
|
132
|
-
"description": "Path for the id of the item. If `items` is an array of objects,\nthe `itemIdPath` is used to compare and identify the same item\nin
|
|
141
|
+
"description": "Path for the id of the item. If `items` is an array of objects,\nthe `itemIdPath` is used to compare and identify the same item\nin the selection and in `filteredItems` (items given by the\n`dataProvider` callback).",
|
|
133
142
|
"value": {
|
|
134
143
|
"type": [
|
|
135
144
|
"string"
|
|
@@ -208,6 +217,15 @@
|
|
|
208
217
|
]
|
|
209
218
|
}
|
|
210
219
|
},
|
|
220
|
+
{
|
|
221
|
+
"name": "partial-match-mode",
|
|
222
|
+
"description": "Controls which item is automatically set to be selected, for\nexample on Enter, when the typed filter only partially matches\nits label. The item that will be selected is highlighted in the\ndropdown while typing:\n\n- `none` (default): an item is automatically set to be selected only when the filter matches its label exactly.\n- `first-match`: the first item in the filtered results is automatically set to be selected.\n- `only-match`: the item is automatically set to be selected when filtering narrows the results to a single item.\n\nIn general, an exact match is always set to be selected and takes\nprecedence over partial matches, regardless of the mode.\n\nA partial match is only applied while the dropdown is open. For\nexample, when auto-open is disabled with `autoOpenDisabled`, typing\ndoes not highlight a match or set it to be selected until the\ndropdown is opened.\n\nThis feature cannot be used together with custom values, because a\npartial match is also a valid custom value. A partial match is not\napplied when custom values are allowed with `allowCustomValue`.",
|
|
223
|
+
"value": {
|
|
224
|
+
"type": [
|
|
225
|
+
"string"
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
},
|
|
211
229
|
{
|
|
212
230
|
"name": "pattern",
|
|
213
231
|
"description": "A regular expression that the value is checked against.\nThe pattern must match the entire value, not just some subset.",
|
|
@@ -283,9 +301,18 @@
|
|
|
283
301
|
],
|
|
284
302
|
"js": {
|
|
285
303
|
"properties": [
|
|
304
|
+
{
|
|
305
|
+
"name": "accessibleDescriptionRef",
|
|
306
|
+
"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.",
|
|
307
|
+
"value": {
|
|
308
|
+
"type": [
|
|
309
|
+
"string"
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
},
|
|
286
313
|
{
|
|
287
314
|
"name": "accessibleName",
|
|
288
|
-
"description": "String used to label the component
|
|
315
|
+
"description": "String used to label the component for screen reader users.",
|
|
289
316
|
"value": {
|
|
290
317
|
"type": [
|
|
291
318
|
"string"
|
|
@@ -294,7 +321,7 @@
|
|
|
294
321
|
},
|
|
295
322
|
{
|
|
296
323
|
"name": "accessibleNameRef",
|
|
297
|
-
"description": "
|
|
324
|
+
"description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
|
|
298
325
|
"value": {
|
|
299
326
|
"type": [
|
|
300
327
|
"string"
|
|
@@ -432,7 +459,7 @@
|
|
|
432
459
|
},
|
|
433
460
|
{
|
|
434
461
|
"name": "itemIdPath",
|
|
435
|
-
"description": "Path for the id of the item. If `items` is an array of objects,\nthe `itemIdPath` is used to compare and identify the same item\nin
|
|
462
|
+
"description": "Path for the id of the item. If `items` is an array of objects,\nthe `itemIdPath` is used to compare and identify the same item\nin the selection and in `filteredItems` (items given by the\n`dataProvider` callback).",
|
|
436
463
|
"value": {
|
|
437
464
|
"type": [
|
|
438
465
|
"string"
|
|
@@ -531,6 +558,15 @@
|
|
|
531
558
|
]
|
|
532
559
|
}
|
|
533
560
|
},
|
|
561
|
+
{
|
|
562
|
+
"name": "partialMatchMode",
|
|
563
|
+
"description": "Controls which item is automatically set to be selected, for\nexample on Enter, when the typed filter only partially matches\nits label. The item that will be selected is highlighted in the\ndropdown while typing:\n\n- `none` (default): an item is automatically set to be selected only when the filter matches its label exactly.\n- `first-match`: the first item in the filtered results is automatically set to be selected.\n- `only-match`: the item is automatically set to be selected when filtering narrows the results to a single item.\n\nIn general, an exact match is always set to be selected and takes\nprecedence over partial matches, regardless of the mode.\n\nA partial match is only applied while the dropdown is open. For\nexample, when auto-open is disabled with `autoOpenDisabled`, typing\ndoes not highlight a match or set it to be selected until the\ndropdown is opened.\n\nThis feature cannot be used together with custom values, because a\npartial match is also a valid custom value. A partial match is not\napplied when custom values are allowed with `allowCustomValue`.",
|
|
564
|
+
"value": {
|
|
565
|
+
"type": [
|
|
566
|
+
"string"
|
|
567
|
+
]
|
|
568
|
+
}
|
|
569
|
+
},
|
|
534
570
|
{
|
|
535
571
|
"name": "pattern",
|
|
536
572
|
"description": "A regular expression that the value is checked against.\nThe pattern must match the entire value, not just some subset.",
|
package/web-types.lit.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": "25.3.0-
|
|
4
|
+
"version": "25.3.0-rc1",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,19 +16,26 @@
|
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
18
|
"name": "vaadin-combo-box",
|
|
19
|
-
"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/25.3.0-
|
|
19
|
+
"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/25.3.0-rc1/#/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/25.3.0-rc1/#/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/25.3.0-rc1/#/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```js\ncomboBox.dataProvider = async (params, callback) => {\n const API = 'https://demo.vaadin.com/demo-data/1.0/filtered-countries';\n const { filter, page, pageSize } = params;\n const index = page * pageSize;\n\n const res = await fetch(`${API}?index=${index}&count=${pageSize}&filter=${filter}`);\n if (res.ok) {\n const { result, size } = await res.json();\n callback(result, size);\n }\n};\n```\n\n### Styling\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 buttons\n`field-button` | Set on both clear and toggle buttons\n`clear-button` | The clear 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`overlay` | The overlay container\n`content` | The overlay content\n`loader` | The loading indicator shown while loading items\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`has-tooltip` | Set when the element has a slotted tooltip\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`loading` | Set when loading items from the data provider\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------------|\n| `--vaadin-combo-box-overlay-max-height` |\n| `--vaadin-combo-box-overlay-width` |\n| `--vaadin-field-default-width` |\n| `--vaadin-input-field-background` |\n| `--vaadin-input-field-border-color` |\n| `--vaadin-input-field-border-radius` |\n| `--vaadin-input-field-border-width` |\n| `--vaadin-input-field-bottom-end-radius` |\n| `--vaadin-input-field-bottom-start-radius` |\n| `--vaadin-input-field-button-text-color` |\n| `--vaadin-input-field-container-gap` |\n| `--vaadin-input-field-disabled-background` |\n| `--vaadin-input-field-disabled-text-color` |\n| `--vaadin-input-field-error-color` |\n| `--vaadin-input-field-error-font-size` |\n| `--vaadin-input-field-error-font-weight` |\n| `--vaadin-input-field-error-line-height` |\n| `--vaadin-input-field-gap` |\n| `--vaadin-input-field-helper-color` |\n| `--vaadin-input-field-helper-font-size` |\n| `--vaadin-input-field-helper-font-weight` |\n| `--vaadin-input-field-helper-line-height` |\n| `--vaadin-input-field-label-color` |\n| `--vaadin-input-field-label-font-size` |\n| `--vaadin-input-field-label-font-weight` |\n| `--vaadin-input-field-label-line-height` |\n| `--vaadin-input-field-padding` |\n| `--vaadin-input-field-placeholder-color` |\n| `--vaadin-input-field-required-indicator` |\n| `--vaadin-input-field-required-indicator-color` |\n| `--vaadin-input-field-top-end-radius` |\n| `--vaadin-input-field-top-start-radius` |\n| `--vaadin-input-field-value-color` |\n| `--vaadin-input-field-value-font-size` |\n| `--vaadin-input-field-value-font-weight` |\n| `--vaadin-input-field-value-line-height` |\n| `--vaadin-item-overlay-padding` |\n\n### Internal components\n\nIn addition to `<vaadin-combo-box>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-combo-box-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-rc1/#/elements/vaadin-item).\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
|
+
{
|
|
23
|
+
"name": ".accessibleDescriptionRef",
|
|
24
|
+
"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.",
|
|
25
|
+
"value": {
|
|
26
|
+
"kind": "expression"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
22
29
|
{
|
|
23
30
|
"name": ".accessibleName",
|
|
24
|
-
"description": "String used to label the component
|
|
31
|
+
"description": "String used to label the component for screen reader users.",
|
|
25
32
|
"value": {
|
|
26
33
|
"kind": "expression"
|
|
27
34
|
}
|
|
28
35
|
},
|
|
29
36
|
{
|
|
30
37
|
"name": ".accessibleNameRef",
|
|
31
|
-
"description": "
|
|
38
|
+
"description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
|
|
32
39
|
"value": {
|
|
33
40
|
"kind": "expression"
|
|
34
41
|
}
|
|
@@ -133,7 +140,7 @@
|
|
|
133
140
|
},
|
|
134
141
|
{
|
|
135
142
|
"name": ".itemIdPath",
|
|
136
|
-
"description": "Path for the id of the item. If `items` is an array of objects,\nthe `itemIdPath` is used to compare and identify the same item\nin
|
|
143
|
+
"description": "Path for the id of the item. If `items` is an array of objects,\nthe `itemIdPath` is used to compare and identify the same item\nin the selection and in `filteredItems` (items given by the\n`dataProvider` callback).",
|
|
137
144
|
"value": {
|
|
138
145
|
"kind": "expression"
|
|
139
146
|
}
|
|
@@ -208,6 +215,13 @@
|
|
|
208
215
|
"kind": "expression"
|
|
209
216
|
}
|
|
210
217
|
},
|
|
218
|
+
{
|
|
219
|
+
"name": ".partialMatchMode",
|
|
220
|
+
"description": "Controls which item is automatically set to be selected, for\nexample on Enter, when the typed filter only partially matches\nits label. The item that will be selected is highlighted in the\ndropdown while typing:\n\n- `none` (default): an item is automatically set to be selected only when the filter matches its label exactly.\n- `first-match`: the first item in the filtered results is automatically set to be selected.\n- `only-match`: the item is automatically set to be selected when filtering narrows the results to a single item.\n\nIn general, an exact match is always set to be selected and takes\nprecedence over partial matches, regardless of the mode.\n\nA partial match is only applied while the dropdown is open. For\nexample, when auto-open is disabled with `autoOpenDisabled`, typing\ndoes not highlight a match or set it to be selected until the\ndropdown is opened.\n\nThis feature cannot be used together with custom values, because a\npartial match is also a valid custom value. A partial match is not\napplied when custom values are allowed with `allowCustomValue`.",
|
|
221
|
+
"value": {
|
|
222
|
+
"kind": "expression"
|
|
223
|
+
}
|
|
224
|
+
},
|
|
211
225
|
{
|
|
212
226
|
"name": ".pattern",
|
|
213
227
|
"description": "A regular expression that the value is checked against.\nThe pattern must match the entire value, not just some subset.",
|