@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.cjs CHANGED
@@ -5549,6 +5549,20 @@ function ITDataTable({
5549
5549
  const isTableVirtual = virtualized && effectiveView === "table";
5550
5550
  const isStickyHeader = stickyHeader && isTableVirtual;
5551
5551
  const resolvedRowHeight = rowHeight ?? getRowHeight(size, density);
5552
+ const headRef = (0, import_react29.useRef)(null);
5553
+ const [headHeight, setHeadHeight] = (0, import_react29.useState)(0);
5554
+ (0, import_react29.useEffect)(() => {
5555
+ if (!isTableVirtual) return;
5556
+ const el = headRef.current;
5557
+ if (!el) return;
5558
+ const measure = () => setHeadHeight(el.getBoundingClientRect().height);
5559
+ measure();
5560
+ if (typeof ResizeObserver === "undefined") return;
5561
+ const ro = new ResizeObserver(measure);
5562
+ ro.observe(el);
5563
+ return () => ro.disconnect();
5564
+ }, [isTableVirtual, resolvedRowHeight]);
5565
+ const snappedMaxHeight = isTableVirtual && headHeight > 0 ? headHeight + Math.max(1, Math.floor((virtualizedMaxHeight - headHeight) / resolvedRowHeight)) * resolvedRowHeight : virtualizedMaxHeight;
5552
5566
  const columnCount = columns.length;
5553
5567
  const pinnedMeta = import_react29.default.useMemo(() => getPinnedColumnMeta(columns), [columns]);
5554
5568
  const scrollOuterClass = isTableVirtual ? "relative min-h-[200px]" : "overflow-x-auto relative min-h-[200px]";
@@ -5848,7 +5862,7 @@ function ITDataTable({
5848
5862
  },
5849
5863
  col.key
5850
5864
  )) }),
5851
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5865
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("thead", { ref: headRef, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5852
5866
  "tr",
5853
5867
  {
5854
5868
  className: (0, import_clsx27.default)(tableHeaderRow, "dark:text-slate-200", headerSlot.className),
@@ -5914,7 +5928,10 @@ function ITDataTable({
5914
5928
  onRowClick && !isLoading && tableRowClickable,
5915
5929
  rowSlot.className
5916
5930
  ),
5917
- style: rowSlot.style,
5931
+ style: {
5932
+ ...isTableVirtual ? { height: resolvedRowHeight } : null,
5933
+ ...rowSlot.style
5934
+ },
5918
5935
  tabIndex: onRowClick && !isLoading ? 0 : void 0,
5919
5936
  onClick: onRowClick && !isLoading ? handleRowClick(row) : void 0,
5920
5937
  onKeyDown: onRowClick && !isLoading ? handleRowKeyDown(row) : void 0,
@@ -6011,7 +6028,7 @@ function ITDataTable({
6011
6028
  {
6012
6029
  ref: scrollRef,
6013
6030
  className: "overflow-x-auto overflow-y-auto",
6014
- style: { maxHeight: virtualizedMaxHeight },
6031
+ style: { maxHeight: snappedMaxHeight },
6015
6032
  children: tableEl
6016
6033
  }
6017
6034
  ) : tableEl