@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/DataGridEx.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 { GridAlignGet, ScrollerGrid, useCombinedRefs } from "@etsoo/react";
|
|
3
4
|
import { Utils } from "@etsoo/shared";
|
|
@@ -72,57 +73,55 @@ export function DataGridEx(props) {
|
|
|
72
73
|
const theme = useTheme();
|
|
73
74
|
const defaultHeaderRenderer = (states) => {
|
|
74
75
|
const { orderBy } = states.queryPaging;
|
|
75
|
-
return (
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
})));
|
|
76
|
+
return (_jsx(Box, { className: "DataGridEx-Header", display: "flex", alignItems: "center", borderBottom: boldBorder, fontWeight: 500, minWidth: widthCalculator.total, height: headerHeight, children: columns.map((column, index) => {
|
|
77
|
+
// Destruct
|
|
78
|
+
const { align, field, header, headerCellRenderer, sortable, sortAsc = true, type } = column;
|
|
79
|
+
// Header text
|
|
80
|
+
const headerText = header ?? field;
|
|
81
|
+
// Cell props
|
|
82
|
+
const cellProps = {};
|
|
83
|
+
// Sortable
|
|
84
|
+
let sortLabel;
|
|
85
|
+
if (headerCellRenderer) {
|
|
86
|
+
sortLabel = headerCellRenderer({
|
|
87
|
+
cellProps,
|
|
88
|
+
column,
|
|
89
|
+
columnIndex: checkable ? index - 1 : index, // Ignore the checkbox case,
|
|
90
|
+
states
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
else if (sortable && field != null) {
|
|
94
|
+
const active = orderBy === field;
|
|
95
|
+
sortLabel = (_jsx(TableSortLabel, { active: active, direction: sortAsc ? "asc" : "desc", onClick: (_event) => {
|
|
96
|
+
if (active)
|
|
97
|
+
column.sortAsc = !sortAsc;
|
|
98
|
+
handleSort(field, column.sortAsc);
|
|
99
|
+
}, children: headerText }));
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
sortLabel = headerText;
|
|
103
|
+
}
|
|
104
|
+
return (_jsx(Box, { textAlign: GridAlignGet(align, type), width: columnWidth(index), children: _jsx(Box, { className: "DataGridEx-Cell", onMouseEnter: handleMouseEnter, ...cellProps, children: sortLabel }) }, field ?? index.toString()));
|
|
105
|
+
}) }));
|
|
106
106
|
};
|
|
107
107
|
function defaultFooterRenderer(rows, states) {
|
|
108
|
-
return (
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
})));
|
|
108
|
+
return (_jsx(Box, { className: "DataGridEx-Footer", display: "flex", alignItems: "center", borderTop: thinBorder, marginTop: "1px", minWidth: widthCalculator.total, height: bottomHeight - 1, children: columns.map((column, index) => {
|
|
109
|
+
// Destruct
|
|
110
|
+
const { align, field, type } = column;
|
|
111
|
+
// Cell props
|
|
112
|
+
const cellProps = {};
|
|
113
|
+
// Cell
|
|
114
|
+
const cell = footerItemRenderer
|
|
115
|
+
? footerItemRenderer(rows, {
|
|
116
|
+
column,
|
|
117
|
+
index: checkable ? index - 1 : index, // Ignore the checkbox case
|
|
118
|
+
states,
|
|
119
|
+
cellProps,
|
|
120
|
+
checkable
|
|
121
|
+
})
|
|
122
|
+
: undefined;
|
|
123
|
+
return (_jsx(Box, { textAlign: GridAlignGet(align, type), width: columnWidth(index), children: _jsx(Box, { className: "DataGridEx-Cell", onMouseEnter: handleMouseEnter, ...cellProps, children: cell }) }, "bottom-" + (field ?? index.toString())));
|
|
124
|
+
}) }));
|
|
126
125
|
}
|
|
127
126
|
// Destruct
|
|
128
127
|
const { alternatingColors = [theme.palette.grey[100], undefined], borderRowsCount, bottomHeight = 53, checkable = false, className, columns, defaultOrderBy, height, headerHeight = 56, headerRenderer = defaultHeaderRenderer, footerRenderer = defaultFooterRenderer, footerItemRenderer = DataGridRenderers.defaultFooterItemRenderer, hideFooter = false, hoverColor = "#f6f9fb", idField = "id", mRef = React.createRef(), onClick, onDoubleClick, selectable = true, selectedColor = "#edf4fb", width, ...rest } = props;
|
|
@@ -136,7 +135,7 @@ export function DataGridEx(props) {
|
|
|
136
135
|
cellProps.sx = {
|
|
137
136
|
padding: "4px!important"
|
|
138
137
|
};
|
|
139
|
-
return (
|
|
138
|
+
return (_jsx(Checkbox, { color: "primary", checked: selected, onChange: (_event, checked) => {
|
|
140
139
|
refs.current.ref?.selectItem(data, checked);
|
|
141
140
|
} }));
|
|
142
141
|
},
|
|
@@ -146,7 +145,7 @@ export function DataGridEx(props) {
|
|
|
146
145
|
cellProps.sx = {
|
|
147
146
|
padding: `${hpad}px 4px ${hpad - 1}px 4px!important`
|
|
148
147
|
};
|
|
149
|
-
return (
|
|
148
|
+
return (_jsx(Checkbox, { color: "primary", indeterminate: states.selectedItems.length > 0 &&
|
|
150
149
|
states.selectedItems.length < states.loadedItems, checked: states.selectedItems.length > 0, onChange: (_event, checked) => refs.current.ref?.selectAll(checked) }));
|
|
151
150
|
}
|
|
152
151
|
};
|
|
@@ -263,8 +262,7 @@ export function DataGridEx(props) {
|
|
|
263
262
|
renderProps: typeof renderProps === "function" ? renderProps(data) : renderProps,
|
|
264
263
|
setItems
|
|
265
264
|
});
|
|
266
|
-
return (
|
|
267
|
-
React.createElement(Box, { ...cellProps, onMouseEnter: handleMouseEnter }, child)));
|
|
265
|
+
return (_jsx("div", { className: rowClass, style: style, "data-row": rowIndex, "data-column": columnIndex, onMouseDown: selectable && !checkable ? handleMouseDown : undefined, onMouseOver: selectable ? handleMouseOver : undefined, onMouseOut: selectable ? handleMouseOut : undefined, onClick: (event) => onClick && data != null && onClick(event, data), onDoubleClick: (event) => onDoubleClick && data != null && onDoubleClick(event, data), children: _jsx(Box, { ...cellProps, onMouseEnter: handleMouseEnter, children: child }) }));
|
|
268
266
|
};
|
|
269
267
|
// Column width calculator
|
|
270
268
|
const widthCalculator = React.useMemo(() => DataGridExCalColumns(columns), [columns]);
|
|
@@ -288,12 +286,12 @@ export function DataGridEx(props) {
|
|
|
288
286
|
const defaultOrderByAsc = defaultOrderBy
|
|
289
287
|
? columns.find((column) => column.field === defaultOrderBy)?.sortAsc
|
|
290
288
|
: undefined;
|
|
291
|
-
return (
|
|
289
|
+
return (_jsx(ScrollerGrid, { className: Utils.mergeClasses("DataGridEx-Body", "DataGridEx-CustomBar", className, createGridStyle(alternatingColors, selectedColor, hoverColor)), columnCount: columns.length, columnWidth: columnWidth, defaultOrderBy: defaultOrderBy, defaultOrderByAsc: defaultOrderByAsc, height: height -
|
|
292
290
|
headerHeight -
|
|
293
291
|
(hideFooter ? 0 : bottomHeight + 1) -
|
|
294
292
|
scrollbarSize, headerRenderer: headerRenderer, idField: idField, itemRenderer: itemRenderer, footerRenderer: hideFooter ? undefined : footerRenderer, width: Math.max(width ?? 0, widthCalculator.total), mRef: mRefLocal, ...rest }));
|
|
295
293
|
}, [width]);
|
|
296
|
-
return (
|
|
294
|
+
return (_jsx(Paper, { sx: {
|
|
297
295
|
fontSize: "0.875rem",
|
|
298
296
|
height,
|
|
299
297
|
"& .DataGridEx-Cell": {
|
|
@@ -321,10 +319,9 @@ export function DataGridEx(props) {
|
|
|
321
319
|
}
|
|
322
320
|
}
|
|
323
321
|
}
|
|
324
|
-
}
|
|
325
|
-
React.createElement("div", { className: "DataGridEx-CustomBar", style: {
|
|
322
|
+
}, children: _jsx("div", { className: "DataGridEx-CustomBar", style: {
|
|
326
323
|
width,
|
|
327
324
|
overflowX: "auto",
|
|
328
325
|
overflowY: "hidden"
|
|
329
|
-
}
|
|
326
|
+
}, children: table }) }));
|
|
330
327
|
}
|
package/lib/DataGridRenderers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { CircularProgress } from '@mui/material';
|
|
3
3
|
import { DateUtils, NumberUtils } from '@etsoo/shared';
|
|
4
4
|
import CheckIcon from '@mui/icons-material/Check';
|
|
@@ -20,7 +20,7 @@ export var DataGridRenderers;
|
|
|
20
20
|
if (data == null) {
|
|
21
21
|
// First column, show loading indicator
|
|
22
22
|
if (columnIndex === 0)
|
|
23
|
-
return
|
|
23
|
+
return _jsx(CircularProgress, { size: 15 });
|
|
24
24
|
// Others return undefined
|
|
25
25
|
return undefined;
|
|
26
26
|
}
|
|
@@ -38,7 +38,7 @@ export var DataGridRenderers;
|
|
|
38
38
|
const option = type === GridDataType.DateTime ? 'ds' : 'd';
|
|
39
39
|
const nearDays = renderProps?.nearDays;
|
|
40
40
|
if (nearDays != null) {
|
|
41
|
-
return (
|
|
41
|
+
return (_jsx(DateText, { value: dateValue, locale: renderProps?.culture, timeZone: renderProps?.timeZone, options: option, nearDays: nearDays }));
|
|
42
42
|
}
|
|
43
43
|
return DateUtils.format(dateValue, renderProps?.culture, option, renderProps?.timeZone);
|
|
44
44
|
}
|
|
@@ -65,9 +65,9 @@ export var DataGridRenderers;
|
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
if (value)
|
|
68
|
-
return
|
|
68
|
+
return _jsx(CheckIcon, { fontSize: "small" });
|
|
69
69
|
else
|
|
70
|
-
return
|
|
70
|
+
return _jsx(ClearIcon, { fontSize: "small", color: "warning" });
|
|
71
71
|
}
|
|
72
72
|
// To string
|
|
73
73
|
return new String(value);
|
package/lib/DataSteps.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TextFieldProps } from "@mui/material";
|
|
2
2
|
import { InputDialogProps } from "@etsoo/react";
|
|
3
|
-
import React from "react";
|
|
4
3
|
/**
|
|
5
4
|
* Data step
|
|
6
5
|
*/
|
|
@@ -36,4 +35,4 @@ export type DataStepsProps<T extends object> = Omit<TextFieldProps, "InputProps"
|
|
|
36
35
|
* @param props Props
|
|
37
36
|
* @returns Component
|
|
38
37
|
*/
|
|
39
|
-
export declare function DataSteps<T extends object>(props: DataStepsProps<T>):
|
|
38
|
+
export declare function DataSteps<T extends object>(props: DataStepsProps<T>): import("react/jsx-runtime").JSX.Element;
|
package/lib/DataSteps.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Button, IconButton, InputAdornment, TextField } from "@mui/material";
|
|
2
3
|
import CloseIcon from "@mui/icons-material/Close";
|
|
3
4
|
import NavigateNextIcon from "@mui/icons-material/NavigateNext";
|
|
@@ -40,25 +41,23 @@ export function DataSteps(props) {
|
|
|
40
41
|
const [{ callback, ...rest }, more] = steps(index, jsonRef.current);
|
|
41
42
|
app.showInputDialog({
|
|
42
43
|
...rest,
|
|
43
|
-
buttons: (n, callback) => (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
onValueChange(value);
|
|
61
|
-
} }, labels.submit)))),
|
|
44
|
+
buttons: (n, callback) => (_jsxs(HBox, { paddingLeft: 2, paddingRight: 2, paddingBottom: 2, gap: 2, justifyContent: "space-between", children: [index === 0 ? (_jsx(Button, { variant: "outlined", startIcon: _jsx(CloseIcon, {}), onClick: () => n.dismiss(), children: labels.close })) : (_jsx(Button, { variant: "outlined", startIcon: _jsx(NavigateBeforeIcon, {}), onClick: () => {
|
|
45
|
+
n.dismiss();
|
|
46
|
+
showStep(indexRef.current - 1);
|
|
47
|
+
}, children: labels.previousStep })), more ? (_jsx(Button, { variant: "contained", startIcon: _jsx(NavigateNextIcon, {}), onClick: async (event) => {
|
|
48
|
+
const result = await callback(event);
|
|
49
|
+
if (!result)
|
|
50
|
+
return;
|
|
51
|
+
showStep(indexRef.current + 1);
|
|
52
|
+
}, children: labels.nextStep })) : (_jsx(Button, { variant: "contained", startIcon: _jsx(CheckIcon, {}), onClick: async (event) => {
|
|
53
|
+
const result = await callback(event);
|
|
54
|
+
if (!result)
|
|
55
|
+
return;
|
|
56
|
+
const value = jsonRef.current;
|
|
57
|
+
setLocalValue(valueFormatter(value));
|
|
58
|
+
if (onValueChange)
|
|
59
|
+
onValueChange(value);
|
|
60
|
+
}, children: labels.submit }))] })),
|
|
62
61
|
callback: (form) => {
|
|
63
62
|
if (form == null)
|
|
64
63
|
return;
|
|
@@ -76,15 +75,13 @@ export function DataSteps(props) {
|
|
|
76
75
|
React.useEffect(() => {
|
|
77
76
|
setLocalValue(valueFormatter(jsonRef.current));
|
|
78
77
|
}, [valueFormatter]);
|
|
79
|
-
return (
|
|
78
|
+
return (_jsx(TextField, { autoComplete: "off", InputLabelProps: InputLabelProps, inputProps: { style: { cursor: "pointer" } }, InputProps: {
|
|
80
79
|
onKeyDown: (event) => {
|
|
81
80
|
if (event.key === "Tab")
|
|
82
81
|
return;
|
|
83
82
|
cancelInput(event);
|
|
84
83
|
},
|
|
85
84
|
onPaste: cancelInput,
|
|
86
|
-
endAdornment: (
|
|
87
|
-
React.createElement(IconButton, { edge: "end", size: "small" },
|
|
88
|
-
React.createElement(StartIcon, null))))
|
|
85
|
+
endAdornment: (_jsx(InputAdornment, { position: "end", children: _jsx(IconButton, { edge: "end", size: "small", children: _jsx(StartIcon, {}) }) }))
|
|
89
86
|
}, onClick: () => showStep(0), value: localValue, ...rest }));
|
|
90
87
|
}
|
package/lib/DataTable.d.ts
CHANGED
|
@@ -30,4 +30,4 @@ export type DataTableProps<R extends GridValidRowModel = any> = Omit<DataGridPro
|
|
|
30
30
|
* @param props Props
|
|
31
31
|
* @returns Component
|
|
32
32
|
*/
|
|
33
|
-
export declare function DataTable<R extends GridValidRowModel = any>(props: DataTableProps<R>):
|
|
33
|
+
export declare function DataTable<R extends GridValidRowModel = any>(props: DataTableProps<R>): import("react/jsx-runtime").JSX.Element;
|
package/lib/DataTable.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { DataGrid } from "@mui/x-data-grid";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { globalApp } from "./app/ReactApp";
|
|
@@ -38,7 +39,7 @@ export function DataTable(props) {
|
|
|
38
39
|
}
|
|
39
40
|
setSelectedCellParams(params);
|
|
40
41
|
}, []);
|
|
41
|
-
return (
|
|
42
|
+
return (_jsx(DataGrid, { disableColumnMenu: true, hideFooter: true, localeText: localeText, cellModesModel: cellModesModel, onCellModesModelChange: (model) => setCellModesModel(model), onProcessRowUpdateError: onProcessRowUpdateError, slots: {
|
|
42
43
|
toolbar: toolbarCreator
|
|
43
44
|
? ({ selectedCellParams, setCellModesModel, cellModesModel }) => toolbarCreator(selectedCellParams, setCellModesModel, cellModesModel)
|
|
44
45
|
: undefined
|
package/lib/DialogButton.d.ts
CHANGED
|
@@ -51,4 +51,4 @@ export interface DialogButtonProps extends ButtonProps {
|
|
|
51
51
|
* @param props Props
|
|
52
52
|
* @returns Component
|
|
53
53
|
*/
|
|
54
|
-
export declare function DialogButton(props: DialogButtonProps):
|
|
54
|
+
export declare function DialogButton(props: DialogButtonProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/DialogButton.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, IconButton } from '@mui/material';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { Labels } from './app/Labels';
|
|
@@ -28,17 +29,9 @@ export function DialogButton(props) {
|
|
|
28
29
|
onClick(event);
|
|
29
30
|
};
|
|
30
31
|
// Layout
|
|
31
|
-
return (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
event.stopPropagation();
|
|
37
|
-
} },
|
|
38
|
-
React.createElement(DialogTitle, null, dialogTitle ?? title ?? children),
|
|
39
|
-
React.createElement(DialogContent, null,
|
|
40
|
-
React.createElement(DialogContentText, { component: contentPre ? 'pre' : 'span' }, content),
|
|
41
|
-
inputs),
|
|
42
|
-
React.createElement(DialogActions, null,
|
|
43
|
-
React.createElement(Button, { onClick: () => setOpen(false) }, buttonLabel)))));
|
|
32
|
+
return (_jsxs(React.Fragment, { children: [icon == null ? (_jsx(Button, { ...rest, title: title, onClick: onClickLocal, children: children })) : (_jsx(IconButton, { ...rest, onClick: onClickLocal, title: title ?? children?.toString(), children: icon })), _jsxs(Dialog, { disableScrollLock: disableScrollLock, fullScreen: fullScreen, fullWidth: fullWidth, maxWidth: maxWidth, open: open, onClose: () => setOpen(false), onClick: (event) => {
|
|
33
|
+
// The dialog will be embeded and the click event will bubble up
|
|
34
|
+
// Stop propatation but will also cancel onClose and onBackdropClick event
|
|
35
|
+
event.stopPropagation();
|
|
36
|
+
}, children: [_jsx(DialogTitle, { children: dialogTitle ?? title ?? children }), _jsxs(DialogContent, { children: [_jsx(DialogContentText, { component: contentPre ? 'pre' : 'span', children: content }), inputs] }), _jsx(DialogActions, { children: _jsx(Button, { onClick: () => setOpen(false), children: buttonLabel }) })] })] }));
|
|
44
37
|
}
|
package/lib/DnDList.d.ts
CHANGED
|
@@ -101,4 +101,4 @@ export interface DnDListPros<D extends object, K extends DataTypes.Keys<D>> {
|
|
|
101
101
|
*/
|
|
102
102
|
export declare function DnDList<D extends {
|
|
103
103
|
id: UniqueIdentifier;
|
|
104
|
-
}, K extends DataTypes.Keys<D, UniqueIdentifier> = DataTypes.Keys<D, UniqueIdentifier>>(props: DnDListPros<D, K>):
|
|
104
|
+
}, K extends DataTypes.Keys<D, UniqueIdentifier> = DataTypes.Keys<D, UniqueIdentifier>>(props: DnDListPros<D, K>): import("react/jsx-runtime").JSX.Element;
|
package/lib/DnDList.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Skeleton, useTheme } from "@mui/material";
|
|
2
3
|
import React from "react";
|
|
3
4
|
function SortableItem(props) {
|
|
@@ -143,7 +144,7 @@ export function DnDList(props) {
|
|
|
143
144
|
});
|
|
144
145
|
}, []);
|
|
145
146
|
if (dnd == null) {
|
|
146
|
-
return
|
|
147
|
+
return _jsx(Skeleton, { variant: "rectangular", width: "100%", height: height });
|
|
147
148
|
}
|
|
148
149
|
const [DndContextType, SortableContextType, useSortableType, rectSortingStrategyType, rectSwappingStrategyType, horizontalListSortingStrategyType, verticalListSortingStrategyType, CSSType] = dnd;
|
|
149
150
|
const strategy = typeof sortingStrategy === "function"
|
|
@@ -199,16 +200,15 @@ export function DnDList(props) {
|
|
|
199
200
|
.querySelectorAll("select")
|
|
200
201
|
.forEach((input) => input.addEventListener("change", () => doFormChange()));
|
|
201
202
|
};
|
|
202
|
-
const children = (
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}))));
|
|
203
|
+
const children = (_jsx(DndContextType, { onDragStart: handleDragStart, onDragEnd: handleDragEnd, children: _jsx(SortableContextType, { items: items, strategy: strategy, children: items.map((item, index) => {
|
|
204
|
+
const id = item[keyField];
|
|
205
|
+
return (_jsx(SortableItem, { id: id, useSortableType: useSortableType, CSSType: CSSType, style: getItemStyle(index, id === activeId), itemRenderer: (nodeRef, actionNodeRef) => itemRenderer(item, index, nodeRef, actionNodeRef) }, id));
|
|
206
|
+
}) }) }));
|
|
207
207
|
if (onFormChange) {
|
|
208
|
-
return (
|
|
208
|
+
return (_jsx("div", { style: { width: "100%" }, ref: (div) => {
|
|
209
209
|
if (div)
|
|
210
210
|
setupDiv(div);
|
|
211
|
-
}
|
|
211
|
+
}, children: children }));
|
|
212
212
|
}
|
|
213
213
|
return children;
|
|
214
214
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { PaperProps } from "@mui/material";
|
|
2
|
-
import React from "react";
|
|
3
2
|
/**
|
|
4
3
|
* Draggable paper component
|
|
5
4
|
* @param props Props
|
|
6
5
|
* @returns Component
|
|
7
6
|
*/
|
|
8
|
-
export declare function DraggablePaperComponent(props: PaperProps):
|
|
7
|
+
export declare function DraggablePaperComponent(props: PaperProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Paper } from "@mui/material";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import Draggable from "react-draggable";
|
|
@@ -8,6 +9,5 @@ import Draggable from "react-draggable";
|
|
|
8
9
|
*/
|
|
9
10
|
export function DraggablePaperComponent(props) {
|
|
10
11
|
const nodeRef = React.useRef(null);
|
|
11
|
-
return (
|
|
12
|
-
React.createElement(Paper, { ref: nodeRef, ...props })));
|
|
12
|
+
return (_jsx(Draggable, { handle: ".draggable-dialog-title", cancel: '[class*="MuiDialogContent-root"]', nodeRef: nodeRef, children: _jsx(Paper, { ref: nodeRef, ...props }) }));
|
|
13
13
|
}
|
package/lib/EmailInput.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TextFieldProps } from '@mui/material';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
/**
|
|
4
3
|
* Email input props
|
|
5
4
|
*/
|
|
@@ -8,4 +7,4 @@ export type EmailInputProps = Omit<TextFieldProps, 'type'> & {};
|
|
|
8
7
|
* Email input
|
|
9
8
|
* @param props Props
|
|
10
9
|
*/
|
|
11
|
-
export declare function EmailInput(props: EmailInputProps):
|
|
10
|
+
export declare function EmailInput(props: EmailInputProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/EmailInput.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { TextField } from '@mui/material';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Email input
|
|
5
5
|
* @param props Props
|
|
@@ -10,5 +10,5 @@ export function EmailInput(props) {
|
|
|
10
10
|
// Default max length
|
|
11
11
|
inputProps.maxLength ?? (inputProps.maxLength = 128);
|
|
12
12
|
// Layout
|
|
13
|
-
return (
|
|
13
|
+
return (_jsx(TextField, { type: "email", fullWidth: true, inputProps: inputProps, ...rest }));
|
|
14
14
|
}
|
package/lib/FabBox.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BoxProps, PaperProps } from "@mui/material";
|
|
2
|
-
import React from "react";
|
|
3
2
|
type SharedProps = keyof BoxProps & keyof PaperProps;
|
|
4
3
|
/**
|
|
5
4
|
* Fabs container box props
|
|
@@ -23,5 +22,5 @@ export type FabBoxProps = Pick<BoxProps, SharedProps> & Pick<PaperProps, SharedP
|
|
|
23
22
|
* @param props Props
|
|
24
23
|
* @returns Component
|
|
25
24
|
*/
|
|
26
|
-
export declare function FabBox(props: FabBoxProps):
|
|
25
|
+
export declare function FabBox(props: FabBoxProps): import("react/jsx-runtime").JSX.Element;
|
|
27
26
|
export {};
|
package/lib/FabBox.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Box, Paper, useTheme } from "@mui/material";
|
|
2
3
|
import React from "react";
|
|
3
4
|
const initOpactiy = 0.15;
|
|
@@ -14,8 +15,8 @@ export function FabBox(props) {
|
|
|
14
15
|
const spaceGap = theme.spacing(itemGap);
|
|
15
16
|
const [opacity, setOpacity] = React.useState(initOpactiy);
|
|
16
17
|
if (columnDirection == null)
|
|
17
|
-
return
|
|
18
|
-
return fabPanel ? (
|
|
18
|
+
return _jsx(React.Fragment, {});
|
|
19
|
+
return fabPanel ? (_jsx(Paper, { sx: {
|
|
19
20
|
position: "fixed",
|
|
20
21
|
display: "flex",
|
|
21
22
|
alignItems: "center",
|
|
@@ -24,7 +25,7 @@ export function FabBox(props) {
|
|
|
24
25
|
gap: spaceGap,
|
|
25
26
|
opacity: opacity,
|
|
26
27
|
...sx
|
|
27
|
-
}, onMouseEnter: () => setOpacity(1), onMouseLeave: () => setOpacity(initOpactiy), ...rest })) : (
|
|
28
|
+
}, onMouseEnter: () => setOpacity(1), onMouseLeave: () => setOpacity(initOpactiy), ...rest })) : (_jsx(Box, { sx: {
|
|
28
29
|
position: "fixed",
|
|
29
30
|
display: "flex",
|
|
30
31
|
alignItems: "center",
|
package/lib/FieldSetEx.d.ts
CHANGED
|
@@ -18,4 +18,4 @@ export type FieldSetExProps = Omit<FormControlProps, "defaultValue" | "variant">
|
|
|
18
18
|
* @param props Props
|
|
19
19
|
* @returns Component
|
|
20
20
|
*/
|
|
21
|
-
export declare function FieldSetEx(props: FieldSetExProps):
|
|
21
|
+
export declare function FieldSetEx(props: FieldSetExProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/FieldSetEx.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { FormControl, FormHelperText, InputLabel } from "@mui/material";
|
|
2
3
|
import NotchedOutline from "@mui/material/OutlinedInput";
|
|
3
4
|
import React from "react";
|
|
@@ -10,20 +11,16 @@ export function FieldSetEx(props) {
|
|
|
10
11
|
// Destruct
|
|
11
12
|
const { label, helperText, required, fullWidth, children, ...rest } = props;
|
|
12
13
|
// Layout
|
|
13
|
-
return (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
display: "none"
|
|
26
|
-
}
|
|
27
|
-
} })),
|
|
28
|
-
helperText && (React.createElement(FormHelperText, { sx: { marginLeft: 2, marginRight: 2 } }, helperText))));
|
|
14
|
+
return (_jsxs(React.Fragment, { children: [_jsxs(FormControl, { fullWidth: fullWidth, ...rest, children: [label && (_jsx(InputLabel, { required: required, variant: "outlined", shrink: true, children: label })), _jsx(NotchedOutline, { label: label && required ? label + " *" : label, notched: true, endAdornment: children, sx: {
|
|
15
|
+
cursor: "default",
|
|
16
|
+
display: "flex",
|
|
17
|
+
flexWrap: "wrap",
|
|
18
|
+
gap: 1,
|
|
19
|
+
paddingX: 2,
|
|
20
|
+
paddingY: "7px",
|
|
21
|
+
width: fullWidth ? "100%" : "auto",
|
|
22
|
+
"& input": {
|
|
23
|
+
display: "none"
|
|
24
|
+
}
|
|
25
|
+
} })] }), helperText && (_jsx(FormHelperText, { sx: { marginLeft: 2, marginRight: 2 }, children: helperText }))] }));
|
|
29
26
|
}
|
|
@@ -33,4 +33,4 @@ export type FileUploadButtonProps = ButtonProps<"label"> & {
|
|
|
33
33
|
* @param props Props
|
|
34
34
|
* @returns Component
|
|
35
35
|
*/
|
|
36
|
-
export declare function FileUploadButton(props: FileUploadButtonProps):
|
|
36
|
+
export declare function FileUploadButton(props: FileUploadButtonProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/FileUploadButton.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Button } from "@mui/material";
|
|
2
|
-
import React from "react";
|
|
3
3
|
/**
|
|
4
4
|
* File upload button
|
|
5
5
|
* @param props Props
|
|
@@ -10,36 +10,34 @@ export function FileUploadButton(props) {
|
|
|
10
10
|
const { maxFiles, maxFileSize, inputProps, onFileInvalid, onUploadFiles, children, ...rest } = props;
|
|
11
11
|
const { onChange } = inputProps ?? {};
|
|
12
12
|
// Layout
|
|
13
|
-
return (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
onChange(event);
|
|
18
|
-
if (event.isDefaultPrevented())
|
|
19
|
-
return;
|
|
20
|
-
if (onUploadFiles) {
|
|
21
|
-
const files = event.target.files;
|
|
22
|
-
if (files == null)
|
|
13
|
+
return (_jsxs(Button, { component: "label", ...rest, children: [children, _jsx("input", { type: "file", hidden: true, onChange: (event) => {
|
|
14
|
+
if (onChange)
|
|
15
|
+
onChange(event);
|
|
16
|
+
if (event.isDefaultPrevented())
|
|
23
17
|
return;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
18
|
+
if (onUploadFiles) {
|
|
19
|
+
const files = event.target.files;
|
|
20
|
+
if (files == null)
|
|
21
|
+
return;
|
|
22
|
+
const fl = files.length;
|
|
23
|
+
if (fl === 0)
|
|
24
|
+
return;
|
|
25
|
+
if (maxFiles && maxFiles > 0 && fl > maxFiles) {
|
|
26
|
+
if (onFileInvalid)
|
|
27
|
+
onFileInvalid([maxFiles, fl]);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (maxFileSize && maxFileSize > 0) {
|
|
31
|
+
for (let f = 0; f < fl; f++) {
|
|
32
|
+
const file = files[f];
|
|
33
|
+
if (file.size > maxFileSize) {
|
|
34
|
+
if (onFileInvalid)
|
|
35
|
+
onFileInvalid([maxFileSize, file.size], file);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
39
38
|
}
|
|
40
39
|
}
|
|
40
|
+
onUploadFiles(files);
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
}, ...inputProps })));
|
|
42
|
+
}, ...inputProps })] }));
|
|
45
43
|
}
|
package/lib/FlexBox.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { StackProps } from '@mui/material';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
/**
|
|
4
3
|
* Horizonal box
|
|
5
4
|
* @param props Props
|
|
6
5
|
* @returns Component
|
|
7
6
|
*/
|
|
8
|
-
export declare function HBox(props: Omit<StackProps, 'ref'>):
|
|
7
|
+
export declare function HBox(props: Omit<StackProps, 'ref'>): import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
/**
|
|
10
9
|
* Vertial box
|
|
11
10
|
* @param props Props
|
|
12
11
|
* @returns Component
|
|
13
12
|
*/
|
|
14
|
-
export declare function VBox(props: Omit<StackProps, 'ref'>):
|
|
13
|
+
export declare function VBox(props: Omit<StackProps, 'ref'>): import("react/jsx-runtime").JSX.Element;
|