@equinor/apollo-components 1.1.0 → 1.1.2
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.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/index.mjs +7 -7
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -42,4 +42,4 @@ interface DataTableProps<T> {
|
|
|
42
42
|
}
|
|
43
43
|
declare function DataTable<T>({ columns, data, header, filters, config }: DataTableProps<T>): JSX.Element;
|
|
44
44
|
|
|
45
|
-
export { AppShell, AppSidebar, ChipsCell, DataTable, DataTableConfig,
|
|
45
|
+
export { AppShell, AppSidebar, ChipsCell, DataTable, DataTableConfig, FilterConfig, HeaderConfig };
|
package/dist/index.js
CHANGED
|
@@ -356,14 +356,14 @@ var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
|
356
356
|
function VirtualTable({ table, containerRef, ...props }) {
|
|
357
357
|
var _a, _b;
|
|
358
358
|
const { rows } = table.getRowModel();
|
|
359
|
-
const rowVirtualizer = (0, import_react_virtual.
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
359
|
+
const rowVirtualizer = (0, import_react_virtual.useVirtualizer)({
|
|
360
|
+
count: rows.length,
|
|
361
|
+
estimateSize: () => 35,
|
|
362
|
+
getScrollElement: () => containerRef.current
|
|
363
363
|
});
|
|
364
|
-
const
|
|
364
|
+
const virtualRows = rowVirtualizer.getVirtualItems();
|
|
365
365
|
const paddingTop = virtualRows.length > 0 ? ((_a = virtualRows == null ? void 0 : virtualRows[0]) == null ? void 0 : _a.start) || 0 : 0;
|
|
366
|
-
const paddingBottom = virtualRows.length > 0 ?
|
|
366
|
+
const paddingBottom = virtualRows.length > 0 ? rowVirtualizer.getTotalSize() - (((_b = virtualRows == null ? void 0 : virtualRows[virtualRows.length - 1]) == null ? void 0 : _b.end) || 0) : 0;
|
|
367
367
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_eds_core_react9.Table, {
|
|
368
368
|
children: [
|
|
369
369
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TableHeader, {
|
package/dist/index.mjs
CHANGED
|
@@ -306,7 +306,7 @@ var DataTableHeader = (props) => {
|
|
|
306
306
|
// src/DataTable/components/VirtualTable.tsx
|
|
307
307
|
import { Table as Table5 } from "@equinor/eds-core-react";
|
|
308
308
|
import { flexRender as flexRender3 } from "@tanstack/react-table";
|
|
309
|
-
import {
|
|
309
|
+
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
310
310
|
|
|
311
311
|
// src/DataTable/components/PaddingRow.tsx
|
|
312
312
|
import { Table as Table4 } from "@equinor/eds-core-react";
|
|
@@ -326,14 +326,14 @@ import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
|
326
326
|
function VirtualTable({ table, containerRef, ...props }) {
|
|
327
327
|
var _a, _b;
|
|
328
328
|
const { rows } = table.getRowModel();
|
|
329
|
-
const rowVirtualizer =
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
329
|
+
const rowVirtualizer = useVirtualizer({
|
|
330
|
+
count: rows.length,
|
|
331
|
+
estimateSize: () => 35,
|
|
332
|
+
getScrollElement: () => containerRef.current
|
|
333
333
|
});
|
|
334
|
-
const
|
|
334
|
+
const virtualRows = rowVirtualizer.getVirtualItems();
|
|
335
335
|
const paddingTop = virtualRows.length > 0 ? ((_a = virtualRows == null ? void 0 : virtualRows[0]) == null ? void 0 : _a.start) || 0 : 0;
|
|
336
|
-
const paddingBottom = virtualRows.length > 0 ?
|
|
336
|
+
const paddingBottom = virtualRows.length > 0 ? rowVirtualizer.getTotalSize() - (((_b = virtualRows == null ? void 0 : virtualRows[virtualRows.length - 1]) == null ? void 0 : _b.end) || 0) : 0;
|
|
337
337
|
return /* @__PURE__ */ jsxs6(Table5, {
|
|
338
338
|
children: [
|
|
339
339
|
/* @__PURE__ */ jsx10(TableHeader, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/apollo-components",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@equinor/eds-tokens": "^0.9.0",
|
|
23
23
|
"@tanstack/match-sorter-utils": "^8.5.14",
|
|
24
24
|
"@tanstack/react-table": "^8.5.15",
|
|
25
|
-
"@tanstack/react-virtual": "^3.0.0-
|
|
25
|
+
"@tanstack/react-virtual": "^3.0.0-beta.23",
|
|
26
26
|
"styled-components": "^5.3.6",
|
|
27
27
|
"tsup": "^6.3.0"
|
|
28
28
|
},
|