From b2e36a24fdb1203247788ec4640031dfb378a16c Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sat, 11 Jan 2025 00:53:22 +0800 Subject: [PATCH] migrate mobile ui utils to typescript --- src/MobileApp.vue | 2 +- src/components/mobile/ColorSelectionSheet.vue | 2 +- .../mobile/DateTimeSelectionSheet.vue | 2 +- src/components/mobile/IconSelectionSheet.vue | 2 +- .../mobile/ListItemSelectionSheet.vue | 2 +- src/components/mobile/NumberPadSheet.vue | 2 +- .../mobile/ScheduleFrequencySheet.vue | 2 +- .../mobile/TransactionTagSelectionSheet.vue | 2 +- .../mobile/TreeViewSelectionSheet.vue | 2 +- .../TwoColumnListItemSelectionSheet.vue | 2 +- src/directives/mobile/textareaAutoSize.js | 10 --- src/directives/mobile/textareaAutoSize.ts | 10 +++ src/lib/common.ts | 10 +++ src/lib/ui/{mobile.js => mobile.ts} | 79 +++++++++++-------- src/mobile-main.js | 4 +- src/views/mobile/LoginPage.vue | 2 +- src/views/mobile/UnlockPage.vue | 2 +- src/views/mobile/accounts/ListPage.vue | 2 +- src/views/mobile/categories/ListPage.vue | 2 +- .../mobile/settings/TextSizeSettingsPage.vue | 2 +- .../mobile/statistics/TransactionPage.vue | 2 +- src/views/mobile/tags/ListPage.vue | 2 +- src/views/mobile/templates/ListPage.vue | 2 +- src/views/mobile/transactions/ListPage.vue | 2 +- src/views/mobile/users/SessionListPage.vue | 2 +- 25 files changed, 88 insertions(+), 65 deletions(-) delete mode 100644 src/directives/mobile/textareaAutoSize.js create mode 100644 src/directives/mobile/textareaAutoSize.ts rename src/lib/ui/{mobile.js => mobile.ts} (55%) diff --git a/src/MobileApp.vue b/src/MobileApp.vue index 6847b585..62b6e953 100644 --- a/src/MobileApp.vue +++ b/src/MobileApp.vue @@ -27,7 +27,7 @@ import { getTheme, isEnableAnimate } from '@/lib/settings.ts'; import { initMapProvider } from '@/lib/map/index.ts'; import { isUserLogined, isUserUnlocked } from '@/lib/userstate.ts'; import { setExpenseAndIncomeAmountColor } from '@/lib/ui/common.ts'; -import { isModalShowing, setAppFontSize } from '@/lib/ui/mobile.js'; +import { isModalShowing, setAppFontSize } from '@/lib/ui/mobile.ts'; const { tt, getCurrentLanguageInfo, setLanguage, initLocale } = useI18n(); diff --git a/src/components/mobile/ColorSelectionSheet.vue b/src/components/mobile/ColorSelectionSheet.vue index 3bcb2c9b..d99fc385 100644 --- a/src/components/mobile/ColorSelectionSheet.vue +++ b/src/components/mobile/ColorSelectionSheet.vue @@ -36,7 +36,7 @@ import { useI18n } from '@/locales/helpers.ts'; import type { ColorValue, ColorInfo } from '@/core/color.ts'; import { arrayContainsFieldValue } from '@/lib/common.ts'; import { getColorsInRows } from '@/lib/color.ts'; -import { scrollToSelectedItem } from '@/lib/ui/mobile.js'; +import { scrollToSelectedItem } from '@/lib/ui/mobile.ts'; const props = defineProps<{ modelValue: ColorValue; diff --git a/src/components/mobile/DateTimeSelectionSheet.vue b/src/components/mobile/DateTimeSelectionSheet.vue index f5bd6073..5487d955 100644 --- a/src/components/mobile/DateTimeSelectionSheet.vue +++ b/src/components/mobile/DateTimeSelectionSheet.vue @@ -64,7 +64,7 @@ import { getTimeValues, getCombinedDateAndTimeValues } from '@/lib/datetime.ts'; -import { createInlinePicker } from '@/lib/ui/mobile.js'; +import { createInlinePicker } from '@/lib/ui/mobile.ts'; export default { props: [ diff --git a/src/components/mobile/IconSelectionSheet.vue b/src/components/mobile/IconSelectionSheet.vue index 5c02bc3a..0bb129b4 100644 --- a/src/components/mobile/IconSelectionSheet.vue +++ b/src/components/mobile/IconSelectionSheet.vue @@ -36,7 +36,7 @@ import { useI18n } from '@/locales/helpers.ts'; import type { IconInfo, IconInfoWithId } from '@/core/icon.ts'; import { arrayContainsFieldValue } from '@/lib/common.ts'; import { getIconsInRows } from '@/lib/icon.ts'; -import { scrollToSelectedItem } from '@/lib/ui/mobile.js'; +import { scrollToSelectedItem } from '@/lib/ui/mobile.ts'; const props = defineProps<{ modelValue: string; diff --git a/src/components/mobile/ListItemSelectionSheet.vue b/src/components/mobile/ListItemSelectionSheet.vue index 5d1b1bfc..071aa796 100644 --- a/src/components/mobile/ListItemSelectionSheet.vue +++ b/src/components/mobile/ListItemSelectionSheet.vue @@ -32,7 +32,7 @@