code refactor

This commit is contained in:
MaysWind
2025-02-09 21:26:02 +08:00
parent e665fac956
commit a21bc7aad7
3 changed files with 8 additions and 4 deletions
+2 -1
View File
@@ -37,12 +37,13 @@ import { useI18n } from '@/locales/helpers.ts';
import type { CurrencyPrependAndAppendText } from '@/core/currency.ts'; import type { CurrencyPrependAndAppendText } from '@/core/currency.ts';
import { TRANSACTION_MIN_AMOUNT, TRANSACTION_MAX_AMOUNT } from '@/consts/transaction.ts'; import { TRANSACTION_MIN_AMOUNT, TRANSACTION_MAX_AMOUNT } from '@/consts/transaction.ts';
import { removeAll } from '@/lib/common.ts'; import { removeAll } from '@/lib/common.ts';
import type { ComponentDensity } from '@/lib/ui/desktop.ts';
import logger from '@/lib/logger.ts'; import logger from '@/lib/logger.ts';
const props = defineProps<{ const props = defineProps<{
class?: string; class?: string;
color?: string; color?: string;
density?: string; density?: ComponentDensity;
currency: string; currency: string;
showCurrency?: boolean; showCurrency?: boolean;
label?: string; label?: string;
+3 -3
View File
@@ -91,7 +91,7 @@ import {
getItemByKeyValue, getItemByKeyValue,
getNameByKeyValue getNameByKeyValue
} from '@/lib/common.ts'; } from '@/lib/common.ts';
import { scrollToSelectedItem } from '@/lib/ui/desktop.ts'; import { type ComponentDensity, type InputVariant, scrollToSelectedItem } from '@/lib/ui/desktop.ts';
import { import {
mdiChevronRight, mdiChevronRight,
@@ -99,8 +99,8 @@ import {
} from '@mdi/js'; } from '@mdi/js';
interface DesktopTwoColumnListItemSelectionProps extends CommonTwoColumnListItemSelectionProps { interface DesktopTwoColumnListItemSelectionProps extends CommonTwoColumnListItemSelectionProps {
density?: string; density?: ComponentDensity;
variant?: string; variant?: InputVariant;
disabled?: boolean; disabled?: boolean;
readonly?: boolean; readonly?: boolean;
label?: string; label?: string;
+3
View File
@@ -1,3 +1,6 @@
export type ComponentDensity = 'default' | 'comfortable' | 'compact';
export type InputVariant = 'filled' | 'underlined' | 'outlined' | 'plain' | 'solo' | 'solo-inverted' | 'solo-filled';
export function getOuterHeight(element: HTMLElement | null): number { export function getOuterHeight(element: HTMLElement | null): number {
if (!element) { if (!element) {
return 0; return 0;