@vaadin/combo-box 24.8.4 → 25.0.0-alpha10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -23
- package/package.json +17 -19
- package/src/styles/vaadin-combo-box-base-styles.d.ts +8 -0
- package/src/styles/vaadin-combo-box-base-styles.js +17 -0
- package/src/styles/vaadin-combo-box-core-styles.d.ts +8 -0
- package/src/styles/vaadin-combo-box-core-styles.js +12 -0
- package/src/styles/vaadin-combo-box-overlay-base-styles.js +46 -0
- package/src/styles/vaadin-combo-box-overlay-core-styles.js +18 -0
- package/src/styles/vaadin-combo-box-scroller-base-styles.js +29 -0
- package/src/styles/vaadin-combo-box-scroller-core-styles.js +27 -0
- package/src/vaadin-combo-box-base-mixin.d.ts +56 -0
- package/src/vaadin-combo-box-base-mixin.js +776 -0
- package/src/vaadin-combo-box-data-provider-mixin.js +17 -32
- package/src/vaadin-combo-box-item-mixin.js +6 -1
- package/src/vaadin-combo-box-item.js +17 -16
- package/src/vaadin-combo-box-items-mixin.d.ts +53 -0
- package/src/vaadin-combo-box-items-mixin.js +275 -0
- package/src/vaadin-combo-box-mixin.d.ts +3 -72
- package/src/vaadin-combo-box-mixin.js +84 -922
- package/src/vaadin-combo-box-overlay-mixin.js +1 -22
- package/src/vaadin-combo-box-overlay.js +15 -22
- package/src/vaadin-combo-box-scroller.js +10 -26
- package/src/vaadin-combo-box.d.ts +12 -14
- package/src/vaadin-combo-box.js +81 -53
- package/web-types.json +51 -536
- package/web-types.lit.json +17 -262
- package/src/vaadin-combo-box-light-mixin.d.ts +0 -26
- package/src/vaadin-combo-box-light-mixin.js +0 -131
- package/src/vaadin-combo-box-light.d.ts +0 -161
- package/src/vaadin-combo-box-light.js +0 -94
- package/src/vaadin-lit-combo-box-item.js +0 -68
- package/src/vaadin-lit-combo-box-light.js +0 -57
- package/src/vaadin-lit-combo-box-overlay.js +0 -60
- package/src/vaadin-lit-combo-box-scroller.js +0 -59
- package/src/vaadin-lit-combo-box.js +0 -169
- package/theme/lumo/vaadin-combo-box-light.d.ts +0 -3
- package/theme/lumo/vaadin-combo-box-light.js +0 -3
- package/theme/lumo/vaadin-lit-combo-box-light.d.ts +0 -3
- package/theme/lumo/vaadin-lit-combo-box-light.js +0 -3
- package/theme/lumo/vaadin-lit-combo-box.d.ts +0 -4
- package/theme/lumo/vaadin-lit-combo-box.js +0 -4
- package/theme/material/vaadin-combo-box-item-styles.d.ts +0 -5
- package/theme/material/vaadin-combo-box-item-styles.js +0 -20
- package/theme/material/vaadin-combo-box-light.d.ts +0 -3
- package/theme/material/vaadin-combo-box-light.js +0 -3
- package/theme/material/vaadin-combo-box-overlay-styles.d.ts +0 -4
- package/theme/material/vaadin-combo-box-overlay-styles.js +0 -51
- package/theme/material/vaadin-combo-box-styles.d.ts +0 -3
- package/theme/material/vaadin-combo-box-styles.js +0 -21
- package/theme/material/vaadin-combo-box.d.ts +0 -4
- package/theme/material/vaadin-combo-box.js +0 -4
- package/theme/material/vaadin-lit-combo-box-light.d.ts +0 -3
- package/theme/material/vaadin-lit-combo-box-light.js +0 -3
- package/theme/material/vaadin-lit-combo-box.d.ts +0 -4
- package/theme/material/vaadin-lit-combo-box.js +0 -4
- package/vaadin-combo-box-light.d.ts +0 -1
- package/vaadin-combo-box-light.js +0 -2
- package/vaadin-lit-combo-box-light.d.ts +0 -1
- package/vaadin-lit-combo-box-light.js +0 -2
- package/vaadin-lit-combo-box.d.ts +0 -1
- package/vaadin-lit-combo-box.js +0 -2
package/README.md
CHANGED
|
@@ -39,29 +39,6 @@ Once installed, import the component in your application:
|
|
|
39
39
|
import '@vaadin/combo-box';
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
## Themes
|
|
43
|
-
|
|
44
|
-
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
|
|
45
|
-
The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/combo-box/vaadin-combo-box.js) of the package uses the Lumo theme.
|
|
46
|
-
|
|
47
|
-
To use the Material theme, import the component from the `theme/material` folder:
|
|
48
|
-
|
|
49
|
-
```js
|
|
50
|
-
import '@vaadin/combo-box/theme/material/vaadin-combo-box.js';
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
You can also import the Lumo version of the component explicitly:
|
|
54
|
-
|
|
55
|
-
```js
|
|
56
|
-
import '@vaadin/combo-box/theme/lumo/vaadin-combo-box.js';
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
|
|
60
|
-
|
|
61
|
-
```js
|
|
62
|
-
import '@vaadin/combo-box/src/vaadin-combo-box.js';
|
|
63
|
-
```
|
|
64
|
-
|
|
65
42
|
## Contributing
|
|
66
43
|
|
|
67
44
|
Read the [contributing guide](https://vaadin.com/docs/latest/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/combo-box",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0-alpha10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -22,6 +22,8 @@
|
|
|
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",
|
|
25
27
|
"theme",
|
|
26
28
|
"vaadin-*.d.ts",
|
|
27
29
|
"vaadin-*.js",
|
|
@@ -32,34 +34,30 @@
|
|
|
32
34
|
"Vaadin",
|
|
33
35
|
"combo-box",
|
|
34
36
|
"web-components",
|
|
35
|
-
"web-component"
|
|
36
|
-
"polymer"
|
|
37
|
+
"web-component"
|
|
37
38
|
],
|
|
38
39
|
"dependencies": {
|
|
39
40
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
40
|
-
"@
|
|
41
|
-
"@vaadin/
|
|
42
|
-
"@vaadin/
|
|
43
|
-
"@vaadin/
|
|
44
|
-
"@vaadin/
|
|
45
|
-
"@vaadin/
|
|
46
|
-
"@vaadin/
|
|
47
|
-
"@vaadin/
|
|
48
|
-
"@vaadin/vaadin-
|
|
49
|
-
"@vaadin/vaadin-material-styles": "~24.8.4",
|
|
50
|
-
"@vaadin/vaadin-themable-mixin": "~24.8.4",
|
|
41
|
+
"@vaadin/a11y-base": "25.0.0-alpha10",
|
|
42
|
+
"@vaadin/component-base": "25.0.0-alpha10",
|
|
43
|
+
"@vaadin/field-base": "25.0.0-alpha10",
|
|
44
|
+
"@vaadin/input-container": "25.0.0-alpha10",
|
|
45
|
+
"@vaadin/item": "25.0.0-alpha10",
|
|
46
|
+
"@vaadin/lit-renderer": "25.0.0-alpha10",
|
|
47
|
+
"@vaadin/overlay": "25.0.0-alpha10",
|
|
48
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha10",
|
|
49
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha10",
|
|
51
50
|
"lit": "^3.0.0"
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
54
|
-
"@vaadin/chai-plugins": "
|
|
55
|
-
"@vaadin/test-runner-commands": "
|
|
56
|
-
"@vaadin/testing-helpers": "^
|
|
57
|
-
"@vaadin/text-field": "~24.8.4",
|
|
53
|
+
"@vaadin/chai-plugins": "25.0.0-alpha10",
|
|
54
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha10",
|
|
55
|
+
"@vaadin/testing-helpers": "^2.0.0",
|
|
58
56
|
"sinon": "^18.0.0"
|
|
59
57
|
},
|
|
60
58
|
"web-types": [
|
|
61
59
|
"web-types.json",
|
|
62
60
|
"web-types.lit.json"
|
|
63
61
|
],
|
|
64
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
|
|
65
63
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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 '@vaadin/component-base/src/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
|
|
9
|
+
export const comboBoxStyles = css`
|
|
10
|
+
:host([opened]) {
|
|
11
|
+
pointer-events: auto;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
[part='toggle-button']::before {
|
|
15
|
+
mask-image: var(--_vaadin-icon-chevron-down);
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
`;
|
|
@@ -0,0 +1,46 @@
|
|
|
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 '@vaadin/component-base/src/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
import { loaderStyles } from '@vaadin/component-base/src/loader-styles.js';
|
|
9
|
+
|
|
10
|
+
export const comboBoxOverlayStyles = [
|
|
11
|
+
loaderStyles,
|
|
12
|
+
css`
|
|
13
|
+
:host {
|
|
14
|
+
--vaadin-item-checkmark-display: block;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
[part='overlay'] {
|
|
18
|
+
position: relative;
|
|
19
|
+
width: var(--vaadin-combo-box-overlay-width, var(--_vaadin-combo-box-overlay-default-width, auto));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[part='content'] {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
height: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host([loading]) [part='content'] {
|
|
29
|
+
--_items-min-height: calc(var(--vaadin-icon-size, 1lh) + 4px);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@media (forced-colors: active) {
|
|
33
|
+
[part='loader'] {
|
|
34
|
+
forced-color-adjust: none;
|
|
35
|
+
--vaadin-combo-box-spinner-color: CanvasText;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[part='loader'] {
|
|
40
|
+
position: absolute;
|
|
41
|
+
inset: calc(var(--vaadin-item-overlay-padding, 4px) + 2px);
|
|
42
|
+
inset-block-end: auto;
|
|
43
|
+
inset-inline-start: auto;
|
|
44
|
+
}
|
|
45
|
+
`,
|
|
46
|
+
];
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
`;
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
/* Fixes scrollbar disappearing when 'Show scroll bars: Always' enabled in Safari */
|
|
11
|
+
box-shadow: 0 0 0 white;
|
|
12
|
+
display: block;
|
|
13
|
+
min-height: 1px;
|
|
14
|
+
overflow: auto;
|
|
15
|
+
/* Fixes item background from getting on top of scrollbars on Safari */
|
|
16
|
+
transform: translate3d(0, 0, 0);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
#selector {
|
|
20
|
+
border: var(--vaadin-item-overlay-padding, 4px) solid transparent;
|
|
21
|
+
position: relative;
|
|
22
|
+
forced-color-adjust: none;
|
|
23
|
+
min-height: var(--_items-min-height, auto);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
#selector > * {
|
|
27
|
+
forced-color-adjust: auto;
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
`;
|
|
@@ -0,0 +1,56 @@
|
|
|
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 { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
|
+
import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js';
|
|
8
|
+
import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
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
|
+
import type { InputMixinClass } from '@vaadin/field-base/src/input-mixin.js';
|
|
12
|
+
import type { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.js';
|
|
13
|
+
|
|
14
|
+
export declare function ComboBoxBaseMixin<T extends Constructor<HTMLElement>>(
|
|
15
|
+
base: T,
|
|
16
|
+
): Constructor<ComboBoxBaseMixinClass> &
|
|
17
|
+
Constructor<DisabledMixinClass> &
|
|
18
|
+
Constructor<FocusMixinClass> &
|
|
19
|
+
Constructor<InputMixinClass> &
|
|
20
|
+
Constructor<KeyboardMixinClass> &
|
|
21
|
+
Constructor<OverlayClassMixinClass> &
|
|
22
|
+
Constructor<ValidateMixinClass> &
|
|
23
|
+
T;
|
|
24
|
+
|
|
25
|
+
export declare class ComboBoxBaseMixinClass {
|
|
26
|
+
/**
|
|
27
|
+
* True if the dropdown is open, false otherwise.
|
|
28
|
+
*/
|
|
29
|
+
opened: boolean;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Set true to prevent the overlay from opening automatically.
|
|
33
|
+
* @attr {boolean} auto-open-disabled
|
|
34
|
+
*/
|
|
35
|
+
autoOpenDisabled: boolean | null | undefined;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* When present, it specifies that the field is read-only.
|
|
39
|
+
*/
|
|
40
|
+
readonly: boolean;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Tag name prefix used by scroller and items.
|
|
44
|
+
*/
|
|
45
|
+
protected readonly _tagNamePrefix: string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Opens the dropdown list.
|
|
49
|
+
*/
|
|
50
|
+
open(): void;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Closes the dropdown list.
|
|
54
|
+
*/
|
|
55
|
+
close(): void;
|
|
56
|
+
}
|