@optilogic/core 1.3.1 → 1.3.2
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.cjs +21 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/data-grid/DataGrid.tsx +25 -11
package/dist/index.cjs
CHANGED
|
@@ -4846,15 +4846,25 @@ function DataGrid({
|
|
|
4846
4846
|
const [headerHeight, setHeaderHeight] = React20__namespace.useState(40);
|
|
4847
4847
|
const [hoveredCell, setHoveredCell] = React20__namespace.useState(null);
|
|
4848
4848
|
const [containerWidth, setContainerWidth] = React20__namespace.useState(0);
|
|
4849
|
-
React20__namespace.
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4849
|
+
const fillWidthObserverRef = React20__namespace.useRef(null);
|
|
4850
|
+
const parentCallbackRef = React20__namespace.useCallback(
|
|
4851
|
+
(node) => {
|
|
4852
|
+
fillWidthObserverRef.current?.disconnect();
|
|
4853
|
+
fillWidthObserverRef.current = null;
|
|
4854
|
+
parentRef.current = node;
|
|
4855
|
+
if (!fillWidth || !node) return;
|
|
4856
|
+
const observer = new ResizeObserver((entries) => {
|
|
4857
|
+
const w = entries[0]?.contentRect.width;
|
|
4858
|
+
if (w && w > 0) setContainerWidth(w);
|
|
4859
|
+
});
|
|
4860
|
+
observer.observe(node);
|
|
4861
|
+
fillWidthObserverRef.current = observer;
|
|
4862
|
+
},
|
|
4863
|
+
[fillWidth]
|
|
4864
|
+
);
|
|
4865
|
+
React20__namespace.useEffect(() => {
|
|
4866
|
+
return () => fillWidthObserverRef.current?.disconnect();
|
|
4867
|
+
}, []);
|
|
4858
4868
|
const visibleColumns = React20__namespace.useMemo(
|
|
4859
4869
|
() => columns.filter((col) => !col.hidden),
|
|
4860
4870
|
[columns]
|
|
@@ -5157,7 +5167,7 @@ function DataGrid({
|
|
|
5157
5167
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5158
5168
|
"div",
|
|
5159
5169
|
{
|
|
5160
|
-
ref:
|
|
5170
|
+
ref: parentCallbackRef,
|
|
5161
5171
|
className: "flex-1 overflow-auto bg-background relative w-full min-h-0 max-h-full",
|
|
5162
5172
|
style: { contain: "strict" },
|
|
5163
5173
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -5372,7 +5382,7 @@ function DataGrid({
|
|
|
5372
5382
|
}
|
|
5373
5383
|
)
|
|
5374
5384
|
] }) }),
|
|
5375
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { ref:
|
|
5385
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { ref: parentCallbackRef, className: "flex-1 overflow-auto min-h-0", children: [
|
|
5376
5386
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5377
5387
|
"div",
|
|
5378
5388
|
{
|