@etsoo/materialui 1.5.27 → 1.5.28

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.
@@ -29,6 +29,10 @@ export interface CommonPageProps extends Omit<ContainerProps, "id"> {
29
29
  * Add panel to the Fab
30
30
  */
31
31
  fabPanel?: boolean;
32
+ /**
33
+ * Fab refresh button is supported or not
34
+ */
35
+ fabRefresh?: boolean;
32
36
  /**
33
37
  * Fab lays in the top
34
38
  */
@@ -25,7 +25,7 @@ function CommonPage(props) {
25
25
  // Global app
26
26
  const app = (0, ReactApp_1.useAppContext)();
27
27
  // Destruct
28
- const { children, disableGutters = true, fabTop, fabButtons, fabColumnDirection, fabPanel, fabPaddingAdjust = 1.5, fabSize = "small", maxWidth = false, moreActions, onRefresh, onUpdate, onUpdateAll, paddings = MUGlobal_1.MUGlobal.pagePaddings, scrollContainer, supportBack = false, targetFields, sx = {}, ...rest } = props;
28
+ const { children, disableGutters = true, fabTop, fabButtons, fabColumnDirection, fabPanel, fabPaddingAdjust = 1.5, fabSize = "small", maxWidth = false, moreActions, onRefresh, onUpdate, onUpdateAll, paddings = MUGlobal_1.MUGlobal.pagePaddings, scrollContainer, supportBack = false, targetFields, fabRefresh = onRefresh != null, sx = {}, ...rest } = props;
29
29
  // Fab padding
30
30
  const fabPadding = MUGlobal_1.MUGlobal.increase(MUGlobal_1.MUGlobal.pagePaddings, fabPaddingAdjust);
31
31
  if (typeof sx === "object" && sx != null && !Reflect.has(sx, "padding")) {
@@ -74,5 +74,5 @@ function CommonPage(props) {
74
74
  bottom: distance,
75
75
  right: distance
76
76
  })
77
- }, columnDirection: fabColumnDirection, fabPanel: fabPanel, children: [scrollContainer && ((0, jsx_runtime_1.jsx)(ScrollTopFab_1.ScrollTopFab, { size: fabSize, target: scrollContainer, title: labels.scrollTop })), fabButtons, onRefresh != null && ((0, jsx_runtime_1.jsx)(Fab_1.default, { title: labels.refresh, size: fabSize, onClick: onRefresh, sx: { display: { xs: "none", md: "inherit" } }, children: (0, jsx_runtime_1.jsx)(Refresh_1.default, {}) })), (0, jsx_runtime_1.jsx)(MoreFab_1.MoreFab, { size: fabSize, title: labels.more, actions: moreActions }), supportBack && (0, jsx_runtime_1.jsx)(BackButton_1.BackButton, { title: labels.back, size: fabSize })] }), children] })] }));
77
+ }, columnDirection: fabColumnDirection, fabPanel: fabPanel, children: [scrollContainer && ((0, jsx_runtime_1.jsx)(ScrollTopFab_1.ScrollTopFab, { size: fabSize, target: scrollContainer, title: labels.scrollTop })), fabButtons, fabRefresh && ((0, jsx_runtime_1.jsx)(Fab_1.default, { title: labels.refresh, size: fabSize, onClick: onRefresh, sx: { display: { xs: "none", md: "inherit" } }, children: (0, jsx_runtime_1.jsx)(Refresh_1.default, {}) })), (0, jsx_runtime_1.jsx)(MoreFab_1.MoreFab, { size: fabSize, title: labels.more, actions: moreActions }), supportBack && (0, jsx_runtime_1.jsx)(BackButton_1.BackButton, { title: labels.back, size: fabSize })] }), children] })] }));
78
78
  }
@@ -29,6 +29,10 @@ export interface CommonPageProps extends Omit<ContainerProps, "id"> {
29
29
  * Add panel to the Fab
30
30
  */
31
31
  fabPanel?: boolean;
32
+ /**
33
+ * Fab refresh button is supported or not
34
+ */
35
+ fabRefresh?: boolean;
32
36
  /**
33
37
  * Fab lays in the top
34
38
  */
@@ -19,7 +19,7 @@ export function CommonPage(props) {
19
19
  // Global app
20
20
  const app = useAppContext();
21
21
  // Destruct
22
- const { children, disableGutters = true, fabTop, fabButtons, fabColumnDirection, fabPanel, fabPaddingAdjust = 1.5, fabSize = "small", maxWidth = false, moreActions, onRefresh, onUpdate, onUpdateAll, paddings = MUGlobal.pagePaddings, scrollContainer, supportBack = false, targetFields, sx = {}, ...rest } = props;
22
+ const { children, disableGutters = true, fabTop, fabButtons, fabColumnDirection, fabPanel, fabPaddingAdjust = 1.5, fabSize = "small", maxWidth = false, moreActions, onRefresh, onUpdate, onUpdateAll, paddings = MUGlobal.pagePaddings, scrollContainer, supportBack = false, targetFields, fabRefresh = onRefresh != null, sx = {}, ...rest } = props;
23
23
  // Fab padding
24
24
  const fabPadding = MUGlobal.increase(MUGlobal.pagePaddings, fabPaddingAdjust);
25
25
  if (typeof sx === "object" && sx != null && !Reflect.has(sx, "padding")) {
@@ -68,5 +68,5 @@ export function CommonPage(props) {
68
68
  bottom: distance,
69
69
  right: distance
70
70
  })
71
- }, columnDirection: fabColumnDirection, fabPanel: fabPanel, children: [scrollContainer && (_jsx(ScrollTopFab, { size: fabSize, target: scrollContainer, title: labels.scrollTop })), fabButtons, onRefresh != null && (_jsx(Fab, { title: labels.refresh, size: fabSize, onClick: onRefresh, sx: { display: { xs: "none", md: "inherit" } }, children: _jsx(RefreshIcon, {}) })), _jsx(MoreFab, { size: fabSize, title: labels.more, actions: moreActions }), supportBack && _jsx(BackButton, { title: labels.back, size: fabSize })] }), children] })] }));
71
+ }, columnDirection: fabColumnDirection, fabPanel: fabPanel, children: [scrollContainer && (_jsx(ScrollTopFab, { size: fabSize, target: scrollContainer, title: labels.scrollTop })), fabButtons, fabRefresh && (_jsx(Fab, { title: labels.refresh, size: fabSize, onClick: onRefresh, sx: { display: { xs: "none", md: "inherit" } }, children: _jsx(RefreshIcon, {}) })), _jsx(MoreFab, { size: fabSize, title: labels.more, actions: moreActions }), supportBack && _jsx(BackButton, { title: labels.back, size: fabSize })] }), children] })] }));
72
72
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.5.27",
3
+ "version": "1.5.28",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -44,6 +44,11 @@ export interface CommonPageProps extends Omit<ContainerProps, "id"> {
44
44
  */
45
45
  fabPanel?: boolean;
46
46
 
47
+ /**
48
+ * Fab refresh button is supported or not
49
+ */
50
+ fabRefresh?: boolean;
51
+
47
52
  /**
48
53
  * Fab lays in the top
49
54
  */
@@ -117,6 +122,7 @@ export function CommonPage(props: CommonPageProps) {
117
122
  scrollContainer,
118
123
  supportBack = false,
119
124
  targetFields,
125
+ fabRefresh = onRefresh != null,
120
126
  sx = {},
121
127
  ...rest
122
128
  } = props;
@@ -208,7 +214,7 @@ export function CommonPage(props: CommonPageProps) {
208
214
  />
209
215
  )}
210
216
  {fabButtons}
211
- {onRefresh != null && (
217
+ {fabRefresh && (
212
218
  <Fab
213
219
  title={labels.refresh}
214
220
  size={fabSize}