multiselect-combo-box
Advanced tools
Comparing version
@@ -15,3 +15,3 @@ { | ||
"name": "multiselect-combo-box", | ||
"version": "2.0.2", | ||
"version": "2.0.3-alpha", | ||
"main": "multiselect-combo-box.js", | ||
@@ -18,0 +18,0 @@ "directories": { |
@@ -13,3 +13,3 @@ [](https://www.webcomponents.org/element/gatanaso/multiselect-combo-box) | ||
#### [Live Demo ↗](https://multiselect-combo-box.firebaseapp.com/demo/) | [Material Theme Live Demo ↗](https://multiselect-combo-box.firebaseapp.com/demo/material) | ||
#### [Live Demo ↗](https://multiselect-combo-box.web.app/demo/) | [Material Theme Live Demo ↗](https://multiselect-combo-box.web.app/demo/material) | ||
@@ -61,6 +61,6 @@ ## Getting started | ||
* `master` the Polymer 2.x. version of the `multiselect-combo-box` | ||
* `polymer-3` the Polymer 3 version of the `multiselect-combo-box` | ||
* `master` the latest (Polymer 3) version of the `multiselect-combo-box` | ||
* `polymer-2` the Polymer 2.x version of the `multiselect-combo-box` | ||
## Java API | ||
The Vaadin Flow Java compatible version of this component is available on the [Vaadin Directory](https://vaadin.com/directory/component/multiselect-combo-box) and [GitHub](https://github.com/gatanaso/multiselect-combo-box-flow). |
@@ -92,3 +92,2 @@ import {PolymerElement} from '@polymer/polymer/polymer-element.js'; | ||
hidden\$="[[readonly]]" | ||
items="[[items]]" | ||
item-id-path="[[itemIdPath]]" | ||
@@ -98,3 +97,4 @@ item-label-path="[[itemLabelPath]]" | ||
on-change="_comboBoxValueChanged" | ||
disabled="[[disabled]]"> | ||
disabled="[[disabled]]" | ||
pageSize="[[pageSize]]"> | ||
@@ -187,2 +187,11 @@ <multiselect-combo-box-input | ||
/** | ||
* Number of items fetched at a time from the dataprovider. This property is delegated to the underlying `vaadin-combo-box`. | ||
*/ | ||
pageSize: { | ||
type: Number, | ||
value: 50, | ||
observer: '_pageSizeObserver' | ||
}, | ||
/** | ||
* The `readonly` attribute. | ||
@@ -223,3 +232,6 @@ */ | ||
static get observers() { | ||
return ['_selectedItemsObserver(selectedItems, selectedItems.*)']; | ||
return [ | ||
'_selectedItemsObserver(selectedItems, selectedItems.*)', | ||
'_itemsObserver(items, items.*)' | ||
]; | ||
} | ||
@@ -250,2 +262,10 @@ | ||
_itemsObserver(items) { | ||
this.$.comboBox.items = items; | ||
} | ||
_dispatchChangeEvent() { | ||
this.dispatchEvent(new CustomEvent('change', {bubbles: true})); | ||
} | ||
_comboBoxValueChanged() { | ||
@@ -267,3 +287,5 @@ const item = this.$.comboBox.selectedItem; | ||
this.$.comboBox.value = ''; | ||
this.validate(); | ||
if (this.validate()) { | ||
this._dispatchChangeEvent(); | ||
} | ||
} | ||
@@ -293,3 +315,5 @@ | ||
this.selectedItems = update; | ||
this.validate(); | ||
if (this.validate()) { | ||
this._dispatchChangeEvent(); | ||
} | ||
} | ||
@@ -299,3 +323,5 @@ | ||
this.set('selectedItems', []); | ||
this.validate(); | ||
if (this.validate()) { | ||
this._dispatchChangeEvent(); | ||
} | ||
} | ||
@@ -378,2 +404,10 @@ | ||
} | ||
_pageSizeObserver(pageSize, oldPageSize) { | ||
if (Math.floor(pageSize) !== pageSize || pageSize <= 0) { | ||
this.pageSize = oldPageSize; | ||
throw new Error('`pageSize` value must be an integer > 0'); | ||
} | ||
this.$.comboBox.pageSize = pageSize; | ||
} | ||
} | ||
@@ -380,0 +414,0 @@ |
@@ -60,2 +60,3 @@ import '@vaadin/vaadin-lumo-styles/typography.js'; | ||
box-sizing: border-box; | ||
min-width: 0; | ||
} | ||
@@ -73,2 +74,3 @@ | ||
font-weight: 500; | ||
overflow: hidden; | ||
} | ||
@@ -75,0 +77,0 @@ |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
52949
1.91%1060
3.11%1
Infinity%2
100%