@vaadin/combo-box 25.0.0-alpha8 → 25.0.0-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +14 -17
- package/src/styles/vaadin-combo-box-base-styles.js +2 -2
- package/src/styles/vaadin-combo-box-overlay-base-styles.js +2 -2
- package/src/vaadin-combo-box-base-mixin.d.ts +0 -2
- package/src/vaadin-combo-box-base-mixin.js +9 -30
- package/src/vaadin-combo-box-data-provider-mixin.js +1 -21
- package/src/vaadin-combo-box-item-mixin.js +1 -1
- package/src/vaadin-combo-box-item.js +1 -1
- package/src/vaadin-combo-box-items-mixin.d.ts +60 -0
- package/src/vaadin-combo-box-items-mixin.js +292 -0
- package/src/vaadin-combo-box-mixin.d.ts +0 -42
- package/src/vaadin-combo-box-mixin.js +4 -236
- package/src/vaadin-combo-box-overlay-mixin.js +1 -25
- package/src/vaadin-combo-box-overlay.js +2 -2
- package/src/vaadin-combo-box-scroller-mixin.d.ts +1 -2
- package/src/vaadin-combo-box-scroller-mixin.js +5 -0
- package/src/vaadin-combo-box-scroller.js +1 -1
- package/src/vaadin-combo-box.d.ts +31 -19
- package/src/vaadin-combo-box.js +62 -21
- package/vaadin-combo-box.js +1 -1
- package/web-types.json +59 -70
- package/web-types.lit.json +20 -20
- package/src/styles/vaadin-combo-box-core-styles.d.ts +0 -8
- package/src/styles/vaadin-combo-box-core-styles.js +0 -12
- package/src/styles/vaadin-combo-box-overlay-core-styles.js +0 -18
- package/src/styles/vaadin-combo-box-scroller-core-styles.js +0 -27
- package/theme/lumo/vaadin-combo-box-item-styles.d.ts +0 -5
- package/theme/lumo/vaadin-combo-box-item-styles.js +0 -25
- package/theme/lumo/vaadin-combo-box-overlay-styles.d.ts +0 -6
- package/theme/lumo/vaadin-combo-box-overlay-styles.js +0 -60
- package/theme/lumo/vaadin-combo-box-styles.d.ts +0 -2
- package/theme/lumo/vaadin-combo-box-styles.js +0 -12
- package/theme/lumo/vaadin-combo-box.d.ts +0 -4
- package/theme/lumo/vaadin-combo-box.js +0 -4
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.0.0-
|
|
4
|
+
"version": "25.0.0-beta1",
|
|
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.0.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.0.0-beta1/#/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-beta1/#/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-beta1/#/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.0.0-beta1/#/elements/vaadin-item).\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "disabled",
|
|
@@ -236,17 +236,6 @@
|
|
|
236
236
|
]
|
|
237
237
|
}
|
|
238
238
|
},
|
|
239
|
-
{
|
|
240
|
-
"name": "overlay-class",
|
|
241
|
-
"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.",
|
|
242
|
-
"value": {
|
|
243
|
-
"type": [
|
|
244
|
-
"string",
|
|
245
|
-
"null",
|
|
246
|
-
"undefined"
|
|
247
|
-
]
|
|
248
|
-
}
|
|
249
|
-
},
|
|
250
239
|
{
|
|
251
240
|
"name": "opened",
|
|
252
241
|
"description": "True if the dropdown is open, false otherwise.",
|
|
@@ -268,26 +257,26 @@
|
|
|
268
257
|
}
|
|
269
258
|
},
|
|
270
259
|
{
|
|
271
|
-
"name": "
|
|
272
|
-
"description": "
|
|
260
|
+
"name": "filter",
|
|
261
|
+
"description": "Filtering string the user has typed into the input field.",
|
|
273
262
|
"value": {
|
|
274
263
|
"type": [
|
|
275
|
-
"
|
|
264
|
+
"string"
|
|
276
265
|
]
|
|
277
266
|
}
|
|
278
267
|
},
|
|
279
268
|
{
|
|
280
|
-
"name": "
|
|
281
|
-
"description": "
|
|
269
|
+
"name": "item-label-path",
|
|
270
|
+
"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.",
|
|
282
271
|
"value": {
|
|
283
272
|
"type": [
|
|
284
|
-
"
|
|
273
|
+
"string"
|
|
285
274
|
]
|
|
286
275
|
}
|
|
287
276
|
},
|
|
288
277
|
{
|
|
289
|
-
"name": "
|
|
290
|
-
"description": "
|
|
278
|
+
"name": "item-value-path",
|
|
279
|
+
"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.",
|
|
291
280
|
"value": {
|
|
292
281
|
"type": [
|
|
293
282
|
"string"
|
|
@@ -295,20 +284,20 @@
|
|
|
295
284
|
}
|
|
296
285
|
},
|
|
297
286
|
{
|
|
298
|
-
"name": "
|
|
299
|
-
"description": "
|
|
287
|
+
"name": "allow-custom-value",
|
|
288
|
+
"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.",
|
|
300
289
|
"value": {
|
|
301
290
|
"type": [
|
|
302
|
-
"
|
|
291
|
+
"boolean"
|
|
303
292
|
]
|
|
304
293
|
}
|
|
305
294
|
},
|
|
306
295
|
{
|
|
307
|
-
"name": "
|
|
308
|
-
"description": "
|
|
296
|
+
"name": "loading",
|
|
297
|
+
"description": "When set to `true`, \"loading\" attribute is added to host and the overlay element.",
|
|
309
298
|
"value": {
|
|
310
299
|
"type": [
|
|
311
|
-
"
|
|
300
|
+
"boolean"
|
|
312
301
|
]
|
|
313
302
|
}
|
|
314
303
|
},
|
|
@@ -573,17 +562,6 @@
|
|
|
573
562
|
]
|
|
574
563
|
}
|
|
575
564
|
},
|
|
576
|
-
{
|
|
577
|
-
"name": "overlayClass",
|
|
578
|
-
"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.",
|
|
579
|
-
"value": {
|
|
580
|
-
"type": [
|
|
581
|
-
"string",
|
|
582
|
-
"null",
|
|
583
|
-
"undefined"
|
|
584
|
-
]
|
|
585
|
-
}
|
|
586
|
-
},
|
|
587
565
|
{
|
|
588
566
|
"name": "opened",
|
|
589
567
|
"description": "True if the dropdown is open, false otherwise.",
|
|
@@ -605,18 +583,19 @@
|
|
|
605
583
|
}
|
|
606
584
|
},
|
|
607
585
|
{
|
|
608
|
-
"name": "
|
|
609
|
-
"description": "
|
|
586
|
+
"name": "items",
|
|
587
|
+
"description": "A full set of items to filter the visible options from.\nThe items can be of either `String` or `Object` type.",
|
|
610
588
|
"value": {
|
|
611
589
|
"type": [
|
|
612
|
-
"
|
|
590
|
+
"Array.<ComboBoxItem",
|
|
591
|
+
"string>",
|
|
613
592
|
"undefined"
|
|
614
593
|
]
|
|
615
594
|
}
|
|
616
595
|
},
|
|
617
596
|
{
|
|
618
|
-
"name": "
|
|
619
|
-
"description": "A
|
|
597
|
+
"name": "filteredItems",
|
|
598
|
+
"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.",
|
|
620
599
|
"value": {
|
|
621
600
|
"type": [
|
|
622
601
|
"Array.<ComboBoxItem",
|
|
@@ -626,37 +605,37 @@
|
|
|
626
605
|
}
|
|
627
606
|
},
|
|
628
607
|
{
|
|
629
|
-
"name": "
|
|
630
|
-
"description": "
|
|
608
|
+
"name": "filter",
|
|
609
|
+
"description": "Filtering string the user has typed into the input field.",
|
|
631
610
|
"value": {
|
|
632
611
|
"type": [
|
|
633
|
-
"
|
|
612
|
+
"string"
|
|
634
613
|
]
|
|
635
614
|
}
|
|
636
615
|
},
|
|
637
616
|
{
|
|
638
|
-
"name": "
|
|
639
|
-
"description": "A
|
|
617
|
+
"name": "itemLabelGenerator",
|
|
618
|
+
"description": "A function that is used to generate the label for dropdown\nitems based on the item. Receives one argument:\n- `item` The item to generate the label for.",
|
|
640
619
|
"value": {
|
|
641
620
|
"type": [
|
|
642
|
-
"
|
|
643
|
-
"
|
|
621
|
+
"Object",
|
|
622
|
+
"null",
|
|
644
623
|
"undefined"
|
|
645
624
|
]
|
|
646
625
|
}
|
|
647
626
|
},
|
|
648
627
|
{
|
|
649
|
-
"name": "
|
|
650
|
-
"description": "
|
|
628
|
+
"name": "itemLabelPath",
|
|
629
|
+
"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.",
|
|
651
630
|
"value": {
|
|
652
631
|
"type": [
|
|
653
|
-
"
|
|
632
|
+
"string"
|
|
654
633
|
]
|
|
655
634
|
}
|
|
656
635
|
},
|
|
657
636
|
{
|
|
658
|
-
"name": "
|
|
659
|
-
"description": "
|
|
637
|
+
"name": "itemValuePath",
|
|
638
|
+
"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.",
|
|
660
639
|
"value": {
|
|
661
640
|
"type": [
|
|
662
641
|
"string"
|
|
@@ -664,42 +643,52 @@
|
|
|
664
643
|
}
|
|
665
644
|
},
|
|
666
645
|
{
|
|
667
|
-
"name": "
|
|
668
|
-
"description": "The
|
|
646
|
+
"name": "renderer",
|
|
647
|
+
"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.",
|
|
669
648
|
"value": {
|
|
670
649
|
"type": [
|
|
671
|
-
"
|
|
672
|
-
"string",
|
|
650
|
+
"ComboBoxRenderer",
|
|
673
651
|
"undefined"
|
|
674
652
|
]
|
|
675
653
|
}
|
|
676
654
|
},
|
|
677
655
|
{
|
|
678
|
-
"name": "
|
|
679
|
-
"description": "
|
|
656
|
+
"name": "allowCustomValue",
|
|
657
|
+
"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.",
|
|
680
658
|
"value": {
|
|
681
659
|
"type": [
|
|
682
|
-
"
|
|
683
|
-
"null",
|
|
684
|
-
"undefined"
|
|
660
|
+
"boolean"
|
|
685
661
|
]
|
|
686
662
|
}
|
|
687
663
|
},
|
|
688
664
|
{
|
|
689
|
-
"name": "
|
|
690
|
-
"description": "
|
|
665
|
+
"name": "loading",
|
|
666
|
+
"description": "When set to `true`, \"loading\" attribute is added to host and the overlay element.",
|
|
691
667
|
"value": {
|
|
692
668
|
"type": [
|
|
693
|
-
"
|
|
669
|
+
"boolean"
|
|
694
670
|
]
|
|
695
671
|
}
|
|
696
672
|
},
|
|
697
673
|
{
|
|
698
|
-
"name": "
|
|
699
|
-
"description": "
|
|
674
|
+
"name": "selectedItem",
|
|
675
|
+
"description": "The selected item from the `items` array.",
|
|
700
676
|
"value": {
|
|
701
677
|
"type": [
|
|
702
|
-
"
|
|
678
|
+
"ComboBoxItem",
|
|
679
|
+
"string",
|
|
680
|
+
"undefined"
|
|
681
|
+
]
|
|
682
|
+
}
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
"name": "itemClassNameGenerator",
|
|
686
|
+
"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.",
|
|
687
|
+
"value": {
|
|
688
|
+
"type": [
|
|
689
|
+
"Object",
|
|
690
|
+
"null",
|
|
691
|
+
"undefined"
|
|
703
692
|
]
|
|
704
693
|
}
|
|
705
694
|
},
|
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.0.0-
|
|
4
|
+
"version": "25.0.0-beta1",
|
|
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.0.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.0.0-beta1/#/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-beta1/#/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-beta1/#/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.0.0-beta1/#/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
|
{
|
|
@@ -202,64 +202,64 @@
|
|
|
202
202
|
}
|
|
203
203
|
},
|
|
204
204
|
{
|
|
205
|
-
"name": ".
|
|
206
|
-
"description": "A
|
|
205
|
+
"name": ".items",
|
|
206
|
+
"description": "A full set of items to filter the visible options from.\nThe items can be of either `String` or `Object` type.",
|
|
207
207
|
"value": {
|
|
208
208
|
"kind": "expression"
|
|
209
209
|
}
|
|
210
210
|
},
|
|
211
211
|
{
|
|
212
|
-
"name": ".
|
|
213
|
-
"description": "
|
|
212
|
+
"name": ".filteredItems",
|
|
213
|
+
"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.",
|
|
214
214
|
"value": {
|
|
215
215
|
"kind": "expression"
|
|
216
216
|
}
|
|
217
217
|
},
|
|
218
218
|
{
|
|
219
|
-
"name": ".
|
|
220
|
-
"description": "
|
|
219
|
+
"name": ".filter",
|
|
220
|
+
"description": "Filtering string the user has typed into the input field.",
|
|
221
221
|
"value": {
|
|
222
222
|
"kind": "expression"
|
|
223
223
|
}
|
|
224
224
|
},
|
|
225
225
|
{
|
|
226
|
-
"name": ".
|
|
227
|
-
"description": "A
|
|
226
|
+
"name": ".itemLabelGenerator",
|
|
227
|
+
"description": "A function that is used to generate the label for dropdown\nitems based on the item. Receives one argument:\n- `item` The item to generate the label for.",
|
|
228
228
|
"value": {
|
|
229
229
|
"kind": "expression"
|
|
230
230
|
}
|
|
231
231
|
},
|
|
232
232
|
{
|
|
233
|
-
"name": ".
|
|
234
|
-
"description": "
|
|
233
|
+
"name": ".itemLabelPath",
|
|
234
|
+
"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.",
|
|
235
235
|
"value": {
|
|
236
236
|
"kind": "expression"
|
|
237
237
|
}
|
|
238
238
|
},
|
|
239
239
|
{
|
|
240
|
-
"name": ".
|
|
241
|
-
"description": "
|
|
240
|
+
"name": ".itemValuePath",
|
|
241
|
+
"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.",
|
|
242
242
|
"value": {
|
|
243
243
|
"kind": "expression"
|
|
244
244
|
}
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
|
-
"name": ".
|
|
248
|
-
"description": "
|
|
247
|
+
"name": ".renderer",
|
|
248
|
+
"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.",
|
|
249
249
|
"value": {
|
|
250
250
|
"kind": "expression"
|
|
251
251
|
}
|
|
252
252
|
},
|
|
253
253
|
{
|
|
254
|
-
"name": ".
|
|
255
|
-
"description": "
|
|
254
|
+
"name": ".selectedItem",
|
|
255
|
+
"description": "The selected item from the `items` array.",
|
|
256
256
|
"value": {
|
|
257
257
|
"kind": "expression"
|
|
258
258
|
}
|
|
259
259
|
},
|
|
260
260
|
{
|
|
261
|
-
"name": ".
|
|
262
|
-
"description": "
|
|
261
|
+
"name": ".itemClassNameGenerator",
|
|
262
|
+
"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.",
|
|
263
263
|
"value": {
|
|
264
264
|
"kind": "expression"
|
|
265
265
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { css } from 'lit';
|
|
7
|
-
|
|
8
|
-
export const comboBoxStyles = css`
|
|
9
|
-
:host([opened]) {
|
|
10
|
-
pointer-events: auto;
|
|
11
|
-
}
|
|
12
|
-
`;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { css } from 'lit';
|
|
7
|
-
|
|
8
|
-
export const comboBoxOverlayStyles = css`
|
|
9
|
-
#overlay {
|
|
10
|
-
width: var(--vaadin-combo-box-overlay-width, var(--_vaadin-combo-box-overlay-default-width, auto));
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
[part='content'] {
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
height: 100%;
|
|
17
|
-
}
|
|
18
|
-
`;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { css } from 'lit';
|
|
7
|
-
|
|
8
|
-
export const comboBoxScrollerStyles = css`
|
|
9
|
-
:host {
|
|
10
|
-
display: block;
|
|
11
|
-
min-height: 1px;
|
|
12
|
-
overflow: auto;
|
|
13
|
-
|
|
14
|
-
/* Fixes item background from getting on top of scrollbars on Safari */
|
|
15
|
-
transform: translate3d(0, 0, 0);
|
|
16
|
-
|
|
17
|
-
/* Fixes scrollbar disappearing when 'Show scroll bars: Always' enabled in Safari */
|
|
18
|
-
box-shadow: 0 0 0 white;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
#selector {
|
|
22
|
-
border-width: var(--_vaadin-combo-box-items-container-border-width);
|
|
23
|
-
border-style: var(--_vaadin-combo-box-items-container-border-style);
|
|
24
|
-
border-color: var(--_vaadin-combo-box-items-container-border-color, transparent);
|
|
25
|
-
position: relative;
|
|
26
|
-
}
|
|
27
|
-
`;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
2
|
-
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
3
|
-
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
4
|
-
import { item } from '@vaadin/item/theme/lumo/vaadin-item-styles.js';
|
|
5
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
6
|
-
|
|
7
|
-
const comboBoxItem = css`
|
|
8
|
-
:host {
|
|
9
|
-
transition: background-color 100ms;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
--_lumo-item-selected-icon-display: block;
|
|
12
|
-
--_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
|
|
13
|
-
--_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
:host([focused]:not([disabled])) {
|
|
17
|
-
box-shadow: inset 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
|
|
18
|
-
}
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
registerStyles('vaadin-combo-box-item', [item, comboBoxItem], {
|
|
22
|
-
moduleId: 'lumo-combo-box-item',
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export { comboBoxItem };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
2
|
-
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
3
|
-
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
4
|
-
declare const comboBoxOverlay: import("lit").CSSResult;
|
|
5
|
-
declare const comboBoxLoader: import("lit").CSSResult;
|
|
6
|
-
export { comboBoxLoader, comboBoxOverlay };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
2
|
-
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
3
|
-
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
4
|
-
import { loader } from '@vaadin/vaadin-lumo-styles/mixins/loader.js';
|
|
5
|
-
import { menuOverlayCore } from '@vaadin/vaadin-lumo-styles/mixins/menu-overlay.js';
|
|
6
|
-
import { overlay } from '@vaadin/vaadin-lumo-styles/mixins/overlay.js';
|
|
7
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
|
-
|
|
9
|
-
const comboBoxOverlay = css`
|
|
10
|
-
[part='content'] {
|
|
11
|
-
padding: 0;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/* When items are empty, the spinner needs some room */
|
|
15
|
-
:host(:not([closing])) [part~='content'] {
|
|
16
|
-
min-height: calc(2 * var(--lumo-space-s) + var(--lumo-icon-size-s));
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
[part~='overlay'] {
|
|
20
|
-
position: relative;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
:host([top-aligned]) [part~='overlay'] {
|
|
24
|
-
margin-top: var(--lumo-space-xs);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
:host([bottom-aligned]) [part~='overlay'] {
|
|
28
|
-
margin-bottom: var(--lumo-space-xs);
|
|
29
|
-
}
|
|
30
|
-
`;
|
|
31
|
-
|
|
32
|
-
const comboBoxLoader = css`
|
|
33
|
-
[part~='loader'] {
|
|
34
|
-
position: absolute;
|
|
35
|
-
z-index: 1;
|
|
36
|
-
inset-inline: var(--lumo-space-s);
|
|
37
|
-
top: var(--lumo-space-s);
|
|
38
|
-
margin-inline: auto 0;
|
|
39
|
-
}
|
|
40
|
-
`;
|
|
41
|
-
|
|
42
|
-
registerStyles(
|
|
43
|
-
'vaadin-combo-box-overlay',
|
|
44
|
-
[
|
|
45
|
-
overlay,
|
|
46
|
-
menuOverlayCore,
|
|
47
|
-
comboBoxOverlay,
|
|
48
|
-
loader,
|
|
49
|
-
comboBoxLoader,
|
|
50
|
-
css`
|
|
51
|
-
:host {
|
|
52
|
-
--_vaadin-combo-box-items-container-border-width: var(--lumo-space-xs);
|
|
53
|
-
--_vaadin-combo-box-items-container-border-style: solid;
|
|
54
|
-
}
|
|
55
|
-
`,
|
|
56
|
-
],
|
|
57
|
-
{ moduleId: 'lumo-combo-box-overlay' },
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
export { comboBoxLoader, comboBoxOverlay };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
|
|
2
|
-
import '@vaadin/vaadin-lumo-styles/font-icons.js';
|
|
3
|
-
import { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';
|
|
4
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
5
|
-
|
|
6
|
-
const comboBox = css`
|
|
7
|
-
[part='toggle-button']::before {
|
|
8
|
-
content: var(--lumo-icons-dropdown);
|
|
9
|
-
}
|
|
10
|
-
`;
|
|
11
|
-
|
|
12
|
-
registerStyles('vaadin-combo-box', [inputFieldShared, comboBox], { moduleId: 'lumo-combo-box' });
|