@equinor/apollo-components 3.1.2-rowfix.5 → 3.1.2-rowfix.7

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.js CHANGED
@@ -954,7 +954,7 @@ function VirtualTableBody({
954
954
  getScrollElement: () => containerRef.current,
955
955
  estimateSize: () => 48,
956
956
  measureElement: (element) => element == null ? void 0 : element.getBoundingClientRect().height,
957
- overscan: 10
957
+ overscan: 2
958
958
  });
959
959
  if (!rowVirtualizer)
960
960
  return null;
@@ -1038,7 +1038,6 @@ var DataTableWrapper = import_styled_components16.default.div`
1038
1038
  function DataTable(props) {
1039
1039
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
1040
1040
  const { columns, data, bannerConfig, cellConfig, sorting } = props;
1041
- console.log("DataTable");
1042
1041
  const [internalColumnVisibility, setInternalColumnVisibility] = (0, import_react6.useState)({});
1043
1042
  const [columnVisibility, setColumnVisibility] = [
1044
1043
  ((_a = props.columnVisibility) == null ? void 0 : _a.state) ?? internalColumnVisibility,
@@ -1114,6 +1113,7 @@ function DataTable(props) {
1114
1113
  }, [table, (_p = props.expansion) == null ? void 0 : _p.expandAllByDefault]);
1115
1114
  const { isLoading, rowConfig } = props;
1116
1115
  const tableContainerRef = (0, import_react6.useRef)(null);
1116
+ console.log("DataTable", { container: tableContainerRef.current });
1117
1117
  const onTableContainerScroll = useFetchMoreOnBottomReached(
1118
1118
  tableContainerRef,
1119
1119
  props.infiniteScroll
@@ -1134,15 +1134,7 @@ function DataTable(props) {
1134
1134
  className: "--table-container " + (((_q = props.tableContainerProps) == null ? void 0 : _q.className) ?? ""),
1135
1135
  style: { contain: "strict" },
1136
1136
  onScroll: ((_r = props.tableContainerProps) == null ? void 0 : _r.onScroll) ?? onTableContainerScroll,
1137
- ref: (node) => {
1138
- var _a2;
1139
- if (node) {
1140
- tableContainerRef.current = node;
1141
- if ((_a2 = props.tableContainerProps) == null ? void 0 : _a2.ref) {
1142
- props.tableContainerProps.ref.current = node;
1143
- }
1144
- }
1145
- },
1137
+ ref: tableContainerRef,
1146
1138
  children: (props == null ? void 0 : props.virtual) ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_eds_core_react18.Table, {
1147
1139
  children: [
1148
1140
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_eds_core_react18.Table.Caption, {
package/dist/index.mjs CHANGED
@@ -911,7 +911,7 @@ function VirtualTableBody({
911
911
  getScrollElement: () => containerRef.current,
912
912
  estimateSize: () => 48,
913
913
  measureElement: (element) => element == null ? void 0 : element.getBoundingClientRect().height,
914
- overscan: 10
914
+ overscan: 2
915
915
  });
916
916
  if (!rowVirtualizer)
917
917
  return null;
@@ -995,7 +995,6 @@ var DataTableWrapper = styled16.div`
995
995
  function DataTable(props) {
996
996
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
997
997
  const { columns, data, bannerConfig, cellConfig, sorting } = props;
998
- console.log("DataTable");
999
998
  const [internalColumnVisibility, setInternalColumnVisibility] = useState5({});
1000
999
  const [columnVisibility, setColumnVisibility] = [
1001
1000
  ((_a = props.columnVisibility) == null ? void 0 : _a.state) ?? internalColumnVisibility,
@@ -1071,6 +1070,7 @@ function DataTable(props) {
1071
1070
  }, [table, (_p = props.expansion) == null ? void 0 : _p.expandAllByDefault]);
1072
1071
  const { isLoading, rowConfig } = props;
1073
1072
  const tableContainerRef = useRef3(null);
1073
+ console.log("DataTable", { container: tableContainerRef.current });
1074
1074
  const onTableContainerScroll = useFetchMoreOnBottomReached(
1075
1075
  tableContainerRef,
1076
1076
  props.infiniteScroll
@@ -1091,15 +1091,7 @@ function DataTable(props) {
1091
1091
  className: "--table-container " + (((_q = props.tableContainerProps) == null ? void 0 : _q.className) ?? ""),
1092
1092
  style: { contain: "strict" },
1093
1093
  onScroll: ((_r = props.tableContainerProps) == null ? void 0 : _r.onScroll) ?? onTableContainerScroll,
1094
- ref: (node) => {
1095
- var _a2;
1096
- if (node) {
1097
- tableContainerRef.current = node;
1098
- if ((_a2 = props.tableContainerProps) == null ? void 0 : _a2.ref) {
1099
- props.tableContainerProps.ref.current = node;
1100
- }
1101
- }
1102
- },
1094
+ ref: tableContainerRef,
1103
1095
  children: (props == null ? void 0 : props.virtual) ? /* @__PURE__ */ jsxs11(Table9, {
1104
1096
  children: [
1105
1097
  /* @__PURE__ */ jsx19(Table9.Caption, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/apollo-components",
3
- "version": "3.1.2-rowfix.5",
3
+ "version": "3.1.2-rowfix.7",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",