@vaadin/multi-select-combo-box 24.8.0-alpha8 → 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
|
@@ -6,18 +6,16 @@
|
|
|
6
6
|
import './vaadin-multi-select-combo-box-chip.js';
|
|
7
7
|
import './vaadin-multi-select-combo-box-container.js';
|
|
8
8
|
import './vaadin-multi-select-combo-box-internal.js';
|
|
9
|
-
import { html,
|
|
9
|
+
import { html, LitElement } from 'lit';
|
|
10
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
10
11
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
11
12
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
13
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
12
14
|
import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
|
|
13
|
-
import {
|
|
15
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
16
|
import { MultiSelectComboBoxMixin } from './vaadin-multi-select-combo-box-mixin.js';
|
|
15
17
|
import { multiSelectComboBox } from './vaadin-multi-select-combo-box-styles.js';
|
|
16
18
|
|
|
17
|
-
registerStyles('vaadin-multi-select-combo-box', [inputFieldShared, multiSelectComboBox], {
|
|
18
|
-
moduleId: 'vaadin-multi-select-combo-box-styles',
|
|
19
|
-
});
|
|
20
|
-
|
|
21
19
|
/**
|
|
22
20
|
* `<vaadin-multi-select-combo-box>` is a web component that wraps `<vaadin-combo-box>` and extends
|
|
23
21
|
* its functionality to allow selecting multiple items, in addition to basic features.
|
|
@@ -101,56 +99,66 @@ registerStyles('vaadin-multi-select-combo-box', [inputFieldShared, multiSelectCo
|
|
|
101
99
|
* @mixes ThemableMixin
|
|
102
100
|
* @mixes MultiSelectComboBoxMixin
|
|
103
101
|
*/
|
|
104
|
-
class MultiSelectComboBox extends MultiSelectComboBoxMixin(ThemableMixin(ElementMixin(
|
|
102
|
+
class MultiSelectComboBox extends MultiSelectComboBoxMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
|
|
105
103
|
static get is() {
|
|
106
104
|
return 'vaadin-multi-select-combo-box';
|
|
107
105
|
}
|
|
108
106
|
|
|
109
|
-
static get
|
|
107
|
+
static get styles() {
|
|
108
|
+
return [inputFieldShared, multiSelectComboBox];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** @protected */
|
|
112
|
+
render() {
|
|
110
113
|
return html`
|
|
111
114
|
<div class="vaadin-multi-select-combo-box-container">
|
|
112
115
|
<div part="label">
|
|
113
116
|
<slot name="label"></slot>
|
|
114
|
-
<span part="required-indicator" aria-hidden="true"
|
|
117
|
+
<span part="required-indicator" aria-hidden="true" @click="${this.focus}"></span>
|
|
115
118
|
</div>
|
|
116
119
|
|
|
117
120
|
<vaadin-multi-select-combo-box-internal
|
|
118
121
|
id="comboBox"
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
opened="{
|
|
139
|
-
renderer="
|
|
140
|
-
|
|
141
|
-
theme
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
122
|
+
.filteredItems="${this.filteredItems}"
|
|
123
|
+
.items="${this.items}"
|
|
124
|
+
.itemIdPath="${this.itemIdPath}"
|
|
125
|
+
.itemLabelPath="${this.itemLabelPath}"
|
|
126
|
+
.itemValuePath="${this.itemValuePath}"
|
|
127
|
+
.disabled="${this.disabled}"
|
|
128
|
+
.readonly="${this.readonly}"
|
|
129
|
+
.autoOpenDisabled="${this.autoOpenDisabled}"
|
|
130
|
+
.allowCustomValue="${this.allowCustomValue}"
|
|
131
|
+
.overlayClass="${this.overlayClass}"
|
|
132
|
+
.dataProvider="${this.dataProvider}"
|
|
133
|
+
.filter="${this.filter}"
|
|
134
|
+
.lastFilter="${this._lastFilter}"
|
|
135
|
+
.loading="${this.loading}"
|
|
136
|
+
.size="${this.size}"
|
|
137
|
+
.selectedItems="${this.selectedItems}"
|
|
138
|
+
.selectedItemsOnTop="${this.selectedItemsOnTop}"
|
|
139
|
+
.itemClassNameGenerator="${this.itemClassNameGenerator}"
|
|
140
|
+
.topGroup="${this._topGroup}"
|
|
141
|
+
.opened="${this.opened}"
|
|
142
|
+
.renderer="${this.renderer}"
|
|
143
|
+
.keepFilter="${this.keepFilter}"
|
|
144
|
+
theme="${ifDefined(this._theme)}"
|
|
145
|
+
@combo-box-item-selected="${this._onComboBoxItemSelected}"
|
|
146
|
+
@change="${this._onComboBoxChange}"
|
|
147
|
+
@custom-value-set="${this._onCustomValueSet}"
|
|
148
|
+
@filtered-items-changed="${this._onFilteredItemsChanged}"
|
|
149
|
+
@filter-changed="${this._onComboBoxFilterChanged}"
|
|
150
|
+
@last-filter-changed="${this._onComboBoxLastFilterChanged}"
|
|
151
|
+
@loading-changed="${this._onComboBoxLoadingChanged}"
|
|
152
|
+
@opened-changed="${this._onComboBoxOpenedChanged}"
|
|
153
|
+
@size-changed="${this._onComboBoxSizeChanged}"
|
|
146
154
|
>
|
|
147
155
|
<vaadin-multi-select-combo-box-container
|
|
148
156
|
part="input-field"
|
|
149
|
-
|
|
150
|
-
readonly="
|
|
151
|
-
disabled="
|
|
152
|
-
invalid="
|
|
153
|
-
theme
|
|
157
|
+
.autoExpandVertically="${this.autoExpandVertically}"
|
|
158
|
+
.readonly="${this.readonly}"
|
|
159
|
+
.disabled="${this.disabled}"
|
|
160
|
+
.invalid="${this.invalid}"
|
|
161
|
+
theme="${ifDefined(this._theme)}"
|
|
154
162
|
>
|
|
155
163
|
<slot name="overflow" slot="prefix"></slot>
|
|
156
164
|
<div id="chips" part="chips" slot="prefix">
|
|
@@ -161,7 +169,7 @@ class MultiSelectComboBox extends MultiSelectComboBoxMixin(ThemableMixin(Element
|
|
|
161
169
|
id="clearButton"
|
|
162
170
|
part="clear-button"
|
|
163
171
|
slot="suffix"
|
|
164
|
-
|
|
172
|
+
@touchend="${this._onClearButtonTouchend}"
|
|
165
173
|
aria-hidden="true"
|
|
166
174
|
></div>
|
|
167
175
|
<div id="toggleButton" class="toggle-button" part="toggle-button" slot="suffix" aria-hidden="true"></div>
|
|
@@ -180,6 +188,31 @@ class MultiSelectComboBox extends MultiSelectComboBoxMixin(ThemableMixin(Element
|
|
|
180
188
|
<slot name="tooltip"></slot>
|
|
181
189
|
`;
|
|
182
190
|
}
|
|
191
|
+
|
|
192
|
+
/** @private */
|
|
193
|
+
_onComboBoxFilterChanged(event) {
|
|
194
|
+
this.filter = event.detail.value;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** @private */
|
|
198
|
+
_onComboBoxLoadingChanged(event) {
|
|
199
|
+
this.loading = event.detail.value;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** @private */
|
|
203
|
+
_onComboBoxLastFilterChanged(event) {
|
|
204
|
+
this._lastFilter = event.detail.value;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/** @private */
|
|
208
|
+
_onComboBoxOpenedChanged(event) {
|
|
209
|
+
this.opened = event.detail.value;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/** @private */
|
|
213
|
+
_onComboBoxSizeChanged(event) {
|
|
214
|
+
this.size = event.detail.value;
|
|
215
|
+
}
|
|
183
216
|
}
|
|
184
217
|
|
|
185
218
|
defineCustomElement(MultiSelectComboBox);
|
package/web-types.json
CHANGED
package/web-types.lit.json
CHANGED
|
@@ -1,79 +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
|
-
* LitElement based version of `<vaadin-multi-select-combo-box-chip>` web component.
|
|
14
|
-
*
|
|
15
|
-
* ## Disclaimer
|
|
16
|
-
*
|
|
17
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
18
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
19
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
20
|
-
*/
|
|
21
|
-
class MultiSelectComboBoxChip extends ThemableMixin(PolylitMixin(LitElement)) {
|
|
22
|
-
static get is() {
|
|
23
|
-
return 'vaadin-multi-select-combo-box-chip';
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
static get styles() {
|
|
27
|
-
return multiSelectComboBoxChip;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static get properties() {
|
|
31
|
-
return {
|
|
32
|
-
disabled: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
reflectToAttribute: true,
|
|
35
|
-
sync: true,
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
readonly: {
|
|
39
|
-
type: Boolean,
|
|
40
|
-
reflectToAttribute: true,
|
|
41
|
-
sync: true,
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
label: {
|
|
45
|
-
type: String,
|
|
46
|
-
sync: true,
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
item: {
|
|
50
|
-
type: Object,
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/** @protected */
|
|
56
|
-
render() {
|
|
57
|
-
return html`
|
|
58
|
-
<div part="label">${this.label}</div>
|
|
59
|
-
<div part="remove-button" @click="${this._onRemoveClick}"></div>
|
|
60
|
-
`;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/** @private */
|
|
64
|
-
_onRemoveClick(event) {
|
|
65
|
-
event.stopPropagation();
|
|
66
|
-
|
|
67
|
-
this.dispatchEvent(
|
|
68
|
-
new CustomEvent('item-removed', {
|
|
69
|
-
detail: {
|
|
70
|
-
item: this.item,
|
|
71
|
-
},
|
|
72
|
-
bubbles: true,
|
|
73
|
-
composed: true,
|
|
74
|
-
}),
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
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,50 +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
|
-
* LitElement based version of `<vaadin-multi-select-combo-box-item>` web component.
|
|
15
|
-
*
|
|
16
|
-
* ## Disclaimer
|
|
17
|
-
*
|
|
18
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
19
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
20
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
21
|
-
*/
|
|
22
|
-
export class MultiSelectComboBoxItem extends ComboBoxItemMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))) {
|
|
23
|
-
static get is() {
|
|
24
|
-
return 'vaadin-multi-select-combo-box-item';
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
static get styles() {
|
|
28
|
-
return css`
|
|
29
|
-
:host {
|
|
30
|
-
display: block;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
:host([hidden]) {
|
|
34
|
-
display: none !important;
|
|
35
|
-
}
|
|
36
|
-
`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/** @protected */
|
|
40
|
-
render() {
|
|
41
|
-
return html`
|
|
42
|
-
<span part="checkmark" aria-hidden="true"></span>
|
|
43
|
-
<div part="content">
|
|
44
|
-
<slot></slot>
|
|
45
|
-
</div>
|
|
46
|
-
`;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
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 +0,0 @@
|
|
|
1
|
-
export * from './vaadin-multi-select-combo-box.js';
|