support selecting all visible in account / category / tag filter dialog / page

This commit is contained in:
MaysWind
2025-10-29 00:52:03 +08:00
parent 48a06c6570
commit 274fb8b4e2
24 changed files with 146 additions and 0 deletions
+18
View File
@@ -414,6 +414,24 @@ export function selectAllSubCategories(filterCategoryIds: Record<string, boolean
}
}
export function selectAllVisible(filterCategoryIds: Record<string, boolean>, allTransactionCategoriesMap: Record<string, TransactionCategory>): void {
for (const categoryId of keys(filterCategoryIds)) {
const category = allTransactionCategoriesMap[categoryId];
if (category) {
if (category.hidden) {
continue;
}
if (category.parentId && allTransactionCategoriesMap[category.parentId] && allTransactionCategoriesMap[category.parentId]!.hidden) {
continue;
}
filterCategoryIds[category.id] = false;
}
}
}
export function selectAll(filterCategoryIds: Record<string, boolean>, allTransactionCategoriesMap: Record<string, TransactionCategory>): void {
for (const categoryId of keys(filterCategoryIds)) {
const category = allTransactionCategoriesMap[categoryId];