@etsoo/materialui 1.6.39 → 1.6.42
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__/SwitchAnt.tsx +6 -7
- package/lib/cjs/ButtonPopupCheckbox.js +8 -3
- package/lib/cjs/ButtonPopupRadio.js +6 -2
- package/lib/cjs/ComboBox.js +7 -5
- package/lib/cjs/ComboBoxMultiple.js +5 -3
- package/lib/cjs/DataGridEx.js +25 -6
- package/lib/cjs/DataSteps.js +21 -11
- package/lib/cjs/FileUploadButton.js +5 -1
- package/lib/cjs/FlexBox.d.ts +2 -2
- package/lib/cjs/FlexBox.js +3 -2
- package/lib/cjs/InputField.js +3 -4
- package/lib/cjs/MoreFab.js +1 -1
- package/lib/cjs/NotifierMU.js +12 -5
- package/lib/cjs/OptionGroup.js +1 -1
- package/lib/cjs/OptionGroupFlag.js +1 -1
- package/lib/cjs/QuickList.js +3 -3
- package/lib/cjs/ResponsibleContainer.js +4 -1
- package/lib/cjs/SearchBar.js +9 -2
- package/lib/cjs/SearchField.js +8 -9
- package/lib/cjs/SwitchAnt.js +2 -2
- package/lib/cjs/SwitchField.js +1 -1
- package/lib/cjs/TextFieldEx.js +6 -11
- package/lib/cjs/Tiplist.js +2 -2
- package/lib/cjs/TiplistPro.js +1 -1
- package/lib/cjs/TwoFieldInput.d.ts +1 -1
- package/lib/cjs/TwoFieldInput.js +12 -7
- package/lib/cjs/UserAvatarEditor.js +8 -5
- package/lib/cjs/ViewContainer.js +2 -2
- package/lib/cjs/custom/CustomAttributeArea.js +2 -2
- package/lib/cjs/custom/CustomFieldViewer.js +3 -2
- package/lib/cjs/custom/CustomFieldWindow.js +2 -1
- package/lib/cjs/custom/FieldJson.js +1 -1
- package/lib/cjs/custom/FieldTexarea.js +1 -1
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +7 -0
- package/lib/cjs/pages/EditPage.js +3 -1
- package/lib/cjs/pages/ViewPage.js +8 -2
- package/lib/mjs/ButtonPopupCheckbox.js +8 -3
- package/lib/mjs/ButtonPopupRadio.js +6 -2
- package/lib/mjs/ComboBox.js +7 -5
- package/lib/mjs/ComboBoxMultiple.js +5 -3
- package/lib/mjs/DataGridEx.js +25 -6
- package/lib/mjs/DataSteps.js +21 -11
- package/lib/mjs/FileUploadButton.js +5 -1
- package/lib/mjs/FlexBox.d.ts +2 -2
- package/lib/mjs/FlexBox.js +3 -2
- package/lib/mjs/InputField.js +3 -4
- package/lib/mjs/MoreFab.js +1 -1
- package/lib/mjs/NotifierMU.js +12 -5
- package/lib/mjs/OptionGroup.js +1 -1
- package/lib/mjs/OptionGroupFlag.js +1 -1
- package/lib/mjs/QuickList.js +3 -3
- package/lib/mjs/ResponsibleContainer.js +4 -1
- package/lib/mjs/SearchBar.js +9 -2
- package/lib/mjs/SearchField.js +8 -9
- package/lib/mjs/SwitchAnt.js +2 -2
- package/lib/mjs/SwitchField.js +1 -1
- package/lib/mjs/TextFieldEx.js +6 -11
- package/lib/mjs/Tiplist.js +2 -2
- package/lib/mjs/TiplistPro.js +1 -1
- package/lib/mjs/TwoFieldInput.d.ts +1 -1
- package/lib/mjs/TwoFieldInput.js +12 -7
- package/lib/mjs/UserAvatarEditor.js +8 -5
- package/lib/mjs/ViewContainer.js +2 -2
- package/lib/mjs/custom/CustomAttributeArea.js +2 -2
- package/lib/mjs/custom/CustomFieldViewer.js +3 -2
- package/lib/mjs/custom/CustomFieldWindow.js +2 -1
- package/lib/mjs/custom/FieldJson.js +1 -1
- package/lib/mjs/custom/FieldTexarea.js +1 -1
- package/lib/mjs/index.d.ts +1 -0
- package/lib/mjs/index.js +2 -0
- package/lib/mjs/pages/EditPage.js +3 -1
- package/lib/mjs/pages/ViewPage.js +8 -2
- package/package.json +14 -14
- package/src/ButtonPopupCheckbox.tsx +10 -8
- package/src/ButtonPopupRadio.tsx +8 -6
- package/src/ComboBox.tsx +7 -5
- package/src/ComboBoxMultiple.tsx +5 -3
- package/src/ComboBoxPro.tsx +1 -1
- package/src/CultureDataTable.tsx +1 -1
- package/src/DataGridEx.tsx +27 -20
- package/src/DataSteps.tsx +27 -22
- package/src/FileUploadButton.tsx +6 -5
- package/src/FlexBox.tsx +7 -7
- package/src/InputField.tsx +2 -5
- package/src/MoreFab.tsx +8 -8
- package/src/NotifierMU.tsx +12 -12
- package/src/NumberInputField.tsx +1 -0
- package/src/OptionGroup.tsx +3 -5
- package/src/OptionGroupFlag.tsx +3 -5
- package/src/QuickList.tsx +4 -4
- package/src/ResponsibleContainer.tsx +3 -3
- package/src/SearchBar.tsx +7 -7
- package/src/SearchField.tsx +8 -14
- package/src/SwitchAnt.tsx +2 -2
- package/src/SwitchField.tsx +1 -3
- package/src/TextFieldEx.tsx +32 -36
- package/src/Tiplist.tsx +2 -2
- package/src/TiplistPro.tsx +2 -2
- package/src/TwoFieldInput.tsx +33 -31
- package/src/UserAvatarEditor.tsx +15 -10
- package/src/ViewContainer.tsx +6 -2
- package/src/custom/CustomAttributeArea.tsx +3 -3
- package/src/custom/CustomFieldViewer.tsx +8 -3
- package/src/custom/CustomFieldWindow.tsx +4 -4
- package/src/custom/FieldJson.tsx +3 -3
- package/src/custom/FieldTexarea.tsx +1 -1
- package/src/index.ts +3 -0
- package/src/pages/EditPage.tsx +4 -5
- package/src/pages/ViewPage.tsx +11 -8
- package/tsconfig.cjs.json +1 -1
- package/tsconfig.json +2 -2
package/lib/mjs/NotifierMU.js
CHANGED
|
@@ -177,7 +177,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
177
177
|
this.dismiss();
|
|
178
178
|
return true;
|
|
179
179
|
};
|
|
180
|
-
return (_jsxs(Dialog, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [_jsxs(IconDialogTitle, { draggable: draggable, className: draggable ? "dialog-title draggable-dialog-title" : "dialog-title", children: [_jsx(InfoIcon, { color: "primary" }), _jsx("span", { className: "dialogTitle", children: title }), closable && (_jsx(IconButton, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: _jsx(CloseIcon, {}) }))] }), _jsxs(DialogContent, { ...inputProps, children: [content, _jsx(Typography, {
|
|
180
|
+
return (_jsxs(Dialog, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [_jsxs(IconDialogTitle, { draggable: draggable, className: draggable ? "dialog-title draggable-dialog-title" : "dialog-title", children: [_jsx(InfoIcon, { color: "primary" }), _jsx("span", { className: "dialogTitle", children: title }), closable && (_jsx(IconButton, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: _jsx(CloseIcon, {}) }))] }), _jsxs(DialogContent, { ...inputProps, children: [content, _jsx(Typography, { component: "div", variant: "caption", ref: errorRef, color: "error" })] }), _jsx(DialogActions, { children: buttons ? (buttons(this, handleSubmit)) : (_jsxs(React.Fragment, { children: [cancelButton && (_jsx(Button, { color: "secondary", onClick: () => {
|
|
181
181
|
if (this.onReturn)
|
|
182
182
|
this.onReturn(undefined);
|
|
183
183
|
this.dismiss();
|
|
@@ -263,7 +263,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
263
263
|
return false;
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
}, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [_jsxs(IconDialogTitle, { draggable: draggable, className: draggable ? "dialog-title draggable-dialog-title" : "dialog-title", children: [_jsx(InfoIcon, { color: "primary" }), _jsx("span", { className: "dialogTitle", children: title }), closable && (_jsx(IconButton, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: _jsx(CloseIcon, {}) }))] }), _jsxs(DialogContent, { dividers: true, children: [typeof this.content === "string" ? (_jsx(DialogContentText, { children: this.content })) : (this.content), localInputs, _jsx(Typography, {
|
|
266
|
+
}, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [_jsxs(IconDialogTitle, { draggable: draggable, className: draggable ? "dialog-title draggable-dialog-title" : "dialog-title", children: [_jsx(InfoIcon, { color: "primary" }), _jsx("span", { className: "dialogTitle", children: title }), closable && (_jsx(IconButton, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: _jsx(CloseIcon, {}) }))] }), _jsxs(DialogContent, { dividers: true, children: [typeof this.content === "string" ? (_jsx(DialogContentText, { children: this.content })) : (this.content), localInputs, _jsx(Typography, { component: "div", variant: "caption", ref: errorRef, color: "error" })] }), _jsx(DialogActions, { children: buttons ? (buttons(this, handleSubmit)) : (_jsxs(React.Fragment, { children: [cancelButton && (_jsx(Button, { color: "secondary", onClick: () => {
|
|
267
267
|
if (this.onReturn)
|
|
268
268
|
this.onReturn(undefined);
|
|
269
269
|
this.dismiss();
|
|
@@ -293,11 +293,15 @@ export class NotificationMU extends NotificationReact {
|
|
|
293
293
|
return (_jsx(Backdrop, { className: className, sx: {
|
|
294
294
|
color: "#fff",
|
|
295
295
|
zIndex: (theme) => theme.zIndex.modal + 1
|
|
296
|
-
}, open: this.open, ...options, children: _jsxs(Box, {
|
|
296
|
+
}, open: this.open, ...options, children: _jsxs(Box, { sx: {
|
|
297
|
+
display: "flex",
|
|
298
|
+
flexDirection: "column",
|
|
299
|
+
flexWrap: "nowrap",
|
|
300
|
+
alignItems: "center",
|
|
297
301
|
"& > :not(style) + :not(style)": {
|
|
298
302
|
marginTop: (theme) => theme.spacing(1)
|
|
299
303
|
}
|
|
300
|
-
}, children: [_jsx(CircularProgress, { ...setupProps }), content && (_jsx(Box, { maxWidth: maxWidth === false ? undefined : maxWidth, children: content }))] }) }, this.id));
|
|
304
|
+
}, children: [_jsx(CircularProgress, { ...setupProps }), content && (_jsx(Box, { sx: { maxWidth: maxWidth === false ? undefined : maxWidth }, children: content }))] }) }, this.id));
|
|
301
305
|
}
|
|
302
306
|
/**
|
|
303
307
|
* Render method
|
|
@@ -414,7 +418,10 @@ export class NotifierMU extends NotifierReact {
|
|
|
414
418
|
// Use SnackBar for layout
|
|
415
419
|
return (_jsx(Snackbar, { anchorOrigin: NotifierMU.getOrigin(align), className: className, sx: align === NotificationAlign.Center
|
|
416
420
|
? { position: "fixed", top: "50%!important" }
|
|
417
|
-
: undefined, open: true, children: _jsx(Box, {
|
|
421
|
+
: undefined, open: true, children: _jsx(Box, { sx: {
|
|
422
|
+
display: "flex",
|
|
423
|
+
flexDirection: "column",
|
|
424
|
+
flexWrap: "nowrap",
|
|
418
425
|
"& > :not(style) + :not(style)": {
|
|
419
426
|
marginTop: (theme) => theme.spacing(1)
|
|
420
427
|
}
|
package/lib/mjs/OptionGroup.js
CHANGED
|
@@ -106,5 +106,5 @@ export function OptionGroup(props) {
|
|
|
106
106
|
"& input": {
|
|
107
107
|
display: "none"
|
|
108
108
|
}
|
|
109
|
-
} })) : (_jsx(Box, { paddingLeft: 2, paddingY: "7px", children: group }))] }), helperText && (_jsx(FormHelperText, { sx: { marginLeft: 2, marginRight: 2 }, children: helperText }))] }));
|
|
109
|
+
} })) : (_jsx(Box, { sx: { paddingLeft: 2, paddingY: "7px" }, children: group }))] }), helperText && (_jsx(FormHelperText, { sx: { marginLeft: 2, marginRight: 2 }, children: helperText }))] }));
|
|
110
110
|
}
|
|
@@ -88,5 +88,5 @@ export function OptionGroupFlag(props) {
|
|
|
88
88
|
"& input": {
|
|
89
89
|
display: "none"
|
|
90
90
|
}
|
|
91
|
-
} })) : (_jsx(Box, { paddingLeft: 2, paddingY: "7px", children: group }))] }), helperText && (_jsx(FormHelperText, { sx: { marginLeft: 2, marginRight: 2 }, children: helperText }))] }));
|
|
91
|
+
} })) : (_jsx(Box, { sx: { paddingLeft: 2, paddingY: "7px" }, children: group }))] }), helperText && (_jsx(FormHelperText, { sx: { marginLeft: 2, marginRight: 2 }, children: helperText }))] }));
|
|
92
92
|
}
|
package/lib/mjs/QuickList.js
CHANGED
|
@@ -18,7 +18,7 @@ export function QuickList(props) {
|
|
|
18
18
|
// Global app
|
|
19
19
|
const app = useAppContext();
|
|
20
20
|
// Destruct
|
|
21
|
-
const { buttonProps = {}, label, inputProps, itemLabel = DataTypes.getListItemLabel, itemRenderer = (item) => itemLabel(item), itemProps, loadData, noMatchesLabel = app?.get("noMatches"),
|
|
21
|
+
const { buttonProps = {}, label, inputProps, itemLabel = DataTypes.getListItemLabel, itemRenderer = (item) => itemLabel(item), itemProps, loadData, noMatchesLabel = app?.get("noMatches"), spacing = 1, onItemClick, sx, ...rest } = props;
|
|
22
22
|
const { onClick, ...buttonRest } = buttonProps;
|
|
23
23
|
// States
|
|
24
24
|
const [loading, setLoading] = React.useState(false);
|
|
@@ -34,12 +34,12 @@ export function QuickList(props) {
|
|
|
34
34
|
loadDataLocal();
|
|
35
35
|
}, []);
|
|
36
36
|
// Layout
|
|
37
|
-
return (_jsxs(VBox, {
|
|
37
|
+
return (_jsxs(VBox, { spacing: spacing, sx: { height: "480px", ...sx }, ...rest, children: [_jsx(InputField, { label: label, onChangeDelay: (event) => {
|
|
38
38
|
// Stop bubble
|
|
39
39
|
event.preventDefault();
|
|
40
40
|
event.stopPropagation();
|
|
41
41
|
loadDataLocal(event.target.value);
|
|
42
|
-
}, fullWidth: true, ...inputProps }), loading ? (_jsx(LinearProgress, {})) : items.length === 0 ? (_jsx(Typography, {
|
|
42
|
+
}, fullWidth: true, ...inputProps }), loading ? (_jsx(LinearProgress, {})) : items.length === 0 ? (_jsx(Typography, { align: "center", children: noMatchesLabel })) : (_jsx(List, { children: items.map((item) => (_jsx(ListItem, { disablePadding: true, ...itemProps, children: _jsx(ListItemButton, { onClick: (event) => {
|
|
43
43
|
if (onClick)
|
|
44
44
|
onClick(event);
|
|
45
45
|
if (!event.defaultPrevented && onItemClick)
|
|
@@ -141,8 +141,11 @@ export function ResponsibleContainer(props) {
|
|
|
141
141
|
return (_jsxs(Box, { sx: containerBoxSx == null
|
|
142
142
|
? undefined
|
|
143
143
|
: containerBoxSx(paddings, hasFields, showDataGrid), children: [_jsxs(Stack, { children: [_jsx(Box, { ref: dimensions[0][0], className: "SearchBox", sx: {
|
|
144
|
+
marginBottom: hasFields
|
|
145
|
+
? `${searchBarBottom}px!important`
|
|
146
|
+
: undefined,
|
|
144
147
|
height: hasFields ? searchBarHeight : 0
|
|
145
|
-
},
|
|
148
|
+
}, children: searchBar }), list] }), pullToRefresh && pullContainer && list != null && (_jsx(PullToRefreshUI, { mainElement: pullContainer, triggerElement: pullContainer, instructionsPullToRefresh: labels.pullToRefresh, instructionsReleaseToRefresh: labels.releaseToRefresh, instructionsRefreshing: labels.refreshing, onRefresh: () => state.ref?.reset(), shouldPullToRefresh: () => {
|
|
146
149
|
const container = document.querySelector(pullContainer);
|
|
147
150
|
return !container?.scrollTop;
|
|
148
151
|
} }))] }));
|
package/lib/mjs/SearchBar.js
CHANGED
|
@@ -242,7 +242,12 @@ export function SearchBar(props) {
|
|
|
242
242
|
return (_jsxs(React.Fragment, { children: [_jsx("form", { id: "SearchBarForm", className: className, onChange: handleForm, ref: (form) => {
|
|
243
243
|
if (form)
|
|
244
244
|
state.form = form;
|
|
245
|
-
}, children: _jsxs(Stack, { ref: dimensions[0][0], className: "SearchBarContainer",
|
|
245
|
+
}, children: _jsxs(Stack, { ref: dimensions[0][0], className: "SearchBarContainer", direction: "row", spacing: `${itemGap}px`, sx: {
|
|
246
|
+
alignItems: "center",
|
|
247
|
+
justifyContent: "center",
|
|
248
|
+
width,
|
|
249
|
+
overflow: "hidden",
|
|
250
|
+
paddingTop: "6px",
|
|
246
251
|
"& > :not(style)": {
|
|
247
252
|
flexBasis: "auto",
|
|
248
253
|
flexGrow: 0,
|
|
@@ -265,7 +270,9 @@ export function SearchBar(props) {
|
|
|
265
270
|
}, open: open, onClose: () => updateOpen(false), children: [top === true && _jsx(Toolbar, {}), _jsx("form", { onChange: moreFormChange, ref: (form) => {
|
|
266
271
|
if (form)
|
|
267
272
|
state.moreForm = form;
|
|
268
|
-
}, children: _jsx(Stack, { direction: "column",
|
|
273
|
+
}, children: _jsx(Stack, { direction: "column", spacing: 2, sx: {
|
|
274
|
+
padding: 2,
|
|
275
|
+
alignItems: "stretch",
|
|
269
276
|
"& > :not(style)": {
|
|
270
277
|
minWidth: "100px"
|
|
271
278
|
}
|
package/lib/mjs/SearchField.js
CHANGED
|
@@ -10,14 +10,8 @@ import TextField from "@mui/material/TextField";
|
|
|
10
10
|
*/
|
|
11
11
|
export function SearchField(props) {
|
|
12
12
|
// Destruct
|
|
13
|
-
const { changeDelay,
|
|
14
|
-
|
|
15
|
-
InputLabelProps.shrink ??= MUGlobal.searchFieldShrink;
|
|
16
|
-
// Read only
|
|
17
|
-
if (readOnly != null)
|
|
18
|
-
InputProps.readOnly = readOnly;
|
|
19
|
-
// Min characters
|
|
20
|
-
inputProps["data-min-chars"] = minChars;
|
|
13
|
+
const { changeDelay, onChange, readOnly, size = MUGlobal.searchFieldSize, variant = MUGlobal.searchFieldVariant, minChars = 0, slotProps, ...rest } = props;
|
|
14
|
+
const { input, inputLabel, htmlInput, ...restSlotProps } = slotProps ?? {};
|
|
21
15
|
const isMounted = React.useRef(true);
|
|
22
16
|
const delayed = onChange != null && changeDelay != null && changeDelay >= 1
|
|
23
17
|
? useDelayedExecutor(onChange, changeDelay)
|
|
@@ -46,5 +40,10 @@ export function SearchField(props) {
|
|
|
46
40
|
};
|
|
47
41
|
}, []);
|
|
48
42
|
// Layout
|
|
49
|
-
return (_jsx(TextField, {
|
|
43
|
+
return (_jsx(TextField, { onChange: onChangeEx, size: size, variant: variant, slotProps: {
|
|
44
|
+
input: { readOnly, ...input },
|
|
45
|
+
inputLabel: { shrink: MUGlobal.searchFieldShrink, ...inputLabel },
|
|
46
|
+
htmlInput: { ["data-min-chars"]: minChars, ...htmlInput },
|
|
47
|
+
...restSlotProps
|
|
48
|
+
}, ...rest }));
|
|
50
49
|
}
|
package/lib/mjs/SwitchAnt.js
CHANGED
|
@@ -31,12 +31,12 @@ export function SwitchAnt(props) {
|
|
|
31
31
|
setControlChecked(checked);
|
|
32
32
|
};
|
|
33
33
|
// Layout
|
|
34
|
-
return (_jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [_jsx(Typography, { onClick: () => controlChecked && ref.current?.click(), sx: {
|
|
34
|
+
return (_jsxs(Stack, { direction: "row", spacing: 1, sx: { alignItems: "center" }, children: [_jsx(Typography, { onClick: () => controlChecked && ref.current?.click(), sx: {
|
|
35
35
|
cursor: "pointer",
|
|
36
36
|
color: controlChecked
|
|
37
37
|
? undefined
|
|
38
38
|
: (theme) => activeColor ?? theme.palette.warning.main
|
|
39
|
-
}, children: startLabel }), _jsx(Switch, { checked: controlChecked,
|
|
39
|
+
}, children: startLabel }), _jsx(Switch, { checked: controlChecked, ref: ref, value: value, onChange: onChangeLocal, ...rest }), _jsx(Typography, { onClick: () => !controlChecked && ref.current?.click(), sx: {
|
|
40
40
|
cursor: "pointer",
|
|
41
41
|
color: controlChecked
|
|
42
42
|
? (theme) => activeColor ?? theme.palette.warning.main
|
package/lib/mjs/SwitchField.js
CHANGED
|
@@ -29,5 +29,5 @@ export function SwitchField(props) {
|
|
|
29
29
|
"& input": {
|
|
30
30
|
display: "none"
|
|
31
31
|
}
|
|
32
|
-
} })) : (_jsx(Box, { paddingLeft: 2, paddingY: "7px", children: group }))] }), helperText && _jsx(FormHelperText, { children: helperText })] }));
|
|
32
|
+
} })) : (_jsx(Box, { sx: { paddingLeft: 2, paddingY: "7px" }, children: group }))] }), helperText && _jsx(FormHelperText, { children: helperText })] }));
|
|
33
33
|
}
|
package/lib/mjs/TextFieldEx.js
CHANGED
|
@@ -15,17 +15,12 @@ export function TextFieldEx(props) {
|
|
|
15
15
|
// Labels
|
|
16
16
|
const { showIt, clearInput } = app?.getLabels("showIt", "clearInput") ?? {};
|
|
17
17
|
// Destructure
|
|
18
|
-
const { changeDelay, clearLabel = clearInput, error, fullWidth = true, helperText,
|
|
18
|
+
const { changeDelay, clearLabel = clearInput, error, fullWidth = true, helperText, slotProps, onChange, onClear, onKeyDown, onEnter, onVisibility, inputRef, readOnly, showClear, showPassword, type, variant = MUGlobal.textFieldVariant, mRef, ...rest } = props;
|
|
19
19
|
// Slot props
|
|
20
20
|
const { input, inputLabel, ...restSlotProps } = slotProps ?? {};
|
|
21
|
-
// Shrink
|
|
22
|
-
InputLabelProps.shrink ??= MUGlobal.searchFieldShrink;
|
|
23
21
|
// State
|
|
24
22
|
const [errorText, updateErrorText] = React.useState();
|
|
25
23
|
const [empty, updateEmpty] = React.useState(true);
|
|
26
|
-
// Read only
|
|
27
|
-
if (readOnly != null)
|
|
28
|
-
InputProps.readOnly = readOnly;
|
|
29
24
|
// Calculate
|
|
30
25
|
let errorEx = error;
|
|
31
26
|
let helperTextEx = helperText;
|
|
@@ -84,10 +79,6 @@ export function TextFieldEx(props) {
|
|
|
84
79
|
}
|
|
85
80
|
preventDefault(e);
|
|
86
81
|
};
|
|
87
|
-
// Show password and/or clear button
|
|
88
|
-
if (!empty && (showPassword || showClear)) {
|
|
89
|
-
InputProps.endAdornment = (_jsxs(InputAdornment, { position: "end", children: [showPassword && (_jsx(IconButton, { tabIndex: -1, onContextMenu: (event) => event.preventDefault(), onMouseDown: touchStart, onMouseUp: touchEnd, onTouchStart: touchStart, onTouchCancel: touchEnd, onTouchEnd: touchEnd, title: showIt, children: _jsx(VisibilityIcon, {}) })), showClear && (_jsx(IconButton, { onClick: clearClick, tabIndex: -1, title: clearLabel, children: _jsx(ClearIcon, {}) }))] }));
|
|
90
|
-
}
|
|
91
82
|
// Extend key precess
|
|
92
83
|
const onKeyPressEx = onEnter == null
|
|
93
84
|
? onKeyDown
|
|
@@ -143,7 +134,11 @@ export function TextFieldEx(props) {
|
|
|
143
134
|
}, []);
|
|
144
135
|
// Textfield
|
|
145
136
|
return (_jsx(TextField, { error: errorEx, fullWidth: fullWidth, helperText: helperTextEx, inputRef: useCombinedRefs(inputRef, localRef), onChange: onChangeEx, onKeyDown: onKeyPressEx, slotProps: {
|
|
146
|
-
input: {
|
|
137
|
+
input: {
|
|
138
|
+
endAdornment: !empty && (showPassword || showClear) ? (_jsxs(InputAdornment, { position: "end", children: [showPassword && (_jsx(IconButton, { tabIndex: -1, onContextMenu: (event) => event.preventDefault(), onMouseDown: touchStart, onMouseUp: touchEnd, onTouchStart: touchStart, onTouchCancel: touchEnd, onTouchEnd: touchEnd, title: showIt, children: _jsx(VisibilityIcon, {}) })), showClear && (_jsx(IconButton, { onClick: clearClick, tabIndex: -1, title: clearLabel, children: _jsx(ClearIcon, {}) }))] })) : undefined,
|
|
139
|
+
readOnly,
|
|
140
|
+
...input
|
|
141
|
+
},
|
|
147
142
|
inputLabel: {
|
|
148
143
|
shrink: MUGlobal.inputFieldShrink,
|
|
149
144
|
...inputLabel
|
package/lib/mjs/Tiplist.js
CHANGED
|
@@ -56,7 +56,7 @@ export function Tiplist(props) {
|
|
|
56
56
|
}
|
|
57
57
|
// https://stackoverflow.com/questions/15738259/disabling-chrome-autofill
|
|
58
58
|
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html
|
|
59
|
-
Object.assign(params.
|
|
59
|
+
Object.assign(params.slotProps.htmlInput, {
|
|
60
60
|
autoComplete: inputAutoComplete,
|
|
61
61
|
"data-reset": inputReset
|
|
62
62
|
});
|
|
@@ -170,7 +170,7 @@ export function Tiplist(props) {
|
|
|
170
170
|
};
|
|
171
171
|
}, []);
|
|
172
172
|
// Layout
|
|
173
|
-
return (_jsxs("div", { style: { flex: 2 }, children: [_jsx("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: `${inputValue ?? (state.current.idSet ? "" : localIdValue ?? "")}`, readOnly: true, onChange: inputOnChange, disabled: disabled }), _jsx(Autocomplete, { filterOptions: (options, _state) => options, disabled: disabled, value: states.value, options: states.options, onChange: (event, value, reason, details) => {
|
|
173
|
+
return (_jsxs("div", { style: { flex: 2 }, children: [_jsx("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: `${inputValue ?? (state.current.idSet ? "" : (localIdValue ?? ""))}`, readOnly: true, onChange: inputOnChange, disabled: disabled }), _jsx(Autocomplete, { filterOptions: (options, _state) => options, disabled: disabled, value: states.value, options: states.options, onChange: (event, value, reason, details) => {
|
|
174
174
|
// Set value
|
|
175
175
|
setInputValue(value);
|
|
176
176
|
// Custom
|
package/lib/mjs/TiplistPro.js
CHANGED
|
@@ -156,7 +156,7 @@ export function TiplistPro(props) {
|
|
|
156
156
|
};
|
|
157
157
|
}, []);
|
|
158
158
|
// Layout
|
|
159
|
-
return (_jsxs("div", { style: { flex: 2 }, children: [_jsx("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: inputValue ?? (state.current.idSet ? "" : localIdValue ?? ""), readOnly: true, onChange: inputOnChange, disabled: disabled }), _jsx(Autocomplete, { filterOptions: (options, _state) => options, value: states.value, options: states.options, disabled: disabled, freeSolo: true, clearOnBlur: false, onChange: (event, value, reason, details) => {
|
|
159
|
+
return (_jsxs("div", { style: { flex: 2 }, children: [_jsx("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: inputValue ?? (state.current.idSet ? "" : (localIdValue ?? "")), readOnly: true, onChange: inputOnChange, disabled: disabled }), _jsx(Autocomplete, { filterOptions: (options, _state) => options, value: states.value, options: states.options, disabled: disabled, freeSolo: true, clearOnBlur: false, onChange: (event, value, reason, details) => {
|
|
160
160
|
if (typeof value === "object") {
|
|
161
161
|
// Set value
|
|
162
162
|
setInputValue(value);
|
|
@@ -3,7 +3,7 @@ type ValueType = string | number | Date | null | undefined;
|
|
|
3
3
|
/**
|
|
4
4
|
* TwoField Input props
|
|
5
5
|
*/
|
|
6
|
-
export type TwoFieldInputProps = Omit<InputFieldProps, "
|
|
6
|
+
export type TwoFieldInputProps = Omit<InputFieldProps, "value"> & {
|
|
7
7
|
/**
|
|
8
8
|
* Values
|
|
9
9
|
*/
|
package/lib/mjs/TwoFieldInput.js
CHANGED
|
@@ -13,7 +13,8 @@ import Input from "@mui/material/Input";
|
|
|
13
13
|
*/
|
|
14
14
|
export function TwoFieldInput(props) {
|
|
15
15
|
// Destruct
|
|
16
|
-
const { name,
|
|
16
|
+
const { name, slotProps, type, values, onValuesChange, onChange, onInput, ...rest } = props;
|
|
17
|
+
const { htmlInput, input, ...restSlotProps } = slotProps ?? {};
|
|
17
18
|
// Local values
|
|
18
19
|
const localValues = values == null
|
|
19
20
|
? [null, null]
|
|
@@ -54,11 +55,15 @@ export function TwoFieldInput(props) {
|
|
|
54
55
|
valueRef.current = localValues;
|
|
55
56
|
}, [localValues]);
|
|
56
57
|
// Layout
|
|
57
|
-
return (_jsx(InputField, { name: `${name}-start`, type: type, value: formatValue(localValues[0], type), ref: dimensions[0][0],
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
return (_jsx(InputField, { name: `${name}-start`, type: type, value: formatValue(localValues[0], type), ref: dimensions[0][0], slotProps: {
|
|
59
|
+
input: {
|
|
60
|
+
...input,
|
|
61
|
+
endAdornment: (_jsxs(InputAdornment, { position: "end", sx: {
|
|
62
|
+
display: "flex",
|
|
63
|
+
alignItems: "center",
|
|
64
|
+
gap: 1
|
|
65
|
+
}, children: [_jsx(ArrowRightAltIcon, {}), _jsx(Input, { type: type, name: `${name}-end`, value: formatValue(localValues[1], type), disableUnderline: true, onInput: onInput, onChange: handleChange, slotProps: { input: htmlInput } })] }))
|
|
66
|
+
},
|
|
67
|
+
...restSlotProps
|
|
63
68
|
}, onInput: onInput, onChange: handleChange, ...rest }));
|
|
64
69
|
}
|
|
@@ -9,6 +9,7 @@ import RemoveIcon from "@mui/icons-material/Remove";
|
|
|
9
9
|
import AddIcon from "@mui/icons-material/Add";
|
|
10
10
|
import { Labels } from "./app/Labels";
|
|
11
11
|
import { FileUploadButton } from "./FileUploadButton";
|
|
12
|
+
import AvatarEditor from "react-avatar-editor";
|
|
12
13
|
import Stack from "@mui/material/Stack";
|
|
13
14
|
import Skeleton from "@mui/material/Skeleton";
|
|
14
15
|
import ButtonGroup from "@mui/material/ButtonGroup";
|
|
@@ -36,7 +37,7 @@ export function UserAvatarEditor(props) {
|
|
|
36
37
|
// Calculated max width
|
|
37
38
|
const maxWidthCalculated = maxWidth == null || maxWidth < defaultSize ? 2 * width : maxWidth;
|
|
38
39
|
// Ref
|
|
39
|
-
const ref = React.
|
|
40
|
+
const ref = React.useRef(null);
|
|
40
41
|
// Image type
|
|
41
42
|
const type = React.useRef("image/jpeg");
|
|
42
43
|
// Button ref
|
|
@@ -81,6 +82,10 @@ export function UserAvatarEditor(props) {
|
|
|
81
82
|
};
|
|
82
83
|
// Handle image load
|
|
83
84
|
const handleLoad = (imageInfo) => {
|
|
85
|
+
if (imageInfo.resource == null ||
|
|
86
|
+
imageInfo.height == null ||
|
|
87
|
+
imageInfo.width == null)
|
|
88
|
+
return;
|
|
84
89
|
// Ignore too small images
|
|
85
90
|
if (imageInfo.resource.width < 10 || imageInfo.resource.height < 10)
|
|
86
91
|
return;
|
|
@@ -161,8 +166,6 @@ export function UserAvatarEditor(props) {
|
|
|
161
166
|
}
|
|
162
167
|
}
|
|
163
168
|
};
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
return (_jsxs(Stack, { direction: "column", spacing: 0.5, width: containerWidth, children: [_jsx(FileUploadButton, { variant: "outlined", size: "medium", startIcon: _jsx(ImageIcon, {}), fullWidth: true, onUploadFiles: handleFileUpload, inputProps: { accept: "image/png, image/jpeg" }, children: selectFileLabel }), _jsxs(Stack, { direction: "row", spacing: 0.5, children: [_jsx(React.Suspense, { fallback: _jsx(Skeleton, { variant: "rounded", width: width, height: localHeight }), children: _jsx(AE, { ref: ref, border: border, width: width, height: localHeight, onLoadSuccess: handleLoad, image: previewImage ??
|
|
167
|
-
"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=", scale: editorState.scale, rotate: editorState.rotate }) }), _jsxs(ButtonGroup, { size: "small", orientation: "vertical", disabled: !ready, children: [_jsx(Button, { onClick: () => handleRotate(90), title: labels.rotateRight, children: _jsx(RotateRightIcon, {}) }), _jsx(Button, { onClick: () => handleRotate(-90), title: labels.rotateLeft, children: _jsx(RotateLeftIcon, {}) }), _jsx(Button, { onClick: handleReset, title: labels.reset, children: _jsx(ClearAllIcon, {}) })] })] }), _jsxs(Stack, { spacing: 0.5, direction: "row", sx: { paddingBottom: 2 }, alignItems: "center", children: [_jsx(IconButton, { size: "small", disabled: !ready || editorState.scale <= min, onClick: () => adjustScale(false), children: _jsx(RemoveIcon, {}) }), _jsx(Slider, { title: labels.zoom, disabled: !ready, min: min, max: max, step: step, value: editorState.scale, valueLabelDisplay: "auto", valueLabelFormat: (value) => `${Math.round(100 * value) / 100}`, marks: marks, onChange: handleZoom }), _jsx(IconButton, { size: "small", disabled: !ready || editorState.scale >= max, onClick: () => adjustScale(true), children: _jsx(AddIcon, {}) })] }), _jsx(Button, { ref: buttonRef, variant: "contained", startIcon: _jsx(DoneIcon, {}), disabled: !ready, onClick: handleDone, children: labels.done })] }));
|
|
169
|
+
return (_jsxs(Stack, { direction: "column", spacing: 0.5, sx: { width: containerWidth }, children: [_jsx(FileUploadButton, { variant: "outlined", size: "medium", startIcon: _jsx(ImageIcon, {}), fullWidth: true, onUploadFiles: handleFileUpload, inputProps: { accept: "image/png, image/jpeg" }, children: selectFileLabel }), _jsxs(Stack, { direction: "row", spacing: 0.5, children: [_jsx(React.Suspense, { fallback: _jsx(Skeleton, { variant: "rounded", width: width, height: localHeight }), children: _jsx(AvatarEditor, { ref: ref, border: border, width: width, height: localHeight, onLoadSuccess: handleLoad, image: previewImage ??
|
|
170
|
+
"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=", scale: editorState.scale, rotate: editorState.rotate }) }), _jsxs(ButtonGroup, { size: "small", orientation: "vertical", disabled: !ready, children: [_jsx(Button, { onClick: () => handleRotate(90), title: labels.rotateRight, children: _jsx(RotateRightIcon, {}) }), _jsx(Button, { onClick: () => handleRotate(-90), title: labels.rotateLeft, children: _jsx(RotateLeftIcon, {}) }), _jsx(Button, { onClick: handleReset, title: labels.reset, children: _jsx(ClearAllIcon, {}) })] })] }), _jsxs(Stack, { spacing: 0.5, direction: "row", sx: { alignItems: "center", paddingBottom: 2 }, children: [_jsx(IconButton, { size: "small", disabled: !ready || editorState.scale <= min, onClick: () => adjustScale(false), children: _jsx(RemoveIcon, {}) }), _jsx(Slider, { title: labels.zoom, disabled: !ready, min: min, max: max, step: step, value: editorState.scale, valueLabelDisplay: "auto", valueLabelFormat: (value) => `${Math.round(100 * value) / 100}`, marks: marks, onChange: handleZoom }), _jsx(IconButton, { size: "small", disabled: !ready || editorState.scale >= max, onClick: () => adjustScale(true), children: _jsx(AddIcon, {}) })] }), _jsx(Button, { ref: buttonRef, variant: "contained", startIcon: _jsx(DoneIcon, {}), disabled: !ready, onClick: handleDone, children: labels.done })] }));
|
|
168
171
|
}
|
package/lib/mjs/ViewContainer.js
CHANGED
|
@@ -156,7 +156,7 @@ export function ViewPageGridItem(props) {
|
|
|
156
156
|
options = getResp(singleRow ?? "small");
|
|
157
157
|
}
|
|
158
158
|
// Layout
|
|
159
|
-
return (_jsxs(Grid, { ...gridProps, ...options, children: [label != null && (_jsx(Typography, { variant: "caption", component: horizontal ? "span" : "div", children: label })), typeof data === "object" ? (data) : horizontal ? (_jsx(Typography, { variant: "subtitle2", component: "span", marginLeft: 0.5, children: data })) : (_jsx(Typography, { variant: "subtitle2", children: data }))] }));
|
|
159
|
+
return (_jsxs(Grid, { ...gridProps, ...options, children: [label != null && (_jsx(Typography, { variant: "caption", component: horizontal ? "span" : "div", children: label })), typeof data === "object" ? (data) : horizontal ? (_jsx(Typography, { variant: "subtitle2", component: "span", sx: { marginLeft: 0.5 }, children: data })) : (_jsx(Typography, { variant: "subtitle2", children: data }))] }));
|
|
160
160
|
}
|
|
161
161
|
export function ViewContainer(props) {
|
|
162
162
|
// Global app
|
|
@@ -226,5 +226,5 @@ export function ViewContainer(props) {
|
|
|
226
226
|
}, [app, fields, data, bp]);
|
|
227
227
|
let leftResult;
|
|
228
228
|
// Layout
|
|
229
|
-
return (_jsxs(Grid, { container: true,
|
|
229
|
+
return (_jsxs(Grid, { container: true, className: "ET-ViewContainer", ref: gridRef, spacing: spacing, sx: { justifyContent: "left" }, children: [leftContainer && (leftResult = leftContainer(data)) != null && (_jsxs(React.Fragment, { children: [_jsx(Grid, { container: true, className: "ET-ViewPage-LeftContainer", spacing: spacing, size: size, ...leftContainerPropsRest, children: leftResult }), _jsx(Grid, { container: true, className: "ET-ViewPage-LeftOthers", spacing: spacing, size: ViewPageSize.matchSize(size), children: createFields(data, leftContainerLines * (12 - getItemSize(bp, size))) })] })), createFields(data)] }));
|
|
230
230
|
}
|
|
@@ -35,7 +35,7 @@ function InputItemUIs({ data }) {
|
|
|
35
35
|
const types = Object.keys(CustomFieldUtils.customFieldCreators);
|
|
36
36
|
const nameRef = React.useRef(null);
|
|
37
37
|
const optionsRef = React.useRef(null);
|
|
38
|
-
return (_jsxs(Grid, { container: true, spacing: 2, marginTop: 1, children: [_jsx(Grid, { size: { xs: 12, sm: 6 }, children: _jsx(ComboBox, { name: "type", label: labels.type, inputRequired: true, size: "small", loadData: () => Promise.resolve(types.map((t) => ({ id: t, label: t }))), onValueChange: (item) => {
|
|
38
|
+
return (_jsxs(Grid, { container: true, spacing: 2, sx: { marginTop: 1 }, children: [_jsx(Grid, { size: { xs: 12, sm: 6 }, children: _jsx(ComboBox, { name: "type", label: labels.type, inputRequired: true, size: "small", loadData: () => Promise.resolve(types.map((t) => ({ id: t, label: t }))), onValueChange: (item) => {
|
|
39
39
|
const type = item?.id;
|
|
40
40
|
optionsRef.current.disabled =
|
|
41
41
|
type !== "combobox" &&
|
|
@@ -159,7 +159,7 @@ function InputUIs({ source, onChange }) {
|
|
|
159
159
|
console.error("Failed to parse source:", error);
|
|
160
160
|
}
|
|
161
161
|
}, [source]);
|
|
162
|
-
return (_jsxs(React.Fragment, { children: [_jsxs(HBox, {
|
|
162
|
+
return (_jsxs(React.Fragment, { children: [_jsxs(HBox, { spacing: 1, sx: { marginTop: 0.5, alignItems: "center" }, children: [_jsx(Typography, { children: labels.sortTip }), _jsx(Button, { size: "small", color: "primary", variant: "outlined", startIcon: _jsx(AddIcon, {}), onClick: () => editItem(), children: labels.add })] }), _jsx(Card, { children: _jsx(CardContent, { children: _jsx(Grid, { container: true, spacing: 0, children: _jsx(DnDSortableList, { items: items, idField: (item) => item.name, labelField: (item) => item.label || item.name, onChange: (items) => doChange(items), itemRenderer: (data, style, { sortable: { index }, ref, handleRef }) => (_jsxs(Grid, { container: true, size: { xs: 12, sm: 12 }, ref: ref, style: style, spacing: 1, children: [_jsx(Grid, { size: smallSize, children: _jsx(IconButton, { style: { cursor: "move" }, size: "small", title: labels.dragIndicator, ref: handleRef, children: _jsx(DragIndicatorIcon, {}) }) }), _jsxs(Grid, { size: size, children: [index + 1, " - ", data.type, " / ", data.space] }), _jsxs(Grid, { size: size, children: [data.name, " - ", data.label] }), _jsxs(Grid, { size: smallSize, children: [_jsx(IconButton, { size: "small", title: labels.delete, onClick: () => doChange(items.filter((item) => item.name !== data.name)), children: _jsx(DeleteIcon, {}) }), _jsx(IconButton, { size: "small", title: labels.edit, onClick: () => editItem(data), children: _jsx(EditIcon, {}) })] })] })) }) }) }) })] }));
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
165
|
* Custom attribute area
|
|
@@ -39,7 +39,8 @@ export function CustomFieldViewer(props) {
|
|
|
39
39
|
if (data == null || typeof data !== "object" || Array.isArray(data)) {
|
|
40
40
|
throw new Error("Invalid JSON data");
|
|
41
41
|
}
|
|
42
|
-
return (_jsx(Grid, { container: true,
|
|
42
|
+
return (_jsx(Grid, { container: true, spacing: spacing, sx: {
|
|
43
|
+
justifyContent: "left",
|
|
43
44
|
".MuiTypography-subtitle2": {
|
|
44
45
|
fontWeight: "bold"
|
|
45
46
|
}
|
|
@@ -50,6 +51,6 @@ export function CustomFieldViewer(props) {
|
|
|
50
51
|
return;
|
|
51
52
|
// Field value
|
|
52
53
|
const value = Utils.getNestedValue(data, name);
|
|
53
|
-
return (_jsx(Grid, { size: CustomFieldUtils.transformSpace(field.space), ...field.gridItemProps, children: _jsxs(VBox, {
|
|
54
|
+
return (_jsx(Grid, { size: CustomFieldUtils.transformSpace(field.space), ...field.gridItemProps, children: _jsxs(VBox, { spacing: verticalGap, children: [_jsx(Typography, { component: "div", fontWeight: "bold", fontSize: "small", ...titleProps, children: field.label ?? name }), _jsx(Typography, { ...valueProps, children: valueLabelFormatter(value, field) })] }) }, name ?? index));
|
|
54
55
|
}) }));
|
|
55
56
|
}
|
|
@@ -71,7 +71,8 @@ export function CustomFieldWindow(props) {
|
|
|
71
71
|
}
|
|
72
72
|
}, {
|
|
73
73
|
fullScreen: app.smDown,
|
|
74
|
-
inputs: (_jsx(Stack, { marginTop: 1.5, children: _jsx(Grid, { container: true,
|
|
74
|
+
inputs: (_jsx(Stack, { sx: { marginTop: 1.5 }, children: _jsx(Grid, { container: true, spacing: spacing, sx: {
|
|
75
|
+
justifyContent: "left",
|
|
75
76
|
".MuiTypography-subtitle2": {
|
|
76
77
|
fontWeight: "bold"
|
|
77
78
|
}
|
|
@@ -46,5 +46,5 @@ export const FieldJson = ({ field, mref, onChange, defaultValue }) => {
|
|
|
46
46
|
if (!name) {
|
|
47
47
|
return (_jsxs(Typography, { children: ["No name for FieldJson ", JSON.stringify(field)] }));
|
|
48
48
|
}
|
|
49
|
-
return (_jsx(InputField, { label: field.label ?? "", helperText: field.helperText, name: name, fullWidth: true, multiline: true, rows: 4,
|
|
49
|
+
return (_jsx(InputField, { label: field.label ?? "", helperText: field.helperText, name: name, fullWidth: true, multiline: true, rows: 4, slotProps: { htmlInput: { maxLength: 1280 } }, inputRef: inputRef, onChange: () => onChange(name, getValue()), ...field.mainSlotProps }));
|
|
50
50
|
};
|
|
@@ -24,5 +24,5 @@ export const FieldTexarea = ({ field, mref, onChange, defaultValue }) => {
|
|
|
24
24
|
if (!name) {
|
|
25
25
|
return (_jsxs(Typography, { children: ["No name for FieldTextarea ", JSON.stringify(field)] }));
|
|
26
26
|
}
|
|
27
|
-
return (_jsx(InputField, { label: field.label ?? "", helperText: field.helperText, name: name, fullWidth: true, multiline: true, rows: 4,
|
|
27
|
+
return (_jsx(InputField, { label: field.label ?? "", helperText: field.helperText, name: name, fullWidth: true, multiline: true, rows: 4, slotProps: { htmlInput: { maxLength: 1280 } }, inputRef: inputRef, defaultValue: defaultValue, onChange: () => onChange(name, getValue()), ...field.mainSlotProps }));
|
|
28
28
|
};
|
package/lib/mjs/index.d.ts
CHANGED
package/lib/mjs/index.js
CHANGED
|
@@ -17,7 +17,9 @@ export function EditPage(props) {
|
|
|
17
17
|
const { children, isEditing, onDelete, onSubmit, paddings = MUGlobal.pagePaddings, scrollContainer = globalThis, supportBack = true, submitDisabled = false, bottomPart, topPart, operationMessageHandler, gridSpacing = MUGlobal.pagePaddings, ...rest } = props;
|
|
18
18
|
// Labels
|
|
19
19
|
const labels = Labels.CommonPage;
|
|
20
|
-
return (_jsxs(CommonPage, { paddings: paddings, scrollContainer: scrollContainer, ...rest, children: [operationMessageHandler && (_jsx(OperationMessageContainer, { handler: operationMessageHandler })), topPart, _jsxs("form", { onSubmit: onSubmit, children: [_jsx(Grid, { container: true, justifyContent: "left",
|
|
20
|
+
return (_jsxs(CommonPage, { paddings: paddings, scrollContainer: scrollContainer, ...rest, children: [operationMessageHandler && (_jsx(OperationMessageContainer, { handler: operationMessageHandler })), topPart, _jsxs("form", { onSubmit: onSubmit, children: [_jsx(Grid, { container: true, spacing: gridSpacing, sx: { justifyContent: "left", paddingTop: 1 }, children: children }), _jsxs(Grid, { container: true, spacing: gridSpacing, sx: {
|
|
21
|
+
position: "sticky",
|
|
22
|
+
display: "flex",
|
|
21
23
|
top: "auto",
|
|
22
24
|
bottom: (theme) => MUGlobal.updateWithTheme(gridSpacing, theme.spacing),
|
|
23
25
|
paddingTop: gridSpacing
|
|
@@ -17,8 +17,14 @@ import Stack from "@mui/material/Stack";
|
|
|
17
17
|
* @returns Component
|
|
18
18
|
*/
|
|
19
19
|
export function ViewPageActionBar(props) {
|
|
20
|
-
const { actionPaddings = MUGlobal.pagePaddings, ...rest } = props;
|
|
21
|
-
return (_jsx(Stack, { className: "ET-ViewPage-Actions", direction: "row",
|
|
20
|
+
const { actionPaddings = MUGlobal.pagePaddings, sx, ...rest } = props;
|
|
21
|
+
return (_jsx(Stack, { className: "ET-ViewPage-Actions", direction: "row", spacing: actionPaddings, sx: {
|
|
22
|
+
flexWrap: "wrap",
|
|
23
|
+
justifyContent: "center",
|
|
24
|
+
paddingTop: actionPaddings,
|
|
25
|
+
paddingBottom: actionPaddings,
|
|
26
|
+
...sx
|
|
27
|
+
}, ...rest }));
|
|
22
28
|
}
|
|
23
29
|
/**
|
|
24
30
|
* View page
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.42",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -40,23 +40,23 @@
|
|
|
40
40
|
"@dnd-kit/react": "^0.3.2",
|
|
41
41
|
"@emotion/react": "^11.14.0",
|
|
42
42
|
"@emotion/styled": "^11.14.1",
|
|
43
|
-
"@etsoo/appscript": "^1.6.
|
|
44
|
-
"@etsoo/notificationbase": "^1.1.
|
|
45
|
-
"@etsoo/react": "^1.8.
|
|
46
|
-
"@etsoo/shared": "^1.2.
|
|
47
|
-
"@mui/icons-material": "^
|
|
48
|
-
"@mui/material": "^
|
|
49
|
-
"@mui/x-data-grid": "^
|
|
43
|
+
"@etsoo/appscript": "^1.6.60",
|
|
44
|
+
"@etsoo/notificationbase": "^1.1.69",
|
|
45
|
+
"@etsoo/react": "^1.8.84",
|
|
46
|
+
"@etsoo/shared": "^1.2.82",
|
|
47
|
+
"@mui/icons-material": "^9.0.0",
|
|
48
|
+
"@mui/material": "^9.0.0",
|
|
49
|
+
"@mui/x-data-grid": "^9.0.1",
|
|
50
50
|
"chart.js": "^4.5.1",
|
|
51
51
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
52
52
|
"dompurify": "^3.3.3",
|
|
53
53
|
"eventemitter3": "^5.0.4",
|
|
54
54
|
"pica": "^9.0.1",
|
|
55
55
|
"pulltorefreshjs": "^0.1.22",
|
|
56
|
-
"react": "^19.2.
|
|
57
|
-
"react-avatar-editor": "^
|
|
56
|
+
"react": "^19.2.5",
|
|
57
|
+
"react-avatar-editor": "^15.1.0",
|
|
58
58
|
"react-chartjs-2": "^5.3.1",
|
|
59
|
-
"react-dom": "^19.2.
|
|
59
|
+
"react-dom": "^19.2.5",
|
|
60
60
|
"react-draggable": "^4.5.0",
|
|
61
61
|
"react-imask": "7.6.1"
|
|
62
62
|
},
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"@types/react-dom": "^19.2.3",
|
|
81
81
|
"@types/react-input-mask": "^3.0.6",
|
|
82
82
|
"@vitejs/plugin-react": "^6.0.1",
|
|
83
|
-
"jsdom": "^29.0.
|
|
84
|
-
"typescript": "^
|
|
85
|
-
"vitest": "^4.1.
|
|
83
|
+
"jsdom": "^29.0.2",
|
|
84
|
+
"typescript": "^6.0.2",
|
|
85
|
+
"vitest": "^4.1.4"
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Button, { ButtonProps } from "@mui/material/Button";
|
|
2
2
|
import Chip from "@mui/material/Chip";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { IdType } from "@etsoo/shared";
|
|
5
5
|
import Grid, { GridSize } from "@mui/material/Grid";
|
|
6
6
|
import Typography from "@mui/material/Typography";
|
|
7
7
|
import DragIndicatorIcon from "@mui/icons-material/DragIndicator";
|
|
@@ -168,7 +168,7 @@ function ButtonPopupList<D extends DnDItemType>(
|
|
|
168
168
|
}, [value]);
|
|
169
169
|
|
|
170
170
|
return (
|
|
171
|
-
<VBox
|
|
171
|
+
<VBox spacing={2}>
|
|
172
172
|
<DnDSortableList<D>
|
|
173
173
|
component={Grid}
|
|
174
174
|
componentProps={{ container: true, spacing: 0 }}
|
|
@@ -188,12 +188,14 @@ function ButtonPopupList<D extends DnDItemType>(
|
|
|
188
188
|
) => (
|
|
189
189
|
<Grid
|
|
190
190
|
size={itemSize}
|
|
191
|
-
|
|
192
|
-
justifyContent="flex-start"
|
|
193
|
-
alignItems="center"
|
|
194
|
-
gap={1}
|
|
191
|
+
spacing={1}
|
|
195
192
|
ref={ref}
|
|
196
|
-
style={
|
|
193
|
+
style={{
|
|
194
|
+
display: "flex",
|
|
195
|
+
alignItems: "center",
|
|
196
|
+
justifyContent: "flex-start",
|
|
197
|
+
...style
|
|
198
|
+
}}
|
|
197
199
|
>
|
|
198
200
|
<IconButton
|
|
199
201
|
style={{ cursor: "move" }}
|
|
@@ -226,7 +228,7 @@ function ButtonPopupList<D extends DnDItemType>(
|
|
|
226
228
|
mRef={dndRef}
|
|
227
229
|
></DnDSortableList>
|
|
228
230
|
{onAdd && (
|
|
229
|
-
<HBox
|
|
231
|
+
<HBox spacing={1}>
|
|
230
232
|
<TextField
|
|
231
233
|
variant="outlined"
|
|
232
234
|
label={labels?.more}
|