@ozdao/prometheus-framework 0.1.14 → 0.1.15
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth.client.cjs +7 -7
- package/dist/auth.client.js +304 -309
- package/package.json +1 -1
- package/src/modules/auth/components/pages/EnterCode.vue +44 -23
package/package.json
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
<h3 class="mn-medium">
|
22
22
|
{{ t('verifyNumberTitle') }}
|
23
23
|
</h3>
|
24
|
-
|
24
|
+
{{state.digits}}
|
25
25
|
<p class="mn-big t-transp">{{ t('instructions') }}</p>
|
26
26
|
|
27
27
|
<div class="w-100 mn-big flex-nowrap flex">
|
@@ -35,7 +35,15 @@
|
|
35
35
|
@keydown="($event) => onKeyDown($event, 0)"
|
36
36
|
class="w-100 h1 pd-small t-center bg-grey radius-small mn-r-small"
|
37
37
|
>
|
38
|
-
<input
|
38
|
+
<input
|
39
|
+
type="number"
|
40
|
+
v-model="state.digits[1]"
|
41
|
+
maxlength="1"
|
42
|
+
@input="onInput(1)"
|
43
|
+
@paste="($event) => onPaste($event, 1)"
|
44
|
+
@keydown="($event) => onKeyDown($event, 1)"
|
45
|
+
class="w-100 h1 pd-small t-center bg-grey radius-small mn-r-small"
|
46
|
+
>
|
39
47
|
<input type="number" v-model="state.digits[2]" maxlength="1" @input="onInput(2)" @paste="($event) => onPaste($event, 2)" @keydown="($event) => onKeyDown($event, 2)" class="w-100 h1 pd-small t-center bg-grey radius-small mn-r-small">
|
40
48
|
<input type="number" v-model="state.digits[3]" maxlength="1" @input="onInput(3)" @paste="($event) => onPaste($event, 3)" @keydown="($event) => onKeyDown($event, 3)" class="w-100 h1 pd-small t-center bg-grey radius-small">
|
41
49
|
</div>
|
@@ -71,15 +79,28 @@
|
|
71
79
|
});
|
72
80
|
|
73
81
|
watch(
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
82
|
+
() => state.digits[0],
|
83
|
+
(newVal) => {
|
84
|
+
console.log(String(newVal));
|
85
|
+
console.log(String(newVal).length);
|
86
|
+
|
87
|
+
if (newVal && String(newVal).length > 1) {
|
88
|
+
let newValArray = String(newVal).split('');
|
89
|
+
console.log(newValArray);
|
90
|
+
|
91
|
+
let newDigits = [...state.digits];
|
92
|
+
newValArray.forEach((digit, i) => {
|
93
|
+
console.log(i);
|
94
|
+
console.log(newDigits[i]);
|
95
|
+
console.log(digit);
|
96
|
+
newDigits[i] = digit;
|
97
|
+
});
|
98
|
+
|
99
|
+
state.digits = newDigits;
|
100
|
+
|
101
|
+
onInput(3);
|
102
|
+
}
|
81
103
|
}
|
82
|
-
}
|
83
104
|
);
|
84
105
|
|
85
106
|
const firstInput = ref(null);
|
@@ -122,20 +143,20 @@
|
|
122
143
|
}
|
123
144
|
};
|
124
145
|
|
125
|
-
const onPaste = (event, index) => {
|
126
|
-
|
127
|
-
|
146
|
+
// const onPaste = (event, index) => {
|
147
|
+
// event.preventDefault();
|
148
|
+
// const pastedData = event.clipboardData.getData('text/plain');
|
128
149
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
};
|
150
|
+
// // Проверим, что вставленный текст состоит только из 4 цифр
|
151
|
+
// if (/^\d{4}$/.test(pastedData)) {
|
152
|
+
// for (let i = 0; i < 4; i++) {
|
153
|
+
// state.digits[index + i] = pastedData[i];
|
154
|
+
// }
|
155
|
+
// onInput(index + 3); // Вызываем обработчик onInput для последнего инпута, чтобы обработать логику ввода
|
156
|
+
// } else {
|
157
|
+
// setError({ response: {data: { errorCode: "INPUT_ERROR"}}})
|
158
|
+
// }
|
159
|
+
// };
|
139
160
|
|
140
161
|
const onInput = (index) => {
|
141
162
|
const inputs = document.querySelectorAll('input');
|