use the new popup select dialog

This commit is contained in:
MaysWind
2025-03-09 16:23:23 +08:00
parent 2bf8c0b501
commit 639bd9c5cd
12 changed files with 473 additions and 191 deletions
+20 -2
View File
@@ -7,21 +7,37 @@ import { useTransactionsStore } from '@/stores/transaction.ts';
import { useOverviewStore } from '@/stores/overview.ts';
import { useStatisticsStore } from '@/stores/statistics.ts';
import type { TypeAndDisplayName } from '@/core/base.ts';
import type { NameValue, TypeAndDisplayName } from '@/core/base.ts';
import type { LocalizedTimezoneInfo } from '@/core/timezone.ts';
export function useAppSettingPageBase() {
const { getAllTimezones, getAllTimezoneTypesUsedForStatistics, getAllCurrencySortingTypes, setTimeZone } = useI18n();
const { tt, getAllTimezones, getAllTimezoneTypesUsedForStatistics, getAllCurrencySortingTypes, setTimeZone } = useI18n();
const settingsStore = useSettingsStore();
const transactionsStore = useTransactionsStore();
const overviewStore = useOverviewStore();
const statisticsStore = useStatisticsStore();
const allThemes = computed<NameValue[]>(() => {
return [
{ name: tt('System Default'), value: 'auto' },
{ name: tt('Light'), value: 'light' },
{ name: tt('Dark'), value: 'dark' }
];
});
const allTimezones = computed<LocalizedTimezoneInfo[]>(() => getAllTimezones(true));
const allTimezoneTypesUsedForStatistics = computed<TypeAndDisplayName[]>(() => getAllTimezoneTypesUsedForStatistics());
const allCurrencySortingTypes = computed<TypeAndDisplayName[]>(() => getAllCurrencySortingTypes());
const allAutoSaveTransactionDraftTypes = computed<NameValue[]>(() => {
return [
{ name: tt('Disabled'), value: 'disabled' },
{ name: tt('Enabled'), value: 'enabled' },
{ name: tt('Show Confirmation Every Time'), value: 'confirmation' }
];
});
const timeZone = computed<string>({
get: () => settingsStore.appSettings.timeZone,
set: (value) => {
@@ -94,9 +110,11 @@ export function useAppSettingPageBase() {
return {
// computed states
allThemes,
allTimezones,
allTimezoneTypesUsedForStatistics,
allCurrencySortingTypes,
allAutoSaveTransactionDraftTypes,
timeZone,
isAutoUpdateExchangeRatesData,
showAccountBalance,