@etsoo/materialui 1.6.40 → 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.
Files changed (110) 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 +4 -1
  18. package/lib/cjs/SearchBar.js +9 -2
  19. package/lib/cjs/SearchField.js +8 -9
  20. package/lib/cjs/SwitchAnt.js +2 -2
  21. package/lib/cjs/SwitchField.js +1 -1
  22. package/lib/cjs/TextFieldEx.js +6 -11
  23. package/lib/cjs/Tiplist.js +2 -2
  24. package/lib/cjs/TiplistPro.js +1 -1
  25. package/lib/cjs/TwoFieldInput.d.ts +1 -1
  26. package/lib/cjs/TwoFieldInput.js +12 -7
  27. package/lib/cjs/UserAvatarEditor.js +2 -2
  28. package/lib/cjs/ViewContainer.js +2 -2
  29. package/lib/cjs/custom/CustomAttributeArea.js +2 -2
  30. package/lib/cjs/custom/CustomFieldViewer.js +3 -2
  31. package/lib/cjs/custom/CustomFieldWindow.js +2 -1
  32. package/lib/cjs/custom/FieldJson.js +1 -1
  33. package/lib/cjs/custom/FieldTexarea.js +1 -1
  34. package/lib/cjs/index.d.ts +1 -0
  35. package/lib/cjs/index.js +7 -0
  36. package/lib/cjs/pages/EditPage.js +3 -1
  37. package/lib/cjs/pages/ViewPage.js +8 -2
  38. package/lib/mjs/ButtonPopupCheckbox.js +8 -3
  39. package/lib/mjs/ButtonPopupRadio.js +6 -2
  40. package/lib/mjs/ComboBox.js +7 -5
  41. package/lib/mjs/ComboBoxMultiple.js +5 -3
  42. package/lib/mjs/DataGridEx.js +25 -6
  43. package/lib/mjs/DataSteps.js +21 -11
  44. package/lib/mjs/FileUploadButton.js +5 -1
  45. package/lib/mjs/FlexBox.d.ts +2 -2
  46. package/lib/mjs/FlexBox.js +3 -2
  47. package/lib/mjs/InputField.js +3 -4
  48. package/lib/mjs/MoreFab.js +1 -1
  49. package/lib/mjs/NotifierMU.js +12 -5
  50. package/lib/mjs/OptionGroup.js +1 -1
  51. package/lib/mjs/OptionGroupFlag.js +1 -1
  52. package/lib/mjs/QuickList.js +3 -3
  53. package/lib/mjs/ResponsibleContainer.js +4 -1
  54. package/lib/mjs/SearchBar.js +9 -2
  55. package/lib/mjs/SearchField.js +8 -9
  56. package/lib/mjs/SwitchAnt.js +2 -2
  57. package/lib/mjs/SwitchField.js +1 -1
  58. package/lib/mjs/TextFieldEx.js +6 -11
  59. package/lib/mjs/Tiplist.js +2 -2
  60. package/lib/mjs/TiplistPro.js +1 -1
  61. package/lib/mjs/TwoFieldInput.d.ts +1 -1
  62. package/lib/mjs/TwoFieldInput.js +12 -7
  63. package/lib/mjs/UserAvatarEditor.js +2 -2
  64. package/lib/mjs/ViewContainer.js +2 -2
  65. package/lib/mjs/custom/CustomAttributeArea.js +2 -2
  66. package/lib/mjs/custom/CustomFieldViewer.js +3 -2
  67. package/lib/mjs/custom/CustomFieldWindow.js +2 -1
  68. package/lib/mjs/custom/FieldJson.js +1 -1
  69. package/lib/mjs/custom/FieldTexarea.js +1 -1
  70. package/lib/mjs/index.d.ts +1 -0
  71. package/lib/mjs/index.js +2 -0
  72. package/lib/mjs/pages/EditPage.js +3 -1
  73. package/lib/mjs/pages/ViewPage.js +8 -2
  74. package/package.json +8 -8
  75. package/src/ButtonPopupCheckbox.tsx +10 -8
  76. package/src/ButtonPopupRadio.tsx +8 -6
  77. package/src/ComboBox.tsx +7 -5
  78. package/src/ComboBoxMultiple.tsx +5 -3
  79. package/src/ComboBoxPro.tsx +1 -1
  80. package/src/CultureDataTable.tsx +1 -1
  81. package/src/DataGridEx.tsx +27 -20
  82. package/src/DataSteps.tsx +27 -22
  83. package/src/FileUploadButton.tsx +6 -5
  84. package/src/FlexBox.tsx +7 -7
  85. package/src/InputField.tsx +2 -5
  86. package/src/MoreFab.tsx +8 -8
  87. package/src/NotifierMU.tsx +12 -12
  88. package/src/NumberInputField.tsx +1 -0
  89. package/src/OptionGroup.tsx +3 -5
  90. package/src/OptionGroupFlag.tsx +3 -5
  91. package/src/QuickList.tsx +4 -4
  92. package/src/ResponsibleContainer.tsx +3 -3
  93. package/src/SearchBar.tsx +7 -7
  94. package/src/SearchField.tsx +8 -14
  95. package/src/SwitchAnt.tsx +2 -2
  96. package/src/SwitchField.tsx +1 -3
  97. package/src/TextFieldEx.tsx +32 -36
  98. package/src/Tiplist.tsx +2 -2
  99. package/src/TiplistPro.tsx +2 -2
  100. package/src/TwoFieldInput.tsx +33 -31
  101. package/src/UserAvatarEditor.tsx +2 -3
  102. package/src/ViewContainer.tsx +6 -2
  103. package/src/custom/CustomAttributeArea.tsx +3 -3
  104. package/src/custom/CustomFieldViewer.tsx +8 -3
  105. package/src/custom/CustomFieldWindow.tsx +4 -4
  106. package/src/custom/FieldJson.tsx +3 -3
  107. package/src/custom/FieldTexarea.tsx +1 -1
  108. package/src/index.ts +3 -0
  109. package/src/pages/EditPage.tsx +4 -5
  110. package/src/pages/ViewPage.tsx +11 -8
@@ -62,7 +62,7 @@ function Tiplist(props) {
62
62
  }
63
63
  // https://stackoverflow.com/questions/15738259/disabling-chrome-autofill
64
64
  // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html
65
- Object.assign(params.inputProps, {
65
+ Object.assign(params.slotProps.htmlInput, {
66
66
  autoComplete: inputAutoComplete,
67
67
  "data-reset": inputReset
68
68
  });
@@ -176,7 +176,7 @@ function Tiplist(props) {
176
176
  };
177
177
  }, []);
178
178
  // Layout
179
- return ((0, jsx_runtime_1.jsxs)("div", { style: { flex: 2 }, children: [(0, jsx_runtime_1.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 }), (0, jsx_runtime_1.jsx)(Autocomplete_1.default, { filterOptions: (options, _state) => options, disabled: disabled, value: states.value, options: states.options, onChange: (event, value, reason, details) => {
179
+ return ((0, jsx_runtime_1.jsxs)("div", { style: { flex: 2 }, children: [(0, jsx_runtime_1.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 }), (0, jsx_runtime_1.jsx)(Autocomplete_1.default, { filterOptions: (options, _state) => options, disabled: disabled, value: states.value, options: states.options, onChange: (event, value, reason, details) => {
180
180
  // Set value
181
181
  setInputValue(value);
182
182
  // Custom
@@ -162,7 +162,7 @@ function TiplistPro(props) {
162
162
  };
163
163
  }, []);
164
164
  // Layout
165
- return ((0, jsx_runtime_1.jsxs)("div", { style: { flex: 2 }, children: [(0, jsx_runtime_1.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 }), (0, jsx_runtime_1.jsx)(Autocomplete_1.default, { filterOptions: (options, _state) => options, value: states.value, options: states.options, disabled: disabled, freeSolo: true, clearOnBlur: false, onChange: (event, value, reason, details) => {
165
+ return ((0, jsx_runtime_1.jsxs)("div", { style: { flex: 2 }, children: [(0, jsx_runtime_1.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 }), (0, jsx_runtime_1.jsx)(Autocomplete_1.default, { filterOptions: (options, _state) => options, value: states.value, options: states.options, disabled: disabled, freeSolo: true, clearOnBlur: false, onChange: (event, value, reason, details) => {
166
166
  if (typeof value === "object") {
167
167
  // Set value
168
168
  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
  */
@@ -19,7 +19,8 @@ const Input_1 = __importDefault(require("@mui/material/Input"));
19
19
  */
20
20
  function TwoFieldInput(props) {
21
21
  // Destruct
22
- const { name, inputProps, type = inputProps?.inputMode, values, onValuesChange, onChange, onInput, ...rest } = props;
22
+ const { name, slotProps, type, values, onValuesChange, onChange, onInput, ...rest } = props;
23
+ const { htmlInput, input, ...restSlotProps } = slotProps ?? {};
23
24
  // Local values
24
25
  const localValues = values == null
25
26
  ? [null, null]
@@ -60,11 +61,15 @@ function TwoFieldInput(props) {
60
61
  valueRef.current = localValues;
61
62
  }, [localValues]);
62
63
  // Layout
63
- return ((0, jsx_runtime_1.jsx)(InputField_1.InputField, { name: `${name}-start`, type: type, value: formatValue(localValues[0], type), ref: dimensions[0][0], inputProps: inputProps, InputProps: {
64
- endAdornment: ((0, jsx_runtime_1.jsxs)(InputAdornment_1.default, { position: "end", sx: {
65
- display: "flex",
66
- alignItems: "center",
67
- gap: 1
68
- }, children: [(0, jsx_runtime_1.jsx)(ArrowRightAlt_1.default, {}), (0, jsx_runtime_1.jsx)(Input_1.default, { type: type, name: `${name}-end`, value: formatValue(localValues[1], type), disableUnderline: true, onInput: onInput, onChange: handleChange, inputProps: inputProps })] }))
64
+ return ((0, jsx_runtime_1.jsx)(InputField_1.InputField, { name: `${name}-start`, type: type, value: formatValue(localValues[0], type), ref: dimensions[0][0], slotProps: {
65
+ input: {
66
+ ...input,
67
+ endAdornment: ((0, jsx_runtime_1.jsxs)(InputAdornment_1.default, { position: "end", sx: {
68
+ display: "flex",
69
+ alignItems: "center",
70
+ gap: 1
71
+ }, children: [(0, jsx_runtime_1.jsx)(ArrowRightAlt_1.default, {}), (0, jsx_runtime_1.jsx)(Input_1.default, { type: type, name: `${name}-end`, value: formatValue(localValues[1], type), disableUnderline: true, onInput: onInput, onChange: handleChange, slotProps: { input: htmlInput } })] }))
72
+ },
73
+ ...restSlotProps
69
74
  }, onInput: onInput, onChange: handleChange, ...rest }));
70
75
  }
@@ -172,6 +172,6 @@ function UserAvatarEditor(props) {
172
172
  }
173
173
  }
174
174
  };
175
- return ((0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "column", spacing: 0.5, width: containerWidth, children: [(0, jsx_runtime_1.jsx)(FileUploadButton_1.FileUploadButton, { variant: "outlined", size: "medium", startIcon: (0, jsx_runtime_1.jsx)(Image_1.default, {}), fullWidth: true, onUploadFiles: handleFileUpload, inputProps: { accept: "image/png, image/jpeg" }, children: selectFileLabel }), (0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "row", spacing: 0.5, children: [(0, jsx_runtime_1.jsx)(react_1.default.Suspense, { fallback: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { variant: "rounded", width: width, height: localHeight }), children: (0, jsx_runtime_1.jsx)(react_avatar_editor_1.default, { ref: ref, border: border, width: width, height: localHeight, onLoadSuccess: handleLoad, image: previewImage ??
176
- "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=", scale: editorState.scale, rotate: editorState.rotate }) }), (0, jsx_runtime_1.jsxs)(ButtonGroup_1.default, { size: "small", orientation: "vertical", disabled: !ready, children: [(0, jsx_runtime_1.jsx)(Button_1.default, { onClick: () => handleRotate(90), title: labels.rotateRight, children: (0, jsx_runtime_1.jsx)(RotateRight_1.default, {}) }), (0, jsx_runtime_1.jsx)(Button_1.default, { onClick: () => handleRotate(-90), title: labels.rotateLeft, children: (0, jsx_runtime_1.jsx)(RotateLeft_1.default, {}) }), (0, jsx_runtime_1.jsx)(Button_1.default, { onClick: handleReset, title: labels.reset, children: (0, jsx_runtime_1.jsx)(ClearAll_1.default, {}) })] })] }), (0, jsx_runtime_1.jsxs)(Stack_1.default, { spacing: 0.5, direction: "row", sx: { paddingBottom: 2 }, alignItems: "center", children: [(0, jsx_runtime_1.jsx)(IconButton_1.default, { size: "small", disabled: !ready || editorState.scale <= min, onClick: () => adjustScale(false), children: (0, jsx_runtime_1.jsx)(Remove_1.default, {}) }), (0, jsx_runtime_1.jsx)(Slider_1.default, { 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 }), (0, jsx_runtime_1.jsx)(IconButton_1.default, { size: "small", disabled: !ready || editorState.scale >= max, onClick: () => adjustScale(true), children: (0, jsx_runtime_1.jsx)(Add_1.default, {}) })] }), (0, jsx_runtime_1.jsx)(Button_1.default, { ref: buttonRef, variant: "contained", startIcon: (0, jsx_runtime_1.jsx)(Done_1.default, {}), disabled: !ready, onClick: handleDone, children: labels.done })] }));
175
+ return ((0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "column", spacing: 0.5, sx: { width: containerWidth }, children: [(0, jsx_runtime_1.jsx)(FileUploadButton_1.FileUploadButton, { variant: "outlined", size: "medium", startIcon: (0, jsx_runtime_1.jsx)(Image_1.default, {}), fullWidth: true, onUploadFiles: handleFileUpload, inputProps: { accept: "image/png, image/jpeg" }, children: selectFileLabel }), (0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "row", spacing: 0.5, children: [(0, jsx_runtime_1.jsx)(react_1.default.Suspense, { fallback: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { variant: "rounded", width: width, height: localHeight }), children: (0, jsx_runtime_1.jsx)(react_avatar_editor_1.default, { ref: ref, border: border, width: width, height: localHeight, onLoadSuccess: handleLoad, image: previewImage ??
176
+ "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=", scale: editorState.scale, rotate: editorState.rotate }) }), (0, jsx_runtime_1.jsxs)(ButtonGroup_1.default, { size: "small", orientation: "vertical", disabled: !ready, children: [(0, jsx_runtime_1.jsx)(Button_1.default, { onClick: () => handleRotate(90), title: labels.rotateRight, children: (0, jsx_runtime_1.jsx)(RotateRight_1.default, {}) }), (0, jsx_runtime_1.jsx)(Button_1.default, { onClick: () => handleRotate(-90), title: labels.rotateLeft, children: (0, jsx_runtime_1.jsx)(RotateLeft_1.default, {}) }), (0, jsx_runtime_1.jsx)(Button_1.default, { onClick: handleReset, title: labels.reset, children: (0, jsx_runtime_1.jsx)(ClearAll_1.default, {}) })] })] }), (0, jsx_runtime_1.jsxs)(Stack_1.default, { spacing: 0.5, direction: "row", sx: { alignItems: "center", paddingBottom: 2 }, children: [(0, jsx_runtime_1.jsx)(IconButton_1.default, { size: "small", disabled: !ready || editorState.scale <= min, onClick: () => adjustScale(false), children: (0, jsx_runtime_1.jsx)(Remove_1.default, {}) }), (0, jsx_runtime_1.jsx)(Slider_1.default, { 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 }), (0, jsx_runtime_1.jsx)(IconButton_1.default, { size: "small", disabled: !ready || editorState.scale >= max, onClick: () => adjustScale(true), children: (0, jsx_runtime_1.jsx)(Add_1.default, {}) })] }), (0, jsx_runtime_1.jsx)(Button_1.default, { ref: buttonRef, variant: "contained", startIcon: (0, jsx_runtime_1.jsx)(Done_1.default, {}), disabled: !ready, onClick: handleDone, children: labels.done })] }));
177
177
  }
@@ -164,7 +164,7 @@ function ViewPageGridItem(props) {
164
164
  options = getResp(singleRow ?? "small");
165
165
  }
166
166
  // Layout
167
- return ((0, jsx_runtime_1.jsxs)(Grid_1.default, { ...gridProps, ...options, children: [label != null && ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "caption", component: horizontal ? "span" : "div", children: label })), typeof data === "object" ? (data) : horizontal ? ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "subtitle2", component: "span", marginLeft: 0.5, children: data })) : ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "subtitle2", children: data }))] }));
167
+ return ((0, jsx_runtime_1.jsxs)(Grid_1.default, { ...gridProps, ...options, children: [label != null && ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "caption", component: horizontal ? "span" : "div", children: label })), typeof data === "object" ? (data) : horizontal ? ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "subtitle2", component: "span", sx: { marginLeft: 0.5 }, children: data })) : ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "subtitle2", children: data }))] }));
168
168
  }
169
169
  function ViewContainer(props) {
170
170
  // Global app
@@ -234,5 +234,5 @@ function ViewContainer(props) {
234
234
  }, [app, fields, data, bp]);
235
235
  let leftResult;
236
236
  // Layout
237
- return ((0, jsx_runtime_1.jsxs)(Grid_1.default, { container: true, justifyContent: "left", className: "ET-ViewContainer", ref: gridRef, spacing: spacing, children: [leftContainer && (leftResult = leftContainer(data)) != null && ((0, jsx_runtime_1.jsxs)(react_2.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(Grid_1.default, { container: true, className: "ET-ViewPage-LeftContainer", spacing: spacing, size: size, ...leftContainerPropsRest, children: leftResult }), (0, jsx_runtime_1.jsx)(Grid_1.default, { container: true, className: "ET-ViewPage-LeftOthers", spacing: spacing, size: ViewPageSize.matchSize(size), children: createFields(data, leftContainerLines * (12 - getItemSize(bp, size))) })] })), createFields(data)] }));
237
+ return ((0, jsx_runtime_1.jsxs)(Grid_1.default, { container: true, className: "ET-ViewContainer", ref: gridRef, spacing: spacing, sx: { justifyContent: "left" }, children: [leftContainer && (leftResult = leftContainer(data)) != null && ((0, jsx_runtime_1.jsxs)(react_2.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(Grid_1.default, { container: true, className: "ET-ViewPage-LeftContainer", spacing: spacing, size: size, ...leftContainerPropsRest, children: leftResult }), (0, jsx_runtime_1.jsx)(Grid_1.default, { container: true, className: "ET-ViewPage-LeftOthers", spacing: spacing, size: ViewPageSize.matchSize(size), children: createFields(data, leftContainerLines * (12 - getItemSize(bp, size))) })] })), createFields(data)] }));
238
238
  }
@@ -41,7 +41,7 @@ function InputItemUIs({ data }) {
41
41
  const types = Object.keys(CustomFieldUtils_1.CustomFieldUtils.customFieldCreators);
42
42
  const nameRef = react_1.default.useRef(null);
43
43
  const optionsRef = react_1.default.useRef(null);
44
- return ((0, jsx_runtime_1.jsxs)(Grid_1.default, { container: true, spacing: 2, marginTop: 1, children: [(0, jsx_runtime_1.jsx)(Grid_1.default, { size: { xs: 12, sm: 6 }, children: (0, jsx_runtime_1.jsx)(ComboBox_1.ComboBox, { name: "type", label: labels.type, inputRequired: true, size: "small", loadData: () => Promise.resolve(types.map((t) => ({ id: t, label: t }))), onValueChange: (item) => {
44
+ return ((0, jsx_runtime_1.jsxs)(Grid_1.default, { container: true, spacing: 2, sx: { marginTop: 1 }, children: [(0, jsx_runtime_1.jsx)(Grid_1.default, { size: { xs: 12, sm: 6 }, children: (0, jsx_runtime_1.jsx)(ComboBox_1.ComboBox, { name: "type", label: labels.type, inputRequired: true, size: "small", loadData: () => Promise.resolve(types.map((t) => ({ id: t, label: t }))), onValueChange: (item) => {
45
45
  const type = item?.id;
46
46
  optionsRef.current.disabled =
47
47
  type !== "combobox" &&
@@ -165,7 +165,7 @@ function InputUIs({ source, onChange }) {
165
165
  console.error("Failed to parse source:", error);
166
166
  }
167
167
  }, [source]);
168
- return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsxs)(FlexBox_1.HBox, { marginBottom: 0.5, gap: 1, alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: labels.sortTip }), (0, jsx_runtime_1.jsx)(Button_1.default, { size: "small", color: "primary", variant: "outlined", startIcon: (0, jsx_runtime_1.jsx)(Add_1.default, {}), onClick: () => editItem(), children: labels.add })] }), (0, jsx_runtime_1.jsx)(Card_1.default, { children: (0, jsx_runtime_1.jsx)(CardContent_1.default, { children: (0, jsx_runtime_1.jsx)(Grid_1.default, { container: true, spacing: 0, children: (0, jsx_runtime_1.jsx)(DnDSortableList_1.DnDSortableList, { items: items, idField: (item) => item.name, labelField: (item) => item.label || item.name, onChange: (items) => doChange(items), itemRenderer: (data, style, { sortable: { index }, ref, handleRef }) => ((0, jsx_runtime_1.jsxs)(Grid_1.default, { container: true, size: { xs: 12, sm: 12 }, ref: ref, style: style, gap: 1, children: [(0, jsx_runtime_1.jsx)(Grid_1.default, { size: smallSize, children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { style: { cursor: "move" }, size: "small", title: labels.dragIndicator, ref: handleRef, children: (0, jsx_runtime_1.jsx)(DragIndicator_1.default, {}) }) }), (0, jsx_runtime_1.jsxs)(Grid_1.default, { size: size, children: [index + 1, " - ", data.type, " / ", data.space] }), (0, jsx_runtime_1.jsxs)(Grid_1.default, { size: size, children: [data.name, " - ", data.label] }), (0, jsx_runtime_1.jsxs)(Grid_1.default, { size: smallSize, children: [(0, jsx_runtime_1.jsx)(IconButton_1.default, { size: "small", title: labels.delete, onClick: () => doChange(items.filter((item) => item.name !== data.name)), children: (0, jsx_runtime_1.jsx)(Delete_1.default, {}) }), (0, jsx_runtime_1.jsx)(IconButton_1.default, { size: "small", title: labels.edit, onClick: () => editItem(data), children: (0, jsx_runtime_1.jsx)(Edit_1.default, {}) })] })] })) }) }) }) })] }));
168
+ return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsxs)(FlexBox_1.HBox, { spacing: 1, sx: { marginTop: 0.5, alignItems: "center" }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: labels.sortTip }), (0, jsx_runtime_1.jsx)(Button_1.default, { size: "small", color: "primary", variant: "outlined", startIcon: (0, jsx_runtime_1.jsx)(Add_1.default, {}), onClick: () => editItem(), children: labels.add })] }), (0, jsx_runtime_1.jsx)(Card_1.default, { children: (0, jsx_runtime_1.jsx)(CardContent_1.default, { children: (0, jsx_runtime_1.jsx)(Grid_1.default, { container: true, spacing: 0, children: (0, jsx_runtime_1.jsx)(DnDSortableList_1.DnDSortableList, { items: items, idField: (item) => item.name, labelField: (item) => item.label || item.name, onChange: (items) => doChange(items), itemRenderer: (data, style, { sortable: { index }, ref, handleRef }) => ((0, jsx_runtime_1.jsxs)(Grid_1.default, { container: true, size: { xs: 12, sm: 12 }, ref: ref, style: style, spacing: 1, children: [(0, jsx_runtime_1.jsx)(Grid_1.default, { size: smallSize, children: (0, jsx_runtime_1.jsx)(IconButton_1.default, { style: { cursor: "move" }, size: "small", title: labels.dragIndicator, ref: handleRef, children: (0, jsx_runtime_1.jsx)(DragIndicator_1.default, {}) }) }), (0, jsx_runtime_1.jsxs)(Grid_1.default, { size: size, children: [index + 1, " - ", data.type, " / ", data.space] }), (0, jsx_runtime_1.jsxs)(Grid_1.default, { size: size, children: [data.name, " - ", data.label] }), (0, jsx_runtime_1.jsxs)(Grid_1.default, { size: smallSize, children: [(0, jsx_runtime_1.jsx)(IconButton_1.default, { size: "small", title: labels.delete, onClick: () => doChange(items.filter((item) => item.name !== data.name)), children: (0, jsx_runtime_1.jsx)(Delete_1.default, {}) }), (0, jsx_runtime_1.jsx)(IconButton_1.default, { size: "small", title: labels.edit, onClick: () => editItem(data), children: (0, jsx_runtime_1.jsx)(Edit_1.default, {}) })] })] })) }) }) }) })] }));
169
169
  }
170
170
  /**
171
171
  * Custom attribute area
@@ -45,7 +45,8 @@ function CustomFieldViewer(props) {
45
45
  if (data == null || typeof data !== "object" || Array.isArray(data)) {
46
46
  throw new Error("Invalid JSON data");
47
47
  }
48
- return ((0, jsx_runtime_1.jsx)(Grid_1.default, { container: true, justifyContent: "left", spacing: spacing, sx: {
48
+ return ((0, jsx_runtime_1.jsx)(Grid_1.default, { container: true, spacing: spacing, sx: {
49
+ justifyContent: "left",
49
50
  ".MuiTypography-subtitle2": {
50
51
  fontWeight: "bold"
51
52
  }
@@ -56,6 +57,6 @@ function CustomFieldViewer(props) {
56
57
  return;
57
58
  // Field value
58
59
  const value = shared_1.Utils.getNestedValue(data, name);
59
- return ((0, jsx_runtime_1.jsx)(Grid_1.default, { size: CustomFieldUtils_1.CustomFieldUtils.transformSpace(field.space), ...field.gridItemProps, children: (0, jsx_runtime_1.jsxs)(FlexBox_1.VBox, { gap: verticalGap, children: [(0, jsx_runtime_1.jsx)(Typography_1.default, { fontWeight: "bold", fontSize: "small", ...titleProps, children: field.label ?? name }), (0, jsx_runtime_1.jsx)(Typography_1.default, { ...valueProps, children: valueLabelFormatter(value, field) })] }) }, name ?? index));
60
+ return ((0, jsx_runtime_1.jsx)(Grid_1.default, { size: CustomFieldUtils_1.CustomFieldUtils.transformSpace(field.space), ...field.gridItemProps, children: (0, jsx_runtime_1.jsxs)(FlexBox_1.VBox, { spacing: verticalGap, children: [(0, jsx_runtime_1.jsx)(Typography_1.default, { component: "div", fontWeight: "bold", fontSize: "small", ...titleProps, children: field.label ?? name }), (0, jsx_runtime_1.jsx)(Typography_1.default, { ...valueProps, children: valueLabelFormatter(value, field) })] }) }, name ?? index));
60
61
  }) }));
61
62
  }
@@ -77,7 +77,8 @@ function CustomFieldWindow(props) {
77
77
  }
78
78
  }, {
79
79
  fullScreen: app.smDown,
80
- inputs: ((0, jsx_runtime_1.jsx)(Stack_1.default, { marginTop: 1.5, children: (0, jsx_runtime_1.jsx)(Grid_1.default, { container: true, justifyContent: "left", spacing: spacing, sx: {
80
+ inputs: ((0, jsx_runtime_1.jsx)(Stack_1.default, { sx: { marginTop: 1.5 }, children: (0, jsx_runtime_1.jsx)(Grid_1.default, { container: true, spacing: spacing, sx: {
81
+ justifyContent: "left",
81
82
  ".MuiTypography-subtitle2": {
82
83
  fontWeight: "bold"
83
84
  }
@@ -52,6 +52,6 @@ const FieldJson = ({ field, mref, onChange, defaultValue }) => {
52
52
  if (!name) {
53
53
  return ((0, jsx_runtime_1.jsxs)(Typography_1.default, { children: ["No name for FieldJson ", JSON.stringify(field)] }));
54
54
  }
55
- return ((0, jsx_runtime_1.jsx)(InputField_1.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 }));
55
+ return ((0, jsx_runtime_1.jsx)(InputField_1.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 }));
56
56
  };
57
57
  exports.FieldJson = FieldJson;
@@ -30,6 +30,6 @@ const FieldTexarea = ({ field, mref, onChange, defaultValue }) => {
30
30
  if (!name) {
31
31
  return ((0, jsx_runtime_1.jsxs)(Typography_1.default, { children: ["No name for FieldTextarea ", JSON.stringify(field)] }));
32
32
  }
33
- return ((0, jsx_runtime_1.jsx)(InputField_1.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 }));
33
+ return ((0, jsx_runtime_1.jsx)(InputField_1.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 }));
34
34
  };
35
35
  exports.FieldTexarea = FieldTexarea;
@@ -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/cjs/index.js CHANGED
@@ -13,7 +13,11 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
16
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.AccountTreeIcon = void 0;
17
21
  __exportStar(require("./app/CommonApp"), exports);
18
22
  __exportStar(require("./app/IServiceApp"), exports);
19
23
  __exportStar(require("./app/IServiceAppSettings"), exports);
@@ -150,3 +154,6 @@ __exportStar(require("./TooltipClick"), exports);
150
154
  __exportStar(require("./UserAvatar"), exports);
151
155
  __exportStar(require("./UserAvatarEditor"), exports);
152
156
  __exportStar(require("./ViewContainer"), exports);
157
+ // Icons
158
+ var AccountTree_1 = require("@mui/icons-material/AccountTree");
159
+ Object.defineProperty(exports, "AccountTreeIcon", { enumerable: true, get: function () { return __importDefault(AccountTree_1).default; } });
@@ -23,7 +23,9 @@ function EditPage(props) {
23
23
  const { children, isEditing, onDelete, onSubmit, paddings = MUGlobal_1.MUGlobal.pagePaddings, scrollContainer = globalThis, supportBack = true, submitDisabled = false, bottomPart, topPart, operationMessageHandler, gridSpacing = MUGlobal_1.MUGlobal.pagePaddings, ...rest } = props;
24
24
  // Labels
25
25
  const labels = Labels_1.Labels.CommonPage;
26
- return ((0, jsx_runtime_1.jsxs)(CommonPage_1.CommonPage, { paddings: paddings, scrollContainer: scrollContainer, ...rest, children: [operationMessageHandler && ((0, jsx_runtime_1.jsx)(OperationMessageContainer_1.OperationMessageContainer, { handler: operationMessageHandler })), topPart, (0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, children: [(0, jsx_runtime_1.jsx)(Grid_1.default, { container: true, justifyContent: "left", spacing: gridSpacing, paddingTop: 1, children: children }), (0, jsx_runtime_1.jsxs)(Grid_1.default, { container: true, position: "sticky", display: "flex", gap: gridSpacing, sx: {
26
+ return ((0, jsx_runtime_1.jsxs)(CommonPage_1.CommonPage, { paddings: paddings, scrollContainer: scrollContainer, ...rest, children: [operationMessageHandler && ((0, jsx_runtime_1.jsx)(OperationMessageContainer_1.OperationMessageContainer, { handler: operationMessageHandler })), topPart, (0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, children: [(0, jsx_runtime_1.jsx)(Grid_1.default, { container: true, spacing: gridSpacing, sx: { justifyContent: "left", paddingTop: 1 }, children: children }), (0, jsx_runtime_1.jsxs)(Grid_1.default, { container: true, spacing: gridSpacing, sx: {
27
+ position: "sticky",
28
+ display: "flex",
27
29
  top: "auto",
28
30
  bottom: (theme) => MUGlobal_1.MUGlobal.updateWithTheme(gridSpacing, theme.spacing),
29
31
  paddingTop: gridSpacing
@@ -24,8 +24,14 @@ const Stack_1 = __importDefault(require("@mui/material/Stack"));
24
24
  * @returns Component
25
25
  */
26
26
  function ViewPageActionBar(props) {
27
- const { actionPaddings = MUGlobal_1.MUGlobal.pagePaddings, ...rest } = props;
28
- return ((0, jsx_runtime_1.jsx)(Stack_1.default, { className: "ET-ViewPage-Actions", direction: "row", width: "100%", flexWrap: "wrap", justifyContent: "center", paddingTop: actionPaddings, paddingBottom: actionPaddings, gap: actionPaddings, ...rest }));
27
+ const { actionPaddings = MUGlobal_1.MUGlobal.pagePaddings, sx, ...rest } = props;
28
+ return ((0, jsx_runtime_1.jsx)(Stack_1.default, { className: "ET-ViewPage-Actions", direction: "row", spacing: actionPaddings, sx: {
29
+ flexWrap: "wrap",
30
+ justifyContent: "center",
31
+ paddingTop: actionPaddings,
32
+ paddingBottom: actionPaddings,
33
+ ...sx
34
+ }, ...rest }));
29
35
  }
30
36
  /**
31
37
  * View page
@@ -34,19 +34,24 @@ function ButtonPopupList(props) {
34
34
  // Set selected ids
35
35
  setSelectedIdsHandler([...value]);
36
36
  }, [value]);
37
- return (_jsxs(VBox, { gap: 2, children: [_jsx(DnDSortableList, { component: Grid, componentProps: { container: true, spacing: 0 }, items: items, labelField: labelField, onChange: (items) => {
37
+ return (_jsxs(VBox, { spacing: 2, children: [_jsx(DnDSortableList, { component: Grid, componentProps: { container: true, spacing: 0 }, items: items, labelField: labelField, onChange: (items) => {
38
38
  const ids = items
39
39
  .filter((item) => tempSelectedIds.current.includes(item.id))
40
40
  .map((item) => item.id);
41
41
  onValueChange(ids);
42
- }, itemRenderer: (item, style, { sortable: { index }, ref, handleRef }) => (_jsxs(Grid, { size: itemSize, display: "flex", justifyContent: "flex-start", alignItems: "center", gap: 1, ref: ref, style: style, children: [_jsx(IconButton, { style: { cursor: "move" }, size: "small", title: labels?.dragIndicator, ref: handleRef, children: _jsx(DragIndicatorIcon, {}) }), _jsx(FormControlLabel, { control: _jsx(Checkbox, { name: "item", value: item.id, checked: selectedIds.includes(item.id), onChange: (e) => {
42
+ }, itemRenderer: (item, style, { sortable: { index }, ref, handleRef }) => (_jsxs(Grid, { size: itemSize, spacing: 1, ref: ref, style: {
43
+ display: "flex",
44
+ alignItems: "center",
45
+ justifyContent: "flex-start",
46
+ ...style
47
+ }, children: [_jsx(IconButton, { style: { cursor: "move" }, size: "small", title: labels?.dragIndicator, ref: handleRef, children: _jsx(DragIndicatorIcon, {}) }), _jsx(FormControlLabel, { control: _jsx(Checkbox, { name: "item", value: item.id, checked: selectedIds.includes(item.id), onChange: (e) => {
43
48
  const checked = e.target.checked;
44
49
  const newIds = [
45
50
  ...selectedIds.toggleItem(item.id, checked)
46
51
  ];
47
52
  setSelectedIdsHandler(newIds);
48
53
  onValueChange(newIds);
49
- } }), label: `${index + 1}. ${labelFormatter(item)}` })] })), mRef: dndRef }), onAdd && (_jsxs(HBox, { gap: 1, children: [_jsx(TextField, { variant: "outlined", label: labels?.more, fullWidth: true, inputRef: inputRef }), _jsx(Button, { sx: { width: "120px" }, variant: "contained", startIcon: _jsx(AddIcon, {}), size: "small", onClick: async () => {
54
+ } }), label: `${index + 1}. ${labelFormatter(item)}` })] })), mRef: dndRef }), onAdd && (_jsxs(HBox, { spacing: 1, children: [_jsx(TextField, { variant: "outlined", label: labels?.more, fullWidth: true, inputRef: inputRef }), _jsx(Button, { sx: { width: "120px" }, variant: "contained", startIcon: _jsx(AddIcon, {}), size: "small", onClick: async () => {
50
55
  if (inputRef.current == null)
51
56
  return;
52
57
  const input = inputRef.current.value.trim();
@@ -23,7 +23,7 @@ function ButtonPopupList(props) {
23
23
  React.useEffect(() => {
24
24
  setCurrentValue(value);
25
25
  }, [value]);
26
- return (_jsxs(VBox, { gap: 2, children: [_jsx(RadioGroup, { value: currentValue ?? "", name: "radio-buttons-group", onChange: (e, v) => {
26
+ return (_jsxs(VBox, { spacing: 2, children: [_jsx(RadioGroup, { value: currentValue ?? "", name: "radio-buttons-group", onChange: (e, v) => {
27
27
  const checked = e.target.checked;
28
28
  const value = checked
29
29
  ? typeof items[0].id === "number"
@@ -32,7 +32,11 @@ function ButtonPopupList(props) {
32
32
  : undefined;
33
33
  setCurrentValue(value);
34
34
  onValueChange(value);
35
- }, children: _jsx(Grid, { container: true, spacing: 0, children: items.map((item) => (_jsx(Grid, { size: itemSize, display: "flex", justifyContent: "flex-start", alignItems: "center", gap: 1, children: _jsx(FormControlLabel, { control: _jsx(Radio, { value: item.id }), label: `${labelFormatter(item)}` }) }, item.id))) }) }), onAdd && (_jsxs(HBox, { gap: 1, children: [_jsx(TextField, { variant: "outlined", label: labels?.more, fullWidth: true, inputRef: inputRef }), _jsx(Button, { sx: { width: "120px" }, variant: "contained", startIcon: _jsx(AddIcon, {}), size: "small", onClick: async () => {
35
+ }, children: _jsx(Grid, { container: true, spacing: 0, children: items.map((item) => (_jsx(Grid, { size: itemSize, sx: {
36
+ display: "flex",
37
+ alignItems: "center",
38
+ justifyContent: "flex-start"
39
+ }, spacing: 1, children: _jsx(FormControlLabel, { control: _jsx(Radio, { value: item.id }), label: `${labelFormatter(item)}` }) }, item.id))) }) }), onAdd && (_jsxs(HBox, { spacing: 1, children: [_jsx(TextField, { variant: "outlined", label: labels?.more, fullWidth: true, inputRef: inputRef }), _jsx(Button, { sx: { width: "120px" }, variant: "contained", startIcon: _jsx(AddIcon, {}), size: "small", onClick: async () => {
36
40
  if (inputRef.current == null)
37
41
  return;
38
42
  const input = inputRef.current.value.trim();
@@ -42,7 +42,7 @@ export function ComboBox(props) {
42
42
  // Local default value
43
43
  const localValue = idValue != null
44
44
  ? localOptions.find((o) => o[idField] === idValue)
45
- : defaultValue ?? value;
45
+ : (defaultValue ?? value);
46
46
  // State
47
47
  // null for controlled
48
48
  const [stateValue, setStateValue] = React.useState(null);
@@ -59,9 +59,9 @@ export function ComboBox(props) {
59
59
  if (readOnly != null) {
60
60
  Object.assign(params, { readOnly });
61
61
  }
62
- Object.assign(params.inputProps, { "data-reset": inputReset });
62
+ Object.assign(params.slotProps.htmlInput, { "data-reset": inputReset });
63
63
  if (dataReadonly) {
64
- params.inputProps.onKeyDown = (event) => {
64
+ params.slotProps.htmlInput.onKeyDown = (event) => {
65
65
  if (Keyboard.isTypingContent(event.key)) {
66
66
  event.preventDefault();
67
67
  }
@@ -69,7 +69,9 @@ export function ComboBox(props) {
69
69
  }
70
70
  // https://stackoverflow.com/questions/15738259/disabling-chrome-autofill
71
71
  // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html
72
- Object.assign(params.inputProps, { autoComplete: inputAutoComplete });
72
+ Object.assign(params.slotProps.htmlInput, {
73
+ autoComplete: inputAutoComplete
74
+ });
73
75
  return params;
74
76
  };
75
77
  const getValue = (value) => {
@@ -118,7 +120,7 @@ export function ComboBox(props) {
118
120
  };
119
121
  }, []);
120
122
  // Layout
121
- 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: getValue(stateValue), readOnly: true, onChange: inputOnChange, disabled: disabled }), _jsxs(Stack, { gap: 0.5, direction: "row", width: "100%", children: [_jsx(Autocomplete, { value: stateValue, disabled: disabled, disableCloseOnSelect: disableCloseOnSelect, getOptionLabel: getOptionLabel, isOptionEqualToValue: (option, value) => option[idField] === value[idField], onChange: (event, value, reason, details) => {
123
+ 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: getValue(stateValue), readOnly: true, onChange: inputOnChange, disabled: disabled }), _jsxs(Stack, { spacing: 0.5, direction: "row", children: [_jsx(Autocomplete, { value: stateValue, disabled: disabled, disableCloseOnSelect: disableCloseOnSelect, getOptionLabel: getOptionLabel, isOptionEqualToValue: (option, value) => option[idField] === value[idField], onChange: (event, value, reason, details) => {
122
124
  // Set value
123
125
  setInputValue(value);
124
126
  // Custom
@@ -57,9 +57,9 @@ export function ComboBoxMultiple(props) {
57
57
  if (readOnly != null) {
58
58
  Object.assign(params, { readOnly });
59
59
  }
60
- Object.assign(params.inputProps, { "data-reset": inputReset });
60
+ Object.assign(params.slotProps.htmlInput, { "data-reset": inputReset });
61
61
  if (dataReadonly) {
62
- params.inputProps.onKeyDown = (event) => {
62
+ params.slotProps.htmlInput.onKeyDown = (event) => {
63
63
  if (Keyboard.isTypingContent(event.key)) {
64
64
  event.preventDefault();
65
65
  }
@@ -67,7 +67,9 @@ export function ComboBoxMultiple(props) {
67
67
  }
68
68
  // https://stackoverflow.com/questions/15738259/disabling-chrome-autofill
69
69
  // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html
70
- Object.assign(params.inputProps, { autoComplete: inputAutoComplete });
70
+ Object.assign(params.slotProps.htmlInput, {
71
+ autoComplete: inputAutoComplete
72
+ });
71
73
  return params;
72
74
  };
73
75
  const getValue = (value) => {
@@ -81,7 +81,14 @@ export function DataGridEx(props) {
81
81
  const theme = useTheme();
82
82
  const defaultHeaderRenderer = (states) => {
83
83
  const { orderBy } = states.queryPaging;
84
- return (_jsx(Box, { className: "DataGridEx-Header", display: "flex", alignItems: "center", borderBottom: boldBorder, fontWeight: 500, minWidth: widthCalculator.total, height: headerHeight, children: columns.map((column, index) => {
84
+ return (_jsx(Box, { className: "DataGridEx-Header", sx: {
85
+ display: "flex",
86
+ alignItems: "center",
87
+ borderBottom: boldBorder,
88
+ fontWeight: 500,
89
+ minWidth: widthCalculator.total,
90
+ height: headerHeight
91
+ }, children: columns.map((column, index) => {
85
92
  // Destruct
86
93
  const { align, field, header, headerCellRenderer, sortable, sortAsc = true, type } = column;
87
94
  // Header text
@@ -109,11 +116,21 @@ export function DataGridEx(props) {
109
116
  else {
110
117
  sortLabel = headerText;
111
118
  }
112
- return (_jsx(Box, { textAlign: GridAlignGet(align, type), width: columnWidth(index), children: _jsx(Box, { className: "DataGridEx-Cell", onMouseEnter: handleMouseEnter, ...cellProps, children: sortLabel }) }, field ?? index.toString()));
119
+ return (_jsx(Box, { sx: {
120
+ textAlign: GridAlignGet(align, type),
121
+ width: columnWidth(index)
122
+ }, children: _jsx(Box, { className: "DataGridEx-Cell", onMouseEnter: handleMouseEnter, ...cellProps, children: sortLabel }) }, field ?? index.toString()));
113
123
  }) }));
114
124
  };
115
125
  function defaultFooterRenderer(rows, states) {
116
- return (_jsx(Box, { className: "DataGridEx-Footer", display: "flex", alignItems: "center", borderTop: thinBorder, marginTop: "1px", minWidth: widthCalculator.total, height: bottomHeight - 1, children: columns.map((column, index) => {
126
+ return (_jsx(Box, { className: "DataGridEx-Footer", sx: {
127
+ display: "flex",
128
+ alignItems: "center",
129
+ borderTop: thinBorder,
130
+ marginTop: "1px",
131
+ minHeight: widthCalculator.total,
132
+ height: bottomHeight - 1
133
+ }, children: columns.map((column, index) => {
117
134
  // Destruct
118
135
  const { align, field, type } = column;
119
136
  // Cell props
@@ -128,7 +145,10 @@ export function DataGridEx(props) {
128
145
  checkable
129
146
  })
130
147
  : undefined;
131
- return (_jsx(Box, { textAlign: GridAlignGet(align, type), width: columnWidth(index), children: _jsx(Box, { className: "DataGridEx-Cell", onMouseEnter: handleMouseEnter, ...cellProps, children: cell }) }, "bottom-" + (field ?? index.toString())));
148
+ return (_jsx(Box, { sx: {
149
+ textAlign: GridAlignGet(align, type),
150
+ width: columnWidth(index)
151
+ }, children: _jsx(Box, { className: "DataGridEx-Cell", onMouseEnter: handleMouseEnter, ...cellProps, children: cell }) }, "bottom-" + (field ?? index.toString())));
132
152
  }) }));
133
153
  }
134
154
  // Destruct
@@ -287,8 +307,7 @@ export function DataGridEx(props) {
287
307
  : cellBoxStyle;
288
308
  const cellProps = {
289
309
  className: "DataGridEx-Cell",
290
- textAlign: GridAlignGet(align, type),
291
- sx: { ...boxStyle }
310
+ sx: { textAlign: GridAlignGet(align, type), ...boxStyle }
292
311
  };
293
312
  const child = cellRenderer({
294
313
  data,
@@ -23,9 +23,8 @@ export function DataSteps(props) {
23
23
  // Labels
24
24
  const labels = app.getLabels("close", "nextStep", "previousStep", "submit");
25
25
  // Destruct
26
- const { InputLabelProps = {}, jsonValue, valueFormatter = (_data) => "...", onValueChange, steps, value = "", ...rest } = props;
27
- // Shrink
28
- InputLabelProps.shrink ??= MUGlobal.searchFieldShrink;
26
+ const { jsonValue, valueFormatter = (_data) => "...", onValueChange, steps, value = "", slotProps, ...rest } = props;
27
+ const { input, htmlInput, inputLabel, ...restSlotProps } = slotProps ?? {};
29
28
  // Current index
30
29
  const indexRef = React.useRef(-1);
31
30
  // Current Json data
@@ -41,7 +40,12 @@ export function DataSteps(props) {
41
40
  const [{ callback, ...rest }, more] = steps(index, jsonRef.current);
42
41
  app.showInputDialog({
43
42
  ...rest,
44
- buttons: (n, callback) => (_jsxs(HBox, { paddingLeft: 2, paddingRight: 2, paddingBottom: 2, gap: 2, justifyContent: "space-between", children: [index === 0 ? (_jsx(Button, { variant: "outlined", startIcon: _jsx(CloseIcon, {}), onClick: () => n.dismiss(), children: labels.close })) : (_jsx(Button, { variant: "outlined", startIcon: _jsx(NavigateBeforeIcon, {}), onClick: () => {
43
+ buttons: (n, callback) => (_jsxs(HBox, { spacing: 2, sx: {
44
+ justifyContent: "space-between",
45
+ paddingLeft: 2,
46
+ paddingRight: 2,
47
+ paddingBottom: 2
48
+ }, children: [index === 0 ? (_jsx(Button, { variant: "outlined", startIcon: _jsx(CloseIcon, {}), onClick: () => n.dismiss(), children: labels.close })) : (_jsx(Button, { variant: "outlined", startIcon: _jsx(NavigateBeforeIcon, {}), onClick: () => {
45
49
  n.dismiss();
46
50
  showStep(indexRef.current - 1);
47
51
  }, children: labels.previousStep })), more ? (_jsx(Button, { variant: "contained", startIcon: _jsx(NavigateNextIcon, {}), onClick: async (event) => {
@@ -75,13 +79,19 @@ export function DataSteps(props) {
75
79
  React.useEffect(() => {
76
80
  setLocalValue(valueFormatter(jsonRef.current));
77
81
  }, [valueFormatter]);
78
- return (_jsx(TextField, { autoComplete: "off", InputLabelProps: InputLabelProps, inputProps: { style: { cursor: "pointer" } }, InputProps: {
79
- onKeyDown: (event) => {
80
- if (event.key === "Tab")
81
- return;
82
- cancelInput(event);
82
+ return (_jsx(TextField, { autoComplete: "off", slotProps: {
83
+ input: {
84
+ onKeyDown: (event) => {
85
+ if (event.key === "Tab")
86
+ return;
87
+ cancelInput(event);
88
+ },
89
+ onPaste: cancelInput,
90
+ endAdornment: (_jsx(InputAdornment, { position: "end", children: _jsx(IconButton, { edge: "end", size: "small", children: _jsx(StartIcon, {}) }) })),
91
+ ...input
83
92
  },
84
- onPaste: cancelInput,
85
- endAdornment: (_jsx(InputAdornment, { position: "end", children: _jsx(IconButton, { edge: "end", size: "small", children: _jsx(StartIcon, {}) }) }))
93
+ htmlInput: { style: { cursor: "pointer" }, ...htmlInput },
94
+ inputLabel: { shrink: MUGlobal.searchFieldShrink, ...inputLabel },
95
+ ...restSlotProps
86
96
  }, onClick: () => showStep(0), value: localValue, ...rest }));
87
97
  }
@@ -45,7 +45,11 @@ export function FileUploadButton(props) {
45
45
  onUploadFiles(files);
46
46
  };
47
47
  // Layout
48
- return (_jsxs(HBox, { alignItems: "center", flexWrap: "wrap", border: (theme) => dragOver ? "1px dashed " + theme.palette.warning.main : undefined, spacing: 0.5, ...(dropFilesLabel == null
48
+ return (_jsxs(HBox, { sx: {
49
+ alignItems: "center",
50
+ flexWrap: "wrap",
51
+ border: (theme) => dragOver ? "1px dashed " + theme.palette.warning.main : undefined
52
+ }, spacing: 0.5, ...(dropFilesLabel == null
49
53
  ? undefined
50
54
  : {
51
55
  onDrop: handleDrop,
@@ -4,7 +4,7 @@ import { StackProps } from "@mui/material/Stack";
4
4
  * @param props Props
5
5
  * @returns Component
6
6
  */
7
- export declare function HBox(props: Omit<StackProps, "ref">): import("react/jsx-runtime").JSX.Element;
7
+ export declare function HBox(props: Omit<StackProps, "ref" | "direction">): import("react/jsx-runtime").JSX.Element;
8
8
  /**
9
9
  * Horizonal box with list items
10
10
  * @param props Props
@@ -16,4 +16,4 @@ export declare function HBoxList(props: Omit<StackProps, "direction">): import("
16
16
  * @param props Props
17
17
  * @returns Component
18
18
  */
19
- export declare function VBox(props: Omit<StackProps, "ref">): import("react/jsx-runtime").JSX.Element;
19
+ export declare function VBox(props: Omit<StackProps, "ref" | "direction">): import("react/jsx-runtime").JSX.Element;
@@ -6,7 +6,7 @@ import Stack from "@mui/material/Stack";
6
6
  * @returns Component
7
7
  */
8
8
  export function HBox(props) {
9
- return _jsx(Stack, { direction: "row", width: "100%", ...props });
9
+ return _jsx(Stack, { direction: "row", ...props });
10
10
  }
11
11
  /**
12
12
  * Horizonal box with list items
@@ -14,7 +14,8 @@ export function HBox(props) {
14
14
  * @returns Component
15
15
  */
16
16
  export function HBoxList(props) {
17
- return (_jsx(Stack, { spacing: 1, gap: 1, direction: "row", flexWrap: "wrap", width: "100%", ...props }));
17
+ const { sx, ...rest } = props;
18
+ return (_jsx(Stack, { spacing: 1, direction: "row", sx: { flexWrap: "wrap", ...sx }, ...rest }));
18
19
  }
19
20
  /**
20
21
  * Vertial box
@@ -10,7 +10,7 @@ import TextField from "@mui/material/TextField";
10
10
  */
11
11
  export function InputField(props) {
12
12
  // Destruct
13
- const { InputProps = {}, inputProps = {}, slotProps, onChange, onChangeDelay, changeDelay = onChangeDelay ? [480] : undefined, readOnly, size = MUGlobal.inputFieldSize, variant = MUGlobal.inputFieldVariant, ...rest } = props;
13
+ const { slotProps, onChange, onChangeDelay, changeDelay = onChangeDelay ? [480] : undefined, readOnly, size = MUGlobal.inputFieldSize, variant = MUGlobal.inputFieldVariant, ...rest } = props;
14
14
  // Slot props
15
15
  const { htmlInput, input, inputLabel, ...restSlotProps } = slotProps ?? {};
16
16
  const isMounted = React.useRef(true);
@@ -44,10 +44,9 @@ export function InputField(props) {
44
44
  return (_jsx(TextField, { slotProps: {
45
45
  htmlInput: {
46
46
  ["data-min-chars"]: changeDelay?.[1],
47
- ...htmlInput,
48
- ...inputProps
47
+ ...htmlInput
49
48
  },
50
- input: { readOnly, ...input, ...InputProps },
49
+ input: { readOnly, ...input },
51
50
  inputLabel: {
52
51
  shrink: MUGlobal.inputFieldShrink,
53
52
  ...inputLabel
@@ -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",