@open-mercato/ui 0.10.1-develop.7699.1.5236fabda0 → 0.10.1-develop.7701.1.87b1ad4224
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.
|
@@ -2578,14 +2578,14 @@ function DataTableImpl({
|
|
|
2578
2578
|
const tableScrollWrapperClassName = embedded ? "isolate" : "isolate overflow-auto";
|
|
2579
2579
|
const virtualScrollRef = React.useRef(null);
|
|
2580
2580
|
const [tableScrollEl, setTableScrollEl] = React.useState(null);
|
|
2581
|
-
const [
|
|
2581
|
+
const [scrollViewportWidth, setScrollViewportWidth] = React.useState(null);
|
|
2582
2582
|
const setTableScrollWrapperRef = React.useCallback((node) => {
|
|
2583
2583
|
setTableScrollEl(node);
|
|
2584
2584
|
virtualScrollRef.current = node;
|
|
2585
2585
|
}, []);
|
|
2586
2586
|
React.useEffect(() => {
|
|
2587
2587
|
if (!tableScrollEl || typeof ResizeObserver === "undefined") return;
|
|
2588
|
-
const update = () =>
|
|
2588
|
+
const update = () => setScrollViewportWidth(tableScrollEl.clientWidth);
|
|
2589
2589
|
update();
|
|
2590
2590
|
const observer = new ResizeObserver(update);
|
|
2591
2591
|
observer.observe(tableScrollEl);
|
|
@@ -2769,7 +2769,14 @@ function DataTableImpl({
|
|
|
2769
2769
|
/* @__PURE__ */ jsx(TableBody, { children: isLoading ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: mergedColumns.length + (rowActions || injectedRowActions.length > 0 ? 1 : 0) + (hasInjectedBulkActions ? 1 : 0), className: "h-24 text-center", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2", children: [
|
|
2770
2770
|
/* @__PURE__ */ jsx(Spinner, { size: "md" }),
|
|
2771
2771
|
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: t("ui.dataTable.loading", "Loading data...") })
|
|
2772
|
-
] }) }) }) : error ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: mergedColumns.length + (rowActions || injectedRowActions.length > 0 ? 1 : 0) + (hasInjectedBulkActions ? 1 : 0), className: "
|
|
2772
|
+
] }) }) }) : error ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: mergedColumns.length + (rowActions || injectedRowActions.length > 0 ? 1 : 0) + (hasInjectedBulkActions ? 1 : 0), className: "p-0", children: /* @__PURE__ */ jsx(
|
|
2773
|
+
"div",
|
|
2774
|
+
{
|
|
2775
|
+
className: cn("sticky left-0 flex min-h-24 items-center justify-center px-4 text-center text-destructive", scrollViewportWidth ? "" : "w-fit"),
|
|
2776
|
+
style: scrollViewportWidth ? { width: scrollViewportWidth } : void 0,
|
|
2777
|
+
children: error
|
|
2778
|
+
}
|
|
2779
|
+
) }) }) : allRows.length ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2773
2780
|
virtualized && rowVirtualizer ? /* @__PURE__ */ jsx(Fragment, { children: rowVirtualizer.getVirtualItems()[0]?.start > 0 ? /* @__PURE__ */ jsx("tr", { style: { height: `${rowVirtualizer.getVirtualItems()[0].start}px` } }) : null }) : null,
|
|
2774
2781
|
(virtualized && rowVirtualizer ? rowVirtualizer.getVirtualItems().map((vi) => allRows[vi.index]) : allRows).map((row) => {
|
|
2775
2782
|
const rowActionsElement = resolvedRowActions(row.original);
|
|
@@ -2898,8 +2905,8 @@ function DataTableImpl({
|
|
|
2898
2905
|
] }) : /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: mergedColumns.length + (rowActions || injectedRowActions.length > 0 ? 1 : 0) + (hasInjectedBulkActions ? 1 : 0), className: "p-0", children: /* @__PURE__ */ jsx(
|
|
2899
2906
|
"div",
|
|
2900
2907
|
{
|
|
2901
|
-
className: cn("sticky left-0 flex justify-center py-6",
|
|
2902
|
-
style:
|
|
2908
|
+
className: cn("sticky left-0 flex justify-center py-6", scrollViewportWidth ? "" : "w-fit"),
|
|
2909
|
+
style: scrollViewportWidth ? { width: scrollViewportWidth } : void 0,
|
|
2903
2910
|
children: filterAwareEmptyState?.active ? /* @__PURE__ */ jsx(
|
|
2904
2911
|
FilteredEmptyResults,
|
|
2905
2912
|
{
|