@invoicebox/ui 0.1.0-alpha.241 → 0.1.0-alpha.248
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.
|
@@ -112,16 +112,22 @@ var PhoneInputLogic = exports.PhoneInputLogic = /*#__PURE__*/function () {
|
|
|
112
112
|
var result = value;
|
|
113
113
|
if (value[0] === '8') {
|
|
114
114
|
result = "7".concat(value.slice(1));
|
|
115
|
+
if (moveCaret) {
|
|
116
|
+
// когда пользователь вводит номер с "9", мы подставляем в инпут "79", но каретка не переносится после "9" - также при вставке, нужно это делать вручную
|
|
117
|
+
moveCaret(this.getCaretPositionByRusValue(result));
|
|
118
|
+
}
|
|
115
119
|
}
|
|
116
120
|
if (value.length === 10 && value[0] !== '7' && (value[0] !== '8' || this.isSupportCityRusPhoneNumber && value[0] === '8')) {
|
|
117
121
|
result = "7".concat(value);
|
|
122
|
+
if (moveCaret) {
|
|
123
|
+
moveCaret(this.getCaretPositionByRusValue(result));
|
|
124
|
+
}
|
|
118
125
|
}
|
|
119
126
|
if (value[0] === '9') {
|
|
120
127
|
result = "79".concat(value.slice(1));
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
moveCaret(this.getCaretPositionByRusValue(result));
|
|
128
|
+
if (moveCaret) {
|
|
129
|
+
moveCaret(this.getCaretPositionByRusValue(result));
|
|
130
|
+
}
|
|
125
131
|
}
|
|
126
132
|
return result;
|
|
127
133
|
}
|