@etsoo/react 1.4.65 → 1.4.70
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.
|
@@ -31,11 +31,15 @@ declare type ViewPageFieldType<T> = (string & keyof T) | [string & keyof T, Grid
|
|
|
31
31
|
/**
|
|
32
32
|
* View page props
|
|
33
33
|
*/
|
|
34
|
-
export interface ViewPageProps<T extends {}> extends CommonPageProps {
|
|
34
|
+
export interface ViewPageProps<T extends {}> extends Exclude<CommonPageProps, 'children'> {
|
|
35
35
|
/**
|
|
36
36
|
* Actions
|
|
37
37
|
*/
|
|
38
|
-
actions?: React.ReactNode;
|
|
38
|
+
actions?: React.ReactNode | ((data: T) => React.ReactNode);
|
|
39
|
+
/**
|
|
40
|
+
* Children
|
|
41
|
+
*/
|
|
42
|
+
children?: React.ReactNode | ((data: T) => React.ReactNode);
|
|
39
43
|
/**
|
|
40
44
|
* Fields to display
|
|
41
45
|
*/
|
package/lib/mu/pages/ViewPage.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Utils } from '@etsoo/shared';
|
|
2
|
+
import { Grid, LinearProgress, Stack, Typography } from '@mui/material';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { globalApp } from '../../app/ReactApp';
|
|
4
|
-
import { HBox } from '../FlexBox';
|
|
5
5
|
import { GridDataFormat } from '../GridDataFormat';
|
|
6
6
|
import { MUGlobal } from '../MUGlobal';
|
|
7
7
|
import { CommonPage } from './CommonPage';
|
|
@@ -86,6 +86,6 @@ export function ViewPage(props) {
|
|
|
86
86
|
":"),
|
|
87
87
|
React.createElement(Typography, { variant: "subtitle2" }, itemData)));
|
|
88
88
|
})),
|
|
89
|
-
actions != null && (React.createElement(
|
|
90
|
-
children))));
|
|
89
|
+
actions != null && (React.createElement(Stack, { direction: "row", width: "100%", flexWrap: "wrap", paddingTop: paddings, paddingBottom: paddings, gap: paddings }, Utils.getResult(actions, data))),
|
|
90
|
+
Utils.getResult(children, data)))));
|
|
91
91
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/react",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.70",
|
|
4
4
|
"description": "TypeScript ReactJs framework",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"@etsoo/appscript": "^1.2.27",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.0",
|
|
55
55
|
"@etsoo/shared": "^1.1.6",
|
|
56
|
-
"@mui/icons-material": "^5.3.
|
|
57
|
-
"@mui/material": "^5.3.
|
|
56
|
+
"@mui/icons-material": "^5.3.1",
|
|
57
|
+
"@mui/material": "^5.3.1",
|
|
58
58
|
"@reach/router": "^1.3.4",
|
|
59
59
|
"@types/pica": "^5.1.3",
|
|
60
60
|
"@types/pulltorefreshjs": "^0.1.5",
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"@babel/runtime-corejs3": "^7.16.8",
|
|
84
84
|
"@types/jest": "^27.4.0",
|
|
85
85
|
"@types/react-test-renderer": "^17.0.1",
|
|
86
|
-
"@typescript-eslint/eslint-plugin": "^5.10.
|
|
87
|
-
"@typescript-eslint/parser": "^5.10.
|
|
86
|
+
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
|
87
|
+
"@typescript-eslint/parser": "^5.10.1",
|
|
88
88
|
"eslint": "^8.7.0",
|
|
89
89
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
90
90
|
"eslint-plugin-import": "^2.25.4",
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Utils } from '@etsoo/shared';
|
|
2
|
+
import {
|
|
3
|
+
Grid,
|
|
4
|
+
GridProps,
|
|
5
|
+
LinearProgress,
|
|
6
|
+
Stack,
|
|
7
|
+
Typography
|
|
8
|
+
} from '@mui/material';
|
|
2
9
|
import React from 'react';
|
|
3
10
|
import { globalApp } from '../../app/ReactApp';
|
|
4
11
|
import {
|
|
5
12
|
GridColumnRenderProps,
|
|
6
13
|
GridDataType
|
|
7
14
|
} from '../../components/GridColumn';
|
|
8
|
-
import { HBox } from '../FlexBox';
|
|
9
15
|
import { GridDataFormat } from '../GridDataFormat';
|
|
10
16
|
import { MUGlobal } from '../MUGlobal';
|
|
11
17
|
import { CommonPage } from './CommonPage';
|
|
@@ -49,11 +55,17 @@ type ViewPageFieldType<T> =
|
|
|
49
55
|
/**
|
|
50
56
|
* View page props
|
|
51
57
|
*/
|
|
52
|
-
export interface ViewPageProps<T extends {}>
|
|
58
|
+
export interface ViewPageProps<T extends {}>
|
|
59
|
+
extends Exclude<CommonPageProps, 'children'> {
|
|
53
60
|
/**
|
|
54
61
|
* Actions
|
|
55
62
|
*/
|
|
56
|
-
actions?: React.ReactNode;
|
|
63
|
+
actions?: React.ReactNode | ((data: T) => React.ReactNode);
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Children
|
|
67
|
+
*/
|
|
68
|
+
children?: React.ReactNode | ((data: T) => React.ReactNode);
|
|
57
69
|
|
|
58
70
|
/**
|
|
59
71
|
* Fields to display
|
|
@@ -204,11 +216,18 @@ export function ViewPage<T extends {}>(props: ViewPageProps<T>) {
|
|
|
204
216
|
})}
|
|
205
217
|
</Grid>
|
|
206
218
|
{actions != null && (
|
|
207
|
-
<
|
|
208
|
-
|
|
209
|
-
|
|
219
|
+
<Stack
|
|
220
|
+
direction="row"
|
|
221
|
+
width="100%"
|
|
222
|
+
flexWrap="wrap"
|
|
223
|
+
paddingTop={paddings}
|
|
224
|
+
paddingBottom={paddings}
|
|
225
|
+
gap={paddings}
|
|
226
|
+
>
|
|
227
|
+
{Utils.getResult(actions, data)}
|
|
228
|
+
</Stack>
|
|
210
229
|
)}
|
|
211
|
-
{children}
|
|
230
|
+
{Utils.getResult(children, data)}
|
|
212
231
|
</React.Fragment>
|
|
213
232
|
)}
|
|
214
233
|
</CommonPage>
|