@etsoo/materialui 1.3.58 → 1.3.59
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 +12 -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 +1 -2
- package/lib/ComboBox.js +12 -16
- package/lib/ComboBoxMultiple.d.ts +1 -2
- 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 +1 -2
- 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/messages/OperationMessageContainer.d.ts +1 -2
- package/lib/messages/OperationMessageContainer.js +2 -1
- package/lib/pages/CommonPage.d.ts +1 -2
- package/lib/pages/CommonPage.js +15 -24
- package/lib/pages/DataGridPage.d.ts +1 -2
- package/lib/pages/DataGridPage.js +5 -8
- package/lib/pages/EditPage.d.ts +1 -1
- package/lib/pages/EditPage.js +6 -15
- package/lib/pages/FixedListPage.d.ts +1 -2
- 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 +1 -2
- package/lib/pages/ListPage.js +4 -7
- package/lib/pages/ResponsivePage.d.ts +1 -2
- package/lib/pages/ResponsivePage.js +25 -26
- package/lib/pages/TablePage.d.ts +1 -2
- 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 +2 -2
- 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/tsconfig.json +1 -1
|
@@ -1,20 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Box, CircularProgress, Typography } from "@mui/material";
|
|
2
|
-
import React from "react";
|
|
3
3
|
export function PercentCircularProgress(props) {
|
|
4
4
|
// Destruct
|
|
5
5
|
const { textProps, valueUnit = "%", ...rest } = props;
|
|
6
6
|
// Component
|
|
7
|
-
return (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
justifyContent: "center"
|
|
18
|
-
} },
|
|
19
|
-
React.createElement(Typography, { variant: "caption", component: "div", color: "text.secondary", ...textProps }, `${Math.round(props.value)}${valueUnit}`))));
|
|
7
|
+
return (_jsxs(Box, { sx: { position: "relative", display: "inline-flex" }, children: [_jsx(CircularProgress, { variant: "determinate", ...rest }), _jsx(Box, { sx: {
|
|
8
|
+
top: 0,
|
|
9
|
+
left: 0,
|
|
10
|
+
bottom: 0,
|
|
11
|
+
right: 0,
|
|
12
|
+
position: "absolute",
|
|
13
|
+
display: "flex",
|
|
14
|
+
alignItems: "center",
|
|
15
|
+
justifyContent: "center"
|
|
16
|
+
}, children: _jsx(Typography, { variant: "caption", component: "div", color: "text.secondary", ...textProps, children: `${Math.round(props.value)}${valueUnit}` }) })] }));
|
|
20
17
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { LinearProgressProps, TypographyProps } from "@mui/material";
|
|
2
|
-
import React from "react";
|
|
3
2
|
export type PercentLinearProgressProps = LinearProgressProps & {
|
|
4
3
|
value: number;
|
|
5
4
|
valueUnit?: string;
|
|
6
5
|
textProps?: TypographyProps;
|
|
7
6
|
};
|
|
8
|
-
export declare function PercentLinearProgress(props: PercentLinearProgressProps):
|
|
7
|
+
export declare function PercentLinearProgress(props: PercentLinearProgressProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Box, LinearProgress, Typography } from "@mui/material";
|
|
2
|
-
import React from "react";
|
|
3
3
|
export function PercentLinearProgress(props) {
|
|
4
4
|
// Destruct
|
|
5
5
|
const { textProps, valueUnit = "%", ...rest } = props;
|
|
6
6
|
// Component
|
|
7
|
-
return (
|
|
8
|
-
React.createElement(Box, { sx: { width: "100%", mr: 1 } },
|
|
9
|
-
React.createElement(LinearProgress, { variant: "determinate", ...rest })),
|
|
10
|
-
React.createElement(Box, { sx: { minWidth: 35 } },
|
|
11
|
-
React.createElement(Typography, { variant: "caption", color: "text.secondary", ...textProps }, `${Math.round(props.value)}${valueUnit}`))));
|
|
7
|
+
return (_jsxs(Box, { sx: { display: "flex", alignItems: "center", flexGrow: 2 }, children: [_jsx(Box, { sx: { width: "100%", mr: 1 }, children: _jsx(LinearProgress, { variant: "determinate", ...rest }) }), _jsx(Box, { sx: { minWidth: 35 }, children: _jsx(Typography, { variant: "caption", color: "text.secondary", ...textProps, children: `${Math.round(props.value)}${valueUnit}` }) })] }));
|
|
12
8
|
}
|
package/lib/ProgressCount.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
/**
|
|
3
2
|
* Process count props
|
|
4
3
|
*/
|
|
@@ -41,4 +40,4 @@ export interface ProgressCountProps {
|
|
|
41
40
|
* @param props Props
|
|
42
41
|
* @returns Component
|
|
43
42
|
*/
|
|
44
|
-
export declare function ProgressCount(props: ProgressCountProps):
|
|
43
|
+
export declare function ProgressCount(props: ProgressCountProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/ProgressCount.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Box, CircularProgress, LinearProgress, Typography } from '@mui/material';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
/**
|
|
@@ -58,22 +59,15 @@ export function ProgressCount(props) {
|
|
|
58
59
|
};
|
|
59
60
|
}, []);
|
|
60
61
|
if (linear)
|
|
61
|
-
return (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
right: 0,
|
|
73
|
-
position: 'absolute',
|
|
74
|
-
display: 'flex',
|
|
75
|
-
alignItems: 'center',
|
|
76
|
-
justifyContent: 'center'
|
|
77
|
-
} },
|
|
78
|
-
React.createElement(Typography, { variant: "caption", component: "div", color: "text.secondary" }, `${value}${valueUnit}`))));
|
|
62
|
+
return (_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', width: '100%' }, children: [_jsx(Box, { sx: { width: '100%', mr: 1 }, children: _jsx(LinearProgress, { variant: variant, value: progressValue }) }), _jsx(Box, { sx: { minWidth }, children: _jsx(Typography, { variant: "body2", color: "text.secondary", children: `${value}${valueUnit}` }) })] }));
|
|
63
|
+
return (_jsxs(Box, { sx: { position: 'relative', display: 'inline-flex' }, children: [_jsx(CircularProgress, { variant: variant, value: progressValue }), _jsx(Box, { sx: {
|
|
64
|
+
top: 0,
|
|
65
|
+
left: 0,
|
|
66
|
+
bottom: 0,
|
|
67
|
+
right: 0,
|
|
68
|
+
position: 'absolute',
|
|
69
|
+
display: 'flex',
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
justifyContent: 'center'
|
|
72
|
+
}, children: _jsx(Typography, { variant: "caption", component: "div", color: "text.secondary", children: `${value}${valueUnit}` }) })] }));
|
|
79
73
|
}
|
package/lib/PullToRefreshUI.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import type { Options } from "pulltorefreshjs";
|
|
3
2
|
/**
|
|
4
3
|
* PullToRefresh UI
|
|
@@ -6,4 +5,4 @@ import type { Options } from "pulltorefreshjs";
|
|
|
6
5
|
* @param props Props
|
|
7
6
|
* @returns Component
|
|
8
7
|
*/
|
|
9
|
-
export declare function PullToRefreshUI(props: Options):
|
|
8
|
+
export declare function PullToRefreshUI(props: Options): import("react/jsx-runtime").JSX.Element;
|
package/lib/PullToRefreshUI.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import React from "react";
|
|
2
3
|
/**
|
|
3
4
|
* PullToRefresh UI
|
|
@@ -18,5 +19,5 @@ export function PullToRefreshUI(props) {
|
|
|
18
19
|
pr.destroyAll();
|
|
19
20
|
};
|
|
20
21
|
}, [props]);
|
|
21
|
-
return
|
|
22
|
+
return _jsx(React.Fragment, {});
|
|
22
23
|
}
|
package/lib/QuickList.d.ts
CHANGED
|
@@ -53,4 +53,4 @@ export type QuickListProps<T extends ListType2 = ListType2> = StackProps & {
|
|
|
53
53
|
* @param props Props
|
|
54
54
|
* @returns Component
|
|
55
55
|
*/
|
|
56
|
-
export declare function QuickList<T extends ListType2 = ListType2>(props: QuickListProps<T>):
|
|
56
|
+
export declare function QuickList<T extends ListType2 = ListType2>(props: QuickListProps<T>): import("react/jsx-runtime").JSX.Element;
|
package/lib/QuickList.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { DataTypes } from "@etsoo/shared";
|
|
2
3
|
import { LinearProgress, List, ListItem, ListItemButton, Typography } from "@mui/material";
|
|
3
4
|
import React from "react";
|
|
@@ -27,18 +28,15 @@ export function QuickList(props) {
|
|
|
27
28
|
loadDataLocal();
|
|
28
29
|
}, []);
|
|
29
30
|
// Layout
|
|
30
|
-
return (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (!event.defaultPrevented && onItemClick)
|
|
42
|
-
onItemClick(item);
|
|
43
|
-
}, ...buttonRest }, itemRenderer(item)))))))));
|
|
31
|
+
return (_jsxs(VBox, { gap: gap, height: height, ...rest, children: [_jsx(InputField, { label: label, changeDelay: 480, onChangeDelay: (event) => {
|
|
32
|
+
// Stop bubble
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
event.stopPropagation();
|
|
35
|
+
loadDataLocal(event.target.value);
|
|
36
|
+
}, fullWidth: true, ...inputProps }), loading ? (_jsx(LinearProgress, {})) : items.length === 0 ? (_jsx(Typography, { textAlign: "center", children: noMatchesLabel })) : (_jsx(List, { children: items.map((item) => (_jsx(ListItem, { disablePadding: true, ...itemProps, children: _jsx(ListItemButton, { onClick: (event) => {
|
|
37
|
+
if (onClick)
|
|
38
|
+
onClick(event);
|
|
39
|
+
if (!event.defaultPrevented && onItemClick)
|
|
40
|
+
onItemClick(item);
|
|
41
|
+
}, ...buttonRest, children: itemRenderer(item) }) }, item.id))) }))] }));
|
|
44
42
|
}
|
|
@@ -96,4 +96,4 @@ export type ResponsibleContainerProps<T extends object, F extends DataTypes.Basi
|
|
|
96
96
|
* @param props Props
|
|
97
97
|
* @returns Layout
|
|
98
98
|
*/
|
|
99
|
-
export declare function ResponsibleContainer<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate>(props: ResponsibleContainerProps<T, F>):
|
|
99
|
+
export declare function ResponsibleContainer<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate>(props: ResponsibleContainerProps<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 { Box, Stack } from "@mui/material";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { ReactUtils, useCombinedRefs, useDimensions } from "@etsoo/react";
|
|
@@ -143,11 +144,10 @@ export function ResponsibleContainer(props) {
|
|
|
143
144
|
// Delete
|
|
144
145
|
delete rest.itemRenderer;
|
|
145
146
|
return [
|
|
146
|
-
|
|
147
|
-
React.createElement(DataGridEx, { autoLoad: !hasFields, height: heightLocal, width: rect.width, loadData: localLoadData, mRef: mRefs, onDoubleClick: (_, data) => quickAction && quickAction(data), outerRef: (element) => {
|
|
147
|
+
_jsx(Box, { className: "DataGridBox", children: _jsx(DataGridEx, { autoLoad: !hasFields, height: heightLocal, width: rect.width, loadData: localLoadData, mRef: mRefs, onDoubleClick: (_, data) => quickAction && quickAction(data), outerRef: (element) => {
|
|
148
148
|
if (element != null && elementReady)
|
|
149
149
|
elementReady(element, true);
|
|
150
|
-
}, onScroll: onGridScroll, columns: columns, onUpdateRows: GridUtils.getUpdateRowsHandler(cacheKey), onInitLoad: onInitLoad, ...rest })),
|
|
150
|
+
}, onScroll: onGridScroll, columns: columns, onUpdateRows: GridUtils.getUpdateRowsHandler(cacheKey), onInitLoad: onInitLoad, ...rest }) }),
|
|
151
151
|
true
|
|
152
152
|
];
|
|
153
153
|
}
|
|
@@ -161,11 +161,10 @@ export function ResponsibleContainer(props) {
|
|
|
161
161
|
delete rest.hoverColor;
|
|
162
162
|
delete rest.selectable;
|
|
163
163
|
return [
|
|
164
|
-
|
|
165
|
-
React.createElement(ScrollerListEx, { autoLoad: !hasFields, height: heightLocal, loadData: localLoadData, onUpdateRows: GridUtils.getUpdateRowsHandler(cacheKey), onInitLoad: onInitLoad, mRef: mRefs, onClick: (event, data) => quickAction && ReactUtils.isSafeClick(event) && quickAction(data), oRef: (element) => {
|
|
164
|
+
_jsx(Box, { className: "ListBox", sx: { height: heightLocal }, children: _jsx(ScrollerListEx, { autoLoad: !hasFields, height: heightLocal, loadData: localLoadData, onUpdateRows: GridUtils.getUpdateRowsHandler(cacheKey), onInitLoad: onInitLoad, mRef: mRefs, onClick: (event, data) => quickAction && ReactUtils.isSafeClick(event) && quickAction(data), oRef: (element) => {
|
|
166
165
|
if (element != null && elementReady)
|
|
167
166
|
elementReady(element, false);
|
|
168
|
-
}, onScroll: onListScroll, ...rest })),
|
|
167
|
+
}, onScroll: onListScroll, ...rest }) }),
|
|
169
168
|
false
|
|
170
169
|
];
|
|
171
170
|
})();
|
|
@@ -173,7 +172,7 @@ export function ResponsibleContainer(props) {
|
|
|
173
172
|
if (!hasFields || showDataGrid == null)
|
|
174
173
|
return;
|
|
175
174
|
const f = typeof fields == "function" ? fields(searchData ?? {}) : fields;
|
|
176
|
-
return (
|
|
175
|
+
return (_jsx(SearchBar, { fields: f, onSubmit: onSubmit, className: `searchBar${showDataGrid ? "Grid" : "List"}` }));
|
|
177
176
|
}, [showDataGrid, hasFields, searchBarHeight]);
|
|
178
177
|
// Pull container
|
|
179
178
|
const pullContainer = showDataGrid == null
|
|
@@ -182,14 +181,10 @@ export function ResponsibleContainer(props) {
|
|
|
182
181
|
? ".DataGridEx-Body"
|
|
183
182
|
: ".ScrollerListEx-Body";
|
|
184
183
|
// Layout
|
|
185
|
-
return (
|
|
184
|
+
return (_jsxs(Box, { sx: containerBoxSx == null
|
|
186
185
|
? undefined
|
|
187
|
-
: containerBoxSx(paddings, hasFields, showDataGrid) },
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
pullToRefresh && pullContainer && (React.createElement(PullToRefreshUI, { mainElement: pullContainer, triggerElement: pullContainer, instructionsPullToRefresh: labels.pullToRefresh, instructionsReleaseToRefresh: labels.releaseToRefresh, instructionsRefreshing: labels.refreshing, onRefresh: () => state.ref?.reset(), shouldPullToRefresh: () => {
|
|
192
|
-
const container = document.querySelector(pullContainer);
|
|
193
|
-
return !container?.scrollTop;
|
|
194
|
-
} }))));
|
|
186
|
+
: containerBoxSx(paddings, hasFields, showDataGrid), children: [_jsxs(Stack, { children: [_jsx(Box, { ref: dimensions[0][0], className: "SearchBox", sx: { height: hasFields ? searchBarHeight : 0 }, children: searchBar }), list] }), pullToRefresh && pullContainer && (_jsx(PullToRefreshUI, { mainElement: pullContainer, triggerElement: pullContainer, instructionsPullToRefresh: labels.pullToRefresh, instructionsReleaseToRefresh: labels.releaseToRefresh, instructionsRefreshing: labels.refreshing, onRefresh: () => state.ref?.reset(), shouldPullToRefresh: () => {
|
|
187
|
+
const container = document.querySelector(pullContainer);
|
|
188
|
+
return !container?.scrollTop;
|
|
189
|
+
} }))] }));
|
|
195
190
|
}
|
package/lib/ScrollTopFab.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { CustomFabProps } from "./CustomFabProps";
|
|
3
2
|
/**
|
|
4
3
|
* Scroll to top fab
|
|
5
4
|
* @returns Component
|
|
6
5
|
*/
|
|
7
|
-
export declare function ScrollTopFab(props: CustomFabProps):
|
|
6
|
+
export declare function ScrollTopFab(props: CustomFabProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/ScrollTopFab.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { Fab, useScrollTrigger, Zoom } from "@mui/material";
|
|
3
4
|
import VerticalAlignTopIcon from "@mui/icons-material/VerticalAlignTop";
|
|
@@ -19,7 +20,5 @@ export function ScrollTopFab(props) {
|
|
|
19
20
|
const handleClick = () => {
|
|
20
21
|
target.scrollTo({ top: 0 });
|
|
21
22
|
};
|
|
22
|
-
return trigger ? (
|
|
23
|
-
React.createElement(Fab, { color: color, size: size, title: title, onClick: handleClick },
|
|
24
|
-
React.createElement(VerticalAlignTopIcon, null)))) : (React.createElement(React.Fragment, null));
|
|
23
|
+
return trigger ? (_jsx(Zoom, { in: trigger, children: _jsx(Fab, { color: color, size: size, title: title, onClick: handleClick, children: _jsx(VerticalAlignTopIcon, {}) }) })) : (_jsx(React.Fragment, {}));
|
|
25
24
|
}
|
package/lib/ScrollerListEx.d.ts
CHANGED
|
@@ -72,4 +72,4 @@ export type ScrollerListExProps<T extends object> = Omit<ScrollerListProps<T>, "
|
|
|
72
72
|
* @param props Props
|
|
73
73
|
* @returns Component
|
|
74
74
|
*/
|
|
75
|
-
export declare function ScrollerListEx<T extends object>(props: ScrollerListExProps<T>):
|
|
75
|
+
export declare function ScrollerListEx<T extends object>(props: ScrollerListExProps<T>): import("react/jsx-runtime").JSX.Element;
|
package/lib/ScrollerListEx.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { css } from "@emotion/css";
|
|
2
3
|
import { ScrollerList } from "@etsoo/react";
|
|
3
4
|
import { Utils } from "@etsoo/shared";
|
|
@@ -81,7 +82,7 @@ function defaultItemRenderer({ index, innerItemRenderer, data, onMouseDown, sele
|
|
|
81
82
|
if (selected)
|
|
82
83
|
rowClass += ` ${selectedClassName}`;
|
|
83
84
|
// Layout
|
|
84
|
-
return (
|
|
85
|
+
return (_jsx("div", { className: rowClass, style: style, onMouseDown: (event) => onMouseDown(event.currentTarget, data), onClick: (event) => onClick && onClick(event, data), onDoubleClick: (event) => onDoubleClick && onDoubleClick(event, data), children: child }));
|
|
85
86
|
}
|
|
86
87
|
/**
|
|
87
88
|
* Extended ScrollerList
|
|
@@ -157,5 +158,5 @@ export function ScrollerListEx(props) {
|
|
|
157
158
|
return size + space;
|
|
158
159
|
};
|
|
159
160
|
// Layout
|
|
160
|
-
return (
|
|
161
|
+
return (_jsx(ScrollerList, { className: Utils.mergeClasses("ScrollerListEx-Body", className, createGridStyle(alternatingColors, selectedColor)), idField: idField, itemRenderer: itemRenderer, itemSize: itemSizeLocal, ...rest }));
|
|
161
162
|
}
|
package/lib/SearchBar.d.ts
CHANGED
|
@@ -25,4 +25,4 @@ export interface SearchBarProps {
|
|
|
25
25
|
* @param props Props
|
|
26
26
|
* @returns Component
|
|
27
27
|
*/
|
|
28
|
-
export declare function SearchBar(props: SearchBarProps):
|
|
28
|
+
export declare function SearchBar(props: SearchBarProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/SearchBar.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Button, Drawer, IconButton, Stack, useTheme } from "@mui/material";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import MoreHorizIcon from "@mui/icons-material/MoreHoriz";
|
|
@@ -168,7 +169,7 @@ export function SearchBar(props) {
|
|
|
168
169
|
const moreItems = [];
|
|
169
170
|
if (index != null) {
|
|
170
171
|
for (let i = index; i < fields.length; i++) {
|
|
171
|
-
moreItems.push(
|
|
172
|
+
moreItems.push(_jsx(React.Fragment, { children: fields[i] }, i));
|
|
172
173
|
}
|
|
173
174
|
}
|
|
174
175
|
const hasMoreItems = moreItems.length > 0;
|
|
@@ -220,41 +221,32 @@ export function SearchBar(props) {
|
|
|
220
221
|
};
|
|
221
222
|
}, [className]);
|
|
222
223
|
// Layout
|
|
223
|
-
return (
|
|
224
|
-
React.createElement("form", { id: "SearchBarForm", className: className, onChange: handleForm, ref: (form) => {
|
|
225
|
-
if (form)
|
|
226
|
-
state.form = form;
|
|
227
|
-
} },
|
|
228
|
-
React.createElement(Stack, { ref: dimensions[0][0], className: "SearchBarContainer", justifyContent: "center", alignItems: "center", direction: "row", spacing: 1, width: "100%", overflow: "hidden", paddingTop: "6px", sx: {
|
|
229
|
-
"& > :not(style)": {
|
|
230
|
-
flexBasis: "auto",
|
|
231
|
-
flexGrow: 0,
|
|
232
|
-
flexShrink: 0,
|
|
233
|
-
maxWidth: `${itemWidth}px`,
|
|
234
|
-
visibility: "hidden"
|
|
235
|
-
},
|
|
236
|
-
"& > .hiddenChild": {
|
|
237
|
-
display: "none"
|
|
238
|
-
},
|
|
239
|
-
"& > .showChild": {
|
|
240
|
-
display: "block",
|
|
241
|
-
visibility: "visible"
|
|
242
|
-
}
|
|
243
|
-
} },
|
|
244
|
-
fields.map((item, index) => (React.createElement(React.Fragment, { key: index }, item))),
|
|
245
|
-
React.createElement(IconButton, { title: labels.more, size: "medium", sx: { height: "40px" }, onClick: handleMore },
|
|
246
|
-
React.createElement(MoreHorizIcon, null)),
|
|
247
|
-
React.createElement(Button, { variant: "contained", size: "medium", ref: resetButtonRef, onClick: handleReset }, labels.reset))),
|
|
248
|
-
hasMoreItems && (React.createElement(Drawer, { anchor: "right", sx: { minWidth: "180px" }, ModalProps: {
|
|
249
|
-
keepMounted: true
|
|
250
|
-
}, open: open, onClose: () => updateOpen(false) },
|
|
251
|
-
React.createElement("form", { onChange: moreFormChange, ref: (form) => {
|
|
224
|
+
return (_jsxs(React.Fragment, { children: [_jsx("form", { id: "SearchBarForm", className: className, onChange: handleForm, ref: (form) => {
|
|
252
225
|
if (form)
|
|
253
|
-
state.
|
|
254
|
-
}
|
|
255
|
-
React.createElement(Stack, { direction: "column", alignItems: "stretch", spacing: 2, padding: 2, sx: {
|
|
226
|
+
state.form = form;
|
|
227
|
+
}, children: _jsxs(Stack, { ref: dimensions[0][0], className: "SearchBarContainer", justifyContent: "center", alignItems: "center", direction: "row", spacing: 1, width: "100%", overflow: "hidden", paddingTop: "6px", sx: {
|
|
256
228
|
"& > :not(style)": {
|
|
257
|
-
|
|
229
|
+
flexBasis: "auto",
|
|
230
|
+
flexGrow: 0,
|
|
231
|
+
flexShrink: 0,
|
|
232
|
+
maxWidth: `${itemWidth}px`,
|
|
233
|
+
visibility: "hidden"
|
|
234
|
+
},
|
|
235
|
+
"& > .hiddenChild": {
|
|
236
|
+
display: "none"
|
|
237
|
+
},
|
|
238
|
+
"& > .showChild": {
|
|
239
|
+
display: "block",
|
|
240
|
+
visibility: "visible"
|
|
258
241
|
}
|
|
259
|
-
} },
|
|
242
|
+
}, children: [fields.map((item, index) => (_jsx(React.Fragment, { children: item }, index))), _jsx(IconButton, { title: labels.more, size: "medium", sx: { height: "40px" }, onClick: handleMore, children: _jsx(MoreHorizIcon, {}) }), _jsx(Button, { variant: "contained", size: "medium", ref: resetButtonRef, onClick: handleReset, children: labels.reset })] }) }), hasMoreItems && (_jsx(Drawer, { anchor: "right", sx: { minWidth: "180px" }, ModalProps: {
|
|
243
|
+
keepMounted: true
|
|
244
|
+
}, open: open, onClose: () => updateOpen(false), children: _jsx("form", { onChange: moreFormChange, ref: (form) => {
|
|
245
|
+
if (form)
|
|
246
|
+
state.moreForm = form;
|
|
247
|
+
}, children: _jsx(Stack, { direction: "column", alignItems: "stretch", spacing: 2, padding: 2, sx: {
|
|
248
|
+
"& > :not(style)": {
|
|
249
|
+
minWidth: "100px"
|
|
250
|
+
}
|
|
251
|
+
}, children: moreItems }) }) }))] }));
|
|
260
252
|
}
|
package/lib/SearchField.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TextFieldProps } from '@mui/material';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
/**
|
|
4
3
|
* Search field props
|
|
5
4
|
*/
|
|
@@ -18,4 +17,4 @@ export type SearchFieldProps = TextFieldProps & {
|
|
|
18
17
|
* @param props Props
|
|
19
18
|
* @returns Component
|
|
20
19
|
*/
|
|
21
|
-
export declare function SearchField(props: SearchFieldProps):
|
|
20
|
+
export declare function SearchField(props: SearchFieldProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/SearchField.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { useDelayedExecutor } from '@etsoo/react';
|
|
2
3
|
import { TextField } from '@mui/material';
|
|
3
4
|
import React from 'react';
|
|
@@ -35,5 +36,5 @@ export function SearchField(props) {
|
|
|
35
36
|
};
|
|
36
37
|
}, []);
|
|
37
38
|
// Layout
|
|
38
|
-
return (
|
|
39
|
+
return (_jsx(TextField, { InputLabelProps: InputLabelProps, InputProps: InputProps, onChange: onChangeEx, size: size, variant: variant, ...rest }));
|
|
39
40
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { DataTypes, IdDefaultType, LabelDefaultType, ListType } from '@etsoo/shared';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { OptionGroupProps } from './OptionGroup';
|
|
4
3
|
/**
|
|
5
4
|
* Search OptionGroup
|
|
6
5
|
* @param props Props
|
|
7
6
|
* @returns Component
|
|
8
7
|
*/
|
|
9
|
-
export declare function SearchOptionGroup<T extends object = ListType, D extends DataTypes.Keys<T> = IdDefaultType<T>, L extends DataTypes.Keys<T, string> = LabelDefaultType<T>>(props: OptionGroupProps<T, D, L>):
|
|
8
|
+
export declare function SearchOptionGroup<T extends object = ListType, D extends DataTypes.Keys<T> = IdDefaultType<T>, L extends DataTypes.Keys<T, string> = LabelDefaultType<T>>(props: OptionGroupProps<T, D, L>): import("react/jsx-runtime").JSX.Element;
|
package/lib/SearchOptionGroup.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { MUGlobal } from './MUGlobal';
|
|
3
3
|
import { OptionGroup } from './OptionGroup';
|
|
4
4
|
/**
|
|
@@ -10,5 +10,5 @@ export function SearchOptionGroup(props) {
|
|
|
10
10
|
// Destruct
|
|
11
11
|
const { row = true, size = MUGlobal.searchFieldSize, sx = { '& .MuiFormLabel-root': { fontSize: '0.75em' } }, ...rest } = props;
|
|
12
12
|
// Layout
|
|
13
|
-
return
|
|
13
|
+
return _jsx(OptionGroup, { row: row, size: size, sx: sx, ...rest });
|
|
14
14
|
}
|
package/lib/SelectBool.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ListType1 } from "@etsoo/shared";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import { SelectExProps } from "./SelectEx";
|
|
4
3
|
/**
|
|
5
4
|
* SelectBool props
|
|
@@ -10,4 +9,4 @@ export type SelectBoolProps = Omit<SelectExProps<ListType1>, "options" | "loadDa
|
|
|
10
9
|
* @param props Props
|
|
11
10
|
* @returns Component
|
|
12
11
|
*/
|
|
13
|
-
export declare function SelectBool(props: SelectBoolProps):
|
|
12
|
+
export declare function SelectBool(props: SelectBoolProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/SelectBool.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Utils } from "@etsoo/shared";
|
|
2
|
-
import React from "react";
|
|
3
3
|
import { globalApp } from "./app/ReactApp";
|
|
4
4
|
import { SelectEx } from "./SelectEx";
|
|
5
5
|
/**
|
|
@@ -15,5 +15,5 @@ export function SelectBool(props) {
|
|
|
15
15
|
if (autoAddBlankItem)
|
|
16
16
|
Utils.addBlankItem(options);
|
|
17
17
|
// Layout
|
|
18
|
-
return
|
|
18
|
+
return _jsx(SelectEx, { options: options, search: search, ...rest });
|
|
19
19
|
}
|
package/lib/SelectEx.d.ts
CHANGED
|
@@ -71,4 +71,4 @@ export type SelectExProps<T extends object, D extends DataTypes.Keys<T> = IdDefa
|
|
|
71
71
|
* @param props Props
|
|
72
72
|
* @returns Component
|
|
73
73
|
*/
|
|
74
|
-
export declare function SelectEx<T extends object = ListType, D extends DataTypes.Keys<T> = IdDefaultType<T>, L extends DataTypes.Keys<T, string> = LabelDefaultType<T>>(props: SelectExProps<T, D, L>):
|
|
74
|
+
export declare function SelectEx<T extends object = ListType, D extends DataTypes.Keys<T> = IdDefaultType<T>, L extends DataTypes.Keys<T, string> = LabelDefaultType<T>>(props: SelectExProps<T, D, L>): import("react/jsx-runtime").JSX.Element;
|
package/lib/SelectEx.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Checkbox, FormControl, FormHelperText, IconButton, InputLabel, ListItemText, MenuItem, OutlinedInput, Select, Stack } from "@mui/material";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { MUGlobal } from "./MUGlobal";
|
|
@@ -124,59 +125,50 @@ export function SelectEx(props) {
|
|
|
124
125
|
};
|
|
125
126
|
}, [multiple]);
|
|
126
127
|
// Layout
|
|
127
|
-
return (
|
|
128
|
-
|
|
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
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
: valueState === id })),
|
|
174
|
-
React.createElement(ListItemText, { primary: label }),
|
|
175
|
-
itemIconRenderer && (React.createElement(ListItemRightIcon, null, itemIconRenderer(option[idField])))));
|
|
176
|
-
})),
|
|
177
|
-
helperText != null && React.createElement(FormHelperText, null, helperText)),
|
|
178
|
-
refresh != null &&
|
|
179
|
-
loadData != null &&
|
|
180
|
-
(typeof refresh === "string" ? (React.createElement(IconButton, { size: "small", title: refresh, onClick: refreshData },
|
|
181
|
-
React.createElement(RefreshIcon, null))) : (refresh))));
|
|
128
|
+
return (_jsxs(Stack, { direction: "row", children: [_jsxs(FormControl, { size: search ? MUGlobal.searchFieldSize : MUGlobal.inputFieldSize, fullWidth: fullWidth, error: error, children: [_jsx(InputLabel, { id: labelId, variant: variant, shrink: search ? MUGlobal.searchFieldShrink : MUGlobal.inputFieldShrink, required: required, children: label }), _jsx(Select, { ref: divRef, value: multiple
|
|
129
|
+
? valueState
|
|
130
|
+
: localOptions.some((o) => o[idField] === valueState)
|
|
131
|
+
? valueState
|
|
132
|
+
: "", input: _jsx(OutlinedInput, { notched: true, label: label, required: required, inputProps: { "data-reset": inputReset } }), labelId: labelId, name: name, multiple: multiple, onChange: (event, child) => {
|
|
133
|
+
if (onChange) {
|
|
134
|
+
onChange(event, child);
|
|
135
|
+
// event.preventDefault() will block executing
|
|
136
|
+
if (event.defaultPrevented)
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
// Set item value
|
|
140
|
+
const value = event.target.value;
|
|
141
|
+
if (multiple && !Array.isArray(value))
|
|
142
|
+
return;
|
|
143
|
+
const diff = setItemValue(value);
|
|
144
|
+
if (diff != null) {
|
|
145
|
+
doItemChange(localOptions, diff, true);
|
|
146
|
+
}
|
|
147
|
+
}, renderValue: (selected) => {
|
|
148
|
+
// The text shows up
|
|
149
|
+
return localOptions
|
|
150
|
+
.filter((option) => {
|
|
151
|
+
const id = getId(option);
|
|
152
|
+
return Array.isArray(selected)
|
|
153
|
+
? selected.indexOf(id) !== -1
|
|
154
|
+
: selected === id;
|
|
155
|
+
})
|
|
156
|
+
.map((option) => getLabel(option))
|
|
157
|
+
.join(", ");
|
|
158
|
+
}, sx: { minWidth: "150px" }, fullWidth: fullWidth, required: required, variant: variant, ...rest, children: localOptions.map((option) => {
|
|
159
|
+
// Option id
|
|
160
|
+
const id = getId(option);
|
|
161
|
+
// Option label
|
|
162
|
+
const label = getLabel(option);
|
|
163
|
+
// Option
|
|
164
|
+
return (_jsxs(MenuItem, { value: id, onClick: (event) => {
|
|
165
|
+
if (onItemClick) {
|
|
166
|
+
onItemClick(event, option);
|
|
167
|
+
}
|
|
168
|
+
}, style: itemStyle == null ? undefined : itemStyle(option), children: [multiple && (_jsx(Checkbox, { checked: Array.isArray(valueState)
|
|
169
|
+
? valueState.includes(id)
|
|
170
|
+
: valueState === id })), _jsx(ListItemText, { primary: label }), itemIconRenderer && (_jsx(ListItemRightIcon, { children: itemIconRenderer(option[idField]) }))] }, id));
|
|
171
|
+
}) }), helperText != null && _jsx(FormHelperText, { children: helperText })] }), refresh != null &&
|
|
172
|
+
loadData != null &&
|
|
173
|
+
(typeof refresh === "string" ? (_jsx(IconButton, { size: "small", title: refresh, onClick: refreshData, children: _jsx(RefreshIcon, {}) })) : (refresh))] }));
|
|
182
174
|
}
|