@vaadin/combo-box 24.6.0-alpha7 → 24.6.0-alpha8
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-combo-box-light-mixin.js +0 -11
- package/src/vaadin-combo-box-mixin.js +1 -1
- package/web-types.json +46 -2
- package/web-types.lit.json +16 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/combo-box",
|
|
3
|
-
"version": "24.6.0-
|
|
3
|
+
"version": "24.6.0-alpha8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,27 +38,27 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
40
40
|
"@polymer/polymer": "^3.0.0",
|
|
41
|
-
"@vaadin/a11y-base": "24.6.0-
|
|
42
|
-
"@vaadin/component-base": "24.6.0-
|
|
43
|
-
"@vaadin/field-base": "24.6.0-
|
|
44
|
-
"@vaadin/input-container": "24.6.0-
|
|
45
|
-
"@vaadin/item": "24.6.0-
|
|
46
|
-
"@vaadin/lit-renderer": "24.6.0-
|
|
47
|
-
"@vaadin/overlay": "24.6.0-
|
|
48
|
-
"@vaadin/vaadin-lumo-styles": "24.6.0-
|
|
49
|
-
"@vaadin/vaadin-material-styles": "24.6.0-
|
|
50
|
-
"@vaadin/vaadin-themable-mixin": "24.6.0-
|
|
41
|
+
"@vaadin/a11y-base": "24.6.0-alpha8",
|
|
42
|
+
"@vaadin/component-base": "24.6.0-alpha8",
|
|
43
|
+
"@vaadin/field-base": "24.6.0-alpha8",
|
|
44
|
+
"@vaadin/input-container": "24.6.0-alpha8",
|
|
45
|
+
"@vaadin/item": "24.6.0-alpha8",
|
|
46
|
+
"@vaadin/lit-renderer": "24.6.0-alpha8",
|
|
47
|
+
"@vaadin/overlay": "24.6.0-alpha8",
|
|
48
|
+
"@vaadin/vaadin-lumo-styles": "24.6.0-alpha8",
|
|
49
|
+
"@vaadin/vaadin-material-styles": "24.6.0-alpha8",
|
|
50
|
+
"@vaadin/vaadin-themable-mixin": "24.6.0-alpha8",
|
|
51
51
|
"lit": "^3.0.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@vaadin/chai-plugins": "24.6.0-
|
|
54
|
+
"@vaadin/chai-plugins": "24.6.0-alpha8",
|
|
55
55
|
"@vaadin/testing-helpers": "^1.0.0",
|
|
56
|
-
"@vaadin/text-field": "24.6.0-
|
|
56
|
+
"@vaadin/text-field": "24.6.0-alpha8",
|
|
57
57
|
"sinon": "^18.0.0"
|
|
58
58
|
},
|
|
59
59
|
"web-types": [
|
|
60
60
|
"web-types.json",
|
|
61
61
|
"web-types.lit.json"
|
|
62
62
|
],
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "a11e1510c4caa08775b202714f5fc1198c22132a"
|
|
64
64
|
}
|
|
@@ -99,17 +99,6 @@ export const ComboBoxLightMixin = (superClass) =>
|
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
/**
|
|
103
|
-
* Returns true if the current input value satisfies all constraints (if any).
|
|
104
|
-
* @return {boolean}
|
|
105
|
-
*/
|
|
106
|
-
checkValidity() {
|
|
107
|
-
if (this.inputElement && this.inputElement.validate) {
|
|
108
|
-
return this.inputElement.validate();
|
|
109
|
-
}
|
|
110
|
-
return super.checkValidity();
|
|
111
|
-
}
|
|
112
|
-
|
|
113
102
|
/**
|
|
114
103
|
* @protected
|
|
115
104
|
* @override
|
|
@@ -1177,7 +1177,7 @@ export const ComboBoxMixin = (subclass) =>
|
|
|
1177
1177
|
// Do not validate when focusout is caused by document
|
|
1178
1178
|
// losing focus, which happens on browser tab switch.
|
|
1179
1179
|
if (document.hasFocus()) {
|
|
1180
|
-
this.
|
|
1180
|
+
this._requestValidation();
|
|
1181
1181
|
}
|
|
1182
1182
|
|
|
1183
1183
|
if (this.value !== this._lastCommittedValue) {
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/combo-box",
|
|
4
|
-
"version": "24.6.0-
|
|
4
|
+
"version": "24.6.0-alpha8",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -40,6 +40,17 @@
|
|
|
40
40
|
]
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
+
{
|
|
44
|
+
"name": "manual-validation",
|
|
45
|
+
"description": "Set to true to enable manual validation mode. This mode disables automatic\nconstraint validation, allowing you to control the validation process yourself.\nYou can still trigger constraint validation manually with the `validate()` method\nor use `checkValidity()` to assess the component's validity without affecting\nthe invalid state. In manual validation mode, you can also manipulate\nthe `invalid` property directly through your application logic without conflicts\nwith the component's internal validation.",
|
|
46
|
+
"value": {
|
|
47
|
+
"type": [
|
|
48
|
+
"boolean",
|
|
49
|
+
"null",
|
|
50
|
+
"undefined"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
43
54
|
{
|
|
44
55
|
"name": "required",
|
|
45
56
|
"description": "Specifies that the user must fill in a value.",
|
|
@@ -232,6 +243,17 @@
|
|
|
232
243
|
]
|
|
233
244
|
}
|
|
234
245
|
},
|
|
246
|
+
{
|
|
247
|
+
"name": "manualValidation",
|
|
248
|
+
"description": "Set to true to enable manual validation mode. This mode disables automatic\nconstraint validation, allowing you to control the validation process yourself.\nYou can still trigger constraint validation manually with the `validate()` method\nor use `checkValidity()` to assess the component's validity without affecting\nthe invalid state. In manual validation mode, you can also manipulate\nthe `invalid` property directly through your application logic without conflicts\nwith the component's internal validation.",
|
|
249
|
+
"value": {
|
|
250
|
+
"type": [
|
|
251
|
+
"boolean",
|
|
252
|
+
"null",
|
|
253
|
+
"undefined"
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
},
|
|
235
257
|
{
|
|
236
258
|
"name": "required",
|
|
237
259
|
"description": "Specifies that the user must fill in a value.",
|
|
@@ -471,7 +493,7 @@
|
|
|
471
493
|
},
|
|
472
494
|
{
|
|
473
495
|
"name": "vaadin-combo-box",
|
|
474
|
-
"description": "`<vaadin-combo-box>` is a web component for choosing a value from a filterable list of options\npresented in a dropdown overlay. The options can be provided as a list of strings or objects\nby setting [`items`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-
|
|
496
|
+
"description": "`<vaadin-combo-box>` is a web component for choosing a value from a filterable list of options\npresented in a dropdown overlay. The options can be provided as a list of strings or objects\nby setting [`items`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha8/#/elements/vaadin-combo-box#property-items) property on the element.\n\n```html\n<vaadin-combo-box id=\"combo-box\"></vaadin-combo-box>\n```\n```js\ndocument.querySelector('#combo-box').items = ['apple', 'orange', 'banana'];\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Item rendering\n\nTo customize the content of the `<vaadin-combo-box-item>` elements placed in the dropdown, use\n[`renderer`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha8/#/elements/vaadin-combo-box#property-renderer) property which accepts a function.\nThe renderer function is called with `root`, `comboBox`, and `model` as arguments.\n\nGenerate DOM content by using `model` object properties if needed, and append it to the `root`\nelement. The `comboBox` reference is provided to access the combo-box element state. Do not\nset combo-box properties in a `renderer` function.\n\n```js\nconst comboBox = document.querySelector('#combo-box');\ncomboBox.items = [{'label': 'Hydrogen', 'value': 'H'}];\ncomboBox.renderer = (root, comboBox, model) => {\n const item = model.item;\n root.innerHTML = `${model.index}: ${item.label} <b>${item.value}</b>`;\n};\n```\n\nRenderer is called on the opening of the combo-box and each time the related model is updated.\nBefore creating new content, it is recommended to check if there is already an existing DOM\nelement in `root` from a previous renderer call for reusing it. Even though combo-box uses\ninfinite scrolling, reducing DOM operations might improve performance.\n\nThe following properties are available in the `model` argument:\n\nProperty | Type | Description\n-----------|------------------|-------------\n`index` | Number | Index of the item in the `items` array\n`item` | String or Object | The item reference\n`selected` | Boolean | True when item is selected\n`focused` | Boolean | True when item is focused\n\n### Lazy Loading with Function Data Provider\n\nIn addition to assigning an array to the items property, you can alternatively use the\n[`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha8/#/elements/vaadin-combo-box#property-dataProvider) function property.\nThe `<vaadin-combo-box>` calls this function lazily, only when it needs more data\nto be displayed.\n\n__Note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```js\ncomboBox.dataProvider = async (params, callback) => {\n const API = 'https://demo.vaadin.com/demo-data/1.0/filtered-countries';\n const { filter, page, pageSize } = params;\n const index = page * pageSize;\n\n const res = await fetch(`${API}?index=${index}&count=${pageSize}&filter=${filter}`);\n if (res.ok) {\n const { result, size } = await res.json();\n callback(result, size);\n }\n};\n```\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n----------------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n`--vaadin-combo-box-overlay-width` | Width of the overlay | `auto`\n`--vaadin-combo-box-overlay-max-height` | Max height of the overlay | `65vh`\n\n`<vaadin-combo-box>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha8/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n----------------|----------------\n`toggle-button` | The toggle button\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description | Part name\n----------|-------------|------------\n`opened` | Set when the combo box dropdown is open | :host\n`loading` | Set when new items are expected | :host\n\nIf you want to replace the default `<input>` and its container with a custom implementation to get full control\nover the input field, consider using the [`<vaadin-combo-box-light>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha8/#/elements/vaadin-combo-box-light) element.\n\n### Internal components\n\nIn addition to `<vaadin-combo-box>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-combo-box-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha8/#/elements/vaadin-overlay).\n- `<vaadin-combo-box-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha8/#/elements/vaadin-item).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha8/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nNote: the `theme` attribute value set on `<vaadin-combo-box>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
475
497
|
"attributes": [
|
|
476
498
|
{
|
|
477
499
|
"name": "disabled",
|
|
@@ -517,6 +539,17 @@
|
|
|
517
539
|
]
|
|
518
540
|
}
|
|
519
541
|
},
|
|
542
|
+
{
|
|
543
|
+
"name": "manual-validation",
|
|
544
|
+
"description": "Set to true to enable manual validation mode. This mode disables automatic\nconstraint validation, allowing you to control the validation process yourself.\nYou can still trigger constraint validation manually with the `validate()` method\nor use `checkValidity()` to assess the component's validity without affecting\nthe invalid state. In manual validation mode, you can also manipulate\nthe `invalid` property directly through your application logic without conflicts\nwith the component's internal validation.",
|
|
545
|
+
"value": {
|
|
546
|
+
"type": [
|
|
547
|
+
"boolean",
|
|
548
|
+
"null",
|
|
549
|
+
"undefined"
|
|
550
|
+
]
|
|
551
|
+
}
|
|
552
|
+
},
|
|
520
553
|
{
|
|
521
554
|
"name": "required",
|
|
522
555
|
"description": "Specifies that the user must fill in a value.",
|
|
@@ -833,6 +866,17 @@
|
|
|
833
866
|
]
|
|
834
867
|
}
|
|
835
868
|
},
|
|
869
|
+
{
|
|
870
|
+
"name": "manualValidation",
|
|
871
|
+
"description": "Set to true to enable manual validation mode. This mode disables automatic\nconstraint validation, allowing you to control the validation process yourself.\nYou can still trigger constraint validation manually with the `validate()` method\nor use `checkValidity()` to assess the component's validity without affecting\nthe invalid state. In manual validation mode, you can also manipulate\nthe `invalid` property directly through your application logic without conflicts\nwith the component's internal validation.",
|
|
872
|
+
"value": {
|
|
873
|
+
"type": [
|
|
874
|
+
"boolean",
|
|
875
|
+
"null",
|
|
876
|
+
"undefined"
|
|
877
|
+
]
|
|
878
|
+
}
|
|
879
|
+
},
|
|
836
880
|
{
|
|
837
881
|
"name": "required",
|
|
838
882
|
"description": "Specifies that the user must fill in a value.",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/combo-box",
|
|
4
|
-
"version": "24.6.0-
|
|
4
|
+
"version": "24.6.0-alpha8",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -26,6 +26,13 @@
|
|
|
26
26
|
"kind": "expression"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
+
{
|
|
30
|
+
"name": "?manualValidation",
|
|
31
|
+
"description": "Set to true to enable manual validation mode. This mode disables automatic\nconstraint validation, allowing you to control the validation process yourself.\nYou can still trigger constraint validation manually with the `validate()` method\nor use `checkValidity()` to assess the component's validity without affecting\nthe invalid state. In manual validation mode, you can also manipulate\nthe `invalid` property directly through your application logic without conflicts\nwith the component's internal validation.",
|
|
32
|
+
"value": {
|
|
33
|
+
"kind": "expression"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
29
36
|
{
|
|
30
37
|
"name": "?required",
|
|
31
38
|
"description": "Specifies that the user must fill in a value.",
|
|
@@ -254,7 +261,7 @@
|
|
|
254
261
|
},
|
|
255
262
|
{
|
|
256
263
|
"name": "vaadin-combo-box",
|
|
257
|
-
"description": "`<vaadin-combo-box>` is a web component for choosing a value from a filterable list of options\npresented in a dropdown overlay. The options can be provided as a list of strings or objects\nby setting [`items`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-
|
|
264
|
+
"description": "`<vaadin-combo-box>` is a web component for choosing a value from a filterable list of options\npresented in a dropdown overlay. The options can be provided as a list of strings or objects\nby setting [`items`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha8/#/elements/vaadin-combo-box#property-items) property on the element.\n\n```html\n<vaadin-combo-box id=\"combo-box\"></vaadin-combo-box>\n```\n```js\ndocument.querySelector('#combo-box').items = ['apple', 'orange', 'banana'];\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Item rendering\n\nTo customize the content of the `<vaadin-combo-box-item>` elements placed in the dropdown, use\n[`renderer`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha8/#/elements/vaadin-combo-box#property-renderer) property which accepts a function.\nThe renderer function is called with `root`, `comboBox`, and `model` as arguments.\n\nGenerate DOM content by using `model` object properties if needed, and append it to the `root`\nelement. The `comboBox` reference is provided to access the combo-box element state. Do not\nset combo-box properties in a `renderer` function.\n\n```js\nconst comboBox = document.querySelector('#combo-box');\ncomboBox.items = [{'label': 'Hydrogen', 'value': 'H'}];\ncomboBox.renderer = (root, comboBox, model) => {\n const item = model.item;\n root.innerHTML = `${model.index}: ${item.label} <b>${item.value}</b>`;\n};\n```\n\nRenderer is called on the opening of the combo-box and each time the related model is updated.\nBefore creating new content, it is recommended to check if there is already an existing DOM\nelement in `root` from a previous renderer call for reusing it. Even though combo-box uses\ninfinite scrolling, reducing DOM operations might improve performance.\n\nThe following properties are available in the `model` argument:\n\nProperty | Type | Description\n-----------|------------------|-------------\n`index` | Number | Index of the item in the `items` array\n`item` | String or Object | The item reference\n`selected` | Boolean | True when item is selected\n`focused` | Boolean | True when item is focused\n\n### Lazy Loading with Function Data Provider\n\nIn addition to assigning an array to the items property, you can alternatively use the\n[`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha8/#/elements/vaadin-combo-box#property-dataProvider) function property.\nThe `<vaadin-combo-box>` calls this function lazily, only when it needs more data\nto be displayed.\n\n__Note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```js\ncomboBox.dataProvider = async (params, callback) => {\n const API = 'https://demo.vaadin.com/demo-data/1.0/filtered-countries';\n const { filter, page, pageSize } = params;\n const index = page * pageSize;\n\n const res = await fetch(`${API}?index=${index}&count=${pageSize}&filter=${filter}`);\n if (res.ok) {\n const { result, size } = await res.json();\n callback(result, size);\n }\n};\n```\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n----------------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n`--vaadin-combo-box-overlay-width` | Width of the overlay | `auto`\n`--vaadin-combo-box-overlay-max-height` | Max height of the overlay | `65vh`\n\n`<vaadin-combo-box>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha8/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n----------------|----------------\n`toggle-button` | The toggle button\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description | Part name\n----------|-------------|------------\n`opened` | Set when the combo box dropdown is open | :host\n`loading` | Set when new items are expected | :host\n\nIf you want to replace the default `<input>` and its container with a custom implementation to get full control\nover the input field, consider using the [`<vaadin-combo-box-light>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha8/#/elements/vaadin-combo-box-light) element.\n\n### Internal components\n\nIn addition to `<vaadin-combo-box>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-combo-box-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha8/#/elements/vaadin-overlay).\n- `<vaadin-combo-box-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha8/#/elements/vaadin-item).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha8/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nNote: the `theme` attribute value set on `<vaadin-combo-box>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
258
265
|
"extension": true,
|
|
259
266
|
"attributes": [
|
|
260
267
|
{
|
|
@@ -278,6 +285,13 @@
|
|
|
278
285
|
"kind": "expression"
|
|
279
286
|
}
|
|
280
287
|
},
|
|
288
|
+
{
|
|
289
|
+
"name": "?manualValidation",
|
|
290
|
+
"description": "Set to true to enable manual validation mode. This mode disables automatic\nconstraint validation, allowing you to control the validation process yourself.\nYou can still trigger constraint validation manually with the `validate()` method\nor use `checkValidity()` to assess the component's validity without affecting\nthe invalid state. In manual validation mode, you can also manipulate\nthe `invalid` property directly through your application logic without conflicts\nwith the component's internal validation.",
|
|
291
|
+
"value": {
|
|
292
|
+
"kind": "expression"
|
|
293
|
+
}
|
|
294
|
+
},
|
|
281
295
|
{
|
|
282
296
|
"name": "?required",
|
|
283
297
|
"description": "Specifies that the user must fill in a value.",
|