allaw-ui 2.4.0 → 2.4.2
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.
|
@@ -30,11 +30,10 @@ var VerificationCodeInput = function (_a) {
|
|
|
30
30
|
}
|
|
31
31
|
}, [testError, onError]);
|
|
32
32
|
var validateAllInputs = function () {
|
|
33
|
-
var _a;
|
|
34
33
|
var fullValue = values.join("");
|
|
35
34
|
console.log("[VerificationCodeInput] Validating inputs:", fullValue);
|
|
36
35
|
if (fullValue.length === numInputs) {
|
|
37
|
-
console.log("[VerificationCodeInput] All inputs filled");
|
|
36
|
+
console.log("[VerificationCodeInput] All inputs filled, length:", fullValue.length);
|
|
38
37
|
if (testError) {
|
|
39
38
|
setError("Code de vérification invalide");
|
|
40
39
|
onError === null || onError === void 0 ? void 0 : onError("Code de vérification invalide");
|
|
@@ -44,11 +43,10 @@ var VerificationCodeInput = function (_a) {
|
|
|
44
43
|
onError === null || onError === void 0 ? void 0 : onError(null);
|
|
45
44
|
console.log("[VerificationCodeInput] Calling onComplete with:", fullValue);
|
|
46
45
|
onComplete === null || onComplete === void 0 ? void 0 : onComplete(fullValue);
|
|
47
|
-
(_a = inputRefs.current[numInputs - 1]) === null || _a === void 0 ? void 0 : _a.blur();
|
|
48
46
|
}
|
|
49
47
|
};
|
|
50
48
|
var handleInputChange = function (index, value) {
|
|
51
|
-
var _a, _b, _c
|
|
49
|
+
var _a, _b, _c;
|
|
52
50
|
console.log("[VerificationCodeInput] Input ".concat(index, " changed to:"), value);
|
|
53
51
|
if (value.length > 1) {
|
|
54
52
|
var pastedChars = value.split("");
|
|
@@ -82,19 +80,19 @@ var VerificationCodeInput = function (_a) {
|
|
|
82
80
|
var newValues = __spreadArray([], values, true);
|
|
83
81
|
newValues[index] = value;
|
|
84
82
|
setValues(newValues);
|
|
85
|
-
|
|
83
|
+
var fullValue = newValues.join("");
|
|
84
|
+
console.log("[VerificationCodeInput] New values:", fullValue);
|
|
85
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(fullValue);
|
|
86
86
|
if (value === "")
|
|
87
87
|
return;
|
|
88
88
|
setError("");
|
|
89
89
|
onError === null || onError === void 0 ? void 0 : onError(null);
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (index < numInputs - 1) {
|
|
93
|
-
(_c = inputRefs.current[index + 1]) === null || _c === void 0 ? void 0 : _c.focus();
|
|
94
|
-
}
|
|
95
|
-
else if (index === numInputs - 1 && value !== "") {
|
|
90
|
+
if (index === numInputs - 1 && value !== "") {
|
|
91
|
+
console.log("[VerificationCodeInput] Last input filled, validating...");
|
|
96
92
|
validateAllInputs();
|
|
97
|
-
|
|
93
|
+
}
|
|
94
|
+
else if (index < numInputs - 1) {
|
|
95
|
+
(_c = inputRefs.current[index + 1]) === null || _c === void 0 ? void 0 : _c.focus();
|
|
98
96
|
}
|
|
99
97
|
};
|
|
100
98
|
var handleKeyDown = function (index, e) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import styles from "./BlogCard.module.css";
|
|
3
|
-
import Link from "next/link";
|
|
4
3
|
import TinyInfo from "../../atoms/typography/TinyInfo";
|
|
5
4
|
import Image from "next/image";
|
|
6
5
|
var BlogTopSection = function (_a) {
|
|
@@ -26,7 +25,7 @@ var BlogCard = function (_a) {
|
|
|
26
25
|
var articleUrl = _a.articleUrl, imageUrl = _a.imageUrl, tags = _a.tags, date = _a.date, title = _a.title, description = _a.description, _b = _a.preview, preview = _b === void 0 ? false : _b, onClick = _a.onClick;
|
|
27
26
|
return (React.createElement(React.Fragment, null, onClick ? (React.createElement("button", { className: styles.blogContainer, onClick: function () { return onClick && onClick(); } },
|
|
28
27
|
!preview && React.createElement(BlogTopSection, { imageUrl: imageUrl, title: title }),
|
|
29
|
-
React.createElement(BlogBottomSection, { tags: tags, date: date, title: title, description: description }))) : (React.createElement(
|
|
28
|
+
React.createElement(BlogBottomSection, { tags: tags, date: date, title: title, description: description }))) : (React.createElement("a", { href: articleUrl, className: styles.blogContainer },
|
|
30
29
|
!preview && React.createElement(BlogTopSection, { imageUrl: imageUrl, title: title }),
|
|
31
30
|
React.createElement(BlogBottomSection, { tags: tags, date: date, title: title, description: description })))));
|
|
32
31
|
};
|