@vaadin/multi-select-combo-box 24.8.0-alpha9 → 25.0.0-alpha1
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 +15 -18
- package/src/vaadin-multi-select-combo-box-chip.js +15 -10
- package/src/vaadin-multi-select-combo-box-container.js +26 -34
- package/src/vaadin-multi-select-combo-box-internal.js +19 -14
- package/src/vaadin-multi-select-combo-box-item.js +17 -12
- package/src/vaadin-multi-select-combo-box-mixin.d.ts +0 -2
- package/src/vaadin-multi-select-combo-box-mixin.js +11 -10
- package/src/vaadin-multi-select-combo-box-overlay.js +12 -8
- package/src/vaadin-multi-select-combo-box-scroller.js +28 -23
- package/src/vaadin-multi-select-combo-box-styles.js +1 -0
- package/src/vaadin-multi-select-combo-box.d.ts +1 -3
- package/src/vaadin-multi-select-combo-box.js +75 -42
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
- package/src/vaadin-lit-multi-select-combo-box-chip.js +0 -79
- package/src/vaadin-lit-multi-select-combo-box-container.js +0 -66
- package/src/vaadin-lit-multi-select-combo-box-internal.js +0 -56
- package/src/vaadin-lit-multi-select-combo-box-item.js +0 -50
- package/src/vaadin-lit-multi-select-combo-box-overlay.js +0 -64
- package/src/vaadin-lit-multi-select-combo-box-scroller.js +0 -96
- package/src/vaadin-lit-multi-select-combo-box.d.ts +0 -1
- package/src/vaadin-lit-multi-select-combo-box.js +0 -146
- package/theme/lumo/vaadin-lit-multi-select-combo-box.d.ts +0 -3
- package/theme/lumo/vaadin-lit-multi-select-combo-box.js +0 -3
- package/theme/material/vaadin-lit-multi-select-combo-box.d.ts +0 -3
- package/theme/material/vaadin-lit-multi-select-combo-box.js +0 -3
- package/theme/material/vaadin-multi-select-combo-box-chip-styles.d.ts +0 -8
- package/theme/material/vaadin-multi-select-combo-box-chip-styles.js +0 -102
- package/theme/material/vaadin-multi-select-combo-box-styles.d.ts +0 -9
- package/theme/material/vaadin-multi-select-combo-box-styles.js +0 -92
- package/theme/material/vaadin-multi-select-combo-box.d.ts +0 -8
- package/theme/material/vaadin-multi-select-combo-box.js +0 -8
- package/vaadin-lit-multi-select-combo-box.d.ts +0 -1
- package/vaadin-lit-multi-select-combo-box.js +0 -2
package/README.md
CHANGED
|
@@ -29,29 +29,6 @@ Once installed, import the component in your application:
|
|
|
29
29
|
import '@vaadin/multi-select-combo-box';
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
## Themes
|
|
33
|
-
|
|
34
|
-
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
|
|
35
|
-
The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/multi-select-combo-box/vaadin-multi-select-combo-box.js) of the package uses the Lumo theme.
|
|
36
|
-
|
|
37
|
-
To use the Material theme, import the component from the `theme/material` folder:
|
|
38
|
-
|
|
39
|
-
```js
|
|
40
|
-
import '@vaadin/multi-select-combo-box/theme/material/vaadin-multi-select-combo-box.js';
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
You can also import the Lumo version of the component explicitly:
|
|
44
|
-
|
|
45
|
-
```js
|
|
46
|
-
import '@vaadin/multi-select-combo-box/theme/lumo/vaadin-multi-select-combo-box.js';
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
|
|
50
|
-
|
|
51
|
-
```js
|
|
52
|
-
import '@vaadin/multi-select-combo-box/src/vaadin-multi-select-combo-box.js';
|
|
53
|
-
```
|
|
54
|
-
|
|
55
32
|
## Contributing
|
|
56
33
|
|
|
57
34
|
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/multi-select-combo-box",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0-alpha1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,28 +33,25 @@
|
|
|
33
33
|
"Vaadin",
|
|
34
34
|
"multi-select-combo-box",
|
|
35
35
|
"web-components",
|
|
36
|
-
"web-component"
|
|
37
|
-
"polymer"
|
|
36
|
+
"web-component"
|
|
38
37
|
],
|
|
39
38
|
"dependencies": {
|
|
40
39
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
41
|
-
"@
|
|
42
|
-
"@vaadin/
|
|
43
|
-
"@vaadin/
|
|
44
|
-
"@vaadin/
|
|
45
|
-
"@vaadin/
|
|
46
|
-
"@vaadin/
|
|
47
|
-
"@vaadin/
|
|
48
|
-
"@vaadin/
|
|
49
|
-
"@vaadin/
|
|
50
|
-
"@vaadin/vaadin-
|
|
51
|
-
"@vaadin/vaadin-material-styles": "24.8.0-alpha9",
|
|
52
|
-
"@vaadin/vaadin-themable-mixin": "24.8.0-alpha9",
|
|
40
|
+
"@vaadin/a11y-base": "25.0.0-alpha1",
|
|
41
|
+
"@vaadin/combo-box": "25.0.0-alpha1",
|
|
42
|
+
"@vaadin/component-base": "25.0.0-alpha1",
|
|
43
|
+
"@vaadin/field-base": "25.0.0-alpha1",
|
|
44
|
+
"@vaadin/input-container": "25.0.0-alpha1",
|
|
45
|
+
"@vaadin/item": "25.0.0-alpha1",
|
|
46
|
+
"@vaadin/lit-renderer": "25.0.0-alpha1",
|
|
47
|
+
"@vaadin/overlay": "25.0.0-alpha1",
|
|
48
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha1",
|
|
49
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha1",
|
|
53
50
|
"lit": "^3.0.0"
|
|
54
51
|
},
|
|
55
52
|
"devDependencies": {
|
|
56
|
-
"@vaadin/chai-plugins": "
|
|
57
|
-
"@vaadin/test-runner-commands": "
|
|
53
|
+
"@vaadin/chai-plugins": "25.0.0-alpha1",
|
|
54
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha1",
|
|
58
55
|
"@vaadin/testing-helpers": "^1.1.0",
|
|
59
56
|
"sinon": "^18.0.0"
|
|
60
57
|
},
|
|
@@ -62,5 +59,5 @@
|
|
|
62
59
|
"web-types.json",
|
|
63
60
|
"web-types.lit.json"
|
|
64
61
|
],
|
|
65
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "b8c22a4a0c64156210d0daac96b43ae4e5526d49"
|
|
66
63
|
}
|
|
@@ -3,15 +3,12 @@
|
|
|
3
3
|
* Copyright (c) 2021 - 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 { html,
|
|
6
|
+
import { html, LitElement } from 'lit';
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
-
import {
|
|
8
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
9
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
10
|
import { multiSelectComboBoxChip } from './vaadin-multi-select-combo-box-styles.js';
|
|
10
11
|
|
|
11
|
-
registerStyles('vaadin-multi-select-combo-box-chip', multiSelectComboBoxChip, {
|
|
12
|
-
moduleId: 'vaadin-multi-select-combo-box-chip',
|
|
13
|
-
});
|
|
14
|
-
|
|
15
12
|
/**
|
|
16
13
|
* An element used by `<vaadin-multi-select-combo-box>` to display selected items.
|
|
17
14
|
*
|
|
@@ -30,25 +27,32 @@ registerStyles('vaadin-multi-select-combo-box-chip', multiSelectComboBoxChip, {
|
|
|
30
27
|
* @extends HTMLElement
|
|
31
28
|
* @private
|
|
32
29
|
*/
|
|
33
|
-
class MultiSelectComboBoxChip extends ThemableMixin(
|
|
30
|
+
class MultiSelectComboBoxChip extends ThemableMixin(PolylitMixin(LitElement)) {
|
|
34
31
|
static get is() {
|
|
35
32
|
return 'vaadin-multi-select-combo-box-chip';
|
|
36
33
|
}
|
|
37
34
|
|
|
35
|
+
static get styles() {
|
|
36
|
+
return multiSelectComboBoxChip;
|
|
37
|
+
}
|
|
38
|
+
|
|
38
39
|
static get properties() {
|
|
39
40
|
return {
|
|
40
41
|
disabled: {
|
|
41
42
|
type: Boolean,
|
|
42
43
|
reflectToAttribute: true,
|
|
44
|
+
sync: true,
|
|
43
45
|
},
|
|
44
46
|
|
|
45
47
|
readonly: {
|
|
46
48
|
type: Boolean,
|
|
47
49
|
reflectToAttribute: true,
|
|
50
|
+
sync: true,
|
|
48
51
|
},
|
|
49
52
|
|
|
50
53
|
label: {
|
|
51
54
|
type: String,
|
|
55
|
+
sync: true,
|
|
52
56
|
},
|
|
53
57
|
|
|
54
58
|
item: {
|
|
@@ -57,10 +61,11 @@ class MultiSelectComboBoxChip extends ThemableMixin(PolymerElement) {
|
|
|
57
61
|
};
|
|
58
62
|
}
|
|
59
63
|
|
|
60
|
-
|
|
64
|
+
/** @protected */
|
|
65
|
+
render() {
|
|
61
66
|
return html`
|
|
62
|
-
<div part="label"
|
|
63
|
-
<div part="remove-button"
|
|
67
|
+
<div part="label">${this.label}</div>
|
|
68
|
+
<div part="remove-button" @click="${this._onRemoveClick}"></div>
|
|
64
69
|
`;
|
|
65
70
|
}
|
|
66
71
|
|
|
@@ -3,29 +3,9 @@
|
|
|
3
3
|
* Copyright (c) 2021 - 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 { css, html } from 'lit';
|
|
6
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
7
8
|
import { InputContainer } from '@vaadin/input-container/src/vaadin-input-container.js';
|
|
8
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
|
-
|
|
10
|
-
registerStyles(
|
|
11
|
-
'vaadin-multi-select-combo-box-container',
|
|
12
|
-
css`
|
|
13
|
-
#wrapper {
|
|
14
|
-
display: flex;
|
|
15
|
-
width: 100%;
|
|
16
|
-
min-width: 0;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
:host([auto-expand-vertically]) #wrapper {
|
|
20
|
-
flex-wrap: wrap;
|
|
21
|
-
}
|
|
22
|
-
`,
|
|
23
|
-
{
|
|
24
|
-
moduleId: 'vaadin-multi-select-combo-box-container-styles',
|
|
25
|
-
},
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
let memoizedTemplate;
|
|
29
9
|
|
|
30
10
|
/**
|
|
31
11
|
* An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
|
|
@@ -39,20 +19,21 @@ class MultiSelectComboBoxContainer extends InputContainer {
|
|
|
39
19
|
return 'vaadin-multi-select-combo-box-container';
|
|
40
20
|
}
|
|
41
21
|
|
|
42
|
-
static get
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
22
|
+
static get styles() {
|
|
23
|
+
return [
|
|
24
|
+
super.styles,
|
|
25
|
+
css`
|
|
26
|
+
#wrapper {
|
|
27
|
+
display: flex;
|
|
28
|
+
width: 100%;
|
|
29
|
+
min-width: 0;
|
|
30
|
+
}
|
|
47
31
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
wrapper.appendChild(slots[1]);
|
|
54
|
-
}
|
|
55
|
-
return memoizedTemplate;
|
|
32
|
+
:host([auto-expand-vertically]) #wrapper {
|
|
33
|
+
flex-wrap: wrap;
|
|
34
|
+
}
|
|
35
|
+
`,
|
|
36
|
+
];
|
|
56
37
|
}
|
|
57
38
|
|
|
58
39
|
static get properties() {
|
|
@@ -69,6 +50,17 @@ class MultiSelectComboBoxContainer extends InputContainer {
|
|
|
69
50
|
},
|
|
70
51
|
};
|
|
71
52
|
}
|
|
53
|
+
|
|
54
|
+
/** @protected */
|
|
55
|
+
render() {
|
|
56
|
+
return html`
|
|
57
|
+
<div id="wrapper">
|
|
58
|
+
<slot name="prefix"></slot>
|
|
59
|
+
<slot></slot>
|
|
60
|
+
</div>
|
|
61
|
+
<slot name="suffix"></slot>
|
|
62
|
+
`;
|
|
63
|
+
}
|
|
72
64
|
}
|
|
73
65
|
|
|
74
66
|
defineCustomElement(MultiSelectComboBoxContainer);
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
import './vaadin-multi-select-combo-box-item.js';
|
|
7
7
|
import './vaadin-multi-select-combo-box-overlay.js';
|
|
8
8
|
import './vaadin-multi-select-combo-box-scroller.js';
|
|
9
|
-
import { html,
|
|
9
|
+
import { css, html, LitElement } from 'lit';
|
|
10
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
10
11
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
12
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
13
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
14
|
import { MultiSelectComboBoxInternalMixin } from './vaadin-multi-select-combo-box-internal-mixin.js';
|
|
13
15
|
|
|
@@ -20,29 +22,32 @@ import { MultiSelectComboBoxInternalMixin } from './vaadin-multi-select-combo-bo
|
|
|
20
22
|
* @mixes ThemableMixin
|
|
21
23
|
* @private
|
|
22
24
|
*/
|
|
23
|
-
class MultiSelectComboBoxInternal extends MultiSelectComboBoxInternalMixin(ThemableMixin(
|
|
25
|
+
class MultiSelectComboBoxInternal extends MultiSelectComboBoxInternalMixin(ThemableMixin(PolylitMixin(LitElement))) {
|
|
24
26
|
static get is() {
|
|
25
27
|
return 'vaadin-multi-select-combo-box-internal';
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
static get
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
static get styles() {
|
|
31
|
+
return css`
|
|
32
|
+
:host([opened]) {
|
|
33
|
+
pointer-events: auto;
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
}
|
|
35
37
|
|
|
38
|
+
/** @protected */
|
|
39
|
+
render() {
|
|
40
|
+
return html`
|
|
36
41
|
<slot></slot>
|
|
37
42
|
|
|
38
43
|
<vaadin-multi-select-combo-box-overlay
|
|
39
44
|
id="overlay"
|
|
40
|
-
opened="
|
|
41
|
-
loading
|
|
42
|
-
theme
|
|
43
|
-
|
|
45
|
+
.opened="${this._overlayOpened}"
|
|
46
|
+
?loading="${this.loading}"
|
|
47
|
+
theme="${ifDefined(this._theme)}"
|
|
48
|
+
.positionTarget="${this._target}"
|
|
44
49
|
no-vertical-overlap
|
|
45
|
-
|
|
50
|
+
.restoreFocusNode="${this.inputElement}"
|
|
46
51
|
></vaadin-multi-select-combo-box-overlay>
|
|
47
52
|
`;
|
|
48
53
|
}
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
* Copyright (c) 2021 - 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 { html,
|
|
6
|
+
import { css, html, LitElement } from 'lit';
|
|
7
7
|
import { ComboBoxItemMixin } from '@vaadin/combo-box/src/vaadin-combo-box-item-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
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
11
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -36,22 +37,26 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
36
37
|
* @mixes DirMixin
|
|
37
38
|
* @private
|
|
38
39
|
*/
|
|
39
|
-
export class MultiSelectComboBoxItem extends ComboBoxItemMixin(ThemableMixin(DirMixin(
|
|
40
|
+
export class MultiSelectComboBoxItem extends ComboBoxItemMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))) {
|
|
40
41
|
static get is() {
|
|
41
42
|
return 'vaadin-multi-select-combo-box-item';
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
static get
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
:
|
|
48
|
-
|
|
49
|
-
}
|
|
45
|
+
static get styles() {
|
|
46
|
+
return css`
|
|
47
|
+
:host {
|
|
48
|
+
display: block;
|
|
49
|
+
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
:host([hidden]) {
|
|
52
|
+
display: none !important;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** @protected */
|
|
58
|
+
render() {
|
|
59
|
+
return html`
|
|
55
60
|
<span part="checkmark" aria-hidden="true"></span>
|
|
56
61
|
<div part="content">
|
|
57
62
|
<slot></slot>
|
|
@@ -9,7 +9,6 @@ import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js
|
|
|
9
9
|
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 { ComboBoxDataProvider, ComboBoxItemModel } from '@vaadin/combo-box/src/vaadin-combo-box.js';
|
|
12
|
-
import type { ControllerMixinClass } from '@vaadin/component-base/src/controller-mixin.js';
|
|
13
12
|
import type { DelegateStateMixinClass } from '@vaadin/component-base/src/delegate-state-mixin.js';
|
|
14
13
|
import type { ResizeMixinClass } from '@vaadin/component-base/src/resize-mixin.js';
|
|
15
14
|
import type { SlotStylesMixinClass } from '@vaadin/component-base/src/slot-styles-mixin.js';
|
|
@@ -39,7 +38,6 @@ export interface MultiSelectComboBoxI18n {
|
|
|
39
38
|
export declare function MultiSelectComboBoxMixin<TItem, T extends Constructor<HTMLElement>>(
|
|
40
39
|
base: T,
|
|
41
40
|
): Constructor<ClearButtonMixinClass> &
|
|
42
|
-
Constructor<ControllerMixinClass> &
|
|
43
41
|
Constructor<DelegateFocusMixinClass> &
|
|
44
42
|
Constructor<DelegateStateMixinClass> &
|
|
45
43
|
Constructor<DisabledMixinClass> &
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import { announce } from '@vaadin/a11y-base/src/announce.js';
|
|
7
7
|
import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
|
|
8
8
|
import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
|
|
9
|
-
import { processTemplates } from '@vaadin/component-base/src/templates.js';
|
|
10
9
|
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
11
10
|
import { InputControlMixin } from '@vaadin/field-base/src/input-control-mixin.js';
|
|
12
11
|
import { InputController } from '@vaadin/field-base/src/input-controller.js';
|
|
@@ -271,6 +270,7 @@ export const MultiSelectComboBoxMixin = (superClass) =>
|
|
|
271
270
|
placeholder: {
|
|
272
271
|
type: String,
|
|
273
272
|
observer: '_placeholderChanged',
|
|
273
|
+
reflectToAttribute: true,
|
|
274
274
|
sync: true,
|
|
275
275
|
},
|
|
276
276
|
|
|
@@ -430,8 +430,6 @@ export const MultiSelectComboBoxMixin = (superClass) =>
|
|
|
430
430
|
this.addController(this._overflowController);
|
|
431
431
|
|
|
432
432
|
this.__updateChips();
|
|
433
|
-
|
|
434
|
-
processTemplates(this);
|
|
435
433
|
}
|
|
436
434
|
|
|
437
435
|
/**
|
|
@@ -877,14 +875,17 @@ export const MultiSelectComboBoxMixin = (superClass) =>
|
|
|
877
875
|
this.insertBefore(chip, refNode);
|
|
878
876
|
|
|
879
877
|
// When auto expanding vertically, no need to measure remaining width
|
|
880
|
-
if (!this.autoExpandVertically
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
chip
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
878
|
+
if (!this.autoExpandVertically) {
|
|
879
|
+
if (this.$.chips.clientWidth > remainingWidth) {
|
|
880
|
+
// If there is no more space for chips, or if there is at least one
|
|
881
|
+
// chip already shown, collapse all remaining chips to the overflow
|
|
882
|
+
if (remainingWidth < chipMinWidth || refNode !== null) {
|
|
883
|
+
chip.remove();
|
|
884
|
+
break;
|
|
885
|
+
}
|
|
887
886
|
}
|
|
887
|
+
|
|
888
|
+
chip.style.maxWidth = `${remainingWidth}px`;
|
|
888
889
|
}
|
|
889
890
|
|
|
890
891
|
items.pop();
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
* Copyright (c) 2021 - 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 { html,
|
|
6
|
+
import { css, html, LitElement } from 'lit';
|
|
7
7
|
import { ComboBoxOverlayMixin } from '@vaadin/combo-box/src/vaadin-combo-box-overlay-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
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
11
|
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
11
12
|
import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
|
|
12
|
-
import {
|
|
13
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
14
|
|
|
14
15
|
const multiSelectComboBoxOverlayStyles = css`
|
|
15
16
|
#overlay {
|
|
@@ -26,10 +27,6 @@ const multiSelectComboBoxOverlayStyles = css`
|
|
|
26
27
|
}
|
|
27
28
|
`;
|
|
28
29
|
|
|
29
|
-
registerStyles('vaadin-multi-select-combo-box-overlay', [overlayStyles, multiSelectComboBoxOverlayStyles], {
|
|
30
|
-
moduleId: 'vaadin-multi-select-combo-box-overlay-styles',
|
|
31
|
-
});
|
|
32
|
-
|
|
33
30
|
/**
|
|
34
31
|
* An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
|
|
35
32
|
*
|
|
@@ -41,12 +38,19 @@ registerStyles('vaadin-multi-select-combo-box-overlay', [overlayStyles, multiSel
|
|
|
41
38
|
* @mixes ThemableMixin
|
|
42
39
|
* @private
|
|
43
40
|
*/
|
|
44
|
-
class MultiSelectComboBoxOverlay extends ComboBoxOverlayMixin(
|
|
41
|
+
class MultiSelectComboBoxOverlay extends ComboBoxOverlayMixin(
|
|
42
|
+
OverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))),
|
|
43
|
+
) {
|
|
45
44
|
static get is() {
|
|
46
45
|
return 'vaadin-multi-select-combo-box-overlay';
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
static get
|
|
48
|
+
static get styles() {
|
|
49
|
+
return [overlayStyles, multiSelectComboBoxOverlayStyles];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** @protected */
|
|
53
|
+
render() {
|
|
50
54
|
return html`
|
|
51
55
|
<div id="backdrop" part="backdrop" hidden></div>
|
|
52
56
|
<div part="overlay" id="overlay">
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
* Copyright (c) 2021 - 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 { html,
|
|
6
|
+
import { css, html, LitElement } from 'lit';
|
|
7
7
|
import { ComboBoxPlaceholder } from '@vaadin/combo-box/src/vaadin-combo-box-placeholder.js';
|
|
8
8
|
import { ComboBoxScrollerMixin } from '@vaadin/combo-box/src/vaadin-combo-box-scroller-mixin.js';
|
|
9
9
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
|
|
@@ -16,36 +17,40 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
|
16
17
|
* @mixes ComboBoxScrollerMixin
|
|
17
18
|
* @private
|
|
18
19
|
*/
|
|
19
|
-
export class MultiSelectComboBoxScroller extends ComboBoxScrollerMixin(
|
|
20
|
+
export class MultiSelectComboBoxScroller extends ComboBoxScrollerMixin(PolylitMixin(LitElement)) {
|
|
20
21
|
static get is() {
|
|
21
22
|
return 'vaadin-multi-select-combo-box-scroller';
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
static get
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
static get styles() {
|
|
26
|
+
return css`
|
|
27
|
+
:host {
|
|
28
|
+
display: block;
|
|
29
|
+
min-height: 1px;
|
|
30
|
+
overflow: auto;
|
|
31
|
+
|
|
32
|
+
/* Fixes item background from getting on top of scrollbars on Safari */
|
|
33
|
+
transform: translate3d(0, 0, 0);
|
|
31
34
|
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
/* Enable momentum scrolling on iOS */
|
|
36
|
+
-webkit-overflow-scrolling: touch;
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
/* Fixes scrollbar disappearing when 'Show scroll bars: Always' enabled in Safari */
|
|
39
|
+
box-shadow: 0 0 0 white;
|
|
40
|
+
}
|
|
37
41
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
#selector {
|
|
43
|
+
border-width: var(--_vaadin-multi-select-combo-box-items-container-border-width);
|
|
44
|
+
border-style: var(--_vaadin-multi-select-combo-box-items-container-border-style);
|
|
45
|
+
border-color: var(--_vaadin-multi-select-combo-box-items-container-border-color, transparent);
|
|
46
|
+
position: relative;
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
41
50
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
border-color: var(--_vaadin-multi-select-combo-box-items-container-border-color, transparent);
|
|
46
|
-
position: relative;
|
|
47
|
-
}
|
|
48
|
-
</style>
|
|
51
|
+
/** @protected */
|
|
52
|
+
render() {
|
|
53
|
+
return html`
|
|
49
54
|
<div id="selector">
|
|
50
55
|
<slot></slot>
|
|
51
56
|
</div>
|
|
@@ -7,6 +7,7 @@ import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
|
7
7
|
|
|
8
8
|
export const multiSelectComboBox = css`
|
|
9
9
|
:host {
|
|
10
|
+
max-width: 100%;
|
|
10
11
|
--input-min-width: var(--vaadin-multi-select-combo-box-input-min-width, 4em);
|
|
11
12
|
--_chip-min-width: var(--vaadin-multi-select-combo-box-chip-min-width, 50px);
|
|
12
13
|
}
|
|
@@ -8,7 +8,6 @@ import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js
|
|
|
8
8
|
import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
9
9
|
import type { KeyboardMixinClass } from '@vaadin/a11y-base/src/keyboard-mixin.js';
|
|
10
10
|
import type { ComboBoxDefaultItem } from '@vaadin/combo-box/src/vaadin-combo-box.js';
|
|
11
|
-
import type { ControllerMixinClass } from '@vaadin/component-base/src/controller-mixin.js';
|
|
12
11
|
import type { DelegateStateMixinClass } from '@vaadin/component-base/src/delegate-state-mixin.js';
|
|
13
12
|
import type { ElementMixinClass } from '@vaadin/component-base/src/element-mixin.js';
|
|
14
13
|
import type { ResizeMixinClass } from '@vaadin/component-base/src/resize-mixin.js';
|
|
@@ -188,8 +187,7 @@ interface MultiSelectComboBox<TItem = ComboBoxDefaultItem>
|
|
|
188
187
|
ResizeMixinClass,
|
|
189
188
|
ThemableMixinClass,
|
|
190
189
|
ThemePropertyMixinClass,
|
|
191
|
-
ElementMixinClass
|
|
192
|
-
ControllerMixinClass {}
|
|
190
|
+
ElementMixinClass {}
|
|
193
191
|
|
|
194
192
|
declare global {
|
|
195
193
|
interface HTMLElementTagNameMap {
|