@open-mercato/ui 0.6.6-develop.5536.1.7cfc9c28a1 → 0.6.6-develop.5548.1.ce0de513a9
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/backend/DataTable.js +6 -6
- package/dist/backend/DataTable.js.map +2 -2
- package/dist/primitives/pagination.js +3 -3
- package/dist/primitives/pagination.js.map +2 -2
- package/package.json +3 -3
- package/src/backend/DataTable.tsx +10 -6
- package/src/backend/__tests__/DataTable.stickyResponsive.test.tsx +99 -0
- package/src/primitives/__tests__/pagination.test.tsx +31 -0
- package/src/primitives/pagination.tsx +3 -3
|
@@ -134,8 +134,8 @@ const EXPORT_LABELS = {
|
|
|
134
134
|
};
|
|
135
135
|
const EMPTY_FILTER_DEFS = [];
|
|
136
136
|
const EMPTY_FILTER_VALUES = Object.freeze({});
|
|
137
|
-
const STICKY_RIGHT_SHADOW_CLASS = "before:absolute before:inset-y-0 before:-left-2 before:w-2 before:bg-gradient-to-l before:from-foreground/8 before:to-transparent before:pointer-events-none";
|
|
138
|
-
const STICKY_LEFT_SHADOW_CLASS = "after:absolute after:inset-y-0 after:-right-2 after:w-2 after:bg-gradient-to-r after:from-foreground/8 after:to-transparent after:pointer-events-none";
|
|
137
|
+
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";
|
|
138
|
+
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";
|
|
139
139
|
function collectUniqueById(entries, warningScope) {
|
|
140
140
|
const byId = /* @__PURE__ */ new Map();
|
|
141
141
|
for (const entry of entries) {
|
|
@@ -2077,7 +2077,7 @@ function DataTable({
|
|
|
2077
2077
|
const columnMeta = header.column.columnDef?.meta;
|
|
2078
2078
|
const priority = resolvePriority(header.column);
|
|
2079
2079
|
const isFirstDataColumn = headerIndex === 0;
|
|
2080
|
-
const stickyClass = stickyFirstColumn && isFirstDataColumn ? ` sticky left-0 z-10 bg-background ${STICKY_LEFT_SHADOW_CLASS}` : "";
|
|
2080
|
+
const stickyClass = stickyFirstColumn && isFirstDataColumn ? ` md:sticky md:left-0 md:z-10 md:bg-background ${STICKY_LEFT_SHADOW_CLASS}` : "";
|
|
2081
2081
|
const headerCellContent = header.isPlaceholder ? null : /* @__PURE__ */ jsxs(
|
|
2082
2082
|
Button,
|
|
2083
2083
|
{
|
|
@@ -2103,7 +2103,7 @@ function DataTable({
|
|
|
2103
2103
|
{
|
|
2104
2104
|
className: cn(
|
|
2105
2105
|
actionsColumnAlign === "center" ? "w-0 text-center" : "w-0 text-right",
|
|
2106
|
-
stickyActionsColumn && `sticky right-0 z-20 bg-background ${STICKY_RIGHT_SHADOW_CLASS}`
|
|
2106
|
+
stickyActionsColumn && `md:sticky md:right-0 md:z-20 md:bg-background ${STICKY_RIGHT_SHADOW_CLASS}`
|
|
2107
2107
|
),
|
|
2108
2108
|
children: t("ui.dataTable.actionsColumn", "Actions")
|
|
2109
2109
|
}
|
|
@@ -2179,14 +2179,14 @@ function DataTable({
|
|
|
2179
2179
|
tooltipText = cellValue != null ? String(cellValue) : void 0;
|
|
2180
2180
|
}
|
|
2181
2181
|
const wrappedContent = shouldTruncate ? /* @__PURE__ */ jsx(TruncatedCell, { maxWidth, tooltipContent: tooltipText, children: content }) : content;
|
|
2182
|
-
return /* @__PURE__ */ jsx(TableCell, { className: responsiveClass(priority, columnMeta?.hidden) + (isStickyCell ? ` sticky left-0 z-10 bg-background ${STICKY_LEFT_SHADOW_CLASS}` : ""), children: wrappedContent }, cell.id);
|
|
2182
|
+
return /* @__PURE__ */ jsx(TableCell, { className: responsiveClass(priority, columnMeta?.hidden) + (isStickyCell ? ` md:sticky md:left-0 md:z-10 md:bg-background ${STICKY_LEFT_SHADOW_CLASS}` : ""), children: wrappedContent }, cell.id);
|
|
2183
2183
|
}),
|
|
2184
2184
|
rowActions || injectedRowActions.length > 0 ? /* @__PURE__ */ jsx(
|
|
2185
2185
|
TableCell,
|
|
2186
2186
|
{
|
|
2187
2187
|
className: cn(
|
|
2188
2188
|
actionsColumnAlign === "center" ? "text-center whitespace-nowrap" : "text-right whitespace-nowrap",
|
|
2189
|
-
stickyActionsColumn && `sticky right-0 z-10 bg-background ${STICKY_RIGHT_SHADOW_CLASS}`
|
|
2189
|
+
stickyActionsColumn && `md:sticky md:right-0 md:z-10 md:bg-background ${STICKY_RIGHT_SHADOW_CLASS}`
|
|
2190
2190
|
),
|
|
2191
2191
|
"data-actions-cell": true,
|
|
2192
2192
|
children: rowActionsElement
|