@vaadin/combo-box 25.0.0-alpha3 → 25.0.0-alpha4
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/styles/vaadin-combo-box-base-styles.js +7 -5
- package/src/styles/vaadin-combo-box-overlay-base-styles.js +45 -43
- package/src/styles/vaadin-combo-box-scroller-base-styles.js +19 -17
- package/src/vaadin-combo-box-base-mixin.d.ts +56 -0
- package/src/vaadin-combo-box-base-mixin.js +786 -0
- package/src/vaadin-combo-box-data-provider-mixin.js +16 -11
- package/src/vaadin-combo-box-item-mixin.js +6 -1
- package/src/vaadin-combo-box-item.js +5 -2
- package/src/vaadin-combo-box-mixin.d.ts +3 -32
- package/src/vaadin-combo-box-mixin.js +91 -661
- package/src/vaadin-combo-box-overlay-mixin.js +6 -3
- package/src/vaadin-combo-box-overlay.js +3 -2
- package/src/vaadin-combo-box-scroller.js +2 -1
- package/src/vaadin-combo-box.d.ts +2 -0
- package/src/vaadin-combo-box.js +4 -1
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
|
@@ -54,17 +54,6 @@ export const ComboBoxDataProviderMixin = (superClass) =>
|
|
|
54
54
|
observer: '_dataProviderChanged',
|
|
55
55
|
sync: true,
|
|
56
56
|
},
|
|
57
|
-
|
|
58
|
-
/** @private */
|
|
59
|
-
__dataProviderInitialized: {
|
|
60
|
-
type: Boolean,
|
|
61
|
-
value: false,
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
/** @private */
|
|
65
|
-
__previousDataProviderFilter: {
|
|
66
|
-
type: String,
|
|
67
|
-
},
|
|
68
57
|
};
|
|
69
58
|
}
|
|
70
59
|
|
|
@@ -79,6 +68,22 @@ export const ComboBoxDataProviderMixin = (superClass) =>
|
|
|
79
68
|
constructor() {
|
|
80
69
|
super();
|
|
81
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Flag indicating that data provider has been initialized.
|
|
73
|
+
* Do not define in `properties` to avoid triggering updates.
|
|
74
|
+
* @type {boolean}
|
|
75
|
+
* @protected
|
|
76
|
+
*/
|
|
77
|
+
this.__dataProviderInitialized = false;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Used to store the previous value of the data provider filter.
|
|
81
|
+
* Do not define in `properties` to avoid triggering updates.
|
|
82
|
+
* @type {string}
|
|
83
|
+
* @protected
|
|
84
|
+
*/
|
|
85
|
+
this.__previousDataProviderFilter;
|
|
86
|
+
|
|
82
87
|
/**
|
|
83
88
|
* @type {DataProviderController}
|
|
84
89
|
* @private
|
|
@@ -84,12 +84,17 @@ export const ComboBoxItemMixin = (superClass) =>
|
|
|
84
84
|
|
|
85
85
|
this._owner = this.parentNode.owner;
|
|
86
86
|
|
|
87
|
-
const hostDir = this.
|
|
87
|
+
const hostDir = this._getHostDir();
|
|
88
88
|
if (hostDir) {
|
|
89
89
|
this.setAttribute('dir', hostDir);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
/** @protected */
|
|
94
|
+
_getHostDir() {
|
|
95
|
+
return this._owner && this._owner.getAttribute('dir');
|
|
96
|
+
}
|
|
97
|
+
|
|
93
98
|
/**
|
|
94
99
|
* Requests an update for the content of the item.
|
|
95
100
|
* While performing the update, it invokes the renderer passed in the `renderer` property.
|
|
@@ -7,7 +7,8 @@ import { html, LitElement } from 'lit';
|
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
8
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
9
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
-
import { itemStyles } from '@vaadin/item/src/vaadin-item-core-styles.js';
|
|
10
|
+
import { itemStyles } from '@vaadin/item/src/styles/vaadin-item-core-styles.js';
|
|
11
|
+
import { CSSInjectionMixin } from '@vaadin/vaadin-themable-mixin/css-injection-mixin.js';
|
|
11
12
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
13
|
import { ComboBoxItemMixin } from './vaadin-combo-box-item-mixin.js';
|
|
13
14
|
|
|
@@ -38,7 +39,9 @@ import { ComboBoxItemMixin } from './vaadin-combo-box-item-mixin.js';
|
|
|
38
39
|
* @mixes DirMixin
|
|
39
40
|
* @private
|
|
40
41
|
*/
|
|
41
|
-
export class ComboBoxItem extends ComboBoxItemMixin(
|
|
42
|
+
export class ComboBoxItem extends ComboBoxItemMixin(
|
|
43
|
+
CSSInjectionMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))),
|
|
44
|
+
) {
|
|
42
45
|
static get is() {
|
|
43
46
|
return 'vaadin-combo-box-item';
|
|
44
47
|
}
|
|
@@ -11,6 +11,7 @@ import type { OverlayClassMixinClass } from '@vaadin/component-base/src/overlay-
|
|
|
11
11
|
import type { InputMixinClass } from '@vaadin/field-base/src/input-mixin.js';
|
|
12
12
|
import type { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.js';
|
|
13
13
|
import type { ComboBox } from './vaadin-combo-box.js';
|
|
14
|
+
import type { ComboBoxBaseMixinClass } from './vaadin-combo-box-base-mixin.js';
|
|
14
15
|
import type { ComboBoxDefaultItem, ComboBoxItemModel, ComboBoxItemRenderer } from './vaadin-combo-box-item-mixin.js';
|
|
15
16
|
|
|
16
17
|
export type { ComboBoxDefaultItem, ComboBoxItemModel };
|
|
@@ -19,7 +20,8 @@ export type ComboBoxRenderer<TItem> = ComboBoxItemRenderer<TItem, ComboBox<TItem
|
|
|
19
20
|
|
|
20
21
|
export declare function ComboBoxMixin<TItem, T extends Constructor<HTMLElement>>(
|
|
21
22
|
base: T,
|
|
22
|
-
): Constructor<
|
|
23
|
+
): Constructor<ComboBoxBaseMixinClass> &
|
|
24
|
+
Constructor<ComboBoxMixinClass<TItem>> &
|
|
23
25
|
Constructor<DisabledMixinClass> &
|
|
24
26
|
Constructor<FocusMixinClass> &
|
|
25
27
|
Constructor<InputMixinClass> &
|
|
@@ -29,22 +31,6 @@ export declare function ComboBoxMixin<TItem, T extends Constructor<HTMLElement>>
|
|
|
29
31
|
T;
|
|
30
32
|
|
|
31
33
|
export declare class ComboBoxMixinClass<TItem> {
|
|
32
|
-
/**
|
|
33
|
-
* True if the dropdown is open, false otherwise.
|
|
34
|
-
*/
|
|
35
|
-
opened: boolean;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Set true to prevent the overlay from opening automatically.
|
|
39
|
-
* @attr {boolean} auto-open-disabled
|
|
40
|
-
*/
|
|
41
|
-
autoOpenDisabled: boolean | null | undefined;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* When present, it specifies that the field is read-only.
|
|
45
|
-
*/
|
|
46
|
-
readonly: boolean;
|
|
47
|
-
|
|
48
34
|
/**
|
|
49
35
|
* Custom function for rendering the content of every item.
|
|
50
36
|
* Receives three arguments:
|
|
@@ -144,11 +130,6 @@ export declare class ComboBoxMixinClass<TItem> {
|
|
|
144
130
|
*/
|
|
145
131
|
itemIdPath: string | null | undefined;
|
|
146
132
|
|
|
147
|
-
/**
|
|
148
|
-
* Tag name prefix used by scroller and items.
|
|
149
|
-
*/
|
|
150
|
-
protected readonly _tagNamePrefix: string;
|
|
151
|
-
|
|
152
133
|
/**
|
|
153
134
|
* Requests an update for the content of items.
|
|
154
135
|
* While performing the update, it invokes the renderer (passed in the `renderer` property) once an item.
|
|
@@ -156,14 +137,4 @@ export declare class ComboBoxMixinClass<TItem> {
|
|
|
156
137
|
* It is not guaranteed that the update happens immediately (synchronously) after it is requested.
|
|
157
138
|
*/
|
|
158
139
|
requestContentUpdate(): void;
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Opens the dropdown list.
|
|
162
|
-
*/
|
|
163
|
-
open(): void;
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Closes the dropdown list.
|
|
167
|
-
*/
|
|
168
|
-
close(): void;
|
|
169
140
|
}
|