@etsoo/materialui 1.0.72 → 1.0.74
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 -1
- package/lib/pages/ViewPage.js +2 -1
- package/package.json +1 -1
- package/src/pages/ViewPage.tsx +16 -16
package/lib/pages/ViewPage.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ declare type ViewPageFieldTypeNarrow<T extends object> = (string & keyof T) | [s
|
|
|
33
33
|
/**
|
|
34
34
|
* View page field type
|
|
35
35
|
*/
|
|
36
|
-
export declare type ViewPageFieldType<T extends object> = ViewPageFieldTypeNarrow<T>
|
|
36
|
+
export declare type ViewPageFieldType<T extends object> = ViewPageFieldTypeNarrow<T> | ((data: T) => React.ReactNode);
|
|
37
37
|
/**
|
|
38
38
|
* View page props
|
|
39
39
|
*/
|
package/lib/pages/ViewPage.js
CHANGED
|
@@ -107,7 +107,8 @@ export function ViewPage(props) {
|
|
|
107
107
|
":"),
|
|
108
108
|
typeof itemData === 'object' ? (itemData) : (React.createElement(Typography, { variant: "subtitle2" }, itemData))));
|
|
109
109
|
})),
|
|
110
|
-
|
|
110
|
+
React.createElement(Stack, { className: "ET-ViewPage-Actions", direction: "row", width: "100%", flexWrap: "wrap", justifyContent: "flex-end", paddingTop: actions == null ? undefined : paddings, paddingBottom: paddings, gap: paddings }, actions != null &&
|
|
111
|
+
Utils.getResult(actions, data, refresh)),
|
|
111
112
|
Utils.getResult(children, data, refresh),
|
|
112
113
|
pullToRefresh && (React.createElement(PullToRefreshUI, { mainElement: pullContainer, triggerElement: pullContainer, instructionsPullToRefresh: labels.pullToRefresh, instructionsReleaseToRefresh: labels.releaseToRefresh, instructionsRefreshing: labels.refreshing, onRefresh: refresh, shouldPullToRefresh: () => {
|
|
113
114
|
const container = document.querySelector(pullContainer);
|
package/package.json
CHANGED
package/src/pages/ViewPage.tsx
CHANGED
|
@@ -56,8 +56,9 @@ type ViewPageFieldTypeNarrow<T extends object> =
|
|
|
56
56
|
/**
|
|
57
57
|
* View page field type
|
|
58
58
|
*/
|
|
59
|
-
export type ViewPageFieldType<T extends object> =
|
|
60
|
-
|
|
59
|
+
export type ViewPageFieldType<T extends object> =
|
|
60
|
+
| ViewPageFieldTypeNarrow<T>
|
|
61
|
+
| ((data: T) => React.ReactNode);
|
|
61
62
|
|
|
62
63
|
/**
|
|
63
64
|
* View page props
|
|
@@ -267,20 +268,19 @@ export function ViewPage<T extends DataTypes.StringRecord>(
|
|
|
267
268
|
);
|
|
268
269
|
})}
|
|
269
270
|
</Grid>
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
)}
|
|
271
|
+
<Stack
|
|
272
|
+
className="ET-ViewPage-Actions"
|
|
273
|
+
direction="row"
|
|
274
|
+
width="100%"
|
|
275
|
+
flexWrap="wrap"
|
|
276
|
+
justifyContent="flex-end"
|
|
277
|
+
paddingTop={actions == null ? undefined : paddings}
|
|
278
|
+
paddingBottom={paddings}
|
|
279
|
+
gap={paddings}
|
|
280
|
+
>
|
|
281
|
+
{actions != null &&
|
|
282
|
+
Utils.getResult(actions, data, refresh)}
|
|
283
|
+
</Stack>
|
|
284
284
|
{Utils.getResult(children, data, refresh)}
|
|
285
285
|
{pullToRefresh && (
|
|
286
286
|
<PullToRefreshUI
|