@teamwork/autocomplete-ui-vue
Advanced tools
Comparing version 1.0.0-alpha.3 to 1.0.0-alpha.4
@@ -160,82 +160,92 @@ import Vue from 'vue'; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; | ||
return this.visible | ||
? createElement('div', { | ||
class: { | ||
'tw-autocomplete': true, | ||
'tw-autocomplete--loading': this.loading, | ||
}, | ||
style: { | ||
left: `${this.caretPosition.left}px`, | ||
top: `${this.caretPosition.bottom}px`, | ||
}, | ||
}, [ | ||
createElement('div', { | ||
class: 'tw-autocomplete__header', | ||
}, (_b = (_a = this.$scopedSlots).header) === null || _b === void 0 ? void 0 : _b.call(_a, { | ||
viewName: this.viewName, | ||
})), | ||
this.viewName === "items" /* items */ | ||
if (!this.visible) { | ||
return createElement(); | ||
} | ||
const { matchedText, viewName } = this; | ||
return createElement('div', { | ||
class: { | ||
'tw-autocomplete': true, | ||
'tw-autocomplete--loading': this.loading, | ||
}, | ||
style: { | ||
left: `${this.caretPosition.left}px`, | ||
top: `${this.caretPosition.bottom}px`, | ||
}, | ||
}, [ | ||
createElement('div', { | ||
class: 'tw-autocomplete__header', | ||
}, (_b = (_a = this.$scopedSlots).header) === null || _b === void 0 ? void 0 : _b.call(_a, { | ||
matchedText, | ||
viewName, | ||
})), | ||
viewName === "items" /* items */ | ||
? createElement('div', { | ||
class: 'tw-autocomplete__list', | ||
}, this.items.map((item, index, items) => { | ||
var _a, _b, _c, _d, _e, _f; | ||
return [ | ||
(_b = (_a = this.$scopedSlots).beforeItem) === null || _b === void 0 ? void 0 : _b.call(_a, { | ||
index, | ||
item, | ||
items, | ||
matchedText, | ||
}), | ||
createElement('div', { | ||
attrs: { | ||
title: item.title || '', | ||
}, | ||
class: { | ||
'tw-autocomplete__list-item': true, | ||
'tw-autocomplete__list-item--selected': this.selectedIndex === index, | ||
}, | ||
key: item.id, | ||
on: { | ||
click: (event) => { | ||
event.preventDefault(); | ||
this.autocomplete.selectedIndex = index; | ||
this.autocomplete.accept(); | ||
}, | ||
}, | ||
ref: this.selectedIndex === index | ||
? 'selectedItemElement' | ||
: undefined, | ||
}, ((_d = (_c = this.$scopedSlots).item) === null || _d === void 0 ? void 0 : _d.call(_c, { | ||
index, | ||
item, | ||
items, | ||
matchedText, | ||
})) || item.text), | ||
(_f = (_e = this.$scopedSlots).afterItem) === null || _f === void 0 ? void 0 : _f.call(_e, { | ||
index, | ||
item, | ||
items, | ||
matchedText, | ||
}), | ||
]; | ||
})) | ||
: viewName === "error" /* error */ | ||
? createElement('div', { | ||
class: 'tw-autocomplete__list', | ||
}, this.items.map((item, index, items) => { | ||
var _a, _b, _c, _d, _e, _f; | ||
return [ | ||
(_b = (_a = this.$scopedSlots).beforeItem) === null || _b === void 0 ? void 0 : _b.call(_a, { | ||
index, | ||
item, | ||
items, | ||
}), | ||
createElement('div', { | ||
attrs: { | ||
title: item.title || '', | ||
}, | ||
class: { | ||
'tw-autocomplete__list-item': true, | ||
'tw-autocomplete__list-item--selected': this.selectedIndex === | ||
index, | ||
}, | ||
key: item.id, | ||
on: { | ||
click: (event) => { | ||
event.preventDefault(); | ||
this.autocomplete.selectedIndex = index; | ||
this.autocomplete.accept(); | ||
}, | ||
}, | ||
ref: this.selectedIndex === index | ||
? 'selectedItemElement' | ||
: undefined, | ||
}, ((_d = (_c = this.$scopedSlots).item) === null || _d === void 0 ? void 0 : _d.call(_c, { | ||
index, | ||
item, | ||
items, | ||
matchedText: this.matchedText, | ||
})) || item.text), | ||
(_f = (_e = this.$scopedSlots).afterItem) === null || _f === void 0 ? void 0 : _f.call(_e, { | ||
index, | ||
item, | ||
items, | ||
}), | ||
]; | ||
})) | ||
: this.viewName === "error" /* error */ | ||
class: 'tw-autocomplete__error', | ||
}, ((_d = (_c = this.$scopedSlots).error) === null || _d === void 0 ? void 0 : _d.call(_c, { | ||
error: this.error, | ||
matchedText, | ||
})) || 'Loading failed') | ||
: viewName === "loading" /* loading */ | ||
? createElement('div', { | ||
class: 'tw-autocomplete__error', | ||
}, ((_d = (_c = this.$scopedSlots).error) === null || _d === void 0 ? void 0 : _d.call(_c, { | ||
error: this.error, | ||
})) || 'Loading failed') | ||
: this.viewName === "loading" /* loading */ | ||
? createElement('div', { | ||
class: 'tw-autocomplete__loading', | ||
}, ((_f = (_e = this.$scopedSlots).loading) === null || _f === void 0 ? void 0 : _f.call(_e, {})) || 'Loading') | ||
: createElement('div', { | ||
class: 'tw-autocomplete__blank', | ||
}, ((_h = (_g = this.$scopedSlots).blank) === null || _h === void 0 ? void 0 : _h.call(_g, {})) || 'No content'), | ||
createElement('div', { | ||
class: 'tw-autocomplete__footer', | ||
}, (_k = (_j = this.$scopedSlots).footer) === null || _k === void 0 ? void 0 : _k.call(_j, { | ||
viewName: this.viewName, | ||
})), | ||
]) | ||
: createElement(); | ||
class: 'tw-autocomplete__loading', | ||
}, ((_f = (_e = this.$scopedSlots).loading) === null || _f === void 0 ? void 0 : _f.call(_e, { | ||
matchedText, | ||
})) || 'Loading') | ||
: createElement('div', { | ||
class: 'tw-autocomplete__blank', | ||
}, ((_h = (_g = this.$scopedSlots).blank) === null || _h === void 0 ? void 0 : _h.call(_g, { | ||
matchedText, | ||
})) || 'No content'), | ||
createElement('div', { | ||
class: 'tw-autocomplete__footer', | ||
}, (_k = (_j = this.$scopedSlots).footer) === null || _k === void 0 ? void 0 : _k.call(_j, { | ||
matchedText, | ||
viewName, | ||
})), | ||
]); | ||
}, | ||
@@ -242,0 +252,0 @@ // Can't test this function properly because jsdom does not support layout. |
{ | ||
"name": "@teamwork/autocomplete-ui-vue", | ||
"version": "1.0.0-alpha.3", | ||
"version": "1.0.0-alpha.4", | ||
"description": "The autocomplete UI in Vue.", | ||
@@ -32,3 +32,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "b6a58bdaa67d948998b33972dfa81a3e7409ca5b" | ||
"gitHead": "a982950a7e9aacbd9860bf726ef5906d523a26c3" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
355
15906