@vaadin/combo-box 25.1.0-beta1 → 25.1.0-beta3
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 +4 -1063
- package/package.json +15 -15
- package/src/vaadin-combo-box-base-mixin.js +0 -3
- package/src/vaadin-combo-box-data-provider-mixin.js +0 -2
- package/src/vaadin-combo-box-items-mixin.js +0 -3
- package/src/vaadin-combo-box-mixin.js +0 -2
- package/web-types.json +52 -18
- package/web-types.lit.json +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/combo-box",
|
|
3
|
-
"version": "25.1.0-
|
|
3
|
+
"version": "25.1.0-beta3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,28 +36,28 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
39
|
-
"@vaadin/a11y-base": "25.1.0-
|
|
40
|
-
"@vaadin/component-base": "25.1.0-
|
|
41
|
-
"@vaadin/field-base": "25.1.0-
|
|
42
|
-
"@vaadin/input-container": "25.1.0-
|
|
43
|
-
"@vaadin/item": "25.1.0-
|
|
44
|
-
"@vaadin/lit-renderer": "25.1.0-
|
|
45
|
-
"@vaadin/overlay": "25.1.0-
|
|
46
|
-
"@vaadin/vaadin-themable-mixin": "25.1.0-
|
|
39
|
+
"@vaadin/a11y-base": "25.1.0-beta3",
|
|
40
|
+
"@vaadin/component-base": "25.1.0-beta3",
|
|
41
|
+
"@vaadin/field-base": "25.1.0-beta3",
|
|
42
|
+
"@vaadin/input-container": "25.1.0-beta3",
|
|
43
|
+
"@vaadin/item": "25.1.0-beta3",
|
|
44
|
+
"@vaadin/lit-renderer": "25.1.0-beta3",
|
|
45
|
+
"@vaadin/overlay": "25.1.0-beta3",
|
|
46
|
+
"@vaadin/vaadin-themable-mixin": "25.1.0-beta3",
|
|
47
47
|
"lit": "^3.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@vaadin/aura": "25.1.0-
|
|
51
|
-
"@vaadin/chai-plugins": "25.1.0-
|
|
52
|
-
"@vaadin/test-runner-commands": "25.1.0-
|
|
50
|
+
"@vaadin/aura": "25.1.0-beta3",
|
|
51
|
+
"@vaadin/chai-plugins": "25.1.0-beta3",
|
|
52
|
+
"@vaadin/test-runner-commands": "25.1.0-beta3",
|
|
53
53
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
54
|
-
"@vaadin/vaadin-lumo-styles": "25.1.0-
|
|
55
|
-
"sinon": "^21.0.
|
|
54
|
+
"@vaadin/vaadin-lumo-styles": "25.1.0-beta3",
|
|
55
|
+
"sinon": "^21.0.2"
|
|
56
56
|
},
|
|
57
57
|
"customElements": "custom-elements.json",
|
|
58
58
|
"web-types": [
|
|
59
59
|
"web-types.json",
|
|
60
60
|
"web-types.lit.json"
|
|
61
61
|
],
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "4251850231a42298fda23b83928da588831cdb5d"
|
|
63
63
|
}
|
|
@@ -26,7 +26,6 @@ export const ComboBoxBaseMixin = (superClass) =>
|
|
|
26
26
|
return {
|
|
27
27
|
/**
|
|
28
28
|
* True if the dropdown is open, false otherwise.
|
|
29
|
-
* @type {boolean}
|
|
30
29
|
*/
|
|
31
30
|
opened: {
|
|
32
31
|
type: Boolean,
|
|
@@ -48,7 +47,6 @@ export const ComboBoxBaseMixin = (superClass) =>
|
|
|
48
47
|
|
|
49
48
|
/**
|
|
50
49
|
* When present, it specifies that the field is read-only.
|
|
51
|
-
* @type {boolean}
|
|
52
50
|
*/
|
|
53
51
|
readonly: {
|
|
54
52
|
type: Boolean,
|
|
@@ -57,7 +55,6 @@ export const ComboBoxBaseMixin = (superClass) =>
|
|
|
57
55
|
},
|
|
58
56
|
|
|
59
57
|
/**
|
|
60
|
-
* @type {number}
|
|
61
58
|
* @protected
|
|
62
59
|
*/
|
|
63
60
|
_focusedIndex: {
|
|
@@ -16,7 +16,6 @@ export const ComboBoxDataProviderMixin = (superClass) =>
|
|
|
16
16
|
/**
|
|
17
17
|
* Number of items fetched at a time from the dataprovider.
|
|
18
18
|
* @attr {number} page-size
|
|
19
|
-
* @type {number}
|
|
20
19
|
*/
|
|
21
20
|
pageSize: {
|
|
22
21
|
type: Number,
|
|
@@ -27,7 +26,6 @@ export const ComboBoxDataProviderMixin = (superClass) =>
|
|
|
27
26
|
|
|
28
27
|
/**
|
|
29
28
|
* Total number of items.
|
|
30
|
-
* @type {number | undefined}
|
|
31
29
|
*/
|
|
32
30
|
size: {
|
|
33
31
|
type: Number,
|
|
@@ -68,7 +68,6 @@ export const ComboBoxItemsMixin = (superClass) =>
|
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* Filtering string the user has typed into the input field.
|
|
71
|
-
* @type {string}
|
|
72
71
|
*/
|
|
73
72
|
filter: {
|
|
74
73
|
type: String,
|
|
@@ -94,7 +93,6 @@ export const ComboBoxItemsMixin = (superClass) =>
|
|
|
94
93
|
* The item label is also used for matching items when processing user
|
|
95
94
|
* input, i.e., for filtering and selecting items.
|
|
96
95
|
* @attr {string} item-label-path
|
|
97
|
-
* @type {string}
|
|
98
96
|
*/
|
|
99
97
|
itemLabelPath: {
|
|
100
98
|
type: String,
|
|
@@ -111,7 +109,6 @@ export const ComboBoxItemsMixin = (superClass) =>
|
|
|
111
109
|
* The item value is used in the `value` property of the combo box,
|
|
112
110
|
* to provide the form value.
|
|
113
111
|
* @attr {string} item-value-path
|
|
114
|
-
* @type {string}
|
|
115
112
|
*/
|
|
116
113
|
itemValuePath: {
|
|
117
114
|
type: String,
|
|
@@ -49,7 +49,6 @@ export const ComboBoxMixin = (superClass) =>
|
|
|
49
49
|
* Also, when `value` is set programmatically, the input value will be set
|
|
50
50
|
* to reflect that value.
|
|
51
51
|
* @attr {boolean} allow-custom-value
|
|
52
|
-
* @type {boolean}
|
|
53
52
|
*/
|
|
54
53
|
allowCustomValue: {
|
|
55
54
|
type: Boolean,
|
|
@@ -58,7 +57,6 @@ export const ComboBoxMixin = (superClass) =>
|
|
|
58
57
|
|
|
59
58
|
/**
|
|
60
59
|
* When set to `true`, "loading" attribute is added to host and the overlay element.
|
|
61
|
-
* @type {boolean}
|
|
62
60
|
*/
|
|
63
61
|
loading: {
|
|
64
62
|
type: Boolean,
|
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/combo-box",
|
|
4
|
-
"version": "25.1.0-
|
|
4
|
+
"version": "25.1.0-beta3",
|
|
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.1.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.1.0-beta3/#/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.1.0-beta3/#/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.1.0-beta3/#/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 custom properties are available for styling:\n\nCustom property | Description | Default\n----------------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n`--vaadin-combo-box-overlay-width` | Width of the overlay | `auto`\n`--vaadin-combo-box-overlay-max-height` | Max height of the overlay | `65vh`\n\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\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.1.0-beta3/#/elements/vaadin-item).\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "accessible-name",
|
|
@@ -37,7 +37,9 @@
|
|
|
37
37
|
"description": "If `true`, the user can input a value that is not present in the items list.\n`value` property will be set to the input value in this case.\nAlso, when `value` is set programmatically, the input value will be set\nto reflect that value.",
|
|
38
38
|
"value": {
|
|
39
39
|
"type": [
|
|
40
|
-
"boolean"
|
|
40
|
+
"boolean",
|
|
41
|
+
"null",
|
|
42
|
+
"undefined"
|
|
41
43
|
]
|
|
42
44
|
}
|
|
43
45
|
},
|
|
@@ -123,7 +125,9 @@
|
|
|
123
125
|
"description": "Filtering string the user has typed into the input field.",
|
|
124
126
|
"value": {
|
|
125
127
|
"type": [
|
|
126
|
-
"string"
|
|
128
|
+
"string",
|
|
129
|
+
"null",
|
|
130
|
+
"undefined"
|
|
127
131
|
]
|
|
128
132
|
}
|
|
129
133
|
},
|
|
@@ -165,7 +169,9 @@
|
|
|
165
169
|
"description": "Path for label of the item. If `items` is an array of objects, the\n`itemLabelPath` is used to fetch the displayed string label for each\nitem.\n\nThe item label is also used for matching items when processing user\ninput, i.e., for filtering and selecting items.",
|
|
166
170
|
"value": {
|
|
167
171
|
"type": [
|
|
168
|
-
"string"
|
|
172
|
+
"string",
|
|
173
|
+
"null",
|
|
174
|
+
"undefined"
|
|
169
175
|
]
|
|
170
176
|
}
|
|
171
177
|
},
|
|
@@ -174,7 +180,9 @@
|
|
|
174
180
|
"description": "Path for the value of the item. If `items` is an array of objects, the\n`itemValuePath:` is used to fetch the string value for the selected\nitem.\n\nThe item value is used in the `value` property of the combo box,\nto provide the form value.",
|
|
175
181
|
"value": {
|
|
176
182
|
"type": [
|
|
177
|
-
"string"
|
|
183
|
+
"string",
|
|
184
|
+
"null",
|
|
185
|
+
"undefined"
|
|
178
186
|
]
|
|
179
187
|
}
|
|
180
188
|
},
|
|
@@ -194,7 +202,9 @@
|
|
|
194
202
|
"description": "When set to `true`, \"loading\" attribute is added to host and the overlay element.",
|
|
195
203
|
"value": {
|
|
196
204
|
"type": [
|
|
197
|
-
"boolean"
|
|
205
|
+
"boolean",
|
|
206
|
+
"null",
|
|
207
|
+
"undefined"
|
|
198
208
|
]
|
|
199
209
|
}
|
|
200
210
|
},
|
|
@@ -225,7 +235,9 @@
|
|
|
225
235
|
"description": "True if the dropdown is open, false otherwise.",
|
|
226
236
|
"value": {
|
|
227
237
|
"type": [
|
|
228
|
-
"boolean"
|
|
238
|
+
"boolean",
|
|
239
|
+
"null",
|
|
240
|
+
"undefined"
|
|
229
241
|
]
|
|
230
242
|
}
|
|
231
243
|
},
|
|
@@ -234,7 +246,9 @@
|
|
|
234
246
|
"description": "Number of items fetched at a time from the dataprovider.",
|
|
235
247
|
"value": {
|
|
236
248
|
"type": [
|
|
237
|
-
"number"
|
|
249
|
+
"number",
|
|
250
|
+
"null",
|
|
251
|
+
"undefined"
|
|
238
252
|
]
|
|
239
253
|
}
|
|
240
254
|
},
|
|
@@ -265,7 +279,9 @@
|
|
|
265
279
|
"description": "When present, it specifies that the field is read-only.",
|
|
266
280
|
"value": {
|
|
267
281
|
"type": [
|
|
268
|
-
"boolean"
|
|
282
|
+
"boolean",
|
|
283
|
+
"null",
|
|
284
|
+
"undefined"
|
|
269
285
|
]
|
|
270
286
|
}
|
|
271
287
|
},
|
|
@@ -286,6 +302,7 @@
|
|
|
286
302
|
"value": {
|
|
287
303
|
"type": [
|
|
288
304
|
"number",
|
|
305
|
+
"null",
|
|
289
306
|
"undefined"
|
|
290
307
|
]
|
|
291
308
|
}
|
|
@@ -353,7 +370,9 @@
|
|
|
353
370
|
"description": "If `true`, the user can input a value that is not present in the items list.\n`value` property will be set to the input value in this case.\nAlso, when `value` is set programmatically, the input value will be set\nto reflect that value.",
|
|
354
371
|
"value": {
|
|
355
372
|
"type": [
|
|
356
|
-
"boolean"
|
|
373
|
+
"boolean",
|
|
374
|
+
"null",
|
|
375
|
+
"undefined"
|
|
357
376
|
]
|
|
358
377
|
}
|
|
359
378
|
},
|
|
@@ -449,7 +468,9 @@
|
|
|
449
468
|
"description": "Filtering string the user has typed into the input field.",
|
|
450
469
|
"value": {
|
|
451
470
|
"type": [
|
|
452
|
-
"string"
|
|
471
|
+
"string",
|
|
472
|
+
"null",
|
|
473
|
+
"undefined"
|
|
453
474
|
]
|
|
454
475
|
}
|
|
455
476
|
},
|
|
@@ -524,7 +545,9 @@
|
|
|
524
545
|
"description": "Path for label of the item. If `items` is an array of objects, the\n`itemLabelPath` is used to fetch the displayed string label for each\nitem.\n\nThe item label is also used for matching items when processing user\ninput, i.e., for filtering and selecting items.",
|
|
525
546
|
"value": {
|
|
526
547
|
"type": [
|
|
527
|
-
"string"
|
|
548
|
+
"string",
|
|
549
|
+
"null",
|
|
550
|
+
"undefined"
|
|
528
551
|
]
|
|
529
552
|
}
|
|
530
553
|
},
|
|
@@ -544,7 +567,9 @@
|
|
|
544
567
|
"description": "Path for the value of the item. If `items` is an array of objects, the\n`itemValuePath:` is used to fetch the string value for the selected\nitem.\n\nThe item value is used in the `value` property of the combo box,\nto provide the form value.",
|
|
545
568
|
"value": {
|
|
546
569
|
"type": [
|
|
547
|
-
"string"
|
|
570
|
+
"string",
|
|
571
|
+
"null",
|
|
572
|
+
"undefined"
|
|
548
573
|
]
|
|
549
574
|
}
|
|
550
575
|
},
|
|
@@ -564,7 +589,9 @@
|
|
|
564
589
|
"description": "When set to `true`, \"loading\" attribute is added to host and the overlay element.",
|
|
565
590
|
"value": {
|
|
566
591
|
"type": [
|
|
567
|
-
"boolean"
|
|
592
|
+
"boolean",
|
|
593
|
+
"null",
|
|
594
|
+
"undefined"
|
|
568
595
|
]
|
|
569
596
|
}
|
|
570
597
|
},
|
|
@@ -595,7 +622,9 @@
|
|
|
595
622
|
"description": "True if the dropdown is open, false otherwise.",
|
|
596
623
|
"value": {
|
|
597
624
|
"type": [
|
|
598
|
-
"boolean"
|
|
625
|
+
"boolean",
|
|
626
|
+
"null",
|
|
627
|
+
"undefined"
|
|
599
628
|
]
|
|
600
629
|
}
|
|
601
630
|
},
|
|
@@ -604,7 +633,9 @@
|
|
|
604
633
|
"description": "Number of items fetched at a time from the dataprovider.",
|
|
605
634
|
"value": {
|
|
606
635
|
"type": [
|
|
607
|
-
"number"
|
|
636
|
+
"number",
|
|
637
|
+
"null",
|
|
638
|
+
"undefined"
|
|
608
639
|
]
|
|
609
640
|
}
|
|
610
641
|
},
|
|
@@ -635,7 +666,9 @@
|
|
|
635
666
|
"description": "When present, it specifies that the field is read-only.",
|
|
636
667
|
"value": {
|
|
637
668
|
"type": [
|
|
638
|
-
"boolean"
|
|
669
|
+
"boolean",
|
|
670
|
+
"null",
|
|
671
|
+
"undefined"
|
|
639
672
|
]
|
|
640
673
|
}
|
|
641
674
|
},
|
|
@@ -677,6 +710,7 @@
|
|
|
677
710
|
"value": {
|
|
678
711
|
"type": [
|
|
679
712
|
"number",
|
|
713
|
+
"null",
|
|
680
714
|
"undefined"
|
|
681
715
|
]
|
|
682
716
|
}
|
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.1.0-
|
|
4
|
+
"version": "25.1.0-beta3",
|
|
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-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.1.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.1.0-beta3/#/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.1.0-beta3/#/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.1.0-beta3/#/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 custom properties are available for styling:\n\nCustom property | Description | Default\n----------------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n`--vaadin-combo-box-overlay-width` | Width of the overlay | `auto`\n`--vaadin-combo-box-overlay-max-height` | Max height of the overlay | `65vh`\n\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\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.1.0-beta3/#/elements/vaadin-item).\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|