@etsoo/react 1.6.53 → 1.6.54

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.
@@ -161,6 +161,10 @@ export type GridColumn<T> = {
161
161
  * Cell renderer
162
162
  */
163
163
  cellRenderer?: (props: GridCellRendererProps<T>) => React.ReactNode;
164
+ /**
165
+ * Cell box style
166
+ */
167
+ cellBoxStyle?: ((data: T) => React.CSSProperties) | React.CSSProperties;
164
168
  /**
165
169
  * Render props
166
170
  */
@@ -33,6 +33,7 @@ export const ScrollerList = (props) => {
33
33
  updateRows(rows);
34
34
  };
35
35
  // States
36
+ const batchSize = GridSizeGet(loadBatchSize, height);
36
37
  const stateRefs = React.useRef({
37
38
  autoLoad,
38
39
  currentPage: 0,
@@ -41,7 +42,7 @@ export const ScrollerList = (props) => {
41
42
  isNextPageLoading: false,
42
43
  orderBy: defaultOrderBy,
43
44
  orderByAsc: defaultOrderByAsc,
44
- batchSize: GridSizeGet(loadBatchSize, height),
45
+ batchSize: batchSize,
45
46
  selectedItems: [],
46
47
  idCache: {}
47
48
  });
@@ -69,7 +70,7 @@ export const ScrollerList = (props) => {
69
70
  state.isMounted = true;
70
71
  const newItems = result.length;
71
72
  state.lastLoadedItems = newItems;
72
- state.hasNextPage = newItems >= loadBatchSize;
73
+ state.hasNextPage = newItems >= batchSize;
73
74
  state.isNextPageLoading = false;
74
75
  if (pageAdd === 0) {
75
76
  // New items
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.6.53",
3
+ "version": "1.6.54",
4
4
  "description": "TypeScript ReactJs UI Independent Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -53,7 +53,7 @@
53
53
  "@etsoo/appscript": "^1.3.82",
54
54
  "@etsoo/notificationbase": "^1.1.24",
55
55
  "@etsoo/shared": "^1.1.92",
56
- "@types/react": "^18.0.28",
56
+ "@types/react": "^18.0.29",
57
57
  "@types/react-dom": "^18.0.11",
58
58
  "@types/react-window": "^1.8.5",
59
59
  "react": "^18.2.0",
@@ -73,6 +73,6 @@
73
73
  "jest": "^29.5.0",
74
74
  "jest-environment-jsdom": "^29.5.0",
75
75
  "ts-jest": "^29.0.5",
76
- "typescript": "^4.9.5"
76
+ "typescript": "^5.0.2"
77
77
  }
78
78
  }
@@ -207,6 +207,11 @@ export type GridColumn<T> = {
207
207
  */
208
208
  cellRenderer?: (props: GridCellRendererProps<T>) => React.ReactNode;
209
209
 
210
+ /**
211
+ * Cell box style
212
+ */
213
+ cellBoxStyle?: ((data: T) => React.CSSProperties) | React.CSSProperties;
214
+
210
215
  /**
211
216
  * Render props
212
217
  */
@@ -154,6 +154,7 @@ export const ScrollerList = <
154
154
  };
155
155
 
156
156
  // States
157
+ const batchSize = GridSizeGet(loadBatchSize, height);
157
158
  const stateRefs = React.useRef<GridLoaderStates<T>>({
158
159
  autoLoad,
159
160
  currentPage: 0,
@@ -162,7 +163,7 @@ export const ScrollerList = <
162
163
  isNextPageLoading: false,
163
164
  orderBy: defaultOrderBy,
164
165
  orderByAsc: defaultOrderByAsc,
165
- batchSize: GridSizeGet(loadBatchSize, height),
166
+ batchSize: batchSize,
166
167
  selectedItems: [],
167
168
  idCache: {}
168
169
  });
@@ -195,7 +196,7 @@ export const ScrollerList = <
195
196
 
196
197
  const newItems = result.length;
197
198
  state.lastLoadedItems = newItems;
198
- state.hasNextPage = newItems >= loadBatchSize;
199
+ state.hasNextPage = newItems >= batchSize;
199
200
  state.isNextPageLoading = false;
200
201
 
201
202
  if (pageAdd === 0) {