mirror of https://github.com/bastienwirtz/homer
Fix search widget
parent
ce391840e5
commit
9582b1871a
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "homer",
|
"name": "homer",
|
||||||
"version": "22.07.1",
|
"version": "22.07.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
|
@ -19,11 +19,11 @@
|
||||||
"@vitejs/plugin-vue": "^2.3.1",
|
"@vitejs/plugin-vue": "^2.3.1",
|
||||||
"@vue/eslint-config-prettier": "^7.0.0",
|
"@vue/eslint-config-prettier": "^7.0.0",
|
||||||
"eslint": "^8.5.0",
|
"eslint": "^8.5.0",
|
||||||
"eslint-plugin-vue": "^9.1.1",
|
"eslint-plugin-vue": "^9.2.0",
|
||||||
"prettier": "^2.5.1",
|
"prettier": "^2.5.1",
|
||||||
"sass": "^1.52.2",
|
"sass": "^1.52.2",
|
||||||
"vite": "^2.9.9",
|
"vite": "^2.9.14",
|
||||||
"vite-plugin-pwa": "^0.12.2"
|
"vite-plugin-pwa": "^0.12.3"
|
||||||
},
|
},
|
||||||
"license": "Apache-2.0"
|
"license": "Apache-2.0"
|
||||||
}
|
}
|
||||||
|
|
16
src/App.vue
16
src/App.vue
|
@ -49,10 +49,10 @@
|
||||||
<SearchInput
|
<SearchInput
|
||||||
class="navbar-item is-inline-block-mobile"
|
class="navbar-item is-inline-block-mobile"
|
||||||
:hotkey="searchHotkey()"
|
:hotkey="searchHotkey()"
|
||||||
@input="filterServices"
|
@input="filterServices($event.target?.value)"
|
||||||
@search-focus="showMenu = true"
|
@search-focus="showMenu = true"
|
||||||
@search-open="navigateToFirstService"
|
@search-open="navigateToFirstService($event?.target?.value)"
|
||||||
@search-cancel="filterServices"
|
@search-cancel="filterServices()"
|
||||||
/>
|
/>
|
||||||
</Navbar>
|
</Navbar>
|
||||||
</div>
|
</div>
|
||||||
|
@ -255,11 +255,12 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
matchesFilter: function (item) {
|
matchesFilter: function (item) {
|
||||||
|
const needle = this.filter?.toLowerCase();
|
||||||
return (
|
return (
|
||||||
item.name.toLowerCase().includes(this.filter) ||
|
item.name.toLowerCase().includes(needle) ||
|
||||||
(item.subtitle && item.subtitle.toLowerCase().includes(this.filter)) ||
|
(item.subtitle && item.subtitle.toLowerCase().includes(needle)) ||
|
||||||
(item.tag && item.tag.toLowerCase().includes(this.filter)) ||
|
(item.tag && item.tag.toLowerCase().includes(needle)) ||
|
||||||
(item.keywords && item.keywords.toLowerCase().includes(this.filter))
|
(item.keywords && item.keywords.toLowerCase().includes(needle))
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
navigateToFirstService: function (target) {
|
navigateToFirstService: function (target) {
|
||||||
|
@ -271,6 +272,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
filterServices: function (filter) {
|
filterServices: function (filter) {
|
||||||
|
console.log(filter);
|
||||||
this.filter = filter;
|
this.filter = filter;
|
||||||
|
|
||||||
if (!filter) {
|
if (!filter) {
|
||||||
|
|
35
yarn.lock
35
yarn.lock
|
@ -1715,10 +1715,10 @@ eslint-plugin-prettier@^4.0.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
prettier-linter-helpers "^1.0.0"
|
prettier-linter-helpers "^1.0.0"
|
||||||
|
|
||||||
eslint-plugin-vue@^9.1.1:
|
eslint-plugin-vue@^9.2.0:
|
||||||
version "9.1.1"
|
version "9.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-9.1.1.tgz#341f7533cb041958455138834341d5be01f9f327"
|
resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-9.2.0.tgz#b7ca02b2ce8218b7586346440fc61c2655db353a"
|
||||||
integrity sha512-W9n5PB1X2jzC7CK6riG0oAcxjmKrjTF6+keL1rni8n57DZeilx/Fulz+IRJK3lYseLNAygN0I62L7DvioW40Tw==
|
integrity sha512-W2hc+NUXoce8sZtWgZ45miQTy6jNyuSdub5aZ1IBune4JDeAyzucYX0TzkrQ1jMO52sNUDYlCIHDoaNePe0p5g==
|
||||||
dependencies:
|
dependencies:
|
||||||
eslint-utils "^3.0.0"
|
eslint-utils "^3.0.0"
|
||||||
natural-compare "^1.4.0"
|
natural-compare "^1.4.0"
|
||||||
|
@ -2679,13 +2679,20 @@ rollup-plugin-terser@^7.0.0:
|
||||||
serialize-javascript "^4.0.0"
|
serialize-javascript "^4.0.0"
|
||||||
terser "^5.0.0"
|
terser "^5.0.0"
|
||||||
|
|
||||||
rollup@^2.43.1, rollup@^2.59.0, rollup@^2.75.5:
|
rollup@^2.43.1, rollup@^2.59.0:
|
||||||
version "2.75.7"
|
version "2.75.7"
|
||||||
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.75.7.tgz#221ff11887ae271e37dcc649ba32ce1590aaa0b9"
|
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.75.7.tgz#221ff11887ae271e37dcc649ba32ce1590aaa0b9"
|
||||||
integrity sha512-VSE1iy0eaAYNCxEXaleThdFXqZJ42qDBatAwrfnPlENEZ8erQ+0LYX4JXOLPceWfZpV1VtZwZ3dFCuOZiSyFtQ==
|
integrity sha512-VSE1iy0eaAYNCxEXaleThdFXqZJ42qDBatAwrfnPlENEZ8erQ+0LYX4JXOLPceWfZpV1VtZwZ3dFCuOZiSyFtQ==
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
fsevents "~2.3.2"
|
fsevents "~2.3.2"
|
||||||
|
|
||||||
|
rollup@^2.75.7:
|
||||||
|
version "2.76.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.76.0.tgz#c69fe03db530ac53fcb9523b3caa0d3c0b9491a1"
|
||||||
|
integrity sha512-9jwRIEY1jOzKLj3nsY/yot41r19ITdQrhs+q3ggNWhr9TQgduHqANvPpS32RNpzGklJu3G1AJfvlZLi/6wFgWA==
|
||||||
|
optionalDependencies:
|
||||||
|
fsevents "~2.3.2"
|
||||||
|
|
||||||
run-parallel@^1.1.9:
|
run-parallel@^1.1.9:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee"
|
resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee"
|
||||||
|
@ -3005,22 +3012,22 @@ v8-compile-cache@^2.0.3:
|
||||||
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee"
|
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee"
|
||||||
integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==
|
integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==
|
||||||
|
|
||||||
vite-plugin-pwa@^0.12.2:
|
vite-plugin-pwa@^0.12.3:
|
||||||
version "0.12.2"
|
version "0.12.3"
|
||||||
resolved "https://registry.yarnpkg.com/vite-plugin-pwa/-/vite-plugin-pwa-0.12.2.tgz#d0ec1cd3088260bdc5bf2b10ba753def0b8f3280"
|
resolved "https://registry.yarnpkg.com/vite-plugin-pwa/-/vite-plugin-pwa-0.12.3.tgz#acf2913ae85a4d39c13ae4b948307f3dd5506fa8"
|
||||||
integrity sha512-XK2oi1YZkoc1J8fyerNYxyh/yfb+INdrdOW/mOOD5DBLq7jVPxHQuncIhqiREbGOMlY/xMe9CSE7QZ9xIAEf7A==
|
integrity sha512-gmYdIVXpmBuNjzbJFPZFzxWYrX4lHqwMAlOtjmXBbxApiHjx9QPXKQPJjSpeTeosLKvVbNcKSAAhfxMda0QVNQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
debug "^4.3.4"
|
debug "^4.3.4"
|
||||||
fast-glob "^3.2.11"
|
fast-glob "^3.2.11"
|
||||||
pretty-bytes "^6.0.0"
|
pretty-bytes "^6.0.0"
|
||||||
rollup "^2.75.5"
|
rollup "^2.75.7"
|
||||||
workbox-build "^6.5.3"
|
workbox-build "^6.5.3"
|
||||||
workbox-window "^6.5.3"
|
workbox-window "^6.5.3"
|
||||||
|
|
||||||
vite@^2.9.9:
|
vite@^2.9.14:
|
||||||
version "2.9.13"
|
version "2.9.14"
|
||||||
resolved "https://registry.yarnpkg.com/vite/-/vite-2.9.13.tgz#859cb5d4c316c0d8c6ec9866045c0f7858ca6abc"
|
resolved "https://registry.yarnpkg.com/vite/-/vite-2.9.14.tgz#c438324c6594afd1050df3777da981dee988bb1b"
|
||||||
integrity sha512-AsOBAaT0AD7Mhe8DuK+/kE4aWYFMx/i0ZNi98hJclxb4e0OhQcZYUrvLjIaQ8e59Ui7txcvKMiJC1yftqpQoDw==
|
integrity sha512-P/UCjSpSMcE54r4mPak55hWAZPlyfS369svib/gpmz8/01L822lMPOJ/RYW6tLCe1RPvMvOsJ17erf55bKp4Hw==
|
||||||
dependencies:
|
dependencies:
|
||||||
esbuild "^0.14.27"
|
esbuild "^0.14.27"
|
||||||
postcss "^8.4.13"
|
postcss "^8.4.13"
|
||||||
|
|
Loading…
Reference in New Issue