@vaadin/combo-box 24.3.0-alpha1 → 24.3.0-alpha3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/combo-box",
3
- "version": "24.3.0-alpha1",
3
+ "version": "24.3.0-alpha3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,21 +38,21 @@
38
38
  "dependencies": {
39
39
  "@open-wc/dedupe-mixin": "^1.3.0",
40
40
  "@polymer/polymer": "^3.0.0",
41
- "@vaadin/a11y-base": "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"
41
+ "@vaadin/a11y-base": "24.3.0-alpha3",
42
+ "@vaadin/component-base": "24.3.0-alpha3",
43
+ "@vaadin/field-base": "24.3.0-alpha3",
44
+ "@vaadin/input-container": "24.3.0-alpha3",
45
+ "@vaadin/item": "24.3.0-alpha3",
46
+ "@vaadin/lit-renderer": "24.3.0-alpha3",
47
+ "@vaadin/overlay": "24.3.0-alpha3",
48
+ "@vaadin/vaadin-lumo-styles": "24.3.0-alpha3",
49
+ "@vaadin/vaadin-material-styles": "24.3.0-alpha3",
50
+ "@vaadin/vaadin-themable-mixin": "24.3.0-alpha3"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@esm-bundle/chai": "^4.3.4",
54
54
  "@vaadin/testing-helpers": "^0.5.0",
55
- "@vaadin/text-field": "24.3.0-alpha1",
55
+ "@vaadin/text-field": "24.3.0-alpha3",
56
56
  "lit": "^2.0.0",
57
57
  "sinon": "^13.0.2"
58
58
  },
@@ -60,5 +60,5 @@
60
60
  "web-types.json",
61
61
  "web-types.lit.json"
62
62
  ],
63
- "gitHead": "9ca6f3ca220a777e8eea181a1f5717e39a732240"
63
+ "gitHead": "9162ca5fb9879dbcc8c68a77c1acb3af2c497a15"
64
64
  }
@@ -63,6 +63,21 @@ export const ComboBoxItemMixin = (superClass) =>
63
63
  return ['__rendererOrItemChanged(renderer, index, item.*, selected, focused)', '__updateLabel(label, renderer)'];
64
64
  }
65
65
 
66
+ static get observedAttributes() {
67
+ return [...super.observedAttributes, 'hidden'];
68
+ }
69
+
70
+ attributeChangedCallback(name, oldValue, newValue) {
71
+ if (name === 'hidden' && newValue !== null) {
72
+ // The element is being hidden (by virtualizer). Mark one of the __rendererOrItemChanged
73
+ // dependencies as undefined to make sure it's called when the element is shown again
74
+ // and assigned properties with possibly identical values as before hiding.
75
+ this.index = undefined;
76
+ } else {
77
+ super.attributeChangedCallback(name, oldValue, newValue);
78
+ }
79
+ }
80
+
66
81
  /** @protected */
67
82
  connectedCallback() {
68
83
  super.connectedCallback();
@@ -41,11 +41,6 @@ export type ComboBoxLightOpenedChangedEvent = CustomEvent<{ value: boolean }>;
41
41
  */
42
42
  export type ComboBoxLightInvalidChangedEvent = CustomEvent<{ value: boolean }>;
43
43
 
44
- /**
45
- * Fired when the `dirty` property changes.
46
- */
47
- export type ComboBoxLightDirtyChangedEvent = CustomEvent<{ value: boolean }>;
48
-
49
44
  /**
50
45
  * Fired when the `value` property changes.
51
46
  */
@@ -77,8 +72,6 @@ export interface ComboBoxLightEventMap<TItem> extends HTMLElementEventMap {
77
72
 
78
73
  'invalid-changed': ComboBoxLightInvalidChangedEvent;
79
74
 
80
- 'dirty-changed': ComboBoxLightDirtyChangedEvent;
81
-
82
75
  'value-changed': ComboBoxLightValueChangedEvent;
83
76
 
84
77
  'selected-item-changed': ComboBoxLightSelectedItemChangedEvent<TItem>;
@@ -129,7 +122,6 @@ export interface ComboBoxLightEventMap<TItem> extends HTMLElementEventMap {
129
122
  * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
130
123
  * @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
131
124
  * @fires {CustomEvent} selected-item-changed - Fired when the `selectedItem` property changes.
132
- * @fires {CustomEvent} dirty-changed - Fired when the `dirty` property changes.
133
125
  * @fires {CustomEvent} value-changed - Fired when the `value` property changes.
134
126
  * @fires {CustomEvent} validated - Fired whenever the field is validated.
135
127
  */
@@ -1087,18 +1087,13 @@ export const ComboBoxMixin = (subclass) =>
1087
1087
 
1088
1088
  /** @private */
1089
1089
  _detectAndDispatchChange() {
1090
- const isValueChanged = this.value !== this._lastCommittedValue;
1091
- if (isValueChanged) {
1092
- this.dirty = true;
1093
- }
1094
-
1095
1090
  // Do not validate when focusout is caused by document
1096
1091
  // losing focus, which happens on browser tab switch.
1097
1092
  if (document.hasFocus()) {
1098
1093
  this.validate();
1099
1094
  }
1100
1095
 
1101
- if (isValueChanged) {
1096
+ if (this.value !== this._lastCommittedValue) {
1102
1097
  this.dispatchEvent(new CustomEvent('change', { bubbles: true }));
1103
1098
  this._lastCommittedValue = this.value;
1104
1099
  }
@@ -53,11 +53,6 @@ export type ComboBoxOpenedChangedEvent = CustomEvent<{ value: boolean }>;
53
53
  */
54
54
  export type ComboBoxInvalidChangedEvent = CustomEvent<{ value: boolean }>;
55
55
 
56
- /**
57
- * Fired when the `dirty` property changes.
58
- */
59
- export type ComboBoxDirtyChangedEvent = CustomEvent<{ value: boolean }>;
60
-
61
56
  /**
62
57
  * Fired when the `value` property changes.
63
58
  */
@@ -89,8 +84,6 @@ export interface ComboBoxEventMap<TItem> extends HTMLElementEventMap {
89
84
 
90
85
  'invalid-changed': ComboBoxInvalidChangedEvent;
91
86
 
92
- 'dirty-changed': ComboBoxDirtyChangedEvent;
93
-
94
87
  'value-changed': ComboBoxValueChangedEvent;
95
88
 
96
89
  'selected-item-changed': ComboBoxSelectedItemChangedEvent<TItem>;
@@ -219,7 +212,6 @@ export interface ComboBoxEventMap<TItem> extends HTMLElementEventMap {
219
212
  * @fires {CustomEvent} filter-changed - Fired when the `filter` property changes.
220
213
  * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
221
214
  * @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
222
- * @fires {CustomEvent} dirty-changed - Fired when the `dirty` property changes.
223
215
  * @fires {CustomEvent} selected-item-changed - Fired when the `selectedItem` property changes.
224
216
  * @fires {CustomEvent} value-changed - Fired when the `value` property changes.
225
217
  * @fires {CustomEvent} validated - Fired whenever the field is validated.
@@ -1,3 +1,4 @@
1
+ import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
1
2
  import '@vaadin/vaadin-lumo-styles/font-icons.js';
2
3
  import { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';
3
4
  import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
@@ -1,4 +1,3 @@
1
- import '@vaadin/input-container/theme/lumo/vaadin-input-container.js';
2
1
  import './vaadin-combo-box-item-styles.js';
3
2
  import './vaadin-combo-box-overlay-styles.js';
4
3
  import './vaadin-combo-box-styles.js';
@@ -1,3 +1,4 @@
1
+ import '@vaadin/input-container/theme/material/vaadin-input-container-styles.js';
1
2
  import '@vaadin/vaadin-material-styles/color.js';
2
3
  import '@vaadin/vaadin-material-styles/font-icons.js';
3
4
  import { inputFieldShared } from '@vaadin/vaadin-material-styles/mixins/input-field-shared.js';
@@ -1,4 +1,3 @@
1
- import '@vaadin/input-container/theme/material/vaadin-input-container.js';
2
1
  import './vaadin-combo-box-item-styles.js';
3
2
  import './vaadin-combo-box-overlay-styles.js';
4
3
  import './vaadin-combo-box-styles.js';
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.3.0-alpha1",
4
+ "version": "24.3.0-alpha3",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -73,17 +73,6 @@
73
73
  ]
74
74
  }
75
75
  },
76
- {
77
- "name": "dirty",
78
- "description": "Whether the field is dirty.\n\nThe field is automatically marked as dirty once the user triggers\nan `input` or `change` event. Additionally, the field can be manually\nmarked as dirty by setting the property to `true`.",
79
- "value": {
80
- "type": [
81
- "boolean",
82
- "null",
83
- "undefined"
84
- ]
85
- }
86
- },
87
76
  {
88
77
  "name": "overlay-class",
89
78
  "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
@@ -276,17 +265,6 @@
276
265
  ]
277
266
  }
278
267
  },
279
- {
280
- "name": "dirty",
281
- "description": "Whether the field is dirty.\n\nThe field is automatically marked as dirty once the user triggers\nan `input` or `change` event. Additionally, the field can be manually\nmarked as dirty by setting the property to `true`.",
282
- "value": {
283
- "type": [
284
- "boolean",
285
- "null",
286
- "undefined"
287
- ]
288
- }
289
- },
290
268
  {
291
269
  "name": "overlayClass",
292
270
  "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
@@ -469,10 +447,6 @@
469
447
  "name": "invalid-changed",
470
448
  "description": "Fired when the `invalid` property changes."
471
449
  },
472
- {
473
- "name": "dirty-changed",
474
- "description": "Fired when the `dirty` property changes."
475
- },
476
450
  {
477
451
  "name": "opened-changed",
478
452
  "description": "Fired when the `opened` property changes."
@@ -486,7 +460,7 @@
486
460
  },
487
461
  {
488
462
  "name": "vaadin-combo-box",
489
- "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.3.0-alpha1/#/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.3.0-alpha1/#/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.3.0-alpha1/#/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.3.0-alpha1/#/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.3.0-alpha1/#/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.3.0-alpha1/#/elements/vaadin-overlay).\n- `<vaadin-combo-box-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha1/#/elements/vaadin-item).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha1/#/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.",
463
+ "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.3.0-alpha3/#/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.3.0-alpha3/#/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.3.0-alpha3/#/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.3.0-alpha3/#/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.3.0-alpha3/#/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.3.0-alpha3/#/elements/vaadin-overlay).\n- `<vaadin-combo-box-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha3/#/elements/vaadin-item).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha3/#/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.",
490
464
  "attributes": [
491
465
  {
492
466
  "name": "disabled",
@@ -598,17 +572,6 @@
598
572
  ]
599
573
  }
600
574
  },
601
- {
602
- "name": "dirty",
603
- "description": "Whether the field is dirty.\n\nThe field is automatically marked as dirty once the user triggers\nan `input` or `change` event. Additionally, the field can be manually\nmarked as dirty by setting the property to `true`.",
604
- "value": {
605
- "type": [
606
- "boolean",
607
- "null",
608
- "undefined"
609
- ]
610
- }
611
- },
612
575
  {
613
576
  "name": "clear-button-visible",
614
577
  "description": "Set to true to display the clear icon which clears the input.\n\nIt is up to the component to choose where to place the clear icon:\nin the Shadow DOM or in the light DOM. In any way, a reference to\nthe clear icon element should be provided via the `clearElement` getter.",
@@ -925,17 +888,6 @@
925
888
  ]
926
889
  }
927
890
  },
928
- {
929
- "name": "dirty",
930
- "description": "Whether the field is dirty.\n\nThe field is automatically marked as dirty once the user triggers\nan `input` or `change` event. Additionally, the field can be manually\nmarked as dirty by setting the property to `true`.",
931
- "value": {
932
- "type": [
933
- "boolean",
934
- "null",
935
- "undefined"
936
- ]
937
- }
938
- },
939
891
  {
940
892
  "name": "clearButtonVisible",
941
893
  "description": "Set to true to display the clear icon which clears the input.\n\nIt is up to the component to choose where to place the clear icon:\nin the Shadow DOM or in the light DOM. In any way, a reference to\nthe clear icon element should be provided via the `clearElement` getter.",
@@ -1219,10 +1171,6 @@
1219
1171
  "name": "invalid-changed",
1220
1172
  "description": "Fired when the `invalid` property changes."
1221
1173
  },
1222
- {
1223
- "name": "dirty-changed",
1224
- "description": "Fired when the `dirty` property changes."
1225
- },
1226
1174
  {
1227
1175
  "name": "opened-changed",
1228
1176
  "description": "Fired when the `opened` property changes."
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/combo-box",
4
- "version": "24.3.0-alpha1",
4
+ "version": "24.3.0-alpha3",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -40,13 +40,6 @@
40
40
  "kind": "expression"
41
41
  }
42
42
  },
43
- {
44
- "name": "?dirty",
45
- "description": "Whether the field is dirty.\n\nThe field is automatically marked as dirty once the user triggers\nan `input` or `change` event. Additionally, the field can be manually\nmarked as dirty by setting the property to `true`.",
46
- "value": {
47
- "kind": "expression"
48
- }
49
- },
50
43
  {
51
44
  "name": "?opened",
52
45
  "description": "True if the dropdown is open, false otherwise.",
@@ -236,13 +229,6 @@
236
229
  "kind": "expression"
237
230
  }
238
231
  },
239
- {
240
- "name": "@dirty-changed",
241
- "description": "Fired when the `dirty` property changes.",
242
- "value": {
243
- "kind": "expression"
244
- }
245
- },
246
232
  {
247
233
  "name": "@opened-changed",
248
234
  "description": "Fired when the `opened` property changes.",
@@ -261,7 +247,7 @@
261
247
  },
262
248
  {
263
249
  "name": "vaadin-combo-box",
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.3.0-alpha1/#/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.3.0-alpha1/#/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.3.0-alpha1/#/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.3.0-alpha1/#/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.3.0-alpha1/#/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.3.0-alpha1/#/elements/vaadin-overlay).\n- `<vaadin-combo-box-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha1/#/elements/vaadin-item).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha1/#/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.",
250
+ "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.3.0-alpha3/#/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.3.0-alpha3/#/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.3.0-alpha3/#/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.3.0-alpha3/#/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.3.0-alpha3/#/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.3.0-alpha3/#/elements/vaadin-overlay).\n- `<vaadin-combo-box-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha3/#/elements/vaadin-item).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha3/#/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.",
265
251
  "extension": true,
266
252
  "attributes": [
267
253
  {
@@ -292,13 +278,6 @@
292
278
  "kind": "expression"
293
279
  }
294
280
  },
295
- {
296
- "name": "?dirty",
297
- "description": "Whether the field is dirty.\n\nThe field is automatically marked as dirty once the user triggers\nan `input` or `change` event. Additionally, the field can be manually\nmarked as dirty by setting the property to `true`.",
298
- "value": {
299
- "kind": "expression"
300
- }
301
- },
302
281
  {
303
282
  "name": "?clearButtonVisible",
304
283
  "description": "Set to true to display the clear icon which clears the input.\n\nIt is up to the component to choose where to place the clear icon:\nin the Shadow DOM or in the light DOM. In any way, a reference to\nthe clear icon element should be provided via the `clearElement` getter.",
@@ -572,13 +551,6 @@
572
551
  "kind": "expression"
573
552
  }
574
553
  },
575
- {
576
- "name": "@dirty-changed",
577
- "description": "Fired when the `dirty` property changes.",
578
- "value": {
579
- "kind": "expression"
580
- }
581
- },
582
554
  {
583
555
  "name": "@opened-changed",
584
556
  "description": "Fired when the `opened` property changes.",