@helpwave/hightide 0.5.2 → 0.5.4
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/dist/index.js +20 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7641,7 +7641,14 @@ var DayPicker = ({
|
|
|
7641
7641
|
"border-transparent": !(isToday && markToday)
|
|
7642
7642
|
}
|
|
7643
7643
|
),
|
|
7644
|
-
onClick: () => onChange?.(
|
|
7644
|
+
onClick: () => onChange?.(new Date(
|
|
7645
|
+
date.getFullYear(),
|
|
7646
|
+
date.getMonth(),
|
|
7647
|
+
date.getDate(),
|
|
7648
|
+
selected.getHours(),
|
|
7649
|
+
selected.getMinutes(),
|
|
7650
|
+
selected.getSeconds()
|
|
7651
|
+
)),
|
|
7645
7652
|
children: date.getDate()
|
|
7646
7653
|
},
|
|
7647
7654
|
date.getDate()
|
|
@@ -9046,8 +9053,11 @@ function useFloatingElement({
|
|
|
9046
9053
|
const [style, setStyle] = (0, import_react19.useState)();
|
|
9047
9054
|
const isMounted = useIsMounted();
|
|
9048
9055
|
const calculate = (0, import_react19.useCallback)(() => {
|
|
9049
|
-
const containerRect = containerRef.current
|
|
9050
|
-
|
|
9056
|
+
const containerRect = containerRef.current?.getBoundingClientRect();
|
|
9057
|
+
if (!containerRect) {
|
|
9058
|
+
return;
|
|
9059
|
+
}
|
|
9060
|
+
const windowRect = windowRef?.current?.getBoundingClientRect() ?? {
|
|
9051
9061
|
top: 0,
|
|
9052
9062
|
bottom: window.innerHeight,
|
|
9053
9063
|
left: 0,
|
|
@@ -9083,6 +9093,9 @@ function useFloatingElement({
|
|
|
9083
9093
|
}
|
|
9084
9094
|
}, [calculate, active, isMounted, height, width]);
|
|
9085
9095
|
(0, import_react19.useEffect)(() => {
|
|
9096
|
+
if (!containerRef.current && active) {
|
|
9097
|
+
return;
|
|
9098
|
+
}
|
|
9086
9099
|
window.addEventListener("resize", calculate);
|
|
9087
9100
|
let timeout;
|
|
9088
9101
|
if (isPolling) {
|
|
@@ -9094,7 +9107,7 @@ function useFloatingElement({
|
|
|
9094
9107
|
clearInterval(timeout);
|
|
9095
9108
|
}
|
|
9096
9109
|
};
|
|
9097
|
-
}, [calculate, isPolling, pollingInterval]);
|
|
9110
|
+
}, [active, calculate, containerRef, isPolling, pollingInterval]);
|
|
9098
9111
|
return style;
|
|
9099
9112
|
}
|
|
9100
9113
|
|
|
@@ -14020,7 +14033,7 @@ var DateTimeInput = ({
|
|
|
14020
14033
|
Input,
|
|
14021
14034
|
{
|
|
14022
14035
|
...cleanInputProps,
|
|
14023
|
-
placeholder: translation("
|
|
14036
|
+
placeholder: translation("clickToSelect"),
|
|
14024
14037
|
value: date ? DateUtils.formatAbsolute(date, locale, mode === "dateTime") : "",
|
|
14025
14038
|
onClick: (event) => {
|
|
14026
14039
|
setIsOpen(true);
|
|
@@ -14100,7 +14113,7 @@ var DateTimeInputUncontrolled = ({
|
|
|
14100
14113
|
date: initialDate,
|
|
14101
14114
|
...props
|
|
14102
14115
|
}) => {
|
|
14103
|
-
const [date, setDate] = useOverwritableState(
|
|
14116
|
+
const [date, setDate] = useOverwritableState(initialDate);
|
|
14104
14117
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14105
14118
|
DateTimeInput,
|
|
14106
14119
|
{
|
|
@@ -14111,7 +14124,7 @@ var DateTimeInputUncontrolled = ({
|
|
|
14111
14124
|
props.onValueChange?.(newDate);
|
|
14112
14125
|
},
|
|
14113
14126
|
onRemove: () => {
|
|
14114
|
-
setDate(
|
|
14127
|
+
setDate(void 0);
|
|
14115
14128
|
props.onRemove?.();
|
|
14116
14129
|
}
|
|
14117
14130
|
}
|