@etsoo/materialui 1.0.87 → 1.0.89

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.
@@ -65,6 +65,10 @@ export interface ViewPageProps<T extends DataTypes.StringRecord> extends Omit<Co
65
65
  * Support refresh
66
66
  */
67
67
  supportRefresh?: boolean;
68
+ /**
69
+ * Grid container reference
70
+ */
71
+ gridRef?: React.Ref<HTMLDivElement>;
68
72
  }
69
73
  /**
70
74
  * View page
@@ -73,7 +73,7 @@ function getItemField(field, data) {
73
73
  */
74
74
  export function ViewPage(props) {
75
75
  // Destruct
76
- const { actions, children, fields, loadData, paddings = MUGlobal.pagePaddings, supportRefresh = true, fabColumnDirection = true, supportBack = true, pullToRefresh = true, ...rest } = props;
76
+ const { actions, children, fields, loadData, paddings = MUGlobal.pagePaddings, supportRefresh = true, fabColumnDirection = true, supportBack = true, pullToRefresh = true, gridRef, ...rest } = props;
77
77
  // Data
78
78
  const [data, setData] = React.useState();
79
79
  // Labels
@@ -88,7 +88,7 @@ export function ViewPage(props) {
88
88
  setData(result);
89
89
  };
90
90
  return (React.createElement(CommonPage, { paddings: paddings, onRefresh: supportRefresh ? refresh : undefined, onUpdate: supportRefresh ? undefined : refresh, ...rest, scrollContainer: globalThis, fabColumnDirection: fabColumnDirection, supportBack: supportBack }, data == null ? (React.createElement(LinearProgress, null)) : (React.createElement(React.Fragment, null,
91
- React.createElement(Grid, { container: true, justifyContent: "left", spacing: paddings, className: "ET-ViewPage", sx: {
91
+ React.createElement(Grid, { container: true, justifyContent: "left", spacing: paddings, className: "ET-ViewPage", ref: gridRef, sx: {
92
92
  '.MuiTypography-subtitle2': {
93
93
  fontWeight: 'bold'
94
94
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.0.87",
3
+ "version": "1.0.89",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -51,9 +51,9 @@
51
51
  "@emotion/css": "^11.10.5",
52
52
  "@emotion/react": "^11.10.5",
53
53
  "@emotion/styled": "^11.10.5",
54
- "@etsoo/appscript": "^1.3.40",
54
+ "@etsoo/appscript": "^1.3.41",
55
55
  "@etsoo/notificationbase": "^1.1.18",
56
- "@etsoo/react": "^1.6.30",
56
+ "@etsoo/react": "^1.6.31",
57
57
  "@etsoo/shared": "^1.1.78",
58
58
  "@mui/icons-material": "^5.10.15",
59
59
  "@mui/material": "^5.10.15",
@@ -101,6 +101,11 @@ export interface ViewPageProps<T extends DataTypes.StringRecord>
101
101
  * Support refresh
102
102
  */
103
103
  supportRefresh?: boolean;
104
+
105
+ /**
106
+ * Grid container reference
107
+ */
108
+ gridRef?: React.Ref<HTMLDivElement>;
104
109
  }
105
110
 
106
111
  function formatItemData(fieldData: unknown): string | undefined {
@@ -195,6 +200,7 @@ export function ViewPage<T extends DataTypes.StringRecord>(
195
200
  fabColumnDirection = true,
196
201
  supportBack = true,
197
202
  pullToRefresh = true,
203
+ gridRef,
198
204
  ...rest
199
205
  } = props;
200
206
 
@@ -233,6 +239,7 @@ export function ViewPage<T extends DataTypes.StringRecord>(
233
239
  justifyContent="left"
234
240
  spacing={paddings}
235
241
  className="ET-ViewPage"
242
+ ref={gridRef}
236
243
  sx={{
237
244
  '.MuiTypography-subtitle2': {
238
245
  fontWeight: 'bold'