allaw-ui 4.9.9 → 5.0.0
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.
|
@@ -45,7 +45,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
import React, { useState } from "react";
|
|
48
|
+
import React, { useState, useEffect } from "react";
|
|
49
49
|
import styles from "./searchBar.module.css";
|
|
50
50
|
import "../../../styles/global.css";
|
|
51
51
|
import "../../../styles/icons.css";
|
|
@@ -53,6 +53,10 @@ import TinyInfo from "../typography/TinyInfo";
|
|
|
53
53
|
var SearchBar = function (_a) {
|
|
54
54
|
var _b = _a.placeholder, placeholder = _b === void 0 ? "Faites une recherche" : _b, endIcon = _a.endIcon, startIcon = _a.startIcon, _c = _a.value, controlledValue = _c === void 0 ? "" : _c, onChange = _a.onChange, _d = _a.showClear, showClear = _d === void 0 ? false : _d, _e = _a.size, size = _e === void 0 ? "normal" : _e, _f = _a.style, styleProp = _f === void 0 ? "classic" : _f, _g = _a.disableAutofill, disableAutofill = _g === void 0 ? false : _g, _h = _a.showLocate, showLocate = _h === void 0 ? false : _h, minChar = _a.minChar, _j = _a.loading, loading = _j === void 0 ? false : _j, resolveCityFromCoords = _a.resolveCityFromCoords;
|
|
55
55
|
var _k = useState(controlledValue), value = _k[0], setValue = _k[1];
|
|
56
|
+
// Synchroniser l'état interne avec la prop value (mode controlled)
|
|
57
|
+
useEffect(function () {
|
|
58
|
+
setValue(controlledValue);
|
|
59
|
+
}, [controlledValue]);
|
|
56
60
|
var _l = useState(null), locationError = _l[0], setLocationError = _l[1];
|
|
57
61
|
var handleChange = function (event) {
|
|
58
62
|
var newValue = event.target.value;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.searchBarPlaceholder {
|
|
24
|
-
color: #
|
|
24
|
+
color: #171e25;
|
|
25
25
|
font-family: "Open Sans";
|
|
26
26
|
font-size: 16px;
|
|
27
27
|
font-style: normal;
|
|
@@ -35,6 +35,11 @@
|
|
|
35
35
|
padding-left: 3px;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
.searchBarPlaceholder::placeholder {
|
|
39
|
+
color: #728ea7;
|
|
40
|
+
opacity: 0.8;
|
|
41
|
+
}
|
|
42
|
+
|
|
38
43
|
.searchBarStartIcon {
|
|
39
44
|
display: inline-flex;
|
|
40
45
|
align-items: center;
|