@vaadin/multi-select-combo-box 24.8.4 → 24.9.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/package.json +15 -15
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
- package/src/vaadin-lit-multi-select-combo-box-chip.js +0 -88
- 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 -68
- 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.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/vaadin-lit-multi-select-combo-box.d.ts +0 -1
- package/vaadin-lit-multi-select-combo-box.js +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/multi-select-combo-box",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.9.0-alpha1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -39,22 +39,22 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
41
41
|
"@polymer/polymer": "^3.0.0",
|
|
42
|
-
"@vaadin/a11y-base": "
|
|
43
|
-
"@vaadin/combo-box": "
|
|
44
|
-
"@vaadin/component-base": "
|
|
45
|
-
"@vaadin/field-base": "
|
|
46
|
-
"@vaadin/input-container": "
|
|
47
|
-
"@vaadin/item": "
|
|
48
|
-
"@vaadin/lit-renderer": "
|
|
49
|
-
"@vaadin/overlay": "
|
|
50
|
-
"@vaadin/vaadin-lumo-styles": "
|
|
51
|
-
"@vaadin/vaadin-material-styles": "
|
|
52
|
-
"@vaadin/vaadin-themable-mixin": "
|
|
42
|
+
"@vaadin/a11y-base": "24.9.0-alpha1",
|
|
43
|
+
"@vaadin/combo-box": "24.9.0-alpha1",
|
|
44
|
+
"@vaadin/component-base": "24.9.0-alpha1",
|
|
45
|
+
"@vaadin/field-base": "24.9.0-alpha1",
|
|
46
|
+
"@vaadin/input-container": "24.9.0-alpha1",
|
|
47
|
+
"@vaadin/item": "24.9.0-alpha1",
|
|
48
|
+
"@vaadin/lit-renderer": "24.9.0-alpha1",
|
|
49
|
+
"@vaadin/overlay": "24.9.0-alpha1",
|
|
50
|
+
"@vaadin/vaadin-lumo-styles": "24.9.0-alpha1",
|
|
51
|
+
"@vaadin/vaadin-material-styles": "24.9.0-alpha1",
|
|
52
|
+
"@vaadin/vaadin-themable-mixin": "24.9.0-alpha1",
|
|
53
53
|
"lit": "^3.0.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@vaadin/chai-plugins": "
|
|
57
|
-
"@vaadin/test-runner-commands": "
|
|
56
|
+
"@vaadin/chai-plugins": "24.9.0-alpha1",
|
|
57
|
+
"@vaadin/test-runner-commands": "24.9.0-alpha1",
|
|
58
58
|
"@vaadin/testing-helpers": "^1.1.0",
|
|
59
59
|
"sinon": "^18.0.0"
|
|
60
60
|
},
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"web-types.json",
|
|
63
63
|
"web-types.lit.json"
|
|
64
64
|
],
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "cc13d59f0e3cd1a3b0c19c1a900a5308446fe7ac"
|
|
66
66
|
}
|
package/web-types.json
CHANGED
package/web-types.lit.json
CHANGED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { html, LitElement } from 'lit';
|
|
7
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
9
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
10
|
-
import { multiSelectComboBoxChip } from './vaadin-multi-select-combo-box-styles.js';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* An element used by `<vaadin-multi-select-combo-box>` to display selected items.
|
|
14
|
-
*
|
|
15
|
-
* ### Styling
|
|
16
|
-
*
|
|
17
|
-
* The following shadow DOM parts are available for styling:
|
|
18
|
-
*
|
|
19
|
-
* Part name | Description
|
|
20
|
-
* -----------------|-------------
|
|
21
|
-
* `label` | Element containing the label
|
|
22
|
-
* `remove-button` | Remove button
|
|
23
|
-
*
|
|
24
|
-
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
25
|
-
*
|
|
26
|
-
* @customElement
|
|
27
|
-
* @extends HTMLElement
|
|
28
|
-
* @private
|
|
29
|
-
*/
|
|
30
|
-
class MultiSelectComboBoxChip extends ThemableMixin(PolylitMixin(LitElement)) {
|
|
31
|
-
static get is() {
|
|
32
|
-
return 'vaadin-multi-select-combo-box-chip';
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
static get styles() {
|
|
36
|
-
return multiSelectComboBoxChip;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
static get properties() {
|
|
40
|
-
return {
|
|
41
|
-
disabled: {
|
|
42
|
-
type: Boolean,
|
|
43
|
-
reflectToAttribute: true,
|
|
44
|
-
sync: true,
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
readonly: {
|
|
48
|
-
type: Boolean,
|
|
49
|
-
reflectToAttribute: true,
|
|
50
|
-
sync: true,
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
label: {
|
|
54
|
-
type: String,
|
|
55
|
-
sync: true,
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
item: {
|
|
59
|
-
type: Object,
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/** @protected */
|
|
65
|
-
render() {
|
|
66
|
-
return html`
|
|
67
|
-
<div part="label">${this.label}</div>
|
|
68
|
-
<div part="remove-button" @click="${this._onRemoveClick}"></div>
|
|
69
|
-
`;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/** @private */
|
|
73
|
-
_onRemoveClick(event) {
|
|
74
|
-
event.stopPropagation();
|
|
75
|
-
|
|
76
|
-
this.dispatchEvent(
|
|
77
|
-
new CustomEvent('item-removed', {
|
|
78
|
-
detail: {
|
|
79
|
-
item: this.item,
|
|
80
|
-
},
|
|
81
|
-
bubbles: true,
|
|
82
|
-
composed: true,
|
|
83
|
-
}),
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
defineCustomElement(MultiSelectComboBoxChip);
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { css, html } from 'lit';
|
|
7
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
-
import { InputContainer } from '@vaadin/input-container/src/vaadin-lit-input-container.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
|
|
12
|
-
*
|
|
13
|
-
* @customElement
|
|
14
|
-
* @extends InputContainer
|
|
15
|
-
* @private
|
|
16
|
-
*/
|
|
17
|
-
class MultiSelectComboBoxContainer extends InputContainer {
|
|
18
|
-
static get is() {
|
|
19
|
-
return 'vaadin-multi-select-combo-box-container';
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
static get styles() {
|
|
23
|
-
return [
|
|
24
|
-
super.styles,
|
|
25
|
-
css`
|
|
26
|
-
#wrapper {
|
|
27
|
-
display: flex;
|
|
28
|
-
width: 100%;
|
|
29
|
-
min-width: 0;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
:host([auto-expand-vertically]) #wrapper {
|
|
33
|
-
flex-wrap: wrap;
|
|
34
|
-
}
|
|
35
|
-
`,
|
|
36
|
-
];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
static get properties() {
|
|
40
|
-
return {
|
|
41
|
-
/**
|
|
42
|
-
* Set to true to not collapse selected items chips into the overflow
|
|
43
|
-
* chip and instead always expand vertically, causing input field to
|
|
44
|
-
* wrap into multiple lines when width is limited.
|
|
45
|
-
* @attr {boolean} auto-expand-vertically
|
|
46
|
-
*/
|
|
47
|
-
autoExpandVertically: {
|
|
48
|
-
type: Boolean,
|
|
49
|
-
reflectToAttribute: true,
|
|
50
|
-
},
|
|
51
|
-
};
|
|
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
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
defineCustomElement(MultiSelectComboBoxContainer);
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import './vaadin-lit-multi-select-combo-box-item.js';
|
|
7
|
-
import './vaadin-lit-multi-select-combo-box-overlay.js';
|
|
8
|
-
import './vaadin-lit-multi-select-combo-box-scroller.js';
|
|
9
|
-
import { css, html, LitElement } from 'lit';
|
|
10
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
12
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
13
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
|
-
import { MultiSelectComboBoxInternalMixin } from './vaadin-multi-select-combo-box-internal-mixin.js';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
|
|
18
|
-
*
|
|
19
|
-
* @customElement
|
|
20
|
-
* @extends HTMLElement
|
|
21
|
-
* @mixes MultiSelectComboBoxInternalMixin
|
|
22
|
-
* @mixes ThemableMixin
|
|
23
|
-
* @private
|
|
24
|
-
*/
|
|
25
|
-
class MultiSelectComboBoxInternal extends MultiSelectComboBoxInternalMixin(ThemableMixin(PolylitMixin(LitElement))) {
|
|
26
|
-
static get is() {
|
|
27
|
-
return 'vaadin-multi-select-combo-box-internal';
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static get styles() {
|
|
31
|
-
return css`
|
|
32
|
-
:host([opened]) {
|
|
33
|
-
pointer-events: auto;
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** @protected */
|
|
39
|
-
render() {
|
|
40
|
-
return html`
|
|
41
|
-
<slot></slot>
|
|
42
|
-
|
|
43
|
-
<vaadin-multi-select-combo-box-overlay
|
|
44
|
-
id="overlay"
|
|
45
|
-
.opened="${this._overlayOpened}"
|
|
46
|
-
?loading="${this.loading}"
|
|
47
|
-
theme="${ifDefined(this._theme)}"
|
|
48
|
-
.positionTarget="${this._target}"
|
|
49
|
-
no-vertical-overlap
|
|
50
|
-
.restoreFocusNode="${this.inputElement}"
|
|
51
|
-
></vaadin-multi-select-combo-box-overlay>
|
|
52
|
-
`;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
defineCustomElement(MultiSelectComboBoxInternal);
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { css, html, LitElement } from 'lit';
|
|
7
|
-
import { ComboBoxItemMixin } from '@vaadin/combo-box/src/vaadin-combo-box-item-mixin.js';
|
|
8
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
|
-
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
10
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* An item element used by the `<vaadin-multi-select-combo-box>` dropdown.
|
|
15
|
-
*
|
|
16
|
-
* ### Styling
|
|
17
|
-
*
|
|
18
|
-
* The following shadow DOM parts are available for styling:
|
|
19
|
-
*
|
|
20
|
-
* Part name | Description
|
|
21
|
-
* ------------|--------------
|
|
22
|
-
* `checkmark` | The graphical checkmark shown for a selected item
|
|
23
|
-
* `content` | The element that wraps the item content
|
|
24
|
-
*
|
|
25
|
-
* The following state attributes are exposed for styling:
|
|
26
|
-
*
|
|
27
|
-
* Attribute | Description
|
|
28
|
-
* -------------|-------------
|
|
29
|
-
* `selected` | Set when the item is selected
|
|
30
|
-
* `focused` | Set when the item is focused
|
|
31
|
-
*
|
|
32
|
-
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
33
|
-
*
|
|
34
|
-
* @customElement
|
|
35
|
-
* @mixes ComboBoxItemMixin
|
|
36
|
-
* @mixes ThemableMixin
|
|
37
|
-
* @mixes DirMixin
|
|
38
|
-
* @private
|
|
39
|
-
*/
|
|
40
|
-
export class MultiSelectComboBoxItem extends ComboBoxItemMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))) {
|
|
41
|
-
static get is() {
|
|
42
|
-
return 'vaadin-multi-select-combo-box-item';
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
static get styles() {
|
|
46
|
-
return css`
|
|
47
|
-
:host {
|
|
48
|
-
display: block;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
:host([hidden]) {
|
|
52
|
-
display: none !important;
|
|
53
|
-
}
|
|
54
|
-
`;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** @protected */
|
|
58
|
-
render() {
|
|
59
|
-
return html`
|
|
60
|
-
<span part="checkmark" aria-hidden="true"></span>
|
|
61
|
-
<div part="content">
|
|
62
|
-
<slot></slot>
|
|
63
|
-
</div>
|
|
64
|
-
`;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
defineCustomElement(MultiSelectComboBoxItem);
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { css, html, LitElement } from 'lit';
|
|
7
|
-
import { ComboBoxOverlayMixin } from '@vaadin/combo-box/src/vaadin-combo-box-overlay-mixin.js';
|
|
8
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
|
-
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
10
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
-
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
12
|
-
import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
|
|
13
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
|
-
|
|
15
|
-
const multiSelectComboBoxOverlayStyles = css`
|
|
16
|
-
#overlay {
|
|
17
|
-
width: var(
|
|
18
|
-
--vaadin-multi-select-combo-box-overlay-width,
|
|
19
|
-
var(--_vaadin-multi-select-combo-box-overlay-default-width, auto)
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
[part='content'] {
|
|
24
|
-
display: flex;
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
height: 100%;
|
|
27
|
-
}
|
|
28
|
-
`;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
|
|
32
|
-
*
|
|
33
|
-
* @customElement
|
|
34
|
-
* @extends HTMLElement
|
|
35
|
-
* @mixes ComboBoxOverlayMixin
|
|
36
|
-
* @mixes DirMixin
|
|
37
|
-
* @mixes OverlayMixin
|
|
38
|
-
* @mixes ThemableMixin
|
|
39
|
-
* @private
|
|
40
|
-
*/
|
|
41
|
-
class MultiSelectComboBoxOverlay extends ComboBoxOverlayMixin(
|
|
42
|
-
OverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))),
|
|
43
|
-
) {
|
|
44
|
-
static get is() {
|
|
45
|
-
return 'vaadin-multi-select-combo-box-overlay';
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
static get styles() {
|
|
49
|
-
return [overlayStyles, multiSelectComboBoxOverlayStyles];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** @protected */
|
|
53
|
-
render() {
|
|
54
|
-
return html`
|
|
55
|
-
<div id="backdrop" part="backdrop" hidden></div>
|
|
56
|
-
<div part="overlay" id="overlay">
|
|
57
|
-
<div part="loader"></div>
|
|
58
|
-
<div part="content" id="content"><slot></slot></div>
|
|
59
|
-
</div>
|
|
60
|
-
`;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
defineCustomElement(MultiSelectComboBoxOverlay);
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { css, html, LitElement } from 'lit';
|
|
7
|
-
import { ComboBoxPlaceholder } from '@vaadin/combo-box/src/vaadin-combo-box-placeholder.js';
|
|
8
|
-
import { ComboBoxScrollerMixin } from '@vaadin/combo-box/src/vaadin-combo-box-scroller-mixin.js';
|
|
9
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
|
|
14
|
-
*
|
|
15
|
-
* @customElement
|
|
16
|
-
* @extends HTMLElement
|
|
17
|
-
* @mixes ComboBoxScrollerMixin
|
|
18
|
-
* @private
|
|
19
|
-
*/
|
|
20
|
-
export class MultiSelectComboBoxScroller extends ComboBoxScrollerMixin(PolylitMixin(LitElement)) {
|
|
21
|
-
static get is() {
|
|
22
|
-
return 'vaadin-multi-select-combo-box-scroller';
|
|
23
|
-
}
|
|
24
|
-
|
|
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);
|
|
34
|
-
|
|
35
|
-
/* Enable momentum scrolling on iOS */
|
|
36
|
-
-webkit-overflow-scrolling: touch;
|
|
37
|
-
|
|
38
|
-
/* Fixes scrollbar disappearing when 'Show scroll bars: Always' enabled in Safari */
|
|
39
|
-
box-shadow: 0 0 0 white;
|
|
40
|
-
}
|
|
41
|
-
|
|
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
|
-
}
|
|
50
|
-
|
|
51
|
-
/** @protected */
|
|
52
|
-
render() {
|
|
53
|
-
return html`
|
|
54
|
-
<div id="selector">
|
|
55
|
-
<slot></slot>
|
|
56
|
-
</div>
|
|
57
|
-
`;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/** @protected */
|
|
61
|
-
ready() {
|
|
62
|
-
super.ready();
|
|
63
|
-
|
|
64
|
-
this.setAttribute('aria-multiselectable', 'true');
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @protected
|
|
69
|
-
* @override
|
|
70
|
-
*/
|
|
71
|
-
_isItemSelected(item, _selectedItem, itemIdPath) {
|
|
72
|
-
if (item instanceof ComboBoxPlaceholder) {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (this.owner.readonly) {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return this.owner._findIndex(item, this.owner.selectedItems, itemIdPath) > -1;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* @param {HTMLElement} el
|
|
85
|
-
* @param {number} index
|
|
86
|
-
* @protected
|
|
87
|
-
* @override
|
|
88
|
-
*/
|
|
89
|
-
_updateElement(el, index) {
|
|
90
|
-
super._updateElement(el, index);
|
|
91
|
-
|
|
92
|
-
el.toggleAttribute('readonly', this.owner.readonly);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
defineCustomElement(MultiSelectComboBoxScroller);
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import './vaadin-lit-multi-select-combo-box-chip.js';
|
|
7
|
-
import './vaadin-lit-multi-select-combo-box-container.js';
|
|
8
|
-
import './vaadin-lit-multi-select-combo-box-internal.js';
|
|
9
|
-
import { html, LitElement } from 'lit';
|
|
10
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
12
|
-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
13
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
14
|
-
import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
|
|
15
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
16
|
-
import { MultiSelectComboBoxMixin } from './vaadin-multi-select-combo-box-mixin.js';
|
|
17
|
-
import { multiSelectComboBox } from './vaadin-multi-select-combo-box-styles.js';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* LitElement based version of `<vaadin-multi-select-combo-box>` web component.
|
|
21
|
-
*
|
|
22
|
-
* ## Disclaimer
|
|
23
|
-
*
|
|
24
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
25
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
26
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
27
|
-
*/
|
|
28
|
-
class MultiSelectComboBox extends MultiSelectComboBoxMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
|
|
29
|
-
static get is() {
|
|
30
|
-
return 'vaadin-multi-select-combo-box';
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
static get styles() {
|
|
34
|
-
return [inputFieldShared, multiSelectComboBox];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/** @protected */
|
|
38
|
-
render() {
|
|
39
|
-
return html`
|
|
40
|
-
<div class="vaadin-multi-select-combo-box-container">
|
|
41
|
-
<div part="label">
|
|
42
|
-
<slot name="label"></slot>
|
|
43
|
-
<span part="required-indicator" aria-hidden="true" @click="${this.focus}"></span>
|
|
44
|
-
</div>
|
|
45
|
-
|
|
46
|
-
<vaadin-multi-select-combo-box-internal
|
|
47
|
-
id="comboBox"
|
|
48
|
-
.filteredItems="${this.filteredItems}"
|
|
49
|
-
.items="${this.items}"
|
|
50
|
-
.itemIdPath="${this.itemIdPath}"
|
|
51
|
-
.itemLabelPath="${this.itemLabelPath}"
|
|
52
|
-
.itemValuePath="${this.itemValuePath}"
|
|
53
|
-
.disabled="${this.disabled}"
|
|
54
|
-
.readonly="${this.readonly}"
|
|
55
|
-
.autoOpenDisabled="${this.autoOpenDisabled}"
|
|
56
|
-
.allowCustomValue="${this.allowCustomValue}"
|
|
57
|
-
.overlayClass="${this.overlayClass}"
|
|
58
|
-
.dataProvider="${this.dataProvider}"
|
|
59
|
-
.filter="${this.filter}"
|
|
60
|
-
.lastFilter="${this._lastFilter}"
|
|
61
|
-
.loading="${this.loading}"
|
|
62
|
-
.size="${this.size}"
|
|
63
|
-
.selectedItems="${this.selectedItems}"
|
|
64
|
-
.selectedItemsOnTop="${this.selectedItemsOnTop}"
|
|
65
|
-
.itemClassNameGenerator="${this.itemClassNameGenerator}"
|
|
66
|
-
.topGroup="${this._topGroup}"
|
|
67
|
-
.opened="${this.opened}"
|
|
68
|
-
.renderer="${this.renderer}"
|
|
69
|
-
.keepFilter="${this.keepFilter}"
|
|
70
|
-
theme="${ifDefined(this._theme)}"
|
|
71
|
-
@combo-box-item-selected="${this._onComboBoxItemSelected}"
|
|
72
|
-
@change="${this._onComboBoxChange}"
|
|
73
|
-
@custom-value-set="${this._onCustomValueSet}"
|
|
74
|
-
@filtered-items-changed="${this._onFilteredItemsChanged}"
|
|
75
|
-
@filter-changed="${this._onComboBoxFilterChanged}"
|
|
76
|
-
@last-filter-changed="${this._onComboBoxLastFilterChanged}"
|
|
77
|
-
@loading-changed="${this._onComboBoxLoadingChanged}"
|
|
78
|
-
@opened-changed="${this._onComboBoxOpenedChanged}"
|
|
79
|
-
@size-changed="${this._onComboBoxSizeChanged}"
|
|
80
|
-
>
|
|
81
|
-
<vaadin-multi-select-combo-box-container
|
|
82
|
-
part="input-field"
|
|
83
|
-
.autoExpandVertically="${this.autoExpandVertically}"
|
|
84
|
-
.readonly="${this.readonly}"
|
|
85
|
-
.disabled="${this.disabled}"
|
|
86
|
-
.invalid="${this.invalid}"
|
|
87
|
-
theme="${ifDefined(this._theme)}"
|
|
88
|
-
>
|
|
89
|
-
<slot name="overflow" slot="prefix"></slot>
|
|
90
|
-
<div id="chips" part="chips" slot="prefix">
|
|
91
|
-
<slot name="chip"></slot>
|
|
92
|
-
</div>
|
|
93
|
-
<slot name="input"></slot>
|
|
94
|
-
<div
|
|
95
|
-
id="clearButton"
|
|
96
|
-
part="clear-button"
|
|
97
|
-
slot="suffix"
|
|
98
|
-
@touchend="${this._onClearButtonTouchend}"
|
|
99
|
-
aria-hidden="true"
|
|
100
|
-
></div>
|
|
101
|
-
<div id="toggleButton" class="toggle-button" part="toggle-button" slot="suffix" aria-hidden="true"></div>
|
|
102
|
-
</vaadin-multi-select-combo-box-container>
|
|
103
|
-
</vaadin-multi-select-combo-box-internal>
|
|
104
|
-
|
|
105
|
-
<div part="helper-text">
|
|
106
|
-
<slot name="helper"></slot>
|
|
107
|
-
</div>
|
|
108
|
-
|
|
109
|
-
<div part="error-message">
|
|
110
|
-
<slot name="error-message"></slot>
|
|
111
|
-
</div>
|
|
112
|
-
</div>
|
|
113
|
-
|
|
114
|
-
<slot name="tooltip"></slot>
|
|
115
|
-
`;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/** @private */
|
|
119
|
-
_onComboBoxFilterChanged(event) {
|
|
120
|
-
this.filter = event.detail.value;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/** @private */
|
|
124
|
-
_onComboBoxLoadingChanged(event) {
|
|
125
|
-
this.loading = event.detail.value;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/** @private */
|
|
129
|
-
_onComboBoxLastFilterChanged(event) {
|
|
130
|
-
this._lastFilter = event.detail.value;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/** @private */
|
|
134
|
-
_onComboBoxOpenedChanged(event) {
|
|
135
|
-
this.opened = event.detail.value;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/** @private */
|
|
139
|
-
_onComboBoxSizeChanged(event) {
|
|
140
|
-
this.size = event.detail.value;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
defineCustomElement(MultiSelectComboBox);
|
|
145
|
-
|
|
146
|
-
export { MultiSelectComboBox };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/vaadin-multi-select-combo-box.js';
|