@vaadin/combo-box 25.0.0-alpha16 → 25.0.0-alpha18
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.d.ts +28 -15
- package/src/vaadin-combo-box.js +28 -15
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/combo-box",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha18",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,26 +35,26 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
39
|
-
"@vaadin/component-base": "25.0.0-
|
|
40
|
-
"@vaadin/field-base": "25.0.0-
|
|
41
|
-
"@vaadin/input-container": "25.0.0-
|
|
42
|
-
"@vaadin/item": "25.0.0-
|
|
43
|
-
"@vaadin/lit-renderer": "25.0.0-
|
|
44
|
-
"@vaadin/overlay": "25.0.0-
|
|
45
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-
|
|
38
|
+
"@vaadin/a11y-base": "25.0.0-alpha18",
|
|
39
|
+
"@vaadin/component-base": "25.0.0-alpha18",
|
|
40
|
+
"@vaadin/field-base": "25.0.0-alpha18",
|
|
41
|
+
"@vaadin/input-container": "25.0.0-alpha18",
|
|
42
|
+
"@vaadin/item": "25.0.0-alpha18",
|
|
43
|
+
"@vaadin/lit-renderer": "25.0.0-alpha18",
|
|
44
|
+
"@vaadin/overlay": "25.0.0-alpha18",
|
|
45
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha18",
|
|
46
46
|
"lit": "^3.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
50
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
49
|
+
"@vaadin/chai-plugins": "25.0.0-alpha18",
|
|
50
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha18",
|
|
51
51
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
52
|
-
"@vaadin/vaadin-lumo-styles": "25.0.0-
|
|
53
|
-
"sinon": "^
|
|
52
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha18",
|
|
53
|
+
"sinon": "^21.0.0"
|
|
54
54
|
},
|
|
55
55
|
"web-types": [
|
|
56
56
|
"web-types.json",
|
|
57
57
|
"web-types.lit.json"
|
|
58
58
|
],
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "cb5cafb5687a117ebead1b81e2116991cec13abe"
|
|
60
60
|
}
|
|
@@ -175,24 +175,37 @@ export interface ComboBoxEventMap<TItem> extends HTMLElementEventMap {
|
|
|
175
175
|
* `--vaadin-combo-box-overlay-width` | Width of the overlay | `auto`
|
|
176
176
|
* `--vaadin-combo-box-overlay-max-height` | Max height of the overlay | `65vh`
|
|
177
177
|
*
|
|
178
|
-
*
|
|
179
|
-
* See [`<vaadin-text-field>`](#/elements/vaadin-text-field) for the styling documentation.
|
|
178
|
+
* The following shadow DOM parts are available for styling:
|
|
180
179
|
*
|
|
181
|
-
*
|
|
180
|
+
* Part name | Description
|
|
181
|
+
* ---------------------|----------------
|
|
182
|
+
* `label` | The label element
|
|
183
|
+
* `input-field` | The element that wraps prefix, value and buttons
|
|
184
|
+
* `clear-button` | The clear button
|
|
185
|
+
* `error-message` | The error message element
|
|
186
|
+
* `helper-text` | The helper text element wrapper
|
|
187
|
+
* `required-indicator` | The `required` state indicator element
|
|
188
|
+
* `toggle-button` | The toggle button
|
|
189
|
+
* `overlay` | The overlay container
|
|
190
|
+
* `content` | The overlay content
|
|
191
|
+
* `loader` | The loading indicator shown while loading items
|
|
182
192
|
*
|
|
183
|
-
*
|
|
184
|
-
* -----------------|------------------
|
|
185
|
-
* `toggle-button` | The toggle button
|
|
186
|
-
* `overlay` | The overlay container
|
|
187
|
-
* `content` | The overlay content
|
|
188
|
-
* `loader` | The loading indicator shown while loading items
|
|
193
|
+
* The following state attributes are available for styling:
|
|
189
194
|
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* `
|
|
195
|
-
* `
|
|
195
|
+
* Attribute | Description
|
|
196
|
+
* ---------------------|---------------------------------
|
|
197
|
+
* `disabled` | Set when the element is disabled
|
|
198
|
+
* `has-value` | Set when the element has a value
|
|
199
|
+
* `has-label` | Set when the element has a label
|
|
200
|
+
* `has-helper` | Set when the element has helper text or slot
|
|
201
|
+
* `has-error-message` | Set when the element has an error message
|
|
202
|
+
* `has-tooltip` | Set when the element has a slotted tooltip
|
|
203
|
+
* `invalid` | Set when the element is invalid
|
|
204
|
+
* `focused` | Set when the element is focused
|
|
205
|
+
* `focus-ring` | Set when the element is keyboard focused
|
|
206
|
+
* `readonly` | Set when the element is readonly
|
|
207
|
+
* `opened` | Set when the overlay is opened
|
|
208
|
+
* `loading` | Set when loading items from the data provider
|
|
196
209
|
*
|
|
197
210
|
* ### Internal components
|
|
198
211
|
*
|
package/src/vaadin-combo-box.js
CHANGED
|
@@ -107,24 +107,37 @@ import { ComboBoxMixin } from './vaadin-combo-box-mixin.js';
|
|
|
107
107
|
* `--vaadin-combo-box-overlay-width` | Width of the overlay | `auto`
|
|
108
108
|
* `--vaadin-combo-box-overlay-max-height` | Max height of the overlay | `65vh`
|
|
109
109
|
*
|
|
110
|
-
*
|
|
111
|
-
* See [`<vaadin-text-field>`](#/elements/vaadin-text-field) for the styling documentation.
|
|
110
|
+
* The following shadow DOM parts are available for styling:
|
|
112
111
|
*
|
|
113
|
-
*
|
|
112
|
+
* Part name | Description
|
|
113
|
+
* ---------------------|----------------
|
|
114
|
+
* `label` | The label element
|
|
115
|
+
* `input-field` | The element that wraps prefix, value and buttons
|
|
116
|
+
* `clear-button` | The clear button
|
|
117
|
+
* `error-message` | The error message element
|
|
118
|
+
* `helper-text` | The helper text element wrapper
|
|
119
|
+
* `required-indicator` | The `required` state indicator element
|
|
120
|
+
* `toggle-button` | The toggle button
|
|
121
|
+
* `overlay` | The overlay container
|
|
122
|
+
* `content` | The overlay content
|
|
123
|
+
* `loader` | The loading indicator shown while loading items
|
|
114
124
|
*
|
|
115
|
-
*
|
|
116
|
-
* -----------------|------------------
|
|
117
|
-
* `toggle-button` | The toggle button
|
|
118
|
-
* `overlay` | The overlay container
|
|
119
|
-
* `content` | The overlay content
|
|
120
|
-
* `loader` | The loading indicator shown while loading items
|
|
125
|
+
* The following state attributes are available for styling:
|
|
121
126
|
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* `
|
|
127
|
-
* `
|
|
127
|
+
* Attribute | Description
|
|
128
|
+
* ---------------------|---------------------------------
|
|
129
|
+
* `disabled` | Set when the element is disabled
|
|
130
|
+
* `has-value` | Set when the element has a value
|
|
131
|
+
* `has-label` | Set when the element has a label
|
|
132
|
+
* `has-helper` | Set when the element has helper text or slot
|
|
133
|
+
* `has-error-message` | Set when the element has an error message
|
|
134
|
+
* `has-tooltip` | Set when the element has a slotted tooltip
|
|
135
|
+
* `invalid` | Set when the element is invalid
|
|
136
|
+
* `focused` | Set when the element is focused
|
|
137
|
+
* `focus-ring` | Set when the element is keyboard focused
|
|
138
|
+
* `readonly` | Set when the element is readonly
|
|
139
|
+
* `opened` | Set when the overlay is opened
|
|
140
|
+
* `loading` | Set when loading items from the data provider
|
|
128
141
|
*
|
|
129
142
|
* ### Internal components
|
|
130
143
|
*
|
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/combo-box",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha18",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-combo-box",
|
|
11
|
-
"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/25.0.0-
|
|
11
|
+
"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/25.0.0-alpha18/#/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/25.0.0-alpha18/#/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/25.0.0-alpha18/#/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\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and buttons\n`clear-button` | The clear button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`overlay` | The overlay container\n`content` | The overlay content\n`loader` | The loading indicator shown while loading items\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n`loading` | Set when loading items from the data provider\n\n### Internal components\n\nIn addition to `<vaadin-combo-box>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-combo-box-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha18/#/elements/vaadin-item).\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "disabled",
|
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": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha18",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
18
|
"name": "vaadin-combo-box",
|
|
19
|
-
"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/25.0.0-
|
|
19
|
+
"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/25.0.0-alpha18/#/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/25.0.0-alpha18/#/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/25.0.0-alpha18/#/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\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and buttons\n`clear-button` | The clear button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`overlay` | The overlay container\n`content` | The overlay content\n`loader` | The loading indicator shown while loading items\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n`loading` | Set when loading items from the data provider\n\n### Internal components\n\nIn addition to `<vaadin-combo-box>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-combo-box-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha18/#/elements/vaadin-item).\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|