@vaadin/multi-select-combo-box 25.0.0-alpha7 → 25.0.0-alpha9

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.
@@ -26,7 +26,7 @@ import { multiSelectComboBoxOverlayStyles } from './styles/vaadin-multi-select-c
26
26
  * @private
27
27
  */
28
28
  class MultiSelectComboBoxOverlay extends ComboBoxOverlayMixin(
29
- OverlayMixin(DirMixin(LumoInjectionMixin(ThemableMixin(PolylitMixin(LitElement))))),
29
+ OverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))),
30
30
  ) {
31
31
  static get is() {
32
32
  return 'vaadin-multi-select-combo-box-overlay';
@@ -39,7 +39,6 @@ class MultiSelectComboBoxOverlay extends ComboBoxOverlayMixin(
39
39
  /** @protected */
40
40
  render() {
41
41
  return html`
42
- <div id="backdrop" part="backdrop" hidden></div>
43
42
  <div part="overlay" id="overlay">
44
43
  <div part="loader"></div>
45
44
  <div part="content" id="content"><slot></slot></div>
@@ -8,8 +8,12 @@ import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js
8
8
  import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
9
9
  import type { KeyboardMixinClass } from '@vaadin/a11y-base/src/keyboard-mixin.js';
10
10
  import type { ComboBoxDefaultItem } from '@vaadin/combo-box/src/vaadin-combo-box.js';
11
+ import type { ComboBoxBaseMixinClass } from '@vaadin/combo-box/src/vaadin-combo-box-base-mixin.js';
12
+ import type { ComboBoxDataProviderMixinClass } from '@vaadin/combo-box/src/vaadin-combo-box-data-provider-mixin.js';
13
+ import type { ComboBoxItemsMixinClass } from '@vaadin/combo-box/src/vaadin-combo-box-items-mixin.js';
11
14
  import type { DelegateStateMixinClass } from '@vaadin/component-base/src/delegate-state-mixin.js';
12
15
  import type { ElementMixinClass } from '@vaadin/component-base/src/element-mixin.js';
16
+ import type { OverlayClassMixinClass } from '@vaadin/component-base/src/overlay-class-mixin.js';
13
17
  import type { ResizeMixinClass } from '@vaadin/component-base/src/resize-mixin.js';
14
18
  import type { SlotStylesMixinClass } from '@vaadin/component-base/src/slot-styles-mixin.js';
15
19
  import type { ClearButtonMixinClass } from '@vaadin/field-base/src/clear-button-mixin.js';
@@ -106,6 +110,9 @@ export interface MultiSelectComboBoxEventMap<TItem> extends HTMLElementEventMap
106
110
  * `helper-text` | The helper text element wrapper
107
111
  * `required-indicator` | The `required` state indicator element
108
112
  * `toggle-button` | The toggle button
113
+ * `overlay` | The overlay container
114
+ * `content` | The overlay content
115
+ * `loader` | The loading indicator shown while loading items
109
116
  *
110
117
  * The following state attributes are available for styling:
111
118
  *
@@ -137,12 +144,8 @@ export interface MultiSelectComboBoxEventMap<TItem> extends HTMLElementEventMap
137
144
  * In addition to `<vaadin-multi-select-combo-box>` itself, the following internal
138
145
  * components are themable:
139
146
  *
140
- * - `<vaadin-multi-select-combo-box-overlay>` - has the same API as `<vaadin-overlay>`.
147
+ * - `<vaadin-multi-select-combo-box-chip>`
141
148
  * - `<vaadin-multi-select-combo-box-item>` - has the same API as `<vaadin-item>`.
142
- * - `<vaadin-multi-select-combo-box-container>` - has the same API as `<vaadin-input-container>`.
143
- *
144
- * Note: the `theme` attribute value set on `<vaadin-multi-select-combo-box>` is
145
- * propagated to these components.
146
149
  *
147
150
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
148
151
  *
@@ -169,7 +172,10 @@ declare class MultiSelectComboBox<TItem = ComboBoxDefaultItem> extends HTMLEleme
169
172
  }
170
173
 
171
174
  interface MultiSelectComboBox<TItem = ComboBoxDefaultItem>
172
- extends ValidateMixinClass,
175
+ extends ComboBoxBaseMixinClass,
176
+ ComboBoxDataProviderMixinClass<TItem>,
177
+ ComboBoxItemsMixinClass<TItem>,
178
+ ValidateMixinClass,
173
179
  SlotStylesMixinClass,
174
180
  LabelMixinClass,
175
181
  KeyboardMixinClass,
@@ -183,6 +189,7 @@ interface MultiSelectComboBox<TItem = ComboBoxDefaultItem>
183
189
  DelegateStateMixinClass,
184
190
  DelegateFocusMixinClass,
185
191
  MultiSelectComboBoxMixinClass<TItem>,
192
+ OverlayClassMixinClass,
186
193
  ResizeMixinClass,
187
194
  ThemableMixinClass,
188
195
  ThemePropertyMixinClass,
@@ -5,7 +5,9 @@
5
5
  */
6
6
  import './vaadin-multi-select-combo-box-chip.js';
7
7
  import './vaadin-multi-select-combo-box-container.js';
8
- import './vaadin-multi-select-combo-box-internal.js';
8
+ import './vaadin-multi-select-combo-box-item.js';
9
+ import './vaadin-multi-select-combo-box-overlay.js';
10
+ import './vaadin-multi-select-combo-box-scroller.js';
9
11
  import { html, LitElement } from 'lit';
10
12
  import { ifDefined } from 'lit/directives/if-defined.js';
11
13
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
@@ -45,6 +47,9 @@ import { MultiSelectComboBoxMixin } from './vaadin-multi-select-combo-box-mixin.
45
47
  * `helper-text` | The helper text element wrapper
46
48
  * `required-indicator` | The `required` state indicator element
47
49
  * `toggle-button` | The toggle button
50
+ * `overlay` | The overlay container
51
+ * `content` | The overlay content
52
+ * `loader` | The loading indicator shown while loading items
48
53
  *
49
54
  * The following state attributes are available for styling:
50
55
  *
@@ -76,12 +81,8 @@ import { MultiSelectComboBoxMixin } from './vaadin-multi-select-combo-box-mixin.
76
81
  * In addition to `<vaadin-multi-select-combo-box>` itself, the following internal
77
82
  * components are themable:
78
83
  *
79
- * - `<vaadin-multi-select-combo-box-overlay>` - has the same API as `<vaadin-overlay>`.
84
+ * - `<vaadin-multi-select-combo-box-chip>`
80
85
  * - `<vaadin-multi-select-combo-box-item>` - has the same API as `<vaadin-item>`.
81
- * - `<vaadin-multi-select-combo-box-container>` - has the same API as `<vaadin-input-container>`.
82
- *
83
- * Note: the `theme` attribute value set on `<vaadin-multi-select-combo-box>` is
84
- * propagated to these components.
85
86
  *
86
87
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
87
88
  *
@@ -100,7 +101,7 @@ import { MultiSelectComboBoxMixin } from './vaadin-multi-select-combo-box-mixin.
100
101
  * @mixes MultiSelectComboBoxMixin
101
102
  */
102
103
  class MultiSelectComboBox extends MultiSelectComboBoxMixin(
103
- LumoInjectionMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))),
104
+ ThemableMixin(ElementMixin(PolylitMixin(LumoInjectionMixin(LitElement)))),
104
105
  ) {
105
106
  static get is() {
106
107
  return 'vaadin-multi-select-combo-box';
@@ -119,65 +120,22 @@ class MultiSelectComboBox extends MultiSelectComboBoxMixin(
119
120
  <span part="required-indicator" aria-hidden="true" @click="${this.focus}"></span>
120
121
  </div>
121
122
 
122
- <vaadin-multi-select-combo-box-internal
123
- id="comboBox"
124
- .owner="${this}"
125
- .filteredItems="${this.filteredItems}"
126
- .items="${this.items}"
127
- .itemIdPath="${this.itemIdPath}"
128
- .itemLabelPath="${this.itemLabelPath}"
129
- .itemValuePath="${this.itemValuePath}"
130
- .disabled="${this.disabled}"
123
+ <vaadin-multi-select-combo-box-container
124
+ part="input-field"
125
+ .autoExpandVertically="${this.autoExpandVertically}"
131
126
  .readonly="${this.readonly}"
132
- .autoOpenDisabled="${this.autoOpenDisabled}"
133
- .allowCustomValue="${this.allowCustomValue}"
134
- .overlayClass="${this.overlayClass}"
135
- .dataProvider="${this.dataProvider}"
136
- .filter="${this.filter}"
137
- .lastFilter="${this._lastFilter}"
138
- .loading="${this.loading}"
139
- .size="${this.size}"
140
- .selectedItems="${this.selectedItems}"
141
- .selectedItemsOnTop="${this.selectedItemsOnTop}"
142
- .itemClassNameGenerator="${this.itemClassNameGenerator}"
143
- .topGroup="${this._topGroup}"
144
- .opened="${this.opened}"
145
- .renderer="${this.renderer}"
146
- .keepFilter="${this.keepFilter}"
127
+ .disabled="${this.disabled}"
128
+ .invalid="${this.invalid}"
147
129
  theme="${ifDefined(this._theme)}"
148
- @combo-box-item-selected="${this._onComboBoxItemSelected}"
149
- @change="${this._onComboBoxChange}"
150
- @custom-value-set="${this._onCustomValueSet}"
151
- @filtered-items-changed="${this._onFilteredItemsChanged}"
152
- @filter-changed="${this._onComboBoxFilterChanged}"
153
- @last-filter-changed="${this._onComboBoxLastFilterChanged}"
154
- @loading-changed="${this._onComboBoxLoadingChanged}"
155
- @opened-changed="${this._onComboBoxOpenedChanged}"
156
- @size-changed="${this._onComboBoxSizeChanged}"
157
130
  >
158
- <vaadin-multi-select-combo-box-container
159
- part="input-field"
160
- .autoExpandVertically="${this.autoExpandVertically}"
161
- .readonly="${this.readonly}"
162
- .disabled="${this.disabled}"
163
- .invalid="${this.invalid}"
164
- theme="${ifDefined(this._theme)}"
165
- >
166
- <slot name="overflow" slot="prefix"></slot>
167
- <div id="chips" part="chips" slot="prefix">
168
- <slot name="chip"></slot>
169
- </div>
170
- <slot name="input"></slot>
171
- <div
172
- id="clearButton"
173
- part="clear-button"
174
- slot="suffix"
175
- @touchend="${this._onClearButtonTouchend}"
176
- aria-hidden="true"
177
- ></div>
178
- <div id="toggleButton" class="toggle-button" part="toggle-button" slot="suffix" aria-hidden="true"></div>
179
- </vaadin-multi-select-combo-box-container>
180
- </vaadin-multi-select-combo-box-internal>
131
+ <slot name="overflow" slot="prefix"></slot>
132
+ <div id="chips" part="chips" slot="prefix">
133
+ <slot name="chip"></slot>
134
+ </div>
135
+ <slot name="input"></slot>
136
+ <div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
137
+ <div id="toggleButton" part="toggle-button" slot="suffix" aria-hidden="true"></div>
138
+ </vaadin-multi-select-combo-box-container>
181
139
 
182
140
  <div part="helper-text">
183
141
  <slot name="helper"></slot>
@@ -188,34 +146,23 @@ class MultiSelectComboBox extends MultiSelectComboBoxMixin(
188
146
  </div>
189
147
  </div>
190
148
 
149
+ <vaadin-multi-select-combo-box-overlay
150
+ id="overlay"
151
+ exportparts="overlay, content, loader"
152
+ .owner="${this}"
153
+ .dir="${this.dir}"
154
+ .opened="${this._overlayOpened}"
155
+ ?loading="${this.loading}"
156
+ theme="${ifDefined(this._theme)}"
157
+ .positionTarget="${this._inputField}"
158
+ no-vertical-overlap
159
+ >
160
+ <slot name="overlay"></slot>
161
+ </vaadin-multi-select-combo-box-overlay>
162
+
191
163
  <slot name="tooltip"></slot>
192
164
  `;
193
165
  }
194
-
195
- /** @private */
196
- _onComboBoxFilterChanged(event) {
197
- this.filter = event.detail.value;
198
- }
199
-
200
- /** @private */
201
- _onComboBoxLoadingChanged(event) {
202
- this.loading = event.detail.value;
203
- }
204
-
205
- /** @private */
206
- _onComboBoxLastFilterChanged(event) {
207
- this._lastFilter = event.detail.value;
208
- }
209
-
210
- /** @private */
211
- _onComboBoxOpenedChanged(event) {
212
- this.opened = event.detail.value;
213
- }
214
-
215
- /** @private */
216
- _onComboBoxSizeChanged(event) {
217
- this.size = event.detail.value;
218
- }
219
166
  }
220
167
 
221
168
  defineCustomElement(MultiSelectComboBox);