2019-09-27 16:02:48 +00:00
|
|
|
<template>
|
|
|
|
<div class="sidebar-simplesearch">
|
2019-10-03 16:54:05 +00:00
|
|
|
<!-- <form method="GET" action="//repository.geologie.ac.at/search" accept-charset="UTF-8"> -->
|
2019-10-30 10:25:56 +00:00
|
|
|
<!-- v-on:keyup.enter="search()" -->
|
|
|
|
<div class="autocomplete__box">
|
2019-09-27 16:02:48 +00:00
|
|
|
<input
|
2019-10-30 10:25:56 +00:00
|
|
|
class="search-input"
|
2019-09-27 16:02:48 +00:00
|
|
|
name="q"
|
|
|
|
type="text"
|
2019-10-30 10:25:56 +00:00
|
|
|
v-model="display"
|
|
|
|
@input="searchChanged"
|
|
|
|
v-bind:title="title"
|
|
|
|
v-bind:placeholder="placeholder"
|
|
|
|
v-on:keydown.down="onArrowDown" v-on:keydown.up="onArrowUp" v-on:keydown.enter="onEnter" @keydown.tab="close"
|
|
|
|
v-on:focus="focus"
|
2019-09-27 16:02:48 +00:00
|
|
|
/>
|
|
|
|
|
|
|
|
<!-- <button @click="search()" class="css-1gklxk5 ekqohx90"> -->
|
|
|
|
<button class="css-1gklxk5 ekqohx90">
|
|
|
|
<svg
|
|
|
|
alt="Search"
|
2019-10-03 16:54:05 +00:00
|
|
|
@click="search()"
|
2019-09-27 16:02:48 +00:00
|
|
|
class="search-icon"
|
|
|
|
height="14"
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
viewBox="0 0 15 15"
|
|
|
|
>
|
|
|
|
<title>Search</title>
|
|
|
|
<path
|
|
|
|
d=" M6.02945,10.20327a4.17382,4.17382,0,1,1,4.17382-4.17382A4.15609,4.15609, 0,0,1,6.02945,10.20327Zm9.69195,4.2199L10.8989,9.59979A5.88021,5.88021, 0,0,0,12.058,6.02856,6.00467,6.00467,0,1,0,9.59979,10.8989l4.82338, 4.82338a.89729.89729,0,0,0,1.29912,0,.89749.89749,0,0,0-.00087-1.29909Z "
|
|
|
|
/>
|
|
|
|
</svg>
|
|
|
|
</button>
|
2019-10-30 10:25:56 +00:00
|
|
|
|
|
|
|
<!-- clearButtonIcon -->
|
|
|
|
<!-- <span v-show="!isLoading" class="autocomplete__icon autocomplete--clear" @click="clear">
|
|
|
|
<img src="../assets/close.svg">
|
|
|
|
</span> -->
|
|
|
|
|
|
|
|
<ul class="autocomplete-results pure-u-23-24" v-show="showResults">
|
|
|
|
<li class="loading" v-if="isLoading">Loading results...</li>
|
|
|
|
|
|
|
|
<li
|
|
|
|
v-else
|
|
|
|
v-for="(result, key) in suggestions"
|
|
|
|
:key="key"
|
|
|
|
class="autocomplete-result-item"
|
|
|
|
:class="{'is-active' : isSelected(key) }"
|
|
|
|
@click.prevent="select(result)"
|
|
|
|
ref="options"
|
|
|
|
>
|
|
|
|
<strong> {{ result }}</strong>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2019-10-03 16:54:05 +00:00
|
|
|
</div>
|
2019-09-27 16:02:48 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
2019-10-23 17:04:54 +00:00
|
|
|
<script lang="ts">
|
|
|
|
// import Vue from "vue";
|
|
|
|
// import { Component, Provide } from "vue-property-decorator";
|
2019-09-27 16:02:48 +00:00
|
|
|
|
2019-10-23 17:04:54 +00:00
|
|
|
// @Component({})
|
|
|
|
// export default class VsInput extends Vue {
|
2019-10-30 10:25:56 +00:00
|
|
|
// term = "";
|
2019-10-23 17:04:54 +00:00
|
|
|
// search() {
|
|
|
|
// this.$emit("search", this.term);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
import VsInput from "./vs-input-class";
|
|
|
|
export default VsInput;
|
2019-10-30 10:25:56 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.sidebar-simplesearch {
|
|
|
|
position: relative;
|
|
|
|
width: 100%;
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
|
|
|
|
|
|
|
.autocomplete-results {
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
border: 1px solid #eeeeee;
|
|
|
|
list-style-type: none;
|
|
|
|
z-index: 1000;
|
|
|
|
position: absolute;
|
|
|
|
max-height: 200px;
|
|
|
|
overflow-y: auto;
|
|
|
|
background: white;
|
|
|
|
width: 100%;
|
|
|
|
border: 1px solid #ccc;
|
|
|
|
border-top: 0;
|
|
|
|
color: black;
|
|
|
|
}
|
|
|
|
|
|
|
|
.autocomplete-result-item {
|
|
|
|
list-style: none;
|
|
|
|
text-align: left;
|
|
|
|
padding: 7px 10px;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
|
|
|
.autocomplete-result-item.is-active {
|
|
|
|
background: rgba(0, 180, 255, 0.15);
|
|
|
|
}
|
|
|
|
|
|
|
|
.autocomplete-result-item:hover {
|
|
|
|
background: rgba(0, 180, 255, 0.075);
|
|
|
|
}
|
|
|
|
</style>
|