@vaadin/multi-select-combo-box 24.2.0-dev.f254716fe → 24.2.0
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 +14 -14
- package/src/vaadin-multi-select-combo-box-chip.js +3 -1
- package/src/vaadin-multi-select-combo-box-container.js +3 -1
- package/src/vaadin-multi-select-combo-box-internal.js +29 -16
- package/src/vaadin-multi-select-combo-box-item.js +3 -1
- package/src/vaadin-multi-select-combo-box-overlay.js +3 -1
- package/src/vaadin-multi-select-combo-box-scroller.js +3 -1
- package/src/vaadin-multi-select-combo-box.d.ts +9 -1
- package/src/vaadin-multi-select-combo-box.js +5 -1
- package/web-types.json +732 -0
- package/web-types.lit.json +307 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/multi-select-combo-box",
|
|
3
|
-
"version": "24.2.0
|
|
3
|
+
"version": "24.2.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -37,21 +37,21 @@
|
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@polymer/polymer": "^3.0.0",
|
|
40
|
-
"@vaadin/a11y-base": "24.2.0
|
|
41
|
-
"@vaadin/combo-box": "24.2.0
|
|
42
|
-
"@vaadin/component-base": "24.2.0
|
|
43
|
-
"@vaadin/field-base": "24.2.0
|
|
44
|
-
"@vaadin/input-container": "24.2.0
|
|
45
|
-
"@vaadin/item": "24.2.0
|
|
46
|
-
"@vaadin/lit-renderer": "24.2.0
|
|
47
|
-
"@vaadin/overlay": "24.2.0
|
|
48
|
-
"@vaadin/vaadin-lumo-styles": "24.2.0
|
|
49
|
-
"@vaadin/vaadin-material-styles": "24.2.0
|
|
50
|
-
"@vaadin/vaadin-themable-mixin": "24.2.0
|
|
40
|
+
"@vaadin/a11y-base": "~24.2.0",
|
|
41
|
+
"@vaadin/combo-box": "~24.2.0",
|
|
42
|
+
"@vaadin/component-base": "~24.2.0",
|
|
43
|
+
"@vaadin/field-base": "~24.2.0",
|
|
44
|
+
"@vaadin/input-container": "~24.2.0",
|
|
45
|
+
"@vaadin/item": "~24.2.0",
|
|
46
|
+
"@vaadin/lit-renderer": "~24.2.0",
|
|
47
|
+
"@vaadin/overlay": "~24.2.0",
|
|
48
|
+
"@vaadin/vaadin-lumo-styles": "~24.2.0",
|
|
49
|
+
"@vaadin/vaadin-material-styles": "~24.2.0",
|
|
50
|
+
"@vaadin/vaadin-themable-mixin": "~24.2.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@esm-bundle/chai": "^4.3.4",
|
|
54
|
-
"@vaadin/testing-helpers": "^0.
|
|
54
|
+
"@vaadin/testing-helpers": "^0.5.0",
|
|
55
55
|
"lit": "^2.0.0",
|
|
56
56
|
"sinon": "^13.0.2"
|
|
57
57
|
},
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"web-types.json",
|
|
60
60
|
"web-types.lit.json"
|
|
61
61
|
],
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "8b9e860d53fc0132d05d3e8701eeded2dca74eba"
|
|
63
63
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
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';
|
|
7
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
7
8
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -20,6 +21,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
20
21
|
*
|
|
21
22
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
22
23
|
*
|
|
24
|
+
* @customElement
|
|
23
25
|
* @extends HTMLElement
|
|
24
26
|
* @private
|
|
25
27
|
*/
|
|
@@ -99,4 +101,4 @@ class MultiSelectComboBoxChip extends ThemableMixin(PolymerElement) {
|
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
103
|
|
|
102
|
-
|
|
104
|
+
defineCustomElement(MultiSelectComboBoxChip);
|
|
@@ -3,6 +3,7 @@
|
|
|
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 { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
6
7
|
import { InputContainer } from '@vaadin/input-container/src/vaadin-input-container.js';
|
|
7
8
|
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
9
|
|
|
@@ -24,6 +25,7 @@ let memoizedTemplate;
|
|
|
24
25
|
/**
|
|
25
26
|
* An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
|
|
26
27
|
*
|
|
28
|
+
* @customElement
|
|
27
29
|
* @extends InputContainer
|
|
28
30
|
* @private
|
|
29
31
|
*/
|
|
@@ -49,4 +51,4 @@ class MultiSelectComboBoxContainer extends InputContainer {
|
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
53
|
|
|
52
|
-
|
|
54
|
+
defineCustomElement(MultiSelectComboBoxContainer);
|
|
@@ -10,11 +10,13 @@ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
|
10
10
|
import { ComboBoxDataProviderMixin } from '@vaadin/combo-box/src/vaadin-combo-box-data-provider-mixin.js';
|
|
11
11
|
import { ComboBoxMixin } from '@vaadin/combo-box/src/vaadin-combo-box-mixin.js';
|
|
12
12
|
import { ComboBoxPlaceholder } from '@vaadin/combo-box/src/vaadin-combo-box-placeholder.js';
|
|
13
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
13
14
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
|
|
17
18
|
*
|
|
19
|
+
* @customElement
|
|
18
20
|
* @extends HTMLElement
|
|
19
21
|
* @mixes ComboBoxDataProviderMixin
|
|
20
22
|
* @mixes ComboBoxMixin
|
|
@@ -160,33 +162,44 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
|
|
|
160
162
|
* @override
|
|
161
163
|
*/
|
|
162
164
|
_onEnter(event) {
|
|
163
|
-
this.
|
|
165
|
+
if (this.opened) {
|
|
166
|
+
// Do not submit the surrounding form.
|
|
167
|
+
event.preventDefault();
|
|
168
|
+
// Do not trigger global listeners.
|
|
169
|
+
event.stopPropagation();
|
|
170
|
+
|
|
171
|
+
if (this.readonly) {
|
|
172
|
+
this.close();
|
|
173
|
+
} else {
|
|
174
|
+
// Keep selected item focused after committing on Enter.
|
|
175
|
+
const focusedItem = this.filteredItems[this._focusedIndex];
|
|
176
|
+
this._commitValue();
|
|
177
|
+
this._focusedIndex = this.filteredItems.indexOf(focusedItem);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
164
182
|
|
|
165
183
|
super._onEnter(event);
|
|
166
184
|
}
|
|
167
185
|
|
|
168
186
|
/**
|
|
187
|
+
* Override Escape handler to not clear
|
|
188
|
+
* selected items when readonly.
|
|
189
|
+
* @param {!Event} event
|
|
169
190
|
* @protected
|
|
170
191
|
* @override
|
|
171
192
|
*/
|
|
172
|
-
|
|
193
|
+
_onEscape(event) {
|
|
173
194
|
if (this.readonly) {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
if (this.__enterPressed) {
|
|
179
|
-
this.__enterPressed = null;
|
|
180
|
-
|
|
181
|
-
// Keep selected item focused after committing on Enter.
|
|
182
|
-
const focusedItem = this.filteredItems[this._focusedIndex];
|
|
183
|
-
this._commitValue();
|
|
184
|
-
this._focusedIndex = this.filteredItems.indexOf(focusedItem);
|
|
185
|
-
|
|
195
|
+
event.stopPropagation();
|
|
196
|
+
if (this.opened) {
|
|
197
|
+
this.close();
|
|
198
|
+
}
|
|
186
199
|
return;
|
|
187
200
|
}
|
|
188
201
|
|
|
189
|
-
super.
|
|
202
|
+
super._onEscape(event);
|
|
190
203
|
}
|
|
191
204
|
|
|
192
205
|
/**
|
|
@@ -331,4 +344,4 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
|
|
|
331
344
|
}
|
|
332
345
|
}
|
|
333
346
|
|
|
334
|
-
|
|
347
|
+
defineCustomElement(MultiSelectComboBoxInternal);
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
7
7
|
import { ComboBoxItemMixin } from '@vaadin/combo-box/src/vaadin-combo-box-item-mixin.js';
|
|
8
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
9
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
10
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
10
11
|
|
|
@@ -29,6 +30,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
29
30
|
*
|
|
30
31
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
31
32
|
*
|
|
33
|
+
* @customElement
|
|
32
34
|
* @mixes ComboBoxItemMixin
|
|
33
35
|
* @mixes ThemableMixin
|
|
34
36
|
* @mixes DirMixin
|
|
@@ -58,4 +60,4 @@ export class MultiSelectComboBoxItem extends ComboBoxItemMixin(ThemableMixin(Dir
|
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
62
|
|
|
61
|
-
|
|
63
|
+
defineCustomElement(MultiSelectComboBoxItem);
|
|
@@ -4,6 +4,7 @@
|
|
|
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 { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
7
8
|
import { Overlay } from '@vaadin/overlay/src/vaadin-overlay.js';
|
|
8
9
|
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
10
|
|
|
@@ -31,6 +32,7 @@ let memoizedTemplate;
|
|
|
31
32
|
/**
|
|
32
33
|
* An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
|
|
33
34
|
*
|
|
35
|
+
* @customElement
|
|
34
36
|
* @extends ComboBoxOverlay
|
|
35
37
|
* @private
|
|
36
38
|
*/
|
|
@@ -56,4 +58,4 @@ class MultiSelectComboBoxOverlay extends ComboBoxOverlayMixin(Overlay) {
|
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
defineCustomElement(MultiSelectComboBoxOverlay);
|
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
7
7
|
import { ComboBoxPlaceholder } from '@vaadin/combo-box/src/vaadin-combo-box-placeholder.js';
|
|
8
8
|
import { ComboBoxScrollerMixin } from '@vaadin/combo-box/src/vaadin-combo-box-scroller-mixin.js';
|
|
9
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* An element used internally by `<vaadin-multi-select-combo-box>`. Not intended to be used separately.
|
|
12
13
|
*
|
|
14
|
+
* @customElement
|
|
13
15
|
* @extends HTMLElement
|
|
14
16
|
* @mixes ComboBoxScrollerMixin
|
|
15
17
|
* @private
|
|
@@ -86,4 +88,4 @@ export class MultiSelectComboBoxScroller extends ComboBoxScrollerMixin(PolymerEl
|
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
|
|
89
|
-
|
|
91
|
+
defineCustomElement(MultiSelectComboBoxScroller);
|
|
@@ -16,13 +16,13 @@ import type { ControllerMixinClass } from '@vaadin/component-base/src/controller
|
|
|
16
16
|
import type { DelegateStateMixinClass } from '@vaadin/component-base/src/delegate-state-mixin.js';
|
|
17
17
|
import type { ElementMixinClass } from '@vaadin/component-base/src/element-mixin.js';
|
|
18
18
|
import type { ResizeMixinClass } from '@vaadin/component-base/src/resize-mixin.js';
|
|
19
|
+
import type { SlotStylesMixinClass } from '@vaadin/component-base/src/slot-styles-mixin.js';
|
|
19
20
|
import type { ClearButtonMixinClass } from '@vaadin/field-base/src/clear-button-mixin.js';
|
|
20
21
|
import type { FieldMixinClass } from '@vaadin/field-base/src/field-mixin.js';
|
|
21
22
|
import type { InputConstraintsMixinClass } from '@vaadin/field-base/src/input-constraints-mixin.js';
|
|
22
23
|
import type { InputControlMixinClass } from '@vaadin/field-base/src/input-control-mixin.js';
|
|
23
24
|
import type { InputMixinClass } from '@vaadin/field-base/src/input-mixin.js';
|
|
24
25
|
import type { LabelMixinClass } from '@vaadin/field-base/src/label-mixin.js';
|
|
25
|
-
import type { SlotStylesMixinClass } from '@vaadin/field-base/src/slot-styles-mixin.js';
|
|
26
26
|
import type { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.js';
|
|
27
27
|
import type { ThemableMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
28
28
|
import type { ThemePropertyMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
|
|
@@ -63,6 +63,11 @@ export type MultiSelectComboBoxFilterChangedEvent = CustomEvent<{ value: string
|
|
|
63
63
|
*/
|
|
64
64
|
export type MultiSelectComboBoxInvalidChangedEvent = CustomEvent<{ value: boolean }>;
|
|
65
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Fired when the `opened` property changes.
|
|
68
|
+
*/
|
|
69
|
+
export type MultiSelectComboBoxOpenedChangedEvent = CustomEvent<{ value: boolean }>;
|
|
70
|
+
|
|
66
71
|
/**
|
|
67
72
|
* Fired when the `selectedItems` property changes.
|
|
68
73
|
*/
|
|
@@ -82,6 +87,8 @@ export interface MultiSelectComboBoxEventMap<TItem> extends HTMLElementEventMap
|
|
|
82
87
|
|
|
83
88
|
'invalid-changed': MultiSelectComboBoxInvalidChangedEvent;
|
|
84
89
|
|
|
90
|
+
'opened-changed': MultiSelectComboBoxOpenedChangedEvent;
|
|
91
|
+
|
|
85
92
|
'selected-items-changed': MultiSelectComboBoxSelectedItemsChangedEvent<TItem>;
|
|
86
93
|
|
|
87
94
|
validated: MultiSelectComboBoxValidatedEvent;
|
|
@@ -159,6 +166,7 @@ export interface MultiSelectComboBoxEventMap<TItem> extends HTMLElementEventMap
|
|
|
159
166
|
* @fires {CustomEvent} custom-value-set - Fired when the user sets a custom value.
|
|
160
167
|
* @fires {CustomEvent} filter-changed - Fired when the `filter` property changes.
|
|
161
168
|
* @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
|
|
169
|
+
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
162
170
|
* @fires {CustomEvent} selected-items-changed - Fired when the `selectedItems` property changes.
|
|
163
171
|
* @fires {CustomEvent} validated - Fired whenever the field is validated.
|
|
164
172
|
*/
|
|
@@ -8,6 +8,7 @@ import './vaadin-multi-select-combo-box-container.js';
|
|
|
8
8
|
import './vaadin-multi-select-combo-box-internal.js';
|
|
9
9
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
10
10
|
import { announce } from '@vaadin/a11y-base/src/announce.js';
|
|
11
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
11
12
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
12
13
|
import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
|
|
13
14
|
import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
|
|
@@ -122,9 +123,11 @@ registerStyles('vaadin-multi-select-combo-box', [inputFieldShared, multiSelectCo
|
|
|
122
123
|
* @fires {CustomEvent} custom-value-set - Fired when the user sets a custom value.
|
|
123
124
|
* @fires {CustomEvent} filter-changed - Fired when the `filter` property changes.
|
|
124
125
|
* @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
|
|
126
|
+
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
125
127
|
* @fires {CustomEvent} selected-items-changed - Fired when the `selectedItems` property changes.
|
|
126
128
|
* @fires {CustomEvent} validated - Fired whenever the field is validated.
|
|
127
129
|
*
|
|
130
|
+
* @customElement
|
|
128
131
|
* @extends HTMLElement
|
|
129
132
|
* @mixes ElementMixin
|
|
130
133
|
* @mixes ThemableMixin
|
|
@@ -527,6 +530,7 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
|
|
|
527
530
|
this._tooltipController = new TooltipController(this);
|
|
528
531
|
this.addController(this._tooltipController);
|
|
529
532
|
this._tooltipController.setPosition('top');
|
|
533
|
+
this._tooltipController.setAriaTarget(this.inputElement);
|
|
530
534
|
this._tooltipController.setShouldShow((target) => !target.opened);
|
|
531
535
|
|
|
532
536
|
this._inputField = this.shadowRoot.querySelector('[part="input-field"]');
|
|
@@ -1144,6 +1148,6 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
|
|
|
1144
1148
|
}
|
|
1145
1149
|
}
|
|
1146
1150
|
|
|
1147
|
-
|
|
1151
|
+
defineCustomElement(MultiSelectComboBox);
|
|
1148
1152
|
|
|
1149
1153
|
export { MultiSelectComboBox };
|