@open-mercato/ui 0.10.1-develop.7702.1.f991ecf392 → 0.10.1-develop.7707.1.61845a3ef7
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.
|
@@ -180,6 +180,8 @@ const EMPTY_FILTER_VALUES = Object.freeze({});
|
|
|
180
180
|
const EMPTY_VIEW_SETTINGS = Object.freeze({});
|
|
181
181
|
const STICKY_RIGHT_SHADOW_CLASS = "md:before:absolute md:before:inset-y-0 md:before:-left-2 md:before:w-2 md:before:bg-gradient-to-l md:before:from-foreground/8 md:before:to-transparent md:before:pointer-events-none";
|
|
182
182
|
const STICKY_LEFT_SHADOW_CLASS = "md:after:absolute md:after:inset-y-0 md:after:-right-2 md:after:w-2 md:after:bg-gradient-to-r md:after:from-foreground/8 md:after:to-transparent md:after:pointer-events-none";
|
|
183
|
+
const STICKY_HEADER_TINT_CLASS = "md:bg-linear-to-r md:from-muted/40 md:to-muted/40";
|
|
184
|
+
const STICKY_ROW_HOVER_TINT_CLASS = "md:group-hover/row:bg-linear-to-r md:group-hover/row:from-muted/30 md:group-hover/row:to-muted/30";
|
|
183
185
|
function collectUniqueById(entries, warningScope) {
|
|
184
186
|
const byId = /* @__PURE__ */ new Map();
|
|
185
187
|
for (const entry of entries) {
|
|
@@ -2576,6 +2578,9 @@ function DataTableImpl({
|
|
|
2576
2578
|
const headerContentClassName = "flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between";
|
|
2577
2579
|
const toolbarWrapperClassName = embedded ? "mt-2" : "mt-3 pt-3 border-t";
|
|
2578
2580
|
const tableScrollWrapperClassName = embedded ? "isolate" : "isolate overflow-auto";
|
|
2581
|
+
const stickySurfaceClass = embedded ? "md:bg-background" : "md:bg-card";
|
|
2582
|
+
const stickyHeaderSurfaceClass = `${stickySurfaceClass} ${STICKY_HEADER_TINT_CLASS}`;
|
|
2583
|
+
const stickyBodySurfaceClass = `${stickySurfaceClass} ${STICKY_ROW_HOVER_TINT_CLASS}`;
|
|
2579
2584
|
const virtualScrollRef = React.useRef(null);
|
|
2580
2585
|
const [tableScrollEl, setTableScrollEl] = React.useState(null);
|
|
2581
2586
|
const [scrollViewportWidth, setScrollViewportWidth] = React.useState(null);
|
|
@@ -2706,7 +2711,7 @@ function DataTableImpl({
|
|
|
2706
2711
|
const columnMeta = header.column.columnDef?.meta;
|
|
2707
2712
|
const priority = resolvePriority(header.column);
|
|
2708
2713
|
const isFirstDataColumn = headerIndex === 0;
|
|
2709
|
-
const stickyClass = stickyFirstColumn && isFirstDataColumn ? ` md:sticky md:left-0 md:z-10
|
|
2714
|
+
const stickyClass = stickyFirstColumn && isFirstDataColumn ? ` md:sticky md:left-0 md:z-10 ${stickyHeaderSurfaceClass} ${STICKY_LEFT_SHADOW_CLASS}` : "";
|
|
2710
2715
|
const isColumnSortable = sortable && !!header.column.getCanSort?.();
|
|
2711
2716
|
const headerContent = header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext());
|
|
2712
2717
|
const headerCellContent = header.isPlaceholder ? null : isColumnSortable ? /* @__PURE__ */ jsxs(
|
|
@@ -2760,7 +2765,7 @@ function DataTableImpl({
|
|
|
2760
2765
|
{
|
|
2761
2766
|
className: cn(
|
|
2762
2767
|
actionsColumnAlign === "center" ? "w-0 text-center" : "w-0 text-right",
|
|
2763
|
-
stickyActionsColumn && `md:sticky md:right-0 md:z-20
|
|
2768
|
+
stickyActionsColumn && `md:sticky md:right-0 md:z-20 ${stickyHeaderSurfaceClass} ${STICKY_RIGHT_SHADOW_CLASS}`
|
|
2764
2769
|
),
|
|
2765
2770
|
children: t("ui.dataTable.actionsColumn", "Actions")
|
|
2766
2771
|
}
|
|
@@ -2786,7 +2791,7 @@ function DataTableImpl({
|
|
|
2786
2791
|
TableRow,
|
|
2787
2792
|
{
|
|
2788
2793
|
"data-state": row.getIsSelected() && "selected",
|
|
2789
|
-
className: isClickable
|
|
2794
|
+
className: cn("group/row", isClickable && "cursor-pointer hover:bg-muted/50 transition-colors"),
|
|
2790
2795
|
onClick: isClickable ? (e) => {
|
|
2791
2796
|
if (e.target.closest("[data-actions-cell]")) {
|
|
2792
2797
|
return;
|
|
@@ -2870,7 +2875,7 @@ function DataTableImpl({
|
|
|
2870
2875
|
return /* @__PURE__ */ jsx(
|
|
2871
2876
|
TableCell,
|
|
2872
2877
|
{
|
|
2873
|
-
className: responsiveClass(priority, columnMeta?.hidden) + (isStickyCell ? ` md:sticky md:left-0 md:z-10
|
|
2878
|
+
className: responsiveClass(priority, columnMeta?.hidden) + (isStickyCell ? ` md:sticky md:left-0 md:z-10 ${stickyBodySurfaceClass} ${STICKY_LEFT_SHADOW_CLASS}` : ""),
|
|
2874
2879
|
style: typeof sizedWidth === "number" ? { width: sizedWidth, minWidth: sizedWidth, maxWidth: sizedWidth } : void 0,
|
|
2875
2880
|
children: expandAffordance ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
|
|
2876
2881
|
expandAffordance,
|
|
@@ -2885,7 +2890,7 @@ function DataTableImpl({
|
|
|
2885
2890
|
{
|
|
2886
2891
|
className: cn(
|
|
2887
2892
|
actionsColumnAlign === "center" ? "text-center whitespace-nowrap" : "text-right whitespace-nowrap",
|
|
2888
|
-
stickyActionsColumn && `md:sticky md:right-0 md:z-10
|
|
2893
|
+
stickyActionsColumn && `md:sticky md:right-0 md:z-10 ${stickyBodySurfaceClass} ${STICKY_RIGHT_SHADOW_CLASS}`
|
|
2889
2894
|
),
|
|
2890
2895
|
"data-actions-cell": true,
|
|
2891
2896
|
children: rowActionsElement
|