@etsoo/materialui 1.1.92 → 1.1.93

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/lib/TableEx.js CHANGED
@@ -153,6 +153,13 @@ export function TableEx(props) {
153
153
  const handleSort = (field, asc) => {
154
154
  reset({ orderBy: field, orderByAsc: asc });
155
155
  };
156
+ // Set items for rerenderer
157
+ const setItems = (callback) => {
158
+ const result = callback(rows);
159
+ if (result == null)
160
+ return;
161
+ setRows(result);
162
+ };
156
163
  // Destruct states
157
164
  const { autoLoad: stateAutoLoad, currentPage, hasNextPage, lastLoadedItems, orderBy, batchSize, selectedItems } = state;
158
165
  // Current page selected items
@@ -255,7 +262,7 @@ export function TableEx(props) {
255
262
  rowIndex,
256
263
  columnIndex,
257
264
  cellProps,
258
- setItems: setRows
265
+ setItems
259
266
  })) : (React.createElement(React.Fragment, null, "\u00A0"));
260
267
  return (React.createElement(TableCell, { key: `${rowId}${columnIndex}`, ...cellProps }, child));
261
268
  })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.1.92",
3
+ "version": "1.1.93",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -52,7 +52,7 @@
52
52
  "@emotion/styled": "^11.10.6",
53
53
  "@etsoo/appscript": "^1.3.89",
54
54
  "@etsoo/notificationbase": "^1.1.24",
55
- "@etsoo/react": "^1.6.59",
55
+ "@etsoo/react": "^1.6.61",
56
56
  "@etsoo/shared": "^1.1.99",
57
57
  "@mui/icons-material": "^5.11.16",
58
58
  "@mui/material": "^5.11.16",
package/src/TableEx.tsx CHANGED
@@ -288,6 +288,13 @@ export function TableEx<
288
288
  reset({ orderBy: field, orderByAsc: asc });
289
289
  };
290
290
 
291
+ // Set items for rerenderer
292
+ const setItems = (callback: (items: T[]) => T[] | undefined) => {
293
+ const result = callback(rows);
294
+ if (result == null) return;
295
+ setRows(result);
296
+ };
297
+
291
298
  // Destruct states
292
299
  const {
293
300
  autoLoad: stateAutoLoad,
@@ -485,7 +492,7 @@ export function TableEx<
485
492
  rowIndex,
486
493
  columnIndex,
487
494
  cellProps,
488
- setItems: setRows
495
+ setItems
489
496
  })
490
497
  ) : (
491
498
  <React.Fragment>&nbsp;</React.Fragment>