- autocomplete search, default full text search

This commit is contained in:
Arno Kaimbacher 2022-09-08 15:16:52 +02:00
parent 38b8973f02
commit f749b2eb3e
7 changed files with 418 additions and 430 deletions

View File

@ -1,9 +1,11 @@
// https://npmmirror.com/package/@typescript-eslint/eslint-plugin/v/5.0.1-alpha.14
module.exports = { module.exports = {
root: true, root: true,
env: { env: {
es6: true, es6: true,
node: true, node: true,
}, },
// extends: ["plugin:vue/vue3-essential", "eslint:recommended", "@vue/typescript/recommended", "@vue/prettier", "@vue/prettier/@typescript-eslint"],
extends: ["plugin:vue/vue3-essential", "eslint:recommended", "@vue/typescript/recommended", "@vue/prettier", "@vue/prettier/@typescript-eslint"], extends: ["plugin:vue/vue3-essential", "eslint:recommended", "@vue/typescript/recommended", "@vue/prettier", "@vue/prettier/@typescript-eslint"],
parserOptions: { parserOptions: {
ecmaVersion: 2020, ecmaVersion: 2020,

817
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -46,7 +46,7 @@
"prettier": "^2.2.1", "prettier": "^2.2.1",
"sass": "^1.26.5", "sass": "^1.26.5",
"sass-loader": "^13.0.0", "sass-loader": "^13.0.0",
"typescript": "^4.7.4", "typescript": "~4.7.4",
"webpack": "^5.72.1" "webpack": "^5.72.1"
} }
} }

View File

@ -28,7 +28,7 @@
<!-- <router-link class="navbar-link is-arrowless" to="/services">SERVICES</router-link> --> <!-- <router-link class="navbar-link is-arrowless" to="/services">SERVICES</router-link> -->
</li> </li>
<li class="navbar-item"> <li class="navbar-item">
<a class="navbar-link is-arrowless" bind:href="help_url">HELP</a> <a class="navbar-link is-arrowless" v-bind:href="help_url">HELP</a>
<!-- <router-link class="navbar-link is-arrowless" to="/help">HELP</router-link> --> <!-- <router-link class="navbar-link is-arrowless" to="/help">HELP</router-link> -->
</li> </li>
<!-- <li class="navbar-item"> <!-- <li class="navbar-item">
@ -38,7 +38,7 @@
<a class="navbar-link is-arrowless" href="#">HELP</a> <a class="navbar-link is-arrowless" href="#">HELP</a>
</li> --> </li> -->
<li class="navbar-item"> <li class="navbar-item">
<a class="navbar-link is-arrowless" bind:href="oai_url">OAI</a> <a class="navbar-link is-arrowless" v-bind:href="oai_url">OAI</a>
<!-- <router-link target="_blank" class="navbar-link is-arrowless" to="/oai">OAI</router-link> --> <!-- <router-link target="_blank" class="navbar-link is-arrowless" to="/oai">OAI</router-link> -->
</li> </li>
<!-- <!--

View File

@ -3,7 +3,7 @@ import { Options, Vue } from "vue-class-component";
import { Prop } from "vue-property-decorator"; import { Prop } from "vue-property-decorator";
import { LatLng, LatLngBounds, Map, MapOptions, Rectangle, tileLayer, TileLayer, CRS } from "leaflet"; import { LatLng, LatLngBounds, Map, MapOptions, Rectangle, tileLayer, TileLayer, CRS } from "leaflet";
// import { LayerOptions } from "./map-options"; // import { LayerOptions } from "./map-options";
import DatasetService from "../../services/dataset.service"; // import DatasetService from "../../services/dataset.service";
import { Subscription } from "rxjs"; import { Subscription } from "rxjs";
import { OaiDataset } from "@/models/oai"; import { OaiDataset } from "@/models/oai";

View File

@ -29,8 +29,8 @@ export default class VsInput extends Vue {
private error = ""; private error = "";
private results: Array<Dataset> = []; private results: Array<Dataset> = [];
private loading = false; private loading = false;
private selectedIndex = 0; private selectedIndex = -1;
private selectedDisplay = ""; // private selectedDisplay = "";
private solr: SolrSettings = { private solr: SolrSettings = {
core: SOLR_CORE, //"rdr_data", // SOLR.core; core: SOLR_CORE, //"rdr_data", // SOLR.core;
host: SOLR_HOST, //"tethys.at", host: SOLR_HOST, //"tethys.at",
@ -132,7 +132,7 @@ export default class VsInput extends Vue {
} }
searchChanged(): void { searchChanged(): void {
this.selectedIndex = 0; this.selectedIndex = -1;
// Let's warn the parent that a change was made // Let's warn the parent that a change was made
// this.$emit("input", this.display); // this.$emit("input", this.display);
if (this.display.length >= 2) { if (this.display.length >= 2) {
@ -183,7 +183,7 @@ export default class VsInput extends Vue {
onArrowDown(ev: Event): void { onArrowDown(ev: Event): void {
ev.preventDefault(); ev.preventDefault();
if (this.selectedIndex === null) { if (this.selectedIndex === -1) {
this.selectedIndex = 0; this.selectedIndex = 0;
return; return;
} }
@ -202,7 +202,7 @@ export default class VsInput extends Vue {
onArrowUp(ev: Event): void { onArrowUp(ev: Event): void {
ev.preventDefault(); ev.preventDefault();
if (this.selectedIndex === null) { if (this.selectedIndex === -1) {
this.selectedIndex = this.suggestions.length - 1; this.selectedIndex = this.suggestions.length - 1;
return; return;
} }
@ -211,11 +211,13 @@ export default class VsInput extends Vue {
} }
onEnter(): void { onEnter(): void {
if (this.selectedIndex === null) { if (this.selectedIndex === -1) {
// this.$emit("nothingSelected", this.display); // this.$emit("nothingSelected", this.display);
return; this.display && this.search();
} else {
this.select(this.suggestions[this.selectedIndex]);
} }
this.select(this.suggestions[this.selectedIndex]);
// this.$emit("enter", this.display); // this.$emit("enter", this.display);
} }

View File

@ -20,7 +20,8 @@
@keydown.tab="close" @keydown.tab="close"
v-on:focus="focus" v-on:focus="focus"
/> />
<!-- <p>Message is: {{ display }}</p> v-on:input="searchChanged"--> <!-- <p>Display is: {{ display }}</p> -->
<!-- v-on:input="searchChanged" -->
</div> </div>
<div class="control"> <div class="control">