From 3dbec4e888f57dc46a8cdc140185db1708ffe665 Mon Sep 17 00:00:00 2001 From: Pierre Romera Date: Tue, 23 Jul 2024 11:12:10 +0000 Subject: [PATCH] feat: use fixed occurrences width --- .../DocumentLocalSearch.vue | 2 +- .../DocumentLocalSearchOccurrences.vue | 22 ++++++++++++++----- .../DocumentLocalSearch.stories.js | 13 +++++++---- .../DocumentLocalSearchOccurrences.stories.js | 13 +++++++++++ 4 files changed, 39 insertions(+), 11 deletions(-) create mode 100644 src/stories/components/Document/DocumentLocalSearch/DocumentLocalSearchOccurrences.stories.js diff --git a/src/components/Document/DocumentLocalSearch/DocumentLocalSearch.vue b/src/components/Document/DocumentLocalSearch/DocumentLocalSearch.vue index 5624e78178..c5afaab4ea 100644 --- a/src/components/Document/DocumentLocalSearch/DocumentLocalSearch.vue +++ b/src/components/Document/DocumentLocalSearch/DocumentLocalSearch.vue @@ -39,7 +39,7 @@ const disabledNext = computed(() => props.activeIndex === props.occurrences || p @next="$emit('update:activeIndex', activeIndex + 1)" /> { return t('documentLocalSearchOccurrences.label', { activeIndex, occurrences }) }) -const show = computed(() => { - return props.occurrences !== null -}) - const style = computed(() => { return { maxWidth: props.maxWidth } }) @@ -37,14 +36,20 @@ const style = computed(() => { const key = computed(() => { return `${props.activeIndex}-${props.occurrences}` }) + +const classList = computed(() => { + return { + 'document-local-search-occurrences--hidden': props.hidden + } +})