mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-15 23:47:33 +08:00
add search box in tag filter page / dialog (#382)
This commit is contained in:
@@ -1560,9 +1560,6 @@
|
||||
"Set All to Included": "Set All to Included",
|
||||
"Set All to Default": "Set All to Default",
|
||||
"Set All to Excluded": "Set All to Excluded",
|
||||
"Set All Visible Items to Included": "Set All Visible Items to Included",
|
||||
"Set All Visible Items to Default": "Set All Visible Items to Default",
|
||||
"Set All Visible Items to Excluded": "Set All Visible Items to Excluded",
|
||||
"Back": "Zurück",
|
||||
"Load More": "Mehr laden",
|
||||
"Export Results": "Export Results",
|
||||
|
||||
@@ -1560,9 +1560,6 @@
|
||||
"Set All to Included": "Set All to Included",
|
||||
"Set All to Default": "Set All to Default",
|
||||
"Set All to Excluded": "Set All to Excluded",
|
||||
"Set All Visible Items to Included": "Set All Visible Items to Included",
|
||||
"Set All Visible Items to Default": "Set All Visible Items to Default",
|
||||
"Set All Visible Items to Excluded": "Set All Visible Items to Excluded",
|
||||
"Back": "Back",
|
||||
"Load More": "Load More",
|
||||
"Export Results": "Export Results",
|
||||
|
||||
@@ -1560,9 +1560,6 @@
|
||||
"Set All to Included": "Set All to Included",
|
||||
"Set All to Default": "Set All to Default",
|
||||
"Set All to Excluded": "Set All to Excluded",
|
||||
"Set All Visible Items to Included": "Set All Visible Items to Included",
|
||||
"Set All Visible Items to Default": "Set All Visible Items to Default",
|
||||
"Set All Visible Items to Excluded": "Set All Visible Items to Excluded",
|
||||
"Back": "Atrás",
|
||||
"Load More": "Cargar Más",
|
||||
"Export Results": "Exportar Resultados",
|
||||
|
||||
@@ -1560,9 +1560,6 @@
|
||||
"Set All to Included": "Set All to Included",
|
||||
"Set All to Default": "Set All to Default",
|
||||
"Set All to Excluded": "Set All to Excluded",
|
||||
"Set All Visible Items to Included": "Set All Visible Items to Included",
|
||||
"Set All Visible Items to Default": "Set All Visible Items to Default",
|
||||
"Set All Visible Items to Excluded": "Set All Visible Items to Excluded",
|
||||
"Back": "Retour",
|
||||
"Load More": "Charger plus",
|
||||
"Export Results": "Exporter les résultats",
|
||||
|
||||
@@ -1560,9 +1560,6 @@
|
||||
"Set All to Included": "Set All to Included",
|
||||
"Set All to Default": "Set All to Default",
|
||||
"Set All to Excluded": "Set All to Excluded",
|
||||
"Set All Visible Items to Included": "Set All Visible Items to Included",
|
||||
"Set All Visible Items to Default": "Set All Visible Items to Default",
|
||||
"Set All Visible Items to Excluded": "Set All Visible Items to Excluded",
|
||||
"Back": "Indietro",
|
||||
"Load More": "Carica altro",
|
||||
"Export Results": "Export Results",
|
||||
|
||||
@@ -1560,9 +1560,6 @@
|
||||
"Set All to Included": "Set All to Included",
|
||||
"Set All to Default": "Set All to Default",
|
||||
"Set All to Excluded": "Set All to Excluded",
|
||||
"Set All Visible Items to Included": "Set All Visible Items to Included",
|
||||
"Set All Visible Items to Default": "Set All Visible Items to Default",
|
||||
"Set All Visible Items to Excluded": "Set All Visible Items to Excluded",
|
||||
"Back": "戻る",
|
||||
"Load More": "さらに読み込む",
|
||||
"Export Results": "Export Results",
|
||||
|
||||
@@ -1560,9 +1560,6 @@
|
||||
"Set All to Included": "ಎಲ್ಲವನ್ನು ಸೇರಿಸಲಾಗಿದೆ ಎನ್ನಿ",
|
||||
"Set All to Default": "ಎಲ್ಲವನ್ನು ಡೀಫಾಲ್ಟ್ಗೆ ಸೆಟ್ ಮಾಡಿ",
|
||||
"Set All to Excluded": "ಎಲ್ಲವನ್ನು ಹೊರತುಪಡಿಸಿ ಎನ್ನಿ",
|
||||
"Set All Visible Items to Included": "ಗೋಚರಿಸುವ ಎಲ್ಲವನ್ನು ಸೇರಿಸಲಾಗಿದೆ ಎನ್ನಿ",
|
||||
"Set All Visible Items to Default": "ಗೋಚರಿಸುವ ಎಲ್ಲವನ್ನು ಡೀಫಾಲ್ಟ್ಗೆ ಸೆಟ್ ಮಾಡಿ",
|
||||
"Set All Visible Items to Excluded": "ಗೋಚರಿಸುವ ಎಲ್ಲವನ್ನು ಹೊರತುಪಡಿಸಿ",
|
||||
"Back": "ಹಿಂದೆ",
|
||||
"Load More": "ಇನ್ನಷ್ಟು ಲೋಡ್ ಮಾಡಿ",
|
||||
"Export Results": "ಫಲಿತಾಂಶಗಳನ್ನು ರಫ್ತುಮಾಡಿ",
|
||||
|
||||
@@ -1560,9 +1560,6 @@
|
||||
"Set All to Included": "Set All to Included",
|
||||
"Set All to Default": "Set All to Default",
|
||||
"Set All to Excluded": "Set All to Excluded",
|
||||
"Set All Visible Items to Included": "Set All Visible Items to Included",
|
||||
"Set All Visible Items to Default": "Set All Visible Items to Default",
|
||||
"Set All Visible Items to Excluded": "Set All Visible Items to Excluded",
|
||||
"Back": "뒤로",
|
||||
"Load More": "더 불러오기",
|
||||
"Export Results": "결과 내보내기",
|
||||
|
||||
@@ -1560,9 +1560,6 @@
|
||||
"Set All to Included": "Set All to Included",
|
||||
"Set All to Default": "Set All to Default",
|
||||
"Set All to Excluded": "Set All to Excluded",
|
||||
"Set All Visible Items to Included": "Set All Visible Items to Included",
|
||||
"Set All Visible Items to Default": "Set All Visible Items to Default",
|
||||
"Set All Visible Items to Excluded": "Set All Visible Items to Excluded",
|
||||
"Back": "Terug",
|
||||
"Load More": "Meer laden",
|
||||
"Export Results": "Resultaten exporteren",
|
||||
|
||||
@@ -1560,9 +1560,6 @@
|
||||
"Set All to Included": "Set All to Included",
|
||||
"Set All to Default": "Set All to Default",
|
||||
"Set All to Excluded": "Set All to Excluded",
|
||||
"Set All Visible Items to Included": "Set All Visible Items to Included",
|
||||
"Set All Visible Items to Default": "Set All Visible Items to Default",
|
||||
"Set All Visible Items to Excluded": "Set All Visible Items to Excluded",
|
||||
"Back": "Voltar",
|
||||
"Load More": "Carregar Mais",
|
||||
"Export Results": "Exportar Resultados",
|
||||
|
||||
@@ -1560,9 +1560,6 @@
|
||||
"Set All to Included": "Set All to Included",
|
||||
"Set All to Default": "Set All to Default",
|
||||
"Set All to Excluded": "Set All to Excluded",
|
||||
"Set All Visible Items to Included": "Set All Visible Items to Included",
|
||||
"Set All Visible Items to Default": "Set All Visible Items to Default",
|
||||
"Set All Visible Items to Excluded": "Set All Visible Items to Excluded",
|
||||
"Back": "Назад",
|
||||
"Load More": "Загрузить еще",
|
||||
"Export Results": "Export Results",
|
||||
|
||||
@@ -1560,9 +1560,6 @@
|
||||
"Set All to Included": "Set All to Included",
|
||||
"Set All to Default": "Set All to Default",
|
||||
"Set All to Excluded": "Set All to Excluded",
|
||||
"Set All Visible Items to Included": "Set All Visible Items to Included",
|
||||
"Set All Visible Items to Default": "Set All Visible Items to Default",
|
||||
"Set All Visible Items to Excluded": "Set All Visible Items to Excluded",
|
||||
"Back": "กลับ",
|
||||
"Load More": "โหลดเพิ่มเติม",
|
||||
"Export Results": "ส่งออกผลลัพธ์",
|
||||
|
||||
@@ -1560,9 +1560,6 @@
|
||||
"Set All to Included": "Tümünü Dahil Et",
|
||||
"Set All to Default": "Tümünü Varsayılan Yap",
|
||||
"Set All to Excluded": "Tümünü Hariç Tut",
|
||||
"Set All Visible Items to Included": "Görünenlerin Tümünü Dahil Et",
|
||||
"Set All Visible Items to Default": "Görünenlerin Tümünü Varsayılan Yap",
|
||||
"Set All Visible Items to Excluded": "Görünenlerin Tümünü Hariç Tut",
|
||||
"Back": "Geri",
|
||||
"Load More": "Daha Fazla Yükle",
|
||||
"Export Results": "Sonuçları Dışa Aktar",
|
||||
|
||||
@@ -1560,9 +1560,6 @@
|
||||
"Set All to Included": "Set All to Included",
|
||||
"Set All to Default": "Set All to Default",
|
||||
"Set All to Excluded": "Set All to Excluded",
|
||||
"Set All Visible Items to Included": "Set All Visible Items to Included",
|
||||
"Set All Visible Items to Default": "Set All Visible Items to Default",
|
||||
"Set All Visible Items to Excluded": "Set All Visible Items to Excluded",
|
||||
"Back": "Назад",
|
||||
"Load More": "Завантажити ще",
|
||||
"Export Results": "Export Results",
|
||||
|
||||
@@ -1560,9 +1560,6 @@
|
||||
"Set All to Included": "Set All to Included",
|
||||
"Set All to Default": "Set All to Default",
|
||||
"Set All to Excluded": "Set All to Excluded",
|
||||
"Set All Visible Items to Included": "Set All Visible Items to Included",
|
||||
"Set All Visible Items to Default": "Set All Visible Items to Default",
|
||||
"Set All Visible Items to Excluded": "Set All Visible Items to Excluded",
|
||||
"Back": "Quay lại",
|
||||
"Load More": "Tải thêm",
|
||||
"Export Results": "Export Results",
|
||||
|
||||
@@ -1560,9 +1560,6 @@
|
||||
"Set All to Included": "全部设置为包含",
|
||||
"Set All to Default": "全部设置为默认",
|
||||
"Set All to Excluded": "全部设置为排除",
|
||||
"Set All Visible Items to Included": "全部可见项目设置为包含",
|
||||
"Set All Visible Items to Default": "全部可见项目设置为默认",
|
||||
"Set All Visible Items to Excluded": "全部可见项目设置为排除",
|
||||
"Back": "返回",
|
||||
"Load More": "加载更多",
|
||||
"Export Results": "导出结果",
|
||||
|
||||
@@ -1560,9 +1560,6 @@
|
||||
"Set All to Included": "全部設為包含",
|
||||
"Set All to Default": "全部設為預設",
|
||||
"Set All to Excluded": "全部設為排除",
|
||||
"Set All Visible Items to Included": "全部可見項目設為包含",
|
||||
"Set All Visible Items to Default": "全部可見項目設為預設",
|
||||
"Set All Visible Items to Excluded": "全部可見項目設為排除",
|
||||
"Back": "返回",
|
||||
"Load More": "載入更多",
|
||||
"Export Results": "匯出結果",
|
||||
|
||||
@@ -24,6 +24,7 @@ export function useTransactionTagFilterSettingPageBase(type?: string) {
|
||||
|
||||
const loading = ref<boolean>(true);
|
||||
const showHidden = ref<boolean>(false);
|
||||
const filterContent = ref<string>('');
|
||||
const filterTagIds = ref<Record<string, TransactionTagFilterState>>({});
|
||||
const includeTagFilterType = ref<number>(TransactionTagFilterType.HasAny.type);
|
||||
const excludeTagFilterType = ref<number>(TransactionTagFilterType.NotHasAny.type);
|
||||
@@ -39,15 +40,23 @@ export function useTransactionTagFilterSettingPageBase(type?: string) {
|
||||
return 'Apply';
|
||||
});
|
||||
|
||||
const allTags = computed<TransactionTag[]>(() => transactionTagsStore.allTransactionTags);
|
||||
const hasAnyAvailableTag = computed<boolean>(() => transactionTagsStore.allAvailableTagsCount > 0);
|
||||
const hasAnyVisibleTag = computed<boolean>(() => {
|
||||
if (showHidden.value) {
|
||||
return transactionTagsStore.allAvailableTagsCount > 0;
|
||||
} else {
|
||||
return transactionTagsStore.allVisibleTagsCount > 0;
|
||||
const allVisibleTags = computed<TransactionTag[]>(() => {
|
||||
const ret: TransactionTag[] = [];
|
||||
const allTags = showHidden.value ? transactionTagsStore.allTransactionTags : transactionTagsStore.allVisibleTags;
|
||||
const lowercaseFilterContent = filterContent.value ? filterContent.value.toLowerCase() : '';
|
||||
|
||||
for (const tag of allTags) {
|
||||
if (lowercaseFilterContent && !tag.name.toLowerCase().includes(lowercaseFilterContent)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ret.push(tag);
|
||||
}
|
||||
|
||||
return ret;
|
||||
});
|
||||
const hasAnyAvailableTag = computed<boolean>(() => transactionTagsStore.allAvailableTagsCount > 0);
|
||||
const hasAnyVisibleTag = computed<boolean>(() => allVisibleTags.value.length > 0);
|
||||
|
||||
function loadFilterTagIds(): boolean {
|
||||
let tagFilters: TransactionTagFilter[] = [];
|
||||
@@ -142,6 +151,7 @@ export function useTransactionTagFilterSettingPageBase(type?: string) {
|
||||
// states
|
||||
loading,
|
||||
showHidden,
|
||||
filterContent,
|
||||
filterTagIds,
|
||||
includeTagFilterType,
|
||||
excludeTagFilterType,
|
||||
@@ -150,7 +160,7 @@ export function useTransactionTagFilterSettingPageBase(type?: string) {
|
||||
excludeTagsCount,
|
||||
title,
|
||||
applyText,
|
||||
allTags,
|
||||
allVisibleTags,
|
||||
hasAnyAvailableTag,
|
||||
hasAnyVisibleTag,
|
||||
// functions
|
||||
|
||||
@@ -1,95 +1,46 @@
|
||||
<template>
|
||||
<v-card :class="{ 'pa-2 pa-sm-4 pa-md-8': dialogMode }">
|
||||
<template #title>
|
||||
<div class="d-flex align-center justify-center" v-if="dialogMode">
|
||||
<div class="w-100 text-center">
|
||||
<h4 class="text-h4">{{ tt(title) }}</h4>
|
||||
</div>
|
||||
<v-btn density="comfortable" color="default" variant="text" class="ms-2"
|
||||
:disabled="loading || !hasAnyAvailableTag" :icon="true">
|
||||
<v-icon :icon="mdiDotsVertical" />
|
||||
<v-menu activator="parent">
|
||||
<v-list>
|
||||
<v-list-item :prepend-icon="mdiSelectAll"
|
||||
:title="tt('Set All to Included')"
|
||||
:disabled="!hasAnyVisibleTag"
|
||||
@click="setAllTagsState(false, TransactionTagFilterState.Include)"></v-list-item>
|
||||
<v-list-item :prepend-icon="mdiSelectAll"
|
||||
:title="tt('Set All to Default')"
|
||||
:disabled="!hasAnyVisibleTag"
|
||||
@click="setAllTagsState(false, TransactionTagFilterState.Default)"></v-list-item>
|
||||
<v-list-item :prepend-icon="mdiSelectAll"
|
||||
:title="tt('Set All to Excluded')"
|
||||
:disabled="!hasAnyVisibleTag"
|
||||
@click="setAllTagsState(false, TransactionTagFilterState.Exclude)"></v-list-item>
|
||||
<v-divider class="my-2"/>
|
||||
<v-list-item :prepend-icon="mdiSelectAll"
|
||||
:title="tt('Set All Visible Items to Included')"
|
||||
:disabled="!hasAnyVisibleTag"
|
||||
@click="setAllTagsState(true, TransactionTagFilterState.Include)"></v-list-item>
|
||||
<v-list-item :prepend-icon="mdiSelectAll"
|
||||
:title="tt('Set All Visible Items to Default')"
|
||||
:disabled="!hasAnyVisibleTag"
|
||||
@click="setAllTagsState(true, TransactionTagFilterState.Default)"></v-list-item>
|
||||
<v-list-item :prepend-icon="mdiSelectAll"
|
||||
:title="tt('Set All Visible Items to Excluded')"
|
||||
:disabled="!hasAnyVisibleTag"
|
||||
@click="setAllTagsState(true, TransactionTagFilterState.Exclude)"></v-list-item>
|
||||
<v-divider class="my-2"/>
|
||||
<v-list-item :prepend-icon="mdiEyeOutline"
|
||||
:title="tt('Show Hidden Transaction Tags')"
|
||||
v-if="!showHidden" @click="showHidden = true"></v-list-item>
|
||||
<v-list-item :prepend-icon="mdiEyeOffOutline"
|
||||
:title="tt('Hide Hidden Transaction Tags')"
|
||||
v-if="showHidden" @click="showHidden = false"></v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-btn>
|
||||
</div>
|
||||
<div class="d-flex align-center" v-else-if="!dialogMode">
|
||||
<span>{{ tt(title) }}</span>
|
||||
<v-spacer/>
|
||||
<v-btn density="comfortable" color="default" variant="text" class="ms-2"
|
||||
:disabled="loading" :icon="true">
|
||||
<v-icon :icon="mdiDotsVertical" />
|
||||
<v-menu activator="parent">
|
||||
<v-list>
|
||||
<v-list-item :prepend-icon="mdiSelectAll"
|
||||
:title="tt('Set All to Included')"
|
||||
:disabled="!hasAnyVisibleTag"
|
||||
@click="setAllTagsState(false, TransactionTagFilterState.Include)"></v-list-item>
|
||||
<v-list-item :prepend-icon="mdiSelectAll"
|
||||
:title="tt('Set All to Default')"
|
||||
:disabled="!hasAnyVisibleTag"
|
||||
@click="setAllTagsState(false, TransactionTagFilterState.Default)"></v-list-item>
|
||||
<v-list-item :prepend-icon="mdiSelectAll"
|
||||
:title="tt('Set All to Excluded')"
|
||||
:disabled="!hasAnyVisibleTag"
|
||||
@click="setAllTagsState(false, TransactionTagFilterState.Exclude)"></v-list-item>
|
||||
<v-divider class="my-2"/>
|
||||
<v-list-item :prepend-icon="mdiSelectAll"
|
||||
:title="tt('Set All Visible Items to Included')"
|
||||
:disabled="!hasAnyVisibleTag"
|
||||
@click="setAllTagsState(true, TransactionTagFilterState.Include)"></v-list-item>
|
||||
<v-list-item :prepend-icon="mdiSelectAll"
|
||||
:title="tt('Set All Visible Items to Default')"
|
||||
:disabled="!hasAnyVisibleTag"
|
||||
@click="setAllTagsState(true, TransactionTagFilterState.Default)"></v-list-item>
|
||||
<v-list-item :prepend-icon="mdiSelectAll"
|
||||
:title="tt('Set All Visible Items to Excluded')"
|
||||
:disabled="!hasAnyVisibleTag"
|
||||
@click="setAllTagsState(true, TransactionTagFilterState.Exclude)"></v-list-item>
|
||||
<v-divider class="my-2"/>
|
||||
<v-list-item :prepend-icon="mdiEyeOutline"
|
||||
:title="tt('Show Hidden Transaction Tags')"
|
||||
v-if="!showHidden" @click="showHidden = true"></v-list-item>
|
||||
<v-list-item :prepend-icon="mdiEyeOffOutline"
|
||||
:title="tt('Hide Hidden Transaction Tags')"
|
||||
v-if="showHidden" @click="showHidden = false"></v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-btn>
|
||||
</div>
|
||||
<v-row>
|
||||
<v-col cols="6">
|
||||
<div :class="{ 'text-h4': dialogMode }">
|
||||
{{ tt(title) }}
|
||||
</div>
|
||||
</v-col>
|
||||
<v-col cols="6" class="d-flex align-center">
|
||||
<v-text-field eager ref="filterInput" density="compact"
|
||||
:prepend-inner-icon="mdiMagnify"
|
||||
:placeholder="tt('Find tag')"
|
||||
v-model="filterContent"></v-text-field>
|
||||
<v-btn density="comfortable" color="default" variant="text" class="ms-2"
|
||||
:disabled="loading || !hasAnyAvailableTag" :icon="true">
|
||||
<v-icon :icon="mdiDotsVertical" />
|
||||
<v-menu activator="parent">
|
||||
<v-list>
|
||||
<v-list-item :prepend-icon="mdiSelectAll"
|
||||
:title="tt('Set All to Included')"
|
||||
:disabled="!hasAnyVisibleTag"
|
||||
@click="setAllTagsState(TransactionTagFilterState.Include)"></v-list-item>
|
||||
<v-list-item :prepend-icon="mdiSelectAll"
|
||||
:title="tt('Set All to Default')"
|
||||
:disabled="!hasAnyVisibleTag"
|
||||
@click="setAllTagsState(TransactionTagFilterState.Default)"></v-list-item>
|
||||
<v-list-item :prepend-icon="mdiSelectAll"
|
||||
:title="tt('Set All to Excluded')"
|
||||
:disabled="!hasAnyVisibleTag"
|
||||
@click="setAllTagsState(TransactionTagFilterState.Exclude)"></v-list-item>
|
||||
<v-divider class="my-2"/>
|
||||
<v-list-item :prepend-icon="mdiEyeOutline"
|
||||
:title="tt('Show Hidden Transaction Tags')"
|
||||
v-if="!showHidden" @click="showHidden = true"></v-list-item>
|
||||
<v-list-item :prepend-icon="mdiEyeOffOutline"
|
||||
:title="tt('Hide Hidden Transaction Tags')"
|
||||
v-if="showHidden" @click="showHidden = false"></v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
<div v-if="loading">
|
||||
@@ -130,7 +81,7 @@
|
||||
<v-expansion-panel-text>
|
||||
<v-list rounded density="comfortable" class="pa-0">
|
||||
<template :key="transactionTag.id"
|
||||
v-for="transactionTag in allTags">
|
||||
v-for="transactionTag in allVisibleTags">
|
||||
<v-list-item v-if="showHidden || !transactionTag.hidden">
|
||||
<template #prepend>
|
||||
<v-badge class="right-bottom-icon" color="secondary"
|
||||
@@ -161,7 +112,7 @@
|
||||
|
||||
<v-card-text class="overflow-y-visible" v-if="dialogMode">
|
||||
<div class="w-100 d-flex justify-center mt-2 mt-sm-4 mt-md-6 gap-4">
|
||||
<v-btn :disabled="!hasAnyVisibleTag" @click="save">{{ tt(applyText) }}</v-btn>
|
||||
<v-btn :disabled="!hasAnyAvailableTag" @click="save">{{ tt(applyText) }}</v-btn>
|
||||
<v-btn color="secondary" variant="tonal" @click="cancel">{{ tt('Cancel') }}</v-btn>
|
||||
</div>
|
||||
</v-card-text>
|
||||
@@ -187,6 +138,7 @@ import { TransactionTagFilterType } from '@/core/transaction.ts';
|
||||
import type { TransactionTag } from '@/models/transaction_tag.ts';
|
||||
|
||||
import {
|
||||
mdiMagnify,
|
||||
mdiSelectAll,
|
||||
mdiEyeOutline,
|
||||
mdiEyeOffOutline,
|
||||
@@ -211,6 +163,7 @@ const { tt } = useI18n();
|
||||
const {
|
||||
loading,
|
||||
showHidden,
|
||||
filterContent,
|
||||
filterTagIds,
|
||||
includeTagFilterType,
|
||||
excludeTagFilterType,
|
||||
@@ -218,7 +171,7 @@ const {
|
||||
excludeTagsCount,
|
||||
title,
|
||||
applyText,
|
||||
allTags,
|
||||
allVisibleTags,
|
||||
hasAnyAvailableTag,
|
||||
hasAnyVisibleTag,
|
||||
loadFilterTagIds,
|
||||
@@ -273,12 +226,8 @@ function updateTransactionTagExcludeType(value: number): void {
|
||||
}
|
||||
}
|
||||
|
||||
function setAllTagsState(onlyVisible: boolean, value: TransactionTagFilterState): void {
|
||||
for (const tag of allTags.value) {
|
||||
if (onlyVisible && !showHidden.value && tag.hidden) {
|
||||
continue;
|
||||
}
|
||||
|
||||
function setAllTagsState(value: TransactionTagFilterState): void {
|
||||
for (const tag of allVisibleTags.value) {
|
||||
filterTagIds.value[tag.id] = value;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,22 @@
|
||||
<template>
|
||||
<f7-page @page:afterin="onPageAfterIn">
|
||||
<f7-page with-subnavbar @page:beforein="onPageBeforeIn" @page:afterin="onPageAfterIn">
|
||||
<f7-navbar>
|
||||
<f7-nav-left :back-link="tt('Back')"></f7-nav-left>
|
||||
<f7-nav-title :title="tt(title)"></f7-nav-title>
|
||||
<f7-nav-right class="navbar-compact-icons">
|
||||
<f7-link icon-f7="ellipsis" :class="{ 'disabled': !hasAnyAvailableTag }" @click="showMoreActionSheet = true"></f7-link>
|
||||
<f7-link icon-f7="checkmark_alt" :class="{ 'disabled': !hasAnyVisibleTag }" @click="save"></f7-link>
|
||||
<f7-link icon-f7="checkmark_alt" :class="{ 'disabled': !hasAnyAvailableTag }" @click="save"></f7-link>
|
||||
</f7-nav-right>
|
||||
|
||||
<f7-subnavbar :inner="false">
|
||||
<f7-searchbar
|
||||
custom-searchs
|
||||
:value="filterContent"
|
||||
:placeholder="tt('Find tag')"
|
||||
:disable-button-text="tt('Cancel')"
|
||||
@change="filterContent = $event.target.value"
|
||||
></f7-searchbar>
|
||||
</f7-subnavbar>
|
||||
</f7-navbar>
|
||||
|
||||
<f7-block class="combination-list-wrapper margin-vertical skeleton-text" v-if="loading">
|
||||
@@ -85,7 +95,7 @@
|
||||
:value="transactionTag.id"
|
||||
:key="transactionTag.id"
|
||||
:after="tt(filterTagIds[transactionTag.id] === TransactionTagFilterState.Include ? 'Included' : filterTagIds[transactionTag.id] === TransactionTagFilterState.Exclude ? 'Excluded' : 'Default')"
|
||||
v-for="transactionTag in allTags"
|
||||
v-for="transactionTag in allVisibleTags"
|
||||
v-show="showHidden || !transactionTag.hidden"
|
||||
@click="currentTransactionTagId = transactionTag.id">
|
||||
<template #media>
|
||||
@@ -122,14 +132,9 @@
|
||||
|
||||
<f7-actions close-by-outside-click close-on-escape :opened="showMoreActionSheet" @actions:closed="showMoreActionSheet = false">
|
||||
<f7-actions-group>
|
||||
<f7-actions-button :class="{ 'disabled': !hasAnyVisibleTag }" @click="setAllTagsState(false, TransactionTagFilterState.Include)">{{ tt('Set All to Included') }}</f7-actions-button>
|
||||
<f7-actions-button :class="{ 'disabled': !hasAnyVisibleTag }" @click="setAllTagsState(false, TransactionTagFilterState.Default)">{{ tt('Set All to Default') }}</f7-actions-button>
|
||||
<f7-actions-button :class="{ 'disabled': !hasAnyVisibleTag }" @click="setAllTagsState(false, TransactionTagFilterState.Exclude)">{{ tt('Set All to Excluded') }}</f7-actions-button>
|
||||
</f7-actions-group>
|
||||
<f7-actions-group>
|
||||
<f7-actions-button :class="{ 'disabled': !hasAnyVisibleTag }" @click="setAllTagsState(true, TransactionTagFilterState.Include)">{{ tt('Set All Visible Items to Included') }}</f7-actions-button>
|
||||
<f7-actions-button :class="{ 'disabled': !hasAnyVisibleTag }" @click="setAllTagsState(true, TransactionTagFilterState.Default)">{{ tt('Set All Visible Items to Default') }}</f7-actions-button>
|
||||
<f7-actions-button :class="{ 'disabled': !hasAnyVisibleTag }" @click="setAllTagsState(true, TransactionTagFilterState.Exclude)">{{ tt('Set All Visible Items to Excluded') }}</f7-actions-button>
|
||||
<f7-actions-button :class="{ 'disabled': !hasAnyVisibleTag }" @click="setAllTagsState(TransactionTagFilterState.Include)">{{ tt('Set All to Included') }}</f7-actions-button>
|
||||
<f7-actions-button :class="{ 'disabled': !hasAnyVisibleTag }" @click="setAllTagsState(TransactionTagFilterState.Default)">{{ tt('Set All to Default') }}</f7-actions-button>
|
||||
<f7-actions-button :class="{ 'disabled': !hasAnyVisibleTag }" @click="setAllTagsState(TransactionTagFilterState.Exclude)">{{ tt('Set All to Excluded') }}</f7-actions-button>
|
||||
</f7-actions-group>
|
||||
<f7-actions-group>
|
||||
<f7-actions-button v-if="!showHidden" @click="showHidden = true">{{ tt('Show Hidden Transaction Tags') }}</f7-actions-button>
|
||||
@@ -174,13 +179,14 @@ const { showToast, routeBackOnError } = useI18nUIComponents();
|
||||
const {
|
||||
loading,
|
||||
showHidden,
|
||||
filterContent,
|
||||
filterTagIds,
|
||||
includeTagFilterType,
|
||||
excludeTagFilterType,
|
||||
includeTagsCount,
|
||||
excludeTagsCount,
|
||||
title,
|
||||
allTags,
|
||||
allVisibleTags,
|
||||
hasAnyAvailableTag,
|
||||
hasAnyVisibleTag,
|
||||
loadFilterTagIds,
|
||||
@@ -224,12 +230,8 @@ function updateCurrentTransactionTagState(state: number): void {
|
||||
currentTransactionTagId.value = '';
|
||||
}
|
||||
|
||||
function setAllTagsState(onlyVisible: boolean, value: TransactionTagFilterState): void {
|
||||
for (const tag of allTags.value) {
|
||||
if (onlyVisible && !showHidden.value && tag.hidden) {
|
||||
continue;
|
||||
}
|
||||
|
||||
function setAllTagsState(value: TransactionTagFilterState): void {
|
||||
for (const tag of allVisibleTags.value) {
|
||||
filterTagIds.value[tag.id] = value;
|
||||
}
|
||||
}
|
||||
@@ -239,6 +241,10 @@ function save(): void {
|
||||
props.f7router.back();
|
||||
}
|
||||
|
||||
function onPageBeforeIn(): void {
|
||||
filterContent.value = '';
|
||||
}
|
||||
|
||||
function onPageAfterIn(): void {
|
||||
routeBackOnError(props.f7router, loadingError);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user