@vaadin/multi-select-combo-box 23.1.2 → 23.2.0-alpha3

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/lit.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './src/lit/renderer-directives.js';
package/lit.js ADDED
@@ -0,0 +1 @@
1
+ export * from './src/lit/renderer-directives.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/multi-select-combo-box",
3
- "version": "23.1.2",
3
+ "version": "23.2.0-alpha3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -19,6 +19,8 @@
19
19
  "main": "vaadin-multi-select-combo-box.js",
20
20
  "module": "vaadin-multi-select-combo-box.js",
21
21
  "files": [
22
+ "lit.js",
23
+ "lit.d.ts",
22
24
  "src",
23
25
  "theme",
24
26
  "vaadin-*.d.ts",
@@ -33,18 +35,19 @@
33
35
  ],
34
36
  "dependencies": {
35
37
  "@polymer/polymer": "^3.0.0",
36
- "@vaadin/combo-box": "^23.1.2",
37
- "@vaadin/component-base": "^23.1.2",
38
- "@vaadin/field-base": "^23.1.2",
39
- "@vaadin/input-container": "^23.1.2",
40
- "@vaadin/vaadin-lumo-styles": "^23.1.2",
41
- "@vaadin/vaadin-material-styles": "^23.1.2",
42
- "@vaadin/vaadin-themable-mixin": "^23.1.2"
38
+ "@vaadin/combo-box": "23.2.0-alpha3",
39
+ "@vaadin/component-base": "23.2.0-alpha3",
40
+ "@vaadin/field-base": "23.2.0-alpha3",
41
+ "@vaadin/input-container": "23.2.0-alpha3",
42
+ "@vaadin/lit-renderer": "23.2.0-alpha3",
43
+ "@vaadin/vaadin-lumo-styles": "23.2.0-alpha3",
44
+ "@vaadin/vaadin-material-styles": "23.2.0-alpha3",
45
+ "@vaadin/vaadin-themable-mixin": "23.2.0-alpha3"
43
46
  },
44
47
  "devDependencies": {
45
48
  "@esm-bundle/chai": "^4.3.4",
46
49
  "@vaadin/testing-helpers": "^0.3.2",
47
50
  "sinon": "^13.0.2"
48
51
  },
49
- "gitHead": "6fb205c6e9a761feadfb779dd5d7af96d3102e56"
52
+ "gitHead": "06e5875be93ca50da2846dafc65a8531010c0576"
50
53
  }
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2022 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import type { TemplateResult } from 'lit';
7
+ import type { DirectiveResult } from 'lit/directive.js';
8
+ import type { ComboBoxItemModel } from '@vaadin/combo-box/src/vaadin-combo-box.js';
9
+ import { LitRendererDirective } from '@vaadin/lit-renderer';
10
+ import type { MultiSelectComboBox } from '../vaadin-multi-select-combo-box.js';
11
+
12
+ export type MultiSelectComboBoxLitRenderer<TItem> = (
13
+ item: TItem,
14
+ model: ComboBoxItemModel<TItem>,
15
+ comboBox: MultiSelectComboBox<TItem>,
16
+ ) => TemplateResult;
17
+
18
+ export class MultiSelectComboBoxRendererDirective<TItem> extends LitRendererDirective<
19
+ MultiSelectComboBox,
20
+ MultiSelectComboBoxLitRenderer<TItem>
21
+ > {
22
+ /**
23
+ * Adds the renderer callback to the combo-box.
24
+ */
25
+ addRenderer(): void;
26
+
27
+ /**
28
+ * Runs the renderer callback on the combo-box.
29
+ */
30
+ runRenderer(): void;
31
+
32
+ /**
33
+ * Removes the renderer callback from the combo-box.
34
+ */
35
+ removeRenderer(): void;
36
+ }
37
+
38
+ /**
39
+ * A Lit directive for rendering the content of the `<vaadin-multi-select-combo-box-item>` elements.
40
+ *
41
+ * The directive accepts a renderer callback returning a Lit template and assigns it to the combo-box
42
+ * via the `renderer` property. The renderer is called for each combo-box item when assigned
43
+ * and whenever a single dependency or an array of dependencies changes.
44
+ * It is not guaranteed that the renderer will be called immediately (synchronously) in both cases.
45
+ *
46
+ * Dependencies can be a single value or an array of values.
47
+ * Values are checked against previous values with strict equality (`===`),
48
+ * so the check won't detect nested property changes inside objects or arrays.
49
+ * When dependencies are provided as an array, each item is checked against the previous value
50
+ * at the same index with strict equality. Nested arrays are also checked only by strict
51
+ * equality.
52
+ *
53
+ * Example of usage:
54
+ * ```js
55
+ * `<vaadin-multi-select-combo-box
56
+ * ${multiSelectComboBoxRenderer((item, model, comboBox) => html`...`)}
57
+ * ></vaadin-multi-select-combo-box>`
58
+ * ```
59
+ *
60
+ * @param renderer the renderer callback that returns a Lit template.
61
+ * @param dependencies a single dependency or an array of dependencies
62
+ * which trigger a re-render when changed.
63
+ */
64
+ export declare function multiSelectComboBoxRenderer<TItem>(
65
+ renderer: MultiSelectComboBoxLitRenderer<TItem>,
66
+ dependencies?: unknown,
67
+ ): DirectiveResult<typeof MultiSelectComboBoxRendererDirective>;
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2022 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import { directive } from 'lit/directive.js';
7
+ import { LitRendererDirective } from '@vaadin/lit-renderer';
8
+
9
+ export class MultiSelectComboBoxRendererDirective extends LitRendererDirective {
10
+ /**
11
+ * Adds the renderer callback to the combo-box.
12
+ */
13
+ addRenderer() {
14
+ this.element.renderer = (root, comboBox, model) => {
15
+ this.renderRenderer(root, model.item, model, comboBox);
16
+ };
17
+ }
18
+
19
+ /**
20
+ * Runs the renderer callback on the combo-box.
21
+ */
22
+ runRenderer() {
23
+ this.element.requestContentUpdate();
24
+ }
25
+
26
+ /**
27
+ * Removes the renderer callback from the combo-box.
28
+ */
29
+ removeRenderer() {
30
+ this.element.renderer = null;
31
+ }
32
+ }
33
+
34
+ /**
35
+ * A Lit directive for rendering the content of the `<vaadin-multi-select-combo-box-item>` elements.
36
+ *
37
+ * The directive accepts a renderer callback returning a Lit template and assigns it to the combo-box
38
+ * via the `renderer` property. The renderer is called for each combo-box item when assigned
39
+ * and whenever a single dependency or an array of dependencies changes.
40
+ * It is not guaranteed that the renderer will be called immediately (synchronously) in both cases.
41
+ *
42
+ * Dependencies can be a single value or an array of values.
43
+ * Values are checked against previous values with strict equality (`===`),
44
+ * so the check won't detect nested property changes inside objects or arrays.
45
+ * When dependencies are provided as an array, each item is checked against the previous value
46
+ * at the same index with strict equality. Nested arrays are also checked only by strict
47
+ * equality.
48
+ *
49
+ * Example of usage:
50
+ * ```js
51
+ * `<vaadin-multi-select-combo-box
52
+ * ${multiSelectComboBoxRenderer((item, model, comboBox) => html`...`)}
53
+ * ></vaadin-multi-select-combo-box>`
54
+ * ```
55
+ *
56
+ * @param renderer the renderer callback that returns a Lit template.
57
+ * @param dependencies a single dependency or an array of dependencies
58
+ * which trigger a re-render when changed.
59
+ */
60
+ export const multiSelectComboBoxRenderer = directive(MultiSelectComboBoxRendererDirective);
@@ -3,7 +3,9 @@
3
3
  * Copyright (c) 2021 - 2022 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-multi-select-combo-box-dropdown.js';
6
+ import './vaadin-multi-select-combo-box-item.js';
7
+ import './vaadin-multi-select-combo-box-overlay.js';
8
+ import './vaadin-multi-select-combo-box-scroller.js';
7
9
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
8
10
  import { ComboBoxDataProviderMixin } from '@vaadin/combo-box/src/vaadin-combo-box-data-provider-mixin.js';
9
11
  import { ComboBoxMixin } from '@vaadin/combo-box/src/vaadin-combo-box-mixin.js';
@@ -34,17 +36,16 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
34
36
 
35
37
  <slot></slot>
36
38
 
37
- <vaadin-multi-select-combo-box-dropdown
38
- id="dropdown"
39
- opened="[[opened]]"
39
+ <vaadin-multi-select-combo-box-overlay
40
+ id="overlay"
41
+ hidden$="[[_isOverlayHidden(filteredItems, loading)]]"
42
+ opened="[[_overlayOpened]]"
43
+ loading$="[[loading]]"
44
+ theme$="[[_theme]]"
40
45
  position-target="[[_target]]"
41
- renderer="[[renderer]]"
42
- _focused-index="[[_focusedIndex]]"
43
- _item-id-path="[[itemIdPath]]"
44
- _item-label-path="[[itemLabelPath]]"
45
- loading="[[loading]]"
46
- theme="[[theme]]"
47
- ></vaadin-multi-select-combo-box-dropdown>
46
+ no-vertical-overlap
47
+ restore-focus-node="[[inputElement]]"
48
+ ></vaadin-multi-select-combo-box-overlay>
48
49
  `;
49
50
  }
50
51
 
@@ -101,10 +102,6 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
101
102
  };
102
103
  }
103
104
 
104
- static get observers() {
105
- return ['_readonlyItemsChanged(readonly, selectedItems)'];
106
- }
107
-
108
105
  /**
109
106
  * Reference to the clear button element.
110
107
  * @protected
@@ -114,6 +111,15 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
114
111
  return this.querySelector('[part="clear-button"]');
115
112
  }
116
113
 
114
+ /**
115
+ * Tag name prefix used by scroller and items.
116
+ * @protected
117
+ * @return {string}
118
+ */
119
+ get _tagNamePrefix() {
120
+ return 'vaadin-multi-select-combo-box';
121
+ }
122
+
117
123
  /**
118
124
  * Override method inherited from the combo-box
119
125
  * to allow opening dropdown when readonly.
@@ -125,14 +131,6 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
125
131
  }
126
132
  }
127
133
 
128
- /**
129
- * @protected
130
- * @override
131
- */
132
- _getItemElements() {
133
- return Array.from(this.$.dropdown._scroller.querySelectorAll('vaadin-multi-select-combo-box-item'));
134
- }
135
-
136
134
  /** @protected */
137
135
  ready() {
138
136
  super.ready();
@@ -141,6 +139,20 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
141
139
  this._toggleElement = this.querySelector('.toggle-button');
142
140
  }
143
141
 
142
+ /**
143
+ * Override combo-box method to set correct owner for using by item renderers.
144
+ * This needs to be done before the scroller gets added to the DOM to ensure
145
+ * Lit directive works in case when combo-box is opened using attribute.
146
+ *
147
+ * @protected
148
+ * @override
149
+ */
150
+ _initScroller() {
151
+ const comboBox = this.getRootNode().host;
152
+
153
+ super._initScroller(comboBox);
154
+ }
155
+
144
156
  /**
145
157
  * Override method from `InputMixin`.
146
158
  *
@@ -299,19 +311,6 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
299
311
  }
300
312
  }
301
313
 
302
- /**
303
- * Override method inherited from the combo-box
304
- * to render only selected items when read-only,
305
- * even if a different set of items is provided.
306
- *
307
- * @protected
308
- * @override
309
- */
310
- _setOverlayItems(items) {
311
- const effectiveItems = this.readonly ? this.selectedItems : items;
312
- super._setOverlayItems(effectiveItems);
313
- }
314
-
315
314
  /**
316
315
  * Override method inherited from the combo-box
317
316
  * to not request data provider when read-only.
@@ -328,20 +327,6 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
328
327
 
329
328
  return super._shouldLoadPage(page);
330
329
  }
331
-
332
- /** @private */
333
- _readonlyItemsChanged(readonly, selectedItems) {
334
- if (readonly && selectedItems) {
335
- this.__savedItems = this._getOverlayItems();
336
- this._setOverlayItems(selectedItems);
337
- }
338
-
339
- // Restore the original dropdown items
340
- if (readonly === false && this.__savedItems) {
341
- this._setOverlayItems(this.__savedItems);
342
- this.__savedItems = null;
343
- }
344
- }
345
330
  }
346
331
 
347
332
  customElements.define(MultiSelectComboBoxInternal.is, MultiSelectComboBoxInternal);
@@ -3,26 +3,26 @@
3
3
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import {
6
+ import type {
7
7
  ComboBoxDataProvider,
8
8
  ComboBoxDefaultItem,
9
9
  ComboBoxItemModel,
10
10
  } from '@vaadin/combo-box/src/vaadin-combo-box.js';
11
- import { ControllerMixinClass } from '@vaadin/component-base/src/controller-mixin.js';
12
- import { DisabledMixinClass } from '@vaadin/component-base/src/disabled-mixin.js';
13
- import { ElementMixinClass } from '@vaadin/component-base/src/element-mixin.js';
14
- import { FocusMixinClass } from '@vaadin/component-base/src/focus-mixin.js';
15
- import { KeyboardMixinClass } from '@vaadin/component-base/src/keyboard-mixin.js';
16
- import { ResizeMixinClass } from '@vaadin/component-base/src/resize-mixin.js';
17
- import { DelegateFocusMixinClass } from '@vaadin/field-base/src/delegate-focus-mixin.js';
18
- import { DelegateStateMixinClass } from '@vaadin/field-base/src/delegate-state-mixin.js';
19
- import { FieldMixinClass } from '@vaadin/field-base/src/field-mixin.js';
20
- import { InputConstraintsMixinClass } from '@vaadin/field-base/src/input-constraints-mixin.js';
21
- import { InputControlMixinClass } from '@vaadin/field-base/src/input-control-mixin.js';
22
- import { InputMixinClass } from '@vaadin/field-base/src/input-mixin.js';
23
- import { LabelMixinClass } from '@vaadin/field-base/src/label-mixin.js';
24
- import { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.js';
25
- import { ThemableMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
+ import type { ControllerMixinClass } from '@vaadin/component-base/src/controller-mixin.js';
12
+ import type { DisabledMixinClass } from '@vaadin/component-base/src/disabled-mixin.js';
13
+ import type { ElementMixinClass } from '@vaadin/component-base/src/element-mixin.js';
14
+ import type { FocusMixinClass } from '@vaadin/component-base/src/focus-mixin.js';
15
+ import type { KeyboardMixinClass } from '@vaadin/component-base/src/keyboard-mixin.js';
16
+ import type { ResizeMixinClass } from '@vaadin/component-base/src/resize-mixin.js';
17
+ import type { DelegateFocusMixinClass } from '@vaadin/field-base/src/delegate-focus-mixin.js';
18
+ import type { DelegateStateMixinClass } from '@vaadin/field-base/src/delegate-state-mixin.js';
19
+ import type { FieldMixinClass } from '@vaadin/field-base/src/field-mixin.js';
20
+ import type { InputConstraintsMixinClass } from '@vaadin/field-base/src/input-constraints-mixin.js';
21
+ import type { InputControlMixinClass } from '@vaadin/field-base/src/input-control-mixin.js';
22
+ import type { InputMixinClass } from '@vaadin/field-base/src/input-mixin.js';
23
+ import type { LabelMixinClass } from '@vaadin/field-base/src/label-mixin.js';
24
+ import type { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.js';
25
+ import type { ThemableMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
26
26
 
27
27
  export type MultiSelectComboBoxRenderer<TItem> = (
28
28
  root: HTMLElement,
@@ -65,6 +65,11 @@ export type MultiSelectComboBoxInvalidChangedEvent = CustomEvent<{ value: boolea
65
65
  */
66
66
  export type MultiSelectComboBoxSelectedItemsChangedEvent<TItem> = CustomEvent<{ value: TItem[] }>;
67
67
 
68
+ /**
69
+ * Fired whenever the field is validated.
70
+ */
71
+ export type MultiSelectComboBoxValidatedEvent = CustomEvent<{ valid: boolean }>;
72
+
68
73
  export interface MultiSelectComboBoxEventMap<TItem> extends HTMLElementEventMap {
69
74
  change: MultiSelectComboBoxChangeEvent<TItem>;
70
75
 
@@ -75,6 +80,8 @@ export interface MultiSelectComboBoxEventMap<TItem> extends HTMLElementEventMap
75
80
  'invalid-changed': MultiSelectComboBoxInvalidChangedEvent;
76
81
 
77
82
  'selected-items-changed': MultiSelectComboBoxSelectedItemsChangedEvent<TItem>;
83
+
84
+ validated: MultiSelectComboBoxValidatedEvent;
78
85
  }
79
86
 
80
87
  /**
@@ -131,6 +138,7 @@ export interface MultiSelectComboBoxEventMap<TItem> extends HTMLElementEventMap
131
138
  * Custom property | Description | Default
132
139
  * -----------------------------------------------------|----------------------------|--------
133
140
  * `--vaadin-field-default-width` | Default width of the field | `12em`
141
+ * `--vaadin-multi-select-combo-box-overlay-width` | Width of the overlay | `auto`
134
142
  * `--vaadin-multi-select-combo-box-overlay-max-height` | Max height of the overlay | `65vh`
135
143
  * `--vaadin-multi-select-combo-box-input-min-width` | Min width of the input | `4em`
136
144
  *
@@ -153,6 +161,7 @@ export interface MultiSelectComboBoxEventMap<TItem> extends HTMLElementEventMap
153
161
  * @fires {CustomEvent} filter-changed - Fired when the `filter` property changes.
154
162
  * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
155
163
  * @fires {CustomEvent} selected-items-changed - Fired when the `selectedItems` property changes.
164
+ * @fires {CustomEvent} validated - Fired whenever the field is validated.
156
165
  */
157
166
  declare class MultiSelectComboBox<TItem = ComboBoxDefaultItem> extends HTMLElement {
158
167
  /**
@@ -109,6 +109,7 @@ registerStyles('vaadin-multi-select-combo-box', [inputFieldShared, multiSelectCo
109
109
  * Custom property | Description | Default
110
110
  * -----------------------------------------------------|----------------------------|--------
111
111
  * `--vaadin-field-default-width` | Default width of the field | `12em`
112
+ * `--vaadin-multi-select-combo-box-overlay-width` | Width of the overlay | `auto`
112
113
  * `--vaadin-multi-select-combo-box-overlay-max-height` | Max height of the overlay | `65vh`
113
114
  * `--vaadin-multi-select-combo-box-input-min-width` | Min width of the input | `4em`
114
115
  *
@@ -131,6 +132,7 @@ registerStyles('vaadin-multi-select-combo-box', [inputFieldShared, multiSelectCo
131
132
  * @fires {CustomEvent} filter-changed - Fired when the `filter` property changes.
132
133
  * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
133
134
  * @fires {CustomEvent} selected-items-changed - Fired when the `selectedItems` property changes.
135
+ * @fires {CustomEvent} validated - Fired whenever the field is validated.
134
136
  *
135
137
  * @extends HTMLElement
136
138
  * @mixes ElementMixin
@@ -153,7 +155,7 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
153
155
 
154
156
  <vaadin-multi-select-combo-box-internal
155
157
  id="comboBox"
156
- items="[[items]]"
158
+ items="[[__effectiveItems]]"
157
159
  item-id-path="[[itemIdPath]]"
158
160
  item-label-path="[[itemLabelPath]]"
159
161
  item-value-path="[[itemValuePath]]"
@@ -166,7 +168,7 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
166
168
  last-filter="{{_lastFilter}}"
167
169
  loading="{{loading}}"
168
170
  size="{{size}}"
169
- filtered-items="[[filteredItems]]"
171
+ filtered-items="[[__effectiveFilteredItems]]"
170
172
  selected-items="[[selectedItems]]"
171
173
  opened="{{opened}}"
172
174
  renderer="[[renderer]]"
@@ -424,6 +426,18 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
424
426
  */
425
427
  filteredItems: Array,
426
428
 
429
+ /** @private */
430
+ __effectiveItems: {
431
+ type: Array,
432
+ computed: '__computeEffectiveItems(items, selectedItems, readonly)',
433
+ },
434
+
435
+ /** @private */
436
+ __effectiveFilteredItems: {
437
+ type: Array,
438
+ computed: '__computeEffectiveFilteredItems(items, filteredItems, selectedItems, readonly)',
439
+ },
440
+
427
441
  /** @protected */
428
442
  _hasValue: {
429
443
  type: Boolean,
@@ -681,7 +695,7 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
681
695
 
682
696
  /** @private */
683
697
  _getItemLabel(item) {
684
- return item && Object.prototype.hasOwnProperty.call(item, this.itemLabelPath) ? item[this.itemLabelPath] : item;
698
+ return this.$.comboBox._getItemLabel(item);
685
699
  }
686
700
 
687
701
  /** @private */
@@ -749,7 +763,8 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
749
763
  const itemsCopy = [...this.selectedItems];
750
764
  itemsCopy.splice(itemsCopy.indexOf(item), 1);
751
765
  this.__updateSelection(itemsCopy);
752
- this.__announceItem(item, false, itemsCopy.length);
766
+ const itemLabel = this._getItemLabel(item);
767
+ this.__announceItem(itemLabel, false, itemsCopy.length);
753
768
  }
754
769
 
755
770
  /** @private */
@@ -1077,6 +1092,16 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
1077
1092
  // and keep the overlay opened when clicking a chip.
1078
1093
  event.preventDefault();
1079
1094
  }
1095
+
1096
+ /** @private */
1097
+ __computeEffectiveItems(items, selectedItems, readonly) {
1098
+ return items && readonly ? selectedItems : items;
1099
+ }
1100
+
1101
+ /** @private */
1102
+ __computeEffectiveFilteredItems(items, filteredItems, selectedItems, readonly) {
1103
+ return !items && readonly ? selectedItems : filteredItems;
1104
+ }
1080
1105
  }
1081
1106
 
1082
1107
  customElements.define(MultiSelectComboBox.is, MultiSelectComboBox);
@@ -1,47 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 - 2022 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-item.js';
7
- import './vaadin-multi-select-combo-box-overlay.js';
8
- import './vaadin-multi-select-combo-box-scroller.js';
9
- import { html } from '@polymer/polymer/lib/utils/html-tag.js';
10
- import { ComboBoxDropdown } from '@vaadin/combo-box/src/vaadin-combo-box-dropdown.js';
11
-
12
- /**
13
- * An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
14
- *
15
- * @extends ComboBoxDropdown
16
- * @private
17
- */
18
- class MultiSelectComboBoxDropdown extends ComboBoxDropdown {
19
- static get is() {
20
- return 'vaadin-multi-select-combo-box-dropdown';
21
- }
22
-
23
- static get template() {
24
- return html`
25
- <vaadin-multi-select-combo-box-overlay
26
- id="overlay"
27
- hidden$="[[_isOverlayHidden(_items.*, loading)]]"
28
- loading$="[[loading]]"
29
- opened="{{_overlayOpened}}"
30
- theme$="[[theme]]"
31
- position-target="[[positionTarget]]"
32
- no-vertical-overlap
33
- ></vaadin-multi-select-combo-box-overlay>
34
- `;
35
- }
36
-
37
- /** @protected */
38
- ready() {
39
- super.ready();
40
-
41
- // Set owner for using by item renderers
42
- const comboBox = this.getRootNode().host;
43
- this._scroller.comboBox = comboBox.getRootNode().host;
44
- }
45
- }
46
-
47
- customElements.define(MultiSelectComboBoxDropdown.is, MultiSelectComboBoxDropdown);