@etsoo/react 1.7.25 → 1.7.26

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.
@@ -220,7 +220,7 @@ export const ScrollerGrid = (props) => {
220
220
  state.isMounted = false;
221
221
  };
222
222
  }, []);
223
- // Force update to work with the new width
223
+ // Force update to work with the new width and rowHeight
224
224
  React.useEffect(() => {
225
225
  var _a;
226
226
  (_a = ref.current) === null || _a === void 0 ? void 0 : _a.resetAfterIndices({
@@ -228,7 +228,7 @@ export const ScrollerGrid = (props) => {
228
228
  rowIndex: 0,
229
229
  shouldForceUpdate: true
230
230
  });
231
- }, [width]);
231
+ }, [width, rowHeight]);
232
232
  // Rows
233
233
  const rowLength = rows.length;
234
234
  // Row count
@@ -244,11 +244,10 @@ export const ScrollerGrid = (props) => {
244
244
  // Layout
245
245
  return (React.createElement(React.Fragment, null,
246
246
  headerRenderer && headerRenderer(state),
247
- React.createElement(VariableSizeGrid, { itemKey: ({ columnIndex, rowIndex }) => {
248
- const data = rows[rowIndex];
247
+ React.createElement(VariableSizeGrid, { itemKey: ({ columnIndex, rowIndex, data }) => {
249
248
  if (data == null)
250
249
  return [rowIndex, columnIndex].join(',');
251
- return [data[idField], columnIndex].join(',');
250
+ return [`${data[idField]}-${rowIndex}`, columnIndex].join(',');
252
251
  }, onItemsRendered: onItemsRenderedLocal, ref: ref, rowCount: rowCount, rowHeight: typeof rowHeight === 'function'
253
252
  ? rowHeight
254
253
  : () => rowHeight, style: { overflowX: 'hidden' }, width: width, ...rest }, (props) => itemRendererLocal(props, state)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.7.25",
3
+ "version": "1.7.26",
4
4
  "description": "TypeScript ReactJs UI Independent Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -48,25 +48,25 @@
48
48
  "@dnd-kit/core": "^6.1.0",
49
49
  "@dnd-kit/sortable": "^8.0.0",
50
50
  "@emotion/css": "^11.11.2",
51
- "@emotion/react": "^11.11.3",
51
+ "@emotion/react": "^11.11.4",
52
52
  "@emotion/styled": "^11.11.0",
53
- "@etsoo/appscript": "^1.4.74",
53
+ "@etsoo/appscript": "^1.4.76",
54
54
  "@etsoo/notificationbase": "^1.1.35",
55
55
  "@etsoo/shared": "^1.2.26",
56
- "@types/react": "^18.2.58",
56
+ "@types/react": "^18.2.60",
57
57
  "@types/react-dom": "^18.2.19",
58
58
  "@types/react-window": "^1.8.8",
59
59
  "react": "^18.2.0",
60
60
  "react-dom": "^18.2.0",
61
- "react-router-dom": "^6.22.1",
61
+ "react-router-dom": "^6.22.2",
62
62
  "react-window": "^1.8.10"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@babel/cli": "^7.23.9",
66
- "@babel/core": "^7.23.9",
67
- "@babel/plugin-transform-runtime": "^7.23.9",
68
- "@babel/preset-env": "^7.23.9",
69
- "@babel/runtime-corejs3": "^7.23.9",
66
+ "@babel/core": "^7.24.0",
67
+ "@babel/plugin-transform-runtime": "^7.24.0",
68
+ "@babel/preset-env": "^7.24.0",
69
+ "@babel/runtime-corejs3": "^7.24.0",
70
70
  "@testing-library/jest-dom": "^6.4.2",
71
71
  "@testing-library/react": "^14.2.1",
72
72
  "@types/jest": "^29.5.12",
@@ -434,14 +434,14 @@ export const ScrollerGrid = <
434
434
  };
435
435
  }, []);
436
436
 
437
- // Force update to work with the new width
437
+ // Force update to work with the new width and rowHeight
438
438
  React.useEffect(() => {
439
439
  ref.current?.resetAfterIndices({
440
440
  columnIndex: 0,
441
441
  rowIndex: 0,
442
442
  shouldForceUpdate: true
443
443
  });
444
- }, [width]);
444
+ }, [width, rowHeight]);
445
445
 
446
446
  // Rows
447
447
  const rowLength = rows.length;
@@ -462,10 +462,11 @@ export const ScrollerGrid = <
462
462
  <React.Fragment>
463
463
  {headerRenderer && headerRenderer(state)}
464
464
  <VariableSizeGrid<T>
465
- itemKey={({ columnIndex, rowIndex }) => {
466
- const data = rows[rowIndex];
465
+ itemKey={({ columnIndex, rowIndex, data }) => {
467
466
  if (data == null) return [rowIndex, columnIndex].join(',');
468
- return [data[idField], columnIndex].join(',');
467
+ return [`${data[idField]}-${rowIndex}`, columnIndex].join(
468
+ ','
469
+ );
469
470
  }}
470
471
  onItemsRendered={onItemsRenderedLocal}
471
472
  ref={ref}