support custom quick save button styles on the mobile transaction edit page

This commit is contained in:
MaysWind
2026-03-17 00:16:37 +08:00
parent 5ee93a5db1
commit 9772d9ca62
27 changed files with 215 additions and 6 deletions
+32
View File
@@ -67,6 +67,38 @@ export class TransactionTagFilterType implements TypeAndName {
}
}
export class TransactionQuickSaveButtonStyle implements TypeAndName {
private static readonly allInstances: TransactionQuickSaveButtonStyle[] = [];
private static readonly allInstancesByType: Record<number, TransactionQuickSaveButtonStyle> = {};
public static readonly Disabled = new TransactionQuickSaveButtonStyle(0, 'Disabled');
public static readonly BottomFixed = new TransactionQuickSaveButtonStyle(1, 'Bottom Fixed');
public static readonly BottomLeftFloating = new TransactionQuickSaveButtonStyle(2, 'Bottom Left Floating');
public static readonly BottomCenterFloating = new TransactionQuickSaveButtonStyle(3, 'Bottom Center Floating');
public static readonly BottomRightFloating = new TransactionQuickSaveButtonStyle(4, 'Bottom Right Floating');
public static readonly Default = TransactionQuickSaveButtonStyle.BottomRightFloating;
public readonly type: number;
public readonly name: string;
private constructor(type: number, name: string) {
this.type = type;
this.name = name;
TransactionQuickSaveButtonStyle.allInstances.push(this);
TransactionQuickSaveButtonStyle.allInstancesByType[type] = this;
}
public static values(): TransactionQuickSaveButtonStyle[] {
return TransactionQuickSaveButtonStyle.allInstances;
}
public static valueOf(type: number): TransactionQuickSaveButtonStyle | undefined {
return TransactionQuickSaveButtonStyle.allInstancesByType[type];
}
}
export class TransactionQuickAddButtonActionType implements TypeAndName {
private static readonly allInstances: TransactionQuickAddButtonActionType[] = [];
private static readonly allInstancesByType: Record<number, TransactionQuickAddButtonActionType> = {};