@etsoo/materialui 1.6.40 → 1.6.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/__tests__/SwitchAnt.tsx +6 -7
  2. package/lib/cjs/ButtonPopupCheckbox.js +8 -3
  3. package/lib/cjs/ButtonPopupRadio.js +6 -2
  4. package/lib/cjs/ComboBox.js +7 -5
  5. package/lib/cjs/ComboBoxMultiple.js +5 -3
  6. package/lib/cjs/DataGridEx.js +25 -6
  7. package/lib/cjs/DataSteps.js +21 -11
  8. package/lib/cjs/FileUploadButton.js +5 -1
  9. package/lib/cjs/FlexBox.d.ts +2 -2
  10. package/lib/cjs/FlexBox.js +3 -2
  11. package/lib/cjs/InputField.js +3 -4
  12. package/lib/cjs/MoreFab.js +1 -1
  13. package/lib/cjs/NotifierMU.js +12 -5
  14. package/lib/cjs/OptionGroup.js +1 -1
  15. package/lib/cjs/OptionGroupFlag.js +1 -1
  16. package/lib/cjs/QuickList.js +3 -3
  17. package/lib/cjs/ResponsibleContainer.js +9 -5
  18. package/lib/cjs/SearchBar.d.ts +1 -1
  19. package/lib/cjs/SearchBar.js +13 -6
  20. package/lib/cjs/SearchField.js +8 -9
  21. package/lib/cjs/SwitchAnt.js +2 -2
  22. package/lib/cjs/SwitchField.js +1 -1
  23. package/lib/cjs/TextFieldEx.js +6 -11
  24. package/lib/cjs/Tiplist.js +2 -2
  25. package/lib/cjs/TiplistPro.js +1 -1
  26. package/lib/cjs/TwoFieldInput.d.ts +1 -1
  27. package/lib/cjs/TwoFieldInput.js +12 -7
  28. package/lib/cjs/UserAvatarEditor.js +2 -2
  29. package/lib/cjs/ViewContainer.js +2 -2
  30. package/lib/cjs/custom/CustomAttributeArea.js +2 -2
  31. package/lib/cjs/custom/CustomFieldViewer.js +3 -2
  32. package/lib/cjs/custom/CustomFieldWindow.js +2 -1
  33. package/lib/cjs/custom/FieldJson.js +1 -1
  34. package/lib/cjs/custom/FieldTexarea.js +1 -1
  35. package/lib/cjs/index.d.ts +1 -0
  36. package/lib/cjs/index.js +7 -0
  37. package/lib/cjs/pages/EditPage.js +3 -1
  38. package/lib/cjs/pages/ViewPage.js +8 -2
  39. package/lib/mjs/ButtonPopupCheckbox.js +8 -3
  40. package/lib/mjs/ButtonPopupRadio.js +6 -2
  41. package/lib/mjs/ComboBox.js +7 -5
  42. package/lib/mjs/ComboBoxMultiple.js +5 -3
  43. package/lib/mjs/DataGridEx.js +25 -6
  44. package/lib/mjs/DataSteps.js +21 -11
  45. package/lib/mjs/FileUploadButton.js +5 -1
  46. package/lib/mjs/FlexBox.d.ts +2 -2
  47. package/lib/mjs/FlexBox.js +3 -2
  48. package/lib/mjs/InputField.js +3 -4
  49. package/lib/mjs/MoreFab.js +1 -1
  50. package/lib/mjs/NotifierMU.js +12 -5
  51. package/lib/mjs/OptionGroup.js +1 -1
  52. package/lib/mjs/OptionGroupFlag.js +1 -1
  53. package/lib/mjs/QuickList.js +3 -3
  54. package/lib/mjs/ResponsibleContainer.js +9 -5
  55. package/lib/mjs/SearchBar.d.ts +1 -1
  56. package/lib/mjs/SearchBar.js +13 -6
  57. package/lib/mjs/SearchField.js +8 -9
  58. package/lib/mjs/SwitchAnt.js +2 -2
  59. package/lib/mjs/SwitchField.js +1 -1
  60. package/lib/mjs/TextFieldEx.js +6 -11
  61. package/lib/mjs/Tiplist.js +2 -2
  62. package/lib/mjs/TiplistPro.js +1 -1
  63. package/lib/mjs/TwoFieldInput.d.ts +1 -1
  64. package/lib/mjs/TwoFieldInput.js +12 -7
  65. package/lib/mjs/UserAvatarEditor.js +2 -2
  66. package/lib/mjs/ViewContainer.js +2 -2
  67. package/lib/mjs/custom/CustomAttributeArea.js +2 -2
  68. package/lib/mjs/custom/CustomFieldViewer.js +3 -2
  69. package/lib/mjs/custom/CustomFieldWindow.js +2 -1
  70. package/lib/mjs/custom/FieldJson.js +1 -1
  71. package/lib/mjs/custom/FieldTexarea.js +1 -1
  72. package/lib/mjs/index.d.ts +1 -0
  73. package/lib/mjs/index.js +2 -0
  74. package/lib/mjs/pages/EditPage.js +3 -1
  75. package/lib/mjs/pages/ViewPage.js +8 -2
  76. package/package.json +8 -8
  77. package/src/ButtonPopupCheckbox.tsx +10 -8
  78. package/src/ButtonPopupRadio.tsx +8 -6
  79. package/src/ComboBox.tsx +7 -5
  80. package/src/ComboBoxMultiple.tsx +5 -3
  81. package/src/ComboBoxPro.tsx +1 -1
  82. package/src/CultureDataTable.tsx +1 -1
  83. package/src/DataGridEx.tsx +27 -20
  84. package/src/DataSteps.tsx +27 -22
  85. package/src/FileUploadButton.tsx +6 -5
  86. package/src/FlexBox.tsx +7 -7
  87. package/src/InputField.tsx +2 -5
  88. package/src/MoreFab.tsx +8 -8
  89. package/src/NotifierMU.tsx +12 -12
  90. package/src/NumberInputField.tsx +1 -0
  91. package/src/OptionGroup.tsx +3 -5
  92. package/src/OptionGroupFlag.tsx +3 -5
  93. package/src/QuickList.tsx +4 -4
  94. package/src/ResponsibleContainer.tsx +8 -6
  95. package/src/SearchBar.tsx +19 -12
  96. package/src/SearchField.tsx +8 -14
  97. package/src/SwitchAnt.tsx +2 -2
  98. package/src/SwitchField.tsx +1 -3
  99. package/src/TextFieldEx.tsx +32 -36
  100. package/src/Tiplist.tsx +2 -2
  101. package/src/TiplistPro.tsx +2 -2
  102. package/src/TwoFieldInput.tsx +33 -31
  103. package/src/UserAvatarEditor.tsx +2 -3
  104. package/src/ViewContainer.tsx +6 -2
  105. package/src/custom/CustomAttributeArea.tsx +3 -3
  106. package/src/custom/CustomFieldViewer.tsx +8 -3
  107. package/src/custom/CustomFieldWindow.tsx +4 -4
  108. package/src/custom/FieldJson.tsx +3 -3
  109. package/src/custom/FieldTexarea.tsx +1 -1
  110. package/src/index.ts +3 -0
  111. package/src/pages/EditPage.tsx +4 -5
  112. package/src/pages/ViewPage.tsx +11 -8
@@ -80,7 +80,7 @@ export function MoreFab(props) {
80
80
  const hasIcon = actionsLocal.some((action) => action.icon != null);
81
81
  // Main
82
82
  const main = iconButton ? (_jsx(IconButton, { color: color, size: size, title: title, onClick: handleClick, children: icon })) : (_jsx(Fab, { color: color, size: size, title: title, onClick: handleClick, children: icon }));
83
- return (_jsxs(React.Fragment, { children: [main, _jsx(Menu, { disableScrollLock: true, anchorEl: anchorEl, anchorOrigin: anchorOrigin, keepMounted: true, transformOrigin: transformOrigin, open: open, onClose: handleClose, PaperProps: PaperProps, children: actionsLocal.map(({ label, icon, action }, index) => label === "-" ? (_jsx(Divider, {}, index)) : (_jsxs(MenuItem, { ...(typeof action === "string"
83
+ return (_jsxs(React.Fragment, { children: [main, _jsx(Menu, { disableScrollLock: true, anchorEl: anchorEl, anchorOrigin: anchorOrigin, keepMounted: true, transformOrigin: transformOrigin, open: open, onClose: handleClose, slotProps: { paper: PaperProps }, children: actionsLocal.map(({ label, icon, action }, index) => label === "-" ? (_jsx(Divider, {}, index)) : (_jsxs(MenuItem, { ...(typeof action === "string"
84
84
  ? action.includes("://")
85
85
  ? {
86
86
  component: "a",
@@ -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, { variant: "caption", display: "block", ref: errorRef, color: "error" })] }), _jsx(DialogActions, { children: buttons ? (buttons(this, handleSubmit)) : (_jsxs(React.Fragment, { children: [cancelButton && (_jsx(Button, { color: "secondary", onClick: () => {
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, { variant: "caption", display: "block", ref: errorRef, color: "error" })] }), _jsx(DialogActions, { children: buttons ? (buttons(this, handleSubmit)) : (_jsxs(React.Fragment, { children: [cancelButton && (_jsx(Button, { color: "secondary", onClick: () => {
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, { display: "flex", flexDirection: "column", flexWrap: "nowrap", alignItems: "center", sx: {
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, { display: "flex", flexDirection: "column", flexWrap: "nowrap", sx: {
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
  }
@@ -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
  }
@@ -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"), gap = 1, height = "480px", onItemClick, ...rest } = props;
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, { gap: gap, height: height, ...rest, children: [_jsx(InputField, { label: label, onChangeDelay: (event) => {
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, { textAlign: "center", children: noMatchesLabel })) : (_jsx(List, { children: items.map((item) => (_jsx(ListItem, { disablePadding: true, ...itemProps, children: _jsx(ListItemButton, { onClick: (event) => {
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)
@@ -67,8 +67,9 @@ export function ResponsibleContainer(props) {
67
67
  // Search data
68
68
  const searchData = useSearchParamsWithCache(cacheKey);
69
69
  // On submit callback
70
- const onSubmit = (data, _reset) => {
71
- if (data == null || state.ref == null)
70
+ // Current UI may be rendered but the search bar rerendered with new data, check init to avoid reset and load new data
71
+ const onSubmit = (data, _reset, init) => {
72
+ if (data == null || state.ref == null || (state.mounted && init))
72
73
  return;
73
74
  state.ref.reset({ data });
74
75
  };
@@ -131,8 +132,8 @@ export function ResponsibleContainer(props) {
131
132
  if (!hasFields || rect?.width == null || rect.width < 20)
132
133
  return;
133
134
  const f = typeof fields == "function" ? fields(searchData) : fields;
134
- return (_jsx(SearchBar, { fields: f, onSubmit: onSubmit, className: `searchBar${showDataGrid ? "Grid" : "List"}`, width: rect.width, top: searchBarTop }));
135
- }, [showDataGrid, hasFields, searchBarHeight, rect?.width]);
135
+ return (_jsx(SearchBar, { fields: f, onSubmit: onSubmit, className: `searchBar${showDataGrid ? "Grid" : "List"}`, width: rect.width, top: searchBarTop, autoSubmitDelay: rest.autoLoad === false ? 0 : undefined }));
136
+ }, [showDataGrid, hasFields, searchBarHeight, rect?.width, rest.autoLoad]);
136
137
  // Pull container
137
138
  const pullContainer = showDataGrid
138
139
  ? ".DataGridEx-Body"
@@ -141,8 +142,11 @@ export function ResponsibleContainer(props) {
141
142
  return (_jsxs(Box, { sx: containerBoxSx == null
142
143
  ? undefined
143
144
  : containerBoxSx(paddings, hasFields, showDataGrid), children: [_jsxs(Stack, { children: [_jsx(Box, { ref: dimensions[0][0], className: "SearchBox", sx: {
145
+ marginBottom: hasFields
146
+ ? `${searchBarBottom}px!important`
147
+ : undefined,
144
148
  height: hasFields ? searchBarHeight : 0
145
- }, marginBottom: hasFields ? `${searchBarBottom}px!important` : undefined, 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: () => {
149
+ }, 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
150
  const container = document.querySelector(pullContainer);
147
151
  return !container?.scrollTop;
148
152
  } }))] }));
@@ -26,7 +26,7 @@ export interface SearchBarProps {
26
26
  /**
27
27
  * On submit callback
28
28
  */
29
- onSubmit: (data: FormData, reset: boolean) => void | PromiseLike<void>;
29
+ onSubmit: (data: FormData, reset: boolean, init: boolean) => void | PromiseLike<void>;
30
30
  /**
31
31
  * Top position, true means Toolbar's height
32
32
  */
@@ -210,13 +210,13 @@ export function SearchBar(props) {
210
210
  delayed.call();
211
211
  };
212
212
  // Submit at once
213
- const handleSubmitInstant = (reset = false) => {
213
+ const handleSubmitInstant = (reset = false, init = false) => {
214
214
  // Prepare data
215
215
  const data = new FormData(state.form);
216
216
  if (state.moreForm != null) {
217
217
  DomUtils.mergeFormData(data, new FormData(state.moreForm));
218
218
  }
219
- onSubmit(data, reset);
219
+ onSubmit(data, reset, init);
220
220
  };
221
221
  const delayed = useDelayedExecutor(handleSubmitInstant, 480);
222
222
  // Reset
@@ -231,8 +231,8 @@ export function SearchBar(props) {
231
231
  };
232
232
  React.useEffect(() => {
233
233
  // Delayed way
234
- if (autoSubmitDelay > 0) {
235
- delayed.call(autoSubmitDelay);
234
+ if (autoSubmitDelay > 10) {
235
+ delayed.call(autoSubmitDelay, false, true);
236
236
  }
237
237
  return () => {
238
238
  delayed.clear();
@@ -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", justifyContent: "center", alignItems: "center", direction: "row", spacing: `${itemGap}px`, width: width, overflow: "hidden", paddingTop: "6px", sx: {
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", alignItems: "stretch", spacing: 2, padding: 2, sx: {
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
  }
@@ -10,14 +10,8 @@ import TextField from "@mui/material/TextField";
10
10
  */
11
11
  export function SearchField(props) {
12
12
  // Destruct
13
- const { changeDelay, InputLabelProps = {}, InputProps = {}, inputProps = {}, onChange, readOnly, size = MUGlobal.searchFieldSize, variant = MUGlobal.searchFieldVariant, minChars = 0, ...rest } = props;
14
- // Shrink
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, { InputLabelProps: InputLabelProps, InputProps: InputProps, inputProps: inputProps, onChange: onChangeEx, size: size, variant: variant, ...rest }));
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
  }
@@ -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, inputRef: ref, value: value, onChange: onChangeLocal, ...rest }), _jsx(Typography, { onClick: () => !controlChecked && ref.current?.click(), sx: {
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
@@ -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
  }
@@ -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, InputLabelProps = {}, InputProps = {}, slotProps, onChange, onClear, onKeyDown, onEnter, onVisibility, inputRef, readOnly, showClear, showPassword, type, variant = MUGlobal.textFieldVariant, mRef, ...rest } = props;
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: { readOnly, ...input, ...InputProps },
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
@@ -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.inputProps, {
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
@@ -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, "InputProps" | "value"> & {
6
+ export type TwoFieldInputProps = Omit<InputFieldProps, "value"> & {
7
7
  /**
8
8
  * Values
9
9
  */
@@ -13,7 +13,8 @@ import Input from "@mui/material/Input";
13
13
  */
14
14
  export function TwoFieldInput(props) {
15
15
  // Destruct
16
- const { name, inputProps, type = inputProps?.inputMode, values, onValuesChange, onChange, onInput, ...rest } = props;
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], inputProps: inputProps, InputProps: {
58
- endAdornment: (_jsxs(InputAdornment, { position: "end", sx: {
59
- display: "flex",
60
- alignItems: "center",
61
- gap: 1
62
- }, children: [_jsx(ArrowRightAltIcon, {}), _jsx(Input, { type: type, name: `${name}-end`, value: formatValue(localValues[1], type), disableUnderline: true, onInput: onInput, onChange: handleChange, inputProps: inputProps })] }))
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
  }
@@ -166,6 +166,6 @@ export function UserAvatarEditor(props) {
166
166
  }
167
167
  }
168
168
  };
169
- 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(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: { 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 })] }));
171
171
  }
@@ -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, justifyContent: "left", className: "ET-ViewContainer", ref: gridRef, spacing: spacing, 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)] }));
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, { marginBottom: 0.5, gap: 1, 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, gap: 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, {}) })] })] })) }) }) }) })] }));
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, justifyContent: "left", spacing: spacing, sx: {
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, { gap: verticalGap, children: [_jsx(Typography, { fontWeight: "bold", fontSize: "small", ...titleProps, children: field.label ?? name }), _jsx(Typography, { ...valueProps, children: valueLabelFormatter(value, field) })] }) }, name ?? index));
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, justifyContent: "left", spacing: spacing, sx: {
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, inputProps: { maxLength: 1280 }, inputRef: inputRef, onChange: () => onChange(name, getValue()), ...field.mainSlotProps }));
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, inputProps: { maxLength: 1280 }, inputRef: inputRef, defaultValue: defaultValue, onChange: () => onChange(name, getValue()), ...field.mainSlotProps }));
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
  };
@@ -134,3 +134,4 @@ export * from "./TooltipClick";
134
134
  export * from "./UserAvatar";
135
135
  export * from "./UserAvatarEditor";
136
136
  export * from "./ViewContainer";
137
+ export { default as AccountTreeIcon } from "@mui/icons-material/AccountTree";
package/lib/mjs/index.js CHANGED
@@ -134,3 +134,5 @@ export * from "./TooltipClick";
134
134
  export * from "./UserAvatar";
135
135
  export * from "./UserAvatarEditor";
136
136
  export * from "./ViewContainer";
137
+ // Icons
138
+ export { default as AccountTreeIcon } from "@mui/icons-material/AccountTree";
@@ -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", spacing: gridSpacing, paddingTop: 1, children: children }), _jsxs(Grid, { container: true, position: "sticky", display: "flex", gap: gridSpacing, sx: {
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", width: "100%", flexWrap: "wrap", justifyContent: "center", paddingTop: actionPaddings, paddingBottom: actionPaddings, gap: actionPaddings, ...rest }));
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.40",
3
+ "version": "1.6.43",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -44,19 +44,19 @@
44
44
  "@etsoo/notificationbase": "^1.1.69",
45
45
  "@etsoo/react": "^1.8.84",
46
46
  "@etsoo/shared": "^1.2.82",
47
- "@mui/icons-material": "^7.3.9",
48
- "@mui/material": "^7.3.9",
49
- "@mui/x-data-grid": "^8.28.2",
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.4",
56
+ "react": "^19.2.5",
57
57
  "react-avatar-editor": "^15.1.0",
58
58
  "react-chartjs-2": "^5.3.1",
59
- "react-dom": "^19.2.4",
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.1",
83
+ "jsdom": "^29.0.2",
84
84
  "typescript": "^6.0.2",
85
- "vitest": "^4.1.2"
85
+ "vitest": "^4.1.4"
86
86
  }
87
87
  }