@axzydev/axzy_ui_system 1.8.0 → 1.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.
package/dist/index.js CHANGED
@@ -5410,6 +5410,20 @@ function ITDataTable({
5410
5410
  const isTableVirtual = virtualized && effectiveView === "table";
5411
5411
  const isStickyHeader = stickyHeader && isTableVirtual;
5412
5412
  const resolvedRowHeight = rowHeight ?? getRowHeight(size, density);
5413
+ const headRef = useRef13(null);
5414
+ const [headHeight, setHeadHeight] = useState19(0);
5415
+ useEffect9(() => {
5416
+ if (!isTableVirtual) return;
5417
+ const el = headRef.current;
5418
+ if (!el) return;
5419
+ const measure = () => setHeadHeight(el.getBoundingClientRect().height);
5420
+ measure();
5421
+ if (typeof ResizeObserver === "undefined") return;
5422
+ const ro = new ResizeObserver(measure);
5423
+ ro.observe(el);
5424
+ return () => ro.disconnect();
5425
+ }, [isTableVirtual, resolvedRowHeight]);
5426
+ const snappedMaxHeight = isTableVirtual && headHeight > 0 ? headHeight + Math.max(1, Math.floor((virtualizedMaxHeight - headHeight) / resolvedRowHeight)) * resolvedRowHeight : virtualizedMaxHeight;
5413
5427
  const columnCount = columns.length;
5414
5428
  const pinnedMeta = React7.useMemo(() => getPinnedColumnMeta(columns), [columns]);
5415
5429
  const scrollOuterClass = isTableVirtual ? "relative min-h-[200px]" : "overflow-x-auto relative min-h-[200px]";
@@ -5709,7 +5723,7 @@ function ITDataTable({
5709
5723
  },
5710
5724
  col.key
5711
5725
  )) }),
5712
- /* @__PURE__ */ jsx29("thead", { children: /* @__PURE__ */ jsx29(
5726
+ /* @__PURE__ */ jsx29("thead", { ref: headRef, children: /* @__PURE__ */ jsx29(
5713
5727
  "tr",
5714
5728
  {
5715
5729
  className: clsx27(tableHeaderRow, "dark:text-slate-200", headerSlot.className),
@@ -5775,7 +5789,10 @@ function ITDataTable({
5775
5789
  onRowClick && !isLoading && tableRowClickable,
5776
5790
  rowSlot.className
5777
5791
  ),
5778
- style: rowSlot.style,
5792
+ style: {
5793
+ ...isTableVirtual ? { height: resolvedRowHeight } : null,
5794
+ ...rowSlot.style
5795
+ },
5779
5796
  tabIndex: onRowClick && !isLoading ? 0 : void 0,
5780
5797
  onClick: onRowClick && !isLoading ? handleRowClick(row) : void 0,
5781
5798
  onKeyDown: onRowClick && !isLoading ? handleRowKeyDown(row) : void 0,
@@ -5872,7 +5889,7 @@ function ITDataTable({
5872
5889
  {
5873
5890
  ref: scrollRef,
5874
5891
  className: "overflow-x-auto overflow-y-auto",
5875
- style: { maxHeight: virtualizedMaxHeight },
5892
+ style: { maxHeight: snappedMaxHeight },
5876
5893
  children: tableEl
5877
5894
  }
5878
5895
  ) : tableEl