@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.mjs
CHANGED
|
@@ -525,6 +525,7 @@ function GoADatePicker({
|
|
|
525
525
|
mr,
|
|
526
526
|
mb,
|
|
527
527
|
ml,
|
|
528
|
+
relative,
|
|
528
529
|
onChange
|
|
529
530
|
}) {
|
|
530
531
|
const ref = useRef(null);
|
|
@@ -534,7 +535,8 @@ function GoADatePicker({
|
|
|
534
535
|
}
|
|
535
536
|
const current = ref.current;
|
|
536
537
|
const handleChange = (e) => {
|
|
537
|
-
|
|
538
|
+
const newValue = e.detail.value;
|
|
539
|
+
onChange(name || "", newValue ? new Date(newValue) : void 0);
|
|
538
540
|
};
|
|
539
541
|
current.addEventListener("_change", handleChange);
|
|
540
542
|
return () => {
|
|
@@ -546,7 +548,7 @@ function GoADatePicker({
|
|
|
546
548
|
{
|
|
547
549
|
ref,
|
|
548
550
|
name,
|
|
549
|
-
value: value == null ? void 0 : value.toISOString(),
|
|
551
|
+
value: (value == null ? void 0 : value.toISOString()) || "",
|
|
550
552
|
error,
|
|
551
553
|
disabled,
|
|
552
554
|
min: min == null ? void 0 : min.toISOString(),
|
|
@@ -555,7 +557,8 @@ function GoADatePicker({
|
|
|
555
557
|
mt,
|
|
556
558
|
mr,
|
|
557
559
|
mb,
|
|
558
|
-
ml
|
|
560
|
+
ml,
|
|
561
|
+
relative
|
|
559
562
|
}
|
|
560
563
|
);
|
|
561
564
|
}
|