@etsoo/react 1.4.68 → 1.4.69

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.
@@ -35,7 +35,7 @@ export interface ViewPageProps<T extends {}> extends Exclude<CommonPageProps, 'c
35
35
  /**
36
36
  * Actions
37
37
  */
38
- actions?: (data: T) => React.ReactNode;
38
+ actions?: React.ReactNode | ((data: T) => React.ReactNode);
39
39
  /**
40
40
  * Children
41
41
  */
@@ -1,8 +1,7 @@
1
1
  import { Utils } from '@etsoo/shared';
2
- import { Grid, LinearProgress, Typography } from '@mui/material';
2
+ import { Grid, LinearProgress, Stack, Typography } from '@mui/material';
3
3
  import React from 'react';
4
4
  import { globalApp } from '../../app/ReactApp';
5
- import { HBox } from '../FlexBox';
6
5
  import { GridDataFormat } from '../GridDataFormat';
7
6
  import { MUGlobal } from '../MUGlobal';
8
7
  import { CommonPage } from './CommonPage';
@@ -87,6 +86,6 @@ export function ViewPage(props) {
87
86
  ":"),
88
87
  React.createElement(Typography, { variant: "subtitle2" }, itemData)));
89
88
  })),
90
- actions != null && (React.createElement(HBox, { paddingTop: paddings, paddingBottom: paddings }, actions)),
89
+ actions != null && (React.createElement(Stack, { direction: "row", width: "100%", flexWrap: "wrap", paddingTop: paddings, paddingBottom: paddings }, Utils.getResult(actions, data))),
91
90
  Utils.getResult(children, data)))));
92
91
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.4.68",
3
+ "version": "1.4.69",
4
4
  "description": "TypeScript ReactJs framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -1,12 +1,17 @@
1
1
  import { Utils } from '@etsoo/shared';
2
- import { Grid, GridProps, LinearProgress, Typography } from '@mui/material';
2
+ import {
3
+ Grid,
4
+ GridProps,
5
+ LinearProgress,
6
+ Stack,
7
+ Typography
8
+ } from '@mui/material';
3
9
  import React from 'react';
4
10
  import { globalApp } from '../../app/ReactApp';
5
11
  import {
6
12
  GridColumnRenderProps,
7
13
  GridDataType
8
14
  } from '../../components/GridColumn';
9
- import { HBox } from '../FlexBox';
10
15
  import { GridDataFormat } from '../GridDataFormat';
11
16
  import { MUGlobal } from '../MUGlobal';
12
17
  import { CommonPage } from './CommonPage';
@@ -55,7 +60,7 @@ export interface ViewPageProps<T extends {}>
55
60
  /**
56
61
  * Actions
57
62
  */
58
- actions?: (data: T) => React.ReactNode;
63
+ actions?: React.ReactNode | ((data: T) => React.ReactNode);
59
64
 
60
65
  /**
61
66
  * Children
@@ -211,9 +216,15 @@ export function ViewPage<T extends {}>(props: ViewPageProps<T>) {
211
216
  })}
212
217
  </Grid>
213
218
  {actions != null && (
214
- <HBox paddingTop={paddings} paddingBottom={paddings}>
215
- {actions}
216
- </HBox>
219
+ <Stack
220
+ direction="row"
221
+ width="100%"
222
+ flexWrap="wrap"
223
+ paddingTop={paddings}
224
+ paddingBottom={paddings}
225
+ >
226
+ {Utils.getResult(actions, data)}
227
+ </Stack>
217
228
  )}
218
229
  {Utils.getResult(children, data)}
219
230
  </React.Fragment>