asma-ui-table 1.0.136 → 1.0.137
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/asma-ui-table.es.js
CHANGED
|
@@ -15124,7 +15124,11 @@ function useElementHeightPx() {
|
|
|
15124
15124
|
}, []);
|
|
15125
15125
|
return { ref, heightPx };
|
|
15126
15126
|
}
|
|
15127
|
-
function useColumnVirtualizer(
|
|
15127
|
+
function useColumnVirtualizer({
|
|
15128
|
+
table,
|
|
15129
|
+
scrollRef,
|
|
15130
|
+
isMobileView
|
|
15131
|
+
}) {
|
|
15128
15132
|
var _a, _b;
|
|
15129
15133
|
const centerColumns = table.getVisibleLeafColumns().filter((column) => !column.columnDef.fixedLeft && column.id !== ACTIONS_COLUMN_ID);
|
|
15130
15134
|
const columnVirtualizer = useVirtualizer({
|
|
@@ -15137,6 +15141,15 @@ function useColumnVirtualizer(table, scrollRef) {
|
|
|
15137
15141
|
horizontal: true,
|
|
15138
15142
|
overscan: 2
|
|
15139
15143
|
});
|
|
15144
|
+
if (isMobileView) {
|
|
15145
|
+
return {
|
|
15146
|
+
columnWindow: {
|
|
15147
|
+
indexes: centerColumns.map((_, i) => i),
|
|
15148
|
+
paddingLeft: 0,
|
|
15149
|
+
paddingRight: 0
|
|
15150
|
+
}
|
|
15151
|
+
};
|
|
15152
|
+
}
|
|
15140
15153
|
const virtualColumns = columnVirtualizer.getVirtualItems();
|
|
15141
15154
|
const totalSize = columnVirtualizer.getTotalSize();
|
|
15142
15155
|
return {
|
|
@@ -15227,7 +15240,7 @@ const StyledTable = (props) => {
|
|
|
15227
15240
|
showNoRowsOverlay && style$1["table-wrapper--no-rows"],
|
|
15228
15241
|
className
|
|
15229
15242
|
);
|
|
15230
|
-
const { columnWindow } = useColumnVirtualizer(table, tableScrollRef);
|
|
15243
|
+
const { columnWindow } = useColumnVirtualizer({ table, scrollRef: tableScrollRef, isMobileView });
|
|
15231
15244
|
const TableMarkup = /* @__PURE__ */ jsxRuntimeExports.jsxs("table", { className: style$1["styled-table"], style: { width: table.getTotalSize(), minWidth: "100%" }, children: [
|
|
15232
15245
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15233
15246
|
TableHeader,
|
|
@@ -7,7 +7,11 @@ export type ColumnWindow = {
|
|
|
7
7
|
};
|
|
8
8
|
export declare function useColumnVirtualizer<TData extends {
|
|
9
9
|
id: string | number;
|
|
10
|
-
}>(table
|
|
10
|
+
}>({ table, scrollRef, isMobileView, }: {
|
|
11
|
+
table: Table<TData>;
|
|
12
|
+
scrollRef?: MutableRefObject<HTMLDivElement | null>;
|
|
13
|
+
isMobileView: boolean;
|
|
14
|
+
}): {
|
|
11
15
|
columnWindow: {
|
|
12
16
|
indexes: number[];
|
|
13
17
|
paddingLeft: number;
|