@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.
Files changed (201) hide show
  1. package/__tests__/ResponsePage.tsx +11 -3
  2. package/lib/AddresSelector.d.ts +1 -1
  3. package/lib/AddresSelector.js +9 -18
  4. package/lib/AuditDisplay.d.ts +1 -1
  5. package/lib/AuditDisplay.js +12 -15
  6. package/lib/BackButton.d.ts +1 -2
  7. package/lib/BackButton.js +3 -4
  8. package/lib/BridgeCloseButton.d.ts +1 -2
  9. package/lib/BridgeCloseButton.js +3 -4
  10. package/lib/ButtonLink.d.ts +1 -2
  11. package/lib/ButtonLink.js +2 -2
  12. package/lib/ComboBox.d.ts +2 -3
  13. package/lib/ComboBox.js +12 -16
  14. package/lib/ComboBoxMultiple.d.ts +2 -3
  15. package/lib/ComboBoxMultiple.js +15 -19
  16. package/lib/ComboBoxPro.d.ts +1 -2
  17. package/lib/ComboBoxPro.js +3 -2
  18. package/lib/CountdownButton.js +4 -3
  19. package/lib/CountryList.d.ts +1 -2
  20. package/lib/CountryList.js +2 -1
  21. package/lib/CultureDataTable.d.ts +1 -2
  22. package/lib/CultureDataTable.js +2 -1
  23. package/lib/DataGridEx.d.ts +1 -1
  24. package/lib/DataGridEx.js +55 -58
  25. package/lib/DataGridRenderers.js +5 -5
  26. package/lib/DataSteps.d.ts +1 -2
  27. package/lib/DataSteps.js +20 -23
  28. package/lib/DataTable.d.ts +1 -1
  29. package/lib/DataTable.js +2 -1
  30. package/lib/DialogButton.d.ts +1 -1
  31. package/lib/DialogButton.js +6 -13
  32. package/lib/DnDList.d.ts +1 -1
  33. package/lib/DnDList.js +8 -8
  34. package/lib/DraggablePaperComponent.d.ts +1 -2
  35. package/lib/DraggablePaperComponent.js +2 -2
  36. package/lib/EmailInput.d.ts +1 -2
  37. package/lib/EmailInput.js +2 -2
  38. package/lib/FabBox.d.ts +1 -2
  39. package/lib/FabBox.js +4 -3
  40. package/lib/FieldSetEx.d.ts +1 -1
  41. package/lib/FieldSetEx.js +13 -16
  42. package/lib/FileUploadButton.d.ts +1 -1
  43. package/lib/FileUploadButton.js +27 -29
  44. package/lib/FlexBox.d.ts +2 -3
  45. package/lib/FlexBox.js +3 -3
  46. package/lib/GridDataFormat.js +2 -2
  47. package/lib/HiSelector.d.ts +1 -1
  48. package/lib/HiSelector.js +2 -12
  49. package/lib/HiSelectorTL.d.ts +1 -1
  50. package/lib/HiSelectorTL.js +2 -12
  51. package/lib/IconButtonLink.d.ts +1 -2
  52. package/lib/IconButtonLink.js +2 -2
  53. package/lib/InputField.js +2 -1
  54. package/lib/InputTipField.d.ts +1 -1
  55. package/lib/InputTipField.js +12 -14
  56. package/lib/IntInputField.js +28 -33
  57. package/lib/ItemList.d.ts +1 -1
  58. package/lib/ItemList.js +6 -11
  59. package/lib/LineChart.d.ts +1 -2
  60. package/lib/LineChart.js +2 -1
  61. package/lib/ListChooser.d.ts +1 -1
  62. package/lib/ListChooser.js +4 -7
  63. package/lib/ListMoreDisplay.d.ts +1 -1
  64. package/lib/ListMoreDisplay.js +5 -10
  65. package/lib/LoadingButton.d.ts +1 -2
  66. package/lib/LoadingButton.js +3 -2
  67. package/lib/MaskInput.d.ts +1 -2
  68. package/lib/MaskInput.js +2 -1
  69. package/lib/MenuButton.d.ts +1 -1
  70. package/lib/MenuButton.js +30 -31
  71. package/lib/MobileListItemRenderer.d.ts +1 -1
  72. package/lib/MobileListItemRenderer.js +15 -18
  73. package/lib/MoneyInputField.js +2 -1
  74. package/lib/MoreFab.d.ts +1 -1
  75. package/lib/MoreFab.js +21 -24
  76. package/lib/NotifierMU.d.ts +2 -2
  77. package/lib/NotifierMU.js +27 -67
  78. package/lib/NumberInputField.d.ts +1 -1
  79. package/lib/NumberInputField.js +4 -4
  80. package/lib/OptionBool.d.ts +1 -2
  81. package/lib/OptionBool.js +2 -2
  82. package/lib/OptionGroup.d.ts +1 -1
  83. package/lib/OptionGroup.js +17 -20
  84. package/lib/OptionGroupFlag.d.ts +1 -1
  85. package/lib/OptionGroupFlag.js +15 -18
  86. package/lib/PList.d.ts +1 -2
  87. package/lib/PList.js +5 -4
  88. package/lib/PercentCircularProgress.d.ts +1 -2
  89. package/lib/PercentCircularProgress.js +11 -14
  90. package/lib/PercentLinearProgress.d.ts +1 -2
  91. package/lib/PercentLinearProgress.js +2 -6
  92. package/lib/ProgressCount.d.ts +1 -2
  93. package/lib/ProgressCount.js +12 -18
  94. package/lib/PullToRefreshUI.d.ts +1 -2
  95. package/lib/PullToRefreshUI.js +2 -1
  96. package/lib/QuickList.d.ts +1 -1
  97. package/lib/QuickList.js +12 -14
  98. package/lib/ResponsibleContainer.d.ts +1 -1
  99. package/lib/ResponsibleContainer.js +11 -16
  100. package/lib/ScrollTopFab.d.ts +1 -2
  101. package/lib/ScrollTopFab.js +2 -3
  102. package/lib/ScrollerListEx.d.ts +1 -1
  103. package/lib/ScrollerListEx.js +3 -2
  104. package/lib/SearchBar.d.ts +1 -1
  105. package/lib/SearchBar.js +27 -35
  106. package/lib/SearchField.d.ts +1 -2
  107. package/lib/SearchField.js +2 -1
  108. package/lib/SearchOptionGroup.d.ts +1 -2
  109. package/lib/SearchOptionGroup.js +2 -2
  110. package/lib/SelectBool.d.ts +1 -2
  111. package/lib/SelectBool.js +2 -2
  112. package/lib/SelectEx.d.ts +1 -1
  113. package/lib/SelectEx.js +47 -55
  114. package/lib/ShowDataComparison.js +2 -11
  115. package/lib/Switch.d.ts +1 -2
  116. package/lib/Switch.js +3 -2
  117. package/lib/SwitchAnt.d.ts +1 -2
  118. package/lib/SwitchAnt.js +12 -14
  119. package/lib/SwitchField.d.ts +1 -1
  120. package/lib/SwitchField.js +13 -16
  121. package/lib/TabBox.d.ts +1 -1
  122. package/lib/TabBox.js +6 -9
  123. package/lib/TableEx.d.ts +1 -1
  124. package/lib/TableEx.js +79 -89
  125. package/lib/TagList.d.ts +1 -2
  126. package/lib/TagList.js +4 -5
  127. package/lib/TagListPro.d.ts +1 -2
  128. package/lib/TagListPro.js +4 -6
  129. package/lib/TextFieldEx.js +3 -6
  130. package/lib/Tiplist.d.ts +2 -3
  131. package/lib/Tiplist.js +39 -40
  132. package/lib/TiplistPro.d.ts +2 -2
  133. package/lib/TiplistPro.js +48 -49
  134. package/lib/TooltipClick.d.ts +1 -1
  135. package/lib/TooltipClick.js +3 -3
  136. package/lib/TwoFieldInput.d.ts +1 -2
  137. package/lib/TwoFieldInput.js +4 -5
  138. package/lib/UserAvatar.d.ts +1 -2
  139. package/lib/UserAvatar.js +3 -3
  140. package/lib/UserAvatarEditor.d.ts +1 -2
  141. package/lib/UserAvatarEditor.js +2 -19
  142. package/lib/index.d.ts +0 -3
  143. package/lib/index.js +0 -3
  144. package/lib/messages/OperationMessageContainer.d.ts +1 -2
  145. package/lib/messages/OperationMessageContainer.js +2 -1
  146. package/lib/pages/CommonPage.d.ts +67 -2
  147. package/lib/pages/CommonPage.js +15 -24
  148. package/lib/pages/DataGridPage.d.ts +2 -3
  149. package/lib/pages/DataGridPage.js +5 -8
  150. package/lib/pages/DataGridPageProps.d.ts +3 -3
  151. package/lib/pages/EditPage.d.ts +3 -3
  152. package/lib/pages/EditPage.js +6 -15
  153. package/lib/pages/FixedListPage.d.ts +2 -3
  154. package/lib/pages/FixedListPage.js +5 -9
  155. package/lib/pages/LeftDrawer.d.ts +1 -1
  156. package/lib/pages/LeftDrawer.js +3 -10
  157. package/lib/pages/ListPage.d.ts +7 -3
  158. package/lib/pages/ListPage.js +4 -7
  159. package/lib/pages/ResponsivePage.d.ts +50 -2
  160. package/lib/pages/ResponsivePage.js +25 -26
  161. package/lib/pages/SearchPageProps.d.ts +3 -3
  162. package/lib/pages/TablePage.d.ts +7 -3
  163. package/lib/pages/TablePage.js +5 -8
  164. package/lib/pages/UserMenu.d.ts +1 -1
  165. package/lib/pages/UserMenu.js +33 -35
  166. package/lib/pages/ViewPage.d.ts +4 -4
  167. package/lib/pages/ViewPage.js +29 -37
  168. package/lib/texts/DateText.d.ts +1 -2
  169. package/lib/texts/DateText.js +2 -2
  170. package/lib/texts/MoneyText.d.ts +1 -2
  171. package/lib/texts/MoneyText.js +4 -4
  172. package/lib/texts/NumberText.d.ts +1 -2
  173. package/lib/texts/NumberText.js +2 -2
  174. package/package.json +3 -3
  175. package/src/ComboBox.tsx +1 -1
  176. package/src/ComboBoxMultiple.tsx +1 -1
  177. package/src/Tiplist.tsx +1 -1
  178. package/src/index.ts +0 -3
  179. package/src/pages/CommonPage.tsx +80 -2
  180. package/src/pages/DataGridPage.tsx +1 -1
  181. package/src/pages/DataGridPageProps.ts +3 -3
  182. package/src/pages/EditPage.tsx +2 -3
  183. package/src/pages/FixedListPage.tsx +1 -1
  184. package/src/pages/ListPage.tsx +10 -2
  185. package/src/pages/ResponsivePage.tsx +70 -2
  186. package/src/pages/SearchPageProps.ts +3 -3
  187. package/src/pages/TablePage.tsx +16 -2
  188. package/src/pages/ViewPage.tsx +3 -4
  189. package/tsconfig.json +2 -2
  190. package/lib/pages/CommonPageProps.d.ts +0 -67
  191. package/lib/pages/CommonPageProps.js +0 -1
  192. package/lib/pages/ListPageProps.d.ts +0 -7
  193. package/lib/pages/ListPageProps.js +0 -1
  194. package/lib/pages/ResponsivePageProps.d.ts +0 -51
  195. package/lib/pages/ResponsivePageProps.js +0 -1
  196. package/lib/pages/TablePageProps.d.ts +0 -7
  197. package/lib/pages/TablePageProps.js +0 -1
  198. package/src/pages/CommonPageProps.ts +0 -80
  199. package/src/pages/ListPageProps.ts +0 -11
  200. package/src/pages/ResponsivePageProps.ts +0 -70
  201. package/src/pages/TablePageProps.ts +0 -12
@@ -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 (React.createElement(Drawer, { hidden: !openLocal, sx: {
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
  }
@@ -1,9 +1,13 @@
1
1
  import { DataTypes } from "@etsoo/shared";
2
- import React from "react";
3
- import { ListPageProps } from "./ListPageProps";
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>): React.JSX.Element;
13
+ export declare function ListPage<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate>(props: ListPageProps<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 { 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 (React.createElement(CommonPage, { ...pageProps, scrollContainer: globalThis },
74
- React.createElement(Stack, null,
75
- React.createElement(Box, { sx: {
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 { ResponsePageProps } from "./ResponsivePageProps";
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 = DataTypes.BasicTemplate>(props: ResponsePageProps<T, F>): React.JSX.Element;
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 (React.createElement(CommonPage, { ...pageRest, paddings: {}, scrollContainer: scrollContainer, fabColumnDirection: direction },
21
- operationMessageHandler && (React.createElement(OperationMessageContainer, { handler: operationMessageHandler })),
22
- React.createElement(ResponsibleContainer, { paddings: paddings, containerBoxSx: (paddings, hasField, _dataGrid) => {
23
- // Half
24
- const half = MUGlobal.half(paddings);
25
- // .SearchBox keep the same to avoid flick when switching between DataGrid and List
26
- return {
27
- paddingTop: paddings,
28
- "& .SearchBox": {
29
- marginLeft: paddings,
30
- marginRight: paddings,
31
- marginBottom: hasField ? half : 0
32
- },
33
- "& .ListBox": {
34
- marginBottom: paddings
35
- },
36
- "& .DataGridBox": {
37
- marginLeft: paddings,
38
- marginRight: paddings,
39
- marginBottom: paddings
40
- }
41
- };
42
- }, elementReady: (element, isDataGrid) => {
43
- setDirection(!isDataGrid);
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 "./CommonPageProps";
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
  */
@@ -1,9 +1,13 @@
1
1
  import { DataTypes, IdDefaultType } from "@etsoo/shared";
2
- import React from "react";
3
- import { TablePageProps } from "./TablePageProps";
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>): React.JSX.Element;
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;
@@ -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 (React.createElement(TableEx, { autoLoad: false, columns: columns, loadData: localLoadData, maxHeight: maxHeight, mRef: refs, ...rest }));
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 (React.createElement(CommonPage, { ...pageProps, scrollContainer: globalThis },
63
- React.createElement(Stack, null,
64
- React.createElement(Box, { ref: dimensions[0][0], sx: {
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
  }
@@ -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): React.JSX.Element;
40
+ export declare function UserMenu(props: UserMenuProps): 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 { 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 (React.createElement(React.Fragment, null,
50
- React.createElement(IconButton, { edge: "end", "aria-haspopup": "true", onClick: handleUserMenuOpen, color: "inherit" },
51
- React.createElement(UserAvatar, { title: name, src: avatar })),
52
- React.createElement(Menu, { slotProps: {
53
- paper: {
54
- elevation: 0,
55
- sx: {
56
- overflow: "visible",
57
- filter: "drop-shadow(0px 2px 8px rgba(0,0,0,0.32))",
58
- mt: -0.4,
59
- "& .MuiAvatar-root": {
60
- width: 32,
61
- height: 32,
62
- ml: -0.5,
63
- mr: 1
64
- },
65
- "&:before": {
66
- content: '""',
67
- display: "block",
68
- position: "absolute",
69
- top: 0,
70
- right: 14,
71
- width: 10,
72
- height: 10,
73
- bgcolor: "background.paper",
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
- }, disableScrollLock: true, anchorEl: anchorEl, anchorOrigin: {
80
- vertical: "bottom",
81
- horizontal: "right"
82
- }, keepMounted: true, transformOrigin: {
83
- vertical: "top",
84
- horizontal: "right"
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
  }
@@ -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 "./CommonPageProps";
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): React.JSX.Element;
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>): React.JSX.Element;
103
+ export declare function ViewPage<T extends DataTypes.StringRecord>(props: ViewPageProps<T>): import("react/jsx-runtime").JSX.Element;
104
104
  export {};
@@ -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 (React.createElement(Grid, { item: true, ...gridProps, ...options },
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 (React.createElement(CommonPage, { paddings: paddings, onRefresh: supportRefresh ? refresh : undefined, onUpdate: supportRefresh ? undefined : refresh, ...rest, scrollContainer: globalThis, fabColumnDirection: fabColumnDirection, fabTop: fabTop, supportBack: supportBack }, data == null ? (React.createElement(LinearProgress, null)) : (React.createElement(React.Fragment, null,
129
- operationMessageHandler && (React.createElement(OperationMessageContainer, { handler: "id" in operationMessageHandler
130
- ? [
131
- operationMessageHandler.types,
132
- refresh,
133
- operationMessageHandler.id
134
- ]
135
- : operationMessageHandler })),
136
- React.createElement(Grid, { container: true, justifyContent: "left", spacing: spacing, className: "ET-ViewPage", ref: gridRef, sx: {
137
- ".MuiTypography-subtitle2": {
138
- fontWeight: "bold"
139
- }
140
- } }, fields.map((field, index) => {
141
- // Get data
142
- if (typeof field === "function") {
143
- // Most flexible way, do whatever you want
144
- return field(data, refresh);
145
- }
146
- const [itemData, itemLabel, gridProps] = getItemField(field, data);
147
- // Some callback function may return '' instead of undefined
148
- if (itemData == null || itemData === "")
149
- return undefined;
150
- // Layout
151
- return (React.createElement(ViewPageGridItem, { item: true, ...gridProps, key: index, data: itemData, label: itemLabel }));
152
- })),
153
- actions !== null && (React.createElement(Stack, { className: "ET-ViewPage-Actions", direction: "row", width: "100%", flexWrap: "wrap", justifyContent: "flex-end", paddingTop: actions == null ? undefined : paddings, paddingBottom: paddings, gap: paddings }, actions != null && Utils.getResult(actions, data, refresh))),
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
  }
@@ -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): React.JSX.Element;
33
+ export declare function DateText(props: DateTextProps): import("react/jsx-runtime").JSX.Element;
@@ -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 (React.createElement(Typography, { component: "span", fontSize: "inherit", ...rest }, localValue));
24
+ return (_jsx(Typography, { component: "span", fontSize: "inherit", ...rest, children: localValue }));
25
25
  }
@@ -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): React.JSX.Element;
20
+ export declare function MoneyText(props: MoneyTextProps): import("react/jsx-runtime").JSX.Element;
@@ -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 (React.createElement(Typography, { component: "span", fontSize: "inherit", ...rest }, value == null
14
- ? ''
15
- : NumberUtils.formatMoney(value, currency, locale, isInteger, options)));
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): React.JSX.Element;
24
+ export declare function NumberText(props: NumberTextProps): import("react/jsx-runtime").JSX.Element;
@@ -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 (React.createElement(Typography, { component: "span", fontSize: "inherit", ...rest }, value == null ? '' : NumberUtils.format(value, locale, options)));
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.58",
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.44",
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.2",
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";
@@ -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";