@vaadin/multi-select-combo-box 24.3.2 → 24.4.0-alpha2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/multi-select-combo-box",
3
- "version": "24.3.2",
3
+ "version": "24.4.0-alpha2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -18,6 +18,7 @@
18
18
  },
19
19
  "main": "vaadin-multi-select-combo-box.js",
20
20
  "module": "vaadin-multi-select-combo-box.js",
21
+ "type": "module",
21
22
  "files": [
22
23
  "lit.d.ts",
23
24
  "lit.js",
@@ -37,17 +38,17 @@
37
38
  ],
38
39
  "dependencies": {
39
40
  "@polymer/polymer": "^3.0.0",
40
- "@vaadin/a11y-base": "~24.3.2",
41
- "@vaadin/combo-box": "~24.3.2",
42
- "@vaadin/component-base": "~24.3.2",
43
- "@vaadin/field-base": "~24.3.2",
44
- "@vaadin/input-container": "~24.3.2",
45
- "@vaadin/item": "~24.3.2",
46
- "@vaadin/lit-renderer": "~24.3.2",
47
- "@vaadin/overlay": "~24.3.2",
48
- "@vaadin/vaadin-lumo-styles": "~24.3.2",
49
- "@vaadin/vaadin-material-styles": "~24.3.2",
50
- "@vaadin/vaadin-themable-mixin": "~24.3.2"
41
+ "@vaadin/a11y-base": "24.4.0-alpha2",
42
+ "@vaadin/combo-box": "24.4.0-alpha2",
43
+ "@vaadin/component-base": "24.4.0-alpha2",
44
+ "@vaadin/field-base": "24.4.0-alpha2",
45
+ "@vaadin/input-container": "24.4.0-alpha2",
46
+ "@vaadin/item": "24.4.0-alpha2",
47
+ "@vaadin/lit-renderer": "24.4.0-alpha2",
48
+ "@vaadin/overlay": "24.4.0-alpha2",
49
+ "@vaadin/vaadin-lumo-styles": "24.4.0-alpha2",
50
+ "@vaadin/vaadin-material-styles": "24.4.0-alpha2",
51
+ "@vaadin/vaadin-themable-mixin": "24.4.0-alpha2"
51
52
  },
52
53
  "devDependencies": {
53
54
  "@esm-bundle/chai": "^4.3.4",
@@ -59,5 +60,5 @@
59
60
  "web-types.json",
60
61
  "web-types.lit.json"
61
62
  ],
62
- "gitHead": "615ee9dd4611f52db90445b0db13dcbb91ca74d4"
63
+ "gitHead": "f303ead58d27e15d81a55db0559611fb77c0e421"
63
64
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
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) 2017 - 2023 Vaadin Ltd.
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 { directive } from 'lit/directive.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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';
@@ -120,6 +120,10 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
120
120
  };
121
121
  }
122
122
 
123
+ static get observers() {
124
+ return ['_readonlyChanged(readonly)'];
125
+ }
126
+
123
127
  /**
124
128
  * Reference to the clear button element.
125
129
  * @protected
@@ -157,6 +161,11 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
157
161
  this._toggleElement = this.querySelector('.toggle-button');
158
162
  }
159
163
 
164
+ /** @private */
165
+ _readonlyChanged() {
166
+ this._setDropdownItems(this.filteredItems);
167
+ }
168
+
160
169
  /**
161
170
  * Override combo-box method to group selected
162
171
  * items at the top of the overlay.
@@ -166,12 +175,12 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
166
175
  */
167
176
  _setDropdownItems(items) {
168
177
  if (this.readonly) {
169
- this._dropdownItems = this.selectedItems;
178
+ super._setDropdownItems(this.selectedItems);
170
179
  return;
171
180
  }
172
181
 
173
182
  if (this.filter || !this.selectedItemsOnTop) {
174
- this._dropdownItems = items;
183
+ super._setDropdownItems(items);
175
184
  return;
176
185
  }
177
186
 
@@ -181,11 +190,11 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
181
190
  (item) => this._comboBox._findIndex(item, this.topGroup, this.itemIdPath) === -1,
182
191
  );
183
192
 
184
- this._dropdownItems = this.topGroup.concat(filteredItems);
193
+ super._setDropdownItems(this.topGroup.concat(filteredItems));
185
194
  return;
186
195
  }
187
196
 
188
- this._dropdownItems = items;
197
+ super._setDropdownItems(items);
189
198
  }
190
199
 
191
200
  /** @private */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2018 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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 { Overlay } from '@vaadin/overlay/src/vaadin-overlay.js';
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(Overlay) {}
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 - 2023 Vaadin Ltd.
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 { Overlay } from '@vaadin/overlay/src/vaadin-overlay.js';
9
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10
-
11
- registerStyles(
12
- 'vaadin-multi-select-combo-box-overlay',
13
- css`
14
- #overlay {
15
- width: var(
16
- --vaadin-multi-select-combo-box-overlay-width,
17
- var(--_vaadin-multi-select-combo-box-overlay-default-width, auto)
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
- [part='content'] {
22
- display: flex;
23
- flex-direction: column;
24
- height: 100%;
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
- let memoizedTemplate;
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 ComboBoxOverlay
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(Overlay) {
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
- if (!memoizedTemplate) {
46
- memoizedTemplate = super.template.cloneNode(true);
47
-
48
- const overlay = memoizedTemplate.content.querySelector('[part~="overlay"]');
49
- overlay.removeAttribute('tabindex');
50
-
51
- const loader = document.createElement('div');
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 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 - 2023 Vaadin Ltd.
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="[[__effectiveItems]]"
166
+ items="[[items]]"
167
167
  item-id-path="[[itemIdPath]]"
168
168
  item-label-path="[[itemLabelPath]]"
169
169
  item-value-path="[[itemValuePath]]"
@@ -177,7 +177,7 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
177
177
  last-filter="{{_lastFilter}}"
178
178
  loading="{{loading}}"
179
179
  size="{{size}}"
180
- filtered-items="[[__effectiveFilteredItems]]"
180
+ filtered-items="[[filteredItems]]"
181
181
  selected-items="[[selectedItems]]"
182
182
  selected-items-on-top="[[selectedItemsOnTop]]"
183
183
  top-group="[[_topGroup]]"
@@ -486,18 +486,6 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
486
486
  type: String,
487
487
  },
488
488
 
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
489
  /** @private */
502
490
  _overflowItems: {
503
491
  type: Array,
@@ -1266,16 +1254,6 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
1266
1254
  // and keep the overlay opened when clicking a chip.
1267
1255
  event.preventDefault();
1268
1256
  }
1269
-
1270
- /** @private */
1271
- __computeEffectiveItems(items, selectedItems, readonly) {
1272
- return items && readonly ? selectedItems : items;
1273
- }
1274
-
1275
- /** @private */
1276
- __computeEffectiveFilteredItems(items, filteredItems, selectedItems, readonly) {
1277
- return !items && readonly ? selectedItems : filteredItems;
1278
- }
1279
1257
  }
1280
1258
 
1281
1259
  defineCustomElement(MultiSelectComboBox);
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 - 2023 Vaadin Ltd.
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/vaadin-lumo-styles/color.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 - 2023 Vaadin Ltd.
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';
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 - 2023 Vaadin Ltd.
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';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 - 2023 Vaadin Ltd.
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/vaadin-material-styles/color.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 - 2023 Vaadin Ltd.
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';
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 - 2023 Vaadin Ltd.
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.3.2",
4
+ "version": "24.4.0-alpha2",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -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.3.2",
4
+ "version": "24.4.0-alpha2",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {