mirror of
https://github.com/gotson/komga.git
synced 2026-05-08 12:35:30 +02:00
conditionally hide search in filter
This commit is contained in:
parent
f7a975f79f
commit
a08c78c95f
7 changed files with 19 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
<template>
|
||||
<v-text-field
|
||||
v-if="!hideSearch"
|
||||
v-model="search"
|
||||
clearable
|
||||
hide-details
|
||||
|
|
@ -49,11 +50,13 @@ const {
|
|||
searchItems = [],
|
||||
searchLoading = false,
|
||||
showModeSelector = false,
|
||||
hideSearch = false,
|
||||
} = defineProps<{
|
||||
items?: ItemType<unknown>[]
|
||||
searchItems?: ItemType<unknown>[]
|
||||
searchLoading?: boolean
|
||||
showModeSelector?: boolean
|
||||
hideSearch?: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
:items="infiniteItems"
|
||||
:search-items="searchResults"
|
||||
:search-loading="searchLoading"
|
||||
:hide-search="hideSearch"
|
||||
show-mode-selector
|
||||
@load-more="loadNextPage()"
|
||||
>
|
||||
|
|
@ -86,6 +87,8 @@ const infiniteItems = computed(() => {
|
|||
]
|
||||
})
|
||||
|
||||
const hideSearch = computed(() => (infiniteData.value?.pages?.[0]?.totalElements || 100) < 10)
|
||||
|
||||
function toItemType(authorName: string): ItemType<Author> {
|
||||
return {
|
||||
title: authorName,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
:items="infiniteItems"
|
||||
:search-items="searchResults"
|
||||
:search-loading="searchLoading"
|
||||
:hide-search="hideSearch"
|
||||
show-mode-selector
|
||||
@load-more="loadNextPage()"
|
||||
>
|
||||
|
|
@ -81,6 +82,8 @@ const infiniteItems = computed(() => {
|
|||
]
|
||||
})
|
||||
|
||||
const hideSearch = computed(() => (infiniteData.value?.pages?.[0]?.totalElements || 100) < 10)
|
||||
|
||||
function toItemType(value: string): ItemType<SchString> {
|
||||
return {
|
||||
title: value,
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
v-model:search="search"
|
||||
:items="allItems"
|
||||
:search-items="searchResults"
|
||||
:hide-search="allItems.length < 10"
|
||||
show-mode-selector
|
||||
>
|
||||
</FilterSearchList>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
:items="infiniteItems"
|
||||
:search-items="searchResults"
|
||||
:search-loading="searchLoading"
|
||||
:hide-search="hideSearch"
|
||||
show-mode-selector
|
||||
@load-more="loadNextPage()"
|
||||
>
|
||||
|
|
@ -81,6 +82,8 @@ const infiniteItems = computed(() => {
|
|||
]
|
||||
})
|
||||
|
||||
const hideSearch = computed(() => (infiniteData.value?.pages?.[0]?.totalElements || 100) < 10)
|
||||
|
||||
function toItemType(value: string): ItemType<SchString> {
|
||||
return {
|
||||
title: value,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
:items="infiniteItems"
|
||||
:search-items="searchResults"
|
||||
:search-loading="searchLoading"
|
||||
:hide-search="hideSearch"
|
||||
show-mode-selector
|
||||
@load-more="loadNextPage()"
|
||||
>
|
||||
|
|
@ -81,6 +82,8 @@ const infiniteItems = computed(() => {
|
|||
]
|
||||
})
|
||||
|
||||
const hideSearch = computed(() => (infiniteData.value?.pages?.[0]?.totalElements || 100) < 10)
|
||||
|
||||
function toItemType(value: string): ItemType<SchString> {
|
||||
return {
|
||||
title: value,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
:items="infiniteItems"
|
||||
:search-items="searchResults"
|
||||
:search-loading="searchLoading"
|
||||
:hide-search="hideSearch"
|
||||
show-mode-selector
|
||||
@load-more="loadNextPage()"
|
||||
>
|
||||
|
|
@ -86,6 +87,8 @@ const infiniteItems = computed(() => {
|
|||
]
|
||||
})
|
||||
|
||||
const hideSearch = computed(() => (infiniteData.value?.pages?.[0]?.totalElements || 100) < 10)
|
||||
|
||||
function toItemType(value: string): ItemType<SchString> {
|
||||
return {
|
||||
title: value,
|
||||
|
|
|
|||
Loading…
Reference in a new issue