multiselect-combo-box
Advanced tools
Comparing version
@@ -15,3 +15,3 @@ { | ||
"name": "multiselect-combo-box", | ||
"version": "2.4.2", | ||
"version": "2.5.0-alpha", | ||
"main": "multiselect-combo-box.js", | ||
@@ -18,0 +18,0 @@ "directories": { |
@@ -1,2 +0,2 @@ | ||
[](https://www.webcomponents.org/element/gatanaso/multiselect-combo-box) | ||
[](https://www.webcomponents.org/element/multiselect-combo-box) | ||
[](https://vaadin.com/directory/component/gatanasomultiselect-combo-box) | ||
@@ -32,3 +32,3 @@ [](https://travis-ci.org/gatanaso/multiselect-combo-box) | ||
``` | ||
bower install --save gatanaso/multiselect-combo-box | ||
bower install --save gatanaso/multiselect-combo-box#1.1.0 | ||
``` | ||
@@ -35,0 +35,0 @@ Once installed, import in your applicaiton: |
@@ -33,3 +33,3 @@ import {PolymerElement} from '@polymer/polymer/polymer-element.js'; | ||
<div part="token-label">[[_getItemDisplayValue(item, itemLabelPath)]]</div> | ||
<div part="token-remove-button" title="remove" role="button" on-click="_removeToken"></div> | ||
<div part="token-remove-button" role="button" on-click="_removeToken"></div> | ||
</div> | ||
@@ -36,0 +36,0 @@ </template> |
@@ -50,2 +50,10 @@ /** | ||
/** | ||
* Custom function for rendering the display value when in compact mode. | ||
* | ||
* This function receives the array of selected items and should return | ||
* a string value that will be used as the display value. | ||
*/ | ||
compactModeValueRenderer: Function, | ||
/** | ||
* The item property to be used as the `label` in combo-box. | ||
@@ -106,5 +114,9 @@ */ | ||
_getCompactModeDisplayValue(items) { | ||
const suffix = (items.length === 0 || items.length > 1) ? 'values' : 'value'; | ||
return `${items.length} ${suffix}`; | ||
if (this.compactModeValueRenderer && typeof this.compactModeValueRenderer === 'function') { | ||
return this.compactModeValueRenderer(items); | ||
} else { | ||
const suffix = (items.length === 0 || items.length > 1) ? 'values' : 'value'; | ||
return `${items.length} ${suffix}`; | ||
} | ||
} | ||
}; |
@@ -112,2 +112,3 @@ import {PolymerElement} from '@polymer/polymer/polymer-element.js'; | ||
compact-mode="[[compactMode]]" | ||
compact-mode-value-renderer="[[compactModeValueRenderer]]" | ||
on-item-removed="_handleItemRemoved" | ||
@@ -313,3 +314,3 @@ on-remove-all-items="_handleRemoveAllItems" | ||
this._setTitle(this._getDisplayValue(selectedItems, this.itemLabelPath, ', ')); | ||
this.compactMode ? this._setTitle(this._getDisplayValue(selectedItems, this.itemLabelPath, ', ')) : this._setTitle(''); | ||
@@ -316,0 +317,0 @@ // manually force a render |
@@ -37,3 +37,4 @@ import '@vaadin/vaadin-lumo-styles/typography.js'; | ||
margin: var(--lumo-space-s); | ||
color: var(--lumo-contrast-70pct); | ||
color: var(--lumo-body-text-color); | ||
font-weight: 500; | ||
cursor: default; | ||
@@ -40,0 +41,0 @@ } |
@@ -79,2 +79,4 @@ import '@vaadin/vaadin-material-styles/typography.js'; | ||
margin: var(--material-space-s); | ||
color: var(--material-body-text-color); | ||
font-size: var(--material-body-font-size); | ||
cursor: default; | ||
@@ -81,0 +83,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
55402
1.27%1112
1.37%1
Infinity%2
100%