@vaadin/multi-select-combo-box
Advanced tools
Comparing version 24.4.0-dev.b3e1d14600 to 24.4.0-rc1
{ | ||
"name": "@vaadin/multi-select-combo-box", | ||
"version": "24.4.0-dev.b3e1d14600", | ||
"version": "24.4.0-rc1", | ||
"publishConfig": { | ||
@@ -41,13 +41,13 @@ "access": "public" | ||
"@polymer/polymer": "^3.0.0", | ||
"@vaadin/a11y-base": "24.4.0-dev.b3e1d14600", | ||
"@vaadin/combo-box": "24.4.0-dev.b3e1d14600", | ||
"@vaadin/component-base": "24.4.0-dev.b3e1d14600", | ||
"@vaadin/field-base": "24.4.0-dev.b3e1d14600", | ||
"@vaadin/input-container": "24.4.0-dev.b3e1d14600", | ||
"@vaadin/item": "24.4.0-dev.b3e1d14600", | ||
"@vaadin/lit-renderer": "24.4.0-dev.b3e1d14600", | ||
"@vaadin/overlay": "24.4.0-dev.b3e1d14600", | ||
"@vaadin/vaadin-lumo-styles": "24.4.0-dev.b3e1d14600", | ||
"@vaadin/vaadin-material-styles": "24.4.0-dev.b3e1d14600", | ||
"@vaadin/vaadin-themable-mixin": "24.4.0-dev.b3e1d14600" | ||
"@vaadin/a11y-base": "24.4.0-rc1", | ||
"@vaadin/combo-box": "24.4.0-rc1", | ||
"@vaadin/component-base": "24.4.0-rc1", | ||
"@vaadin/field-base": "24.4.0-rc1", | ||
"@vaadin/input-container": "24.4.0-rc1", | ||
"@vaadin/item": "24.4.0-rc1", | ||
"@vaadin/lit-renderer": "24.4.0-rc1", | ||
"@vaadin/overlay": "24.4.0-rc1", | ||
"@vaadin/vaadin-lumo-styles": "24.4.0-rc1", | ||
"@vaadin/vaadin-material-styles": "24.4.0-rc1", | ||
"@vaadin/vaadin-themable-mixin": "24.4.0-rc1" | ||
}, | ||
@@ -64,3 +64,3 @@ "devDependencies": { | ||
], | ||
"gitHead": "502d4f5b03f770a83d270d98078cde230254dd0e" | ||
"gitHead": "a81e3b927d44c56613fa4e1307494a2acc81005f" | ||
} |
/** | ||
* @license | ||
* Copyright (c) 2017 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2017 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* @license | ||
* Copyright (c) 2017 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2017 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* @license | ||
* Copyright (c) 2021 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* @license | ||
* Copyright (c) 2021 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* @license | ||
* Copyright (c) 2021 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -64,2 +64,10 @@ */ | ||
/** | ||
* When true, filter string isn't cleared after selecting an item. | ||
*/ | ||
keepFilter: { | ||
type: Boolean, | ||
value: false, | ||
}, | ||
/** | ||
* When set to `true`, "loading" attribute is set | ||
@@ -240,3 +248,3 @@ * on the host and the overlay element. | ||
this.close(); | ||
} else { | ||
} else if (this._hasValidInputValue()) { | ||
// Keep selected item focused after committing on Enter. | ||
@@ -274,5 +282,29 @@ const focusedItem = this._dropdownItems[this._focusedIndex]; | ||
/** | ||
* Override from combo-box to ignore requests to clear the filter if the | ||
* keepFilter option is enabled. Exceptions are when the dropdown is closed, | ||
* so the filter is still cleared on cancel and focus out. | ||
* @protected | ||
* @override | ||
*/ | ||
_clearFilter() { | ||
if (!this.keepFilter || !this.opened) { | ||
super._clearFilter(); | ||
} | ||
} | ||
/** | ||
* Override method from combo-box to always clear the filter when reverting | ||
* the input value, regardless of the keepFilter option. | ||
* @override | ||
* @protected | ||
*/ | ||
_revertInputValueToValue() { | ||
super._revertInputValueToValue(); | ||
this.filter = ''; | ||
} | ||
/** | ||
* @protected | ||
* @override | ||
*/ | ||
_commitValue() { | ||
@@ -387,4 +419,2 @@ // Store filter value for checking if user input is matching | ||
* | ||
* @param {number} | ||
* @return {boolean} | ||
* @protected | ||
@@ -391,0 +421,0 @@ * @override |
/** | ||
* @license | ||
* Copyright (c) 2018 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2018 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* @license | ||
* Copyright (c) 2021 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* @license | ||
* Copyright (c) 2021 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* @license | ||
* Copyright (c) 2021 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* @license | ||
* Copyright (c) 2021 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* @license | ||
* Copyright (c) 2021 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* @license | ||
* Copyright (c) 2021 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -278,2 +278,8 @@ */ | ||
/** | ||
* When true, filter string isn't cleared after selecting an item. | ||
* @attr {boolean} keep-filter | ||
*/ | ||
keepFilter: boolean; | ||
/** | ||
* True when loading items from the data provider, false otherwise. | ||
@@ -280,0 +286,0 @@ */ |
/** | ||
* @license | ||
* Copyright (c) 2021 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -186,2 +186,3 @@ */ | ||
renderer="[[renderer]]" | ||
keep-filter="[[keepFilter]]" | ||
theme$="[[_theme]]" | ||
@@ -347,2 +348,10 @@ on-combo-box-item-selected="_onComboBoxItemSelected" | ||
/** | ||
* When true, filter string isn't cleared after selecting an item. | ||
*/ | ||
keepFilter: { | ||
type: Boolean, | ||
value: false, | ||
}, | ||
/** | ||
* True when loading items from the data provider, false otherwise. | ||
@@ -829,6 +838,23 @@ */ | ||
/** @private */ | ||
__clearFilter() { | ||
this.filter = ''; | ||
this.$.comboBox.clear(); | ||
/** | ||
* Clear the internal combo box value and filter. Filter will not be cleared | ||
* when the `keepFilter` option is enabled. Using `force` can enforce clearing | ||
* the filter. | ||
* @param {boolean} force overrides the keepFilter option | ||
* @private | ||
*/ | ||
__clearInternalValue(force = false) { | ||
if (!this.keepFilter || force) { | ||
// Clear both combo box value and filter. | ||
this.filter = ''; | ||
this.$.comboBox.clear(); | ||
} else { | ||
// Only clear combo box value. This effectively resets _lastCommittedValue | ||
// which allows toggling the same item multiple times via keyboard. | ||
this.$.comboBox.clear(); | ||
// Restore input to the filter value. Needed when items are | ||
// navigated with keyboard, which overrides the input value | ||
// with the item label. | ||
this._inputElementValue = this.filter; | ||
} | ||
} | ||
@@ -865,3 +891,3 @@ | ||
if (lastFilter && lastFilter.toLowerCase() === itemLabel.toLowerCase()) { | ||
this.__clearFilter(); | ||
this.__clearInternalValue(); | ||
return; | ||
@@ -879,3 +905,3 @@ } | ||
// Suppress `value-changed` event. | ||
this.__clearFilter(); | ||
this.__clearInternalValue(); | ||
@@ -1049,2 +1075,5 @@ this.__announceItem(itemLabel, isSelected, itemsCopy.length); | ||
event.preventDefault(); | ||
// Prevent default combo box behavior which can otherwise unnecessarily | ||
// clear the input and filter | ||
event.stopPropagation(); | ||
@@ -1241,3 +1270,3 @@ this.clear(); | ||
this.__clearFilter(); | ||
this.__clearInternalValue(true); | ||
@@ -1264,2 +1293,8 @@ this.dispatchEvent( | ||
} | ||
/** | ||
* Fired when the user sets a custom value. | ||
* @event custom-value-set | ||
* @param {string} detail the custom value | ||
*/ | ||
} | ||
@@ -1266,0 +1301,0 @@ |
/** | ||
* @license | ||
* Copyright (c) 2021 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* @license | ||
* Copyright (c) 2021 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* @license | ||
* Copyright (c) 2021 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* @license | ||
* Copyright (c) 2021 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* @license | ||
* Copyright (c) 2021 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -5,0 +5,0 @@ */ |
/** | ||
* @license | ||
* Copyright (c) 2021 - 2023 Vaadin Ltd. | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
@@ -5,0 +5,0 @@ */ |
157990
34
4036
+ Added@vaadin/a11y-base@24.4.0-rc1(transitive)
+ Added@vaadin/combo-box@24.4.0-rc1(transitive)
+ Added@vaadin/component-base@24.4.0-rc1(transitive)
+ Added@vaadin/field-base@24.4.0-rc1(transitive)
+ Added@vaadin/icon@24.4.0-rc1(transitive)
+ Added@vaadin/input-container@24.4.0-rc1(transitive)
+ Added@vaadin/item@24.4.0-rc1(transitive)
+ Added@vaadin/lit-renderer@24.4.0-rc1(transitive)
+ Added@vaadin/overlay@24.4.0-rc1(transitive)
+ Added@vaadin/vaadin-lumo-styles@24.4.0-rc1(transitive)
+ Added@vaadin/vaadin-material-styles@24.4.0-rc1(transitive)
+ Added@vaadin/vaadin-themable-mixin@24.4.0-rc1(transitive)
- Removed@vaadin/a11y-base@24.4.0-dev.b3e1d14600(transitive)
- Removed@vaadin/combo-box@24.4.0-dev.b3e1d14600(transitive)
- Removed@vaadin/component-base@24.4.0-dev.b3e1d14600(transitive)
- Removed@vaadin/field-base@24.4.0-dev.b3e1d14600(transitive)
- Removed@vaadin/icon@24.4.0-dev.b3e1d14600(transitive)
- Removed@vaadin/input-container@24.4.0-dev.b3e1d14600(transitive)
- Removed@vaadin/item@24.4.0-dev.b3e1d14600(transitive)
- Removed@vaadin/lit-renderer@24.4.0-dev.b3e1d14600(transitive)
- Removed@vaadin/overlay@24.4.0-dev.b3e1d14600(transitive)
- Removed@vaadin/vaadin-lumo-styles@24.4.0-dev.b3e1d14600(transitive)
- Removed@vaadin/vaadin-material-styles@24.4.0-dev.b3e1d14600(transitive)
- Removed@vaadin/vaadin-themable-mixin@24.4.0-dev.b3e1d14600(transitive)
Updated@vaadin/a11y-base@24.4.0-rc1
Updated@vaadin/combo-box@24.4.0-rc1
Updated@vaadin/item@24.4.0-rc1
Updated@vaadin/overlay@24.4.0-rc1