fix typing in array-selector

This commit is contained in:
Daniel Freedman
2017-01-12 16:39:34 -08:00
parent bff132234d
commit 77ebe7a112

View File

@@ -74,7 +74,7 @@ is false, `selected` is a property representing the last selected item. When
return class extends superClass {
static get config() {
return {
properties: {
@@ -206,7 +206,7 @@ is false, `selected` is a property representing the last selected item. When
if (idx >= 0) {
this.linkPaths('items.' + idx, 'selected.' + sidx++);
}
});
});
} else {
this._selectedMap.forEach(idx => {
this.linkPaths('selected', 'items.' + idx);
@@ -265,13 +265,13 @@ is false, `selected` is a property representing the last selected item. When
* Deselects the given index if it is already selected.
*
* @method deselect
* @param {number} index Index from `items` array to deselect
* @param {number} idx Index from `items` array to deselect
*/
deselectIndex(idx) {
if (this._selectedMap.delete(this.items[idx])) {
let sidx;
if (this.multi) {
sidx = parseInt(this.__dataLinkedPaths['items.' + idx].slice('selected.'.length));
sidx = parseInt(this.__dataLinkedPaths['items.' + idx].slice('selected.'.length), 10);
}
this._updateLinks();
if (this.multi) {
@@ -298,7 +298,7 @@ is false, `selected` is a property representing the last selected item. When
* deselect the item if already selected.
*
* @method select
* @param {number} index Index from `items` array to select
* @param {number} idx Index from `items` array to select
*/
selectIndex(idx) {
let item = this.items[idx];
@@ -326,7 +326,8 @@ is false, `selected` is a property representing the last selected item. When
Polymer.ArraySelectorMixin = ArraySelectorMixin;
// define element class & export
class ArraySelector extends ArraySelectorMixin(Polymer.Element) { }
const ArraySelectorMixinImpl = ArraySelectorMixin(Polymer.Element);
class ArraySelector extends ArraySelectorMixinImpl { }
customElements.define('array-selector', ArraySelector);
Polymer.ArraySelector = ArraySelector;