@vaadin/combo-box 25.0.0-alpha9 → 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.
Files changed (30) hide show
  1. package/package.json +14 -17
  2. package/src/styles/vaadin-combo-box-base-styles.js +2 -2
  3. package/src/styles/vaadin-combo-box-overlay-base-styles.js +2 -2
  4. package/src/vaadin-combo-box-base-mixin.d.ts +0 -2
  5. package/src/vaadin-combo-box-base-mixin.js +1 -5
  6. package/src/vaadin-combo-box-item.js +1 -1
  7. package/src/vaadin-combo-box-items-mixin.d.ts +7 -0
  8. package/src/vaadin-combo-box-items-mixin.js +17 -0
  9. package/src/vaadin-combo-box-mixin.d.ts +0 -2
  10. package/src/vaadin-combo-box-overlay.js +2 -2
  11. package/src/vaadin-combo-box-scroller-mixin.d.ts +1 -2
  12. package/src/vaadin-combo-box-scroller-mixin.js +5 -0
  13. package/src/vaadin-combo-box-scroller.js +1 -1
  14. package/src/vaadin-combo-box.d.ts +29 -17
  15. package/src/vaadin-combo-box.js +32 -18
  16. package/vaadin-combo-box.js +1 -1
  17. package/web-types.json +13 -24
  18. package/web-types.lit.json +9 -9
  19. package/src/styles/vaadin-combo-box-core-styles.d.ts +0 -8
  20. package/src/styles/vaadin-combo-box-core-styles.js +0 -12
  21. package/src/styles/vaadin-combo-box-overlay-core-styles.js +0 -18
  22. package/src/styles/vaadin-combo-box-scroller-core-styles.js +0 -27
  23. package/theme/lumo/vaadin-combo-box-item-styles.d.ts +0 -5
  24. package/theme/lumo/vaadin-combo-box-item-styles.js +0 -25
  25. package/theme/lumo/vaadin-combo-box-overlay-styles.d.ts +0 -6
  26. package/theme/lumo/vaadin-combo-box-overlay-styles.js +0 -60
  27. package/theme/lumo/vaadin-combo-box-styles.d.ts +0 -2
  28. package/theme/lumo/vaadin-combo-box-styles.js +0 -12
  29. package/theme/lumo/vaadin-combo-box.d.ts +0 -4
  30. package/theme/lumo/vaadin-combo-box.js +0 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/combo-box",
3
- "version": "25.0.0-alpha9",
3
+ "version": "25.0.0-beta1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -22,9 +22,6 @@
22
22
  "lit.d.ts",
23
23
  "lit.js",
24
24
  "src",
25
- "!src/styles/*-base-styles.d.ts",
26
- "!src/styles/*-base-styles.js",
27
- "theme",
28
25
  "vaadin-*.d.ts",
29
26
  "vaadin-*.js",
30
27
  "web-types.json",
@@ -38,26 +35,26 @@
38
35
  ],
39
36
  "dependencies": {
40
37
  "@open-wc/dedupe-mixin": "^1.3.0",
41
- "@vaadin/a11y-base": "25.0.0-alpha9",
42
- "@vaadin/component-base": "25.0.0-alpha9",
43
- "@vaadin/field-base": "25.0.0-alpha9",
44
- "@vaadin/input-container": "25.0.0-alpha9",
45
- "@vaadin/item": "25.0.0-alpha9",
46
- "@vaadin/lit-renderer": "25.0.0-alpha9",
47
- "@vaadin/overlay": "25.0.0-alpha9",
48
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha9",
49
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha9",
38
+ "@vaadin/a11y-base": "25.0.0-beta1",
39
+ "@vaadin/component-base": "25.0.0-beta1",
40
+ "@vaadin/field-base": "25.0.0-beta1",
41
+ "@vaadin/input-container": "25.0.0-beta1",
42
+ "@vaadin/item": "25.0.0-beta1",
43
+ "@vaadin/lit-renderer": "25.0.0-beta1",
44
+ "@vaadin/overlay": "25.0.0-beta1",
45
+ "@vaadin/vaadin-themable-mixin": "25.0.0-beta1",
50
46
  "lit": "^3.0.0"
51
47
  },
52
48
  "devDependencies": {
53
- "@vaadin/chai-plugins": "25.0.0-alpha9",
54
- "@vaadin/test-runner-commands": "25.0.0-alpha9",
49
+ "@vaadin/chai-plugins": "25.0.0-beta1",
50
+ "@vaadin/test-runner-commands": "25.0.0-beta1",
55
51
  "@vaadin/testing-helpers": "^2.0.0",
56
- "sinon": "^18.0.0"
52
+ "@vaadin/vaadin-lumo-styles": "25.0.0-beta1",
53
+ "sinon": "^21.0.0"
57
54
  },
58
55
  "web-types": [
59
56
  "web-types.json",
60
57
  "web-types.lit.json"
61
58
  ],
62
- "gitHead": "bbe4720721e0955ffc87a79b412bee38b1f0eb1e"
59
+ "gitHead": "1d20cf54e582d1f2e209126d4586f8b4c01c50e0"
63
60
  }
@@ -3,7 +3,7 @@
3
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
- import '@vaadin/component-base/src/style-props.js';
6
+ import '@vaadin/component-base/src/styles/style-props.js';
7
7
  import { css } from 'lit';
8
8
 
9
9
  export const comboBoxStyles = css`
@@ -11,7 +11,7 @@ export const comboBoxStyles = css`
11
11
  pointer-events: auto;
12
12
  }
13
13
 
14
- [part='toggle-button']::before {
14
+ [part~='toggle-button']::before {
15
15
  mask-image: var(--_vaadin-icon-chevron-down);
16
16
  }
17
17
  `;
@@ -3,9 +3,9 @@
3
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
- import '@vaadin/component-base/src/style-props.js';
6
+ import '@vaadin/component-base/src/styles/style-props.js';
7
7
  import { css } from 'lit';
8
- import { loaderStyles } from '@vaadin/component-base/src/loader-styles.js';
8
+ import { loaderStyles } from '@vaadin/component-base/src/styles/loader-styles.js';
9
9
 
10
10
  export const comboBoxOverlayStyles = [
11
11
  loaderStyles,
@@ -7,7 +7,6 @@ import type { Constructor } from '@open-wc/dedupe-mixin';
7
7
  import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js';
8
8
  import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
9
9
  import type { KeyboardMixinClass } from '@vaadin/a11y-base/src/keyboard-mixin.js';
10
- import type { OverlayClassMixinClass } from '@vaadin/component-base/src/overlay-class-mixin.js';
11
10
  import type { InputMixinClass } from '@vaadin/field-base/src/input-mixin.js';
12
11
  import type { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.js';
13
12
 
@@ -18,7 +17,6 @@ export declare function ComboBoxBaseMixin<T extends Constructor<HTMLElement>>(
18
17
  Constructor<FocusMixinClass> &
19
18
  Constructor<InputMixinClass> &
20
19
  Constructor<KeyboardMixinClass> &
21
- Constructor<OverlayClassMixinClass> &
22
20
  Constructor<ValidateMixinClass> &
23
21
  T;
24
22
 
@@ -8,7 +8,6 @@ import { FocusMixin } from '@vaadin/a11y-base/src/focus-mixin.js';
8
8
  import { isElementFocused, isKeyboardActive } from '@vaadin/a11y-base/src/focus-utils.js';
9
9
  import { KeyboardMixin } from '@vaadin/a11y-base/src/keyboard-mixin.js';
10
10
  import { isTouch } from '@vaadin/component-base/src/browser-utils.js';
11
- import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
12
11
  import { InputMixin } from '@vaadin/field-base/src/input-mixin.js';
13
12
  import { VirtualKeyboardController } from '@vaadin/field-base/src/virtual-keyboard-controller.js';
14
13
  import { ComboBoxPlaceholder } from './vaadin-combo-box-placeholder.js';
@@ -19,13 +18,10 @@ import { ComboBoxPlaceholder } from './vaadin-combo-box-placeholder.js';
19
18
  * @mixes FocusMixin
20
19
  * @mixes InputMixin
21
20
  * @mixes KeyboardMixin
22
- * @mixes OverlayClassMixin
23
21
  * @param {function(new:HTMLElement)} superClass
24
22
  */
25
23
  export const ComboBoxBaseMixin = (superClass) =>
26
- class ComboBoxMixinBaseClass extends OverlayClassMixin(
27
- KeyboardMixin(InputMixin(DisabledMixin(FocusMixin(superClass)))),
28
- ) {
24
+ class ComboBoxMixinBaseClass extends KeyboardMixin(InputMixin(DisabledMixin(FocusMixin(superClass)))) {
29
25
  static get properties() {
30
26
  return {
31
27
  /**
@@ -7,7 +7,7 @@ import { html, LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
9
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
- import { itemStyles } from '@vaadin/item/src/styles/vaadin-item-core-styles.js';
10
+ import { itemStyles } from '@vaadin/item/src/styles/vaadin-item-base-styles.js';
11
11
  import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
12
12
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
13
13
  import { ComboBoxItemMixin } from './vaadin-combo-box-item-mixin.js';
@@ -29,6 +29,13 @@ export declare class ComboBoxItemsMixinClass<TItem> {
29
29
  */
30
30
  filter: string;
31
31
 
32
+ /**
33
+ * A function that is used to generate the label for dropdown
34
+ * items based on the item. Receives one argument:
35
+ * - `item` The item to generate the label for.
36
+ */
37
+ itemLabelGenerator: ((item: TItem) => string) | undefined;
38
+
32
39
  /**
33
40
  * Path for label of the item. If `items` is an array of objects, the
34
41
  * `itemLabelPath` is used to fetch the displayed string label for each
@@ -77,6 +77,15 @@ export const ComboBoxItemsMixin = (superClass) =>
77
77
  sync: true,
78
78
  },
79
79
 
80
+ /**
81
+ * A function that is used to generate the label for dropdown
82
+ * items based on the item. Receives one argument:
83
+ * - `item` The item to generate the label for.
84
+ */
85
+ itemLabelGenerator: {
86
+ type: Object,
87
+ },
88
+
80
89
  /**
81
90
  * Path for label of the item. If `items` is an array of objects, the
82
91
  * `itemLabelPath` is used to fetch the displayed string label for each
@@ -122,6 +131,10 @@ export const ComboBoxItemsMixin = (superClass) =>
122
131
  if (props.has('filter')) {
123
132
  this._filterChanged(this.filter);
124
133
  }
134
+
135
+ if (props.has('itemLabelGenerator')) {
136
+ this.requestContentUpdate();
137
+ }
125
138
  }
126
139
 
127
140
  /**
@@ -161,6 +174,10 @@ export const ComboBoxItemsMixin = (superClass) =>
161
174
  * @override
162
175
  */
163
176
  _getItemLabel(item) {
177
+ if (typeof this.itemLabelGenerator === 'function' && item) {
178
+ return this.itemLabelGenerator(item) || '';
179
+ }
180
+
164
181
  let label = item && this.itemLabelPath ? get(this.itemLabelPath, item) : undefined;
165
182
  if (label === undefined || label === null) {
166
183
  label = item ? item.toString() : '';
@@ -7,7 +7,6 @@ import type { Constructor } from '@open-wc/dedupe-mixin';
7
7
  import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js';
8
8
  import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
9
9
  import type { KeyboardMixinClass } from '@vaadin/a11y-base/src/keyboard-mixin.js';
10
- import type { OverlayClassMixinClass } from '@vaadin/component-base/src/overlay-class-mixin.js';
11
10
  import type { InputMixinClass } from '@vaadin/field-base/src/input-mixin.js';
12
11
  import type { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.js';
13
12
  import type { ComboBox } from './vaadin-combo-box.js';
@@ -26,7 +25,6 @@ export declare function ComboBoxMixin<TItem, T extends Constructor<HTMLElement>>
26
25
  Constructor<FocusMixinClass> &
27
26
  Constructor<InputMixinClass> &
28
27
  Constructor<KeyboardMixinClass> &
29
- Constructor<OverlayClassMixinClass> &
30
28
  Constructor<ValidateMixinClass> &
31
29
  T;
32
30
 
@@ -7,11 +7,11 @@ import { html, LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
9
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
- import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-core-styles.js';
10
+ import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-base-styles.js';
11
11
  import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
12
12
  import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
13
13
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
14
- import { comboBoxOverlayStyles } from './styles/vaadin-combo-box-overlay-core-styles.js';
14
+ import { comboBoxOverlayStyles } from './styles/vaadin-combo-box-overlay-base-styles.js';
15
15
  import { ComboBoxOverlayMixin } from './vaadin-combo-box-overlay-mixin.js';
16
16
 
17
17
  /**
@@ -45,8 +45,7 @@ export declare class ComboBoxScrollerMixinClass<TItem, TOwner> {
45
45
  owner: TOwner;
46
46
 
47
47
  /**
48
- * Set true to prevent the overlay from opening automatically.
49
- * @attr {boolean} auto-open-disabled
48
+ * Function used to render the content of every combo-box item.
50
49
  */
51
50
  renderer: ComboBoxItemRenderer<TItem, TOwner> | null | undefined;
52
51
 
@@ -234,6 +234,11 @@ export const ComboBoxScrollerMixin = (superClass) =>
234
234
  scrollTarget: this,
235
235
  scrollContainer: this.$.selector,
236
236
  reorderElements: true,
237
+ // Combo-box items have a CSS-defined minimum height, so the virtualizer's
238
+ // height placeholder logic can be disabled. This helps save reflows which
239
+ // might otherwise be triggered by this logic because it reads the row height
240
+ // right after updating the rows' content.
241
+ __disableHeightPlaceholder: true,
237
242
  });
238
243
  }
239
244
 
@@ -6,7 +6,7 @@
6
6
  import { html, LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9
- import { comboBoxScrollerStyles } from './styles/vaadin-combo-box-scroller-core-styles.js';
9
+ import { comboBoxScrollerStyles } from './styles/vaadin-combo-box-scroller-base-styles.js';
10
10
  import { ComboBoxScrollerMixin } from './vaadin-combo-box-scroller-mixin.js';
11
11
 
12
12
  /**
@@ -9,7 +9,6 @@ import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
9
9
  import type { KeyboardMixinClass } from '@vaadin/a11y-base/src/keyboard-mixin.js';
10
10
  import type { DelegateStateMixinClass } from '@vaadin/component-base/src/delegate-state-mixin.js';
11
11
  import type { ElementMixinClass } from '@vaadin/component-base/src/element-mixin.js';
12
- import type { OverlayClassMixinClass } from '@vaadin/component-base/src/overlay-class-mixin.js';
13
12
  import type { ClearButtonMixinClass } from '@vaadin/field-base/src/clear-button-mixin.js';
14
13
  import type { FieldMixinClass } from '@vaadin/field-base/src/field-mixin.js';
15
14
  import type { InputConstraintsMixinClass } from '@vaadin/field-base/src/input-constraints-mixin.js';
@@ -176,24 +175,38 @@ export interface ComboBoxEventMap<TItem> extends HTMLElementEventMap {
176
175
  * `--vaadin-combo-box-overlay-width` | Width of the overlay | `auto`
177
176
  * `--vaadin-combo-box-overlay-max-height` | Max height of the overlay | `65vh`
178
177
  *
179
- * `<vaadin-combo-box>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.
180
- * See [`<vaadin-text-field>`](#/elements/vaadin-text-field) for the styling documentation.
178
+ * The following shadow DOM parts are available for styling:
181
179
  *
182
- * In addition to `<vaadin-text-field>` parts, the following parts are available for theming:
180
+ * Part name | Description
181
+ * ---------------------|----------------
182
+ * `label` | The label element
183
+ * `input-field` | The element that wraps prefix, value and buttons
184
+ * `field-button` | Set on both clear and toggle buttons
185
+ * `clear-button` | The clear button
186
+ * `error-message` | The error message element
187
+ * `helper-text` | The helper text element wrapper
188
+ * `required-indicator` | The `required` state indicator element
189
+ * `toggle-button` | The toggle button
190
+ * `overlay` | The overlay container
191
+ * `content` | The overlay content
192
+ * `loader` | The loading indicator shown while loading items
183
193
  *
184
- * Part name | Description
185
- * -----------------|------------------
186
- * `toggle-button` | The toggle button
187
- * `overlay` | The overlay container
188
- * `content` | The overlay content
189
- * `loader` | The loading indicator shown while loading items
194
+ * The following state attributes are available for styling:
190
195
  *
191
- * In addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:
192
- *
193
- * Attribute | Description | Part name
194
- * ----------|-------------|------------
195
- * `opened` | Set when the combo box dropdown is open | :host
196
- * `loading` | Set when new items are expected | :host
196
+ * Attribute | Description
197
+ * ---------------------|---------------------------------
198
+ * `disabled` | Set when the element is disabled
199
+ * `has-value` | Set when the element has a value
200
+ * `has-label` | Set when the element has a label
201
+ * `has-helper` | Set when the element has helper text or slot
202
+ * `has-error-message` | Set when the element has an error message
203
+ * `has-tooltip` | Set when the element has a slotted tooltip
204
+ * `invalid` | Set when the element is invalid
205
+ * `focused` | Set when the element is focused
206
+ * `focus-ring` | Set when the element is keyboard focused
207
+ * `readonly` | Set when the element is readonly
208
+ * `opened` | Set when the overlay is opened
209
+ * `loading` | Set when loading items from the data provider
197
210
  *
198
211
  * ### Internal components
199
212
  *
@@ -236,7 +249,6 @@ interface ComboBox<TItem = ComboBoxDefaultItem>
236
249
  PatternMixinClass,
237
250
  LabelMixinClass,
238
251
  KeyboardMixinClass,
239
- OverlayClassMixinClass,
240
252
  InputMixinClass,
241
253
  ClearButtonMixinClass,
242
254
  InputControlMixinClass,
@@ -20,7 +20,7 @@ import { PatternMixin } from '@vaadin/field-base/src/pattern-mixin.js';
20
20
  import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
21
21
  import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
22
22
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
23
- import { comboBoxStyles } from './styles/vaadin-combo-box-core-styles.js';
23
+ import { comboBoxStyles } from './styles/vaadin-combo-box-base-styles.js';
24
24
  import { ComboBoxDataProviderMixin } from './vaadin-combo-box-data-provider-mixin.js';
25
25
  import { ComboBoxMixin } from './vaadin-combo-box-mixin.js';
26
26
 
@@ -107,24 +107,38 @@ import { ComboBoxMixin } from './vaadin-combo-box-mixin.js';
107
107
  * `--vaadin-combo-box-overlay-width` | Width of the overlay | `auto`
108
108
  * `--vaadin-combo-box-overlay-max-height` | Max height of the overlay | `65vh`
109
109
  *
110
- * `<vaadin-combo-box>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.
111
- * See [`<vaadin-text-field>`](#/elements/vaadin-text-field) for the styling documentation.
110
+ * The following shadow DOM parts are available for styling:
112
111
  *
113
- * In addition to `<vaadin-text-field>` parts, the following parts are available for theming:
112
+ * Part name | Description
113
+ * ---------------------|----------------
114
+ * `label` | The label element
115
+ * `input-field` | The element that wraps prefix, value and buttons
116
+ * `field-button` | Set on both clear and toggle buttons
117
+ * `clear-button` | The clear button
118
+ * `error-message` | The error message element
119
+ * `helper-text` | The helper text element wrapper
120
+ * `required-indicator` | The `required` state indicator element
121
+ * `toggle-button` | The toggle button
122
+ * `overlay` | The overlay container
123
+ * `content` | The overlay content
124
+ * `loader` | The loading indicator shown while loading items
114
125
  *
115
- * Part name | Description
116
- * -----------------|------------------
117
- * `toggle-button` | The toggle button
118
- * `overlay` | The overlay container
119
- * `content` | The overlay content
120
- * `loader` | The loading indicator shown while loading items
126
+ * The following state attributes are available for styling:
121
127
  *
122
- * In addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:
123
- *
124
- * Attribute | Description | Part name
125
- * ----------|-------------|------------
126
- * `opened` | Set when the combo box dropdown is open | :host
127
- * `loading` | Set when new items are expected | :host
128
+ * Attribute | Description
129
+ * ---------------------|---------------------------------
130
+ * `disabled` | Set when the element is disabled
131
+ * `has-value` | Set when the element has a value
132
+ * `has-label` | Set when the element has a label
133
+ * `has-helper` | Set when the element has helper text or slot
134
+ * `has-error-message` | Set when the element has an error message
135
+ * `has-tooltip` | Set when the element has a slotted tooltip
136
+ * `invalid` | Set when the element is invalid
137
+ * `focused` | Set when the element is focused
138
+ * `focus-ring` | Set when the element is keyboard focused
139
+ * `readonly` | Set when the element is readonly
140
+ * `opened` | Set when the overlay is opened
141
+ * `loading` | Set when loading items from the data provider
128
142
  *
129
143
  * ### Internal components
130
144
  *
@@ -204,8 +218,8 @@ class ComboBox extends ComboBoxDataProviderMixin(
204
218
  >
205
219
  <slot name="prefix" slot="prefix"></slot>
206
220
  <slot name="input"></slot>
207
- <div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
208
- <div id="toggleButton" part="toggle-button" slot="suffix" aria-hidden="true"></div>
221
+ <div id="clearButton" part="field-button clear-button" slot="suffix" aria-hidden="true"></div>
222
+ <div id="toggleButton" part="field-button toggle-button" slot="suffix" aria-hidden="true"></div>
209
223
  </vaadin-input-container>
210
224
 
211
225
  <div part="helper-text">
@@ -1,2 +1,2 @@
1
- import './theme/lumo/vaadin-combo-box.js';
1
+ import './src/vaadin-combo-box.js';
2
2
  export * from './src/vaadin-combo-box.js';
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-alpha9",
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-alpha9/#/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-alpha9/#/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-alpha9/#/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-alpha9/#/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-alpha9/#/elements/vaadin-item).\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
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.",
@@ -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.",
@@ -635,6 +613,17 @@
635
613
  ]
636
614
  }
637
615
  },
616
+ {
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.",
619
+ "value": {
620
+ "type": [
621
+ "Object",
622
+ "null",
623
+ "undefined"
624
+ ]
625
+ }
626
+ },
638
627
  {
639
628
  "name": "itemLabelPath",
640
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.",
@@ -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-alpha9",
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-alpha9/#/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-alpha9/#/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-alpha9/#/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-alpha9/#/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-alpha9/#/elements/vaadin-item).\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
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
  {
@@ -201,13 +201,6 @@
201
201
  "kind": "expression"
202
202
  }
203
203
  },
204
- {
205
- "name": ".overlayClass",
206
- "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.",
207
- "value": {
208
- "kind": "expression"
209
- }
210
- },
211
204
  {
212
205
  "name": ".items",
213
206
  "description": "A full set of items to filter the visible options from.\nThe items can be of either `String` or `Object` type.",
@@ -229,6 +222,13 @@
229
222
  "kind": "expression"
230
223
  }
231
224
  },
225
+ {
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
+ "value": {
229
+ "kind": "expression"
230
+ }
231
+ },
232
232
  {
233
233
  "name": ".itemLabelPath",
234
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.",
@@ -1,8 +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 type { CSSResult } from 'lit';
7
-
8
- export const comboBoxStyles: CSSResult;
@@ -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,5 +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 comboBoxItem: import("lit").CSSResult;
5
- export { comboBoxItem };
@@ -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,2 +0,0 @@
1
- import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
2
- import '@vaadin/vaadin-lumo-styles/font-icons.js';
@@ -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' });
@@ -1,4 +0,0 @@
1
- import './vaadin-combo-box-item-styles.js';
2
- import './vaadin-combo-box-overlay-styles.js';
3
- import './vaadin-combo-box-styles.js';
4
- import '../../src/vaadin-combo-box.js';
@@ -1,4 +0,0 @@
1
- import './vaadin-combo-box-item-styles.js';
2
- import './vaadin-combo-box-overlay-styles.js';
3
- import './vaadin-combo-box-styles.js';
4
- import '../../src/vaadin-combo-box.js';