allaw-ui 1.0.58 → 1.0.60

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.
@@ -54,6 +54,9 @@ var Datepicker = function (_a) {
54
54
  var buttonRef = useRef(null);
55
55
  var calendarRef = useRef(null);
56
56
  var _g = useState("bottom"), placement = _g[0], setPlacement = _g[1];
57
+ useEffect(function () {
58
+ setSelectedDate(value);
59
+ }, [value]);
57
60
  var updatePosition = function () {
58
61
  if (buttonRef.current) {
59
62
  var rect = buttonRef.current.getBoundingClientRect();
@@ -96,8 +99,12 @@ var Datepicker = function (_a) {
96
99
  };
97
100
  }, [isOpen]);
98
101
  var handleDateChange = function (date) {
102
+ console.log("Avant l'appel à onChange :", date);
99
103
  setSelectedDate(date || undefined);
100
- onChange === null || onChange === void 0 ? void 0 : onChange(date || undefined);
104
+ if (date) {
105
+ onChange === null || onChange === void 0 ? void 0 : onChange(date);
106
+ }
107
+ console.log("Après l'appel à onChange :", date);
101
108
  setIsOpen(false);
102
109
  };
103
110
  var handleClickOutside = function (event) {
@@ -5,6 +5,7 @@ import Paragraph from "../../atoms/typography/Paragraph";
5
5
  import Datepicker from "../../atoms/datepickers/Datepicker";
6
6
  var DatepickerForm = function (_a) {
7
7
  var value = _a.value, onChange = _a.onChange, _b = _a.placeholder, placeholder = _b === void 0 ? "Sélectionner une date" : _b, text = _a.text, _c = _a.variant, variant = _c === void 0 ? "medium" : _c, _d = _a.color, color = _d === void 0 ? "noir" : _d, _e = _a.yearDropdownItemNumber, yearDropdownItemNumber = _e === void 0 ? 10 : _e, maxDaysInPast = _a.maxDaysInPast, minDate = _a.minDate;
8
+ console.log("Valeur reçue dans DatepickerForm :", value);
8
9
  return (React.createElement("div", { className: "datepicker-form-wrapper" },
9
10
  text && React.createElement(Paragraph, { text: text, variant: variant, color: color }),
10
11
  React.createElement(Datepicker, { value: value || undefined, onChange: onChange, placeholder: placeholder, yearDropdownItemNumber: yearDropdownItemNumber, maxDaysInPast: maxDaysInPast, minDate: minDate })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "1.0.58",
3
+ "version": "1.0.60",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",