@etsoo/materialui 1.3.58 → 1.3.60
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/__tests__/ResponsePage.tsx +11 -3
- package/lib/AddresSelector.d.ts +1 -1
- package/lib/AddresSelector.js +9 -18
- package/lib/AuditDisplay.d.ts +1 -1
- package/lib/AuditDisplay.js +12 -15
- package/lib/BackButton.d.ts +1 -2
- package/lib/BackButton.js +3 -4
- package/lib/BridgeCloseButton.d.ts +1 -2
- package/lib/BridgeCloseButton.js +3 -4
- package/lib/ButtonLink.d.ts +1 -2
- package/lib/ButtonLink.js +2 -2
- package/lib/ComboBox.d.ts +2 -3
- package/lib/ComboBox.js +12 -16
- package/lib/ComboBoxMultiple.d.ts +2 -3
- package/lib/ComboBoxMultiple.js +15 -19
- package/lib/ComboBoxPro.d.ts +1 -2
- package/lib/ComboBoxPro.js +3 -2
- package/lib/CountdownButton.js +4 -3
- package/lib/CountryList.d.ts +1 -2
- package/lib/CountryList.js +2 -1
- package/lib/CultureDataTable.d.ts +1 -2
- package/lib/CultureDataTable.js +2 -1
- package/lib/DataGridEx.d.ts +1 -1
- package/lib/DataGridEx.js +55 -58
- package/lib/DataGridRenderers.js +5 -5
- package/lib/DataSteps.d.ts +1 -2
- package/lib/DataSteps.js +20 -23
- package/lib/DataTable.d.ts +1 -1
- package/lib/DataTable.js +2 -1
- package/lib/DialogButton.d.ts +1 -1
- package/lib/DialogButton.js +6 -13
- package/lib/DnDList.d.ts +1 -1
- package/lib/DnDList.js +8 -8
- package/lib/DraggablePaperComponent.d.ts +1 -2
- package/lib/DraggablePaperComponent.js +2 -2
- package/lib/EmailInput.d.ts +1 -2
- package/lib/EmailInput.js +2 -2
- package/lib/FabBox.d.ts +1 -2
- package/lib/FabBox.js +4 -3
- package/lib/FieldSetEx.d.ts +1 -1
- package/lib/FieldSetEx.js +13 -16
- package/lib/FileUploadButton.d.ts +1 -1
- package/lib/FileUploadButton.js +27 -29
- package/lib/FlexBox.d.ts +2 -3
- package/lib/FlexBox.js +3 -3
- package/lib/GridDataFormat.js +2 -2
- package/lib/HiSelector.d.ts +1 -1
- package/lib/HiSelector.js +2 -12
- package/lib/HiSelectorTL.d.ts +1 -1
- package/lib/HiSelectorTL.js +2 -12
- package/lib/IconButtonLink.d.ts +1 -2
- package/lib/IconButtonLink.js +2 -2
- package/lib/InputField.js +2 -1
- package/lib/InputTipField.d.ts +1 -1
- package/lib/InputTipField.js +12 -14
- package/lib/IntInputField.js +28 -33
- package/lib/ItemList.d.ts +1 -1
- package/lib/ItemList.js +6 -11
- package/lib/LineChart.d.ts +1 -2
- package/lib/LineChart.js +2 -1
- package/lib/ListChooser.d.ts +1 -1
- package/lib/ListChooser.js +4 -7
- package/lib/ListMoreDisplay.d.ts +1 -1
- package/lib/ListMoreDisplay.js +5 -10
- package/lib/LoadingButton.d.ts +1 -2
- package/lib/LoadingButton.js +3 -2
- package/lib/MaskInput.d.ts +1 -2
- package/lib/MaskInput.js +2 -1
- package/lib/MenuButton.d.ts +1 -1
- package/lib/MenuButton.js +30 -31
- package/lib/MobileListItemRenderer.d.ts +1 -1
- package/lib/MobileListItemRenderer.js +15 -18
- package/lib/MoneyInputField.js +2 -1
- package/lib/MoreFab.d.ts +1 -1
- package/lib/MoreFab.js +21 -24
- package/lib/NotifierMU.d.ts +2 -2
- package/lib/NotifierMU.js +27 -67
- package/lib/NumberInputField.d.ts +1 -1
- package/lib/NumberInputField.js +4 -4
- package/lib/OptionBool.d.ts +1 -2
- package/lib/OptionBool.js +2 -2
- package/lib/OptionGroup.d.ts +1 -1
- package/lib/OptionGroup.js +17 -20
- package/lib/OptionGroupFlag.d.ts +1 -1
- package/lib/OptionGroupFlag.js +15 -18
- package/lib/PList.d.ts +1 -2
- package/lib/PList.js +5 -4
- package/lib/PercentCircularProgress.d.ts +1 -2
- package/lib/PercentCircularProgress.js +11 -14
- package/lib/PercentLinearProgress.d.ts +1 -2
- package/lib/PercentLinearProgress.js +2 -6
- package/lib/ProgressCount.d.ts +1 -2
- package/lib/ProgressCount.js +12 -18
- package/lib/PullToRefreshUI.d.ts +1 -2
- package/lib/PullToRefreshUI.js +2 -1
- package/lib/QuickList.d.ts +1 -1
- package/lib/QuickList.js +12 -14
- package/lib/ResponsibleContainer.d.ts +1 -1
- package/lib/ResponsibleContainer.js +11 -16
- package/lib/ScrollTopFab.d.ts +1 -2
- package/lib/ScrollTopFab.js +2 -3
- package/lib/ScrollerListEx.d.ts +1 -1
- package/lib/ScrollerListEx.js +3 -2
- package/lib/SearchBar.d.ts +1 -1
- package/lib/SearchBar.js +27 -35
- package/lib/SearchField.d.ts +1 -2
- package/lib/SearchField.js +2 -1
- package/lib/SearchOptionGroup.d.ts +1 -2
- package/lib/SearchOptionGroup.js +2 -2
- package/lib/SelectBool.d.ts +1 -2
- package/lib/SelectBool.js +2 -2
- package/lib/SelectEx.d.ts +1 -1
- package/lib/SelectEx.js +47 -55
- package/lib/ShowDataComparison.js +2 -11
- package/lib/Switch.d.ts +1 -2
- package/lib/Switch.js +3 -2
- package/lib/SwitchAnt.d.ts +1 -2
- package/lib/SwitchAnt.js +12 -14
- package/lib/SwitchField.d.ts +1 -1
- package/lib/SwitchField.js +13 -16
- package/lib/TabBox.d.ts +1 -1
- package/lib/TabBox.js +6 -9
- package/lib/TableEx.d.ts +1 -1
- package/lib/TableEx.js +79 -89
- package/lib/TagList.d.ts +1 -2
- package/lib/TagList.js +4 -5
- package/lib/TagListPro.d.ts +1 -2
- package/lib/TagListPro.js +4 -6
- package/lib/TextFieldEx.js +3 -6
- package/lib/Tiplist.d.ts +2 -3
- package/lib/Tiplist.js +39 -40
- package/lib/TiplistPro.d.ts +2 -2
- package/lib/TiplistPro.js +48 -49
- package/lib/TooltipClick.d.ts +1 -1
- package/lib/TooltipClick.js +3 -3
- package/lib/TwoFieldInput.d.ts +1 -2
- package/lib/TwoFieldInput.js +4 -5
- package/lib/UserAvatar.d.ts +1 -2
- package/lib/UserAvatar.js +3 -3
- package/lib/UserAvatarEditor.d.ts +1 -2
- package/lib/UserAvatarEditor.js +2 -19
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -3
- package/lib/messages/OperationMessageContainer.d.ts +1 -2
- package/lib/messages/OperationMessageContainer.js +2 -1
- package/lib/pages/CommonPage.d.ts +67 -2
- package/lib/pages/CommonPage.js +15 -24
- package/lib/pages/DataGridPage.d.ts +2 -3
- package/lib/pages/DataGridPage.js +5 -8
- package/lib/pages/DataGridPageProps.d.ts +3 -3
- package/lib/pages/EditPage.d.ts +3 -3
- package/lib/pages/EditPage.js +6 -15
- package/lib/pages/FixedListPage.d.ts +2 -3
- package/lib/pages/FixedListPage.js +5 -9
- package/lib/pages/LeftDrawer.d.ts +1 -1
- package/lib/pages/LeftDrawer.js +3 -10
- package/lib/pages/ListPage.d.ts +7 -3
- package/lib/pages/ListPage.js +4 -7
- package/lib/pages/ResponsivePage.d.ts +50 -2
- package/lib/pages/ResponsivePage.js +25 -26
- package/lib/pages/SearchPageProps.d.ts +3 -3
- package/lib/pages/TablePage.d.ts +7 -3
- package/lib/pages/TablePage.js +5 -8
- package/lib/pages/UserMenu.d.ts +1 -1
- package/lib/pages/UserMenu.js +33 -35
- package/lib/pages/ViewPage.d.ts +4 -4
- package/lib/pages/ViewPage.js +29 -37
- package/lib/texts/DateText.d.ts +1 -2
- package/lib/texts/DateText.js +2 -2
- package/lib/texts/MoneyText.d.ts +1 -2
- package/lib/texts/MoneyText.js +4 -4
- package/lib/texts/NumberText.d.ts +1 -2
- package/lib/texts/NumberText.js +2 -2
- package/package.json +3 -3
- package/src/ComboBox.tsx +1 -1
- package/src/ComboBoxMultiple.tsx +1 -1
- package/src/Tiplist.tsx +1 -1
- package/src/index.ts +0 -3
- package/src/pages/CommonPage.tsx +80 -2
- package/src/pages/DataGridPage.tsx +1 -1
- package/src/pages/DataGridPageProps.ts +3 -3
- package/src/pages/EditPage.tsx +2 -3
- package/src/pages/FixedListPage.tsx +1 -1
- package/src/pages/ListPage.tsx +10 -2
- package/src/pages/ResponsivePage.tsx +70 -2
- package/src/pages/SearchPageProps.ts +3 -3
- package/src/pages/TablePage.tsx +16 -2
- package/src/pages/ViewPage.tsx +3 -4
- package/tsconfig.json +2 -2
- package/lib/pages/CommonPageProps.d.ts +0 -67
- package/lib/pages/CommonPageProps.js +0 -1
- package/lib/pages/ListPageProps.d.ts +0 -7
- package/lib/pages/ListPageProps.js +0 -1
- package/lib/pages/ResponsivePageProps.d.ts +0 -51
- package/lib/pages/ResponsivePageProps.js +0 -1
- package/lib/pages/TablePageProps.d.ts +0 -7
- package/lib/pages/TablePageProps.js +0 -1
- package/src/pages/CommonPageProps.ts +0 -80
- package/src/pages/ListPageProps.ts +0 -11
- package/src/pages/ResponsivePageProps.ts +0 -70
- package/src/pages/TablePageProps.ts +0 -12
package/src/pages/CommonPage.tsx
CHANGED
|
@@ -2,13 +2,91 @@ import React from "react";
|
|
|
2
2
|
import { FabBox } from "../FabBox";
|
|
3
3
|
import { ScrollTopFab } from "../ScrollTopFab";
|
|
4
4
|
import { MUGlobal } from "../MUGlobal";
|
|
5
|
-
import { CommonPageProps } from "./CommonPageProps";
|
|
6
5
|
import { MoreFab } from "../MoreFab";
|
|
7
|
-
import { Container, Fab, useTheme } from "@mui/material";
|
|
6
|
+
import { Container, ContainerProps, Fab, Theme, useTheme } from "@mui/material";
|
|
8
7
|
import RefreshIcon from "@mui/icons-material/Refresh";
|
|
9
8
|
import { BackButton } from "../BackButton";
|
|
10
9
|
import { Labels } from "../app/Labels";
|
|
11
10
|
import { ReactAppStateDetector } from "../app/ReactApp";
|
|
11
|
+
import type { CustomFabSize } from "../CustomFabProps";
|
|
12
|
+
import type { IStateUpdate, ListItemReact } from "@etsoo/react";
|
|
13
|
+
import type { UserKey } from "@etsoo/appscript";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Common page props
|
|
17
|
+
* Default container id is 'pageContainer'
|
|
18
|
+
*/
|
|
19
|
+
export interface CommonPageProps extends Omit<ContainerProps, "id"> {
|
|
20
|
+
/**
|
|
21
|
+
* Fab buttons
|
|
22
|
+
*/
|
|
23
|
+
fabButtons?: React.ReactNode;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Fab size
|
|
27
|
+
*/
|
|
28
|
+
fabSize?: CustomFabSize;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Fab flex column direction, undefined to hide it
|
|
32
|
+
*/
|
|
33
|
+
fabColumnDirection?: boolean;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Fab padding adjust
|
|
37
|
+
*/
|
|
38
|
+
fabPaddingAdjust?: number;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Add panel to the Fab
|
|
42
|
+
*/
|
|
43
|
+
fabPanel?: boolean;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Fab lays in the top
|
|
47
|
+
*/
|
|
48
|
+
fabTop?: ((theme: Theme, padding: {}) => object) | boolean;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* More actions
|
|
52
|
+
*/
|
|
53
|
+
moreActions?: ListItemReact[];
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* On refresh callback, only when authorized = true
|
|
57
|
+
*/
|
|
58
|
+
onRefresh?: () => void | PromiseLike<void>;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* On page update, when authorized = null or true case, may uses onRefresh
|
|
62
|
+
*/
|
|
63
|
+
onUpdate?: () => void | PromiseLike<void>;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* On page update, all cases with authorized
|
|
67
|
+
*/
|
|
68
|
+
onUpdateAll?: IStateUpdate;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Paddings
|
|
72
|
+
*/
|
|
73
|
+
paddings?: Record<string, string | number>;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Scroll container
|
|
77
|
+
*/
|
|
78
|
+
scrollContainer?: HTMLElement | object;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Support back click
|
|
82
|
+
*/
|
|
83
|
+
supportBack?: boolean;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* State last changed fields
|
|
87
|
+
*/
|
|
88
|
+
targetFields?: UserKey[];
|
|
89
|
+
}
|
|
12
90
|
|
|
13
91
|
/**
|
|
14
92
|
* Common page
|
|
@@ -14,7 +14,7 @@ import { DataGridEx } from "../DataGridEx";
|
|
|
14
14
|
import { MUGlobal } from "../MUGlobal";
|
|
15
15
|
import { SearchBar } from "../SearchBar";
|
|
16
16
|
import { CommonPage } from "./CommonPage";
|
|
17
|
-
import { DataGridPageProps } from "./DataGridPageProps";
|
|
17
|
+
import type { DataGridPageProps } from "./DataGridPageProps";
|
|
18
18
|
import { GridUtils } from "../GridUtils";
|
|
19
19
|
|
|
20
20
|
interface LocalStates<T> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DataTypes } from "@etsoo/shared";
|
|
2
|
-
import { DataGridExProps } from "../DataGridEx";
|
|
3
|
-
import { SearchPageProps } from "./SearchPageProps";
|
|
1
|
+
import type { DataTypes } from "@etsoo/shared";
|
|
2
|
+
import type { DataGridExProps } from "../DataGridEx";
|
|
3
|
+
import type { SearchPageProps } from "./SearchPageProps";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* DataGrid page props
|
package/src/pages/EditPage.tsx
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Button, Grid } from "@mui/material";
|
|
2
2
|
import React, { FormEventHandler } from "react";
|
|
3
3
|
import { MUGlobal } from "../MUGlobal";
|
|
4
|
-
import { CommonPage } from "./CommonPage";
|
|
5
|
-
import { CommonPageProps } from "./CommonPageProps";
|
|
4
|
+
import { CommonPage, CommonPageProps } from "./CommonPage";
|
|
6
5
|
import SaveIcon from "@mui/icons-material/Save";
|
|
7
6
|
import DeleteIcon from "@mui/icons-material/Delete";
|
|
8
7
|
import { BackButton } from "../BackButton";
|
|
9
8
|
import { Labels } from "../app/Labels";
|
|
10
|
-
import { OperationMessageHandlerAll } from "../messages/OperationMessageHandler";
|
|
9
|
+
import type { OperationMessageHandlerAll } from "../messages/OperationMessageHandler";
|
|
11
10
|
import { OperationMessageContainer } from "../messages/OperationMessageContainer";
|
|
12
11
|
|
|
13
12
|
/**
|
|
@@ -14,8 +14,8 @@ import { MUGlobal } from "../MUGlobal";
|
|
|
14
14
|
import { ScrollerListEx } from "../ScrollerListEx";
|
|
15
15
|
import { SearchBar } from "../SearchBar";
|
|
16
16
|
import { CommonPage } from "./CommonPage";
|
|
17
|
-
import { ListPageProps } from "./ListPageProps";
|
|
18
17
|
import { GridUtils } from "../GridUtils";
|
|
18
|
+
import type { ListPageProps } from "./ListPage";
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Fixed height list page
|
package/src/pages/ListPage.tsx
CHANGED
|
@@ -10,11 +10,19 @@ import { DataTypes } from "@etsoo/shared";
|
|
|
10
10
|
import { Box, Stack } from "@mui/material";
|
|
11
11
|
import React from "react";
|
|
12
12
|
import { MUGlobal } from "../MUGlobal";
|
|
13
|
-
import { ScrollerListEx } from "../ScrollerListEx";
|
|
13
|
+
import { ScrollerListEx, ScrollerListExProps } from "../ScrollerListEx";
|
|
14
14
|
import { SearchBar } from "../SearchBar";
|
|
15
15
|
import { CommonPage } from "./CommonPage";
|
|
16
|
-
import { ListPageProps } from "./ListPageProps";
|
|
17
16
|
import { GridUtils } from "../GridUtils";
|
|
17
|
+
import type { SearchPageProps } from "./SearchPageProps";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* List page props
|
|
21
|
+
*/
|
|
22
|
+
export type ListPageProps<
|
|
23
|
+
T extends object,
|
|
24
|
+
F extends DataTypes.BasicTemplate
|
|
25
|
+
> = SearchPageProps<T, F> & Omit<ScrollerListExProps<T>, "loadData">;
|
|
18
26
|
|
|
19
27
|
/**
|
|
20
28
|
* List page
|
|
@@ -3,8 +3,76 @@ import React from "react";
|
|
|
3
3
|
import { MUGlobal } from "../MUGlobal";
|
|
4
4
|
import { ResponsibleContainer } from "../ResponsibleContainer";
|
|
5
5
|
import { CommonPage } from "./CommonPage";
|
|
6
|
-
import { ResponsePageProps } from "./ResponsivePageProps";
|
|
7
6
|
import { OperationMessageContainer } from "../messages/OperationMessageContainer";
|
|
7
|
+
import type { DataGridPageProps } from "./DataGridPageProps";
|
|
8
|
+
import type {
|
|
9
|
+
ScrollerListExInnerItemRendererProps,
|
|
10
|
+
ScrollerListExItemSize
|
|
11
|
+
} from "../ScrollerListEx";
|
|
12
|
+
import { ListChildComponentProps } from "react-window";
|
|
13
|
+
import { GridMethodRef } from "@etsoo/react";
|
|
14
|
+
import type { OperationMessageHandlerAll } from "../messages/OperationMessageHandler";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Response page props
|
|
18
|
+
*/
|
|
19
|
+
export type ResponsePageProps<
|
|
20
|
+
T extends object,
|
|
21
|
+
F extends DataTypes.BasicTemplate
|
|
22
|
+
> = Omit<
|
|
23
|
+
DataGridPageProps<T, F>,
|
|
24
|
+
"mRef" | "itemKey" | "onScroll" | "onItemsRendered"
|
|
25
|
+
> & {
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @param height Current height
|
|
29
|
+
* @param isGrid Is displaying DataGrid
|
|
30
|
+
* @returns Adjusted height
|
|
31
|
+
*/
|
|
32
|
+
adjustFabHeight?: (height: number, isGrid: boolean) => number;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Min width to show Datagrid
|
|
36
|
+
*/
|
|
37
|
+
dataGridMinWidth?: number;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Inner item renderer
|
|
41
|
+
*/
|
|
42
|
+
innerItemRenderer: (
|
|
43
|
+
props: ScrollerListExInnerItemRendererProps<T>
|
|
44
|
+
) => React.ReactNode;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Item renderer
|
|
48
|
+
*/
|
|
49
|
+
itemRenderer?: (props: ListChildComponentProps<T>) => React.ReactElement;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Item size, a function indicates its a variable size list
|
|
53
|
+
*/
|
|
54
|
+
itemSize: ScrollerListExItemSize;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Methods
|
|
58
|
+
*/
|
|
59
|
+
mRef?: React.MutableRefObject<GridMethodRef<T> | undefined>;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Pull to refresh data
|
|
63
|
+
*/
|
|
64
|
+
pullToRefresh?: boolean;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Quick action for double click or click under mobile
|
|
68
|
+
*/
|
|
69
|
+
quickAction?: (data: T) => void;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Operation message handler
|
|
73
|
+
*/
|
|
74
|
+
operationMessageHandler?: OperationMessageHandlerAll;
|
|
75
|
+
};
|
|
8
76
|
|
|
9
77
|
/**
|
|
10
78
|
* Fixed height list page
|
|
@@ -13,7 +81,7 @@ import { OperationMessageContainer } from "../messages/OperationMessageContainer
|
|
|
13
81
|
*/
|
|
14
82
|
export function ResponsivePage<
|
|
15
83
|
T extends object,
|
|
16
|
-
F extends DataTypes.BasicTemplate =
|
|
84
|
+
F extends DataTypes.BasicTemplate = {}
|
|
17
85
|
>(props: ResponsePageProps<T, F>) {
|
|
18
86
|
// Destruct
|
|
19
87
|
const { pageProps = {}, operationMessageHandler, ...rest } = props;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { GridJsonData, GridLoader } from "@etsoo/react";
|
|
2
|
-
import { DataTypes } from "@etsoo/shared";
|
|
3
|
-
import { CommonPageProps } from "./
|
|
1
|
+
import type { GridJsonData, GridLoader } from "@etsoo/react";
|
|
2
|
+
import type { DataTypes } from "@etsoo/shared";
|
|
3
|
+
import type { CommonPageProps } from "./CommonPage";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Search page props
|
package/src/pages/TablePage.tsx
CHANGED
|
@@ -8,10 +8,24 @@ import { Box, Stack } from "@mui/material";
|
|
|
8
8
|
import React from "react";
|
|
9
9
|
import { MUGlobal } from "../MUGlobal";
|
|
10
10
|
import { SearchBar } from "../SearchBar";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
TableEx,
|
|
13
|
+
TableExMethodRef,
|
|
14
|
+
TableExMinWidth,
|
|
15
|
+
TableExProps
|
|
16
|
+
} from "../TableEx";
|
|
12
17
|
import { CommonPage } from "./CommonPage";
|
|
13
|
-
import { TablePageProps } from "./TablePageProps";
|
|
14
18
|
import { GridUtils } from "../GridUtils";
|
|
19
|
+
import type { SearchPageProps } from "./SearchPageProps";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Table page props
|
|
23
|
+
*/
|
|
24
|
+
export type TablePageProps<
|
|
25
|
+
T extends object,
|
|
26
|
+
F extends DataTypes.BasicTemplate,
|
|
27
|
+
D extends DataTypes.Keys<T>
|
|
28
|
+
> = SearchPageProps<T, F> & Omit<TableExProps<T, D>, "loadData">;
|
|
15
29
|
|
|
16
30
|
/**
|
|
17
31
|
* Table page
|
package/src/pages/ViewPage.tsx
CHANGED
|
@@ -17,11 +17,10 @@ import { globalApp } from "../app/ReactApp";
|
|
|
17
17
|
import { GridDataFormat } from "../GridDataFormat";
|
|
18
18
|
import { MUGlobal } from "../MUGlobal";
|
|
19
19
|
import { PullToRefreshUI } from "../PullToRefreshUI";
|
|
20
|
-
import { CommonPage } from "./CommonPage";
|
|
21
|
-
import {
|
|
22
|
-
import { OperationMessageHandlerAll } from "../messages/OperationMessageHandler";
|
|
20
|
+
import { CommonPage, CommonPageProps } from "./CommonPage";
|
|
21
|
+
import type { OperationMessageHandlerAll } from "../messages/OperationMessageHandler";
|
|
23
22
|
import { MessageUtils } from "../messages/MessageUtils";
|
|
24
|
-
import { RefreshHandler } from "../messages/RefreshHandler";
|
|
23
|
+
import type { RefreshHandler } from "../messages/RefreshHandler";
|
|
25
24
|
import { OperationMessageContainer } from "../messages/OperationMessageContainer";
|
|
26
25
|
|
|
27
26
|
/**
|
package/tsconfig.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
4
|
"target": "ES2020",
|
|
5
5
|
"module": "ESNext",
|
|
6
|
-
"moduleResolution": "
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
7
|
"allowJs": false,
|
|
8
8
|
"isolatedModules": true,
|
|
9
9
|
"outDir": "./lib",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"strict": true,
|
|
13
13
|
"esModuleInterop": true,
|
|
14
14
|
"skipLibCheck": true,
|
|
15
|
-
"jsx": "react",
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
16
|
"forceConsistentCasingInFileNames": true
|
|
17
17
|
},
|
|
18
18
|
"include": ["src"]
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { UserKey } from "@etsoo/appscript";
|
|
3
|
-
import { IStateUpdate, ListItemReact } from "@etsoo/react";
|
|
4
|
-
import { ContainerProps, Theme } from "@mui/material";
|
|
5
|
-
import { CustomFabSize } from "../CustomFabProps";
|
|
6
|
-
/**
|
|
7
|
-
* Common page props
|
|
8
|
-
* Default container id is 'pageContainer'
|
|
9
|
-
*/
|
|
10
|
-
export interface CommonPageProps extends Omit<ContainerProps, "id"> {
|
|
11
|
-
/**
|
|
12
|
-
* Fab buttons
|
|
13
|
-
*/
|
|
14
|
-
fabButtons?: React.ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* Fab size
|
|
17
|
-
*/
|
|
18
|
-
fabSize?: CustomFabSize;
|
|
19
|
-
/**
|
|
20
|
-
* Fab flex column direction, undefined to hide it
|
|
21
|
-
*/
|
|
22
|
-
fabColumnDirection?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Fab padding adjust
|
|
25
|
-
*/
|
|
26
|
-
fabPaddingAdjust?: number;
|
|
27
|
-
/**
|
|
28
|
-
* Add panel to the Fab
|
|
29
|
-
*/
|
|
30
|
-
fabPanel?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Fab lays in the top
|
|
33
|
-
*/
|
|
34
|
-
fabTop?: ((theme: Theme, padding: {}) => object) | boolean;
|
|
35
|
-
/**
|
|
36
|
-
* More actions
|
|
37
|
-
*/
|
|
38
|
-
moreActions?: ListItemReact[];
|
|
39
|
-
/**
|
|
40
|
-
* On refresh callback, only when authorized = true
|
|
41
|
-
*/
|
|
42
|
-
onRefresh?: () => void | PromiseLike<void>;
|
|
43
|
-
/**
|
|
44
|
-
* On page update, when authorized = null or true case, may uses onRefresh
|
|
45
|
-
*/
|
|
46
|
-
onUpdate?: () => void | PromiseLike<void>;
|
|
47
|
-
/**
|
|
48
|
-
* On page update, all cases with authorized
|
|
49
|
-
*/
|
|
50
|
-
onUpdateAll?: IStateUpdate;
|
|
51
|
-
/**
|
|
52
|
-
* Paddings
|
|
53
|
-
*/
|
|
54
|
-
paddings?: Record<string, string | number>;
|
|
55
|
-
/**
|
|
56
|
-
* Scroll container
|
|
57
|
-
*/
|
|
58
|
-
scrollContainer?: HTMLElement | object;
|
|
59
|
-
/**
|
|
60
|
-
* Support back click
|
|
61
|
-
*/
|
|
62
|
-
supportBack?: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* State last changed fields
|
|
65
|
-
*/
|
|
66
|
-
targetFields?: UserKey[];
|
|
67
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DataTypes } from "@etsoo/shared";
|
|
2
|
-
import { ScrollerListExProps } from "../ScrollerListEx";
|
|
3
|
-
import { SearchPageProps } from "./SearchPageProps";
|
|
4
|
-
/**
|
|
5
|
-
* List page props
|
|
6
|
-
*/
|
|
7
|
-
export type ListPageProps<T extends object, F extends DataTypes.BasicTemplate> = SearchPageProps<T, F> & Omit<ScrollerListExProps<T>, "loadData">;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { GridMethodRef } from "@etsoo/react";
|
|
3
|
-
import { DataTypes } from "@etsoo/shared";
|
|
4
|
-
import { ListChildComponentProps } from "react-window";
|
|
5
|
-
import { ScrollerListExInnerItemRendererProps, ScrollerListExItemSize } from "../ScrollerListEx";
|
|
6
|
-
import { DataGridPageProps } from "./DataGridPageProps";
|
|
7
|
-
import { OperationMessageHandlerAll } from "../messages/OperationMessageHandler";
|
|
8
|
-
/**
|
|
9
|
-
* Response page props
|
|
10
|
-
*/
|
|
11
|
-
export type ResponsePageProps<T extends object, F extends DataTypes.BasicTemplate> = Omit<DataGridPageProps<T, F>, "mRef" | "itemKey" | "onScroll" | "onItemsRendered"> & {
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @param height Current height
|
|
15
|
-
* @param isGrid Is displaying DataGrid
|
|
16
|
-
* @returns Adjusted height
|
|
17
|
-
*/
|
|
18
|
-
adjustFabHeight?: (height: number, isGrid: boolean) => number;
|
|
19
|
-
/**
|
|
20
|
-
* Min width to show Datagrid
|
|
21
|
-
*/
|
|
22
|
-
dataGridMinWidth?: number;
|
|
23
|
-
/**
|
|
24
|
-
* Inner item renderer
|
|
25
|
-
*/
|
|
26
|
-
innerItemRenderer: (props: ScrollerListExInnerItemRendererProps<T>) => React.ReactNode;
|
|
27
|
-
/**
|
|
28
|
-
* Item renderer
|
|
29
|
-
*/
|
|
30
|
-
itemRenderer?: (props: ListChildComponentProps<T>) => React.ReactElement;
|
|
31
|
-
/**
|
|
32
|
-
* Item size, a function indicates its a variable size list
|
|
33
|
-
*/
|
|
34
|
-
itemSize: ScrollerListExItemSize;
|
|
35
|
-
/**
|
|
36
|
-
* Methods
|
|
37
|
-
*/
|
|
38
|
-
mRef?: React.MutableRefObject<GridMethodRef<T> | undefined>;
|
|
39
|
-
/**
|
|
40
|
-
* Pull to refresh data
|
|
41
|
-
*/
|
|
42
|
-
pullToRefresh?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Quick action for double click or click under mobile
|
|
45
|
-
*/
|
|
46
|
-
quickAction?: (data: T) => void;
|
|
47
|
-
/**
|
|
48
|
-
* Operation message handler
|
|
49
|
-
*/
|
|
50
|
-
operationMessageHandler?: OperationMessageHandlerAll;
|
|
51
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DataTypes } from '@etsoo/shared';
|
|
2
|
-
import { TableExProps } from '../TableEx';
|
|
3
|
-
import { SearchPageProps } from './SearchPageProps';
|
|
4
|
-
/**
|
|
5
|
-
* Table page props
|
|
6
|
-
*/
|
|
7
|
-
export type TablePageProps<T extends object, F extends DataTypes.BasicTemplate, D extends DataTypes.Keys<T>> = SearchPageProps<T, F> & Omit<TableExProps<T, D>, 'loadData'>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { UserKey } from "@etsoo/appscript";
|
|
2
|
-
import { IStateUpdate, ListItemReact } from "@etsoo/react";
|
|
3
|
-
import { ContainerProps, Theme } from "@mui/material";
|
|
4
|
-
import { CustomFabSize } from "../CustomFabProps";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Common page props
|
|
8
|
-
* Default container id is 'pageContainer'
|
|
9
|
-
*/
|
|
10
|
-
export interface CommonPageProps extends Omit<ContainerProps, "id"> {
|
|
11
|
-
/**
|
|
12
|
-
* Fab buttons
|
|
13
|
-
*/
|
|
14
|
-
fabButtons?: React.ReactNode;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Fab size
|
|
18
|
-
*/
|
|
19
|
-
fabSize?: CustomFabSize;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Fab flex column direction, undefined to hide it
|
|
23
|
-
*/
|
|
24
|
-
fabColumnDirection?: boolean;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Fab padding adjust
|
|
28
|
-
*/
|
|
29
|
-
fabPaddingAdjust?: number;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Add panel to the Fab
|
|
33
|
-
*/
|
|
34
|
-
fabPanel?: boolean;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Fab lays in the top
|
|
38
|
-
*/
|
|
39
|
-
fabTop?: ((theme: Theme, padding: {}) => object) | boolean;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* More actions
|
|
43
|
-
*/
|
|
44
|
-
moreActions?: ListItemReact[];
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* On refresh callback, only when authorized = true
|
|
48
|
-
*/
|
|
49
|
-
onRefresh?: () => void | PromiseLike<void>;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* On page update, when authorized = null or true case, may uses onRefresh
|
|
53
|
-
*/
|
|
54
|
-
onUpdate?: () => void | PromiseLike<void>;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* On page update, all cases with authorized
|
|
58
|
-
*/
|
|
59
|
-
onUpdateAll?: IStateUpdate;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Paddings
|
|
63
|
-
*/
|
|
64
|
-
paddings?: Record<string, string | number>;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Scroll container
|
|
68
|
-
*/
|
|
69
|
-
scrollContainer?: HTMLElement | object;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Support back click
|
|
73
|
-
*/
|
|
74
|
-
supportBack?: boolean;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* State last changed fields
|
|
78
|
-
*/
|
|
79
|
-
targetFields?: UserKey[];
|
|
80
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DataTypes } from "@etsoo/shared";
|
|
2
|
-
import { ScrollerListExProps } from "../ScrollerListEx";
|
|
3
|
-
import { SearchPageProps } from "./SearchPageProps";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* List page props
|
|
7
|
-
*/
|
|
8
|
-
export type ListPageProps<
|
|
9
|
-
T extends object,
|
|
10
|
-
F extends DataTypes.BasicTemplate
|
|
11
|
-
> = SearchPageProps<T, F> & Omit<ScrollerListExProps<T>, "loadData">;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { GridMethodRef } from "@etsoo/react";
|
|
2
|
-
import { DataTypes } from "@etsoo/shared";
|
|
3
|
-
import { ListChildComponentProps } from "react-window";
|
|
4
|
-
import {
|
|
5
|
-
ScrollerListExInnerItemRendererProps,
|
|
6
|
-
ScrollerListExItemSize
|
|
7
|
-
} from "../ScrollerListEx";
|
|
8
|
-
import { DataGridPageProps } from "./DataGridPageProps";
|
|
9
|
-
import { OperationMessageHandlerAll } from "../messages/OperationMessageHandler";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Response page props
|
|
13
|
-
*/
|
|
14
|
-
export type ResponsePageProps<
|
|
15
|
-
T extends object,
|
|
16
|
-
F extends DataTypes.BasicTemplate
|
|
17
|
-
> = Omit<
|
|
18
|
-
DataGridPageProps<T, F>,
|
|
19
|
-
"mRef" | "itemKey" | "onScroll" | "onItemsRendered"
|
|
20
|
-
> & {
|
|
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;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Operation message handler
|
|
68
|
-
*/
|
|
69
|
-
operationMessageHandler?: OperationMessageHandlerAll;
|
|
70
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DataTypes } from '@etsoo/shared';
|
|
2
|
-
import { TableExProps } from '../TableEx';
|
|
3
|
-
import { SearchPageProps } from './SearchPageProps';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Table page props
|
|
7
|
-
*/
|
|
8
|
-
export type TablePageProps<
|
|
9
|
-
T extends object,
|
|
10
|
-
F extends DataTypes.BasicTemplate,
|
|
11
|
-
D extends DataTypes.Keys<T>
|
|
12
|
-
> = SearchPageProps<T, F> & Omit<TableExProps<T, D>, 'loadData'>;
|