@etsoo/materialui 1.1.97 → 1.1.99

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/FabBox.d.ts CHANGED
@@ -12,6 +12,10 @@ export type FabBoxProps = BoxProps & {
12
12
  * Flex direction, row or column
13
13
  */
14
14
  columnDirection?: boolean;
15
+ /**
16
+ * Add panel to the Fab
17
+ */
18
+ fabPanel?: boolean;
15
19
  };
16
20
  /**
17
21
  * Fabs container box
package/lib/FabBox.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Box, useTheme } from "@mui/material";
1
+ import { Box, Paper, useTheme } from "@mui/material";
2
2
  import React from "react";
3
3
  /**
4
4
  * Fabs container box
@@ -7,7 +7,7 @@ import React from "react";
7
7
  */
8
8
  export function FabBox(props) {
9
9
  // Destruct
10
- const { columnDirection, itemGap = 1, sx, ...rest } = props;
10
+ const { columnDirection, fabPanel = columnDirection, itemGap = 1, sx, ...rest } = props;
11
11
  // Theme
12
12
  const theme = useTheme();
13
13
  const spaceGap = theme.spacing(itemGap);
@@ -17,13 +17,13 @@ export function FabBox(props) {
17
17
  const margin = columnDirection
18
18
  ? { marginTop: spaceGap }
19
19
  : { marginLeft: spaceGap };
20
- return (React.createElement(Box, { sx: {
20
+ const box = (React.createElement(Box, { sx: {
21
21
  position: "fixed",
22
22
  display: "flex",
23
23
  alignItems: "center",
24
- background: "rgba(255, 255, 255, .4)",
25
24
  flexDirection: columnDirection ? "column" : "row",
26
25
  "& > :not(style) + :not(style)": margin,
27
26
  ...sx
28
27
  }, ...rest }));
28
+ return fabPanel ? React.createElement(Paper, { sx: { padding: spaceGap } }, box) : box;
29
29
  }
@@ -13,9 +13,15 @@ export type ResponsibleContainerProps<T extends object, F extends DataTypes.Basi
13
13
  * Height will be deducted
14
14
  * @param height Current calcuated height
15
15
  * @param rect Current rect data
16
+ */
17
+ adjustHeight?: (height: number, rect: DOMRect) => number;
18
+ /**
19
+ *
20
+ * @param height Current height
16
21
  * @param isGrid Is displaying DataGrid
22
+ * @returns Adjusted height
17
23
  */
18
- adjustHeight?: (height: number, rect: DOMRect, isGrid: boolean) => number;
24
+ adjustFabHeight?: (height: number, isGrid: boolean) => number;
19
25
  /**
20
26
  * Columns
21
27
  */
@@ -22,7 +22,7 @@ function defaultContainerBoxSx(paddings, hasField, _dataGrid) {
22
22
  */
23
23
  export function ResponsibleContainer(props) {
24
24
  // Destruct
25
- const { adjustHeight, columns, containerBoxSx = defaultContainerBoxSx, dataGridMinWidth = Math.max(576, DataGridExCalColumns(columns).total), elementReady, fields, fieldTemplate, height, loadData, mRef, paddings = MUGlobal.pagePaddings, pullToRefresh = true, quickAction, sizeReadyMiliseconds = 0, searchBarHeight = 45.6, ...rest } = props;
25
+ const { adjustHeight, adjustFabHeight, columns, containerBoxSx = defaultContainerBoxSx, dataGridMinWidth = Math.max(576, DataGridExCalColumns(columns).total), elementReady, fields, fieldTemplate, height, loadData, mRef, paddings = MUGlobal.pagePaddings, pullToRefresh = true, quickAction, sizeReadyMiliseconds = 0, searchBarHeight = 45.6, ...rest } = props;
26
26
  // Labels
27
27
  const labels = Labels.CommonPage;
28
28
  // Refs
@@ -95,8 +95,10 @@ export function ResponsibleContainer(props) {
95
95
  if (!isNaN(boxMargin))
96
96
  heightLocal -= 3 * boxMargin; // 1 - Box, 2 - Page bottom
97
97
  if (adjustHeight != null)
98
- heightLocal -= adjustHeight(heightLocal, rect, showDataGrid);
98
+ heightLocal -= adjustHeight(heightLocal, rect);
99
99
  }
100
+ if (adjustFabHeight)
101
+ heightLocal = adjustFabHeight(heightLocal, showDataGrid);
100
102
  if (showDataGrid) {
101
103
  // Delete
102
104
  delete rest.itemRenderer;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { CommonPageProps } from './CommonPageProps';
2
+ import { CommonPageProps } from "./CommonPageProps";
3
3
  /**
4
4
  * Default scroll container
5
5
  */
@@ -1,13 +1,13 @@
1
- import React from 'react';
2
- import { FabBox } from '../FabBox';
3
- import { ScrollTopFab } from '../ScrollTopFab';
4
- import { MUGlobal } from '../MUGlobal';
5
- import { MoreFab } from '../MoreFab';
6
- import { Container, Fab } from '@mui/material';
7
- import RefreshIcon from '@mui/icons-material/Refresh';
8
- import { BackButton } from '../BackButton';
9
- import { Labels } from '../app/Labels';
10
- import { ReactAppStateDetector } from '../app/ReactApp';
1
+ import React from "react";
2
+ import { FabBox } from "../FabBox";
3
+ import { ScrollTopFab } from "../ScrollTopFab";
4
+ import { MUGlobal } from "../MUGlobal";
5
+ import { MoreFab } from "../MoreFab";
6
+ import { Container, Fab } from "@mui/material";
7
+ import RefreshIcon from "@mui/icons-material/Refresh";
8
+ import { BackButton } from "../BackButton";
9
+ import { Labels } from "../app/Labels";
10
+ import { ReactAppStateDetector } from "../app/ReactApp";
11
11
  /**
12
12
  * Default scroll container
13
13
  */
@@ -18,12 +18,12 @@ export const CommonPageScrollContainer = global;
18
18
  */
19
19
  export function CommonPage(props) {
20
20
  // Destruct
21
- const { children, disableGutters = true, fabButtons, fabColumnDirection, fabPaddingAdjust = 1.5, fabSize = 'small', maxWidth = false, moreActions, onRefresh, onUpdate, onUpdateAll, paddings = MUGlobal.pagePaddings, scrollContainer, supportBack = false, targetFields, sx = {}, ...rest } = props;
21
+ const { children, disableGutters = true, 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
22
  // Fab padding
23
23
  const fabPadding = MUGlobal.increase(MUGlobal.pagePaddings, fabPaddingAdjust);
24
- if (typeof sx === 'object' && sx != null && !Reflect.has(sx, 'padding')) {
24
+ if (typeof sx === "object" && sx != null && !Reflect.has(sx, "padding")) {
25
25
  // Set default padding
26
- Reflect.set(sx, 'padding', paddings);
26
+ Reflect.set(sx, "padding", paddings);
27
27
  }
28
28
  // Labels
29
29
  const labels = Labels.CommonPage;
@@ -49,12 +49,12 @@ export function CommonPage(props) {
49
49
  zIndex: 1,
50
50
  bottom: (theme) => MUGlobal.updateWithTheme(fabPadding, theme.spacing),
51
51
  right: (theme) => MUGlobal.updateWithTheme(fabPadding, theme.spacing)
52
- }, columnDirection: fabColumnDirection },
52
+ }, columnDirection: fabColumnDirection, fabPanel: fabPanel },
53
53
  scrollContainer && (React.createElement(ScrollTopFab, { size: fabSize, target: scrollContainer, title: labels.scrollTop })),
54
54
  fabButtons,
55
- onRefresh != null && (React.createElement(Fab, { title: labels.refresh, size: fabSize, onClick: onRefresh, sx: { display: { xs: 'none', md: 'inherit' } } },
55
+ onRefresh != null && (React.createElement(Fab, { title: labels.refresh, size: fabSize, onClick: onRefresh, sx: { display: { xs: "none", md: "inherit" } } },
56
56
  React.createElement(RefreshIcon, null))),
57
57
  React.createElement(MoreFab, { size: fabSize, title: labels.more, actions: moreActions }),
58
- supportBack && (React.createElement(BackButton, { title: labels.back, size: fabSize }))),
58
+ supportBack && React.createElement(BackButton, { title: labels.back, size: fabSize })),
59
59
  children)));
60
60
  }
@@ -1,13 +1,13 @@
1
1
  /// <reference types="react" />
2
- import { UserKey } from '@etsoo/appscript';
3
- import { IStateUpdate, ListItemReact } from '@etsoo/react';
4
- import { ContainerProps } from '@mui/material';
5
- import { CustomFabSize } from '../CustomFabProps';
2
+ import { UserKey } from "@etsoo/appscript";
3
+ import { IStateUpdate, ListItemReact } from "@etsoo/react";
4
+ import { ContainerProps } from "@mui/material";
5
+ import { CustomFabSize } from "../CustomFabProps";
6
6
  /**
7
7
  * Common page props
8
8
  * Default container id is 'pageContainer'
9
9
  */
10
- export interface CommonPageProps extends Omit<ContainerProps, 'id'> {
10
+ export interface CommonPageProps extends Omit<ContainerProps, "id"> {
11
11
  /**
12
12
  * Fab buttons
13
13
  */
@@ -24,6 +24,10 @@ export interface CommonPageProps extends Omit<ContainerProps, 'id'> {
24
24
  * Fab padding adjust
25
25
  */
26
26
  fabPaddingAdjust?: number;
27
+ /**
28
+ * Add panel to the Fab
29
+ */
30
+ fabPanel?: boolean;
27
31
  /**
28
32
  * More actions
29
33
  */
@@ -1,13 +1,20 @@
1
1
  /// <reference types="react" />
2
- import { GridMethodRef } from '@etsoo/react';
3
- import { DataTypes, IdDefaultType } from '@etsoo/shared';
4
- import { ListChildComponentProps } from 'react-window';
5
- import { ScrollerListExInnerItemRendererProps, ScrollerListExItemSize } from '../ScrollerListEx';
6
- import { DataGridPageProps } from './DataGridPageProps';
2
+ import { GridMethodRef } from "@etsoo/react";
3
+ import { DataTypes, IdDefaultType } from "@etsoo/shared";
4
+ import { ListChildComponentProps } from "react-window";
5
+ import { ScrollerListExInnerItemRendererProps, ScrollerListExItemSize } from "../ScrollerListEx";
6
+ import { DataGridPageProps } from "./DataGridPageProps";
7
7
  /**
8
8
  * Response page props
9
9
  */
10
- export type ResponsePageProps<T extends object, F extends DataTypes.BasicTemplate, D extends DataTypes.Keys<T> = IdDefaultType<T>> = Omit<DataGridPageProps<T, F, D>, 'mRef' | 'itemKey' | 'onScroll' | 'onItemsRendered'> & {
10
+ export type ResponsePageProps<T extends object, F extends DataTypes.BasicTemplate, D extends DataTypes.Keys<T> = IdDefaultType<T>> = Omit<DataGridPageProps<T, F, D>, "mRef" | "itemKey" | "onScroll" | "onItemsRendered"> & {
11
+ /**
12
+ *
13
+ * @param height Current height
14
+ * @param isGrid Is displaying DataGrid
15
+ * @returns Adjusted height
16
+ */
17
+ adjustFabHeight?: (height: number, isGrid: boolean) => number;
11
18
  /**
12
19
  * Min width to show Datagrid
13
20
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.1.97",
3
+ "version": "1.1.99",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
package/src/FabBox.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import { Box, BoxProps, useTheme } from "@mui/material";
1
+ import { Box, BoxProps, Paper, useTheme } from "@mui/material";
2
2
  import React from "react";
3
3
 
4
4
  /**
@@ -14,6 +14,11 @@ export type FabBoxProps = BoxProps & {
14
14
  * Flex direction, row or column
15
15
  */
16
16
  columnDirection?: boolean;
17
+
18
+ /**
19
+ * Add panel to the Fab
20
+ */
21
+ fabPanel?: boolean;
17
22
  };
18
23
 
19
24
  /**
@@ -23,7 +28,13 @@ export type FabBoxProps = BoxProps & {
23
28
  */
24
29
  export function FabBox(props: FabBoxProps) {
25
30
  // Destruct
26
- const { columnDirection, itemGap = 1, sx, ...rest } = props;
31
+ const {
32
+ columnDirection,
33
+ fabPanel = columnDirection,
34
+ itemGap = 1,
35
+ sx,
36
+ ...rest
37
+ } = props;
27
38
 
28
39
  // Theme
29
40
  const theme = useTheme();
@@ -36,13 +47,12 @@ export function FabBox(props: FabBoxProps) {
36
47
  ? { marginTop: spaceGap }
37
48
  : { marginLeft: spaceGap };
38
49
 
39
- return (
50
+ const box = (
40
51
  <Box
41
52
  sx={{
42
53
  position: "fixed",
43
54
  display: "flex",
44
55
  alignItems: "center",
45
- background: "rgba(255, 255, 255, .4)",
46
56
  flexDirection: columnDirection ? "column" : "row",
47
57
  "& > :not(style) + :not(style)": margin,
48
58
  ...sx
@@ -50,4 +60,6 @@ export function FabBox(props: FabBoxProps) {
50
60
  {...rest}
51
61
  />
52
62
  );
63
+
64
+ return fabPanel ? <Paper sx={{ padding: spaceGap }}>{box}</Paper> : box;
53
65
  }
@@ -42,9 +42,16 @@ export type ResponsibleContainerProps<
42
42
  * Height will be deducted
43
43
  * @param height Current calcuated height
44
44
  * @param rect Current rect data
45
+ */
46
+ adjustHeight?: (height: number, rect: DOMRect) => number;
47
+
48
+ /**
49
+ *
50
+ * @param height Current height
45
51
  * @param isGrid Is displaying DataGrid
52
+ * @returns Adjusted height
46
53
  */
47
- adjustHeight?: (height: number, rect: DOMRect, isGrid: boolean) => number;
54
+ adjustFabHeight?: (height: number, isGrid: boolean) => number;
48
55
 
49
56
  /**
50
57
  * Columns
@@ -172,6 +179,7 @@ export function ResponsibleContainer<
172
179
  // Destruct
173
180
  const {
174
181
  adjustHeight,
182
+ adjustFabHeight,
175
183
  columns,
176
184
  containerBoxSx = defaultContainerBoxSx,
177
185
  dataGridMinWidth = Math.max(576, DataGridExCalColumns(columns).total),
@@ -279,10 +287,12 @@ export function ResponsibleContainer<
279
287
  const boxMargin = parseFloat(style.marginBottom);
280
288
  if (!isNaN(boxMargin)) heightLocal -= 3 * boxMargin; // 1 - Box, 2 - Page bottom
281
289
 
282
- if (adjustHeight != null)
283
- heightLocal -= adjustHeight(heightLocal, rect, showDataGrid);
290
+ if (adjustHeight != null) heightLocal -= adjustHeight(heightLocal, rect);
284
291
  }
285
292
 
293
+ if (adjustFabHeight)
294
+ heightLocal = adjustFabHeight(heightLocal, showDataGrid);
295
+
286
296
  if (showDataGrid) {
287
297
  // Delete
288
298
  delete rest.itemRenderer;
@@ -1,14 +1,14 @@
1
- import React from 'react';
2
- import { FabBox } from '../FabBox';
3
- import { ScrollTopFab } from '../ScrollTopFab';
4
- import { MUGlobal } from '../MUGlobal';
5
- import { CommonPageProps } from './CommonPageProps';
6
- import { MoreFab } from '../MoreFab';
7
- import { Container, Fab } from '@mui/material';
8
- import RefreshIcon from '@mui/icons-material/Refresh';
9
- import { BackButton } from '../BackButton';
10
- import { Labels } from '../app/Labels';
11
- import { ReactAppStateDetector } from '../app/ReactApp';
1
+ import React from "react";
2
+ import { FabBox } from "../FabBox";
3
+ import { ScrollTopFab } from "../ScrollTopFab";
4
+ import { MUGlobal } from "../MUGlobal";
5
+ import { CommonPageProps } from "./CommonPageProps";
6
+ import { MoreFab } from "../MoreFab";
7
+ import { Container, Fab } from "@mui/material";
8
+ import RefreshIcon from "@mui/icons-material/Refresh";
9
+ import { BackButton } from "../BackButton";
10
+ import { Labels } from "../app/Labels";
11
+ import { ReactAppStateDetector } from "../app/ReactApp";
12
12
 
13
13
  /**
14
14
  * Default scroll container
@@ -20,109 +20,99 @@ export const CommonPageScrollContainer = global;
20
20
  * @param props Props
21
21
  */
22
22
  export function CommonPage(props: CommonPageProps) {
23
- // Destruct
24
- const {
25
- children,
26
- disableGutters = true,
27
- fabButtons,
28
- fabColumnDirection,
29
- fabPaddingAdjust = 1.5,
30
- fabSize = 'small',
31
- maxWidth = false,
32
- moreActions,
33
- onRefresh,
34
- onUpdate,
35
- onUpdateAll,
36
- paddings = MUGlobal.pagePaddings,
37
- scrollContainer,
38
- supportBack = false,
39
- targetFields,
40
- sx = {},
41
- ...rest
42
- } = props;
23
+ // Destruct
24
+ const {
25
+ children,
26
+ disableGutters = true,
27
+ fabButtons,
28
+ fabColumnDirection,
29
+ fabPanel,
30
+ fabPaddingAdjust = 1.5,
31
+ fabSize = "small",
32
+ maxWidth = false,
33
+ moreActions,
34
+ onRefresh,
35
+ onUpdate,
36
+ onUpdateAll,
37
+ paddings = MUGlobal.pagePaddings,
38
+ scrollContainer,
39
+ supportBack = false,
40
+ targetFields,
41
+ sx = {},
42
+ ...rest
43
+ } = props;
43
44
 
44
- // Fab padding
45
- const fabPadding = MUGlobal.increase(
46
- MUGlobal.pagePaddings,
47
- fabPaddingAdjust
48
- );
45
+ // Fab padding
46
+ const fabPadding = MUGlobal.increase(MUGlobal.pagePaddings, fabPaddingAdjust);
49
47
 
50
- if (typeof sx === 'object' && sx != null && !Reflect.has(sx, 'padding')) {
51
- // Set default padding
52
- Reflect.set(sx, 'padding', paddings);
53
- }
48
+ if (typeof sx === "object" && sx != null && !Reflect.has(sx, "padding")) {
49
+ // Set default padding
50
+ Reflect.set(sx, "padding", paddings);
51
+ }
54
52
 
55
- // Labels
56
- const labels = Labels.CommonPage;
53
+ // Labels
54
+ const labels = Labels.CommonPage;
57
55
 
58
- // Update
59
- const update = onUpdateAll
60
- ? onUpdateAll
61
- : onUpdate
62
- ? (authorized?: boolean) => {
63
- if (authorized == null || authorized) onUpdate();
64
- }
65
- : onRefresh
66
- ? (authorized?: boolean) => {
67
- if (authorized) onRefresh();
68
- }
69
- : undefined;
56
+ // Update
57
+ const update = onUpdateAll
58
+ ? onUpdateAll
59
+ : onUpdate
60
+ ? (authorized?: boolean) => {
61
+ if (authorized == null || authorized) onUpdate();
62
+ }
63
+ : onRefresh
64
+ ? (authorized?: boolean) => {
65
+ if (authorized) onRefresh();
66
+ }
67
+ : undefined;
70
68
 
71
- // Return the UI
72
- return (
73
- <React.Fragment>
74
- {update && (
75
- <ReactAppStateDetector
76
- targetFields={targetFields}
77
- update={update}
78
- />
79
- )}
80
- <Container
81
- disableGutters={disableGutters}
82
- maxWidth={maxWidth}
83
- sx={sx}
84
- id="page-container"
85
- {...rest}
69
+ // Return the UI
70
+ return (
71
+ <React.Fragment>
72
+ {update && (
73
+ <ReactAppStateDetector targetFields={targetFields} update={update} />
74
+ )}
75
+ <Container
76
+ disableGutters={disableGutters}
77
+ maxWidth={maxWidth}
78
+ sx={sx}
79
+ id="page-container"
80
+ {...rest}
81
+ >
82
+ <FabBox
83
+ sx={{
84
+ zIndex: 1,
85
+ bottom: (theme) =>
86
+ MUGlobal.updateWithTheme(fabPadding, theme.spacing),
87
+ right: (theme) =>
88
+ MUGlobal.updateWithTheme(fabPadding, theme.spacing)
89
+ }}
90
+ columnDirection={fabColumnDirection}
91
+ fabPanel={fabPanel}
92
+ >
93
+ {scrollContainer && (
94
+ <ScrollTopFab
95
+ size={fabSize}
96
+ target={scrollContainer}
97
+ title={labels.scrollTop}
98
+ />
99
+ )}
100
+ {fabButtons}
101
+ {onRefresh != null && (
102
+ <Fab
103
+ title={labels.refresh}
104
+ size={fabSize}
105
+ onClick={onRefresh}
106
+ sx={{ display: { xs: "none", md: "inherit" } }}
86
107
  >
87
- <FabBox
88
- sx={{
89
- zIndex: 1,
90
- bottom: (theme) =>
91
- MUGlobal.updateWithTheme(fabPadding, theme.spacing),
92
- right: (theme) =>
93
- MUGlobal.updateWithTheme(fabPadding, theme.spacing)
94
- }}
95
- columnDirection={fabColumnDirection}
96
- >
97
- {scrollContainer && (
98
- <ScrollTopFab
99
- size={fabSize}
100
- target={scrollContainer}
101
- title={labels.scrollTop}
102
- />
103
- )}
104
- {fabButtons}
105
- {onRefresh != null && (
106
- <Fab
107
- title={labels.refresh}
108
- size={fabSize}
109
- onClick={onRefresh}
110
- sx={{ display: { xs: 'none', md: 'inherit' } }}
111
- >
112
- <RefreshIcon />
113
- </Fab>
114
- )}
115
- <MoreFab
116
- size={fabSize}
117
- title={labels.more}
118
- actions={moreActions}
119
- />
120
- {supportBack && (
121
- <BackButton title={labels.back} size={fabSize} />
122
- )}
123
- </FabBox>
124
- {children}
125
- </Container>
126
- </React.Fragment>
127
- );
108
+ <RefreshIcon />
109
+ </Fab>
110
+ )}
111
+ <MoreFab size={fabSize} title={labels.more} actions={moreActions} />
112
+ {supportBack && <BackButton title={labels.back} size={fabSize} />}
113
+ </FabBox>
114
+ {children}
115
+ </Container>
116
+ </React.Fragment>
117
+ );
128
118
  }
@@ -1,70 +1,75 @@
1
- import { UserKey } from '@etsoo/appscript';
2
- import { IStateUpdate, ListItemReact } from '@etsoo/react';
3
- import { ContainerProps } from '@mui/material';
4
- import { CustomFabSize } from '../CustomFabProps';
1
+ import { UserKey } from "@etsoo/appscript";
2
+ import { IStateUpdate, ListItemReact } from "@etsoo/react";
3
+ import { ContainerProps } from "@mui/material";
4
+ import { CustomFabSize } from "../CustomFabProps";
5
5
 
6
6
  /**
7
7
  * Common page props
8
8
  * Default container id is 'pageContainer'
9
9
  */
10
- export interface CommonPageProps extends Omit<ContainerProps, 'id'> {
11
- /**
12
- * Fab buttons
13
- */
14
- fabButtons?: React.ReactNode;
10
+ export interface CommonPageProps extends Omit<ContainerProps, "id"> {
11
+ /**
12
+ * Fab buttons
13
+ */
14
+ fabButtons?: React.ReactNode;
15
15
 
16
- /**
17
- * Fab size
18
- */
19
- fabSize?: CustomFabSize;
16
+ /**
17
+ * Fab size
18
+ */
19
+ fabSize?: CustomFabSize;
20
20
 
21
- /**
22
- * Fab flex column direction, undefined to hide it
23
- */
24
- fabColumnDirection?: boolean;
21
+ /**
22
+ * Fab flex column direction, undefined to hide it
23
+ */
24
+ fabColumnDirection?: boolean;
25
25
 
26
- /**
27
- * Fab padding adjust
28
- */
29
- fabPaddingAdjust?: number;
26
+ /**
27
+ * Fab padding adjust
28
+ */
29
+ fabPaddingAdjust?: number;
30
30
 
31
- /**
32
- * More actions
33
- */
34
- moreActions?: ListItemReact[];
31
+ /**
32
+ * Add panel to the Fab
33
+ */
34
+ fabPanel?: boolean;
35
35
 
36
- /**
37
- * On refresh callback, only when authorized = true
38
- */
39
- onRefresh?: () => void | PromiseLike<void>;
36
+ /**
37
+ * More actions
38
+ */
39
+ moreActions?: ListItemReact[];
40
40
 
41
- /**
42
- * On page update, when authorized = null or true case, may uses onRefresh
43
- */
44
- onUpdate?: () => void | PromiseLike<void>;
41
+ /**
42
+ * On refresh callback, only when authorized = true
43
+ */
44
+ onRefresh?: () => void | PromiseLike<void>;
45
45
 
46
- /**
47
- * On page update, all cases with authorized
48
- */
49
- onUpdateAll?: IStateUpdate;
46
+ /**
47
+ * On page update, when authorized = null or true case, may uses onRefresh
48
+ */
49
+ onUpdate?: () => void | PromiseLike<void>;
50
50
 
51
- /**
52
- * Paddings
53
- */
54
- paddings?: Record<string, string | number>;
51
+ /**
52
+ * On page update, all cases with authorized
53
+ */
54
+ onUpdateAll?: IStateUpdate;
55
55
 
56
- /**
57
- * Scroll container
58
- */
59
- scrollContainer?: HTMLElement | object;
56
+ /**
57
+ * Paddings
58
+ */
59
+ paddings?: Record<string, string | number>;
60
60
 
61
- /**
62
- * Support back click
63
- */
64
- supportBack?: boolean;
61
+ /**
62
+ * Scroll container
63
+ */
64
+ scrollContainer?: HTMLElement | object;
65
65
 
66
- /**
67
- * State last changed fields
68
- */
69
- targetFields?: UserKey[];
66
+ /**
67
+ * Support back click
68
+ */
69
+ supportBack?: boolean;
70
+
71
+ /**
72
+ * State last changed fields
73
+ */
74
+ targetFields?: UserKey[];
70
75
  }
@@ -1,57 +1,65 @@
1
- import { GridMethodRef } from '@etsoo/react';
2
- import { DataTypes, IdDefaultType } from '@etsoo/shared';
3
- import { ListChildComponentProps } from 'react-window';
1
+ import { GridMethodRef } from "@etsoo/react";
2
+ import { DataTypes, IdDefaultType } from "@etsoo/shared";
3
+ import { ListChildComponentProps } from "react-window";
4
4
  import {
5
- ScrollerListExInnerItemRendererProps,
6
- ScrollerListExItemSize
7
- } from '../ScrollerListEx';
8
- import { DataGridPageProps } from './DataGridPageProps';
5
+ ScrollerListExInnerItemRendererProps,
6
+ ScrollerListExItemSize
7
+ } from "../ScrollerListEx";
8
+ import { DataGridPageProps } from "./DataGridPageProps";
9
9
 
10
10
  /**
11
11
  * Response page props
12
12
  */
13
13
  export type ResponsePageProps<
14
- T extends object,
15
- F extends DataTypes.BasicTemplate,
16
- D extends DataTypes.Keys<T> = IdDefaultType<T>
14
+ T extends object,
15
+ F extends DataTypes.BasicTemplate,
16
+ D extends DataTypes.Keys<T> = IdDefaultType<T>
17
17
  > = Omit<
18
- DataGridPageProps<T, F, D>,
19
- 'mRef' | 'itemKey' | 'onScroll' | 'onItemsRendered'
18
+ DataGridPageProps<T, F, D>,
19
+ "mRef" | "itemKey" | "onScroll" | "onItemsRendered"
20
20
  > & {
21
- /**
22
- * Min width to show Datagrid
23
- */
24
- dataGridMinWidth?: number;
25
-
26
- /**
27
- * Inner item renderer
28
- */
29
- innerItemRenderer: (
30
- props: ScrollerListExInnerItemRendererProps<T>
31
- ) => React.ReactNode;
32
-
33
- /**
34
- * Item renderer
35
- */
36
- itemRenderer?: (props: ListChildComponentProps<T>) => React.ReactElement;
37
-
38
- /**
39
- * Item size, a function indicates its a variable size list
40
- */
41
- itemSize: ScrollerListExItemSize;
42
-
43
- /**
44
- * Methods
45
- */
46
- mRef?: React.MutableRefObject<GridMethodRef<T> | undefined>;
47
-
48
- /**
49
- * Pull to refresh data
50
- */
51
- pullToRefresh?: boolean;
52
-
53
- /**
54
- * Quick action for double click or click under mobile
55
- */
56
- quickAction?: (data: T) => void;
21
+ /**
22
+ *
23
+ * @param height Current height
24
+ * @param isGrid Is displaying DataGrid
25
+ * @returns Adjusted height
26
+ */
27
+ adjustFabHeight?: (height: number, isGrid: boolean) => number;
28
+
29
+ /**
30
+ * Min width to show Datagrid
31
+ */
32
+ dataGridMinWidth?: number;
33
+
34
+ /**
35
+ * Inner item renderer
36
+ */
37
+ innerItemRenderer: (
38
+ props: ScrollerListExInnerItemRendererProps<T>
39
+ ) => React.ReactNode;
40
+
41
+ /**
42
+ * Item renderer
43
+ */
44
+ itemRenderer?: (props: ListChildComponentProps<T>) => React.ReactElement;
45
+
46
+ /**
47
+ * Item size, a function indicates its a variable size list
48
+ */
49
+ itemSize: ScrollerListExItemSize;
50
+
51
+ /**
52
+ * Methods
53
+ */
54
+ mRef?: React.MutableRefObject<GridMethodRef<T> | undefined>;
55
+
56
+ /**
57
+ * Pull to refresh data
58
+ */
59
+ pullToRefresh?: boolean;
60
+
61
+ /**
62
+ * Quick action for double click or click under mobile
63
+ */
64
+ quickAction?: (data: T) => void;
57
65
  };