allaw-ui 3.2.2 → 3.2.3
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.
|
@@ -34,6 +34,11 @@
|
|
|
34
34
|
transition: min-height 0.3s ease-in-out; /* Transition fluide pour les changements de hauteur */
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/* Classe pour désactiver la transition */
|
|
38
|
+
.no-transition {
|
|
39
|
+
transition: none !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
37
42
|
/* Style default */
|
|
38
43
|
.text-area-default {
|
|
39
44
|
display: flex;
|
|
@@ -89,6 +94,10 @@
|
|
|
89
94
|
transition: min-height 0.3s ease-in-out; /* Transition fluide pour les changements de hauteur */
|
|
90
95
|
}
|
|
91
96
|
|
|
97
|
+
.text-area-default .text-area-input textarea.no-transition {
|
|
98
|
+
transition: none !important;
|
|
99
|
+
}
|
|
100
|
+
|
|
92
101
|
.text-area-variation {
|
|
93
102
|
display: flex;
|
|
94
103
|
width: 100%;
|
|
@@ -129,6 +138,10 @@
|
|
|
129
138
|
transition: min-height 0.3s ease-in-out; /* Transition fluide pour les changements de hauteur */
|
|
130
139
|
}
|
|
131
140
|
|
|
141
|
+
.text-area-variation .text-area-input textarea.no-transition {
|
|
142
|
+
transition: none !important;
|
|
143
|
+
}
|
|
144
|
+
|
|
132
145
|
.text-area-variation .text-area-icon-button {
|
|
133
146
|
display: flex;
|
|
134
147
|
width: 40px;
|
|
@@ -6,10 +6,10 @@ import { commonRegex } from "../../../utils/regex";
|
|
|
6
6
|
import TinyInfo from "../typography/TinyInfo";
|
|
7
7
|
import Paragraph from "../typography/Paragraph";
|
|
8
8
|
var TextArea = forwardRef(function (_a, ref) {
|
|
9
|
-
var title = _a.title, _b = _a.style, style = _b === void 0 ? "default" : _b, placeholder = _a.placeholder, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, validate = _a.validate, onError = _a.onError, onChange = _a.onChange, propValue = _a.value, propError = _a.error, _d = _a.maxHeight, maxHeight = _d === void 0 ? 400 : _d,
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
9
|
+
var title = _a.title, _b = _a.style, style = _b === void 0 ? "default" : _b, placeholder = _a.placeholder, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, validate = _a.validate, onError = _a.onError, onChange = _a.onChange, propValue = _a.value, propError = _a.error, _d = _a.maxHeight, maxHeight = _d === void 0 ? 400 : _d, minHeight = _a.minHeight, _e = _a.variant, variant = _e === void 0 ? "medium" : _e, _f = _a.color, color = _f === void 0 ? "noir" : _f, dataCy = _a.dataCy;
|
|
10
|
+
var _g = useState(propValue || ""), value = _g[0], setValue = _g[1];
|
|
11
|
+
var _h = useState(propError || ""), error = _h[0], setError = _h[1];
|
|
12
|
+
var _j = useState(false), isTouched = _j[0], setIsTouched = _j[1];
|
|
13
13
|
var textareaRef = useRef(null);
|
|
14
14
|
useEffect(function () {
|
|
15
15
|
setValue(propValue || "");
|
|
@@ -50,6 +50,15 @@ var TextArea = forwardRef(function (_a, ref) {
|
|
|
50
50
|
setIsTouched(true);
|
|
51
51
|
validateTextArea();
|
|
52
52
|
};
|
|
53
|
+
// Préparer les styles du textarea
|
|
54
|
+
var textareaStyle = {
|
|
55
|
+
maxHeight: "".concat(maxHeight, "px"),
|
|
56
|
+
};
|
|
57
|
+
// Ajouter minHeight si spécifiée, sans transition
|
|
58
|
+
if (minHeight !== undefined) {
|
|
59
|
+
textareaStyle.minHeight = "".concat(minHeight, "px");
|
|
60
|
+
textareaStyle.transition = "none";
|
|
61
|
+
}
|
|
53
62
|
return (React.createElement("div", { className: "TextArea text-area-".concat(style) },
|
|
54
63
|
React.createElement("div", { className: "text-area-title-container" },
|
|
55
64
|
React.createElement(Paragraph, { variant: variant, color: color, text: title }),
|
|
@@ -58,10 +67,9 @@ var TextArea = forwardRef(function (_a, ref) {
|
|
|
58
67
|
"*"))),
|
|
59
68
|
React.createElement("div", { className: "text-area-container" },
|
|
60
69
|
React.createElement("div", { className: "text-area-input", "data-cy": dataCy || "text-area" },
|
|
61
|
-
React.createElement("textarea", { ref: textareaRef, placeholder: placeholder, className:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
} })),
|
|
70
|
+
React.createElement("textarea", { ref: textareaRef, placeholder: placeholder, className: minHeight !== undefined
|
|
71
|
+
? "text-area-placeholder no-transition"
|
|
72
|
+
: "text-area-placeholder", value: value, onChange: handleChange, onBlur: handleBlur, style: textareaStyle })),
|
|
65
73
|
error && isTouched && (React.createElement("div", { className: "error-message" },
|
|
66
74
|
React.createElement(TinyInfo, { variant: "medium12", color: "actions-error", text: error }))))));
|
|
67
75
|
});
|