@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/lib/pages/LeftDrawer.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Avatar, Divider, Drawer, IconButton, List, Typography } from "@mui/material";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
|
|
@@ -17,7 +18,7 @@ export function LeftDrawer(props) {
|
|
|
17
18
|
React.useEffect(() => {
|
|
18
19
|
setOpen(open);
|
|
19
20
|
}, [open]);
|
|
20
|
-
return (
|
|
21
|
+
return (_jsxs(Drawer, { hidden: !openLocal, sx: {
|
|
21
22
|
width,
|
|
22
23
|
flexShrink: 0,
|
|
23
24
|
"& .MuiDrawer-paper": {
|
|
@@ -26,13 +27,5 @@ export function LeftDrawer(props) {
|
|
|
26
27
|
}
|
|
27
28
|
}, anchor: "left", variant: mdUp ? "persistent" : "temporary", open: open, transitionDuration: 0, onClose: mdUp ? undefined : handleDrawerClose, ModalProps: {
|
|
28
29
|
keepMounted: true // Better open performance on mobile.
|
|
29
|
-
} },
|
|
30
|
-
React.createElement(DrawerHeader, null,
|
|
31
|
-
React.createElement("a", { href: "https://www.etsoo.com", title: globalApp?.get("etsoo") ?? "ETSOO", target: "_blank", rel: "noreferrer" },
|
|
32
|
-
React.createElement(Avatar, { src: logoUrl, variant: "square", sx: { marginLeft: -0.5, marginRight: 1.5, marginBottom: 1 } })),
|
|
33
|
-
React.createElement(Typography, { noWrap: true, component: "div", title: appName, sx: { flexGrow: 2 } }, appName),
|
|
34
|
-
React.createElement(IconButton, { size: "small", onClick: handleDrawerClose },
|
|
35
|
-
React.createElement(ChevronLeftIcon, null))),
|
|
36
|
-
React.createElement(Divider, null),
|
|
37
|
-
React.createElement(List, { onClick: mdUp ? undefined : handleDrawerClose }, children)));
|
|
30
|
+
}, children: [_jsxs(DrawerHeader, { children: [_jsx("a", { href: "https://www.etsoo.com", title: globalApp?.get("etsoo") ?? "ETSOO", target: "_blank", rel: "noreferrer", children: _jsx(Avatar, { src: logoUrl, variant: "square", sx: { marginLeft: -0.5, marginRight: 1.5, marginBottom: 1 } }) }), _jsx(Typography, { noWrap: true, component: "div", title: appName, sx: { flexGrow: 2 }, children: appName }), _jsx(IconButton, { size: "small", onClick: handleDrawerClose, children: _jsx(ChevronLeftIcon, {}) })] }), _jsx(Divider, {}), _jsx(List, { onClick: mdUp ? undefined : handleDrawerClose, children: children })] }));
|
|
38
31
|
}
|
package/lib/pages/ListPage.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { DataTypes } from "@etsoo/shared";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import { ScrollerListExProps } from "../ScrollerListEx";
|
|
3
|
+
import type { 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">;
|
|
4
8
|
/**
|
|
5
9
|
* List page
|
|
6
10
|
* @param props Props
|
|
7
11
|
* @returns Component
|
|
8
12
|
*/
|
|
9
|
-
export declare function ListPage<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate>(props: ListPageProps<T, F>):
|
|
13
|
+
export declare function ListPage<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate>(props: ListPageProps<T, F>): import("react/jsx-runtime").JSX.Element;
|
package/lib/pages/ListPage.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { useCombinedRefs } from "@etsoo/react";
|
|
2
3
|
import { Box, Stack } from "@mui/material";
|
|
3
4
|
import React from "react";
|
|
@@ -70,11 +71,7 @@ export function ListPage(props) {
|
|
|
70
71
|
};
|
|
71
72
|
const f = typeof fields == "function" ? fields(searchData ?? {}) : fields;
|
|
72
73
|
// Layout
|
|
73
|
-
return (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
paddingBottom: pageProps.paddings
|
|
77
|
-
} },
|
|
78
|
-
React.createElement(SearchBar, { fields: f, onSubmit: onSubmit })),
|
|
79
|
-
React.createElement(ScrollerListEx, { autoLoad: false, loadData: localLoadData, onUpdateRows: GridUtils.getUpdateRowsHandler(cacheKey), onInitLoad: onInitLoad, onScroll: onListScroll, mRef: refs, ...rest }))));
|
|
74
|
+
return (_jsx(CommonPage, { ...pageProps, scrollContainer: globalThis, children: _jsxs(Stack, { children: [_jsx(Box, { sx: {
|
|
75
|
+
paddingBottom: pageProps.paddings
|
|
76
|
+
}, children: _jsx(SearchBar, { fields: f, onSubmit: onSubmit }) }), _jsx(ScrollerListEx, { autoLoad: false, loadData: localLoadData, onUpdateRows: GridUtils.getUpdateRowsHandler(cacheKey), onInitLoad: onInitLoad, onScroll: onListScroll, mRef: refs, ...rest })] }) }));
|
|
80
77
|
}
|
|
@@ -1,9 +1,57 @@
|
|
|
1
1
|
import { DataTypes } from "@etsoo/shared";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import {
|
|
3
|
+
import type { DataGridPageProps } from "./DataGridPageProps";
|
|
4
|
+
import type { ScrollerListExInnerItemRendererProps, ScrollerListExItemSize } from "../ScrollerListEx";
|
|
5
|
+
import { ListChildComponentProps } from "react-window";
|
|
6
|
+
import { GridMethodRef } from "@etsoo/react";
|
|
7
|
+
import type { 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
|
+
};
|
|
4
52
|
/**
|
|
5
53
|
* Fixed height list page
|
|
6
54
|
* @param props Props
|
|
7
55
|
* @returns Component
|
|
8
56
|
*/
|
|
9
|
-
export declare function ResponsivePage<T extends object, F extends DataTypes.BasicTemplate =
|
|
57
|
+
export declare function ResponsivePage<T extends object, F extends DataTypes.BasicTemplate = {}>(props: ResponsePageProps<T, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { MUGlobal } from "../MUGlobal";
|
|
3
4
|
import { ResponsibleContainer } from "../ResponsibleContainer";
|
|
@@ -17,30 +18,28 @@ export function ResponsivePage(props) {
|
|
|
17
18
|
const [scrollContainer, setScrollContainer] = React.useState();
|
|
18
19
|
const [direction, setDirection] = React.useState(fabColumnDirection);
|
|
19
20
|
// Layout
|
|
20
|
-
return (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
setScrollContainer(element);
|
|
45
|
-
}, ...rest })));
|
|
21
|
+
return (_jsxs(CommonPage, { ...pageRest, paddings: {}, scrollContainer: scrollContainer, fabColumnDirection: direction, children: [operationMessageHandler && (_jsx(OperationMessageContainer, { handler: operationMessageHandler })), _jsx(ResponsibleContainer, { paddings: paddings, containerBoxSx: (paddings, hasField, _dataGrid) => {
|
|
22
|
+
// Half
|
|
23
|
+
const half = MUGlobal.half(paddings);
|
|
24
|
+
// .SearchBox keep the same to avoid flick when switching between DataGrid and List
|
|
25
|
+
return {
|
|
26
|
+
paddingTop: paddings,
|
|
27
|
+
"& .SearchBox": {
|
|
28
|
+
marginLeft: paddings,
|
|
29
|
+
marginRight: paddings,
|
|
30
|
+
marginBottom: hasField ? half : 0
|
|
31
|
+
},
|
|
32
|
+
"& .ListBox": {
|
|
33
|
+
marginBottom: paddings
|
|
34
|
+
},
|
|
35
|
+
"& .DataGridBox": {
|
|
36
|
+
marginLeft: paddings,
|
|
37
|
+
marginRight: paddings,
|
|
38
|
+
marginBottom: paddings
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}, elementReady: (element, isDataGrid) => {
|
|
42
|
+
setDirection(!isDataGrid);
|
|
43
|
+
setScrollContainer(element);
|
|
44
|
+
}, ...rest })] }));
|
|
46
45
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { GridJsonData, GridLoader } from "@etsoo/react";
|
|
3
|
-
import { DataTypes } from "@etsoo/shared";
|
|
4
|
-
import { CommonPageProps } from "./
|
|
2
|
+
import type { GridJsonData, GridLoader } from "@etsoo/react";
|
|
3
|
+
import type { DataTypes } from "@etsoo/shared";
|
|
4
|
+
import type { CommonPageProps } from "./CommonPage";
|
|
5
5
|
/**
|
|
6
6
|
* Search page props
|
|
7
7
|
*/
|
package/lib/pages/TablePage.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { DataTypes, IdDefaultType } from "@etsoo/shared";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import { TableExProps } from "../TableEx";
|
|
3
|
+
import type { 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">;
|
|
4
8
|
/**
|
|
5
9
|
* Table page
|
|
6
10
|
* @param props Props
|
|
7
11
|
* @returns Component
|
|
8
12
|
*/
|
|
9
|
-
export declare function TablePage<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate, D extends DataTypes.Keys<T> = IdDefaultType<T>>(props: TablePageProps<T, F, D>):
|
|
13
|
+
export declare function TablePage<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate, D extends DataTypes.Keys<T> = IdDefaultType<T>>(props: TablePageProps<T, F, D>): import("react/jsx-runtime").JSX.Element;
|
package/lib/pages/TablePage.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { useCombinedRefs, useDimensions } from "@etsoo/react";
|
|
2
3
|
import { Box, Stack } from "@mui/material";
|
|
3
4
|
import React from "react";
|
|
@@ -54,16 +55,12 @@ export function TablePage(props) {
|
|
|
54
55
|
const paddingBottom = parseFloat(style.paddingBottom);
|
|
55
56
|
if (!isNaN(paddingBottom))
|
|
56
57
|
maxHeight -= paddingBottom;
|
|
57
|
-
return (
|
|
58
|
+
return (_jsx(TableEx, { autoLoad: false, columns: columns, loadData: localLoadData, maxHeight: maxHeight, mRef: refs, ...rest }));
|
|
58
59
|
}
|
|
59
60
|
}, [rect]);
|
|
60
61
|
const f = typeof fields == "function" ? fields(searchData ?? {}) : fields;
|
|
61
62
|
// Layout
|
|
62
|
-
return (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
paddingBottom: pageProps.paddings
|
|
66
|
-
} },
|
|
67
|
-
React.createElement(SearchBar, { fields: f, onSubmit: onSubmit })),
|
|
68
|
-
list)));
|
|
63
|
+
return (_jsx(CommonPage, { ...pageProps, scrollContainer: globalThis, children: _jsxs(Stack, { children: [_jsx(Box, { ref: dimensions[0][0], sx: {
|
|
64
|
+
paddingBottom: pageProps.paddings
|
|
65
|
+
}, children: _jsx(SearchBar, { fields: f, onSubmit: onSubmit }) }), list] }) }));
|
|
69
66
|
}
|
package/lib/pages/UserMenu.d.ts
CHANGED
|
@@ -37,4 +37,4 @@ export declare const eventWatcher: EventWatcher;
|
|
|
37
37
|
* @param props Props
|
|
38
38
|
* @returns Component
|
|
39
39
|
*/
|
|
40
|
-
export declare function UserMenu(props: UserMenuProps):
|
|
40
|
+
export declare function UserMenu(props: UserMenuProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/pages/UserMenu.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { EventWatcher } from "@etsoo/react";
|
|
2
3
|
import { IconButton, Menu } from "@mui/material";
|
|
3
4
|
import React from "react";
|
|
@@ -46,41 +47,38 @@ export function UserMenu(props) {
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
};
|
|
49
|
-
return (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
transform: "translateY(-50%) rotate(45deg)",
|
|
75
|
-
zIndex: 0
|
|
50
|
+
return (_jsxs(React.Fragment, { children: [_jsx(IconButton, { edge: "end", "aria-haspopup": "true", onClick: handleUserMenuOpen, color: "inherit", children: _jsx(UserAvatar, { title: name, src: avatar }) }), _jsx(Menu, { slotProps: {
|
|
51
|
+
paper: {
|
|
52
|
+
elevation: 0,
|
|
53
|
+
sx: {
|
|
54
|
+
overflow: "visible",
|
|
55
|
+
filter: "drop-shadow(0px 2px 8px rgba(0,0,0,0.32))",
|
|
56
|
+
mt: -0.4,
|
|
57
|
+
"& .MuiAvatar-root": {
|
|
58
|
+
width: 32,
|
|
59
|
+
height: 32,
|
|
60
|
+
ml: -0.5,
|
|
61
|
+
mr: 1
|
|
62
|
+
},
|
|
63
|
+
"&:before": {
|
|
64
|
+
content: '""',
|
|
65
|
+
display: "block",
|
|
66
|
+
position: "absolute",
|
|
67
|
+
top: 0,
|
|
68
|
+
right: 14,
|
|
69
|
+
width: 10,
|
|
70
|
+
height: 10,
|
|
71
|
+
bgcolor: "background.paper",
|
|
72
|
+
transform: "translateY(-50%) rotate(45deg)",
|
|
73
|
+
zIndex: 0
|
|
74
|
+
}
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}, open: isMenuOpen, transitionDuration: 0, onTransitionEnd: () => eventWatcher.do(eventWatcherAction), onClick: handleClick, onClose: handleMenuClose }, children(handleMenuClose))));
|
|
77
|
+
}, disableScrollLock: true, anchorEl: anchorEl, anchorOrigin: {
|
|
78
|
+
vertical: "bottom",
|
|
79
|
+
horizontal: "right"
|
|
80
|
+
}, keepMounted: true, transformOrigin: {
|
|
81
|
+
vertical: "top",
|
|
82
|
+
horizontal: "right"
|
|
83
|
+
}, open: isMenuOpen, transitionDuration: 0, onTransitionEnd: () => eventWatcher.do(eventWatcherAction), onClick: handleClick, onClose: handleMenuClose, children: children(handleMenuClose) })] }));
|
|
86
84
|
}
|
package/lib/pages/ViewPage.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { GridColumnRenderProps, GridDataType } from "@etsoo/react";
|
|
|
2
2
|
import { DataTypes } from "@etsoo/shared";
|
|
3
3
|
import { GridProps } from "@mui/material";
|
|
4
4
|
import React from "react";
|
|
5
|
-
import { CommonPageProps } from "./
|
|
6
|
-
import { OperationMessageHandlerAll } from "../messages/OperationMessageHandler";
|
|
5
|
+
import { CommonPageProps } from "./CommonPage";
|
|
6
|
+
import type { OperationMessageHandlerAll } from "../messages/OperationMessageHandler";
|
|
7
7
|
/**
|
|
8
8
|
* View page grid item properties
|
|
9
9
|
*/
|
|
@@ -17,7 +17,7 @@ export type ViewPageGridItemProps = GridProps & {
|
|
|
17
17
|
* @param props Props
|
|
18
18
|
* @returns Result
|
|
19
19
|
*/
|
|
20
|
-
export declare function ViewPageGridItem(props: ViewPageGridItemProps):
|
|
20
|
+
export declare function ViewPageGridItem(props: ViewPageGridItemProps): import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
/**
|
|
22
22
|
* View page row width type
|
|
23
23
|
*/
|
|
@@ -100,5 +100,5 @@ export interface ViewPageProps<T extends DataTypes.StringRecord> extends Omit<Co
|
|
|
100
100
|
* View page
|
|
101
101
|
* @param props Props
|
|
102
102
|
*/
|
|
103
|
-
export declare function ViewPage<T extends DataTypes.StringRecord>(props: ViewPageProps<T>):
|
|
103
|
+
export declare function ViewPage<T extends DataTypes.StringRecord>(props: ViewPageProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
104
104
|
export {};
|
package/lib/pages/ViewPage.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { createElement as _createElement } from "react";
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
1
3
|
import { ScrollRestoration } from "@etsoo/react";
|
|
2
4
|
import { DateUtils, Utils } from "@etsoo/shared";
|
|
3
5
|
import { Grid, LinearProgress, Stack, Typography } from "@mui/material";
|
|
@@ -27,11 +29,7 @@ export function ViewPageGridItem(props) {
|
|
|
27
29
|
options = getResp(singleRow ?? "small");
|
|
28
30
|
}
|
|
29
31
|
// Layout
|
|
30
|
-
return (
|
|
31
|
-
label != null && (React.createElement(Typography, { variant: "caption", component: "div" },
|
|
32
|
-
label,
|
|
33
|
-
":")),
|
|
34
|
-
typeof data === "object" ? (data) : (React.createElement(Typography, { variant: "subtitle2" }, data))));
|
|
32
|
+
return (_jsxs(Grid, { item: true, ...gridProps, ...options, children: [label != null && (_jsxs(Typography, { variant: "caption", component: "div", children: [label, ":"] })), typeof data === "object" ? (data) : (_jsx(Typography, { variant: "subtitle2", children: data }))] }));
|
|
35
33
|
}
|
|
36
34
|
function formatItemData(fieldData) {
|
|
37
35
|
if (fieldData == null)
|
|
@@ -125,36 +123,30 @@ export function ViewPage(props) {
|
|
|
125
123
|
MessageUtils.offRefresh(refreshHandler);
|
|
126
124
|
};
|
|
127
125
|
}, []);
|
|
128
|
-
return (
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
Utils.getResult(children, data, refresh),
|
|
155
|
-
pullToRefresh && (React.createElement(PullToRefreshUI, { mainElement: pullContainer, triggerElement: pullContainer, instructionsPullToRefresh: labels.pullToRefresh, instructionsReleaseToRefresh: labels.releaseToRefresh, instructionsRefreshing: labels.refreshing, onRefresh: refresh, shouldPullToRefresh: () => {
|
|
156
|
-
const container = document.querySelector(pullContainer);
|
|
157
|
-
return !container?.scrollTop;
|
|
158
|
-
} })),
|
|
159
|
-
React.createElement(ScrollRestoration, null)))));
|
|
126
|
+
return (_jsx(CommonPage, { paddings: paddings, onRefresh: supportRefresh ? refresh : undefined, onUpdate: supportRefresh ? undefined : refresh, ...rest, scrollContainer: globalThis, fabColumnDirection: fabColumnDirection, fabTop: fabTop, supportBack: supportBack, children: data == null ? (_jsx(LinearProgress, {})) : (_jsxs(React.Fragment, { children: [operationMessageHandler && (_jsx(OperationMessageContainer, { handler: "id" in operationMessageHandler
|
|
127
|
+
? [
|
|
128
|
+
operationMessageHandler.types,
|
|
129
|
+
refresh,
|
|
130
|
+
operationMessageHandler.id
|
|
131
|
+
]
|
|
132
|
+
: operationMessageHandler })), _jsx(Grid, { container: true, justifyContent: "left", spacing: spacing, className: "ET-ViewPage", ref: gridRef, sx: {
|
|
133
|
+
".MuiTypography-subtitle2": {
|
|
134
|
+
fontWeight: "bold"
|
|
135
|
+
}
|
|
136
|
+
}, children: fields.map((field, index) => {
|
|
137
|
+
// Get data
|
|
138
|
+
if (typeof field === "function") {
|
|
139
|
+
// Most flexible way, do whatever you want
|
|
140
|
+
return field(data, refresh);
|
|
141
|
+
}
|
|
142
|
+
const [itemData, itemLabel, gridProps] = getItemField(field, data);
|
|
143
|
+
// Some callback function may return '' instead of undefined
|
|
144
|
+
if (itemData == null || itemData === "")
|
|
145
|
+
return undefined;
|
|
146
|
+
// Layout
|
|
147
|
+
return (_createElement(ViewPageGridItem, { item: true, ...gridProps, key: index, data: itemData, label: itemLabel }));
|
|
148
|
+
}) }), actions !== null && (_jsx(Stack, { className: "ET-ViewPage-Actions", direction: "row", width: "100%", flexWrap: "wrap", justifyContent: "flex-end", paddingTop: actions == null ? undefined : paddings, paddingBottom: paddings, gap: paddings, children: actions != null && Utils.getResult(actions, data, refresh) })), Utils.getResult(children, data, refresh), pullToRefresh && (_jsx(PullToRefreshUI, { mainElement: pullContainer, triggerElement: pullContainer, instructionsPullToRefresh: labels.pullToRefresh, instructionsReleaseToRefresh: labels.releaseToRefresh, instructionsRefreshing: labels.refreshing, onRefresh: refresh, shouldPullToRefresh: () => {
|
|
149
|
+
const container = document.querySelector(pullContainer);
|
|
150
|
+
return !container?.scrollTop;
|
|
151
|
+
} })), _jsx(ScrollRestoration, {})] })) }));
|
|
160
152
|
}
|
package/lib/texts/DateText.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DateUtils } from '@etsoo/shared';
|
|
2
2
|
import { TypographyProps } from '@mui/material';
|
|
3
|
-
import React from 'react';
|
|
4
3
|
/**
|
|
5
4
|
* Date text props
|
|
6
5
|
*/
|
|
@@ -31,4 +30,4 @@ export interface DateTextProps extends TypographyProps {
|
|
|
31
30
|
* @param props Props
|
|
32
31
|
* @returns Component
|
|
33
32
|
*/
|
|
34
|
-
export declare function DateText(props: DateTextProps):
|
|
33
|
+
export declare function DateText(props: DateTextProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/texts/DateText.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { DateUtils } from '@etsoo/shared';
|
|
2
3
|
import { Typography } from '@mui/material';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
/**
|
|
5
5
|
* Date text
|
|
6
6
|
* @param props Props
|
|
@@ -21,5 +21,5 @@ export function DateText(props) {
|
|
|
21
21
|
rest.color = (theme) => theme.palette.error.main;
|
|
22
22
|
}
|
|
23
23
|
// Layout
|
|
24
|
-
return (
|
|
24
|
+
return (_jsx(Typography, { component: "span", fontSize: "inherit", ...rest, children: localValue }));
|
|
25
25
|
}
|
package/lib/texts/MoneyText.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { NumberTextProps } from './NumberText';
|
|
3
2
|
/**
|
|
4
3
|
* Money text props
|
|
@@ -18,4 +17,4 @@ export interface MoneyTextProps extends NumberTextProps {
|
|
|
18
17
|
* @param props Props
|
|
19
18
|
* @returns Component
|
|
20
19
|
*/
|
|
21
|
-
export declare function MoneyText(props: MoneyTextProps):
|
|
20
|
+
export declare function MoneyText(props: MoneyTextProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/texts/MoneyText.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { NumberUtils } from '@etsoo/shared';
|
|
2
3
|
import { Typography } from '@mui/material';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
/**
|
|
5
5
|
* Money text
|
|
6
6
|
* @param props Props
|
|
@@ -10,7 +10,7 @@ export function MoneyText(props) {
|
|
|
10
10
|
// Destruct
|
|
11
11
|
const { currency, isInteger = false, locale, options = {}, value, ...rest } = props;
|
|
12
12
|
// Layout
|
|
13
|
-
return (
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
return (_jsx(Typography, { component: "span", fontSize: "inherit", ...rest, children: value == null
|
|
14
|
+
? ''
|
|
15
|
+
: NumberUtils.formatMoney(value, currency, locale, isInteger, options) }));
|
|
16
16
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TypographyProps } from '@mui/material';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
/**
|
|
4
3
|
* Number text props
|
|
5
4
|
*/
|
|
@@ -22,4 +21,4 @@ export interface NumberTextProps extends TypographyProps {
|
|
|
22
21
|
* @param props Props
|
|
23
22
|
* @returns Component
|
|
24
23
|
*/
|
|
25
|
-
export declare function NumberText(props: NumberTextProps):
|
|
24
|
+
export declare function NumberText(props: NumberTextProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/texts/NumberText.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { NumberUtils } from '@etsoo/shared';
|
|
2
3
|
import { Typography } from '@mui/material';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
/**
|
|
5
5
|
* Number text
|
|
6
6
|
* @param props Props
|
|
@@ -10,5 +10,5 @@ export function NumberText(props) {
|
|
|
10
10
|
// Destruct
|
|
11
11
|
const { locale, options = {}, value, ...rest } = props;
|
|
12
12
|
// Layout
|
|
13
|
-
return (
|
|
13
|
+
return (_jsx(Typography, { component: "span", fontSize: "inherit", ...rest, children: value == null ? '' : NumberUtils.format(value, locale, options) }));
|
|
14
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.60",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"@emotion/styled": "^11.11.5",
|
|
53
53
|
"@etsoo/appscript": "^1.4.90",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.42",
|
|
55
|
-
"@etsoo/react": "^1.7.
|
|
55
|
+
"@etsoo/react": "^1.7.45",
|
|
56
56
|
"@etsoo/shared": "^1.2.40",
|
|
57
57
|
"@mui/icons-material": "^5.15.18",
|
|
58
58
|
"@mui/material": "^5.15.18",
|
|
59
59
|
"@mui/x-data-grid": "^7.5.0",
|
|
60
|
-
"chart.js": "^4.4.
|
|
60
|
+
"chart.js": "^4.4.3",
|
|
61
61
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
62
62
|
"eventemitter3": "^5.0.1",
|
|
63
63
|
"pica": "^9.0.1",
|
package/src/ComboBox.tsx
CHANGED
|
@@ -15,7 +15,7 @@ import React from "react";
|
|
|
15
15
|
import { Utils as SharedUtils } from "@etsoo/shared";
|
|
16
16
|
import { ReactUtils } from "@etsoo/react";
|
|
17
17
|
import AddIcon from "@mui/icons-material/Add";
|
|
18
|
-
import { AutocompleteExtendedProps } from "./AutocompleteExtendedProps";
|
|
18
|
+
import type { AutocompleteExtendedProps } from "./AutocompleteExtendedProps";
|
|
19
19
|
import { SearchField } from "./SearchField";
|
|
20
20
|
import { InputField } from "./InputField";
|
|
21
21
|
import { globalApp } from "./app/ReactApp";
|
package/src/ComboBoxMultiple.tsx
CHANGED
|
@@ -16,7 +16,7 @@ import { ReactUtils } from "@etsoo/react";
|
|
|
16
16
|
|
|
17
17
|
import CheckBoxOutlineBlankIcon from "@mui/icons-material/CheckBoxOutlineBlank";
|
|
18
18
|
import CheckBoxIcon from "@mui/icons-material/CheckBox";
|
|
19
|
-
import { AutocompleteExtendedProps } from "./AutocompleteExtendedProps";
|
|
19
|
+
import type { AutocompleteExtendedProps } from "./AutocompleteExtendedProps";
|
|
20
20
|
import { SearchField } from "./SearchField";
|
|
21
21
|
import { InputField } from "./InputField";
|
|
22
22
|
import { globalApp } from "./app/ReactApp";
|
package/src/Tiplist.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { ReactUtils, useDelayedExecutor } from "@etsoo/react";
|
|
|
2
2
|
import { DataTypes, IdDefaultType, ListType2 } from "@etsoo/shared";
|
|
3
3
|
import { Autocomplete, AutocompleteRenderInputParams } from "@mui/material";
|
|
4
4
|
import React from "react";
|
|
5
|
-
import { AutocompleteExtendedProps } from "./AutocompleteExtendedProps";
|
|
5
|
+
import type { AutocompleteExtendedProps } from "./AutocompleteExtendedProps";
|
|
6
6
|
import { globalApp } from "./app/ReactApp";
|
|
7
7
|
import { SearchField } from "./SearchField";
|
|
8
8
|
import { InputField } from "./InputField";
|
package/src/index.ts
CHANGED
|
@@ -17,7 +17,6 @@ export * from "./messages/RefreshHandler";
|
|
|
17
17
|
export * from "./messages/SignalRUser";
|
|
18
18
|
|
|
19
19
|
export * from "./pages/CommonPage";
|
|
20
|
-
export * from "./pages/CommonPageProps";
|
|
21
20
|
export * from "./pages/DataGridPage";
|
|
22
21
|
export * from "./pages/DataGridPageProps";
|
|
23
22
|
export * from "./pages/DrawerHeader";
|
|
@@ -25,9 +24,7 @@ export * from "./pages/EditPage";
|
|
|
25
24
|
export * from "./pages/FixedListPage";
|
|
26
25
|
export * from "./pages/LeftDrawer";
|
|
27
26
|
export * from "./pages/ListPage";
|
|
28
|
-
export * from "./pages/ListPageProps";
|
|
29
27
|
export * from "./pages/ResponsivePage";
|
|
30
|
-
export * from "./pages/ResponsivePageProps";
|
|
31
28
|
export * from "./pages/SearchPageProps";
|
|
32
29
|
export * from "./pages/TablePage";
|
|
33
30
|
export * from "./pages/UserMenu";
|