intelicoreact 1.1.78 → 1.1.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MASK_PRESET = void 0;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @param type: 'inputMask',
|
|
10
|
+
* @param maskPattern: 'DD.DD.DDDD',
|
|
11
|
+
* @param maskPatternPlaceholder: 'MM.DD.YYYY',
|
|
12
|
+
* @param usePatternPlaceholder: true,
|
|
13
|
+
* @param isNumericMobileKeyboard: true,
|
|
14
|
+
* @param blinkErrors: true,
|
|
15
|
+
* @param showErrors: false,
|
|
16
|
+
* @param autocomplete: 'bday',
|
|
17
|
+
* @param focusSelector: 'input',
|
|
18
|
+
*/
|
|
19
|
+
var DATE_PRESET = {
|
|
20
|
+
type: 'inputMask',
|
|
21
|
+
maskPattern: 'DD.DD.DDDD',
|
|
22
|
+
maskPatternPlaceholder: 'MM.DD.YYYY',
|
|
23
|
+
usePatternPlaceholder: true,
|
|
24
|
+
isNumericMobileKeyboard: true,
|
|
25
|
+
blinkErrors: true,
|
|
26
|
+
showErrors: false,
|
|
27
|
+
autocomplete: 'bday',
|
|
28
|
+
focusSelector: 'input'
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @param type: 'inputMask',
|
|
32
|
+
* @param maskPattern: 'DDDDD',
|
|
33
|
+
* @param maskPlaceholder: 'X',
|
|
34
|
+
* @param isNumericMobileKeyboard: true,
|
|
35
|
+
* @param blinkErrors: true,
|
|
36
|
+
* @param showErrors: false,
|
|
37
|
+
* @param focusSelector: 'input',
|
|
38
|
+
* @param autocomplete: 'postal-code',
|
|
39
|
+
* @param rules: 'fieldZip'
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
var ZIP_PRESET = {
|
|
43
|
+
type: 'inputMask',
|
|
44
|
+
focusSelector: 'input',
|
|
45
|
+
maskPattern: 'DDDDD',
|
|
46
|
+
maskPlaceholder: 'X',
|
|
47
|
+
isNumericMobileKeyboard: true,
|
|
48
|
+
blinkErrors: true,
|
|
49
|
+
showErrors: false,
|
|
50
|
+
autocomplete: 'postal-code',
|
|
51
|
+
rules: 'fieldZip'
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* @param type: 'inputMask',
|
|
55
|
+
* @param maskPattern: 'DDDDDDDDD',
|
|
56
|
+
* @param maskPlaceholder: 'X',
|
|
57
|
+
* @param isNumericMobileKeyboard: true,
|
|
58
|
+
* @param blinkErrors: true,
|
|
59
|
+
* @param showErrors: false,
|
|
60
|
+
* @param focusSelector: 'input',
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
var SSN_PRESET = {
|
|
64
|
+
type: 'inputMask',
|
|
65
|
+
maskPattern: 'DDDDDDDDD',
|
|
66
|
+
maskPlaceholder: 'X',
|
|
67
|
+
focusSelector: 'input',
|
|
68
|
+
isNumericMobileKeyboard: true,
|
|
69
|
+
blinkErrors: true,
|
|
70
|
+
showErrors: false
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* @param type: 'inputMask',
|
|
74
|
+
* @param maskPattern: 'DDD-DDD-DDDD',
|
|
75
|
+
* @param maskPlaceholder: 'X',
|
|
76
|
+
* @param isNumericMobileKeyboard: true,
|
|
77
|
+
* @param blinkErrors: true,
|
|
78
|
+
* @param showErrors: false,
|
|
79
|
+
* @param focusSelector: 'input',
|
|
80
|
+
* @param autocomplete: 'tel-national',
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
var MOBILE_PHONE_PRESET = {
|
|
84
|
+
type: 'inputMask',
|
|
85
|
+
maskPattern: 'DDD-DDD-DDDD',
|
|
86
|
+
maskPlaceholder: 'X',
|
|
87
|
+
focusSelector: 'input',
|
|
88
|
+
isNumericMobileKeyboard: true,
|
|
89
|
+
blinkErrors: true,
|
|
90
|
+
showErrors: false,
|
|
91
|
+
autocomplete: 'tel-national'
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* @param type: 'inputMask3',
|
|
95
|
+
* @param maskPattern: 'DDDD',
|
|
96
|
+
* @param maskPlaceholder: 'X',
|
|
97
|
+
* @param isNumericMobileKeyboard: true,
|
|
98
|
+
* @param blinkErrors: true,
|
|
99
|
+
* @param showErrors: false,
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
var SHORT_SSN_PRESET = {
|
|
103
|
+
type: 'inputMask3',
|
|
104
|
+
maskPattern: 'DDDD',
|
|
105
|
+
maskPlaceholder: 'X',
|
|
106
|
+
focusSelector: 'input',
|
|
107
|
+
isNumericMobileKeyboard: true,
|
|
108
|
+
blinkErrors: true,
|
|
109
|
+
showErrors: false
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* @param type: 'inputMask',
|
|
113
|
+
* @param maskPattern: 'DDDDDDDDD',
|
|
114
|
+
* @param maskPlaceholder: 'X',
|
|
115
|
+
* @param isNumericMobileKeyboard: true,
|
|
116
|
+
* @param blinkErrors: true,
|
|
117
|
+
* @param showErrors: false,
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
var ABA_PRESET = {
|
|
121
|
+
type: 'inputMask',
|
|
122
|
+
maskPattern: 'DDDDDDDDD',
|
|
123
|
+
maskPlaceholder: 'X',
|
|
124
|
+
isNumericMobileKeyboard: true,
|
|
125
|
+
blinkErrors: true,
|
|
126
|
+
showErrors: false
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* @param type: 'inputMask',
|
|
130
|
+
* @param maskPattern: 'MM/YY',
|
|
131
|
+
* @param maskPatternPlaceholder: 'MM/YY',
|
|
132
|
+
* @param usePatternPlaceholder: true,
|
|
133
|
+
* @param isNumericMobileKeyboard: true,
|
|
134
|
+
* @param blinkErrors: true,
|
|
135
|
+
* @param showErrors: false,
|
|
136
|
+
* @param focusSelector: 'input',
|
|
137
|
+
*/
|
|
138
|
+
|
|
139
|
+
var CC_EXPIRATION_DATE = {
|
|
140
|
+
type: 'inputMask',
|
|
141
|
+
maskPattern: 'MM/YY',
|
|
142
|
+
maskPatternPlaceholder: 'MM/YY',
|
|
143
|
+
usePatternPlaceholder: true,
|
|
144
|
+
isNumericMobileKeyboard: true,
|
|
145
|
+
blinkErrors: true,
|
|
146
|
+
showErrors: false,
|
|
147
|
+
focusSelector: 'input'
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* @param type: 'inputMask',
|
|
151
|
+
* @param maskPattern: 'DDDDDDDDDD',
|
|
152
|
+
* @param maskPlaceholder: 'X',
|
|
153
|
+
* @param isNumericMobileKeyboard: true,
|
|
154
|
+
* @param blinkErrors: true,
|
|
155
|
+
* @param showErrors: false,
|
|
156
|
+
*/
|
|
157
|
+
|
|
158
|
+
var BANK_ACCOUNT = {
|
|
159
|
+
type: 'inputMask',
|
|
160
|
+
maskPattern: 'DDDDDDDDDD',
|
|
161
|
+
maskPlaceholder: 'X',
|
|
162
|
+
isNumericMobileKeyboard: true,
|
|
163
|
+
blinkErrors: true,
|
|
164
|
+
showErrors: false
|
|
165
|
+
};
|
|
166
|
+
var MASK_PRESET = {
|
|
167
|
+
BANK_ACCOUNT: BANK_ACCOUNT,
|
|
168
|
+
CC_EXPIRATION_DATE: CC_EXPIRATION_DATE,
|
|
169
|
+
DATE_PRESET: DATE_PRESET,
|
|
170
|
+
ZIP_PRESET: ZIP_PRESET,
|
|
171
|
+
SSN_PRESET: SSN_PRESET,
|
|
172
|
+
MOBILE_PHONE_PRESET: MOBILE_PHONE_PRESET,
|
|
173
|
+
SHORT_SSN_PRESET: SHORT_SSN_PRESET,
|
|
174
|
+
ABA_PRESET: ABA_PRESET
|
|
175
|
+
};
|
|
176
|
+
exports.MASK_PRESET = MASK_PRESET;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.INPUT_PRESET = void 0;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @name fieldChangesMiddleware
|
|
10
|
+
* @description Обрабатывает входящую строку, удаляет все символы, которые не являются
|
|
11
|
+
* алфавитными, дефисами, апострофами или пробелами.
|
|
12
|
+
* Удаляет недопустимые символы в начале и конце строки.
|
|
13
|
+
*
|
|
14
|
+
* @param {string} value - Входная строка для обработки.
|
|
15
|
+
* @returns {string} - Обработанная строка.
|
|
16
|
+
*/
|
|
17
|
+
var NAME_SYMBOLS_EXCLUDER = {
|
|
18
|
+
fieldChangesMiddleware: function fieldChangesMiddleware(value) {
|
|
19
|
+
var invalidCharacters = new RegExp(/[^a-zA-Z-'`\s]/g);
|
|
20
|
+
var invalidFirstAndLastCharacters = new RegExp(/^[`\-'\s]+|[`\-'\s]+$/g);
|
|
21
|
+
var safeValue = getSafelyValue(value);
|
|
22
|
+
return safeValue.replace(invalidCharacters, '').replace(invalidFirstAndLastCharacters, '');
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* @name fieldChangesMiddleware
|
|
27
|
+
* @description Обрабатывает входную строку, удаляет все неалфавитные символы, заменяет двойные дефисы на одинарные
|
|
28
|
+
* и удаляет все дефисы в начале или конце строки.
|
|
29
|
+
* @param {string} value - входная строка для обработки
|
|
30
|
+
* @returns {string} обработанная строка
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
var ONLY_STRING_AND_DASH = {
|
|
34
|
+
fieldChangesMiddleware: function fieldChangesMiddleware(value) {
|
|
35
|
+
var nonAlphabeticAndNotSingleDash = new RegExp(/[^a-zA-Z-]|--/gi);
|
|
36
|
+
var consecutiveDashes = new RegExp(/-+/g);
|
|
37
|
+
var sanitizedInput = getSafelyValue(value);
|
|
38
|
+
return sanitizedInput.replace(nonAlphabeticAndNotSingleDash, '').replace(consecutiveDashes, '-');
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var INPUT_PRESET = {
|
|
42
|
+
NAME_SYMBOLS_EXCLUDER: NAME_SYMBOLS_EXCLUDER,
|
|
43
|
+
ONLY_STRING_AND_DASH: ONLY_STRING_AND_DASH
|
|
44
|
+
};
|
|
45
|
+
exports.INPUT_PRESET = INPUT_PRESET;
|