@vaadin/multi-select-combo-box 24.3.4 → 24.4.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/package.json +13 -13
- package/src/lit/renderer-directives.d.ts +1 -1
- package/src/lit/renderer-directives.js +1 -1
- package/src/vaadin-multi-select-combo-box-chip.js +1 -1
- package/src/vaadin-multi-select-combo-box-container.js +1 -1
- package/src/vaadin-multi-select-combo-box-internal.js +46 -5
- package/src/vaadin-multi-select-combo-box-item.d.ts +1 -1
- package/src/vaadin-multi-select-combo-box-item.js +1 -1
- package/src/vaadin-multi-select-combo-box-overlay.d.ts +7 -3
- package/src/vaadin-multi-select-combo-box-overlay.js +36 -37
- package/src/vaadin-multi-select-combo-box-scroller.d.ts +1 -1
- package/src/vaadin-multi-select-combo-box-scroller.js +1 -1
- package/src/vaadin-multi-select-combo-box.d.ts +7 -1
- package/src/vaadin-multi-select-combo-box.js +36 -32
- package/theme/lumo/vaadin-multi-select-combo-box-chip-styles.d.ts +10 -0
- package/theme/lumo/vaadin-multi-select-combo-box-chip-styles.js +1 -1
- package/theme/lumo/vaadin-multi-select-combo-box-styles.d.ts +10 -0
- package/theme/lumo/vaadin-multi-select-combo-box-styles.js +1 -1
- package/theme/lumo/vaadin-multi-select-combo-box.d.ts +8 -0
- package/theme/lumo/vaadin-multi-select-combo-box.js +1 -2
- package/theme/material/vaadin-multi-select-combo-box-chip-styles.d.ts +8 -0
- package/theme/material/vaadin-multi-select-combo-box-chip-styles.js +1 -1
- package/theme/material/vaadin-multi-select-combo-box-styles.d.ts +9 -0
- package/theme/material/vaadin-multi-select-combo-box-styles.js +1 -1
- package/theme/material/vaadin-multi-select-combo-box.d.ts +8 -0
- package/theme/material/vaadin-multi-select-combo-box.js +1 -2
- package/web-types.json +23 -1
- package/web-types.lit.json +8 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/multi-select-combo-box",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.4.0-alpha10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,17 +38,17 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@polymer/polymer": "^3.0.0",
|
|
41
|
-
"@vaadin/a11y-base": "
|
|
42
|
-
"@vaadin/combo-box": "
|
|
43
|
-
"@vaadin/component-base": "
|
|
44
|
-
"@vaadin/field-base": "
|
|
45
|
-
"@vaadin/input-container": "
|
|
46
|
-
"@vaadin/item": "
|
|
47
|
-
"@vaadin/lit-renderer": "
|
|
48
|
-
"@vaadin/overlay": "
|
|
49
|
-
"@vaadin/vaadin-lumo-styles": "
|
|
50
|
-
"@vaadin/vaadin-material-styles": "
|
|
51
|
-
"@vaadin/vaadin-themable-mixin": "
|
|
41
|
+
"@vaadin/a11y-base": "24.4.0-alpha10",
|
|
42
|
+
"@vaadin/combo-box": "24.4.0-alpha10",
|
|
43
|
+
"@vaadin/component-base": "24.4.0-alpha10",
|
|
44
|
+
"@vaadin/field-base": "24.4.0-alpha10",
|
|
45
|
+
"@vaadin/input-container": "24.4.0-alpha10",
|
|
46
|
+
"@vaadin/item": "24.4.0-alpha10",
|
|
47
|
+
"@vaadin/lit-renderer": "24.4.0-alpha10",
|
|
48
|
+
"@vaadin/overlay": "24.4.0-alpha10",
|
|
49
|
+
"@vaadin/vaadin-lumo-styles": "24.4.0-alpha10",
|
|
50
|
+
"@vaadin/vaadin-material-styles": "24.4.0-alpha10",
|
|
51
|
+
"@vaadin/vaadin-themable-mixin": "24.4.0-alpha10"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@esm-bundle/chai": "^4.3.4",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"web-types.json",
|
|
61
61
|
"web-types.lit.json"
|
|
62
62
|
],
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "c563c01d6ac5157f5a5885c8f6048d1cf4c727b4"
|
|
64
64
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2017 -
|
|
3
|
+
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { DirectiveResult } from 'lit/directive.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import './vaadin-multi-select-combo-box-item.js';
|
|
@@ -60,6 +60,14 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
|
|
|
60
60
|
notify: true,
|
|
61
61
|
},
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* When true, filter string isn't cleared after selecting an item.
|
|
65
|
+
*/
|
|
66
|
+
keepFilter: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
value: false,
|
|
69
|
+
},
|
|
70
|
+
|
|
63
71
|
/**
|
|
64
72
|
* When set to `true`, "loading" attribute is set
|
|
65
73
|
* on the host and the overlay element.
|
|
@@ -120,6 +128,10 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
|
|
|
120
128
|
};
|
|
121
129
|
}
|
|
122
130
|
|
|
131
|
+
static get observers() {
|
|
132
|
+
return ['_readonlyChanged(readonly)'];
|
|
133
|
+
}
|
|
134
|
+
|
|
123
135
|
/**
|
|
124
136
|
* Reference to the clear button element.
|
|
125
137
|
* @protected
|
|
@@ -157,6 +169,11 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
|
|
|
157
169
|
this._toggleElement = this.querySelector('.toggle-button');
|
|
158
170
|
}
|
|
159
171
|
|
|
172
|
+
/** @private */
|
|
173
|
+
_readonlyChanged() {
|
|
174
|
+
this._setDropdownItems(this.filteredItems);
|
|
175
|
+
}
|
|
176
|
+
|
|
160
177
|
/**
|
|
161
178
|
* Override combo-box method to group selected
|
|
162
179
|
* items at the top of the overlay.
|
|
@@ -166,12 +183,12 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
|
|
|
166
183
|
*/
|
|
167
184
|
_setDropdownItems(items) {
|
|
168
185
|
if (this.readonly) {
|
|
169
|
-
|
|
186
|
+
super._setDropdownItems(this.selectedItems);
|
|
170
187
|
return;
|
|
171
188
|
}
|
|
172
189
|
|
|
173
190
|
if (this.filter || !this.selectedItemsOnTop) {
|
|
174
|
-
|
|
191
|
+
super._setDropdownItems(items);
|
|
175
192
|
return;
|
|
176
193
|
}
|
|
177
194
|
|
|
@@ -181,11 +198,11 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
|
|
|
181
198
|
(item) => this._comboBox._findIndex(item, this.topGroup, this.itemIdPath) === -1,
|
|
182
199
|
);
|
|
183
200
|
|
|
184
|
-
|
|
201
|
+
super._setDropdownItems(this.topGroup.concat(filteredItems));
|
|
185
202
|
return;
|
|
186
203
|
}
|
|
187
204
|
|
|
188
|
-
|
|
205
|
+
super._setDropdownItems(items);
|
|
189
206
|
}
|
|
190
207
|
|
|
191
208
|
/** @private */
|
|
@@ -259,6 +276,30 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
|
|
|
259
276
|
super._onEscape(event);
|
|
260
277
|
}
|
|
261
278
|
|
|
279
|
+
/**
|
|
280
|
+
* Override from combo-box to ignore requests to clear the filter if the
|
|
281
|
+
* keepFilter option is enabled. Exceptions are when the dropdown is closed,
|
|
282
|
+
* so the filter is still cleared on cancel and focus out.
|
|
283
|
+
* @protected
|
|
284
|
+
* @override
|
|
285
|
+
*/
|
|
286
|
+
_clearFilter() {
|
|
287
|
+
if (!this.keepFilter || !this.opened) {
|
|
288
|
+
super._clearFilter();
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Override method from combo-box to always clear the filter when reverting
|
|
294
|
+
* the input value, regardless of the keepFilter option.
|
|
295
|
+
* @override
|
|
296
|
+
* @protected
|
|
297
|
+
*/
|
|
298
|
+
_revertInputValueToValue() {
|
|
299
|
+
super._revertInputValueToValue();
|
|
300
|
+
this.filter = '';
|
|
301
|
+
}
|
|
302
|
+
|
|
262
303
|
/**
|
|
263
304
|
* @protected
|
|
264
305
|
* @override
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2018 -
|
|
3
|
+
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { ComboBoxDefaultItem, ComboBoxItemMixinClass } from '@vaadin/combo-box/src/vaadin-combo-box-item-mixin.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { ComboBoxOverlayMixin } from '@vaadin/combo-box/src/vaadin-combo-box-overlay-mixin.js';
|
|
7
|
-
import {
|
|
7
|
+
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
8
|
+
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
9
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
|
|
11
13
|
*/
|
|
12
|
-
declare class MultiSelectComboBoxOverlay extends ComboBoxOverlayMixin(
|
|
14
|
+
declare class MultiSelectComboBoxOverlay extends ComboBoxOverlayMixin(
|
|
15
|
+
OverlayMixin(DirMixin(ThemableMixin(HTMLElement))),
|
|
16
|
+
) {}
|
|
13
17
|
|
|
14
18
|
declare global {
|
|
15
19
|
interface HTMLElementTagNameMap {
|
|
@@ -1,60 +1,59 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2024 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, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
6
7
|
import { ComboBoxOverlayMixin } from '@vaadin/combo-box/src/vaadin-combo-box-overlay-mixin.js';
|
|
7
8
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
registerStyles
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
10
|
+
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
11
|
+
import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
|
|
12
|
+
import { css, registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
+
|
|
14
|
+
const multiSelectComboBoxOverlayStyles = css`
|
|
15
|
+
#overlay {
|
|
16
|
+
width: var(
|
|
17
|
+
--vaadin-multi-select-combo-box-overlay-width,
|
|
18
|
+
var(--_vaadin-multi-select-combo-box-overlay-default-width, auto)
|
|
19
|
+
);
|
|
20
|
+
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{ moduleId: 'vaadin-multi-select-combo-box-overlay-styles' },
|
|
28
|
-
);
|
|
22
|
+
[part='content'] {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
height: 100%;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
registerStyles('vaadin-multi-select-combo-box-overlay', [overlayStyles, multiSelectComboBoxOverlayStyles], {
|
|
30
|
+
moduleId: 'vaadin-multi-select-combo-box-overlay-styles',
|
|
31
|
+
});
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
34
|
* An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
|
|
34
35
|
*
|
|
35
36
|
* @customElement
|
|
36
|
-
* @extends
|
|
37
|
+
* @extends HTMLElement
|
|
38
|
+
* @mixes ComboBoxOverlayMixin
|
|
39
|
+
* @mixes DirMixin
|
|
40
|
+
* @mixes OverlayMixin
|
|
41
|
+
* @mixes ThemableMixin
|
|
37
42
|
* @private
|
|
38
43
|
*/
|
|
39
|
-
class MultiSelectComboBoxOverlay extends ComboBoxOverlayMixin(
|
|
44
|
+
class MultiSelectComboBoxOverlay extends ComboBoxOverlayMixin(OverlayMixin(DirMixin(ThemableMixin(PolymerElement)))) {
|
|
40
45
|
static get is() {
|
|
41
46
|
return 'vaadin-multi-select-combo-box-overlay';
|
|
42
47
|
}
|
|
43
48
|
|
|
44
49
|
static get template() {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
loader.setAttribute('part', 'loader');
|
|
53
|
-
|
|
54
|
-
overlay.insertBefore(loader, overlay.firstElementChild);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return memoizedTemplate;
|
|
50
|
+
return html`
|
|
51
|
+
<div id="backdrop" part="backdrop" hidden></div>
|
|
52
|
+
<div part="overlay" id="overlay">
|
|
53
|
+
<div part="loader"></div>
|
|
54
|
+
<div part="content" id="content"><slot></slot></div>
|
|
55
|
+
</div>
|
|
56
|
+
`;
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { ComboBoxScrollerMixin } from '@vaadin/combo-box/src/vaadin-combo-box-scroller-mixin.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { DelegateFocusMixinClass } from '@vaadin/a11y-base/src/delegate-focus-mixin.js';
|
|
@@ -274,6 +274,12 @@ declare class MultiSelectComboBox<TItem = ComboBoxDefaultItem> extends HTMLEleme
|
|
|
274
274
|
*/
|
|
275
275
|
i18n: MultiSelectComboBoxI18n;
|
|
276
276
|
|
|
277
|
+
/**
|
|
278
|
+
* When true, filter string isn't cleared after selecting an item.
|
|
279
|
+
* @attr {boolean} keep-filter
|
|
280
|
+
*/
|
|
281
|
+
keepFilter: boolean;
|
|
282
|
+
|
|
277
283
|
/**
|
|
278
284
|
* True when loading items from the data provider, false otherwise.
|
|
279
285
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import './vaadin-multi-select-combo-box-chip.js';
|
|
@@ -163,7 +163,7 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
|
|
|
163
163
|
|
|
164
164
|
<vaadin-multi-select-combo-box-internal
|
|
165
165
|
id="comboBox"
|
|
166
|
-
items="[[
|
|
166
|
+
items="[[items]]"
|
|
167
167
|
item-id-path="[[itemIdPath]]"
|
|
168
168
|
item-label-path="[[itemLabelPath]]"
|
|
169
169
|
item-value-path="[[itemValuePath]]"
|
|
@@ -177,12 +177,13 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
|
|
|
177
177
|
last-filter="{{_lastFilter}}"
|
|
178
178
|
loading="{{loading}}"
|
|
179
179
|
size="{{size}}"
|
|
180
|
-
filtered-items="[[
|
|
180
|
+
filtered-items="[[filteredItems]]"
|
|
181
181
|
selected-items="[[selectedItems]]"
|
|
182
182
|
selected-items-on-top="[[selectedItemsOnTop]]"
|
|
183
183
|
top-group="[[_topGroup]]"
|
|
184
184
|
opened="{{opened}}"
|
|
185
185
|
renderer="[[renderer]]"
|
|
186
|
+
keep-filter="[[keepFilter]]"
|
|
186
187
|
theme$="[[_theme]]"
|
|
187
188
|
on-combo-box-item-selected="_onComboBoxItemSelected"
|
|
188
189
|
on-change="_onComboBoxChange"
|
|
@@ -342,6 +343,14 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
|
|
|
342
343
|
},
|
|
343
344
|
},
|
|
344
345
|
|
|
346
|
+
/**
|
|
347
|
+
* When true, filter string isn't cleared after selecting an item.
|
|
348
|
+
*/
|
|
349
|
+
keepFilter: {
|
|
350
|
+
type: Boolean,
|
|
351
|
+
value: false,
|
|
352
|
+
},
|
|
353
|
+
|
|
345
354
|
/**
|
|
346
355
|
* True when loading items from the data provider, false otherwise.
|
|
347
356
|
*/
|
|
@@ -486,18 +495,6 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
|
|
|
486
495
|
type: String,
|
|
487
496
|
},
|
|
488
497
|
|
|
489
|
-
/** @private */
|
|
490
|
-
__effectiveItems: {
|
|
491
|
-
type: Array,
|
|
492
|
-
computed: '__computeEffectiveItems(items, selectedItems, readonly)',
|
|
493
|
-
},
|
|
494
|
-
|
|
495
|
-
/** @private */
|
|
496
|
-
__effectiveFilteredItems: {
|
|
497
|
-
type: Array,
|
|
498
|
-
computed: '__computeEffectiveFilteredItems(items, filteredItems, selectedItems, readonly)',
|
|
499
|
-
},
|
|
500
|
-
|
|
501
498
|
/** @private */
|
|
502
499
|
_overflowItems: {
|
|
503
500
|
type: Array,
|
|
@@ -836,10 +833,27 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
|
|
|
836
833
|
return selectedItems.indexOf(item);
|
|
837
834
|
}
|
|
838
835
|
|
|
839
|
-
/**
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
836
|
+
/**
|
|
837
|
+
* Clear the internal combo box value and filter. Filter will not be cleared
|
|
838
|
+
* when the `keepFilter` option is enabled. Using `force` can enforce clearing
|
|
839
|
+
* the filter.
|
|
840
|
+
* @param {boolean} force overrides the keepFilter option
|
|
841
|
+
* @private
|
|
842
|
+
*/
|
|
843
|
+
__clearInternalValue(force = false) {
|
|
844
|
+
if (!this.keepFilter || force) {
|
|
845
|
+
// Clear both combo box value and filter.
|
|
846
|
+
this.filter = '';
|
|
847
|
+
this.$.comboBox.clear();
|
|
848
|
+
} else {
|
|
849
|
+
// Only clear combo box value. This effectively resets _lastCommittedValue
|
|
850
|
+
// which allows toggling the same item multiple times via keyboard.
|
|
851
|
+
this.$.comboBox.clear();
|
|
852
|
+
// Restore input to the filter value. Needed when items are
|
|
853
|
+
// navigated with keyboard, which overrides the input value
|
|
854
|
+
// with the item label.
|
|
855
|
+
this._inputElementValue = this.filter;
|
|
856
|
+
}
|
|
843
857
|
}
|
|
844
858
|
|
|
845
859
|
/** @private */
|
|
@@ -871,7 +885,7 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
|
|
|
871
885
|
const lastFilter = this._lastFilter;
|
|
872
886
|
// Do not unselect when manually typing and committing an already selected item.
|
|
873
887
|
if (lastFilter && lastFilter.toLowerCase() === itemLabel.toLowerCase()) {
|
|
874
|
-
this.
|
|
888
|
+
this.__clearInternalValue();
|
|
875
889
|
return;
|
|
876
890
|
}
|
|
877
891
|
|
|
@@ -884,7 +898,7 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
|
|
|
884
898
|
this.__updateSelection(itemsCopy);
|
|
885
899
|
|
|
886
900
|
// Suppress `value-changed` event.
|
|
887
|
-
this.
|
|
901
|
+
this.__clearInternalValue();
|
|
888
902
|
|
|
889
903
|
this.__announceItem(itemLabel, isSelected, itemsCopy.length);
|
|
890
904
|
}
|
|
@@ -1247,7 +1261,7 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
|
|
|
1247
1261
|
// Stop the original event
|
|
1248
1262
|
event.stopPropagation();
|
|
1249
1263
|
|
|
1250
|
-
this.
|
|
1264
|
+
this.__clearInternalValue(true);
|
|
1251
1265
|
|
|
1252
1266
|
this.dispatchEvent(
|
|
1253
1267
|
new CustomEvent('custom-value-set', {
|
|
@@ -1269,16 +1283,6 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
|
|
|
1269
1283
|
// and keep the overlay opened when clicking a chip.
|
|
1270
1284
|
event.preventDefault();
|
|
1271
1285
|
}
|
|
1272
|
-
|
|
1273
|
-
/** @private */
|
|
1274
|
-
__computeEffectiveItems(items, selectedItems, readonly) {
|
|
1275
|
-
return items && readonly ? selectedItems : items;
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
/** @private */
|
|
1279
|
-
__computeEffectiveFilteredItems(items, filteredItems, selectedItems, readonly) {
|
|
1280
|
-
return !items && readonly ? selectedItems : filteredItems;
|
|
1281
|
-
}
|
|
1282
1286
|
}
|
|
1283
1287
|
|
|
1284
1288
|
defineCustomElement(MultiSelectComboBox);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
7
|
+
import '@vaadin/vaadin-lumo-styles/font-icons.js';
|
|
8
|
+
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
9
|
+
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
10
|
+
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 2024 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/color.js';
|
|
8
|
+
import '@vaadin/vaadin-lumo-styles/font-icons.js';
|
|
9
|
+
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
10
|
+
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import './vaadin-multi-select-combo-box-chip-styles.js';
|
|
7
|
+
import './vaadin-multi-select-combo-box-styles.js';
|
|
8
|
+
import '../../src/vaadin-multi-select-combo-box.js';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2024 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/overlay/theme/lumo/vaadin-overlay.js';
|
|
7
6
|
import './vaadin-multi-select-combo-box-chip-styles.js';
|
|
8
7
|
import './vaadin-multi-select-combo-box-styles.js';
|
|
9
8
|
import '../../src/vaadin-multi-select-combo-box.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import '@vaadin/vaadin-material-styles/color.js';
|
|
7
|
+
import '@vaadin/vaadin-material-styles/font-icons.js';
|
|
8
|
+
import '@vaadin/vaadin-material-styles/typography.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 2024 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/material/vaadin-input-container-styles.js';
|
|
7
|
+
import '@vaadin/vaadin-material-styles/color.js';
|
|
8
|
+
import '@vaadin/vaadin-material-styles/font-icons.js';
|
|
9
|
+
import '@vaadin/vaadin-material-styles/typography.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import '@vaadin/input-container/theme/material/vaadin-input-container-styles.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import './vaadin-multi-select-combo-box-chip-styles.js';
|
|
7
|
+
import './vaadin-multi-select-combo-box-styles.js';
|
|
8
|
+
import '../../src/vaadin-multi-select-combo-box.js';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2024 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/overlay/theme/material/vaadin-overlay.js';
|
|
7
6
|
import './vaadin-multi-select-combo-box-chip-styles.js';
|
|
8
7
|
import './vaadin-multi-select-combo-box-styles.js';
|
|
9
8
|
import '../../src/vaadin-multi-select-combo-box.js';
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/multi-select-combo-box",
|
|
4
|
-
"version": "24.
|
|
4
|
+
"version": "24.4.0-alpha10",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -263,6 +263,17 @@
|
|
|
263
263
|
]
|
|
264
264
|
}
|
|
265
265
|
},
|
|
266
|
+
{
|
|
267
|
+
"name": "keep-filter",
|
|
268
|
+
"description": "When true, filter string isn't cleared after selecting an item.",
|
|
269
|
+
"value": {
|
|
270
|
+
"type": [
|
|
271
|
+
"boolean",
|
|
272
|
+
"null",
|
|
273
|
+
"undefined"
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
},
|
|
266
277
|
{
|
|
267
278
|
"name": "loading",
|
|
268
279
|
"description": "True when loading items from the data provider, false otherwise.",
|
|
@@ -627,6 +638,17 @@
|
|
|
627
638
|
]
|
|
628
639
|
}
|
|
629
640
|
},
|
|
641
|
+
{
|
|
642
|
+
"name": "keepFilter",
|
|
643
|
+
"description": "When true, filter string isn't cleared after selecting an item.",
|
|
644
|
+
"value": {
|
|
645
|
+
"type": [
|
|
646
|
+
"boolean",
|
|
647
|
+
"null",
|
|
648
|
+
"undefined"
|
|
649
|
+
]
|
|
650
|
+
}
|
|
651
|
+
},
|
|
630
652
|
{
|
|
631
653
|
"name": "loading",
|
|
632
654
|
"description": "True when loading items from the data provider, false otherwise.",
|
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/multi-select-combo-box",
|
|
4
|
-
"version": "24.
|
|
4
|
+
"version": "24.4.0-alpha10",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -89,6 +89,13 @@
|
|
|
89
89
|
"kind": "expression"
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
|
+
{
|
|
93
|
+
"name": "?keepFilter",
|
|
94
|
+
"description": "When true, filter string isn't cleared after selecting an item.",
|
|
95
|
+
"value": {
|
|
96
|
+
"kind": "expression"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
92
99
|
{
|
|
93
100
|
"name": "?loading",
|
|
94
101
|
"description": "True when loading items from the data provider, false otherwise.",
|