@vaadin/combo-box 24.7.0-alpha1 → 24.7.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/package.json +16 -15
- package/src/lit/renderer-directives.d.ts +1 -1
- package/src/lit/renderer-directives.js +1 -1
- package/src/vaadin-combo-box-data-provider-mixin.d.ts +1 -1
- package/src/vaadin-combo-box-data-provider-mixin.js +1 -1
- package/src/vaadin-combo-box-item-mixin.d.ts +1 -1
- package/src/vaadin-combo-box-item-mixin.js +1 -1
- package/src/vaadin-combo-box-item.d.ts +1 -1
- package/src/vaadin-combo-box-item.js +1 -1
- package/src/vaadin-combo-box-light-mixin.d.ts +1 -1
- package/src/vaadin-combo-box-light-mixin.js +1 -1
- package/src/vaadin-combo-box-light.d.ts +1 -1
- package/src/vaadin-combo-box-light.js +1 -1
- package/src/vaadin-combo-box-mixin.d.ts +1 -1
- package/src/vaadin-combo-box-mixin.js +12 -27
- package/src/vaadin-combo-box-overlay-mixin.d.ts +1 -1
- package/src/vaadin-combo-box-overlay-mixin.js +1 -1
- package/src/vaadin-combo-box-overlay.d.ts +1 -1
- package/src/vaadin-combo-box-overlay.js +1 -1
- package/src/vaadin-combo-box-placeholder.js +1 -1
- package/src/vaadin-combo-box-scroller-mixin.d.ts +1 -1
- package/src/vaadin-combo-box-scroller-mixin.js +1 -7
- package/src/vaadin-combo-box-scroller.d.ts +1 -1
- package/src/vaadin-combo-box-scroller.js +1 -1
- package/src/vaadin-combo-box.d.ts +1 -1
- package/src/vaadin-combo-box.js +1 -1
- package/src/vaadin-lit-combo-box-item.js +1 -1
- package/src/vaadin-lit-combo-box-light.js +1 -1
- package/src/vaadin-lit-combo-box-overlay.js +1 -1
- package/src/vaadin-lit-combo-box-scroller.js +1 -1
- package/src/vaadin-lit-combo-box.js +1 -1
- package/theme/material/vaadin-combo-box-overlay-styles.js +6 -1
- package/web-types.json +4 -4
- package/web-types.lit.json +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/combo-box",
|
|
3
|
-
"version": "24.7.0-
|
|
3
|
+
"version": "24.7.0-alpha10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,27 +38,28 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
40
40
|
"@polymer/polymer": "^3.0.0",
|
|
41
|
-
"@vaadin/a11y-base": "24.7.0-
|
|
42
|
-
"@vaadin/component-base": "24.7.0-
|
|
43
|
-
"@vaadin/field-base": "24.7.0-
|
|
44
|
-
"@vaadin/input-container": "24.7.0-
|
|
45
|
-
"@vaadin/item": "24.7.0-
|
|
46
|
-
"@vaadin/lit-renderer": "24.7.0-
|
|
47
|
-
"@vaadin/overlay": "24.7.0-
|
|
48
|
-
"@vaadin/vaadin-lumo-styles": "24.7.0-
|
|
49
|
-
"@vaadin/vaadin-material-styles": "24.7.0-
|
|
50
|
-
"@vaadin/vaadin-themable-mixin": "24.7.0-
|
|
41
|
+
"@vaadin/a11y-base": "24.7.0-alpha10",
|
|
42
|
+
"@vaadin/component-base": "24.7.0-alpha10",
|
|
43
|
+
"@vaadin/field-base": "24.7.0-alpha10",
|
|
44
|
+
"@vaadin/input-container": "24.7.0-alpha10",
|
|
45
|
+
"@vaadin/item": "24.7.0-alpha10",
|
|
46
|
+
"@vaadin/lit-renderer": "24.7.0-alpha10",
|
|
47
|
+
"@vaadin/overlay": "24.7.0-alpha10",
|
|
48
|
+
"@vaadin/vaadin-lumo-styles": "24.7.0-alpha10",
|
|
49
|
+
"@vaadin/vaadin-material-styles": "24.7.0-alpha10",
|
|
50
|
+
"@vaadin/vaadin-themable-mixin": "24.7.0-alpha10",
|
|
51
51
|
"lit": "^3.0.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@vaadin/chai-plugins": "24.7.0-
|
|
55
|
-
"@vaadin/
|
|
56
|
-
"@vaadin/
|
|
54
|
+
"@vaadin/chai-plugins": "24.7.0-alpha10",
|
|
55
|
+
"@vaadin/test-runner-commands": "24.7.0-alpha10",
|
|
56
|
+
"@vaadin/testing-helpers": "^1.1.0",
|
|
57
|
+
"@vaadin/text-field": "24.7.0-alpha10",
|
|
57
58
|
"sinon": "^18.0.0"
|
|
58
59
|
},
|
|
59
60
|
"web-types": [
|
|
60
61
|
"web-types.json",
|
|
61
62
|
"web-types.lit.json"
|
|
62
63
|
],
|
|
63
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "c0f8933df2a6a40648d3fb9cfbae6bbf86a8aa90"
|
|
64
65
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2017 -
|
|
3
|
+
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { DirectiveResult } from 'lit/directive.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { DataProviderController } from '@vaadin/component-base/src/data-provider-controller/data-provider-controller.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { DirMixinClass } from '@vaadin/component-base/src/dir-mixin.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { dashToCamelCase } from '@polymer/polymer/lib/utils/case-map.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { DisabledMixin } from '@vaadin/a11y-base/src/disabled-mixin.js';
|
|
@@ -543,17 +543,6 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
543
543
|
theme,
|
|
544
544
|
itemClassNameGenerator,
|
|
545
545
|
});
|
|
546
|
-
|
|
547
|
-
// NOTE: in PolylitMixin, setProperties() waits for `hasUpdated` to be set.
|
|
548
|
-
// This means for the first opening, properties won't be set synchronously.
|
|
549
|
-
// Call `performUpdate()` in this case to mimic the Polymer version logic.
|
|
550
|
-
if (scroller.performUpdate && !scroller.hasUpdated) {
|
|
551
|
-
try {
|
|
552
|
-
scroller.performUpdate();
|
|
553
|
-
} catch (_) {
|
|
554
|
-
// Suppress errors in synchronous tests for pre-opened combo-box.
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
546
|
}
|
|
558
547
|
}
|
|
559
548
|
|
|
@@ -877,19 +866,16 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
877
866
|
* @override
|
|
878
867
|
*/
|
|
879
868
|
_onEscape(e) {
|
|
880
|
-
if (
|
|
869
|
+
if (
|
|
870
|
+
this.autoOpenDisabled &&
|
|
871
|
+
(this.opened || (this.value !== this._inputElementValue && this._inputElementValue.length > 0))
|
|
872
|
+
) {
|
|
881
873
|
// Auto-open is disabled
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
this.cancel();
|
|
888
|
-
} else if (this.clearButtonVisible && !this.opened && !!this.value) {
|
|
889
|
-
e.stopPropagation();
|
|
890
|
-
// The clear button is visible and the overlay is closed, so clear the value.
|
|
891
|
-
this._onClearAction();
|
|
892
|
-
}
|
|
874
|
+
// The overlay is open or
|
|
875
|
+
// The input value has changed but the change hasn't been committed, so cancel it.
|
|
876
|
+
e.stopPropagation();
|
|
877
|
+
this._focusedIndex = -1;
|
|
878
|
+
this.cancel();
|
|
893
879
|
} else if (this.opened) {
|
|
894
880
|
// Auto-open is enabled
|
|
895
881
|
// The overlay is open
|
|
@@ -903,7 +889,7 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
903
889
|
// No item is focused, cancel the change and close the overlay
|
|
904
890
|
this.cancel();
|
|
905
891
|
}
|
|
906
|
-
} else if (this.clearButtonVisible && !!this.value) {
|
|
892
|
+
} else if (this.clearButtonVisible && !!this.value && !this.readonly) {
|
|
907
893
|
e.stopPropagation();
|
|
908
894
|
// The clear button is visible and the overlay is closed, so clear the value.
|
|
909
895
|
this._onClearAction();
|
|
@@ -1430,8 +1416,7 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
1430
1416
|
*/
|
|
1431
1417
|
|
|
1432
1418
|
/**
|
|
1433
|
-
* Fired when value
|
|
1434
|
-
* To comply with https://developer.mozilla.org/en-US/docs/Web/Events/change
|
|
1419
|
+
* Fired when the user commits a value change.
|
|
1435
1420
|
* @event change
|
|
1436
1421
|
*/
|
|
1437
1422
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { isElementFocusable } from '@vaadin/a11y-base/src/focus-utils.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { get } from '@vaadin/component-base/src/path-utils.js';
|
|
@@ -329,12 +329,6 @@ export const ComboBoxScrollerMixin = (superClass) =>
|
|
|
329
329
|
el.className = '';
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
// NOTE: in PolylitMixin, setProperties() waits for `hasUpdated` to be set.
|
|
333
|
-
// However, this causes issues with virtualizer. So we enforce sync update.
|
|
334
|
-
if (el.performUpdate && !el.hasUpdated) {
|
|
335
|
-
el.performUpdate();
|
|
336
|
-
}
|
|
337
|
-
|
|
338
332
|
el.id = `${this.__hostTagName}-item-${index}`;
|
|
339
333
|
el.setAttribute('role', index !== undefined ? 'option' : false);
|
|
340
334
|
el.setAttribute('aria-selected', selected.toString());
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { ComboBoxScrollerMixin } from './vaadin-combo-box-scroller-mixin.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { DelegateFocusMixinClass } from '@vaadin/a11y-base/src/delegate-focus-mixin.js';
|
package/src/vaadin-combo-box.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import '@vaadin/input-container/src/vaadin-input-container.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2015 -
|
|
3
|
+
* Copyright (c) 2015 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import '@vaadin/input-container/src/vaadin-lit-input-container.js';
|
|
@@ -6,11 +6,16 @@ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themab
|
|
|
6
6
|
const comboBoxOverlay = css`
|
|
7
7
|
[part='overlay'] {
|
|
8
8
|
position: relative;
|
|
9
|
-
overflow: visible;
|
|
10
9
|
border-top-left-radius: 0;
|
|
11
10
|
border-top-right-radius: 0;
|
|
12
11
|
}
|
|
13
12
|
|
|
13
|
+
/* Overflow needs to be auto by default to make overlay sizing logic work */
|
|
14
|
+
/* When loading, overflow needs to be visible to make loading indicator visible */
|
|
15
|
+
:host([loading]) [part='overlay'] {
|
|
16
|
+
overflow: visible;
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
[part='content'] {
|
|
15
20
|
padding: 0;
|
|
16
21
|
}
|
package/web-types.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": "24.7.0-
|
|
4
|
+
"version": "24.7.0-alpha10",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -454,7 +454,7 @@
|
|
|
454
454
|
},
|
|
455
455
|
{
|
|
456
456
|
"name": "change",
|
|
457
|
-
"description": "Fired when
|
|
457
|
+
"description": "Fired when the user commits a value change."
|
|
458
458
|
},
|
|
459
459
|
{
|
|
460
460
|
"name": "custom-value-set",
|
|
@@ -493,7 +493,7 @@
|
|
|
493
493
|
},
|
|
494
494
|
{
|
|
495
495
|
"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/24.7.0-
|
|
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/24.7.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/24.7.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/24.7.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/24.7.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\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\nIf you want to replace the default `<input>` and its container with a custom implementation to get full control\nover the input field, consider using the [`<vaadin-combo-box-light>`](https://cdn.vaadin.com/vaadin-web-components/24.7.0-alpha10/#/elements/vaadin-combo-box-light) element.\n\n### Internal components\n\nIn addition to `<vaadin-combo-box>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-combo-box-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.7.0-alpha10/#/elements/vaadin-overlay).\n- `<vaadin-combo-box-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.7.0-alpha10/#/elements/vaadin-item).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.7.0-alpha10/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nNote: the `theme` attribute value set on `<vaadin-combo-box>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
497
497
|
"attributes": [
|
|
498
498
|
{
|
|
499
499
|
"name": "disabled",
|
|
@@ -1207,7 +1207,7 @@
|
|
|
1207
1207
|
},
|
|
1208
1208
|
{
|
|
1209
1209
|
"name": "change",
|
|
1210
|
-
"description": "Fired when
|
|
1210
|
+
"description": "Fired when the user commits a value change."
|
|
1211
1211
|
},
|
|
1212
1212
|
{
|
|
1213
1213
|
"name": "input",
|
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": "24.7.0-
|
|
4
|
+
"version": "24.7.0-alpha10",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
},
|
|
197
197
|
{
|
|
198
198
|
"name": "@change",
|
|
199
|
-
"description": "Fired when
|
|
199
|
+
"description": "Fired when the user commits a value change.",
|
|
200
200
|
"value": {
|
|
201
201
|
"kind": "expression"
|
|
202
202
|
}
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
},
|
|
262
262
|
{
|
|
263
263
|
"name": "vaadin-combo-box",
|
|
264
|
-
"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/24.7.0-
|
|
264
|
+
"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/24.7.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/24.7.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/24.7.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/24.7.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\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\nIf you want to replace the default `<input>` and its container with a custom implementation to get full control\nover the input field, consider using the [`<vaadin-combo-box-light>`](https://cdn.vaadin.com/vaadin-web-components/24.7.0-alpha10/#/elements/vaadin-combo-box-light) element.\n\n### Internal components\n\nIn addition to `<vaadin-combo-box>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-combo-box-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.7.0-alpha10/#/elements/vaadin-overlay).\n- `<vaadin-combo-box-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.7.0-alpha10/#/elements/vaadin-item).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.7.0-alpha10/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nNote: the `theme` attribute value set on `<vaadin-combo-box>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
265
265
|
"extension": true,
|
|
266
266
|
"attributes": [
|
|
267
267
|
{
|
|
@@ -525,7 +525,7 @@
|
|
|
525
525
|
},
|
|
526
526
|
{
|
|
527
527
|
"name": "@change",
|
|
528
|
-
"description": "Fired when
|
|
528
|
+
"description": "Fired when the user commits a value change.",
|
|
529
529
|
"value": {
|
|
530
530
|
"kind": "expression"
|
|
531
531
|
}
|