-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathoptions.ts
More file actions
243 lines (242 loc) · 7.21 KB
/
Copy pathoptions.ts
File metadata and controls
243 lines (242 loc) · 7.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
export interface Options {
backgroundImage?: string | string[];
MediaAttribution?: boolean;
applePay?: boolean;
CapitalizeFields?: boolean;
ClickToExpand?: boolean;
CurrencySymbol?: string;
CurrencyCode?: string;
AddCurrencySymbol?: boolean;
CurrencySeparator?: string; // Deprecated
ThousandsSeparator?: string;
DecimalSeparator?: string;
DecimalPlaces?: number;
MinAmount?: number;
MaxAmount?: number;
MinAmountMessage?: string;
MaxAmountMessage?: string;
UseAmountValidatorFromEN?: boolean;
SkipToMainContentLink?: boolean;
SrcDefer?: boolean;
NeverBounceAPI?: string | null;
NeverBounceDateField?: string | null;
NeverBounceDateFormat?: string;
NeverBounceStatusField?: string | null;
NeverBounceTimeout?: number | null;
FreshAddress?:
| false
| {
dateField?: string;
dateFieldFormat?: string;
statusField?: string;
messageField?: string;
};
ProgressBar?: boolean | null;
AutoYear?: boolean;
TranslateFields?: boolean;
Debug?: boolean;
RegionLongFormat?: string;
RememberMe?:
| boolean
| {
remoteUrl?: string;
cookieName?: string;
cookieExpirationDays?: number;
fieldNames?: string[];
fieldDonationAmountRadioName?: string;
fieldDonationAmountOtherName?: string;
fieldDonationRecurrPayRadioName?: string;
fieldDonationAmountOtherCheckboxID?: string;
fieldOptInSelectorTarget?: string;
fieldOptInSelectorTargetLocation?: string;
fieldClearSelectorTarget?: string;
fieldClearSelectorTargetLocation?: string;
checked?: boolean;
};
TidyContact?:
| false
| {
cid?: string; // Client ID
record_field?: string; // TidyContact Record
date_field?: string; // TidyContact Date
status_field?: string; // TidyContact Status
countries?: string[]; // Country that is allowed to use the API, if empty, all countries are allowed. You can use more than one country by separating them with a comma.
country_fallback?: string; // Fallback country if the country field is not found.
us_zip_divider?: string; // The divider used in US zip codes.
address_enable?: boolean; // Enable address fields (true by default)
address_fields?: {
address1: string; // Address Field 1
address2: string; // Address Field 2
address3: string; // Address Field 3 - This is only used for field creation
city: string; // City field
region: string; // State field
postalCode: string; // Zipcode field
country: string; // Country field
phone: string; // Phone field
};
phone_enable?: boolean; // Enable phone field
phone_flags?: boolean; // Phone flags
phone_country_from_ip?: boolean; // Phone country from IP
phone_preferred_countries?: string[]; // Prioritize some countries on the list
phone_record_field?: string; // TidyContact Record
phone_date_field?: string; // TidyContact Date
phone_status_field?: string; // TidyContact Status
};
MobileCTA?: false | { pageType: string; label: string }[];
PageLayouts?: string[];
CountryDisable?: string[];
Placeholders?: false | { [key: string]: string };
ENValidators?: boolean;
// CustomCurrency is either false or an object with the following properties:
// label: string;
// default: object[];
// countries: object[];
CustomCurrency?:
| false
| {
label?: string;
default: { [key: string]: string };
countries?: { [key: string]: { [key: string]: string } };
};
VGS?:
| false
| {
"transaction.ccnumber"?: {
showCardIcon?: boolean | object;
css?: {
[key: string]: string | object;
};
icons?: {
[key: string]: string;
};
ariaLabel?: string;
placeholder?: string;
validCardBrands?:
| {
type: string;
}[]
| null;
};
"transaction.ccvv"?: {
showCardIcon?: boolean | object;
css?: {
[key: string]: string | object;
};
ariaLabel?: string;
placeholder?: string;
hideValue?: boolean;
};
"transaction.ccexpire"?: {
css?: {
[key: string]: string | object;
};
placeholder?: string;
yearLength?: number;
};
};
PostalCodeValidator?: boolean;
CountryRedirect?: false | { [key: string]: string };
WelcomeBack?:
| false
| {
welcomeBackMessage: {
display: boolean;
title: string;
editText: string;
anchor: string;
placement: "beforebegin" | "afterbegin" | "beforeend" | "afterend";
};
personalDetailsSummary: {
display: boolean;
title: string;
editText: string;
anchor: string;
placement: "beforebegin" | "afterbegin" | "beforeend" | "afterend";
};
};
OptInLadder?:
| false
| {
iframeUrl: string;
placementQuerySelector?: string | null;
excludePageIDs?: string[];
};
PreferredPaymentMethod?:
| false
| {
preferredPaymentMethodField?: string;
defaultPaymentMethod?: string[];
};
// CustomPremium filters premium gifts per frequency based on minimum amounts
// Supports two shapes per frequency:
// - Flat map: { 3759: 10, 3760: 25 }
// - Object with products/default: { products: { 3759: 10 }, default: 3759 }
CustomPremium?:
| false
| {
[frequency: string]:
| {
products?: { [productId: string]: number };
default?: number | string;
} & { [productId: string]: number };
};
onLoad?: () => void;
onResize?: () => void;
onSubmit?: () => void;
onError?: () => void;
onValidate?: () => void;
}
export const OptionsDefaults: Options = {
backgroundImage: "",
MediaAttribution: true,
applePay: false,
CapitalizeFields: false,
ClickToExpand: true,
CurrencySymbol: "$",
CurrencyCode: "USD",
AddCurrencySymbol: true,
ThousandsSeparator: "",
DecimalSeparator: ".",
DecimalPlaces: 2,
MinAmount: 1,
MaxAmount: 100000,
MinAmountMessage: "Amount must be at least $1",
MaxAmountMessage: "Amount must be less than $100,000",
UseAmountValidatorFromEN: false,
SkipToMainContentLink: true,
SrcDefer: true,
NeverBounceAPI: null,
NeverBounceDateField: null,
NeverBounceStatusField: null,
NeverBounceDateFormat: "MM/DD/YYYY",
NeverBounceTimeout: 10000,
FreshAddress: false,
ProgressBar: false,
AutoYear: false,
TranslateFields: true,
Debug: false,
RememberMe: false,
TidyContact: false,
RegionLongFormat: "",
CountryDisable: [],
Placeholders: false,
ENValidators: false,
MobileCTA: false,
CustomCurrency: false,
CustomPremium: false,
VGS: false,
PostalCodeValidator: false,
CountryRedirect: false,
WelcomeBack: false,
OptInLadder: false,
PreferredPaymentMethod: false,
PageLayouts: [
"leftleft1col",
"centerleft1col",
"centercenter1col",
"centercenter2col",
"centerright1col",
"rightright1col",
"none",
],
};