@vaadin/combo-box 24.8.4 → 25.0.0-alpha10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -23
- package/package.json +17 -19
- package/src/styles/vaadin-combo-box-base-styles.d.ts +8 -0
- package/src/styles/vaadin-combo-box-base-styles.js +17 -0
- package/src/styles/vaadin-combo-box-core-styles.d.ts +8 -0
- package/src/styles/vaadin-combo-box-core-styles.js +12 -0
- package/src/styles/vaadin-combo-box-overlay-base-styles.js +46 -0
- package/src/styles/vaadin-combo-box-overlay-core-styles.js +18 -0
- package/src/styles/vaadin-combo-box-scroller-base-styles.js +29 -0
- package/src/styles/vaadin-combo-box-scroller-core-styles.js +27 -0
- package/src/vaadin-combo-box-base-mixin.d.ts +56 -0
- package/src/vaadin-combo-box-base-mixin.js +776 -0
- package/src/vaadin-combo-box-data-provider-mixin.js +17 -32
- package/src/vaadin-combo-box-item-mixin.js +6 -1
- package/src/vaadin-combo-box-item.js +17 -16
- package/src/vaadin-combo-box-items-mixin.d.ts +53 -0
- package/src/vaadin-combo-box-items-mixin.js +275 -0
- package/src/vaadin-combo-box-mixin.d.ts +3 -72
- package/src/vaadin-combo-box-mixin.js +84 -922
- package/src/vaadin-combo-box-overlay-mixin.js +1 -22
- package/src/vaadin-combo-box-overlay.js +15 -22
- package/src/vaadin-combo-box-scroller.js +10 -26
- package/src/vaadin-combo-box.d.ts +12 -14
- package/src/vaadin-combo-box.js +81 -53
- package/web-types.json +51 -536
- package/web-types.lit.json +17 -262
- package/src/vaadin-combo-box-light-mixin.d.ts +0 -26
- package/src/vaadin-combo-box-light-mixin.js +0 -131
- package/src/vaadin-combo-box-light.d.ts +0 -161
- package/src/vaadin-combo-box-light.js +0 -94
- package/src/vaadin-lit-combo-box-item.js +0 -68
- package/src/vaadin-lit-combo-box-light.js +0 -57
- package/src/vaadin-lit-combo-box-overlay.js +0 -60
- package/src/vaadin-lit-combo-box-scroller.js +0 -59
- package/src/vaadin-lit-combo-box.js +0 -169
- package/theme/lumo/vaadin-combo-box-light.d.ts +0 -3
- package/theme/lumo/vaadin-combo-box-light.js +0 -3
- package/theme/lumo/vaadin-lit-combo-box-light.d.ts +0 -3
- package/theme/lumo/vaadin-lit-combo-box-light.js +0 -3
- package/theme/lumo/vaadin-lit-combo-box.d.ts +0 -4
- package/theme/lumo/vaadin-lit-combo-box.js +0 -4
- package/theme/material/vaadin-combo-box-item-styles.d.ts +0 -5
- package/theme/material/vaadin-combo-box-item-styles.js +0 -20
- package/theme/material/vaadin-combo-box-light.d.ts +0 -3
- package/theme/material/vaadin-combo-box-light.js +0 -3
- package/theme/material/vaadin-combo-box-overlay-styles.d.ts +0 -4
- package/theme/material/vaadin-combo-box-overlay-styles.js +0 -51
- package/theme/material/vaadin-combo-box-styles.d.ts +0 -3
- package/theme/material/vaadin-combo-box-styles.js +0 -21
- package/theme/material/vaadin-combo-box.d.ts +0 -4
- package/theme/material/vaadin-combo-box.js +0 -4
- package/theme/material/vaadin-lit-combo-box-light.d.ts +0 -3
- package/theme/material/vaadin-lit-combo-box-light.js +0 -3
- package/theme/material/vaadin-lit-combo-box.d.ts +0 -4
- package/theme/material/vaadin-lit-combo-box.js +0 -4
- package/vaadin-combo-box-light.d.ts +0 -1
- package/vaadin-combo-box-light.js +0 -2
- package/vaadin-lit-combo-box-light.d.ts +0 -1
- package/vaadin-lit-combo-box-light.js +0 -2
- package/vaadin-lit-combo-box.d.ts +0 -1
- package/vaadin-lit-combo-box.js +0 -2
package/web-types.json
CHANGED
|
@@ -1,499 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/combo-box",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "25.0.0-alpha10",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
|
-
{
|
|
10
|
-
"name": "vaadin-combo-box-light",
|
|
11
|
-
"description": "`<vaadin-combo-box-light>` is a customizable version of the `<vaadin-combo-box>` providing\nonly the dropdown functionality and leaving the input field definition to the user.\n\nThe element has the same API as `<vaadin-combo-box>`.\n\nTo create a custom input field, you need to add a child element which has a two-way\ndata-bindable property representing the input value. The property name is expected\nto be `value` by default. For example, you can use `<vaadin-text-field>` element:\n\n```html\n<vaadin-combo-box-light>\n <vaadin-text-field></vaadin-text-field>\n</vaadin-combo-box-light>\n```\n\nIf you are using custom input field that has other property for value,\nset `class=\"input\"` to enable corresponding logic, and use `attr-for-value`\nattribute to specify which property to use:\n\n```html\n<vaadin-combo-box-light attr-for-value=\"input-value\">\n <custom-input class=\"input\"></custom-input>\n</vaadin-combo-box-light>\n```\n\nYou can also pass custom toggle and clear buttons with corresponding classes:\n\n```html\n<vaadin-combo-box-light>\n <custom-input class=\"input\" attr-for-value=\"input-value\">\n <button slot=\"suffix\" class=\"clear-button\">Clear</button>\n <button slot=\"suffix\" class=\"toggle-button\">Toggle</button>\n </custom-input>\n</vaadin-combo-box-light>\n```",
|
|
12
|
-
"attributes": [
|
|
13
|
-
{
|
|
14
|
-
"name": "page-size",
|
|
15
|
-
"description": "Number of items fetched at a time from the dataprovider.",
|
|
16
|
-
"value": {
|
|
17
|
-
"type": [
|
|
18
|
-
"number"
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"name": "size",
|
|
24
|
-
"description": "Total number of items.",
|
|
25
|
-
"value": {
|
|
26
|
-
"type": [
|
|
27
|
-
"number",
|
|
28
|
-
"undefined"
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"name": "invalid",
|
|
34
|
-
"description": "Set to true when the field is invalid.",
|
|
35
|
-
"value": {
|
|
36
|
-
"type": [
|
|
37
|
-
"boolean",
|
|
38
|
-
"null",
|
|
39
|
-
"undefined"
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"name": "manual-validation",
|
|
45
|
-
"description": "Set to true to enable manual validation mode. This mode disables automatic\nconstraint validation, allowing you to control the validation process yourself.\nYou can still trigger constraint validation manually with the `validate()` method\nor use `checkValidity()` to assess the component's validity without affecting\nthe invalid state. In manual validation mode, you can also manipulate\nthe `invalid` property directly through your application logic without conflicts\nwith the component's internal validation.",
|
|
46
|
-
"value": {
|
|
47
|
-
"type": [
|
|
48
|
-
"boolean",
|
|
49
|
-
"null",
|
|
50
|
-
"undefined"
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"name": "required",
|
|
56
|
-
"description": "Specifies that the user must fill in a value.",
|
|
57
|
-
"value": {
|
|
58
|
-
"type": [
|
|
59
|
-
"boolean",
|
|
60
|
-
"null",
|
|
61
|
-
"undefined"
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"name": "disabled",
|
|
67
|
-
"description": "If true, the user cannot interact with this element.",
|
|
68
|
-
"value": {
|
|
69
|
-
"type": [
|
|
70
|
-
"boolean",
|
|
71
|
-
"null",
|
|
72
|
-
"undefined"
|
|
73
|
-
]
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"name": "value",
|
|
78
|
-
"description": "The value of the field.",
|
|
79
|
-
"value": {
|
|
80
|
-
"type": [
|
|
81
|
-
"string",
|
|
82
|
-
"null",
|
|
83
|
-
"undefined"
|
|
84
|
-
]
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"name": "overlay-class",
|
|
89
|
-
"description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
|
|
90
|
-
"value": {
|
|
91
|
-
"type": [
|
|
92
|
-
"string",
|
|
93
|
-
"null",
|
|
94
|
-
"undefined"
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"name": "opened",
|
|
100
|
-
"description": "True if the dropdown is open, false otherwise.",
|
|
101
|
-
"value": {
|
|
102
|
-
"type": [
|
|
103
|
-
"boolean"
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
"name": "auto-open-disabled",
|
|
109
|
-
"description": "Set true to prevent the overlay from opening automatically.",
|
|
110
|
-
"value": {
|
|
111
|
-
"type": [
|
|
112
|
-
"boolean",
|
|
113
|
-
"null",
|
|
114
|
-
"undefined"
|
|
115
|
-
]
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"name": "readonly",
|
|
120
|
-
"description": "When present, it specifies that the field is read-only.",
|
|
121
|
-
"value": {
|
|
122
|
-
"type": [
|
|
123
|
-
"boolean"
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
"name": "allow-custom-value",
|
|
129
|
-
"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.",
|
|
130
|
-
"value": {
|
|
131
|
-
"type": [
|
|
132
|
-
"boolean"
|
|
133
|
-
]
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"name": "loading",
|
|
138
|
-
"description": "When set to `true`, \"loading\" attribute is added to host and the overlay element.",
|
|
139
|
-
"value": {
|
|
140
|
-
"type": [
|
|
141
|
-
"boolean"
|
|
142
|
-
]
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"name": "filter",
|
|
147
|
-
"description": "Filtering string the user has typed into the input field.",
|
|
148
|
-
"value": {
|
|
149
|
-
"type": [
|
|
150
|
-
"string"
|
|
151
|
-
]
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
"name": "item-label-path",
|
|
156
|
-
"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.",
|
|
157
|
-
"value": {
|
|
158
|
-
"type": [
|
|
159
|
-
"string"
|
|
160
|
-
]
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
"name": "item-value-path",
|
|
165
|
-
"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.",
|
|
166
|
-
"value": {
|
|
167
|
-
"type": [
|
|
168
|
-
"string"
|
|
169
|
-
]
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
"name": "item-id-path",
|
|
174
|
-
"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 `selectedItem` and `filteredItems` (items given by the\n`dataProvider` callback).",
|
|
175
|
-
"value": {
|
|
176
|
-
"type": [
|
|
177
|
-
"string",
|
|
178
|
-
"null",
|
|
179
|
-
"undefined"
|
|
180
|
-
]
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
"name": "attr-for-value",
|
|
185
|
-
"description": "Name of the two-way data-bindable property representing the\nvalue of the custom input field.",
|
|
186
|
-
"value": {
|
|
187
|
-
"type": [
|
|
188
|
-
"string"
|
|
189
|
-
]
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
"name": "theme",
|
|
194
|
-
"description": "The theme variants to apply to the component.",
|
|
195
|
-
"value": {
|
|
196
|
-
"type": [
|
|
197
|
-
"string",
|
|
198
|
-
"null",
|
|
199
|
-
"undefined"
|
|
200
|
-
]
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
],
|
|
204
|
-
"js": {
|
|
205
|
-
"properties": [
|
|
206
|
-
{
|
|
207
|
-
"name": "pageSize",
|
|
208
|
-
"description": "Number of items fetched at a time from the dataprovider.",
|
|
209
|
-
"value": {
|
|
210
|
-
"type": [
|
|
211
|
-
"number"
|
|
212
|
-
]
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
"name": "size",
|
|
217
|
-
"description": "Total number of items.",
|
|
218
|
-
"value": {
|
|
219
|
-
"type": [
|
|
220
|
-
"number",
|
|
221
|
-
"undefined"
|
|
222
|
-
]
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
"name": "dataProvider",
|
|
227
|
-
"description": "Function that provides items lazily. Receives arguments `params`, `callback`\n\n`params.page` Requested page index\n\n`params.pageSize` Current page size\n\n`params.filter` Currently applied filter\n\n`callback(items, size)` Callback function with arguments:\n - `items` Current page of items\n - `size` Total number of items.",
|
|
228
|
-
"value": {
|
|
229
|
-
"type": [
|
|
230
|
-
"ComboBoxDataProvider",
|
|
231
|
-
"undefined"
|
|
232
|
-
]
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
"name": "invalid",
|
|
237
|
-
"description": "Set to true when the field is invalid.",
|
|
238
|
-
"value": {
|
|
239
|
-
"type": [
|
|
240
|
-
"boolean",
|
|
241
|
-
"null",
|
|
242
|
-
"undefined"
|
|
243
|
-
]
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
"name": "manualValidation",
|
|
248
|
-
"description": "Set to true to enable manual validation mode. This mode disables automatic\nconstraint validation, allowing you to control the validation process yourself.\nYou can still trigger constraint validation manually with the `validate()` method\nor use `checkValidity()` to assess the component's validity without affecting\nthe invalid state. In manual validation mode, you can also manipulate\nthe `invalid` property directly through your application logic without conflicts\nwith the component's internal validation.",
|
|
249
|
-
"value": {
|
|
250
|
-
"type": [
|
|
251
|
-
"boolean",
|
|
252
|
-
"null",
|
|
253
|
-
"undefined"
|
|
254
|
-
]
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
"name": "required",
|
|
259
|
-
"description": "Specifies that the user must fill in a value.",
|
|
260
|
-
"value": {
|
|
261
|
-
"type": [
|
|
262
|
-
"boolean",
|
|
263
|
-
"null",
|
|
264
|
-
"undefined"
|
|
265
|
-
]
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
"name": "disabled",
|
|
270
|
-
"description": "If true, the user cannot interact with this element.",
|
|
271
|
-
"value": {
|
|
272
|
-
"type": [
|
|
273
|
-
"boolean",
|
|
274
|
-
"null",
|
|
275
|
-
"undefined"
|
|
276
|
-
]
|
|
277
|
-
}
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
"name": "value",
|
|
281
|
-
"description": "The value of the field.",
|
|
282
|
-
"value": {
|
|
283
|
-
"type": [
|
|
284
|
-
"string",
|
|
285
|
-
"null",
|
|
286
|
-
"undefined"
|
|
287
|
-
]
|
|
288
|
-
}
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
"name": "overlayClass",
|
|
292
|
-
"description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
|
|
293
|
-
"value": {
|
|
294
|
-
"type": [
|
|
295
|
-
"string",
|
|
296
|
-
"null",
|
|
297
|
-
"undefined"
|
|
298
|
-
]
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
"name": "opened",
|
|
303
|
-
"description": "True if the dropdown is open, false otherwise.",
|
|
304
|
-
"value": {
|
|
305
|
-
"type": [
|
|
306
|
-
"boolean"
|
|
307
|
-
]
|
|
308
|
-
}
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
"name": "autoOpenDisabled",
|
|
312
|
-
"description": "Set true to prevent the overlay from opening automatically.",
|
|
313
|
-
"value": {
|
|
314
|
-
"type": [
|
|
315
|
-
"boolean",
|
|
316
|
-
"null",
|
|
317
|
-
"undefined"
|
|
318
|
-
]
|
|
319
|
-
}
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
"name": "readonly",
|
|
323
|
-
"description": "When present, it specifies that the field is read-only.",
|
|
324
|
-
"value": {
|
|
325
|
-
"type": [
|
|
326
|
-
"boolean"
|
|
327
|
-
]
|
|
328
|
-
}
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
"name": "renderer",
|
|
332
|
-
"description": "Custom function for rendering the content of every item.\nReceives three arguments:\n\n- `root` The `<vaadin-combo-box-item>` internal container DOM element.\n- `comboBox` The reference to the `<vaadin-combo-box>` element.\n- `model` The object with the properties related with the rendered\n item, contains:\n - `model.index` The index of the rendered item.\n - `model.item` The item.",
|
|
333
|
-
"value": {
|
|
334
|
-
"type": [
|
|
335
|
-
"ComboBoxRenderer",
|
|
336
|
-
"undefined"
|
|
337
|
-
]
|
|
338
|
-
}
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
"name": "items",
|
|
342
|
-
"description": "A full set of items to filter the visible options from.\nThe items can be of either `String` or `Object` type.",
|
|
343
|
-
"value": {
|
|
344
|
-
"type": [
|
|
345
|
-
"Array.<ComboBoxItem",
|
|
346
|
-
"string>",
|
|
347
|
-
"undefined"
|
|
348
|
-
]
|
|
349
|
-
}
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
"name": "allowCustomValue",
|
|
353
|
-
"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
|
-
"value": {
|
|
355
|
-
"type": [
|
|
356
|
-
"boolean"
|
|
357
|
-
]
|
|
358
|
-
}
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
"name": "filteredItems",
|
|
362
|
-
"description": "A subset of items, filtered based on the user input. Filtered items\ncan be assigned directly to omit the internal filtering functionality.\nThe items can be of either `String` or `Object` type.",
|
|
363
|
-
"value": {
|
|
364
|
-
"type": [
|
|
365
|
-
"Array.<ComboBoxItem",
|
|
366
|
-
"string>",
|
|
367
|
-
"undefined"
|
|
368
|
-
]
|
|
369
|
-
}
|
|
370
|
-
},
|
|
371
|
-
{
|
|
372
|
-
"name": "loading",
|
|
373
|
-
"description": "When set to `true`, \"loading\" attribute is added to host and the overlay element.",
|
|
374
|
-
"value": {
|
|
375
|
-
"type": [
|
|
376
|
-
"boolean"
|
|
377
|
-
]
|
|
378
|
-
}
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
"name": "filter",
|
|
382
|
-
"description": "Filtering string the user has typed into the input field.",
|
|
383
|
-
"value": {
|
|
384
|
-
"type": [
|
|
385
|
-
"string"
|
|
386
|
-
]
|
|
387
|
-
}
|
|
388
|
-
},
|
|
389
|
-
{
|
|
390
|
-
"name": "selectedItem",
|
|
391
|
-
"description": "The selected item from the `items` array.",
|
|
392
|
-
"value": {
|
|
393
|
-
"type": [
|
|
394
|
-
"ComboBoxItem",
|
|
395
|
-
"string",
|
|
396
|
-
"undefined"
|
|
397
|
-
]
|
|
398
|
-
}
|
|
399
|
-
},
|
|
400
|
-
{
|
|
401
|
-
"name": "itemClassNameGenerator",
|
|
402
|
-
"description": "A function used to generate CSS class names for dropdown\nitems based on the item. The return value should be the\ngenerated class name as a string, or multiple class names\nseparated by whitespace characters.",
|
|
403
|
-
"value": {
|
|
404
|
-
"type": [
|
|
405
|
-
"Object",
|
|
406
|
-
"null",
|
|
407
|
-
"undefined"
|
|
408
|
-
]
|
|
409
|
-
}
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
"name": "itemLabelPath",
|
|
413
|
-
"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.",
|
|
414
|
-
"value": {
|
|
415
|
-
"type": [
|
|
416
|
-
"string"
|
|
417
|
-
]
|
|
418
|
-
}
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
"name": "itemValuePath",
|
|
422
|
-
"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.",
|
|
423
|
-
"value": {
|
|
424
|
-
"type": [
|
|
425
|
-
"string"
|
|
426
|
-
]
|
|
427
|
-
}
|
|
428
|
-
},
|
|
429
|
-
{
|
|
430
|
-
"name": "itemIdPath",
|
|
431
|
-
"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 `selectedItem` and `filteredItems` (items given by the\n`dataProvider` callback).",
|
|
432
|
-
"value": {
|
|
433
|
-
"type": [
|
|
434
|
-
"string",
|
|
435
|
-
"null",
|
|
436
|
-
"undefined"
|
|
437
|
-
]
|
|
438
|
-
}
|
|
439
|
-
},
|
|
440
|
-
{
|
|
441
|
-
"name": "attrForValue",
|
|
442
|
-
"description": "Name of the two-way data-bindable property representing the\nvalue of the custom input field.",
|
|
443
|
-
"value": {
|
|
444
|
-
"type": [
|
|
445
|
-
"string"
|
|
446
|
-
]
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
],
|
|
450
|
-
"events": [
|
|
451
|
-
{
|
|
452
|
-
"name": "validated",
|
|
453
|
-
"description": "Fired whenever the field is validated."
|
|
454
|
-
},
|
|
455
|
-
{
|
|
456
|
-
"name": "change",
|
|
457
|
-
"description": "Fired when the user commits a value change."
|
|
458
|
-
},
|
|
459
|
-
{
|
|
460
|
-
"name": "custom-value-set",
|
|
461
|
-
"description": "Fired when the user sets a custom value."
|
|
462
|
-
},
|
|
463
|
-
{
|
|
464
|
-
"name": "selected-item-changed",
|
|
465
|
-
"description": "Fired when selected item changes."
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
"name": "vaadin-combo-box-dropdown-closed",
|
|
469
|
-
"description": "Fired after the `vaadin-combo-box-overlay` closes."
|
|
470
|
-
},
|
|
471
|
-
{
|
|
472
|
-
"name": "vaadin-combo-box-dropdown-opened",
|
|
473
|
-
"description": "Fired after the `vaadin-combo-box-overlay` opens."
|
|
474
|
-
},
|
|
475
|
-
{
|
|
476
|
-
"name": "value-changed",
|
|
477
|
-
"description": "Fired when the value changes."
|
|
478
|
-
},
|
|
479
|
-
{
|
|
480
|
-
"name": "invalid-changed",
|
|
481
|
-
"description": "Fired when the `invalid` property changes."
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
"name": "opened-changed",
|
|
485
|
-
"description": "Fired when the `opened` property changes."
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
"name": "filter-changed",
|
|
489
|
-
"description": "Fired when the `filter` property changes."
|
|
490
|
-
}
|
|
491
|
-
]
|
|
492
|
-
}
|
|
493
|
-
},
|
|
494
9
|
{
|
|
495
10
|
"name": "vaadin-combo-box",
|
|
496
|
-
"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/
|
|
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.0.0-alpha10/#/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.0.0-alpha10/#/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.0.0-alpha10/#/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\n`<vaadin-combo-box>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n-----------------|------------------\n`toggle-button` | The toggle button\n`overlay` | The overlay container\n`content` | The overlay content\n`loader` | The loading indicator shown while loading items\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description | Part name\n----------|-------------|------------\n`opened` | Set when the combo box dropdown is open | :host\n`loading` | Set when new items are expected | :host\n\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.0.0-alpha10/#/elements/vaadin-item).\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
497
12
|
"attributes": [
|
|
498
13
|
{
|
|
499
14
|
"name": "disabled",
|
|
@@ -753,26 +268,26 @@
|
|
|
753
268
|
}
|
|
754
269
|
},
|
|
755
270
|
{
|
|
756
|
-
"name": "
|
|
757
|
-
"description": "
|
|
271
|
+
"name": "filter",
|
|
272
|
+
"description": "Filtering string the user has typed into the input field.",
|
|
758
273
|
"value": {
|
|
759
274
|
"type": [
|
|
760
|
-
"
|
|
275
|
+
"string"
|
|
761
276
|
]
|
|
762
277
|
}
|
|
763
278
|
},
|
|
764
279
|
{
|
|
765
|
-
"name": "
|
|
766
|
-
"description": "
|
|
280
|
+
"name": "item-label-path",
|
|
281
|
+
"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.",
|
|
767
282
|
"value": {
|
|
768
283
|
"type": [
|
|
769
|
-
"
|
|
284
|
+
"string"
|
|
770
285
|
]
|
|
771
286
|
}
|
|
772
287
|
},
|
|
773
288
|
{
|
|
774
|
-
"name": "
|
|
775
|
-
"description": "
|
|
289
|
+
"name": "item-value-path",
|
|
290
|
+
"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.",
|
|
776
291
|
"value": {
|
|
777
292
|
"type": [
|
|
778
293
|
"string"
|
|
@@ -780,20 +295,20 @@
|
|
|
780
295
|
}
|
|
781
296
|
},
|
|
782
297
|
{
|
|
783
|
-
"name": "
|
|
784
|
-
"description": "
|
|
298
|
+
"name": "allow-custom-value",
|
|
299
|
+
"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.",
|
|
785
300
|
"value": {
|
|
786
301
|
"type": [
|
|
787
|
-
"
|
|
302
|
+
"boolean"
|
|
788
303
|
]
|
|
789
304
|
}
|
|
790
305
|
},
|
|
791
306
|
{
|
|
792
|
-
"name": "
|
|
793
|
-
"description": "
|
|
307
|
+
"name": "loading",
|
|
308
|
+
"description": "When set to `true`, \"loading\" attribute is added to host and the overlay element.",
|
|
794
309
|
"value": {
|
|
795
310
|
"type": [
|
|
796
|
-
"
|
|
311
|
+
"boolean"
|
|
797
312
|
]
|
|
798
313
|
}
|
|
799
314
|
},
|
|
@@ -1090,18 +605,19 @@
|
|
|
1090
605
|
}
|
|
1091
606
|
},
|
|
1092
607
|
{
|
|
1093
|
-
"name": "
|
|
1094
|
-
"description": "
|
|
608
|
+
"name": "items",
|
|
609
|
+
"description": "A full set of items to filter the visible options from.\nThe items can be of either `String` or `Object` type.",
|
|
1095
610
|
"value": {
|
|
1096
611
|
"type": [
|
|
1097
|
-
"
|
|
612
|
+
"Array.<ComboBoxItem",
|
|
613
|
+
"string>",
|
|
1098
614
|
"undefined"
|
|
1099
615
|
]
|
|
1100
616
|
}
|
|
1101
617
|
},
|
|
1102
618
|
{
|
|
1103
|
-
"name": "
|
|
1104
|
-
"description": "A
|
|
619
|
+
"name": "filteredItems",
|
|
620
|
+
"description": "A subset of items, filtered based on the user input. Filtered items\ncan be assigned directly to omit the internal filtering functionality.\nThe items can be of either `String` or `Object` type.",
|
|
1105
621
|
"value": {
|
|
1106
622
|
"type": [
|
|
1107
623
|
"Array.<ComboBoxItem",
|
|
@@ -1111,80 +627,79 @@
|
|
|
1111
627
|
}
|
|
1112
628
|
},
|
|
1113
629
|
{
|
|
1114
|
-
"name": "
|
|
1115
|
-
"description": "
|
|
630
|
+
"name": "filter",
|
|
631
|
+
"description": "Filtering string the user has typed into the input field.",
|
|
1116
632
|
"value": {
|
|
1117
633
|
"type": [
|
|
1118
|
-
"
|
|
634
|
+
"string"
|
|
1119
635
|
]
|
|
1120
636
|
}
|
|
1121
637
|
},
|
|
1122
638
|
{
|
|
1123
|
-
"name": "
|
|
1124
|
-
"description": "
|
|
639
|
+
"name": "itemLabelPath",
|
|
640
|
+
"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.",
|
|
1125
641
|
"value": {
|
|
1126
642
|
"type": [
|
|
1127
|
-
"
|
|
1128
|
-
"string>",
|
|
1129
|
-
"undefined"
|
|
643
|
+
"string"
|
|
1130
644
|
]
|
|
1131
645
|
}
|
|
1132
646
|
},
|
|
1133
647
|
{
|
|
1134
|
-
"name": "
|
|
1135
|
-
"description": "
|
|
648
|
+
"name": "itemValuePath",
|
|
649
|
+
"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.",
|
|
1136
650
|
"value": {
|
|
1137
651
|
"type": [
|
|
1138
|
-
"
|
|
652
|
+
"string"
|
|
1139
653
|
]
|
|
1140
654
|
}
|
|
1141
655
|
},
|
|
1142
656
|
{
|
|
1143
|
-
"name": "
|
|
1144
|
-
"description": "
|
|
657
|
+
"name": "renderer",
|
|
658
|
+
"description": "Custom function for rendering the content of every item.\nReceives three arguments:\n\n- `root` The `<vaadin-combo-box-item>` internal container DOM element.\n- `comboBox` The reference to the `<vaadin-combo-box>` element.\n- `model` The object with the properties related with the rendered\n item, contains:\n - `model.index` The index of the rendered item.\n - `model.item` The item.",
|
|
1145
659
|
"value": {
|
|
1146
660
|
"type": [
|
|
1147
|
-
"
|
|
661
|
+
"ComboBoxRenderer",
|
|
662
|
+
"undefined"
|
|
1148
663
|
]
|
|
1149
664
|
}
|
|
1150
665
|
},
|
|
1151
666
|
{
|
|
1152
|
-
"name": "
|
|
1153
|
-
"description": "
|
|
667
|
+
"name": "allowCustomValue",
|
|
668
|
+
"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.",
|
|
1154
669
|
"value": {
|
|
1155
670
|
"type": [
|
|
1156
|
-
"
|
|
1157
|
-
"string",
|
|
1158
|
-
"undefined"
|
|
671
|
+
"boolean"
|
|
1159
672
|
]
|
|
1160
673
|
}
|
|
1161
674
|
},
|
|
1162
675
|
{
|
|
1163
|
-
"name": "
|
|
1164
|
-
"description": "
|
|
676
|
+
"name": "loading",
|
|
677
|
+
"description": "When set to `true`, \"loading\" attribute is added to host and the overlay element.",
|
|
1165
678
|
"value": {
|
|
1166
679
|
"type": [
|
|
1167
|
-
"
|
|
1168
|
-
"null",
|
|
1169
|
-
"undefined"
|
|
680
|
+
"boolean"
|
|
1170
681
|
]
|
|
1171
682
|
}
|
|
1172
683
|
},
|
|
1173
684
|
{
|
|
1174
|
-
"name": "
|
|
1175
|
-
"description": "
|
|
685
|
+
"name": "selectedItem",
|
|
686
|
+
"description": "The selected item from the `items` array.",
|
|
1176
687
|
"value": {
|
|
1177
688
|
"type": [
|
|
1178
|
-
"
|
|
689
|
+
"ComboBoxItem",
|
|
690
|
+
"string",
|
|
691
|
+
"undefined"
|
|
1179
692
|
]
|
|
1180
693
|
}
|
|
1181
694
|
},
|
|
1182
695
|
{
|
|
1183
|
-
"name": "
|
|
1184
|
-
"description": "
|
|
696
|
+
"name": "itemClassNameGenerator",
|
|
697
|
+
"description": "A function used to generate CSS class names for dropdown\nitems based on the item. The return value should be the\ngenerated class name as a string, or multiple class names\nseparated by whitespace characters.",
|
|
1185
698
|
"value": {
|
|
1186
699
|
"type": [
|
|
1187
|
-
"
|
|
700
|
+
"Object",
|
|
701
|
+
"null",
|
|
702
|
+
"undefined"
|
|
1188
703
|
]
|
|
1189
704
|
}
|
|
1190
705
|
},
|