@vaadin/multi-select-combo-box 24.0.0-alpha9 → 24.0.0-beta2

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.0.0-alpha9",
3
+ "version": "24.0.0-beta2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,18 +37,18 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@polymer/polymer": "^3.0.0",
40
- "@vaadin/combo-box": "24.0.0-alpha9",
41
- "@vaadin/component-base": "24.0.0-alpha9",
42
- "@vaadin/field-base": "24.0.0-alpha9",
43
- "@vaadin/input-container": "24.0.0-alpha9",
44
- "@vaadin/lit-renderer": "24.0.0-alpha9",
45
- "@vaadin/vaadin-lumo-styles": "24.0.0-alpha9",
46
- "@vaadin/vaadin-material-styles": "24.0.0-alpha9",
47
- "@vaadin/vaadin-themable-mixin": "24.0.0-alpha9"
40
+ "@vaadin/combo-box": "24.0.0-beta2",
41
+ "@vaadin/component-base": "24.0.0-beta2",
42
+ "@vaadin/field-base": "24.0.0-beta2",
43
+ "@vaadin/input-container": "24.0.0-beta2",
44
+ "@vaadin/lit-renderer": "24.0.0-beta2",
45
+ "@vaadin/vaadin-lumo-styles": "24.0.0-beta2",
46
+ "@vaadin/vaadin-material-styles": "24.0.0-beta2",
47
+ "@vaadin/vaadin-themable-mixin": "24.0.0-beta2"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@esm-bundle/chai": "^4.3.4",
51
- "@vaadin/testing-helpers": "^0.3.2",
51
+ "@vaadin/testing-helpers": "^0.4.0",
52
52
  "lit": "^2.0.0",
53
53
  "sinon": "^13.0.2"
54
54
  },
@@ -56,5 +56,5 @@
56
56
  "web-types.json",
57
57
  "web-types.lit.json"
58
58
  ],
59
- "gitHead": "cc3f747164041566b300bde4b105d2475649e93f"
59
+ "gitHead": "00086f1f6d487f042f189c9b9ecd7ba736960888"
60
60
  }
@@ -152,20 +152,6 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
152
152
  super._initScroller(comboBox);
153
153
  }
154
154
 
155
- /**
156
- * Override method from `InputMixin`.
157
- *
158
- * @protected
159
- * @override
160
- */
161
- clear() {
162
- super.clear();
163
-
164
- if (this.inputElement) {
165
- this.inputElement.value = '';
166
- }
167
- }
168
-
169
155
  /**
170
156
  * Override Enter handler to keep overlay open
171
157
  * when item is selected or unselected.
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2018 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import type { ComboBoxDefaultItem, ComboBoxItemMixinClass } from '@vaadin/combo-box/src/vaadin-combo-box-item-mixin.js';
7
+ import type { DirMixinClass } from '@vaadin/component-base/src/dir-mixin.js';
8
+ import type { ThemableMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
9
+ import type { MultiSelectComboBox } from './vaadin-multi-select-combo-box.js';
10
+
11
+ /**
12
+ * An item element used by the `<vaadin-multi-select-combo-box>` dropdown.
13
+ *
14
+ * ### Styling
15
+ *
16
+ * The following shadow DOM parts are available for styling:
17
+ *
18
+ * Part name | Description
19
+ * ------------|--------------
20
+ * `checkmark` | The graphical checkmark shown for a selected item
21
+ * `content` | The element that wraps the item content
22
+ *
23
+ * The following state attributes are exposed for styling:
24
+ *
25
+ * Attribute | Description
26
+ * -------------|-------------
27
+ * `selected` | Set when the item is selected
28
+ * `focused` | Set when the item is focused
29
+ *
30
+ * See [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.
31
+ */
32
+ declare class MultiSelectComboBoxItem extends HTMLElement {}
33
+
34
+ interface MultiSelectComboBoxItem<TItem = ComboBoxDefaultItem>
35
+ extends ComboBoxItemMixinClass<TItem, MultiSelectComboBox>,
36
+ DirMixinClass,
37
+ ThemableMixinClass {}
38
+
39
+ declare global {
40
+ interface HTMLElementTagNameMap {
41
+ 'vaadin-multi-select-combo-box-item': MultiSelectComboBoxItem;
42
+ }
43
+ }
44
+
45
+ export { MultiSelectComboBoxItem };
@@ -3,35 +3,59 @@
3
3
  * Copyright (c) 2021 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { ComboBoxItem } from '@vaadin/combo-box/src/vaadin-combo-box-item.js';
6
+ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
7
+ import { ComboBoxItemMixin } from '@vaadin/combo-box/src/vaadin-combo-box-item-mixin.js';
8
+ import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
7
10
 
8
11
  /**
9
- * An element used for items in `<vaadin-multi-select-combo-box>`.
12
+ * An item element used by the `<vaadin-multi-select-combo-box>` dropdown.
10
13
  *
11
14
  * ### Styling
12
15
  *
13
16
  * The following shadow DOM parts are available for styling:
14
17
  *
15
- * Part name | Description
16
- * ----------|-------------
17
- * `content` | The element that wraps the item content
18
+ * Part name | Description
19
+ * ------------|--------------
20
+ * `checkmark` | The graphical checkmark shown for a selected item
21
+ * `content` | The element that wraps the item content
18
22
  *
19
23
  * The following state attributes are exposed for styling:
20
24
  *
21
- * Attribute | Description | Part name
22
- * -----------|-------------------------------|-----------
23
- * `selected` | Set when the item is selected | :host
24
- * `focused` | Set when the item is focused | :host
25
+ * Attribute | Description
26
+ * -------------|-------------
27
+ * `selected` | Set when the item is selected
28
+ * `focused` | Set when the item is focused
25
29
  *
26
30
  * See [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.
27
31
  *
28
- * @extends ComboBoxItem
32
+ * @mixes ComboBoxItemMixin
33
+ * @mixes ThemableMixin
34
+ * @mixes DirMixin
29
35
  * @private
30
36
  */
31
- class MultiSelectComboBoxItem extends ComboBoxItem {
37
+ export class MultiSelectComboBoxItem extends ComboBoxItemMixin(ThemableMixin(DirMixin(PolymerElement))) {
32
38
  static get is() {
33
39
  return 'vaadin-multi-select-combo-box-item';
34
40
  }
41
+
42
+ static get template() {
43
+ return html`
44
+ <style>
45
+ :host {
46
+ display: block;
47
+ }
48
+
49
+ :host([hidden]) {
50
+ display: none !important;
51
+ }
52
+ </style>
53
+ <span part="checkmark" aria-hidden="true"></span>
54
+ <div part="content">
55
+ <slot></slot>
56
+ </div>
57
+ `;
58
+ }
35
59
  }
36
60
 
37
61
  customElements.define(MultiSelectComboBoxItem.is, MultiSelectComboBoxItem);
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2021 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import { ComboBoxOverlayMixin } from '@vaadin/combo-box/src/vaadin-combo-box-overlay-mixin.js';
7
+ import { Overlay } from '@vaadin/overlay/src/vaadin-overlay.js';
8
+
9
+ /**
10
+ * An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
11
+ */
12
+ declare class MultiSelectComboBoxOverlay extends ComboBoxOverlayMixin(Overlay) {}
13
+
14
+ declare global {
15
+ interface HTMLElementTagNameMap {
16
+ 'vaadin-multi-select-combo-box-overlay': MultiSelectComboBoxOverlay;
17
+ }
18
+ }
19
+
20
+ export { MultiSelectComboBoxOverlay };
@@ -3,7 +3,8 @@
3
3
  * Copyright (c) 2021 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { ComboBoxOverlay } from '@vaadin/combo-box/src/vaadin-combo-box-overlay.js';
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
8
  import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
9
 
9
10
  registerStyles(
@@ -15,20 +16,44 @@ registerStyles(
15
16
  var(--_vaadin-multi-select-combo-box-overlay-default-width, auto)
16
17
  );
17
18
  }
19
+
20
+ [part='content'] {
21
+ display: flex;
22
+ flex-direction: column;
23
+ height: 100%;
24
+ }
18
25
  `,
19
26
  { moduleId: 'vaadin-multi-select-combo-box-overlay-styles' },
20
27
  );
21
28
 
29
+ let memoizedTemplate;
30
+
22
31
  /**
23
32
  * An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
24
33
  *
25
34
  * @extends ComboBoxOverlay
26
35
  * @private
27
36
  */
28
- class MultiSelectComboBoxOverlay extends ComboBoxOverlay {
37
+ class MultiSelectComboBoxOverlay extends ComboBoxOverlayMixin(Overlay) {
29
38
  static get is() {
30
39
  return 'vaadin-multi-select-combo-box-overlay';
31
40
  }
41
+
42
+ static get template() {
43
+ if (!memoizedTemplate) {
44
+ memoizedTemplate = super.template.cloneNode(true);
45
+
46
+ const overlay = memoizedTemplate.content.querySelector('[part~="overlay"]');
47
+ overlay.removeAttribute('tabindex');
48
+
49
+ const loader = document.createElement('div');
50
+ loader.setAttribute('part', 'loader');
51
+
52
+ overlay.insertBefore(loader, overlay.firstElementChild);
53
+ }
54
+
55
+ return memoizedTemplate;
56
+ }
32
57
  }
33
58
 
34
59
  customElements.define(MultiSelectComboBoxOverlay.is, MultiSelectComboBoxOverlay);
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2021 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import { ComboBoxScrollerMixin } from '@vaadin/combo-box/src/vaadin-combo-box-scroller-mixin.js';
7
+
8
+ /**
9
+ * An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
10
+ */
11
+ declare class MultiSelectComboBoxScroller extends ComboBoxScrollerMixin(HTMLElement) {}
12
+
13
+ declare global {
14
+ interface HTMLElementTagNameMap {
15
+ 'vaadin-multi-select-combo-box-scroller': MultiSelectComboBoxScroller;
16
+ }
17
+ }
18
+
19
+ export { MultiSelectComboBoxScroller };
@@ -3,20 +3,52 @@
3
3
  * Copyright (c) 2021 - 2023 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 { ComboBoxPlaceholder } from '@vaadin/combo-box/src/vaadin-combo-box-placeholder.js';
7
- import { ComboBoxScroller } from '@vaadin/combo-box/src/vaadin-combo-box-scroller.js';
8
+ import { ComboBoxScrollerMixin } from '@vaadin/combo-box/src/vaadin-combo-box-scroller-mixin.js';
8
9
 
9
10
  /**
10
11
  * An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
11
12
  *
12
- * @extends ComboBoxScroller
13
+ * @extends HTMLElement
14
+ * @mixes ComboBoxScrollerMixin
13
15
  * @private
14
16
  */
15
- class MultiSelectComboBoxScroller extends ComboBoxScroller {
17
+ export class MultiSelectComboBoxScroller extends ComboBoxScrollerMixin(PolymerElement) {
16
18
  static get is() {
17
19
  return 'vaadin-multi-select-combo-box-scroller';
18
20
  }
19
21
 
22
+ static get template() {
23
+ return html`
24
+ <style>
25
+ :host {
26
+ display: block;
27
+ min-height: 1px;
28
+ overflow: auto;
29
+
30
+ /* Fixes item background from getting on top of scrollbars on Safari */
31
+ transform: translate3d(0, 0, 0);
32
+
33
+ /* Enable momentum scrolling on iOS */
34
+ -webkit-overflow-scrolling: touch;
35
+
36
+ /* Fixes scrollbar disappearing when 'Show scroll bars: Always' enabled in Safari */
37
+ box-shadow: 0 0 0 white;
38
+ }
39
+
40
+ #selector {
41
+ border-width: var(--_vaadin-multi-select-combo-box-items-container-border-width);
42
+ border-style: var(--_vaadin-multi-select-combo-box-items-container-border-style);
43
+ border-color: var(--_vaadin-multi-select-combo-box-items-container-border-color, transparent);
44
+ }
45
+ </style>
46
+ <div id="selector">
47
+ <slot></slot>
48
+ </div>
49
+ `;
50
+ }
51
+
20
52
  /** @protected */
21
53
  ready() {
22
54
  super.ready();
@@ -24,30 +56,32 @@ class MultiSelectComboBoxScroller extends ComboBoxScroller {
24
56
  this.setAttribute('aria-multiselectable', 'true');
25
57
  }
26
58
 
27
- /** @private */
28
- __getAriaSelected(_focusedIndex, itemIndex) {
29
- const item = this.items[itemIndex];
30
- return this.__isItemSelected(item, null, this.itemIdPath).toString();
31
- }
32
-
33
- /** @private */
34
- __isItemSelected(item, _selectedItem, itemIdPath) {
59
+ /**
60
+ * @protected
61
+ * @override
62
+ */
63
+ _isItemSelected(item, _selectedItem, itemIdPath) {
35
64
  if (item instanceof ComboBoxPlaceholder) {
36
65
  return false;
37
66
  }
38
67
 
39
- if (this.comboBox.readonly) {
68
+ if (this.owner.readonly) {
40
69
  return false;
41
70
  }
42
71
 
43
- return this.comboBox._findIndex(item, this.comboBox.selectedItems, itemIdPath) > -1;
72
+ return this.owner._findIndex(item, this.owner.selectedItems, itemIdPath) > -1;
44
73
  }
45
74
 
46
- /** @private */
47
- __updateElement(el, index) {
48
- super.__updateElement(el, index);
75
+ /**
76
+ * @param {HTMLElement} el
77
+ * @param {number} index
78
+ * @protected
79
+ * @override
80
+ */
81
+ _updateElement(el, index) {
82
+ super._updateElement(el, index);
49
83
 
50
- el.toggleAttribute('readonly', this.comboBox.readonly);
84
+ el.toggleAttribute('readonly', this.owner.readonly);
51
85
  }
52
86
  }
53
87
 
@@ -16,6 +16,7 @@ import type { ElementMixinClass } from '@vaadin/component-base/src/element-mixin
16
16
  import type { FocusMixinClass } from '@vaadin/component-base/src/focus-mixin.js';
17
17
  import type { KeyboardMixinClass } from '@vaadin/component-base/src/keyboard-mixin.js';
18
18
  import type { ResizeMixinClass } from '@vaadin/component-base/src/resize-mixin.js';
19
+ import type { ClearButtonMixinClass } from '@vaadin/field-base/src/clear-button-mixin.js';
19
20
  import type { FieldMixinClass } from '@vaadin/field-base/src/field-mixin.js';
20
21
  import type { InputConstraintsMixinClass } from '@vaadin/field-base/src/input-constraints-mixin.js';
21
22
  import type { InputControlMixinClass } from '@vaadin/field-base/src/input-control-mixin.js';
@@ -254,6 +255,13 @@ declare class MultiSelectComboBox<TItem = ComboBoxDefaultItem> extends HTMLEleme
254
255
  */
255
256
  loading: boolean;
256
257
 
258
+ /**
259
+ * A space-delimited list of CSS class names to set on the overlay element.
260
+ *
261
+ * @attr {string} overlay-class
262
+ */
263
+ overlayClass: string;
264
+
257
265
  /**
258
266
  * True if the dropdown is open, false otherwise.
259
267
  */
@@ -332,6 +340,7 @@ interface MultiSelectComboBox
332
340
  SlotStylesMixinClass,
333
341
  LabelMixinClass,
334
342
  KeyboardMixinClass,
343
+ ClearButtonMixinClass,
335
344
  Omit<InputMixinClass, 'value'>,
336
345
  InputControlMixinClass,
337
346
  InputConstraintsMixinClass,
@@ -154,6 +154,7 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
154
154
  readonly="[[readonly]]"
155
155
  auto-open-disabled="[[autoOpenDisabled]]"
156
156
  allow-custom-value="[[allowCustomValue]]"
157
+ overlay-class="[[overlayClass]]"
157
158
  data-provider="[[dataProvider]]"
158
159
  filter="{{filter}}"
159
160
  last-filter="{{_lastFilter}}"
@@ -305,6 +306,15 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
305
306
  reflectToAttribute: true,
306
307
  },
307
308
 
309
+ /**
310
+ * A space-delimited list of CSS class names to set on the overlay element.
311
+ *
312
+ * @attr {string} overlay-class
313
+ */
314
+ overlayClass: {
315
+ type: String,
316
+ },
317
+
308
318
  /**
309
319
  * When present, it specifies that the field is read-only.
310
320
  */
@@ -488,6 +498,17 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
488
498
  return [...this.querySelectorAll('[slot="chip"]')];
489
499
  }
490
500
 
501
+ /**
502
+ * Override a getter from `InputMixin` to compute
503
+ * the presence of value based on `selectedItems`.
504
+ *
505
+ * @protected
506
+ * @override
507
+ */
508
+ get _hasValue() {
509
+ return this.selectedItems && this.selectedItems.length > 0;
510
+ }
511
+
491
512
  /** @protected */
492
513
  ready() {
493
514
  super.ready();
@@ -838,7 +859,7 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
838
859
 
839
860
  /** @private */
840
861
  __updateChips() {
841
- if (!this._inputField) {
862
+ if (!this._inputField || !this.inputElement) {
842
863
  return;
843
864
  }
844
865
 
@@ -1118,17 +1139,6 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
1118
1139
  __computeEffectiveFilteredItems(items, filteredItems, selectedItems, readonly) {
1119
1140
  return !items && readonly ? selectedItems : filteredItems;
1120
1141
  }
1121
-
1122
- /**
1123
- * Override a method from `InputMixin` to
1124
- * compute the presence of value based on `selectedItems`.
1125
- *
1126
- * @protected
1127
- * @override
1128
- */
1129
- get _hasValue() {
1130
- return this.selectedItems && this.selectedItems.length > 0;
1131
- }
1132
1142
  }
1133
1143
 
1134
1144
  customElements.define(MultiSelectComboBox.is, MultiSelectComboBox);
@@ -7,22 +7,44 @@ import '@vaadin/vaadin-lumo-styles/color.js';
7
7
  import '@vaadin/vaadin-lumo-styles/font-icons.js';
8
8
  import '@vaadin/vaadin-lumo-styles/style.js';
9
9
  import '@vaadin/vaadin-lumo-styles/typography.js';
10
+ import { comboBoxItem } from '@vaadin/combo-box/theme/lumo/vaadin-combo-box-item-styles.js';
11
+ import { comboBoxLoader, comboBoxOverlay } from '@vaadin/combo-box/theme/lumo/vaadin-combo-box-overlay-styles.js';
12
+ import { item } from '@vaadin/item/theme/lumo/vaadin-item-styles.js';
10
13
  import { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';
14
+ import { loader } from '@vaadin/vaadin-lumo-styles/mixins/loader.js';
15
+ import { menuOverlayCore } from '@vaadin/vaadin-lumo-styles/mixins/menu-overlay.js';
16
+ import { overlay } from '@vaadin/vaadin-lumo-styles/mixins/overlay.js';
11
17
  import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
18
 
19
+ const multiSelectComboBoxItem = css`
20
+ @media (any-hover: hover) {
21
+ :host(:hover[readonly]) {
22
+ background-color: transparent;
23
+ cursor: default;
24
+ }
25
+ }
26
+ `;
27
+
28
+ registerStyles('vaadin-multi-select-combo-box-item', [item, comboBoxItem, multiSelectComboBoxItem], {
29
+ moduleId: 'lumo-multi-select-combo-box-item',
30
+ });
31
+
13
32
  registerStyles(
14
- 'vaadin-multi-select-combo-box-item',
15
- css`
16
- @media (any-hover: hover) {
17
- :host(:hover[readonly]) {
18
- background-color: transparent;
19
- cursor: default;
33
+ 'vaadin-multi-select-combo-box-overlay',
34
+ [
35
+ overlay,
36
+ menuOverlayCore,
37
+ comboBoxOverlay,
38
+ loader,
39
+ comboBoxLoader,
40
+ css`
41
+ :host {
42
+ --_vaadin-multi-select-combo-box-items-container-border-width: var(--lumo-space-xs);
43
+ --_vaadin-multi-select-combo-box-items-container-border-style: solid;
20
44
  }
21
- }
22
- `,
23
- {
24
- moduleId: 'lumo-multi-select-combo-box-item',
25
- },
45
+ `,
46
+ ],
47
+ { moduleId: 'lumo-multi-select-combo-box-overlay' },
26
48
  );
27
49
 
28
50
  const multiSelectComboBox = css`
@@ -3,9 +3,8 @@
3
3
  * Copyright (c) 2021 - 2023 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/combo-box/theme/lumo/vaadin-combo-box-item-styles.js';
7
- import '@vaadin/combo-box/theme/lumo/vaadin-combo-box-dropdown-styles.js';
8
6
  import '@vaadin/input-container/theme/lumo/vaadin-input-container.js';
7
+ import '@vaadin/overlay/theme/lumo/vaadin-overlay.js';
9
8
  import './vaadin-multi-select-combo-box-chip-styles.js';
10
9
  import './vaadin-multi-select-combo-box-styles.js';
11
10
  import '../../src/vaadin-multi-select-combo-box.js';
@@ -6,22 +6,42 @@
6
6
  import '@vaadin/vaadin-material-styles/color.js';
7
7
  import '@vaadin/vaadin-material-styles/font-icons.js';
8
8
  import '@vaadin/vaadin-material-styles/typography.js';
9
+ import { comboBoxItem } from '@vaadin/combo-box/theme/material/vaadin-combo-box-item-styles.js';
10
+ import { comboBoxLoader, comboBoxOverlay } from '@vaadin/combo-box/theme/material/vaadin-combo-box-overlay-styles.js';
11
+ import { item } from '@vaadin/item/theme/material/vaadin-item-styles.js';
9
12
  import { inputFieldShared } from '@vaadin/vaadin-material-styles/mixins/input-field-shared.js';
13
+ import { loader } from '@vaadin/vaadin-material-styles/mixins/loader.js';
14
+ import { menuOverlay } from '@vaadin/vaadin-material-styles/mixins/menu-overlay.js';
10
15
  import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
16
 
17
+ const multiSelectComboBoxItem = css`
18
+ @media (any-hover: hover) {
19
+ :host(:hover[readonly]) {
20
+ background-color: transparent;
21
+ cursor: default;
22
+ }
23
+ }
24
+ `;
25
+
26
+ registerStyles('vaadin-multi-select-combo-box-item', [item, comboBoxItem, multiSelectComboBoxItem], {
27
+ moduleId: 'material-multi-select-combo-box-item',
28
+ });
29
+
12
30
  registerStyles(
13
- 'vaadin-multi-select-combo-box-item',
14
- css`
15
- @media (any-hover: hover) {
16
- :host(:hover[readonly]) {
17
- background-color: transparent;
18
- cursor: default;
31
+ 'vaadin-multi-select-combo-box-overlay',
32
+ [
33
+ menuOverlay,
34
+ comboBoxOverlay,
35
+ loader,
36
+ comboBoxLoader,
37
+ css`
38
+ :host {
39
+ --_vaadin-multi-select-combo-box-items-container-border-width: 8px 0;
40
+ --_vaadin-multi-select-combo-box-items-container-border-style: solid;
19
41
  }
20
- }
21
- `,
22
- {
23
- moduleId: 'material-multi-select-combo-box-item',
24
- },
42
+ `,
43
+ ],
44
+ { moduleId: 'material-multi-select-combo-box-overlay' },
25
45
  );
26
46
 
27
47
  const multiSelectComboBox = css`
@@ -3,9 +3,8 @@
3
3
  * Copyright (c) 2021 - 2023 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/combo-box/theme/material/vaadin-combo-box-item-styles.js';
7
- import '@vaadin/combo-box/theme/material/vaadin-combo-box-dropdown-styles.js';
8
6
  import '@vaadin/input-container/theme/material/vaadin-input-container.js';
7
+ import '@vaadin/overlay/theme/material/vaadin-overlay.js';
9
8
  import './vaadin-multi-select-combo-box-chip-styles.js';
10
9
  import './vaadin-multi-select-combo-box-styles.js';
11
10
  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.0.0-alpha9",
4
+ "version": "24.0.0-beta2",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -99,30 +99,30 @@
99
99
  }
100
100
  },
101
101
  {
102
- "name": "allowed-char-pattern",
103
- "description": "A pattern matched against individual characters the user inputs.\n\nWhen set, the field will prevent:\n- `keydown` events if the entered key doesn't match `/^allowedCharPattern$/`\n- `paste` events if the pasted text doesn't match `/^allowedCharPattern*$/`\n- `drop` events if the dropped text doesn't match `/^allowedCharPattern*$/`\n\nFor example, to allow entering only numbers and minus signs, use:\n`allowedCharPattern = \"[\\\\d-]\"`",
102
+ "name": "clear-button-visible",
103
+ "description": "Set to true to display the clear icon which clears the input.",
104
104
  "value": {
105
105
  "type": [
106
- "string",
106
+ "boolean",
107
107
  "null",
108
108
  "undefined"
109
109
  ]
110
110
  }
111
111
  },
112
112
  {
113
- "name": "autoselect",
114
- "description": "If true, the input text gets fully selected when the field is focused using click or touch / tap.",
113
+ "name": "allowed-char-pattern",
114
+ "description": "A pattern matched against individual characters the user inputs.\n\nWhen set, the field will prevent:\n- `keydown` events if the entered key doesn't match `/^allowedCharPattern$/`\n- `paste` events if the pasted text doesn't match `/^allowedCharPattern*$/`\n- `drop` events if the dropped text doesn't match `/^allowedCharPattern*$/`\n\nFor example, to allow entering only numbers and minus signs, use:\n`allowedCharPattern = \"[\\\\d-]\"`",
115
115
  "value": {
116
116
  "type": [
117
- "boolean",
117
+ "string",
118
118
  "null",
119
119
  "undefined"
120
120
  ]
121
121
  }
122
122
  },
123
123
  {
124
- "name": "clear-button-visible",
125
- "description": "Set to true to display the clear icon which clears the input.",
124
+ "name": "autoselect",
125
+ "description": "If true, the input text gets fully selected when the field is focused using click or touch / tap.",
126
126
  "value": {
127
127
  "type": [
128
128
  "boolean",
@@ -230,6 +230,17 @@
230
230
  ]
231
231
  }
232
232
  },
233
+ {
234
+ "name": "overlay-class",
235
+ "description": "A space-delimited list of CSS class names to set on the overlay element.",
236
+ "value": {
237
+ "type": [
238
+ "string",
239
+ "null",
240
+ "undefined"
241
+ ]
242
+ }
243
+ },
233
244
  {
234
245
  "name": "opened",
235
246
  "description": "True if the dropdown is open, false otherwise.",
@@ -377,30 +388,30 @@
377
388
  }
378
389
  },
379
390
  {
380
- "name": "allowedCharPattern",
381
- "description": "A pattern matched against individual characters the user inputs.\n\nWhen set, the field will prevent:\n- `keydown` events if the entered key doesn't match `/^allowedCharPattern$/`\n- `paste` events if the pasted text doesn't match `/^allowedCharPattern*$/`\n- `drop` events if the dropped text doesn't match `/^allowedCharPattern*$/`\n\nFor example, to allow entering only numbers and minus signs, use:\n`allowedCharPattern = \"[\\\\d-]\"`",
391
+ "name": "clearButtonVisible",
392
+ "description": "Set to true to display the clear icon which clears the input.",
382
393
  "value": {
383
394
  "type": [
384
- "string",
395
+ "boolean",
385
396
  "null",
386
397
  "undefined"
387
398
  ]
388
399
  }
389
400
  },
390
401
  {
391
- "name": "autoselect",
392
- "description": "If true, the input text gets fully selected when the field is focused using click or touch / tap.",
402
+ "name": "allowedCharPattern",
403
+ "description": "A pattern matched against individual characters the user inputs.\n\nWhen set, the field will prevent:\n- `keydown` events if the entered key doesn't match `/^allowedCharPattern$/`\n- `paste` events if the pasted text doesn't match `/^allowedCharPattern*$/`\n- `drop` events if the dropped text doesn't match `/^allowedCharPattern*$/`\n\nFor example, to allow entering only numbers and minus signs, use:\n`allowedCharPattern = \"[\\\\d-]\"`",
393
404
  "value": {
394
405
  "type": [
395
- "boolean",
406
+ "string",
396
407
  "null",
397
408
  "undefined"
398
409
  ]
399
410
  }
400
411
  },
401
412
  {
402
- "name": "clearButtonVisible",
403
- "description": "Set to true to display the clear icon which clears the input.",
413
+ "name": "autoselect",
414
+ "description": "If true, the input text gets fully selected when the field is focused using click or touch / tap.",
404
415
  "value": {
405
416
  "type": [
406
417
  "boolean",
@@ -528,6 +539,17 @@
528
539
  ]
529
540
  }
530
541
  },
542
+ {
543
+ "name": "overlayClass",
544
+ "description": "A space-delimited list of CSS class names to set on the overlay element.",
545
+ "value": {
546
+ "type": [
547
+ "string",
548
+ "null",
549
+ "undefined"
550
+ ]
551
+ }
552
+ },
531
553
  {
532
554
  "name": "selectedItems",
533
555
  "description": "The list of selected items.\nNote: modifying the selected items creates a new array each time.",
@@ -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.0.0-alpha9",
4
+ "version": "24.0.0-beta2",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -48,15 +48,15 @@
48
48
  }
49
49
  },
50
50
  {
51
- "name": "?autoselect",
52
- "description": "If true, the input text gets fully selected when the field is focused using click or touch / tap.",
51
+ "name": "?clearButtonVisible",
52
+ "description": "Set to true to display the clear icon which clears the input.",
53
53
  "value": {
54
54
  "kind": "expression"
55
55
  }
56
56
  },
57
57
  {
58
- "name": "?clearButtonVisible",
59
- "description": "Set to true to display the clear icon which clears the input.",
58
+ "name": "?autoselect",
59
+ "description": "If true, the input text gets fully selected when the field is focused using click or touch / tap.",
60
60
  "value": {
61
61
  "kind": "expression"
62
62
  }
@@ -180,6 +180,13 @@
180
180
  "kind": "expression"
181
181
  }
182
182
  },
183
+ {
184
+ "name": ".overlayClass",
185
+ "description": "A space-delimited list of CSS class names to set on the overlay element.",
186
+ "value": {
187
+ "kind": "expression"
188
+ }
189
+ },
183
190
  {
184
191
  "name": ".selectedItems",
185
192
  "description": "The list of selected items.\nNote: modifying the selected items creates a new array each time.",