1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 10:13:31 +00:00

Separate CreditCard constants into its own class

This commit is contained in:
Daniel James Smith
2022-01-02 13:56:42 +01:00
parent 0fbeabf7a6
commit 47b40e0049
2 changed files with 42 additions and 40 deletions

View File

@@ -1,21 +1,4 @@
export class AutoFillConstants {
static readonly CardAttributes: string[] = [
"autoCompleteType",
"data-stripe",
"htmlName",
"htmlID",
"label-tag",
"placeholder",
"label-left",
"label-top",
"data-recurly",
];
static readonly CardAttributesExtended: string[] = [
...AutoFillConstants.CardAttributes,
"label-right",
];
static readonly IdentityAttributes: string[] = [
"autoCompleteType",
"data-stripe",
@@ -84,12 +67,6 @@ export class AutoFillConstants {
"search",
];
// Each index represents a language. These three arrays should all be the same length.
// 0: English, 1: Danish, 2: German/Dutch, 3: French/Spanish/Italian, 4: Russian, 5: Portuguese
static readonly MonthAbbr = ["mm", "mm", "mm", "mm", "mm", "mm"];
static readonly YearAbbrShort = ["yy", "åå", "jj", "aa", "гг", "rr"];
static readonly YearAbbrLong = ["yyyy", "åååå", "jjjj", "aa", "гггг", "rrrr"];
static readonly OperationDelays = new Map<string, number>([["buzzsprout.com", 100]]);
static readonly IsoCountries: { [id: string]: string } = {
@@ -418,3 +395,28 @@ export class AutoFillConstants {
saskatchewan: "SK",
};
}
export class CreditCardAutoFillConstants {
static readonly CardAttributes: string[] = [
"autoCompleteType",
"data-stripe",
"htmlName",
"htmlID",
"label-tag",
"placeholder",
"label-left",
"label-top",
"data-recurly",
];
static readonly CardAttributesExtended: string[] = [
...CreditCardAutoFillConstants.CardAttributes,
"label-right",
];
// Each index represents a language. These three arrays should all be the same length.
// 0: English, 1: Danish, 2: German/Dutch, 3: French/Spanish/Italian, 4: Russian, 5: Portuguese
static readonly MonthAbbr = ["mm", "mm", "mm", "mm", "mm", "mm"];
static readonly YearAbbrShort = ["yy", "åå", "jj", "aa", "гг", "rr"];
static readonly YearAbbrLong = ["yyyy", "åååå", "jjjj", "aa", "гггг", "rrrr"];
}