@vaadin/multi-select-combo-box 24.2.0-dev.e9803eea7 → 24.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/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 +17 -1
- package/src/vaadin-multi-select-combo-box.js +7 -1
- package/web-types.json +758 -0
- package/web-types.lit.json +321 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/multi-select-combo-box",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.3.0-alpha1",
|
|
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.
|
|
41
|
-
"@vaadin/combo-box": "24.
|
|
42
|
-
"@vaadin/component-base": "24.
|
|
43
|
-
"@vaadin/field-base": "24.
|
|
44
|
-
"@vaadin/input-container": "24.
|
|
45
|
-
"@vaadin/item": "24.
|
|
46
|
-
"@vaadin/lit-renderer": "24.
|
|
47
|
-
"@vaadin/overlay": "24.
|
|
48
|
-
"@vaadin/vaadin-lumo-styles": "24.
|
|
49
|
-
"@vaadin/vaadin-material-styles": "24.
|
|
50
|
-
"@vaadin/vaadin-themable-mixin": "24.
|
|
40
|
+
"@vaadin/a11y-base": "24.3.0-alpha1",
|
|
41
|
+
"@vaadin/combo-box": "24.3.0-alpha1",
|
|
42
|
+
"@vaadin/component-base": "24.3.0-alpha1",
|
|
43
|
+
"@vaadin/field-base": "24.3.0-alpha1",
|
|
44
|
+
"@vaadin/input-container": "24.3.0-alpha1",
|
|
45
|
+
"@vaadin/item": "24.3.0-alpha1",
|
|
46
|
+
"@vaadin/lit-renderer": "24.3.0-alpha1",
|
|
47
|
+
"@vaadin/overlay": "24.3.0-alpha1",
|
|
48
|
+
"@vaadin/vaadin-lumo-styles": "24.3.0-alpha1",
|
|
49
|
+
"@vaadin/vaadin-material-styles": "24.3.0-alpha1",
|
|
50
|
+
"@vaadin/vaadin-themable-mixin": "24.3.0-alpha1"
|
|
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": "9ca6f3ca220a777e8eea181a1f5717e39a732240"
|
|
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';
|
|
@@ -53,6 +53,11 @@ export type MultiSelectComboBoxChangeEvent<TItem> = Event & {
|
|
|
53
53
|
*/
|
|
54
54
|
export type MultiSelectComboBoxCustomValueSetEvent = CustomEvent<string>;
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Fired when the `dirty` property changes.
|
|
58
|
+
*/
|
|
59
|
+
export type MultiSelectComboBoxDirtyChangedEvent = CustomEvent<{ value: boolean }>;
|
|
60
|
+
|
|
56
61
|
/**
|
|
57
62
|
* Fired when the `filter` property changes.
|
|
58
63
|
*/
|
|
@@ -63,6 +68,11 @@ export type MultiSelectComboBoxFilterChangedEvent = CustomEvent<{ value: string
|
|
|
63
68
|
*/
|
|
64
69
|
export type MultiSelectComboBoxInvalidChangedEvent = CustomEvent<{ value: boolean }>;
|
|
65
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Fired when the `opened` property changes.
|
|
73
|
+
*/
|
|
74
|
+
export type MultiSelectComboBoxOpenedChangedEvent = CustomEvent<{ value: boolean }>;
|
|
75
|
+
|
|
66
76
|
/**
|
|
67
77
|
* Fired when the `selectedItems` property changes.
|
|
68
78
|
*/
|
|
@@ -78,10 +88,14 @@ export interface MultiSelectComboBoxEventMap<TItem> extends HTMLElementEventMap
|
|
|
78
88
|
|
|
79
89
|
'custom-value-set': MultiSelectComboBoxCustomValueSetEvent;
|
|
80
90
|
|
|
91
|
+
'dirty-changed': MultiSelectComboBoxDirtyChangedEvent;
|
|
92
|
+
|
|
81
93
|
'filter-changed': MultiSelectComboBoxFilterChangedEvent;
|
|
82
94
|
|
|
83
95
|
'invalid-changed': MultiSelectComboBoxInvalidChangedEvent;
|
|
84
96
|
|
|
97
|
+
'opened-changed': MultiSelectComboBoxOpenedChangedEvent;
|
|
98
|
+
|
|
85
99
|
'selected-items-changed': MultiSelectComboBoxSelectedItemsChangedEvent<TItem>;
|
|
86
100
|
|
|
87
101
|
validated: MultiSelectComboBoxValidatedEvent;
|
|
@@ -157,8 +171,10 @@ export interface MultiSelectComboBoxEventMap<TItem> extends HTMLElementEventMap
|
|
|
157
171
|
*
|
|
158
172
|
* @fires {Event} change - Fired when the user commits a value change.
|
|
159
173
|
* @fires {CustomEvent} custom-value-set - Fired when the user sets a custom value.
|
|
174
|
+
* @fires {CustomEvent} dirty-changed - Fired when the `dirty` property changes.
|
|
160
175
|
* @fires {CustomEvent} filter-changed - Fired when the `filter` property changes.
|
|
161
176
|
* @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
|
|
177
|
+
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
162
178
|
* @fires {CustomEvent} selected-items-changed - Fired when the `selectedItems` property changes.
|
|
163
179
|
* @fires {CustomEvent} validated - Fired whenever the field is validated.
|
|
164
180
|
*/
|
|
@@ -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';
|
|
@@ -120,11 +121,14 @@ registerStyles('vaadin-multi-select-combo-box', [inputFieldShared, multiSelectCo
|
|
|
120
121
|
*
|
|
121
122
|
* @fires {Event} change - Fired when the user commits a value change.
|
|
122
123
|
* @fires {CustomEvent} custom-value-set - Fired when the user sets a custom value.
|
|
124
|
+
* @fires {CustomEvent} dirty-changed - Fired when the `dirty` property changes.
|
|
123
125
|
* @fires {CustomEvent} filter-changed - Fired when the `filter` property changes.
|
|
124
126
|
* @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
|
|
127
|
+
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
125
128
|
* @fires {CustomEvent} selected-items-changed - Fired when the `selectedItems` property changes.
|
|
126
129
|
* @fires {CustomEvent} validated - Fired whenever the field is validated.
|
|
127
130
|
*
|
|
131
|
+
* @customElement
|
|
128
132
|
* @extends HTMLElement
|
|
129
133
|
* @mixes ElementMixin
|
|
130
134
|
* @mixes ThemableMixin
|
|
@@ -527,6 +531,7 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
|
|
|
527
531
|
this._tooltipController = new TooltipController(this);
|
|
528
532
|
this.addController(this._tooltipController);
|
|
529
533
|
this._tooltipController.setPosition('top');
|
|
534
|
+
this._tooltipController.setAriaTarget(this.inputElement);
|
|
530
535
|
this._tooltipController.setShouldShow((target) => !target.opened);
|
|
531
536
|
|
|
532
537
|
this._inputField = this.shadowRoot.querySelector('[part="input-field"]');
|
|
@@ -812,6 +817,7 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
|
|
|
812
817
|
|
|
813
818
|
/** @private */
|
|
814
819
|
__updateSelection(selectedItems) {
|
|
820
|
+
this.dirty = true;
|
|
815
821
|
this.selectedItems = selectedItems;
|
|
816
822
|
|
|
817
823
|
this.validate();
|
|
@@ -1144,6 +1150,6 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
|
|
|
1144
1150
|
}
|
|
1145
1151
|
}
|
|
1146
1152
|
|
|
1147
|
-
|
|
1153
|
+
defineCustomElement(MultiSelectComboBox);
|
|
1148
1154
|
|
|
1149
1155
|
export { MultiSelectComboBox };
|