@vaadin/select 25.0.0-alpha9 → 25.0.0-beta2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/select",
3
- "version": "25.0.0-alpha9",
3
+ "version": "25.0.0-beta2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -23,9 +23,6 @@
23
23
  "lit.d.ts",
24
24
  "lit.js",
25
25
  "src",
26
- "!src/styles/*-base-styles.d.ts",
27
- "!src/styles/*-base-styles.js",
28
- "theme",
29
26
  "vaadin-*.d.ts",
30
27
  "vaadin-*.js",
31
28
  "web-types.json",
@@ -39,28 +36,28 @@
39
36
  ],
40
37
  "dependencies": {
41
38
  "@open-wc/dedupe-mixin": "^1.3.0",
42
- "@vaadin/a11y-base": "25.0.0-alpha9",
43
- "@vaadin/button": "25.0.0-alpha9",
44
- "@vaadin/component-base": "25.0.0-alpha9",
45
- "@vaadin/field-base": "25.0.0-alpha9",
46
- "@vaadin/input-container": "25.0.0-alpha9",
47
- "@vaadin/item": "25.0.0-alpha9",
48
- "@vaadin/list-box": "25.0.0-alpha9",
49
- "@vaadin/lit-renderer": "25.0.0-alpha9",
50
- "@vaadin/overlay": "25.0.0-alpha9",
51
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha9",
52
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha9",
39
+ "@vaadin/a11y-base": "25.0.0-beta2",
40
+ "@vaadin/button": "25.0.0-beta2",
41
+ "@vaadin/component-base": "25.0.0-beta2",
42
+ "@vaadin/field-base": "25.0.0-beta2",
43
+ "@vaadin/input-container": "25.0.0-beta2",
44
+ "@vaadin/item": "25.0.0-beta2",
45
+ "@vaadin/list-box": "25.0.0-beta2",
46
+ "@vaadin/lit-renderer": "25.0.0-beta2",
47
+ "@vaadin/overlay": "25.0.0-beta2",
48
+ "@vaadin/vaadin-themable-mixin": "25.0.0-beta2",
53
49
  "lit": "^3.0.0"
54
50
  },
55
51
  "devDependencies": {
56
- "@vaadin/chai-plugins": "25.0.0-alpha9",
57
- "@vaadin/test-runner-commands": "25.0.0-alpha9",
52
+ "@vaadin/chai-plugins": "25.0.0-beta2",
53
+ "@vaadin/test-runner-commands": "25.0.0-beta2",
58
54
  "@vaadin/testing-helpers": "^2.0.0",
59
- "sinon": "^18.0.0"
55
+ "@vaadin/vaadin-lumo-styles": "25.0.0-beta2",
56
+ "sinon": "^21.0.0"
60
57
  },
61
58
  "web-types": [
62
59
  "web-types.json",
63
60
  "web-types.lit.json"
64
61
  ],
65
- "gitHead": "bbe4720721e0955ffc87a79b412bee38b1f0eb1e"
62
+ "gitHead": "e078f8371ae266f05c7ca1ec25686cc489c83f24"
66
63
  }
@@ -28,7 +28,7 @@ export class SelectRendererDirective extends LitRendererDirective<Select, Select
28
28
  }
29
29
 
30
30
  /**
31
- * A Lit directive for populating the content of the `<vaadin-select-overlay>` element.
31
+ * A Lit directive for populating the content of the `<vaadin-select>` element.
32
32
  *
33
33
  * The directive accepts a renderer callback returning a Lit template and assigns it to the select
34
34
  * via the `renderer` property. The renderer is called once to populate the content when assigned
@@ -32,7 +32,7 @@ export class SelectRendererDirective extends LitRendererDirective {
32
32
  }
33
33
 
34
34
  /**
35
- * A Lit directive for populating the content of the `<vaadin-select-overlay>` element.
35
+ * A Lit directive for populating the content of the `<vaadin-select>` element.
36
36
  *
37
37
  * The directive accepts a renderer callback returning a Lit template and assigns it to the select
38
38
  * via the `renderer` property. The renderer is called once to populate the content when assigned
@@ -3,7 +3,7 @@
3
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
- 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 selectStyles = css`
@@ -32,7 +32,7 @@ export const selectStyles = css`
32
32
  cursor: var(--vaadin-clickable-cursor);
33
33
  }
34
34
 
35
- [part='toggle-button']::before {
35
+ [part~='toggle-button']::before {
36
36
  mask-image: var(--_vaadin-icon-chevron-down);
37
37
  }
38
38
  `;
@@ -11,11 +11,15 @@ export const selectOverlayStyles = css`
11
11
  justify-content: flex-start;
12
12
  }
13
13
 
14
- :host(:not([phone])) [part='overlay'] {
14
+ [part='overlay'] {
15
15
  min-width: var(--vaadin-select-overlay-width, var(--_vaadin-select-overlay-default-width));
16
16
  }
17
17
 
18
18
  [part='content'] {
19
19
  padding: var(--vaadin-item-overlay-padding, 4px);
20
20
  }
21
+
22
+ [part='backdrop'] {
23
+ background: transparent;
24
+ }
21
25
  `;
@@ -24,6 +24,10 @@ export const valueButton = css`
24
24
  display: contents;
25
25
  }
26
26
 
27
+ :host([placeholder]) {
28
+ color: var(--vaadin-input-field-placeholder-color, var(--vaadin-text-color-secondary));
29
+ }
30
+
27
31
  :host([disabled]) {
28
32
  pointer-events: none;
29
33
  }
@@ -10,7 +10,6 @@ import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
10
10
  import type { KeyboardMixinClass } from '@vaadin/a11y-base/src/keyboard-mixin.js';
11
11
  import type { TabindexMixinClass } from '@vaadin/a11y-base/src/tabindex-mixin.js';
12
12
  import type { DelegateStateMixinClass } from '@vaadin/component-base/src/delegate-state-mixin.js';
13
- import type { OverlayClassMixinClass } from '@vaadin/component-base/src/overlay-class-mixin.js';
14
13
  import type { FieldMixinClass } from '@vaadin/field-base/src/field-mixin.js';
15
14
  import type { LabelMixinClass } from '@vaadin/field-base/src/label-mixin.js';
16
15
  import type { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.js';
@@ -25,7 +24,6 @@ export declare function SelectBaseMixin<T extends Constructor<HTMLElement>>(
25
24
  Constructor<FocusMixinClass> &
26
25
  Constructor<KeyboardMixinClass> &
27
26
  Constructor<LabelMixinClass> &
28
- Constructor<OverlayClassMixinClass> &
29
27
  Constructor<SelectBaseMixinClass> &
30
28
  Constructor<TabindexMixinClass> &
31
29
  Constructor<ValidateMixinClass> &
@@ -64,8 +62,7 @@ export declare class SelectBaseMixinClass {
64
62
  * Custom function for rendering the content of the `<vaadin-select>`.
65
63
  * Receives two arguments:
66
64
  *
67
- * - `root` The `<vaadin-select-overlay>` internal container
68
- * DOM element. Append your content to it.
65
+ * - `root` The internal container DOM element. Append your content to it.
69
66
  * - `select` The reference to the `<vaadin-select>` element.
70
67
  */
71
68
  renderer: SelectRenderer | undefined;
@@ -8,7 +8,6 @@ import { DelegateFocusMixin } from '@vaadin/a11y-base/src/delegate-focus-mixin.j
8
8
  import { KeyboardMixin } from '@vaadin/a11y-base/src/keyboard-mixin.js';
9
9
  import { DelegateStateMixin } from '@vaadin/component-base/src/delegate-state-mixin.js';
10
10
  import { MediaQueryController } from '@vaadin/component-base/src/media-query-controller.js';
11
- import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
12
11
  import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
13
12
  import { generateUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';
14
13
  import { FieldMixin } from '@vaadin/field-base/src/field-mixin.js';
@@ -21,12 +20,9 @@ import { ButtonController } from './button-controller.js';
21
20
  * @mixes DelegateStateMixin
22
21
  * @mixes FieldMixin
23
22
  * @mixes KeyboardMixin
24
- * @mixes OverlayClassMixin
25
23
  */
26
24
  export const SelectBaseMixin = (superClass) =>
27
- class SelectBaseMixin extends OverlayClassMixin(
28
- DelegateFocusMixin(DelegateStateMixin(KeyboardMixin(FieldMixin(superClass)))),
29
- ) {
25
+ class SelectBaseMixin extends DelegateFocusMixin(DelegateStateMixin(KeyboardMixin(FieldMixin(superClass)))) {
30
26
  static get properties() {
31
27
  return {
32
28
  /**
@@ -72,8 +68,7 @@ export const SelectBaseMixin = (superClass) =>
72
68
  * Custom function for rendering the content of the `<vaadin-select>`.
73
69
  * Receives two arguments:
74
70
  *
75
- * - `root` The `<vaadin-select-overlay>` internal container
76
- * DOM element. Append your content to it.
71
+ * - `root` The internal container DOM element. Append your content to it.
77
72
  * - `select` The reference to the `<vaadin-select>` element.
78
73
  * @type {!SelectRenderer | undefined}
79
74
  */
@@ -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 { ItemMixin } from '@vaadin/item/src/vaadin-item-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';
@@ -8,7 +8,7 @@ import { ListMixin } from '@vaadin/a11y-base/src/list-mixin.js';
8
8
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
9
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
10
10
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
11
- import { listBoxStyles } from '@vaadin/list-box/src/styles/vaadin-list-box-core-styles.js';
11
+ import { listBoxStyles } from '@vaadin/list-box/src/styles/vaadin-list-box-base-styles.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
14
 
@@ -27,10 +27,20 @@ export const SelectOverlayMixin = (superClass) =>
27
27
  }
28
28
 
29
29
  /**
30
- * @override
30
+ * Override method from OverlayFocusMixin to use slotted div as content root.
31
31
  * @protected
32
+ * @override
32
33
  */
33
34
  get _contentRoot() {
35
+ return this._rendererRoot;
36
+ }
37
+
38
+ /**
39
+ * Override method from OverlayMixin to use slotted div as a renderer root.
40
+ * @protected
41
+ * @override
42
+ */
43
+ get _rendererRoot() {
34
44
  if (!this.__savedRoot) {
35
45
  const root = document.createElement('div');
36
46
  root.setAttribute('slot', 'overlay');
@@ -66,7 +76,7 @@ export const SelectOverlayMixin = (superClass) =>
66
76
 
67
77
  /** @protected */
68
78
  _getMenuElement() {
69
- return Array.from(this._contentRoot.children).find((el) => el.localName !== 'style');
79
+ return Array.from(this._rendererRoot.children).find((el) => el.localName !== 'style');
70
80
  }
71
81
 
72
82
  /** @private */
@@ -6,10 +6,10 @@
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 { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-core-styles.js';
9
+ import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-base-styles.js';
10
10
  import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
11
11
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
- import { selectOverlayStyles } from './styles/vaadin-select-overlay-core-styles.js';
12
+ import { selectOverlayStyles } from './styles/vaadin-select-overlay-base-styles.js';
13
13
  import { SelectOverlayMixin } from './vaadin-select-overlay-mixin.js';
14
14
 
15
15
  /**
@@ -9,7 +9,7 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
9
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
10
  import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
11
11
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
- import { valueButton } from './styles/vaadin-select-value-button-core-styles.js';
12
+ import { valueButton } from './styles/vaadin-select-value-button-base-styles.js';
13
13
 
14
14
  /**
15
15
  * An element used internally by `<vaadin-select>`. Not intended to be used separately.
@@ -26,8 +26,7 @@ export type SelectChangeEvent = Event & {
26
26
  * Function for rendering the content of the `<vaadin-select>`.
27
27
  * Receives two arguments:
28
28
  *
29
- * - `root` The `<vaadin-select-overlay>` internal container
30
- * DOM element. Append your content to it.
29
+ * - `root` The internal container DOM element. Append your content to it.
31
30
  * - `select` The reference to the `<vaadin-select>` element.
32
31
  */
33
32
  export type SelectRenderer = (root: HTMLElement, select: Select) => void;
@@ -131,41 +130,45 @@ export interface SelectEventMap extends HTMLElementEventMap, SelectCustomEventMa
131
130
  * `--vaadin-field-default-width` | Default width of the field | `12em`
132
131
  * `--vaadin-select-overlay-width` | Width of the overlay |
133
132
  *
134
- * `<vaadin-select>` provides mostly the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.
135
- * See [`<vaadin-text-field>`](#/elements/vaadin-text-field) for the styling documentation.
136
- *
137
- *
138
- * In addition to `<vaadin-text-field>` parts, the following parts are available for theming:
139
- *
140
- * Part name | Description
141
- * -----------------|----------------
142
- * `toggle-button` | The toggle button
143
- * `backdrop` | Backdrop of the overlay
144
- * `overlay` | The overlay container
145
- * `content` | The overlay content
146
- *
147
- * In addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:
148
- *
149
- * Attribute | Description
150
- * ----------|-----------------------------
151
- * `opened` | Set when the select is open
152
- * `phone` | Set when the overlay is shown in phone mode
153
- *
154
- * There are two exceptions in terms of styling compared to `<vaadin-text-field>`:
155
- * - the `clear-button` shadow DOM part does not exist in `<vaadin-select>`.
156
- * - the `input-prevented` state attribute is not supported by `<vaadin-select>`.
133
+ * The following shadow DOM parts are available for styling:
134
+ *
135
+ * Part name | Description
136
+ * ---------------------|----------------
137
+ * `label` | The label element
138
+ * `input-field` | The element that wraps prefix, value and toggle button
139
+ * `field-button` | Set on the toggle button
140
+ * `error-message` | The error message element
141
+ * `helper-text` | The helper text element wrapper
142
+ * `required-indicator` | The `required` state indicator element
143
+ * `toggle-button` | The toggle button
144
+ * `backdrop` | Backdrop of the overlay
145
+ * `overlay` | The overlay container
146
+ * `content` | The overlay content
147
+ *
148
+ * The following state attributes are available for styling:
149
+ *
150
+ * Attribute | Description
151
+ * ---------------------|---------------------------------
152
+ * `disabled` | Set when the element is disabled
153
+ * `has-value` | Set when the element has a value
154
+ * `has-label` | Set when the element has a label
155
+ * `has-helper` | Set when the element has helper text or slot
156
+ * `has-error-message` | Set when the element has an error message
157
+ * `invalid` | Set when the element is invalid
158
+ * `focused` | Set when the element is focused
159
+ * `focus-ring` | Set when the element is keyboard focused
160
+ * `readonly` | Set when the element is readonly
161
+ * `opened` | Set when the overlay is opened
162
+ * `phone` | Set when the overlay is shown in phone mode
157
163
  *
158
164
  * ### Internal components
159
165
  *
160
166
  * In addition to `<vaadin-select>` itself, the following internal
161
167
  * components are themable:
162
168
  *
163
- * - `<vaadin-select-overlay>` - has the same API as [`<vaadin-overlay>`](#/elements/vaadin-overlay).
164
169
  * - `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](#/elements/vaadin-button).
165
- * - [`<vaadin-input-container>`](#/elements/vaadin-input-container) - an internal element wrapping the button.
166
- *
167
- * Note: the `theme` attribute value set on `<vaadin-select>` is
168
- * propagated to the internal components listed above.
170
+ * - `<vaadin-select-list-box>` - has the same API as [`<vaadin-list-box>`](#/elements/vaadin-list-box).
171
+ * - `<vaadin-select-item>` - has the same API as [`<vaadin-item>`](#/elements/vaadin-item).
169
172
  *
170
173
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
171
174
  *
@@ -10,6 +10,7 @@ import './vaadin-select-overlay.js';
10
10
  import './vaadin-select-value-button.js';
11
11
  import { html, LitElement } from 'lit';
12
12
  import { ifDefined } from 'lit/directives/if-defined.js';
13
+ import { isKeyboardActive } from '@vaadin/a11y-base/src/focus-utils.js';
13
14
  import { screenReaderOnly } from '@vaadin/a11y-base/src/styles/sr-only-styles.js';
14
15
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
15
16
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
@@ -17,7 +18,7 @@ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
17
18
  import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
18
19
  import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
19
20
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
20
- import { selectStyles } from './styles/vaadin-select-core-styles.js';
21
+ import { selectStyles } from './styles/vaadin-select-base-styles.js';
21
22
  import { SelectBaseMixin } from './vaadin-select-base-mixin.js';
22
23
 
23
24
  /**
@@ -85,41 +86,45 @@ import { SelectBaseMixin } from './vaadin-select-base-mixin.js';
85
86
  * `--vaadin-field-default-width` | Default width of the field | `12em`
86
87
  * `--vaadin-select-overlay-width` | Width of the overlay |
87
88
  *
88
- * `<vaadin-select>` provides mostly the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.
89
- * See [`<vaadin-text-field>`](#/elements/vaadin-text-field) for the styling documentation.
90
- *
91
- *
92
- * In addition to `<vaadin-text-field>` parts, the following parts are available for theming:
93
- *
94
- * Part name | Description
95
- * -----------------|----------------
96
- * `toggle-button` | The toggle button
97
- * `backdrop` | Backdrop of the overlay
98
- * `overlay` | The overlay container
99
- * `content` | The overlay content
100
- *
101
- * In addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:
102
- *
103
- * Attribute | Description
104
- * ----------|-----------------------------
105
- * `opened` | Set when the select is open
106
- * `phone` | Set when the overlay is shown in phone mode
107
- *
108
- * There are two exceptions in terms of styling compared to `<vaadin-text-field>`:
109
- * - the `clear-button` shadow DOM part does not exist in `<vaadin-select>`.
110
- * - the `input-prevented` state attribute is not supported by `<vaadin-select>`.
89
+ * The following shadow DOM parts are available for styling:
90
+ *
91
+ * Part name | Description
92
+ * ---------------------|----------------
93
+ * `label` | The label element
94
+ * `input-field` | The element that wraps prefix, value and toggle button
95
+ * `field-button` | Set on the toggle button
96
+ * `error-message` | The error message element
97
+ * `helper-text` | The helper text element wrapper
98
+ * `required-indicator` | The `required` state indicator element
99
+ * `toggle-button` | The toggle button
100
+ * `backdrop` | Backdrop of the overlay
101
+ * `overlay` | The overlay container
102
+ * `content` | The overlay content
103
+ *
104
+ * The following state attributes are available for styling:
105
+ *
106
+ * Attribute | Description
107
+ * ---------------------|---------------------------------
108
+ * `disabled` | Set when the element is disabled
109
+ * `has-value` | Set when the element has a value
110
+ * `has-label` | Set when the element has a label
111
+ * `has-helper` | Set when the element has helper text or slot
112
+ * `has-error-message` | Set when the element has an error message
113
+ * `invalid` | Set when the element is invalid
114
+ * `focused` | Set when the element is focused
115
+ * `focus-ring` | Set when the element is keyboard focused
116
+ * `readonly` | Set when the element is readonly
117
+ * `opened` | Set when the overlay is opened
118
+ * `phone` | Set when the overlay is shown in phone mode
111
119
  *
112
120
  * ### Internal components
113
121
  *
114
122
  * In addition to `<vaadin-select>` itself, the following internal
115
123
  * components are themable:
116
124
  *
117
- * - `<vaadin-select-overlay>` - has the same API as [`<vaadin-overlay>`](#/elements/vaadin-overlay).
118
125
  * - `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](#/elements/vaadin-button).
119
- * - [`<vaadin-input-container>`](#/elements/vaadin-input-container) - an internal element wrapping the button.
120
- *
121
- * Note: the `theme` attribute value set on `<vaadin-select>` is
122
- * propagated to the internal components listed above.
126
+ * - `<vaadin-select-list-box>` - has the same API as [`<vaadin-list-box>`](#/elements/vaadin-list-box).
127
+ * - `<vaadin-select-item>` - has the same API as [`<vaadin-item>`](#/elements/vaadin-item).
123
128
  *
124
129
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
125
130
  *
@@ -163,7 +168,12 @@ class Select extends SelectBaseMixin(ElementMixin(ThemableMixin(PolylitMixin(Lum
163
168
  >
164
169
  <slot name="prefix" slot="prefix"></slot>
165
170
  <slot name="value"></slot>
166
- <div part="toggle-button" slot="suffix" aria-hidden="true" @mousedown="${this._onToggleMouseDown}"></div>
171
+ <div
172
+ part="field-button toggle-button"
173
+ slot="suffix"
174
+ aria-hidden="true"
175
+ @mousedown="${this._onToggleMouseDown}"
176
+ ></div>
167
177
  </vaadin-input-container>
168
178
 
169
179
  <div part="helper-text">
@@ -207,7 +217,7 @@ class Select extends SelectBaseMixin(ElementMixin(ThemableMixin(PolylitMixin(Lum
207
217
  /** @private */
208
218
  _onOverlayOpen() {
209
219
  if (this._menuElement) {
210
- this._menuElement.focus();
220
+ this._menuElement.focus({ focusVisible: isKeyboardActive() });
211
221
  }
212
222
  }
213
223
 
package/vaadin-select.js CHANGED
@@ -1,2 +1,2 @@
1
- import './theme/lumo/vaadin-select.js';
1
+ import './src/vaadin-select.js';
2
2
  export * from './src/vaadin-select.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/select",
4
- "version": "25.0.0-alpha9",
4
+ "version": "25.0.0-beta2",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-select",
11
- "description": "`<vaadin-select>` is a Web Component for selecting values from a list of items.\n\n### Items\n\nUse the `items` property to define possible options for the select:\n\n```html\n<vaadin-select id=\"select\"></vaadin-select>\n```\n```js\nconst select = document.querySelector('#select');\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },\n { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\n### Rendering\n\nAlternatively, the content of the select can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `select` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `select`.\n\n```js\nconst select = document.querySelector('#select');\nselect.renderer = function(root, select) {\n const listBox = document.createElement('vaadin-list-box');\n // append 3 <vaadin-item> elements\n ['Jose', 'Manolo', 'Pedro'].forEach(function(name) {\n const item = document.createElement('vaadin-item');\n item.textContent = name;\n item.setAttribute('label', name)\n listBox.appendChild(item);\n });\n\n // update the content\n root.appendChild(listBox);\n};\n```\n\nRenderer is called on initialization of new select and on its opening.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n* Hint: By setting the `label` property of inner vaadin-items you will\nbe able to change the visual representation of the selected value in the input part.\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-select-overlay-width` | Width of the overlay |\n\n`<vaadin-select>` provides mostly 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\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`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description\n----------|-----------------------------\n`opened` | Set when the select is open\n`phone` | Set when the overlay is shown in phone mode\n\nThere are two exceptions in terms of styling compared to `<vaadin-text-field>`:\n- the `clear-button` shadow DOM part does not exist in `<vaadin-select>`.\n- the `input-prevented` state attribute is not supported by `<vaadin-select>`.\n\n### Internal components\n\nIn addition to `<vaadin-select>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-select-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha9/#/elements/vaadin-overlay).\n- `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha9/#/elements/vaadin-button).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha9/#/elements/vaadin-input-container) - an internal element wrapping the button.\n\nNote: the `theme` attribute value set on `<vaadin-select>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
11
+ "description": "`<vaadin-select>` is a Web Component for selecting values from a list of items.\n\n### Items\n\nUse the `items` property to define possible options for the select:\n\n```html\n<vaadin-select id=\"select\"></vaadin-select>\n```\n```js\nconst select = document.querySelector('#select');\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },\n { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\n### Rendering\n\nAlternatively, the content of the select can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `select` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `select`.\n\n```js\nconst select = document.querySelector('#select');\nselect.renderer = function(root, select) {\n const listBox = document.createElement('vaadin-list-box');\n // append 3 <vaadin-item> elements\n ['Jose', 'Manolo', 'Pedro'].forEach(function(name) {\n const item = document.createElement('vaadin-item');\n item.textContent = name;\n item.setAttribute('label', name)\n listBox.appendChild(item);\n });\n\n // update the content\n root.appendChild(listBox);\n};\n```\n\nRenderer is called on initialization of new select and on its opening.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n* Hint: By setting the `label` property of inner vaadin-items you will\nbe able to change the visual representation of the selected value in the input part.\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-select-overlay-width` | Width of the overlay |\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 toggle button\n`field-button` | Set on the toggle 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`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\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`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`phone` | Set when the overlay is shown in phone mode\n\n### Internal components\n\nIn addition to `<vaadin-select>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-button).\n- `<vaadin-select-list-box>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-list-box).\n- `<vaadin-select-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/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",
@@ -120,17 +120,6 @@
120
120
  ]
121
121
  }
122
122
  },
123
- {
124
- "name": "overlay-class",
125
- "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.",
126
- "value": {
127
- "type": [
128
- "string",
129
- "null",
130
- "undefined"
131
- ]
132
- }
133
- },
134
123
  {
135
124
  "name": "opened",
136
125
  "description": "Set when the select is open",
@@ -315,17 +304,6 @@
315
304
  ]
316
305
  }
317
306
  },
318
- {
319
- "name": "overlayClass",
320
- "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.",
321
- "value": {
322
- "type": [
323
- "string",
324
- "null",
325
- "undefined"
326
- ]
327
- }
328
- },
329
307
  {
330
308
  "name": "items",
331
309
  "description": "An array containing items that will be rendered as the options of the select.\n\n#### Example\n```js\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },\n { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\nNote: each item is rendered by default as the internal `<vaadin-select-item>` that is an extension of `<vaadin-item>`.\nTo render the item with a custom component, provide a tag name by the `component` property.",
@@ -346,7 +324,7 @@
346
324
  },
347
325
  {
348
326
  "name": "renderer",
349
- "description": "Custom function for rendering the content of the `<vaadin-select>`.\nReceives two arguments:\n\n- `root` The `<vaadin-select-overlay>` internal container\n DOM element. Append your content to it.\n- `select` The reference to the `<vaadin-select>` element.",
327
+ "description": "Custom function for rendering the content of the `<vaadin-select>`.\nReceives two arguments:\n\n- `root` The internal container DOM element. Append your content to it.\n- `select` The reference to the `<vaadin-select>` element.",
350
328
  "value": {
351
329
  "type": [
352
330
  "SelectRenderer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/select",
4
- "version": "25.0.0-alpha9",
4
+ "version": "25.0.0-beta2",
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-select",
19
- "description": "`<vaadin-select>` is a Web Component for selecting values from a list of items.\n\n### Items\n\nUse the `items` property to define possible options for the select:\n\n```html\n<vaadin-select id=\"select\"></vaadin-select>\n```\n```js\nconst select = document.querySelector('#select');\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },\n { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\n### Rendering\n\nAlternatively, the content of the select can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `select` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `select`.\n\n```js\nconst select = document.querySelector('#select');\nselect.renderer = function(root, select) {\n const listBox = document.createElement('vaadin-list-box');\n // append 3 <vaadin-item> elements\n ['Jose', 'Manolo', 'Pedro'].forEach(function(name) {\n const item = document.createElement('vaadin-item');\n item.textContent = name;\n item.setAttribute('label', name)\n listBox.appendChild(item);\n });\n\n // update the content\n root.appendChild(listBox);\n};\n```\n\nRenderer is called on initialization of new select and on its opening.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n* Hint: By setting the `label` property of inner vaadin-items you will\nbe able to change the visual representation of the selected value in the input part.\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-select-overlay-width` | Width of the overlay |\n\n`<vaadin-select>` provides mostly 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\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`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description\n----------|-----------------------------\n`opened` | Set when the select is open\n`phone` | Set when the overlay is shown in phone mode\n\nThere are two exceptions in terms of styling compared to `<vaadin-text-field>`:\n- the `clear-button` shadow DOM part does not exist in `<vaadin-select>`.\n- the `input-prevented` state attribute is not supported by `<vaadin-select>`.\n\n### Internal components\n\nIn addition to `<vaadin-select>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-select-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha9/#/elements/vaadin-overlay).\n- `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha9/#/elements/vaadin-button).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha9/#/elements/vaadin-input-container) - an internal element wrapping the button.\n\nNote: the `theme` attribute value set on `<vaadin-select>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
19
+ "description": "`<vaadin-select>` is a Web Component for selecting values from a list of items.\n\n### Items\n\nUse the `items` property to define possible options for the select:\n\n```html\n<vaadin-select id=\"select\"></vaadin-select>\n```\n```js\nconst select = document.querySelector('#select');\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },\n { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\n### Rendering\n\nAlternatively, the content of the select can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `select` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `select`.\n\n```js\nconst select = document.querySelector('#select');\nselect.renderer = function(root, select) {\n const listBox = document.createElement('vaadin-list-box');\n // append 3 <vaadin-item> elements\n ['Jose', 'Manolo', 'Pedro'].forEach(function(name) {\n const item = document.createElement('vaadin-item');\n item.textContent = name;\n item.setAttribute('label', name)\n listBox.appendChild(item);\n });\n\n // update the content\n root.appendChild(listBox);\n};\n```\n\nRenderer is called on initialization of new select and on its opening.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n* Hint: By setting the `label` property of inner vaadin-items you will\nbe able to change the visual representation of the selected value in the input part.\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-select-overlay-width` | Width of the overlay |\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 toggle button\n`field-button` | Set on the toggle 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`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\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`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`phone` | Set when the overlay is shown in phone mode\n\n### Internal components\n\nIn addition to `<vaadin-select>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-button).\n- `<vaadin-select-list-box>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-list-box).\n- `<vaadin-select-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/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
  {
@@ -110,13 +110,6 @@
110
110
  "kind": "expression"
111
111
  }
112
112
  },
113
- {
114
- "name": ".overlayClass",
115
- "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.",
116
- "value": {
117
- "kind": "expression"
118
- }
119
- },
120
113
  {
121
114
  "name": ".items",
122
115
  "description": "An array containing items that will be rendered as the options of the select.\n\n#### Example\n```js\nselect.items = [\n { label: 'Most recent first', value: 'recent' },\n { component: 'hr' },\n { label: 'Rating: low to high', value: 'rating-asc', className: 'asc' },\n { label: 'Rating: high to low', value: 'rating-desc', className: 'desc' },\n { component: 'hr' },\n { label: 'Price: low to high', value: 'price-asc', disabled: true },\n { label: 'Price: high to low', value: 'price-desc', disabled: true }\n];\n```\n\nNote: each item is rendered by default as the internal `<vaadin-select-item>` that is an extension of `<vaadin-item>`.\nTo render the item with a custom component, provide a tag name by the `component` property.",
@@ -126,7 +119,7 @@
126
119
  },
127
120
  {
128
121
  "name": ".renderer",
129
- "description": "Custom function for rendering the content of the `<vaadin-select>`.\nReceives two arguments:\n\n- `root` The `<vaadin-select-overlay>` internal container\n DOM element. Append your content to it.\n- `select` The reference to the `<vaadin-select>` element.",
122
+ "description": "Custom function for rendering the content of the `<vaadin-select>`.\nReceives two arguments:\n\n- `root` The internal container DOM element. Append your content to it.\n- `select` The reference to the `<vaadin-select>` element.",
130
123
  "value": {
131
124
  "kind": "expression"
132
125
  }
@@ -1,8 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 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 selectStyles: CSSResult;
@@ -1,20 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 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 selectStyles = css`
9
- :host {
10
- position: relative;
11
- }
12
-
13
- ::slotted([slot='value']) {
14
- flex-grow: 1;
15
- }
16
-
17
- ::slotted(div[slot='overlay']) {
18
- display: contents;
19
- }
20
- `;
@@ -1,23 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 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 selectOverlayStyles = css`
9
- :host {
10
- align-items: flex-start;
11
- justify-content: flex-start;
12
- }
13
-
14
- :host(:not([phone])) [part='overlay'] {
15
- min-width: var(--vaadin-select-overlay-width, var(--_vaadin-select-overlay-default-width));
16
- }
17
-
18
- @media (forced-colors: active) {
19
- [part='overlay'] {
20
- outline: 3px solid;
21
- }
22
- }
23
- `;
@@ -1,49 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 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 valueButton = css`
9
- :host {
10
- display: inline-block;
11
- position: relative;
12
- outline: none;
13
- white-space: nowrap;
14
- -webkit-user-select: none;
15
- user-select: none;
16
- min-width: 0;
17
- width: 0;
18
- }
19
-
20
- ::slotted(*) {
21
- padding-left: 0;
22
- padding-right: 0;
23
- flex: auto;
24
- }
25
-
26
- /* placeholder styles */
27
- ::slotted(*:not([selected])) {
28
- line-height: 1;
29
- }
30
-
31
- .vaadin-button-container {
32
- display: inline-flex;
33
- align-items: center;
34
- justify-content: center;
35
- text-align: inherit;
36
- width: 100%;
37
- height: 100%;
38
- min-height: inherit;
39
- text-shadow: inherit;
40
- }
41
-
42
- [part='label'] {
43
- white-space: nowrap;
44
- overflow: hidden;
45
- text-overflow: ellipsis;
46
- width: 100%;
47
- line-height: inherit;
48
- }
49
- `;
@@ -1,9 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
7
- import '@vaadin/vaadin-lumo-styles/sizing.js';
8
- import '@vaadin/vaadin-lumo-styles/style.js';
9
- import '@vaadin/vaadin-lumo-styles/font-icons.js';
@@ -1,135 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
7
- import '@vaadin/vaadin-lumo-styles/sizing.js';
8
- import '@vaadin/vaadin-lumo-styles/style.js';
9
- import '@vaadin/vaadin-lumo-styles/font-icons.js';
10
- import { item } from '@vaadin/item/theme/lumo/vaadin-item-styles.js';
11
- import { listBox } from '@vaadin/list-box/theme/lumo/vaadin-list-box-styles.js';
12
- import { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';
13
- import { menuOverlay } from '@vaadin/vaadin-lumo-styles/mixins/menu-overlay.js';
14
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
15
-
16
- registerStyles('vaadin-select-item', item, { moduleId: 'lumo-select-item' });
17
-
18
- registerStyles('vaadin-select-list-box', listBox, { moduleId: 'lumo-select-list-box' });
19
-
20
- const select = css`
21
- :host {
22
- /* Disable pointer focus-ring for select, not supported yet */
23
- --lumo-input-field-pointer-focus-visible: 0;
24
- }
25
-
26
- :host(:not([theme*='align'])) ::slotted([slot='value']) {
27
- text-align: start;
28
- }
29
-
30
- [part='input-field'] {
31
- cursor: var(--lumo-clickable-cursor);
32
- }
33
-
34
- [part='input-field'] ::slotted([slot='value']) {
35
- font-weight: var(--vaadin-input-field-value-font-weight, 500);
36
- }
37
-
38
- [part='input-field'] ::slotted([slot='value']:not([placeholder])) {
39
- color: var(--vaadin-input-field-value-color, var(--lumo-body-text-color));
40
- }
41
-
42
- :host([readonly]) [part='input-field'] ::slotted([slot='value']:not([placeholder])) {
43
- color: var(--lumo-secondary-text-color);
44
- }
45
-
46
- /* placeholder styles */
47
- [part='input-field'] ::slotted([slot='value'][placeholder]) {
48
- color: var(--vaadin-input-field-placeholder-color, var(--lumo-secondary-text-color));
49
- }
50
-
51
- :host(:is([readonly], [disabled])) ::slotted([slot='value'][placeholder]) {
52
- opacity: 0;
53
- }
54
-
55
- [part='toggle-button']::before {
56
- content: var(--lumo-icons-dropdown);
57
- }
58
-
59
- /* Highlight the toggle button when hovering over the entire component */
60
- :host(:hover:not([readonly]):not([disabled])) [part='toggle-button'] {
61
- color: var(--lumo-contrast-80pct);
62
- }
63
-
64
- :host([theme~='small']) [part='input-field'] ::slotted([slot='value']) {
65
- --_lumo-selected-item-height: var(--lumo-size-s);
66
- --_lumo-selected-item-padding: 0;
67
- }
68
- `;
69
-
70
- registerStyles('vaadin-select', [inputFieldShared, select], { moduleId: 'lumo-select' });
71
-
72
- registerStyles(
73
- 'vaadin-select-value-button',
74
- css`
75
- :host {
76
- font-family: var(--lumo-font-family);
77
- font-size: var(--vaadin-input-field-value-font-size, var(--lumo-font-size-m));
78
- padding: 0 0.25em;
79
- --_lumo-selected-item-height: var(--lumo-size-m);
80
- --_lumo-selected-item-padding: 0.5em;
81
- }
82
-
83
- ::slotted(*) {
84
- min-height: var(--_lumo-selected-item-height);
85
- padding-top: var(--_lumo-selected-item-padding);
86
- padding-bottom: var(--_lumo-selected-item-padding);
87
- font-size: inherit;
88
- }
89
-
90
- ::slotted(*:hover) {
91
- background-color: transparent;
92
- }
93
- `,
94
- { moduleId: 'lumo-select-value-button' },
95
- );
96
-
97
- const selectOverlay = css`
98
- :host {
99
- --_lumo-item-selected-icon-display: block;
100
- }
101
-
102
- /* Small viewport adjustment */
103
- :host([phone]) {
104
- /* stylelint-disable declaration-block-no-redundant-longhand-properties */
105
- top: 0 !important;
106
- right: 0 !important;
107
- bottom: var(--vaadin-overlay-viewport-bottom, 0) !important;
108
- left: 0 !important;
109
- /* stylelint-enable declaration-block-no-redundant-longhand-properties */
110
- align-items: stretch;
111
- justify-content: flex-end;
112
- }
113
-
114
- :host([no-vertical-overlap][top-aligned]) [part='overlay'] {
115
- margin-block-start: var(--lumo-space-xs);
116
- }
117
-
118
- :host([no-vertical-overlap][bottom-aligned]) [part='overlay'] {
119
- margin-block-end: var(--lumo-space-xs);
120
- }
121
-
122
- :host([theme~='align-left']) {
123
- text-align: left;
124
- }
125
-
126
- :host([theme~='align-right']) {
127
- text-align: right;
128
- }
129
-
130
- :host([theme~='align-center']) {
131
- text-align: center;
132
- }
133
- `;
134
-
135
- registerStyles('vaadin-select-overlay', [menuOverlay, selectOverlay], { moduleId: 'lumo-select-overlay' });
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import './vaadin-select-styles.js';
7
- import '../../src/vaadin-select.js';
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import './vaadin-select-styles.js';
7
- import '../../src/vaadin-select.js';