@etsoo/materialui 1.2.60 → 1.2.61

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.
@@ -36,7 +36,7 @@ type ViewPageFieldTypeNarrow<T extends object> = (string & keyof T) | [string &
36
36
  /**
37
37
  * View page field type
38
38
  */
39
- export type ViewPageFieldType<T extends object> = ViewPageFieldTypeNarrow<T> | ((data: T) => React.ReactNode);
39
+ export type ViewPageFieldType<T extends object> = ViewPageFieldTypeNarrow<T> | ((data: T, refresh: () => Promise<void>) => React.ReactNode);
40
40
  /**
41
41
  * View page props
42
42
  */
@@ -107,7 +107,7 @@ export function ViewPage(props) {
107
107
  // Get data
108
108
  if (typeof field === "function") {
109
109
  // Most flexible way, do whatever you want
110
- return field(data);
110
+ return field(data, refresh);
111
111
  }
112
112
  const [itemData, itemLabel, gridProps] = getItemField(field, data);
113
113
  // Some callback function may return '' instead of undefined
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.2.60",
3
+ "version": "1.2.61",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -47,16 +47,16 @@
47
47
  "dependencies": {
48
48
  "@dnd-kit/core": "^6.0.8",
49
49
  "@dnd-kit/sortable": "^7.0.2",
50
- "@emotion/css": "^11.11.0",
50
+ "@emotion/css": "^11.11.2",
51
51
  "@emotion/react": "^11.11.1",
52
52
  "@emotion/styled": "^11.11.0",
53
- "@etsoo/appscript": "^1.4.19",
53
+ "@etsoo/appscript": "^1.4.20",
54
54
  "@etsoo/notificationbase": "^1.1.25",
55
55
  "@etsoo/react": "^1.6.93",
56
- "@etsoo/shared": "^1.2.5",
56
+ "@etsoo/shared": "^1.2.7",
57
57
  "@mui/icons-material": "^5.11.16",
58
58
  "@mui/material": "^5.13.5",
59
- "@mui/x-data-grid": "^6.7.0",
59
+ "@mui/x-data-grid": "^6.8.0",
60
60
  "@types/pica": "^9.0.1",
61
61
  "@types/pulltorefreshjs": "^0.1.5",
62
62
  "@types/react": "^18.2.12",
@@ -65,7 +65,7 @@ type ViewPageFieldTypeNarrow<T extends object> =
65
65
  */
66
66
  export type ViewPageFieldType<T extends object> =
67
67
  | ViewPageFieldTypeNarrow<T>
68
- | ((data: T) => React.ReactNode);
68
+ | ((data: T, refresh: () => Promise<void>) => React.ReactNode);
69
69
 
70
70
  /**
71
71
  * View page props
@@ -276,7 +276,7 @@ export function ViewPage<T extends DataTypes.StringRecord>(
276
276
  // Get data
277
277
  if (typeof field === "function") {
278
278
  // Most flexible way, do whatever you want
279
- return field(data);
279
+ return field(data, refresh);
280
280
  }
281
281
 
282
282
  const [itemData, itemLabel, gridProps] = getItemField(