@etsoo/materialui 1.2.70 → 1.2.72
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/pages/ViewPage.d.ts +1 -0
- package/lib/pages/ViewPage.js +10 -2
- package/package.json +1 -1
- package/src/pages/ViewPage.tsx +11 -2
package/lib/pages/ViewPage.d.ts
CHANGED
package/lib/pages/ViewPage.js
CHANGED
|
@@ -15,9 +15,17 @@ import { CommonPage } from "./CommonPage";
|
|
|
15
15
|
*/
|
|
16
16
|
export function ViewPageGridItem(props) {
|
|
17
17
|
// Destruct
|
|
18
|
-
const { data, label, ...gridProps } = props;
|
|
18
|
+
const { data, label, singleRow, ...gridProps } = props;
|
|
19
|
+
// Default options
|
|
20
|
+
let options = {};
|
|
21
|
+
if (gridProps.xs == null && gridProps.md == null) {
|
|
22
|
+
options = getResp(singleRow !== null && singleRow !== void 0 ? singleRow : "small");
|
|
23
|
+
}
|
|
24
|
+
else if (singleRow != null) {
|
|
25
|
+
options = getResp(singleRow !== null && singleRow !== void 0 ? singleRow : "small");
|
|
26
|
+
}
|
|
19
27
|
// Layout
|
|
20
|
-
return (React.createElement(Grid, { item: true, ...gridProps },
|
|
28
|
+
return (React.createElement(Grid, { item: true, ...gridProps, ...options },
|
|
21
29
|
label != null && (React.createElement(Typography, { variant: "caption", component: "div" },
|
|
22
30
|
label,
|
|
23
31
|
":")),
|
package/package.json
CHANGED
package/src/pages/ViewPage.tsx
CHANGED
|
@@ -26,6 +26,7 @@ import { CommonPageProps } from "./CommonPageProps";
|
|
|
26
26
|
export type ViewPageGridItemProps = GridProps & {
|
|
27
27
|
data: React.ReactNode;
|
|
28
28
|
label?: React.ReactNode;
|
|
29
|
+
singleRow?: ViewPageRowType;
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
/**
|
|
@@ -35,11 +36,19 @@ export type ViewPageGridItemProps = GridProps & {
|
|
|
35
36
|
*/
|
|
36
37
|
export function ViewPageGridItem(props: ViewPageGridItemProps) {
|
|
37
38
|
// Destruct
|
|
38
|
-
const { data, label, ...gridProps } = props;
|
|
39
|
+
const { data, label, singleRow, ...gridProps } = props;
|
|
40
|
+
|
|
41
|
+
// Default options
|
|
42
|
+
let options = {};
|
|
43
|
+
if (gridProps.xs == null && gridProps.md == null) {
|
|
44
|
+
options = getResp(singleRow ?? "small");
|
|
45
|
+
} else if (singleRow != null) {
|
|
46
|
+
options = getResp(singleRow ?? "small");
|
|
47
|
+
}
|
|
39
48
|
|
|
40
49
|
// Layout
|
|
41
50
|
return (
|
|
42
|
-
<Grid item {...gridProps}>
|
|
51
|
+
<Grid item {...gridProps} {...options}>
|
|
43
52
|
{label != null && (
|
|
44
53
|
<Typography variant="caption" component="div">
|
|
45
54
|
{label}:
|