@abgov/react-components 5.0.0-alpha.3 → 5.0.0-alpha.5
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.
- package/index.js +6 -3
- package/index.js.map +1 -1
- package/index.mjs +6 -3
- package/index.mjs.map +1 -1
- package/lib/date-picker/date-picker.d.ts +4 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -527,6 +527,7 @@ function GoADatePicker({
|
|
|
527
527
|
mr,
|
|
528
528
|
mb,
|
|
529
529
|
ml,
|
|
530
|
+
relative,
|
|
530
531
|
onChange
|
|
531
532
|
}) {
|
|
532
533
|
const ref = react.useRef(null);
|
|
@@ -536,7 +537,8 @@ function GoADatePicker({
|
|
|
536
537
|
}
|
|
537
538
|
const current = ref.current;
|
|
538
539
|
const handleChange = (e) => {
|
|
539
|
-
|
|
540
|
+
const newValue = e.detail.value;
|
|
541
|
+
onChange(name || "", newValue ? new Date(newValue) : void 0);
|
|
540
542
|
};
|
|
541
543
|
current.addEventListener("_change", handleChange);
|
|
542
544
|
return () => {
|
|
@@ -548,7 +550,7 @@ function GoADatePicker({
|
|
|
548
550
|
{
|
|
549
551
|
ref,
|
|
550
552
|
name,
|
|
551
|
-
value: value == null ? void 0 : value.toISOString(),
|
|
553
|
+
value: (value == null ? void 0 : value.toISOString()) || "",
|
|
552
554
|
error,
|
|
553
555
|
disabled,
|
|
554
556
|
min: min == null ? void 0 : min.toISOString(),
|
|
@@ -557,7 +559,8 @@ function GoADatePicker({
|
|
|
557
559
|
mt,
|
|
558
560
|
mr,
|
|
559
561
|
mb,
|
|
560
|
-
ml
|
|
562
|
+
ml,
|
|
563
|
+
relative
|
|
561
564
|
}
|
|
562
565
|
);
|
|
563
566
|
}
|