@vaadin/multi-select-combo-box 23.2.0 → 23.3.0-alpha1

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/README.md CHANGED
@@ -2,15 +2,19 @@
2
2
 
3
3
  A web component that wraps `<vaadin-combo-box>` and allows selecting multiple items.
4
4
 
5
+ [Documentation + Live Demo ↗](https://vaadin.com/docs/latest/components/multi-select-combo-box)
6
+
5
7
  ```html
6
- <vaadin-multi-select-combo-box id="fruit"></vaadin-multi-select-combo-box>
8
+ <vaadin-multi-select-combo-box style="width: 300px"></vaadin-multi-select-combo-box>
7
9
  <script>
8
- const comboBox = document.querySelector('#fruit');
10
+ const comboBox = document.querySelector('vaadin-multi-select-combo-box');
9
11
  comboBox.items = ['apple', 'banana', 'lemon', 'orange'];
10
- comboBox.selectedItems = ['lemon', 'orange'];
12
+ comboBox.selectedItems = ['apple', 'banana'];
11
13
  </script>
12
14
  ```
13
15
 
16
+ [<img src="https://raw.githubusercontent.com/vaadin/web-components/master/packages/multi-select-combo-box/screenshot.png" width="300" alt="Screenshot of vaadin-multi-select-combo-box">](https://vaadin.com/docs/latest/components/multi-select-combo-box)
17
+
14
18
  ## Installation
15
19
 
16
20
  Install the component:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/multi-select-combo-box",
3
- "version": "23.2.0",
3
+ "version": "23.3.0-alpha1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -19,8 +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
22
  "lit.d.ts",
23
+ "lit.js",
24
24
  "src",
25
25
  "theme",
26
26
  "vaadin-*.d.ts",
@@ -37,14 +37,14 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@polymer/polymer": "^3.0.0",
40
- "@vaadin/combo-box": "^23.2.0",
41
- "@vaadin/component-base": "^23.2.0",
42
- "@vaadin/field-base": "^23.2.0",
43
- "@vaadin/input-container": "^23.2.0",
44
- "@vaadin/lit-renderer": "^23.2.0",
45
- "@vaadin/vaadin-lumo-styles": "^23.2.0",
46
- "@vaadin/vaadin-material-styles": "^23.2.0",
47
- "@vaadin/vaadin-themable-mixin": "^23.2.0"
40
+ "@vaadin/combo-box": "23.3.0-alpha1",
41
+ "@vaadin/component-base": "23.3.0-alpha1",
42
+ "@vaadin/field-base": "23.3.0-alpha1",
43
+ "@vaadin/input-container": "23.3.0-alpha1",
44
+ "@vaadin/lit-renderer": "23.3.0-alpha1",
45
+ "@vaadin/vaadin-lumo-styles": "23.3.0-alpha1",
46
+ "@vaadin/vaadin-material-styles": "23.3.0-alpha1",
47
+ "@vaadin/vaadin-themable-mixin": "23.3.0-alpha1"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@esm-bundle/chai": "^4.3.4",
@@ -55,5 +55,5 @@
55
55
  "web-types.json",
56
56
  "web-types.lit.json"
57
57
  ],
58
- "gitHead": "8b1f5941f26ac41ca038e75e24c8584e331bc7a8"
58
+ "gitHead": "beabc527d4b1274eb798ff701d406fed45cfe638"
59
59
  }
@@ -21,6 +21,7 @@ import type { InputConstraintsMixinClass } from '@vaadin/field-base/src/input-co
21
21
  import type { InputControlMixinClass } from '@vaadin/field-base/src/input-control-mixin.js';
22
22
  import type { InputMixinClass } from '@vaadin/field-base/src/input-mixin.js';
23
23
  import type { LabelMixinClass } from '@vaadin/field-base/src/label-mixin.js';
24
+ import type { SlotStylesMixinClass } from '@vaadin/field-base/src/slot-styles-mixin.js';
24
25
  import type { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.js';
25
26
  import type { ThemableMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
26
27
  import type { ThemePropertyMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
@@ -332,6 +333,7 @@ declare class MultiSelectComboBox<TItem = ComboBoxDefaultItem> extends HTMLEleme
332
333
 
333
334
  interface MultiSelectComboBox
334
335
  extends ValidateMixinClass,
336
+ SlotStylesMixinClass,
335
337
  LabelMixinClass,
336
338
  KeyboardMixinClass,
337
339
  Omit<InputMixinClass, 'value'>,
@@ -11,6 +11,7 @@ import { announce } from '@vaadin/component-base/src/a11y-announcer.js';
11
11
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
12
12
  import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
13
13
  import { processTemplates } from '@vaadin/component-base/src/templates.js';
14
+ import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
14
15
  import { InputControlMixin } from '@vaadin/field-base/src/input-control-mixin.js';
15
16
  import { InputController } from '@vaadin/field-base/src/input-controller.js';
16
17
  import { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';
@@ -31,10 +32,6 @@ const multiSelectComboBox = css`
31
32
  align-items: center;
32
33
  }
33
34
 
34
- :host([has-value]) ::slotted(input:placeholder-shown) {
35
- color: transparent !important;
36
- }
37
-
38
35
  ::slotted(input) {
39
36
  box-sizing: border-box;
40
37
  flex: 1 0 var(--input-min-width);
@@ -217,6 +214,8 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
217
214
  <slot name="error-message"></slot>
218
215
  </div>
219
216
  </div>
217
+
218
+ <slot name="tooltip"></slot>
220
219
  `;
221
220
  }
222
221
 
@@ -473,6 +472,19 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
473
472
  return ['_selectedItemsChanged(selectedItems, selectedItems.*)'];
474
473
  }
475
474
 
475
+ /** @protected */
476
+ get slotStyles() {
477
+ const tag = this.localName;
478
+ return [
479
+ ...super.slotStyles,
480
+ `
481
+ ${tag}[has-value] input::placeholder {
482
+ color: transparent !important;
483
+ }
484
+ `,
485
+ ];
486
+ }
487
+
476
488
  /**
477
489
  * Used by `InputControlMixin` as a reference to the clear button element.
478
490
  * @protected
@@ -501,6 +513,10 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
501
513
  );
502
514
  this.addController(new LabelledInputController(this.inputElement, this._labelController));
503
515
 
516
+ this._tooltipController = new TooltipController(this);
517
+ this.addController(this._tooltipController);
518
+ this._tooltipController.setShouldShow((target) => !target.opened);
519
+
504
520
  this._inputField = this.shadowRoot.querySelector('[part="input-field"]');
505
521
  this.__updateChips();
506
522
 
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": "23.2.0",
4
+ "version": "23.3.0-alpha1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -652,6 +652,14 @@
652
652
  {
653
653
  "name": "filter-changed",
654
654
  "description": "Fired when the `filter` property changes."
655
+ },
656
+ {
657
+ "name": "invalid-changed",
658
+ "description": "Fired when the `invalid` property changes."
659
+ },
660
+ {
661
+ "name": "selectedItems-changed",
662
+ "description": "Fired when the `selectedItems` property changes."
655
663
  }
656
664
  ]
657
665
  }
@@ -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": "23.2.0",
4
+ "version": "23.3.0-alpha1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -270,6 +270,20 @@
270
270
  "value": {
271
271
  "kind": "expression"
272
272
  }
273
+ },
274
+ {
275
+ "name": "@invalid-changed",
276
+ "description": "Fired when the `invalid` property changes.",
277
+ "value": {
278
+ "kind": "expression"
279
+ }
280
+ },
281
+ {
282
+ "name": "@selectedItems-changed",
283
+ "description": "Fired when the `selectedItems` property changes.",
284
+ "value": {
285
+ "kind": "expression"
286
+ }
273
287
  }
274
288
  ]
275
289
  }