@vaadin/select 25.0.0-alpha10 → 25.0.0-alpha12
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 +15 -18
- package/src/lit/renderer-directives.d.ts +1 -1
- package/src/lit/renderer-directives.js +1 -1
- package/src/styles/vaadin-select-base-styles.js +1 -1
- package/src/vaadin-select-base-mixin.d.ts +1 -2
- package/src/vaadin-select-base-mixin.js +1 -2
- package/src/vaadin-select-item.js +1 -1
- package/src/vaadin-select-list-box.js +1 -1
- package/src/vaadin-select-overlay.js +2 -2
- package/src/vaadin-select-value-button.js +1 -1
- package/src/vaadin-select.d.ts +3 -7
- package/src/vaadin-select.js +3 -6
- package/vaadin-select.js +1 -1
- package/web-types.json +3 -3
- package/web-types.lit.json +3 -3
- package/src/styles/vaadin-select-core-styles.d.ts +0 -8
- package/src/styles/vaadin-select-core-styles.js +0 -20
- package/src/styles/vaadin-select-overlay-core-styles.js +0 -23
- package/src/styles/vaadin-select-value-button-core-styles.js +0 -49
- package/theme/lumo/vaadin-select-styles.d.ts +0 -9
- package/theme/lumo/vaadin-select-styles.js +0 -135
- package/theme/lumo/vaadin-select.d.ts +0 -7
- package/theme/lumo/vaadin-select.js +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/select",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha12",
|
|
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-
|
|
43
|
-
"@vaadin/button": "25.0.0-
|
|
44
|
-
"@vaadin/component-base": "25.0.0-
|
|
45
|
-
"@vaadin/field-base": "25.0.0-
|
|
46
|
-
"@vaadin/input-container": "25.0.0-
|
|
47
|
-
"@vaadin/item": "25.0.0-
|
|
48
|
-
"@vaadin/list-box": "25.0.0-
|
|
49
|
-
"@vaadin/lit-renderer": "25.0.0-
|
|
50
|
-
"@vaadin/overlay": "25.0.0-
|
|
51
|
-
"@vaadin/vaadin-
|
|
52
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha10",
|
|
39
|
+
"@vaadin/a11y-base": "25.0.0-alpha12",
|
|
40
|
+
"@vaadin/button": "25.0.0-alpha12",
|
|
41
|
+
"@vaadin/component-base": "25.0.0-alpha12",
|
|
42
|
+
"@vaadin/field-base": "25.0.0-alpha12",
|
|
43
|
+
"@vaadin/input-container": "25.0.0-alpha12",
|
|
44
|
+
"@vaadin/item": "25.0.0-alpha12",
|
|
45
|
+
"@vaadin/list-box": "25.0.0-alpha12",
|
|
46
|
+
"@vaadin/lit-renderer": "25.0.0-alpha12",
|
|
47
|
+
"@vaadin/overlay": "25.0.0-alpha12",
|
|
48
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha12",
|
|
53
49
|
"lit": "^3.0.0"
|
|
54
50
|
},
|
|
55
51
|
"devDependencies": {
|
|
56
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
57
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
52
|
+
"@vaadin/chai-plugins": "25.0.0-alpha12",
|
|
53
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha12",
|
|
58
54
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
55
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha12",
|
|
59
56
|
"sinon": "^18.0.0"
|
|
60
57
|
},
|
|
61
58
|
"web-types": [
|
|
62
59
|
"web-types.json",
|
|
63
60
|
"web-types.lit.json"
|
|
64
61
|
],
|
|
65
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "e75527348f9ba7c363d068c868b9f030c15b84a1"
|
|
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
|
|
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
|
|
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`
|
|
@@ -64,8 +64,7 @@ export declare class SelectBaseMixinClass {
|
|
|
64
64
|
* Custom function for rendering the content of the `<vaadin-select>`.
|
|
65
65
|
* Receives two arguments:
|
|
66
66
|
*
|
|
67
|
-
* - `root` The
|
|
68
|
-
* DOM element. Append your content to it.
|
|
67
|
+
* - `root` The internal container DOM element. Append your content to it.
|
|
69
68
|
* - `select` The reference to the `<vaadin-select>` element.
|
|
70
69
|
*/
|
|
71
70
|
renderer: SelectRenderer | undefined;
|
|
@@ -72,8 +72,7 @@ export const SelectBaseMixin = (superClass) =>
|
|
|
72
72
|
* Custom function for rendering the content of the `<vaadin-select>`.
|
|
73
73
|
* Receives two arguments:
|
|
74
74
|
*
|
|
75
|
-
* - `root` The
|
|
76
|
-
* DOM element. Append your content to it.
|
|
75
|
+
* - `root` The internal container DOM element. Append your content to it.
|
|
77
76
|
* - `select` The reference to the `<vaadin-select>` element.
|
|
78
77
|
* @type {!SelectRenderer | undefined}
|
|
79
78
|
*/
|
|
@@ -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-
|
|
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-
|
|
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
|
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
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.
|
package/src/vaadin-select.d.ts
CHANGED
|
@@ -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
|
|
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;
|
|
@@ -160,12 +159,9 @@ export interface SelectEventMap extends HTMLElementEventMap, SelectCustomEventMa
|
|
|
160
159
|
* In addition to `<vaadin-select>` itself, the following internal
|
|
161
160
|
* components are themable:
|
|
162
161
|
*
|
|
163
|
-
* - `<vaadin-select-overlay>` - has the same API as [`<vaadin-overlay>`](#/elements/vaadin-overlay).
|
|
164
162
|
* - `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](#/elements/vaadin-button).
|
|
165
|
-
* - [`<vaadin-
|
|
166
|
-
*
|
|
167
|
-
* Note: the `theme` attribute value set on `<vaadin-select>` is
|
|
168
|
-
* propagated to the internal components listed above.
|
|
163
|
+
* - `<vaadin-select-list-box>` - has the same API as [`<vaadin-list-box>`](#/elements/vaadin-list-box).
|
|
164
|
+
* - `<vaadin-select-item>` - has the same API as [`<vaadin-item>`](#/elements/vaadin-item).
|
|
169
165
|
*
|
|
170
166
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
171
167
|
*
|
package/src/vaadin-select.js
CHANGED
|
@@ -17,7 +17,7 @@ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
|
17
17
|
import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
|
|
18
18
|
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
19
19
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
20
|
-
import { selectStyles } from './styles/vaadin-select-
|
|
20
|
+
import { selectStyles } from './styles/vaadin-select-base-styles.js';
|
|
21
21
|
import { SelectBaseMixin } from './vaadin-select-base-mixin.js';
|
|
22
22
|
|
|
23
23
|
/**
|
|
@@ -114,12 +114,9 @@ import { SelectBaseMixin } from './vaadin-select-base-mixin.js';
|
|
|
114
114
|
* In addition to `<vaadin-select>` itself, the following internal
|
|
115
115
|
* components are themable:
|
|
116
116
|
*
|
|
117
|
-
* - `<vaadin-select-overlay>` - has the same API as [`<vaadin-overlay>`](#/elements/vaadin-overlay).
|
|
118
117
|
* - `<vaadin-select-value-button>` - has the same API as [`<vaadin-button>`](#/elements/vaadin-button).
|
|
119
|
-
* - [`<vaadin-
|
|
120
|
-
*
|
|
121
|
-
* Note: the `theme` attribute value set on `<vaadin-select>` is
|
|
122
|
-
* propagated to the internal components listed above.
|
|
118
|
+
* - `<vaadin-select-list-box>` - has the same API as [`<vaadin-list-box>`](#/elements/vaadin-list-box).
|
|
119
|
+
* - `<vaadin-select-item>` - has the same API as [`<vaadin-item>`](#/elements/vaadin-item).
|
|
123
120
|
*
|
|
124
121
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
125
122
|
*
|
package/vaadin-select.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import './
|
|
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-
|
|
4
|
+
"version": "25.0.0-alpha12",
|
|
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-
|
|
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-alpha12/#/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-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha12/#/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-alpha12/#/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-alpha12/#/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",
|
|
@@ -346,7 +346,7 @@
|
|
|
346
346
|
},
|
|
347
347
|
{
|
|
348
348
|
"name": "renderer",
|
|
349
|
-
"description": "Custom function for rendering the content of the `<vaadin-select>`.\nReceives two arguments:\n\n- `root` The
|
|
349
|
+
"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
350
|
"value": {
|
|
351
351
|
"type": [
|
|
352
352
|
"SelectRenderer",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/select",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha12",
|
|
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-
|
|
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-alpha12/#/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-value-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha12/#/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-alpha12/#/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-alpha12/#/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
|
{
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
"name": ".renderer",
|
|
129
|
-
"description": "Custom function for rendering the content of the `<vaadin-select>`.\nReceives two arguments:\n\n- `root` The
|
|
129
|
+
"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
130
|
"value": {
|
|
131
131
|
"kind": "expression"
|
|
132
132
|
}
|
|
@@ -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' });
|