@vaadin/combo-box 22.0.14 → 22.0.15
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 +13 -13
- package/src/vaadin-combo-box-data-provider-mixin.d.ts +2 -2
- package/src/vaadin-combo-box-data-provider-mixin.js +9 -9
- package/src/vaadin-combo-box-dropdown.js +14 -14
- package/src/vaadin-combo-box-item.js +4 -4
- package/src/vaadin-combo-box-light.d.ts +3 -3
- package/src/vaadin-combo-box-light.js +2 -2
- package/src/vaadin-combo-box-mixin.d.ts +2 -2
- package/src/vaadin-combo-box-mixin.js +16 -16
- package/src/vaadin-combo-box-overlay.js +1 -1
- package/src/vaadin-combo-box-scroller.js +18 -16
- package/src/vaadin-combo-box.d.ts +3 -3
- package/src/vaadin-combo-box.js +4 -4
- package/theme/lumo/vaadin-combo-box-dropdown-styles.js +1 -1
- package/theme/lumo/vaadin-combo-box-item-styles.js +1 -1
- package/theme/material/vaadin-combo-box-dropdown-styles.js +1 -1
- package/theme/material/vaadin-combo-box-item-styles.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/combo-box",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.15",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,23 +33,23 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
35
35
|
"@polymer/polymer": "^3.0.0",
|
|
36
|
-
"@vaadin/component-base": "^22.0.
|
|
37
|
-
"@vaadin/field-base": "^22.0.
|
|
38
|
-
"@vaadin/input-container": "^22.0.
|
|
39
|
-
"@vaadin/item": "^22.0.
|
|
40
|
-
"@vaadin/vaadin-lumo-styles": "^22.0.
|
|
41
|
-
"@vaadin/vaadin-material-styles": "^22.0.
|
|
42
|
-
"@vaadin/vaadin-overlay": "^22.0.
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "^22.0.
|
|
36
|
+
"@vaadin/component-base": "^22.0.15",
|
|
37
|
+
"@vaadin/field-base": "^22.0.15",
|
|
38
|
+
"@vaadin/input-container": "^22.0.15",
|
|
39
|
+
"@vaadin/item": "^22.0.15",
|
|
40
|
+
"@vaadin/vaadin-lumo-styles": "^22.0.15",
|
|
41
|
+
"@vaadin/vaadin-material-styles": "^22.0.15",
|
|
42
|
+
"@vaadin/vaadin-overlay": "^22.0.15",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "^22.0.15"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@esm-bundle/chai": "^4.3.4",
|
|
47
|
-
"@vaadin/dialog": "^22.0.
|
|
48
|
-
"@vaadin/polymer-legacy-adapter": "^22.0.
|
|
47
|
+
"@vaadin/dialog": "^22.0.15",
|
|
48
|
+
"@vaadin/polymer-legacy-adapter": "^22.0.15",
|
|
49
49
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
50
|
-
"@vaadin/text-field": "^22.0.
|
|
50
|
+
"@vaadin/text-field": "^22.0.15",
|
|
51
51
|
"lit": "^2.0.0",
|
|
52
52
|
"sinon": "^9.2.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "bba021b56ba45da93d2bb980242956ad929ecfe2"
|
|
55
55
|
}
|
|
@@ -15,11 +15,11 @@ export interface ComboBoxDataProviderParams {
|
|
|
15
15
|
|
|
16
16
|
export type ComboBoxDataProvider<TItem> = (
|
|
17
17
|
params: ComboBoxDataProviderParams,
|
|
18
|
-
callback: ComboBoxDataProviderCallback<TItem
|
|
18
|
+
callback: ComboBoxDataProviderCallback<TItem>,
|
|
19
19
|
) => void;
|
|
20
20
|
|
|
21
21
|
export declare function ComboBoxDataProviderMixin<TItem, T extends Constructor<HTMLElement>>(
|
|
22
|
-
base: T
|
|
22
|
+
base: T,
|
|
23
23
|
): T & Constructor<ComboBoxDataProviderMixinClass<TItem>>;
|
|
24
24
|
|
|
25
25
|
export declare class ComboBoxDataProviderMixinClass<TItem> {
|
|
@@ -20,7 +20,7 @@ export const ComboBoxDataProviderMixin = (superClass) =>
|
|
|
20
20
|
pageSize: {
|
|
21
21
|
type: Number,
|
|
22
22
|
value: 50,
|
|
23
|
-
observer: '_pageSizeChanged'
|
|
23
|
+
observer: '_pageSizeChanged',
|
|
24
24
|
},
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -29,7 +29,7 @@ export const ComboBoxDataProviderMixin = (superClass) =>
|
|
|
29
29
|
*/
|
|
30
30
|
size: {
|
|
31
31
|
type: Number,
|
|
32
|
-
observer: '_sizeChanged'
|
|
32
|
+
observer: '_sizeChanged',
|
|
33
33
|
},
|
|
34
34
|
|
|
35
35
|
/**
|
|
@@ -48,20 +48,20 @@ export const ComboBoxDataProviderMixin = (superClass) =>
|
|
|
48
48
|
*/
|
|
49
49
|
dataProvider: {
|
|
50
50
|
type: Object,
|
|
51
|
-
observer: '_dataProviderChanged'
|
|
51
|
+
observer: '_dataProviderChanged',
|
|
52
52
|
},
|
|
53
53
|
|
|
54
54
|
/** @private */
|
|
55
55
|
_pendingRequests: {
|
|
56
56
|
value: () => {
|
|
57
57
|
return {};
|
|
58
|
-
}
|
|
58
|
+
},
|
|
59
59
|
},
|
|
60
60
|
|
|
61
61
|
/** @private */
|
|
62
62
|
__placeHolder: {
|
|
63
|
-
value: new ComboBoxPlaceholder()
|
|
64
|
-
}
|
|
63
|
+
value: new ComboBoxPlaceholder(),
|
|
64
|
+
},
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -70,7 +70,7 @@ export const ComboBoxDataProviderMixin = (superClass) =>
|
|
|
70
70
|
'_dataProviderFilterChanged(filter, dataProvider)',
|
|
71
71
|
'_dataProviderClearFilter(dataProvider, opened, value)',
|
|
72
72
|
'_warnDataProviderValue(dataProvider, value)',
|
|
73
|
-
'_ensureFirstPage(opened)'
|
|
73
|
+
'_ensureFirstPage(opened)',
|
|
74
74
|
];
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -172,7 +172,7 @@ export const ComboBoxDataProviderMixin = (superClass) =>
|
|
|
172
172
|
const params = {
|
|
173
173
|
page,
|
|
174
174
|
pageSize: this.pageSize,
|
|
175
|
-
filter: this.filter
|
|
175
|
+
filter: this.filter,
|
|
176
176
|
};
|
|
177
177
|
|
|
178
178
|
const callback = (items, size) => {
|
|
@@ -283,7 +283,7 @@ export const ComboBoxDataProviderMixin = (superClass) =>
|
|
|
283
283
|
'Nothing to display in the text field. This usually happens when ' +
|
|
284
284
|
'setting an initial `value` before any items are returned from ' +
|
|
285
285
|
'the `dataProvider` callback. Consider setting `selectedItem` ' +
|
|
286
|
-
'instead of `value`'
|
|
286
|
+
'instead of `value`',
|
|
287
287
|
);
|
|
288
288
|
}
|
|
289
289
|
}
|
|
@@ -46,7 +46,7 @@ export class ComboBoxDropdown extends PolymerElement {
|
|
|
46
46
|
*/
|
|
47
47
|
positionTarget: {
|
|
48
48
|
type: Object,
|
|
49
|
-
observer: '_positionTargetChanged'
|
|
49
|
+
observer: '_positionTargetChanged',
|
|
50
50
|
},
|
|
51
51
|
|
|
52
52
|
/**
|
|
@@ -60,7 +60,7 @@ export class ComboBoxDropdown extends PolymerElement {
|
|
|
60
60
|
loading: {
|
|
61
61
|
type: Boolean,
|
|
62
62
|
value: false,
|
|
63
|
-
reflectToAttribute: true
|
|
63
|
+
reflectToAttribute: true,
|
|
64
64
|
},
|
|
65
65
|
|
|
66
66
|
/**
|
|
@@ -69,31 +69,31 @@ export class ComboBoxDropdown extends PolymerElement {
|
|
|
69
69
|
theme: String,
|
|
70
70
|
|
|
71
71
|
_selectedItem: {
|
|
72
|
-
type: Object
|
|
72
|
+
type: Object,
|
|
73
73
|
},
|
|
74
74
|
|
|
75
75
|
_items: {
|
|
76
|
-
type: Array
|
|
76
|
+
type: Array,
|
|
77
77
|
},
|
|
78
78
|
|
|
79
79
|
_focusedIndex: {
|
|
80
80
|
type: Number,
|
|
81
|
-
value: -1
|
|
81
|
+
value: -1,
|
|
82
82
|
},
|
|
83
83
|
|
|
84
84
|
focusedItem: {
|
|
85
85
|
type: String,
|
|
86
|
-
computed: '_getFocusedItem(_focusedIndex)'
|
|
86
|
+
computed: '_getFocusedItem(_focusedIndex)',
|
|
87
87
|
},
|
|
88
88
|
|
|
89
89
|
_itemLabelPath: {
|
|
90
90
|
type: String,
|
|
91
|
-
value: 'label'
|
|
91
|
+
value: 'label',
|
|
92
92
|
},
|
|
93
93
|
|
|
94
94
|
_itemValuePath: {
|
|
95
95
|
type: String,
|
|
96
|
-
value: 'value'
|
|
96
|
+
value: 'value',
|
|
97
97
|
},
|
|
98
98
|
|
|
99
99
|
_scroller: Object,
|
|
@@ -102,15 +102,15 @@ export class ComboBoxDropdown extends PolymerElement {
|
|
|
102
102
|
|
|
103
103
|
_overlayOpened: {
|
|
104
104
|
type: Boolean,
|
|
105
|
-
observer: '_openedChanged'
|
|
106
|
-
}
|
|
105
|
+
observer: '_openedChanged',
|
|
106
|
+
},
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
static get observers() {
|
|
111
111
|
return [
|
|
112
112
|
'_openedOrItemsChanged(opened, _items, loading)',
|
|
113
|
-
'__updateScroller(_scroller, _items, opened, loading, _selectedItem, _itemIdPath, _focusedIndex, renderer, theme)'
|
|
113
|
+
'__updateScroller(_scroller, _items, opened, loading, _selectedItem, _itemIdPath, _focusedIndex, renderer, theme)',
|
|
114
114
|
];
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -172,8 +172,8 @@ export class ComboBoxDropdown extends PolymerElement {
|
|
|
172
172
|
_fireTouchAction(sourceEvent) {
|
|
173
173
|
this.dispatchEvent(
|
|
174
174
|
new CustomEvent('vaadin-overlay-touch-action', {
|
|
175
|
-
detail: { sourceEvent: sourceEvent }
|
|
176
|
-
})
|
|
175
|
+
detail: { sourceEvent: sourceEvent },
|
|
176
|
+
}),
|
|
177
177
|
);
|
|
178
178
|
}
|
|
179
179
|
|
|
@@ -262,7 +262,7 @@ export class ComboBoxDropdown extends PolymerElement {
|
|
|
262
262
|
itemIdPath,
|
|
263
263
|
focusedIndex,
|
|
264
264
|
renderer,
|
|
265
|
-
theme
|
|
265
|
+
theme,
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
268
|
}
|
|
@@ -79,7 +79,7 @@ export class ComboBoxItem extends ThemableMixin(DirMixin(PolymerElement)) {
|
|
|
79
79
|
selected: {
|
|
80
80
|
type: Boolean,
|
|
81
81
|
value: false,
|
|
82
|
-
reflectToAttribute: true
|
|
82
|
+
reflectToAttribute: true,
|
|
83
83
|
},
|
|
84
84
|
|
|
85
85
|
/**
|
|
@@ -88,7 +88,7 @@ export class ComboBoxItem extends ThemableMixin(DirMixin(PolymerElement)) {
|
|
|
88
88
|
focused: {
|
|
89
89
|
type: Boolean,
|
|
90
90
|
value: false,
|
|
91
|
-
reflectToAttribute: true
|
|
91
|
+
reflectToAttribute: true,
|
|
92
92
|
},
|
|
93
93
|
|
|
94
94
|
/**
|
|
@@ -99,7 +99,7 @@ export class ComboBoxItem extends ThemableMixin(DirMixin(PolymerElement)) {
|
|
|
99
99
|
/**
|
|
100
100
|
* Saved instance of a custom renderer function.
|
|
101
101
|
*/
|
|
102
|
-
_oldRenderer: Function
|
|
102
|
+
_oldRenderer: Function,
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -133,7 +133,7 @@ export class ComboBoxItem extends ThemableMixin(DirMixin(PolymerElement)) {
|
|
|
133
133
|
index: this.index,
|
|
134
134
|
item: this.item,
|
|
135
135
|
focused: this.focused,
|
|
136
|
-
selected: this.selected
|
|
136
|
+
selected: this.selected,
|
|
137
137
|
};
|
|
138
138
|
|
|
139
139
|
this.renderer(this, this._comboBox, model);
|
|
@@ -13,7 +13,7 @@ import { ComboBoxDefaultItem } from './vaadin-combo-box-mixin.js';
|
|
|
13
13
|
export {
|
|
14
14
|
ComboBoxDataProvider,
|
|
15
15
|
ComboBoxDataProviderCallback,
|
|
16
|
-
ComboBoxDataProviderParams
|
|
16
|
+
ComboBoxDataProviderParams,
|
|
17
17
|
} from './vaadin-combo-box-data-provider-mixin.js';
|
|
18
18
|
export { ComboBoxDefaultItem, ComboBoxItemModel, ComboBoxRenderer } from './vaadin-combo-box-mixin.js';
|
|
19
19
|
|
|
@@ -117,13 +117,13 @@ declare class ComboBoxLight<TItem = ComboBoxDefaultItem> extends HTMLElement {
|
|
|
117
117
|
addEventListener<K extends keyof ComboBoxLightEventMap<TItem>>(
|
|
118
118
|
type: K,
|
|
119
119
|
listener: (this: ComboBoxLight<TItem>, ev: ComboBoxLightEventMap<TItem>[K]) => void,
|
|
120
|
-
options?: boolean | AddEventListenerOptions
|
|
120
|
+
options?: boolean | AddEventListenerOptions,
|
|
121
121
|
): void;
|
|
122
122
|
|
|
123
123
|
removeEventListener<K extends keyof ComboBoxLightEventMap<TItem>>(
|
|
124
124
|
type: K,
|
|
125
125
|
listener: (this: ComboBoxLight<TItem>, ev: ComboBoxLightEventMap<TItem>[K]) => void,
|
|
126
|
-
options?: boolean | EventListenerOptions
|
|
126
|
+
options?: boolean | EventListenerOptions,
|
|
127
127
|
): void;
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -19,11 +19,11 @@ export interface ComboBoxItemModel<TItem> {
|
|
|
19
19
|
export type ComboBoxRenderer<TItem> = (
|
|
20
20
|
root: HTMLElement,
|
|
21
21
|
comboBox: ComboBox<TItem>,
|
|
22
|
-
model: ComboBoxItemModel<TItem
|
|
22
|
+
model: ComboBoxItemModel<TItem>,
|
|
23
23
|
) => void;
|
|
24
24
|
|
|
25
25
|
export declare function ComboBoxMixin<TItem, T extends Constructor<HTMLElement>>(
|
|
26
|
-
base: T
|
|
26
|
+
base: T,
|
|
27
27
|
): T &
|
|
28
28
|
Constructor<ComboBoxMixinClass<TItem>> &
|
|
29
29
|
Constructor<DisabledMixinClass> &
|
|
@@ -26,7 +26,7 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
26
26
|
notify: true,
|
|
27
27
|
value: false,
|
|
28
28
|
reflectToAttribute: true,
|
|
29
|
-
observer: '_openedChanged'
|
|
29
|
+
observer: '_openedChanged',
|
|
30
30
|
},
|
|
31
31
|
|
|
32
32
|
/**
|
|
@@ -34,7 +34,7 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
34
34
|
* @attr {boolean} auto-open-disabled
|
|
35
35
|
*/
|
|
36
36
|
autoOpenDisabled: {
|
|
37
|
-
type: Boolean
|
|
37
|
+
type: Boolean,
|
|
38
38
|
},
|
|
39
39
|
|
|
40
40
|
/**
|
|
@@ -44,7 +44,7 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
44
44
|
readonly: {
|
|
45
45
|
type: Boolean,
|
|
46
46
|
value: false,
|
|
47
|
-
reflectToAttribute: true
|
|
47
|
+
reflectToAttribute: true,
|
|
48
48
|
},
|
|
49
49
|
|
|
50
50
|
/**
|
|
@@ -68,7 +68,7 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
68
68
|
*/
|
|
69
69
|
items: {
|
|
70
70
|
type: Array,
|
|
71
|
-
observer: '_itemsChanged'
|
|
71
|
+
observer: '_itemsChanged',
|
|
72
72
|
},
|
|
73
73
|
|
|
74
74
|
/**
|
|
@@ -81,7 +81,7 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
81
81
|
*/
|
|
82
82
|
allowCustomValue: {
|
|
83
83
|
type: Boolean,
|
|
84
|
-
value: false
|
|
84
|
+
value: false,
|
|
85
85
|
},
|
|
86
86
|
|
|
87
87
|
/**
|
|
@@ -91,7 +91,7 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
91
91
|
* @type {!Array<!ComboBoxItem | string> | undefined}
|
|
92
92
|
*/
|
|
93
93
|
filteredItems: {
|
|
94
|
-
type: Array
|
|
94
|
+
type: Array,
|
|
95
95
|
},
|
|
96
96
|
|
|
97
97
|
/**
|
|
@@ -108,7 +108,7 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
108
108
|
type: Boolean,
|
|
109
109
|
value: false,
|
|
110
110
|
reflectToAttribute: true,
|
|
111
|
-
observer: '_loadingChanged'
|
|
111
|
+
observer: '_loadingChanged',
|
|
112
112
|
},
|
|
113
113
|
|
|
114
114
|
/**
|
|
@@ -118,7 +118,7 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
118
118
|
_focusedIndex: {
|
|
119
119
|
type: Number,
|
|
120
120
|
observer: '_focusedIndexChanged',
|
|
121
|
-
value: -1
|
|
121
|
+
value: -1,
|
|
122
122
|
},
|
|
123
123
|
|
|
124
124
|
/**
|
|
@@ -128,7 +128,7 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
128
128
|
filter: {
|
|
129
129
|
type: String,
|
|
130
130
|
value: '',
|
|
131
|
-
notify: true
|
|
131
|
+
notify: true,
|
|
132
132
|
},
|
|
133
133
|
|
|
134
134
|
/**
|
|
@@ -137,7 +137,7 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
137
137
|
*/
|
|
138
138
|
selectedItem: {
|
|
139
139
|
type: Object,
|
|
140
|
-
notify: true
|
|
140
|
+
notify: true,
|
|
141
141
|
},
|
|
142
142
|
|
|
143
143
|
/**
|
|
@@ -153,7 +153,7 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
153
153
|
itemLabelPath: {
|
|
154
154
|
type: String,
|
|
155
155
|
value: 'label',
|
|
156
|
-
observer: '_itemLabelPathChanged'
|
|
156
|
+
observer: '_itemLabelPathChanged',
|
|
157
157
|
},
|
|
158
158
|
|
|
159
159
|
/**
|
|
@@ -168,7 +168,7 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
168
168
|
*/
|
|
169
169
|
itemValuePath: {
|
|
170
170
|
type: String,
|
|
171
|
-
value: 'value'
|
|
171
|
+
value: 'value',
|
|
172
172
|
},
|
|
173
173
|
|
|
174
174
|
/**
|
|
@@ -186,11 +186,11 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
186
186
|
*/
|
|
187
187
|
_toggleElement: {
|
|
188
188
|
type: Object,
|
|
189
|
-
observer: '_toggleElementChanged'
|
|
189
|
+
observer: '_toggleElementChanged',
|
|
190
190
|
},
|
|
191
191
|
|
|
192
192
|
/** @private */
|
|
193
|
-
_closeOnBlurIsPrevented: Boolean
|
|
193
|
+
_closeOnBlurIsPrevented: Boolean,
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
196
|
|
|
@@ -199,7 +199,7 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
199
199
|
'_filterChanged(filter, itemValuePath, itemLabelPath)',
|
|
200
200
|
'_itemsOrPathsChanged(items.*, itemValuePath, itemLabelPath)',
|
|
201
201
|
'_filteredItemsChanged(filteredItems.*, itemValuePath, itemLabelPath)',
|
|
202
|
-
'_selectedItemChanged(selectedItem, itemValuePath, itemLabelPath)'
|
|
202
|
+
'_selectedItemChanged(selectedItem, itemValuePath, itemLabelPath)',
|
|
203
203
|
];
|
|
204
204
|
}
|
|
205
205
|
|
|
@@ -732,7 +732,7 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
732
732
|
detail: customValue,
|
|
733
733
|
composed: true,
|
|
734
734
|
cancelable: true,
|
|
735
|
-
bubbles: true
|
|
735
|
+
bubbles: true,
|
|
736
736
|
});
|
|
737
737
|
this.dispatchEvent(e);
|
|
738
738
|
if (!e.defaultPrevented) {
|
|
@@ -56,7 +56,7 @@ export class ComboBoxScroller extends PolymerElement {
|
|
|
56
56
|
*/
|
|
57
57
|
items: {
|
|
58
58
|
type: Array,
|
|
59
|
-
observer: '__itemsChanged'
|
|
59
|
+
observer: '__itemsChanged',
|
|
60
60
|
},
|
|
61
61
|
|
|
62
62
|
/**
|
|
@@ -65,7 +65,7 @@ export class ComboBoxScroller extends PolymerElement {
|
|
|
65
65
|
*/
|
|
66
66
|
focusedIndex: {
|
|
67
67
|
type: Number,
|
|
68
|
-
observer: '__focusedIndexChanged'
|
|
68
|
+
observer: '__focusedIndexChanged',
|
|
69
69
|
},
|
|
70
70
|
|
|
71
71
|
/**
|
|
@@ -73,7 +73,7 @@ export class ComboBoxScroller extends PolymerElement {
|
|
|
73
73
|
*/
|
|
74
74
|
loading: {
|
|
75
75
|
type: Boolean,
|
|
76
|
-
observer: '__loadingChanged'
|
|
76
|
+
observer: '__loadingChanged',
|
|
77
77
|
},
|
|
78
78
|
|
|
79
79
|
/**
|
|
@@ -82,35 +82,35 @@ export class ComboBoxScroller extends PolymerElement {
|
|
|
82
82
|
*/
|
|
83
83
|
opened: {
|
|
84
84
|
type: Boolean,
|
|
85
|
-
observer: '__openedChanged'
|
|
85
|
+
observer: '__openedChanged',
|
|
86
86
|
},
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
89
|
* The selected item from the `items` array.
|
|
90
90
|
*/
|
|
91
91
|
selectedItem: {
|
|
92
|
-
type: Object
|
|
92
|
+
type: Object,
|
|
93
93
|
},
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
96
|
* Path for the id of the item, used to detect whether the item is selected.
|
|
97
97
|
*/
|
|
98
98
|
itemIdPath: {
|
|
99
|
-
type: String
|
|
99
|
+
type: String,
|
|
100
100
|
},
|
|
101
101
|
|
|
102
102
|
/**
|
|
103
103
|
* Reference to the combo-box, used by the item elements.
|
|
104
104
|
*/
|
|
105
105
|
comboBox: {
|
|
106
|
-
type: Object
|
|
106
|
+
type: Object,
|
|
107
107
|
},
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Function used to set a label for every combo-box item.
|
|
111
111
|
*/
|
|
112
112
|
getItemLabel: {
|
|
113
|
-
type: Object
|
|
113
|
+
type: Object,
|
|
114
114
|
},
|
|
115
115
|
|
|
116
116
|
/**
|
|
@@ -118,15 +118,15 @@ export class ComboBoxScroller extends PolymerElement {
|
|
|
118
118
|
*/
|
|
119
119
|
renderer: {
|
|
120
120
|
type: Object,
|
|
121
|
-
observer: '__rendererChanged'
|
|
121
|
+
observer: '__rendererChanged',
|
|
122
122
|
},
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* Used to propagate the `theme` attribute from the host element.
|
|
126
126
|
*/
|
|
127
127
|
theme: {
|
|
128
|
-
type: String
|
|
129
|
-
}
|
|
128
|
+
type: String,
|
|
129
|
+
},
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
132
|
|
|
@@ -159,7 +159,7 @@ export class ComboBoxScroller extends PolymerElement {
|
|
|
159
159
|
updateElement: this.__updateElement.bind(this),
|
|
160
160
|
elementsContainer: this,
|
|
161
161
|
scrollTarget: this,
|
|
162
|
-
scrollContainer: this.$.selector
|
|
162
|
+
scrollContainer: this.$.selector,
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
|
|
@@ -193,7 +193,7 @@ export class ComboBoxScroller extends PolymerElement {
|
|
|
193
193
|
|
|
194
194
|
// Sometimes the item is partly below the bottom edge, detect and adjust.
|
|
195
195
|
const lastPhysicalItem = [...this.children].find(
|
|
196
|
-
(el) => !el.hidden && el.index === this.__virtualizer.lastVisibleIndex
|
|
196
|
+
(el) => !el.hidden && el.index === this.__virtualizer.lastVisibleIndex,
|
|
197
197
|
);
|
|
198
198
|
if (!lastPhysicalItem || index !== lastPhysicalItem.index) {
|
|
199
199
|
return;
|
|
@@ -260,7 +260,9 @@ export class ComboBoxScroller extends PolymerElement {
|
|
|
260
260
|
this.requestContentUpdate();
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
|
|
263
|
+
// Do not jump back to the previously focused item while loading
|
|
264
|
+
// when requesting next page from the data provider on scroll.
|
|
265
|
+
if (index >= 0 && !this.loading) {
|
|
264
266
|
this.scrollIntoView(index);
|
|
265
267
|
}
|
|
266
268
|
}
|
|
@@ -295,7 +297,7 @@ export class ComboBoxScroller extends PolymerElement {
|
|
|
295
297
|
label: this.getItemLabel(item),
|
|
296
298
|
selected: this.__isItemSelected(item, this.selectedItem, this.itemIdPath),
|
|
297
299
|
renderer: this.renderer,
|
|
298
|
-
focused: this.__isItemFocused(focusedIndex, index)
|
|
300
|
+
focused: this.__isItemFocused(focusedIndex, index),
|
|
299
301
|
});
|
|
300
302
|
|
|
301
303
|
el.id = `${this.__hostTagName}-item-${index}`;
|
|
@@ -356,7 +358,7 @@ export class ComboBoxScroller extends PolymerElement {
|
|
|
356
358
|
__requestItemByIndex(item, index) {
|
|
357
359
|
if (item instanceof ComboBoxPlaceholder && index !== undefined) {
|
|
358
360
|
this.dispatchEvent(
|
|
359
|
-
new CustomEvent('index-requested', { detail: { index, currentScrollerPos: this._oldScrollerPosition } })
|
|
361
|
+
new CustomEvent('index-requested', { detail: { index, currentScrollerPos: this._oldScrollerPosition } }),
|
|
360
362
|
);
|
|
361
363
|
}
|
|
362
364
|
|
|
@@ -24,7 +24,7 @@ import { ComboBoxDefaultItem } from './vaadin-combo-box-mixin.js';
|
|
|
24
24
|
export {
|
|
25
25
|
ComboBoxDataProvider,
|
|
26
26
|
ComboBoxDataProviderCallback,
|
|
27
|
-
ComboBoxDataProviderParams
|
|
27
|
+
ComboBoxDataProviderParams,
|
|
28
28
|
} from './vaadin-combo-box-data-provider-mixin.js';
|
|
29
29
|
export { ComboBoxDefaultItem, ComboBoxItemModel, ComboBoxRenderer } from './vaadin-combo-box-mixin.js';
|
|
30
30
|
|
|
@@ -203,13 +203,13 @@ declare class ComboBox<TItem = ComboBoxDefaultItem> extends HTMLElement {
|
|
|
203
203
|
addEventListener<K extends keyof ComboBoxEventMap<TItem>>(
|
|
204
204
|
type: K,
|
|
205
205
|
listener: (this: ComboBox<TItem>, ev: ComboBoxEventMap<TItem>[K]) => void,
|
|
206
|
-
options?: boolean | AddEventListenerOptions
|
|
206
|
+
options?: boolean | AddEventListenerOptions,
|
|
207
207
|
): void;
|
|
208
208
|
|
|
209
209
|
removeEventListener<K extends keyof ComboBoxEventMap<TItem>>(
|
|
210
210
|
type: K,
|
|
211
211
|
listener: (this: ComboBox<TItem>, ev: ComboBoxEventMap<TItem>[K]) => void,
|
|
212
|
-
options?: boolean | EventListenerOptions
|
|
212
|
+
options?: boolean | EventListenerOptions,
|
|
213
213
|
): void;
|
|
214
214
|
}
|
|
215
215
|
|
package/src/vaadin-combo-box.js
CHANGED
|
@@ -154,7 +154,7 @@ registerStyles('vaadin-combo-box', inputFieldShared, { moduleId: 'vaadin-combo-b
|
|
|
154
154
|
* @mixes ComboBoxMixin
|
|
155
155
|
*/
|
|
156
156
|
class ComboBox extends ComboBoxDataProviderMixin(
|
|
157
|
-
ComboBoxMixin(PatternMixin(InputControlMixin(ThemableMixin(ElementMixin(PolymerElement)))))
|
|
157
|
+
ComboBoxMixin(PatternMixin(InputControlMixin(ThemableMixin(ElementMixin(PolymerElement))))),
|
|
158
158
|
) {
|
|
159
159
|
static get is() {
|
|
160
160
|
return 'vaadin-combo-box';
|
|
@@ -216,8 +216,8 @@ class ComboBox extends ComboBoxDataProviderMixin(
|
|
|
216
216
|
* @protected
|
|
217
217
|
*/
|
|
218
218
|
_positionTarget: {
|
|
219
|
-
type: Object
|
|
220
|
-
}
|
|
219
|
+
type: Object,
|
|
220
|
+
},
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
223
|
|
|
@@ -240,7 +240,7 @@ class ComboBox extends ComboBoxDataProviderMixin(
|
|
|
240
240
|
this._setFocusElement(input);
|
|
241
241
|
this.stateTarget = input;
|
|
242
242
|
this.ariaTarget = input;
|
|
243
|
-
})
|
|
243
|
+
}),
|
|
244
244
|
);
|
|
245
245
|
this.addController(new LabelledInputController(this.inputElement, this._labelController));
|
|
246
246
|
this._positionTarget = this.shadowRoot.querySelector('[part="input-field"]');
|