mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 16:07:33 +08:00
migrate to typescript
This commit is contained in:
@@ -1,80 +0,0 @@
|
||||
const allAccountCategories = {
|
||||
Cash: {
|
||||
id: 1,
|
||||
name: 'Cash',
|
||||
defaultAccountIconId: '1'
|
||||
},
|
||||
CheckingAccount: {
|
||||
id: 2,
|
||||
name: 'Checking Account',
|
||||
defaultAccountIconId: '100'
|
||||
},
|
||||
SavingsAccount: {
|
||||
id: 8,
|
||||
name: 'Savings Account',
|
||||
defaultAccountIconId: '100'
|
||||
},
|
||||
CreditCard: {
|
||||
id: 3,
|
||||
name: 'Credit Card',
|
||||
defaultAccountIconId: '100'
|
||||
},
|
||||
VirtualAccount: {
|
||||
id: 4,
|
||||
name: 'Virtual Account',
|
||||
defaultAccountIconId: '500'
|
||||
},
|
||||
DebtAccount: {
|
||||
id: 5,
|
||||
name: 'Debt Account',
|
||||
defaultAccountIconId: '600'
|
||||
},
|
||||
Receivables: {
|
||||
id: 6,
|
||||
name: 'Receivables',
|
||||
defaultAccountIconId: '700'
|
||||
},
|
||||
CertificatePfDeposit: {
|
||||
id: 9,
|
||||
name: 'Certificate of Deposit',
|
||||
defaultAccountIconId: '110'
|
||||
},
|
||||
InvestmentAccount: {
|
||||
id: 7,
|
||||
name: 'Investment Account',
|
||||
defaultAccountIconId: '800'
|
||||
}
|
||||
};
|
||||
|
||||
const allAccountCategoriesArray = [
|
||||
allAccountCategories.Cash,
|
||||
allAccountCategories.CheckingAccount,
|
||||
allAccountCategories.SavingsAccount,
|
||||
allAccountCategories.CreditCard,
|
||||
allAccountCategories.VirtualAccount,
|
||||
allAccountCategories.DebtAccount,
|
||||
allAccountCategories.Receivables,
|
||||
allAccountCategories.CertificatePfDeposit,
|
||||
allAccountCategories.InvestmentAccount
|
||||
];
|
||||
const allAccountTypes = {
|
||||
SingleAccount: 1,
|
||||
MultiSubAccounts: 2
|
||||
};
|
||||
const allAccountTypesArray = [
|
||||
{
|
||||
id: allAccountTypes.SingleAccount,
|
||||
name: 'Single Account'
|
||||
}, {
|
||||
id: allAccountTypes.MultiSubAccounts,
|
||||
name: 'Multiple Sub-accounts'
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
cashCategoryType: allAccountCategories.Cash.id,
|
||||
creditCardCategoryType: allAccountCategories.CreditCard.id,
|
||||
allCategories: allAccountCategoriesArray,
|
||||
allAccountTypes: allAccountTypes,
|
||||
allAccountTypesArray: allAccountTypesArray,
|
||||
};
|
||||
@@ -1,27 +1,45 @@
|
||||
const defaultTimeout = 10000; // 10s
|
||||
const uploadTimeout = 30000; // 30s
|
||||
const importTimeout = 1800000; // 1800s
|
||||
const baseApiUrlPath = '/api';
|
||||
const baseQrcodePath = '/qrcode';
|
||||
const baseProxyUrlPath = '/proxy';
|
||||
const baseAmapApiProxyUrlPath = '/_AMapService';
|
||||
const apiNotFoundErrorCode = 100001;
|
||||
const validatorErrorCode = 200000;
|
||||
const userEmailNotVerifiedErrorCode = 201020;
|
||||
const transactionCannotCreateInThisTimeErrorCode = 205017;
|
||||
const transactionCannotModifyInThisTimeErrorCode = 205018;
|
||||
const transactionPictureNotFoundErrorCode = 211001;
|
||||
const googleMapJavascriptUrl = 'https://maps.googleapis.com/maps/api/js';
|
||||
const baiduMapJavascriptUrl = 'https://api.map.baidu.com/api?v=3.0';
|
||||
const amapJavascriptUrl = 'https://webapi.amap.com/maps?v=2.0';
|
||||
export const BASE_API_URL_PATH: string = '/api';
|
||||
export const BASE_QRCODE_PATH: string = '/qrcode';
|
||||
export const BASE_PROXY_URL_PATH: string = '/proxy';
|
||||
export const BASE_AMAP_API_PROXY_URL_PATH: string = '/_AMapService';
|
||||
|
||||
const specifiedApiNotFoundErrors = {
|
||||
export const DEFAULT_API_TIMEOUT: number = 10000; // 10s
|
||||
export const DEFAULT_UPLOAD_API_TIMEOUT: number = 30000; // 30s
|
||||
export const DEFAULT_IMPORT_API_TIMEOUT: number = 1800000; // 1800s
|
||||
|
||||
export const GOOGLE_MAP_JAVASCRIPT_URL: string = 'https://maps.googleapis.com/maps/api/js';
|
||||
export const BAIDU_MAP_JAVASCRIPT_URL: string = 'https://api.map.baidu.com/api?v=3.0';
|
||||
export const AMAP_JAVASCRIPT_URL: string = 'https://webapi.amap.com/maps?v=2.0';
|
||||
|
||||
export enum KnownErrorCode {
|
||||
ApiNotFound = 100001,
|
||||
ValidatorError = 200000,
|
||||
UserEmailNotVerified = 201020,
|
||||
TransactionCannotCreateInThisTime = 205017,
|
||||
TransactionCannotModifyInThisTime = 205018,
|
||||
TransactionPictureNotFound = 211001
|
||||
}
|
||||
|
||||
export interface SpecifiedApiError {
|
||||
readonly message: string;
|
||||
}
|
||||
|
||||
export const SPECIFIED_API_NOT_FOUND_ERRORS: Record<string, SpecifiedApiError> = {
|
||||
'/api/register.json': {
|
||||
message: 'User registration is disabled'
|
||||
}
|
||||
};
|
||||
|
||||
const parameterizedErrors = [
|
||||
export interface ParameterizedError {
|
||||
readonly localeKey: string;
|
||||
readonly regex: RegExp;
|
||||
readonly parameters: {
|
||||
readonly field: string;
|
||||
readonly localized: boolean;
|
||||
}[];
|
||||
}
|
||||
|
||||
export const PARAMETERIZED_ERRORS: ParameterizedError[] = [
|
||||
{
|
||||
localeKey: 'parameter invalid',
|
||||
regex: /^parameter "(\w+)" is invalid$/,
|
||||
@@ -142,24 +160,3 @@ const parameterizedErrors = [
|
||||
}]
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
defaultTimeout: defaultTimeout,
|
||||
uploadTimeout: uploadTimeout,
|
||||
importTimeout: importTimeout,
|
||||
baseApiUrlPath: baseApiUrlPath,
|
||||
baseQrcodePath: baseQrcodePath,
|
||||
baseProxyUrlPath: baseProxyUrlPath,
|
||||
baseAmapApiProxyUrlPath: baseAmapApiProxyUrlPath,
|
||||
apiNotFoundErrorCode: apiNotFoundErrorCode,
|
||||
validatorErrorCode: validatorErrorCode,
|
||||
userEmailNotVerifiedErrorCode: userEmailNotVerifiedErrorCode,
|
||||
transactionCannotCreateInThisTimeErrorCode: transactionCannotCreateInThisTimeErrorCode,
|
||||
transactionCannotModifyInThisTimeErrorCode: transactionCannotModifyInThisTimeErrorCode,
|
||||
transactionPictureNotFoundErrorCode: transactionPictureNotFoundErrorCode,
|
||||
specifiedApiNotFoundErrors: specifiedApiNotFoundErrors,
|
||||
parameterizedErrors: parameterizedErrors,
|
||||
googleMapJavascriptUrl: googleMapJavascriptUrl,
|
||||
baiduMapJavascriptUrl: baiduMapJavascriptUrl,
|
||||
amapJavascriptUrl: amapJavascriptUrl
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
const baseImagePath = 'img';
|
||||
const ezBookkeepingLogoPath = baseImagePath + '/ezbookkeeping-192.png';
|
||||
|
||||
export default {
|
||||
ezBookkeepingLogoPath: ezBookkeepingLogoPath
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
const baseImagePath: string = 'img';
|
||||
export const APPLICATION_LOGO_PATH: string = baseImagePath + '/ezbookkeeping-192.png';
|
||||
@@ -1,10 +1,19 @@
|
||||
const allCategoryTypes = {
|
||||
Income: 1,
|
||||
Expense: 2,
|
||||
Transfer: 3
|
||||
};
|
||||
import type { ColorValue } from '@/core/color.ts';
|
||||
|
||||
const defaultExpenseCategories = [
|
||||
export interface PresetCategory {
|
||||
name: string;
|
||||
categoryIconId: string;
|
||||
color: ColorValue;
|
||||
subCategories: PresetSubCategory[];
|
||||
}
|
||||
|
||||
export interface PresetSubCategory {
|
||||
name: string;
|
||||
categoryIconId: string;
|
||||
color: ColorValue;
|
||||
}
|
||||
|
||||
export const DEFAULT_EXPENSE_CATEGORIES: PresetCategory[] = [
|
||||
{
|
||||
name: 'Food & Drink',
|
||||
categoryIconId: '1',
|
||||
@@ -294,7 +303,7 @@ const defaultExpenseCategories = [
|
||||
}
|
||||
];
|
||||
|
||||
const defaultIncomeCategories = [
|
||||
export const DEFAULT_INCOME_CATEGORIES: PresetCategory[] = [
|
||||
{
|
||||
name: 'Occupational Earnings',
|
||||
categoryIconId: '2000',
|
||||
@@ -373,7 +382,7 @@ const defaultIncomeCategories = [
|
||||
}
|
||||
];
|
||||
|
||||
const defaultTransferCategories = [
|
||||
export const DEFAULT_TRANSFER_CATEGORIES: PresetCategory[] = [
|
||||
{
|
||||
name: 'General Transfer',
|
||||
categoryIconId: '4000',
|
||||
@@ -447,10 +456,3 @@ const defaultTransferCategories = [
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
allCategoryTypes: allCategoryTypes,
|
||||
defaultExpenseCategories: defaultExpenseCategories,
|
||||
defaultIncomeCategories: defaultIncomeCategories,
|
||||
defaultTransferCategories: defaultTransferCategories,
|
||||
};
|
||||
@@ -1,98 +0,0 @@
|
||||
const defaultColor = '000000';
|
||||
const allAvailableColors = [
|
||||
'000000', // black
|
||||
'8e8e93', // gray
|
||||
'ff3b30', // red
|
||||
'ff2d55', // pink
|
||||
'ff6b22', // deep orange
|
||||
'ff9500', // orange
|
||||
'ffcc00', // yellow
|
||||
'cddc39', // lime
|
||||
'009688', // teal
|
||||
'4cd964', // green
|
||||
'5ac8fa', // light blue
|
||||
'2196f3', // blue
|
||||
'673ab7', // deep purple
|
||||
'9c27b0', // purple
|
||||
];
|
||||
|
||||
const defaultChartColors = [
|
||||
'cc4a66',
|
||||
'e3564a',
|
||||
'fc892c',
|
||||
'ffc349',
|
||||
'4dd291',
|
||||
'24ceb3',
|
||||
'2ab4d0',
|
||||
'065786',
|
||||
'713670',
|
||||
'8e1d51'
|
||||
];
|
||||
|
||||
const allAmountColors = {
|
||||
Green: {
|
||||
type: 1,
|
||||
name: 'Green',
|
||||
lightThemeColor: '#009688',
|
||||
darkThemeColor: '#009688',
|
||||
expenseClassName: 'expense-amount-color-green',
|
||||
incomeClassName: 'income-amount-color-green'
|
||||
},
|
||||
Red: {
|
||||
type: 2,
|
||||
name: 'Red',
|
||||
lightThemeColor: '#d43f3f',
|
||||
darkThemeColor: '#d43f3f',
|
||||
expenseClassName: 'expense-amount-color-red',
|
||||
incomeClassName: 'income-amount-color-red'
|
||||
},
|
||||
Yellow: {
|
||||
type: 3,
|
||||
name: 'Yellow',
|
||||
lightThemeColor: '#e2b60a',
|
||||
darkThemeColor: '#e2b60a',
|
||||
expenseClassName: 'expense-amount-color-yellow',
|
||||
incomeClassName: 'income-amount-color-yellow'
|
||||
},
|
||||
BlackOrWhite: {
|
||||
type: 4,
|
||||
name: 'Black or White',
|
||||
lightThemeColor: '#413935',
|
||||
darkThemeColor: '#fcf0e3',
|
||||
expenseClassName: 'expense-amount-color-blackorwhite',
|
||||
incomeClassName: 'income-amount-color-blackorwhite'
|
||||
}
|
||||
}
|
||||
|
||||
const allAmountColorsArray = [
|
||||
allAmountColors.Green,
|
||||
allAmountColors.Red,
|
||||
allAmountColors.Yellow,
|
||||
allAmountColors.BlackOrWhite
|
||||
];
|
||||
|
||||
const allAmountColorTypesMap = {
|
||||
[allAmountColors.Green.type]: allAmountColors.Green,
|
||||
[allAmountColors.Red.type]: allAmountColors.Red,
|
||||
[allAmountColors.Yellow.type]: allAmountColors.Yellow,
|
||||
[allAmountColors.BlackOrWhite.type]: allAmountColors.BlackOrWhite
|
||||
};
|
||||
|
||||
const defaultExpenseIncomeAmountValue = 0;
|
||||
const defaultExpenseAmountColor = allAmountColors.Green;
|
||||
const defaultIncomeAmountColor = allAmountColors.Red;
|
||||
|
||||
export default {
|
||||
defaultColor: defaultColor,
|
||||
allAccountColors: allAvailableColors,
|
||||
defaultAccountColor: defaultColor,
|
||||
allCategoryColors: allAvailableColors,
|
||||
defaultCategoryColor: defaultColor,
|
||||
defaultChartColors: defaultChartColors,
|
||||
allAmountColors: allAmountColors,
|
||||
allAmountColorsArray: allAmountColorsArray,
|
||||
allAmountColorTypesMap: allAmountColorTypesMap,
|
||||
defaultExpenseIncomeAmountValue: defaultExpenseIncomeAmountValue,
|
||||
defaultExpenseAmountColor: defaultExpenseAmountColor,
|
||||
defaultIncomeAmountColor: defaultIncomeAmountColor,
|
||||
};
|
||||
@@ -0,0 +1,40 @@
|
||||
import type { ColorValue } from '@/core/color.ts';
|
||||
|
||||
const defaultColor: ColorValue = '000000';
|
||||
|
||||
export const DEFAULT_ICON_COLOR: ColorValue = defaultColor;
|
||||
export const DEFAULT_ACCOUNT_COLOR: ColorValue = defaultColor;
|
||||
export const DEFAULT_CATEGORY_COLOR: ColorValue = defaultColor;
|
||||
|
||||
const allAvailableColors: ColorValue[] = [
|
||||
'000000', // black
|
||||
'8e8e93', // gray
|
||||
'ff3b30', // red
|
||||
'ff2d55', // pink
|
||||
'ff6b22', // deep orange
|
||||
'ff9500', // orange
|
||||
'ffcc00', // yellow
|
||||
'cddc39', // lime
|
||||
'009688', // teal
|
||||
'4cd964', // green
|
||||
'5ac8fa', // light blue
|
||||
'2196f3', // blue
|
||||
'673ab7', // deep purple
|
||||
'9c27b0', // purple
|
||||
];
|
||||
|
||||
export const ALL_ACCOUNT_COLORS: ColorValue[] = allAvailableColors;
|
||||
export const ALL_CATEGORY_COLORS: ColorValue[] = allAvailableColors;
|
||||
|
||||
export const DEFAULT_CHART_COLORS: ColorValue[] = [
|
||||
'cc4a66',
|
||||
'e3564a',
|
||||
'fc892c',
|
||||
'ffc349',
|
||||
'4dd291',
|
||||
'24ceb3',
|
||||
'2ab4d0',
|
||||
'065786',
|
||||
'713670',
|
||||
'8e1d51'
|
||||
];
|
||||
@@ -1,9 +1,16 @@
|
||||
const parentAccountCurrencyPlaceholder = '---';
|
||||
const defaultCurrencySymbol = '¤';
|
||||
export interface CurrencyInfo {
|
||||
readonly code: string,
|
||||
readonly fraction?: number,
|
||||
readonly symbol?: {
|
||||
readonly normal: string,
|
||||
readonly plural?: string
|
||||
},
|
||||
readonly unit: string
|
||||
}
|
||||
|
||||
// ISO 4217
|
||||
// Reference: https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/list-one.xml
|
||||
const allCurrencies = {
|
||||
export const ALL_CURRENCIES: Record<string, CurrencyInfo> = {
|
||||
'AED': { // UAE Dirham
|
||||
code: 'AED',
|
||||
fraction: 2,
|
||||
@@ -1284,177 +1291,6 @@ const allCurrencies = {
|
||||
}
|
||||
};
|
||||
|
||||
const allCurrencyDisplaySymbol = {
|
||||
None: 0,
|
||||
Symbol: 1,
|
||||
Code: 2,
|
||||
Unit: 3,
|
||||
Name: 4
|
||||
};
|
||||
|
||||
const allCurrencyDisplayLocation = {
|
||||
BeforeAmount: 0,
|
||||
AfterAmount: 1
|
||||
};
|
||||
|
||||
const allCurrencyDisplayType = {
|
||||
None: {
|
||||
type: 1,
|
||||
name: 'None',
|
||||
fraction: 2,
|
||||
symbol: allCurrencyDisplaySymbol.None,
|
||||
separator: ''
|
||||
},
|
||||
SymbolBeforeAmount: {
|
||||
type: 2,
|
||||
name: 'Currency Symbol',
|
||||
fraction: 2,
|
||||
symbol: allCurrencyDisplaySymbol.Symbol,
|
||||
location: allCurrencyDisplayLocation.BeforeAmount,
|
||||
separator: ' '
|
||||
},
|
||||
SymbolAfterAmount: {
|
||||
type: 3,
|
||||
name: 'Currency Symbol',
|
||||
fraction: 2,
|
||||
symbol: allCurrencyDisplaySymbol.Symbol,
|
||||
location: allCurrencyDisplayLocation.AfterAmount,
|
||||
separator: ' '
|
||||
},
|
||||
SymbolBeforeAmountWithoutSpace: {
|
||||
type: 4,
|
||||
name: 'Currency Symbol',
|
||||
fraction: 2,
|
||||
symbol: allCurrencyDisplaySymbol.Symbol,
|
||||
location: allCurrencyDisplayLocation.BeforeAmount,
|
||||
separator: ''
|
||||
},
|
||||
SymbolAfterAmountWithoutSpace: {
|
||||
type: 5,
|
||||
name: 'Currency Symbol',
|
||||
fraction: 2,
|
||||
symbol: allCurrencyDisplaySymbol.Symbol,
|
||||
location: allCurrencyDisplayLocation.AfterAmount,
|
||||
separator: ''
|
||||
},
|
||||
CodeBeforeAmount: {
|
||||
type: 6,
|
||||
name: 'Currency Code',
|
||||
fraction: 2,
|
||||
symbol: allCurrencyDisplaySymbol.Code,
|
||||
location: allCurrencyDisplayLocation.BeforeAmount,
|
||||
separator: ' '
|
||||
},
|
||||
CodeAfterAmount: {
|
||||
type: 7,
|
||||
name: 'Currency Code',
|
||||
fraction: 2,
|
||||
symbol: allCurrencyDisplaySymbol.Code,
|
||||
location: allCurrencyDisplayLocation.AfterAmount,
|
||||
separator: ' '
|
||||
},
|
||||
UnitBeforeAmount: {
|
||||
type: 8,
|
||||
name: 'Currency Unit',
|
||||
fraction: 2,
|
||||
symbol: allCurrencyDisplaySymbol.Unit,
|
||||
location: allCurrencyDisplayLocation.BeforeAmount,
|
||||
separator: ' '
|
||||
},
|
||||
UnitAfterAmount: {
|
||||
type: 9,
|
||||
name: 'Currency Unit',
|
||||
fraction: 2,
|
||||
symbol: allCurrencyDisplaySymbol.Unit,
|
||||
location: allCurrencyDisplayLocation.AfterAmount,
|
||||
separator: ' '
|
||||
},
|
||||
NameBeforeAmount: {
|
||||
type: 10,
|
||||
name: 'Currency Name',
|
||||
fraction: 2,
|
||||
symbol: allCurrencyDisplaySymbol.Name,
|
||||
location: allCurrencyDisplayLocation.BeforeAmount,
|
||||
separator: ' '
|
||||
},
|
||||
NameAfterAmount: {
|
||||
type: 11,
|
||||
name: 'Currency Name',
|
||||
fraction: 2,
|
||||
symbol: allCurrencyDisplaySymbol.Name,
|
||||
location: allCurrencyDisplayLocation.AfterAmount,
|
||||
separator: ' '
|
||||
}
|
||||
};
|
||||
|
||||
const allCurrencyDisplayTypeArray = [
|
||||
allCurrencyDisplayType.None,
|
||||
allCurrencyDisplayType.SymbolBeforeAmount,
|
||||
allCurrencyDisplayType.SymbolAfterAmount,
|
||||
allCurrencyDisplayType.SymbolBeforeAmountWithoutSpace,
|
||||
allCurrencyDisplayType.SymbolAfterAmountWithoutSpace,
|
||||
allCurrencyDisplayType.CodeBeforeAmount,
|
||||
allCurrencyDisplayType.CodeAfterAmount,
|
||||
allCurrencyDisplayType.UnitBeforeAmount,
|
||||
allCurrencyDisplayType.UnitAfterAmount,
|
||||
allCurrencyDisplayType.NameBeforeAmount,
|
||||
allCurrencyDisplayType.NameAfterAmount
|
||||
];
|
||||
|
||||
const allCurrencyDisplayTypeMap = {
|
||||
[allCurrencyDisplayType.None.type]: allCurrencyDisplayType.None,
|
||||
[allCurrencyDisplayType.SymbolBeforeAmount.type]: allCurrencyDisplayType.SymbolBeforeAmount,
|
||||
[allCurrencyDisplayType.SymbolAfterAmount.type]: allCurrencyDisplayType.SymbolAfterAmount,
|
||||
[allCurrencyDisplayType.SymbolBeforeAmountWithoutSpace.type]: allCurrencyDisplayType.SymbolBeforeAmountWithoutSpace,
|
||||
[allCurrencyDisplayType.SymbolAfterAmountWithoutSpace.type]: allCurrencyDisplayType.SymbolAfterAmountWithoutSpace,
|
||||
[allCurrencyDisplayType.CodeBeforeAmount.type]: allCurrencyDisplayType.CodeBeforeAmount,
|
||||
[allCurrencyDisplayType.CodeAfterAmount.type]: allCurrencyDisplayType.CodeAfterAmount,
|
||||
[allCurrencyDisplayType.UnitBeforeAmount.type]: allCurrencyDisplayType.UnitBeforeAmount,
|
||||
[allCurrencyDisplayType.UnitAfterAmount.type]: allCurrencyDisplayType.UnitAfterAmount,
|
||||
[allCurrencyDisplayType.NameBeforeAmount.type]: allCurrencyDisplayType.NameBeforeAmount,
|
||||
[allCurrencyDisplayType.NameAfterAmount.type]: allCurrencyDisplayType.NameAfterAmount
|
||||
};
|
||||
|
||||
const defaultCurrency = allCurrencies.USD.code;
|
||||
const defaultCurrencyDisplayType = allCurrencyDisplayType.SymbolBeforeAmount;
|
||||
const defaultCurrencyDisplayTypeValue = 0;
|
||||
|
||||
const allCurrencySortingTypes = {
|
||||
Name: {
|
||||
type: 0,
|
||||
name: 'Currency Name'
|
||||
},
|
||||
CurrencyCode: {
|
||||
type: 1,
|
||||
name: 'Currency Code'
|
||||
},
|
||||
ExchangeRate: {
|
||||
type: 2,
|
||||
name: 'Exchange Rate'
|
||||
}
|
||||
};
|
||||
|
||||
const allCurrencySortingTypesArray = [
|
||||
allCurrencySortingTypes.Name,
|
||||
allCurrencySortingTypes.CurrencyCode,
|
||||
allCurrencySortingTypes.ExchangeRate
|
||||
]
|
||||
|
||||
const defaultCurrencySortingType = allCurrencySortingTypes.Name.type;
|
||||
|
||||
export default {
|
||||
parentAccountCurrencyPlaceholder: parentAccountCurrencyPlaceholder,
|
||||
defaultCurrencySymbol: defaultCurrencySymbol,
|
||||
all: allCurrencies,
|
||||
defaultCurrency: defaultCurrency,
|
||||
allCurrencyDisplaySymbol: allCurrencyDisplaySymbol,
|
||||
allCurrencyDisplayLocation: allCurrencyDisplayLocation,
|
||||
allCurrencyDisplayType: allCurrencyDisplayType,
|
||||
allCurrencyDisplayTypeArray: allCurrencyDisplayTypeArray,
|
||||
allCurrencyDisplayTypeMap: allCurrencyDisplayTypeMap,
|
||||
defaultCurrencyDisplayType: defaultCurrencyDisplayType,
|
||||
defaultCurrencyDisplayTypeValue: defaultCurrencyDisplayTypeValue,
|
||||
allCurrencySortingTypes: allCurrencySortingTypes,
|
||||
allCurrencySortingTypesArray: allCurrencySortingTypesArray,
|
||||
defaultCurrencySortingType: defaultCurrencySortingType
|
||||
};
|
||||
export const DEFAULT_CURRENCY_SYMBOL: string = '¤';
|
||||
export const DEFAULT_CURRENCY_CODE: string = ALL_CURRENCIES.USD.code;
|
||||
export const PARENT_ACCOUNT_CURRENCY_PLACEHOLDER: string = '---';
|
||||
@@ -1,6 +1,23 @@
|
||||
const supportedImageExtensions = '.jpg,.jpeg,.png,.gif,.webp';
|
||||
export const SUPPORTED_IMAGE_EXTENSIONS: string = '.jpg,.jpeg,.png,.gif,.webp';
|
||||
|
||||
const supportedImportFileTypes = [
|
||||
export interface ImportFileType {
|
||||
readonly type: string;
|
||||
readonly name: string;
|
||||
readonly extensions: string;
|
||||
readonly subTypes?: ImportFileTypeSubType[];
|
||||
readonly document?: {
|
||||
readonly supportMultiLanguages: boolean | string;
|
||||
readonly anchor: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ImportFileTypeSubType {
|
||||
readonly type: string;
|
||||
readonly name: string;
|
||||
readonly extensions?: string;
|
||||
}
|
||||
|
||||
export const SUPPORTED_IMPORT_FILE_TYPES: ImportFileType[] = [
|
||||
{
|
||||
type: 'ezbookkeeping',
|
||||
name: 'ezbookkeeping Data Export File',
|
||||
@@ -120,8 +137,3 @@ const supportedImportFileTypes = [
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
supportedImageExtensions: supportedImageExtensions,
|
||||
supportedImportFileTypes: supportedImportFileTypes
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
const allFontSize = {
|
||||
Small: {
|
||||
type: 0,
|
||||
className: 'font-size-small'
|
||||
},
|
||||
Default: {
|
||||
type: 1,
|
||||
className: 'font-size-default'
|
||||
},
|
||||
Large: {
|
||||
type: 2,
|
||||
className: 'font-size-large'
|
||||
},
|
||||
XLarge: {
|
||||
type: 3,
|
||||
className: 'font-size-x-large'
|
||||
},
|
||||
XXLarge: {
|
||||
type: 4,
|
||||
className: 'font-size-xx-large'
|
||||
},
|
||||
XXXLarge: {
|
||||
type: 5,
|
||||
className: 'font-size-xxx-large'
|
||||
},
|
||||
XXXXLarge: {
|
||||
type: 6,
|
||||
className: 'font-size-xxxx-large'
|
||||
}
|
||||
}
|
||||
|
||||
const allFontSizeArray = [
|
||||
allFontSize.Small,
|
||||
allFontSize.Default,
|
||||
allFontSize.Large,
|
||||
allFontSize.XLarge,
|
||||
allFontSize.XXLarge,
|
||||
allFontSize.XXXLarge,
|
||||
allFontSize.XXXXLarge
|
||||
];
|
||||
|
||||
const defaultFontSize = allFontSize.Default;
|
||||
const fontSizePreviewClassNamePrefix = 'preview-';
|
||||
|
||||
export default {
|
||||
allFontSize: allFontSize,
|
||||
allFontSizeArray: allFontSizeArray,
|
||||
defaultFontSize: defaultFontSize,
|
||||
fontSizePreviewClassNamePrefix: fontSizePreviewClassNamePrefix
|
||||
};
|
||||
@@ -1,5 +1,8 @@
|
||||
const defaultAccountIconId = '1';
|
||||
const allAccountIcons = {
|
||||
import type { IconInfo } from '@/core/icon.ts';
|
||||
|
||||
export const DEFAULT_ACCOUNT_ICON_ID = '1';
|
||||
|
||||
export const ALL_ACCOUNT_ICONS: Record<string, IconInfo> = {
|
||||
// 1 - 99 : Cash Symbols
|
||||
'1': {
|
||||
icon: 'las la-wallet'
|
||||
@@ -158,8 +161,11 @@ const allAccountIcons = {
|
||||
}
|
||||
};
|
||||
|
||||
const defaultCategoryIconId = '1';
|
||||
const allCategoryIcons = {
|
||||
export const DEFAULT_ACCOUNT_ICON = ALL_ACCOUNT_ICONS[DEFAULT_ACCOUNT_ICON_ID];
|
||||
|
||||
export const DEFAULT_CATEGORY_ICON_ID = '1';
|
||||
|
||||
export const ALL_CATEGORY_ICONS = {
|
||||
// 1 - 99 : Expense - Food & Drink
|
||||
'1': {
|
||||
icon: 'las la-utensils'
|
||||
@@ -830,11 +836,4 @@ const allCategoryIcons = {
|
||||
}
|
||||
};
|
||||
|
||||
export default {
|
||||
allAccountIcons: allAccountIcons,
|
||||
defaultAccountIconId: defaultAccountIconId,
|
||||
defaultAccountIcon: allAccountIcons[defaultAccountIconId],
|
||||
allCategoryIcons: allCategoryIcons,
|
||||
defaultCategoryIconId: defaultCategoryIconId,
|
||||
defaultCategoryIcon: allCategoryIcons[defaultCategoryIconId]
|
||||
};
|
||||
export const DEFAULT_CATEGORY_ICON = ALL_CATEGORY_ICONS[DEFAULT_CATEGORY_ICON_ID];
|
||||
@@ -1,4 +1,23 @@
|
||||
const leafletTileSources = {
|
||||
export interface PresetLeafletTileSource {
|
||||
readonly tileUrlFormat: string;
|
||||
readonly tileUrlSubDomains: string;
|
||||
readonly tileUrlExtraParams?: PresetLeafletTileSourceExtraParam[];
|
||||
readonly annotationUrlFormat?: string;
|
||||
readonly annotationUrlSubDomains?: string;
|
||||
readonly annotationUrlExtraParams?: PresetLeafletTileSourceExtraParam[];
|
||||
readonly minZoom: number;
|
||||
readonly maxZoom: number;
|
||||
readonly defaultZoomLevel: number;
|
||||
readonly website: string;
|
||||
readonly attribution: string;
|
||||
}
|
||||
|
||||
export interface PresetLeafletTileSourceExtraParam {
|
||||
readonly paramName: string;
|
||||
readonly paramValueType: string;
|
||||
}
|
||||
|
||||
export const LEAFLET_TILE_SOURCES: Record<string, PresetLeafletTileSource> = {
|
||||
'openstreetmap': {
|
||||
tileUrlFormat: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||
tileUrlSubDomains: 'abc',
|
||||
@@ -96,7 +115,3 @@ const leafletTileSources = {
|
||||
attribution : '<a href="https://www.tianditu.gov.cn" class="external" target="_blank">天地图</a>'
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
leafletTileSources: leafletTileSources
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
const allTemplateTypes = {
|
||||
Normal: 1,
|
||||
Schedule: 2,
|
||||
};
|
||||
|
||||
const allTemplateScheduledFrequencyTypes = {
|
||||
Disabled: {
|
||||
type: 0,
|
||||
name: 'Disabled'
|
||||
},
|
||||
Weekly: {
|
||||
type: 1,
|
||||
name: 'Weekly'
|
||||
},
|
||||
Monthly: {
|
||||
type: 2,
|
||||
name: 'Monthly'
|
||||
}
|
||||
};
|
||||
|
||||
export default {
|
||||
allTemplateTypes: allTemplateTypes,
|
||||
allTemplateScheduledFrequencyTypes: allTemplateScheduledFrequencyTypes,
|
||||
}
|
||||
@@ -1,5 +1,15 @@
|
||||
export interface TimezoneInfo {
|
||||
readonly displayName: string;
|
||||
readonly timezoneName: string;
|
||||
}
|
||||
|
||||
export const UTC_TIMEZONE: TimezoneInfo = {
|
||||
displayName: 'Coordinated Universal Time',
|
||||
timezoneName: 'Etc/GMT'
|
||||
};
|
||||
|
||||
// Reference: https://github.com/nodatime/nodatime/blob/main/data/cldr/windowsZones-45.xml
|
||||
const allAvailableTimezones = [
|
||||
export const ALL_TIMEZONES: TimezoneInfo[] = [
|
||||
// UTC-12:00
|
||||
{
|
||||
displayName: 'International Date Line West',
|
||||
@@ -591,17 +601,3 @@ const allAvailableTimezones = [
|
||||
timezoneName: 'Pacific/Kiritimati'
|
||||
}
|
||||
];
|
||||
|
||||
const allTimezoneTypesUsedForStatistics = {
|
||||
ApplicationTimezone: 0,
|
||||
TransactionTimezone: 1
|
||||
};
|
||||
|
||||
const defaultTimezoneTypesUsedForStatistics = allTimezoneTypesUsedForStatistics.ApplicationTimezone;
|
||||
|
||||
export default {
|
||||
all: allAvailableTimezones,
|
||||
utcTimezoneName: 'Etc/GMT',
|
||||
allTimezoneTypesUsedForStatistics: allTimezoneTypesUsedForStatistics,
|
||||
defaultTimezoneTypesUsedForStatistics: defaultTimezoneTypesUsedForStatistics
|
||||
};
|
||||
@@ -1,72 +0,0 @@
|
||||
const allTransactionTypes = {
|
||||
ModifyBalance: 1,
|
||||
Income: 2,
|
||||
Expense: 3,
|
||||
Transfer: 4
|
||||
};
|
||||
|
||||
const allTransactionEditScopeTypes = {
|
||||
None: {
|
||||
type: 0,
|
||||
name: 'None'
|
||||
},
|
||||
All: {
|
||||
type: 1,
|
||||
name: 'All'
|
||||
},
|
||||
TodayOrLater: {
|
||||
type: 2,
|
||||
name: 'Today or later'
|
||||
},
|
||||
Recent24HoursOrLater: {
|
||||
type: 3,
|
||||
name: 'Recent 24 hours or later'
|
||||
},
|
||||
ThisWeekOrLater: {
|
||||
type: 4,
|
||||
name: 'This week or later'
|
||||
},
|
||||
ThisMonthOrLater: {
|
||||
type: 5,
|
||||
name: 'This month or later'
|
||||
},
|
||||
ThisYearOrLater: {
|
||||
type: 6,
|
||||
name: 'This year or later'
|
||||
}
|
||||
};
|
||||
|
||||
const allTransactionTagFilterTypes = {
|
||||
HasAny: {
|
||||
type: 0,
|
||||
name: 'With Any Selected Tags'
|
||||
},
|
||||
HasAll: {
|
||||
type: 1,
|
||||
name: 'With All Selected Tags'
|
||||
},
|
||||
NotHasAny: {
|
||||
type: 2,
|
||||
name: 'Without Any Selected Tags'
|
||||
},
|
||||
NotHasAll: {
|
||||
type: 3,
|
||||
name: 'Without All Selected Tags'
|
||||
}
|
||||
};
|
||||
|
||||
const defaultTransactionTagFilterType = allTransactionTagFilterTypes.HasAny;
|
||||
|
||||
const minAmountNumber = -99999999999; // -999999999.99
|
||||
const maxAmountNumber = 99999999999; // 999999999.99
|
||||
const maxPictureCount = 10;
|
||||
|
||||
export default {
|
||||
allTransactionTypes: allTransactionTypes,
|
||||
allTransactionEditScopeTypes: allTransactionEditScopeTypes,
|
||||
allTransactionTagFilterTypes: allTransactionTagFilterTypes,
|
||||
defaultTransactionTagFilterType: defaultTransactionTagFilterType,
|
||||
minAmountNumber: minAmountNumber,
|
||||
maxAmountNumber: maxAmountNumber,
|
||||
maxPictureCount: maxPictureCount,
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
export const TRANSACTION_MIN_AMOUNT: number = -99999999999; // -999999999.99
|
||||
export const TRANSACTION_MAX_AMOUNT: number = 99999999999; // 999999999.99
|
||||
export const TRANSACTION_MAX_PICTURE_COUNT: number = 10;
|
||||
Reference in New Issue
Block a user