opus-toolkit-components 0.7.9 → 0.8.1
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.
|
@@ -3690,7 +3690,7 @@ const Input = /*#__PURE__*/(0,external_react_.forwardRef)((_ref, ref) => {
|
|
|
3690
3690
|
className: iconClasses
|
|
3691
3691
|
})), /*#__PURE__*/external_react_default().createElement("input", {
|
|
3692
3692
|
ref: ref,
|
|
3693
|
-
className: "w-full ".concat(Icon ? iconPosition === 'left' ? 'pl-10' : 'pr-10' : '', " bg-[--color-input-bg] border-none focus:ring-0 focus:outline-none rounded-md
|
|
3693
|
+
className: "w-full ".concat(Icon ? iconPosition === 'left' ? 'pl-10' : 'pr-10' : '', " bg-[--color-input-bg] border-none focus:ring-0 focus:outline-none rounded-md py-2 px-3"),
|
|
3694
3694
|
type: type,
|
|
3695
3695
|
name: name,
|
|
3696
3696
|
placeholder: placeholder,
|
|
@@ -3820,10 +3820,25 @@ function DatePicker(_ref) {
|
|
|
3820
3820
|
setSelectedDate(normalizedInitialDate);
|
|
3821
3821
|
}
|
|
3822
3822
|
}, [value, initialDate]);
|
|
3823
|
+
(0,external_react_.useEffect)(() => {
|
|
3824
|
+
if (value !== undefined && value !== selectedDate) {
|
|
3825
|
+
setSelectedDate(value); // Sync selectedDate when value prop changes
|
|
3826
|
+
}
|
|
3827
|
+
}, [value, selectedDate]);
|
|
3823
3828
|
const handleDateChange = e => {
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3829
|
+
const rawValue = e.target.value; // yyyy-MM-dd
|
|
3830
|
+
setSelectedDate(rawValue);
|
|
3831
|
+
if (onChange && rawValue) {
|
|
3832
|
+
const [year, month, day] = rawValue.split('-');
|
|
3833
|
+
const formattedValue = "".concat(day, "/").concat(month, "/").concat(year);
|
|
3834
|
+
onChange({
|
|
3835
|
+
target: {
|
|
3836
|
+
name,
|
|
3837
|
+
value: formattedValue,
|
|
3838
|
+
// dd/MM/yyyy
|
|
3839
|
+
rawValue // yyyy-MM-dd
|
|
3840
|
+
}
|
|
3841
|
+
});
|
|
3827
3842
|
}
|
|
3828
3843
|
};
|
|
3829
3844
|
const handleIconClick = () => {
|
|
@@ -3886,6 +3901,7 @@ const RadioButton = _ref => {
|
|
|
3886
3901
|
label: 'Other'
|
|
3887
3902
|
}],
|
|
3888
3903
|
name,
|
|
3904
|
+
value,
|
|
3889
3905
|
onChange,
|
|
3890
3906
|
className = '',
|
|
3891
3907
|
tabIndex = '',
|
|
@@ -3896,10 +3912,9 @@ const RadioButton = _ref => {
|
|
|
3896
3912
|
dataCy,
|
|
3897
3913
|
disabled = false
|
|
3898
3914
|
} = _ref;
|
|
3899
|
-
const
|
|
3915
|
+
const selectedValue = value;
|
|
3900
3916
|
const handleChange = item => {
|
|
3901
3917
|
if (disabled) return;
|
|
3902
|
-
setSelectedValue(item.value);
|
|
3903
3918
|
const event = {
|
|
3904
3919
|
target: {
|
|
3905
3920
|
name: name,
|
|
@@ -12538,4 +12553,4 @@ const Pill = _ref => {
|
|
|
12538
12553
|
/******/ })()
|
|
12539
12554
|
;
|
|
12540
12555
|
});
|
|
12541
|
-
//# sourceMappingURL=main.
|
|
12556
|
+
//# sourceMappingURL=main.3e2d4fa6c0b568552cc7.js.map
|