-
+
@@ -68,6 +73,16 @@ export default {
return this.selectedIndex * this.itemHeight >= this.$el.scrollTop
&& (this.selectedIndex + 1) * this.itemHeight <= this.$el.scrollTop + this.$el.clientHeight
},
+ itemGroups() {
+ const groups = {}
+ this.items.forEach((item) => {
+ if (!groups[item.suggestGroup]) {
+ groups[item.suggestGroup] = []
+ }
+ groups[item.suggestGroup].push(item)
+ })
+ return groups
+ },
},
watch: {
items() {
@@ -128,11 +143,26 @@ export default {
min-width: 200px;
max-width: 400px;
+ width: 80vw;
padding: 4px;
// Show maximum 5 entries and a half to show scroll
max-height: 35.5px * 5 + 18px;
margin: 5px 0;
+ &__group {
+ font-weight: bold;
+ color: var(--color-primary-element);
+ font-size: var(--default-font-size);
+ line-height: 44px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ opacity: .7;
+ box-shadow: none !important;
+ flex-shrink: 0;
+ padding-left: 8px;
+ }
+
&__item {
border-radius: 8px;
padding: 4px 8px;