@etsoo/materialui 1.6.39 → 1.6.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/SwitchAnt.tsx +6 -7
- package/lib/cjs/ButtonPopupCheckbox.js +8 -3
- package/lib/cjs/ButtonPopupRadio.js +6 -2
- package/lib/cjs/ComboBox.js +7 -5
- package/lib/cjs/ComboBoxMultiple.js +5 -3
- package/lib/cjs/DataGridEx.js +25 -6
- package/lib/cjs/DataSteps.js +21 -11
- package/lib/cjs/FileUploadButton.js +5 -1
- package/lib/cjs/FlexBox.d.ts +2 -2
- package/lib/cjs/FlexBox.js +3 -2
- package/lib/cjs/InputField.js +3 -4
- package/lib/cjs/MoreFab.js +1 -1
- package/lib/cjs/NotifierMU.js +12 -5
- package/lib/cjs/OptionGroup.js +1 -1
- package/lib/cjs/OptionGroupFlag.js +1 -1
- package/lib/cjs/QuickList.js +3 -3
- package/lib/cjs/ResponsibleContainer.js +4 -1
- package/lib/cjs/SearchBar.js +9 -2
- package/lib/cjs/SearchField.js +8 -9
- package/lib/cjs/SwitchAnt.js +2 -2
- package/lib/cjs/SwitchField.js +1 -1
- package/lib/cjs/TextFieldEx.js +6 -11
- package/lib/cjs/Tiplist.js +2 -2
- package/lib/cjs/TiplistPro.js +1 -1
- package/lib/cjs/TwoFieldInput.d.ts +1 -1
- package/lib/cjs/TwoFieldInput.js +12 -7
- package/lib/cjs/UserAvatarEditor.js +8 -5
- package/lib/cjs/ViewContainer.js +2 -2
- package/lib/cjs/custom/CustomAttributeArea.js +2 -2
- package/lib/cjs/custom/CustomFieldViewer.js +3 -2
- package/lib/cjs/custom/CustomFieldWindow.js +2 -1
- package/lib/cjs/custom/FieldJson.js +1 -1
- package/lib/cjs/custom/FieldTexarea.js +1 -1
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +7 -0
- package/lib/cjs/pages/EditPage.js +3 -1
- package/lib/cjs/pages/ViewPage.js +8 -2
- package/lib/mjs/ButtonPopupCheckbox.js +8 -3
- package/lib/mjs/ButtonPopupRadio.js +6 -2
- package/lib/mjs/ComboBox.js +7 -5
- package/lib/mjs/ComboBoxMultiple.js +5 -3
- package/lib/mjs/DataGridEx.js +25 -6
- package/lib/mjs/DataSteps.js +21 -11
- package/lib/mjs/FileUploadButton.js +5 -1
- package/lib/mjs/FlexBox.d.ts +2 -2
- package/lib/mjs/FlexBox.js +3 -2
- package/lib/mjs/InputField.js +3 -4
- package/lib/mjs/MoreFab.js +1 -1
- package/lib/mjs/NotifierMU.js +12 -5
- package/lib/mjs/OptionGroup.js +1 -1
- package/lib/mjs/OptionGroupFlag.js +1 -1
- package/lib/mjs/QuickList.js +3 -3
- package/lib/mjs/ResponsibleContainer.js +4 -1
- package/lib/mjs/SearchBar.js +9 -2
- package/lib/mjs/SearchField.js +8 -9
- package/lib/mjs/SwitchAnt.js +2 -2
- package/lib/mjs/SwitchField.js +1 -1
- package/lib/mjs/TextFieldEx.js +6 -11
- package/lib/mjs/Tiplist.js +2 -2
- package/lib/mjs/TiplistPro.js +1 -1
- package/lib/mjs/TwoFieldInput.d.ts +1 -1
- package/lib/mjs/TwoFieldInput.js +12 -7
- package/lib/mjs/UserAvatarEditor.js +8 -5
- package/lib/mjs/ViewContainer.js +2 -2
- package/lib/mjs/custom/CustomAttributeArea.js +2 -2
- package/lib/mjs/custom/CustomFieldViewer.js +3 -2
- package/lib/mjs/custom/CustomFieldWindow.js +2 -1
- package/lib/mjs/custom/FieldJson.js +1 -1
- package/lib/mjs/custom/FieldTexarea.js +1 -1
- package/lib/mjs/index.d.ts +1 -0
- package/lib/mjs/index.js +2 -0
- package/lib/mjs/pages/EditPage.js +3 -1
- package/lib/mjs/pages/ViewPage.js +8 -2
- package/package.json +14 -14
- package/src/ButtonPopupCheckbox.tsx +10 -8
- package/src/ButtonPopupRadio.tsx +8 -6
- package/src/ComboBox.tsx +7 -5
- package/src/ComboBoxMultiple.tsx +5 -3
- package/src/ComboBoxPro.tsx +1 -1
- package/src/CultureDataTable.tsx +1 -1
- package/src/DataGridEx.tsx +27 -20
- package/src/DataSteps.tsx +27 -22
- package/src/FileUploadButton.tsx +6 -5
- package/src/FlexBox.tsx +7 -7
- package/src/InputField.tsx +2 -5
- package/src/MoreFab.tsx +8 -8
- package/src/NotifierMU.tsx +12 -12
- package/src/NumberInputField.tsx +1 -0
- package/src/OptionGroup.tsx +3 -5
- package/src/OptionGroupFlag.tsx +3 -5
- package/src/QuickList.tsx +4 -4
- package/src/ResponsibleContainer.tsx +3 -3
- package/src/SearchBar.tsx +7 -7
- package/src/SearchField.tsx +8 -14
- package/src/SwitchAnt.tsx +2 -2
- package/src/SwitchField.tsx +1 -3
- package/src/TextFieldEx.tsx +32 -36
- package/src/Tiplist.tsx +2 -2
- package/src/TiplistPro.tsx +2 -2
- package/src/TwoFieldInput.tsx +33 -31
- package/src/UserAvatarEditor.tsx +15 -10
- package/src/ViewContainer.tsx +6 -2
- package/src/custom/CustomAttributeArea.tsx +3 -3
- package/src/custom/CustomFieldViewer.tsx +8 -3
- package/src/custom/CustomFieldWindow.tsx +4 -4
- package/src/custom/FieldJson.tsx +3 -3
- package/src/custom/FieldTexarea.tsx +1 -1
- package/src/index.ts +3 -0
- package/src/pages/EditPage.tsx +4 -5
- package/src/pages/ViewPage.tsx +11 -8
- package/tsconfig.cjs.json +1 -1
- package/tsconfig.json +2 -2
package/src/SwitchField.tsx
CHANGED
|
@@ -116,9 +116,7 @@ export function SwitchField(props: SwitchFieldProps) {
|
|
|
116
116
|
}}
|
|
117
117
|
/>
|
|
118
118
|
) : (
|
|
119
|
-
<Box
|
|
120
|
-
{group}
|
|
121
|
-
</Box>
|
|
119
|
+
<Box sx={{ paddingLeft: 2, paddingY: "7px" }}>{group}</Box>
|
|
122
120
|
)}
|
|
123
121
|
</FormControl>
|
|
124
122
|
{helperText && <FormHelperText>{helperText}</FormHelperText>}
|
package/src/TextFieldEx.tsx
CHANGED
|
@@ -86,8 +86,6 @@ export function TextFieldEx(props: TextFieldExProps) {
|
|
|
86
86
|
error,
|
|
87
87
|
fullWidth = true,
|
|
88
88
|
helperText,
|
|
89
|
-
InputLabelProps = {},
|
|
90
|
-
InputProps = {},
|
|
91
89
|
slotProps,
|
|
92
90
|
onChange,
|
|
93
91
|
onClear,
|
|
@@ -107,16 +105,10 @@ export function TextFieldEx(props: TextFieldExProps) {
|
|
|
107
105
|
// Slot props
|
|
108
106
|
const { input, inputLabel, ...restSlotProps } = slotProps ?? {};
|
|
109
107
|
|
|
110
|
-
// Shrink
|
|
111
|
-
InputLabelProps.shrink ??= MUGlobal.searchFieldShrink;
|
|
112
|
-
|
|
113
108
|
// State
|
|
114
109
|
const [errorText, updateErrorText] = React.useState<React.ReactNode>();
|
|
115
110
|
const [empty, updateEmpty] = React.useState<boolean>(true);
|
|
116
111
|
|
|
117
|
-
// Read only
|
|
118
|
-
if (readOnly != null) InputProps.readOnly = readOnly;
|
|
119
|
-
|
|
120
112
|
// Calculate
|
|
121
113
|
let errorEx = error;
|
|
122
114
|
let helperTextEx = helperText;
|
|
@@ -181,33 +173,6 @@ export function TextFieldEx(props: TextFieldExProps) {
|
|
|
181
173
|
preventDefault(e);
|
|
182
174
|
};
|
|
183
175
|
|
|
184
|
-
// Show password and/or clear button
|
|
185
|
-
if (!empty && (showPassword || showClear)) {
|
|
186
|
-
InputProps.endAdornment = (
|
|
187
|
-
<InputAdornment position="end">
|
|
188
|
-
{showPassword && (
|
|
189
|
-
<IconButton
|
|
190
|
-
tabIndex={-1}
|
|
191
|
-
onContextMenu={(event) => event.preventDefault()}
|
|
192
|
-
onMouseDown={touchStart}
|
|
193
|
-
onMouseUp={touchEnd}
|
|
194
|
-
onTouchStart={touchStart}
|
|
195
|
-
onTouchCancel={touchEnd}
|
|
196
|
-
onTouchEnd={touchEnd}
|
|
197
|
-
title={showIt}
|
|
198
|
-
>
|
|
199
|
-
<VisibilityIcon />
|
|
200
|
-
</IconButton>
|
|
201
|
-
)}
|
|
202
|
-
{showClear && (
|
|
203
|
-
<IconButton onClick={clearClick} tabIndex={-1} title={clearLabel}>
|
|
204
|
-
<ClearIcon />
|
|
205
|
-
</IconButton>
|
|
206
|
-
)}
|
|
207
|
-
</InputAdornment>
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
176
|
// Extend key precess
|
|
212
177
|
const onKeyPressEx =
|
|
213
178
|
onEnter == null
|
|
@@ -287,7 +252,38 @@ export function TextFieldEx(props: TextFieldExProps) {
|
|
|
287
252
|
onChange={onChangeEx}
|
|
288
253
|
onKeyDown={onKeyPressEx}
|
|
289
254
|
slotProps={{
|
|
290
|
-
input: {
|
|
255
|
+
input: {
|
|
256
|
+
endAdornment:
|
|
257
|
+
!empty && (showPassword || showClear) ? (
|
|
258
|
+
<InputAdornment position="end">
|
|
259
|
+
{showPassword && (
|
|
260
|
+
<IconButton
|
|
261
|
+
tabIndex={-1}
|
|
262
|
+
onContextMenu={(event) => event.preventDefault()}
|
|
263
|
+
onMouseDown={touchStart}
|
|
264
|
+
onMouseUp={touchEnd}
|
|
265
|
+
onTouchStart={touchStart}
|
|
266
|
+
onTouchCancel={touchEnd}
|
|
267
|
+
onTouchEnd={touchEnd}
|
|
268
|
+
title={showIt}
|
|
269
|
+
>
|
|
270
|
+
<VisibilityIcon />
|
|
271
|
+
</IconButton>
|
|
272
|
+
)}
|
|
273
|
+
{showClear && (
|
|
274
|
+
<IconButton
|
|
275
|
+
onClick={clearClick}
|
|
276
|
+
tabIndex={-1}
|
|
277
|
+
title={clearLabel}
|
|
278
|
+
>
|
|
279
|
+
<ClearIcon />
|
|
280
|
+
</IconButton>
|
|
281
|
+
)}
|
|
282
|
+
</InputAdornment>
|
|
283
|
+
) : undefined,
|
|
284
|
+
readOnly,
|
|
285
|
+
...input
|
|
286
|
+
},
|
|
291
287
|
inputLabel: {
|
|
292
288
|
shrink: MUGlobal.inputFieldShrink,
|
|
293
289
|
...inputLabel
|
package/src/Tiplist.tsx
CHANGED
|
@@ -159,7 +159,7 @@ export function Tiplist<
|
|
|
159
159
|
|
|
160
160
|
// https://stackoverflow.com/questions/15738259/disabling-chrome-autofill
|
|
161
161
|
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html
|
|
162
|
-
Object.assign(params.
|
|
162
|
+
Object.assign(params.slotProps.htmlInput, {
|
|
163
163
|
autoComplete: inputAutoComplete,
|
|
164
164
|
"data-reset": inputReset
|
|
165
165
|
});
|
|
@@ -299,7 +299,7 @@ export function Tiplist<
|
|
|
299
299
|
style={{ display: "none" }}
|
|
300
300
|
name={name}
|
|
301
301
|
value={`${
|
|
302
|
-
inputValue ?? (state.current.idSet ? "" : localIdValue ?? "")
|
|
302
|
+
inputValue ?? (state.current.idSet ? "" : (localIdValue ?? ""))
|
|
303
303
|
}`}
|
|
304
304
|
readOnly
|
|
305
305
|
onChange={inputOnChange}
|
package/src/TiplistPro.tsx
CHANGED
|
@@ -312,7 +312,7 @@ export function TiplistPro<T extends ListType2 = ListType2>(
|
|
|
312
312
|
type={idIsString ? "text" : "number"}
|
|
313
313
|
style={{ display: "none" }}
|
|
314
314
|
name={name}
|
|
315
|
-
value={inputValue ?? (state.current.idSet ? "" : localIdValue ?? "")}
|
|
315
|
+
value={inputValue ?? (state.current.idSet ? "" : (localIdValue ?? ""))}
|
|
316
316
|
readOnly
|
|
317
317
|
onChange={inputOnChange}
|
|
318
318
|
disabled={disabled}
|
|
@@ -383,7 +383,7 @@ export function TiplistPro<T extends ListType2 = ListType2>(
|
|
|
383
383
|
data-reset={inputReset}
|
|
384
384
|
/>
|
|
385
385
|
)}
|
|
386
|
-
isOptionEqualToValue={(option, value) => option.id === value.id}
|
|
386
|
+
isOptionEqualToValue={(option, value) => option.id === (value as T).id}
|
|
387
387
|
sx={sx}
|
|
388
388
|
noOptionsText={noOptionsText}
|
|
389
389
|
loadingText={loadingText}
|
package/src/TwoFieldInput.tsx
CHANGED
|
@@ -11,10 +11,7 @@ type ValueType = string | number | Date | null | undefined;
|
|
|
11
11
|
/**
|
|
12
12
|
* TwoField Input props
|
|
13
13
|
*/
|
|
14
|
-
export type TwoFieldInputProps = Omit<
|
|
15
|
-
InputFieldProps,
|
|
16
|
-
"InputProps" | "value"
|
|
17
|
-
> & {
|
|
14
|
+
export type TwoFieldInputProps = Omit<InputFieldProps, "value"> & {
|
|
18
15
|
/**
|
|
19
16
|
* Values
|
|
20
17
|
*/
|
|
@@ -37,8 +34,8 @@ export function TwoFieldInput(props: TwoFieldInputProps) {
|
|
|
37
34
|
// Destruct
|
|
38
35
|
const {
|
|
39
36
|
name,
|
|
40
|
-
|
|
41
|
-
type
|
|
37
|
+
slotProps,
|
|
38
|
+
type,
|
|
42
39
|
values,
|
|
43
40
|
onValuesChange,
|
|
44
41
|
onChange,
|
|
@@ -46,13 +43,15 @@ export function TwoFieldInput(props: TwoFieldInputProps) {
|
|
|
46
43
|
...rest
|
|
47
44
|
} = props;
|
|
48
45
|
|
|
46
|
+
const { htmlInput, input, ...restSlotProps } = slotProps ?? {};
|
|
47
|
+
|
|
49
48
|
// Local values
|
|
50
49
|
const localValues: [ValueType, ValueType] =
|
|
51
50
|
values == null
|
|
52
51
|
? [null, null]
|
|
53
52
|
: Array.isArray(values)
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
? (values as [ValueType, ValueType])
|
|
54
|
+
: [values as ValueType, null];
|
|
56
55
|
|
|
57
56
|
// Ref
|
|
58
57
|
const valueRef = React.useRef<[ValueType, ValueType]>(localValues);
|
|
@@ -100,29 +99,32 @@ export function TwoFieldInput(props: TwoFieldInputProps) {
|
|
|
100
99
|
type={type}
|
|
101
100
|
value={formatValue(localValues[0], type)}
|
|
102
101
|
ref={dimensions[0][0]}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
102
|
+
slotProps={{
|
|
103
|
+
input: {
|
|
104
|
+
...input,
|
|
105
|
+
endAdornment: (
|
|
106
|
+
<InputAdornment
|
|
107
|
+
position="end"
|
|
108
|
+
sx={{
|
|
109
|
+
display: "flex",
|
|
110
|
+
alignItems: "center",
|
|
111
|
+
gap: 1
|
|
112
|
+
}}
|
|
113
|
+
>
|
|
114
|
+
<ArrowRightAltIcon />
|
|
115
|
+
<Input
|
|
116
|
+
type={type}
|
|
117
|
+
name={`${name}-end`}
|
|
118
|
+
value={formatValue(localValues[1], type)}
|
|
119
|
+
disableUnderline
|
|
120
|
+
onInput={onInput}
|
|
121
|
+
onChange={handleChange}
|
|
122
|
+
slotProps={{ input: htmlInput as any }} // Fix it in the future
|
|
123
|
+
/>
|
|
124
|
+
</InputAdornment>
|
|
125
|
+
)
|
|
126
|
+
},
|
|
127
|
+
...restSlotProps
|
|
126
128
|
}}
|
|
127
129
|
onInput={onInput}
|
|
128
130
|
onChange={handleChange}
|
package/src/UserAvatarEditor.tsx
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type AvatarEditor from "react-avatar-editor";
|
|
3
2
|
import RotateLeftIcon from "@mui/icons-material/RotateLeft";
|
|
4
3
|
import RotateRightIcon from "@mui/icons-material/RotateRight";
|
|
5
4
|
import ClearAllIcon from "@mui/icons-material/ClearAll";
|
|
@@ -9,7 +8,10 @@ import RemoveIcon from "@mui/icons-material/Remove";
|
|
|
9
8
|
import AddIcon from "@mui/icons-material/Add";
|
|
10
9
|
import { Labels } from "./app/Labels";
|
|
11
10
|
import { FileUploadButton } from "./FileUploadButton";
|
|
12
|
-
import {
|
|
11
|
+
import AvatarEditor, {
|
|
12
|
+
type ImageState,
|
|
13
|
+
type AvatarEditorRef
|
|
14
|
+
} from "react-avatar-editor";
|
|
13
15
|
import Stack from "@mui/material/Stack";
|
|
14
16
|
import Skeleton from "@mui/material/Skeleton";
|
|
15
17
|
import ButtonGroup from "@mui/material/ButtonGroup";
|
|
@@ -132,7 +134,7 @@ export function UserAvatarEditor(props: UserAvatarEditorProps) {
|
|
|
132
134
|
maxWidth == null || maxWidth < defaultSize ? 2 * width : maxWidth;
|
|
133
135
|
|
|
134
136
|
// Ref
|
|
135
|
-
const ref = React.
|
|
137
|
+
const ref = React.useRef<AvatarEditorRef>(null);
|
|
136
138
|
|
|
137
139
|
// Image type
|
|
138
140
|
const type = React.useRef<string>("image/jpeg");
|
|
@@ -196,6 +198,13 @@ export function UserAvatarEditor(props: UserAvatarEditorProps) {
|
|
|
196
198
|
|
|
197
199
|
// Handle image load
|
|
198
200
|
const handleLoad = (imageInfo: ImageState) => {
|
|
201
|
+
if (
|
|
202
|
+
imageInfo.resource == null ||
|
|
203
|
+
imageInfo.height == null ||
|
|
204
|
+
imageInfo.width == null
|
|
205
|
+
)
|
|
206
|
+
return;
|
|
207
|
+
|
|
199
208
|
// Ignore too small images
|
|
200
209
|
if (imageInfo.resource.width < 10 || imageInfo.resource.height < 10) return;
|
|
201
210
|
|
|
@@ -293,11 +302,8 @@ export function UserAvatarEditor(props: UserAvatarEditorProps) {
|
|
|
293
302
|
}
|
|
294
303
|
};
|
|
295
304
|
|
|
296
|
-
// Load the component
|
|
297
|
-
const AE = React.lazy(() => import("react-avatar-editor"));
|
|
298
|
-
|
|
299
305
|
return (
|
|
300
|
-
<Stack direction="column" spacing={0.5}
|
|
306
|
+
<Stack direction="column" spacing={0.5} sx={{ width: containerWidth }}>
|
|
301
307
|
<FileUploadButton
|
|
302
308
|
variant="outlined"
|
|
303
309
|
size="medium"
|
|
@@ -314,7 +320,7 @@ export function UserAvatarEditor(props: UserAvatarEditorProps) {
|
|
|
314
320
|
<Skeleton variant="rounded" width={width} height={localHeight} />
|
|
315
321
|
}
|
|
316
322
|
>
|
|
317
|
-
<
|
|
323
|
+
<AvatarEditor
|
|
318
324
|
ref={ref}
|
|
319
325
|
border={border}
|
|
320
326
|
width={width}
|
|
@@ -343,8 +349,7 @@ export function UserAvatarEditor(props: UserAvatarEditorProps) {
|
|
|
343
349
|
<Stack
|
|
344
350
|
spacing={0.5}
|
|
345
351
|
direction="row"
|
|
346
|
-
sx={{ paddingBottom: 2 }}
|
|
347
|
-
alignItems="center"
|
|
352
|
+
sx={{ alignItems: "center", paddingBottom: 2 }}
|
|
348
353
|
>
|
|
349
354
|
<IconButton
|
|
350
355
|
size="small"
|
package/src/ViewContainer.tsx
CHANGED
|
@@ -222,7 +222,11 @@ export function ViewPageGridItem(props: ViewPageGridItemProps) {
|
|
|
222
222
|
{typeof data === "object" ? (
|
|
223
223
|
data
|
|
224
224
|
) : horizontal ? (
|
|
225
|
-
<Typography
|
|
225
|
+
<Typography
|
|
226
|
+
variant="subtitle2"
|
|
227
|
+
component="span"
|
|
228
|
+
sx={{ marginLeft: 0.5 }}
|
|
229
|
+
>
|
|
226
230
|
{data}
|
|
227
231
|
</Typography>
|
|
228
232
|
) : (
|
|
@@ -423,10 +427,10 @@ export function ViewContainer<T extends DataTypes.StringRecord>(
|
|
|
423
427
|
return (
|
|
424
428
|
<Grid
|
|
425
429
|
container
|
|
426
|
-
justifyContent="left"
|
|
427
430
|
className="ET-ViewContainer"
|
|
428
431
|
ref={gridRef}
|
|
429
432
|
spacing={spacing}
|
|
433
|
+
sx={{ justifyContent: "left" }}
|
|
430
434
|
>
|
|
431
435
|
{leftContainer && (leftResult = leftContainer(data)) != null && (
|
|
432
436
|
<React.Fragment>
|
|
@@ -55,7 +55,7 @@ function InputItemUIs({ data }: { data?: CustomFieldData }) {
|
|
|
55
55
|
const optionsRef = React.useRef<HTMLInputElement>(null);
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
|
-
<Grid container spacing={2}
|
|
58
|
+
<Grid container spacing={2} sx={{ marginTop: 1 }}>
|
|
59
59
|
<Grid size={{ xs: 12, sm: 6 }}>
|
|
60
60
|
<ComboBox
|
|
61
61
|
name="type"
|
|
@@ -334,7 +334,7 @@ function InputUIs({
|
|
|
334
334
|
|
|
335
335
|
return (
|
|
336
336
|
<React.Fragment>
|
|
337
|
-
<HBox
|
|
337
|
+
<HBox spacing={1} sx={{ marginTop: 0.5, alignItems: "center" }}>
|
|
338
338
|
<Typography>{labels.sortTip}</Typography>
|
|
339
339
|
<Button
|
|
340
340
|
size="small"
|
|
@@ -364,7 +364,7 @@ function InputUIs({
|
|
|
364
364
|
size={{ xs: 12, sm: 12 }}
|
|
365
365
|
ref={ref}
|
|
366
366
|
style={style}
|
|
367
|
-
|
|
367
|
+
spacing={1}
|
|
368
368
|
>
|
|
369
369
|
<Grid size={smallSize}>
|
|
370
370
|
<IconButton
|
|
@@ -99,9 +99,9 @@ export function CustomFieldViewer(props: CustomFieldViewerProps) {
|
|
|
99
99
|
return (
|
|
100
100
|
<Grid
|
|
101
101
|
container
|
|
102
|
-
justifyContent="left"
|
|
103
102
|
spacing={spacing}
|
|
104
103
|
sx={{
|
|
104
|
+
justifyContent: "left",
|
|
105
105
|
".MuiTypography-subtitle2": {
|
|
106
106
|
fontWeight: "bold"
|
|
107
107
|
}
|
|
@@ -122,8 +122,13 @@ export function CustomFieldViewer(props: CustomFieldViewerProps) {
|
|
|
122
122
|
size={CustomFieldUtils.transformSpace(field.space)}
|
|
123
123
|
{...field.gridItemProps}
|
|
124
124
|
>
|
|
125
|
-
<VBox
|
|
126
|
-
<Typography
|
|
125
|
+
<VBox spacing={verticalGap}>
|
|
126
|
+
<Typography
|
|
127
|
+
component="div"
|
|
128
|
+
fontWeight="bold"
|
|
129
|
+
fontSize="small"
|
|
130
|
+
{...titleProps}
|
|
131
|
+
>
|
|
127
132
|
{field.label ?? name}
|
|
128
133
|
</Typography>
|
|
129
134
|
<Typography {...valueProps}>
|
|
@@ -29,8 +29,8 @@ function parseJsonData(jsonData: unknown): [Record<string, unknown>, number] {
|
|
|
29
29
|
typeof jsonData === "object"
|
|
30
30
|
? jsonData
|
|
31
31
|
: typeof jsonData === "string"
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
? JSON.parse(jsonData)
|
|
33
|
+
: {};
|
|
34
34
|
} catch {}
|
|
35
35
|
}
|
|
36
36
|
return [data, calculateKeys(data)];
|
|
@@ -153,12 +153,12 @@ export function CustomFieldWindow<D extends CustomFieldData = CustomFieldData>(
|
|
|
153
153
|
{
|
|
154
154
|
fullScreen: app.smDown,
|
|
155
155
|
inputs: (
|
|
156
|
-
<Stack
|
|
156
|
+
<Stack sx={{ marginTop: 1.5 }}>
|
|
157
157
|
<Grid
|
|
158
158
|
container
|
|
159
|
-
justifyContent="left"
|
|
160
159
|
spacing={spacing}
|
|
161
160
|
sx={{
|
|
161
|
+
justifyContent: "left",
|
|
162
162
|
".MuiTypography-subtitle2": {
|
|
163
163
|
fontWeight: "bold"
|
|
164
164
|
}
|
package/src/custom/FieldJson.tsx
CHANGED
|
@@ -36,8 +36,8 @@ export const FieldJson: ICustomFieldReact<object> = ({
|
|
|
36
36
|
typeof value === "object"
|
|
37
37
|
? value
|
|
38
38
|
: typeof value === "string"
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
? parseJson(value)
|
|
40
|
+
: undefined;
|
|
41
41
|
inputRef.current.value = obj ? JSON.stringify(obj, null, 4) : "";
|
|
42
42
|
}
|
|
43
43
|
};
|
|
@@ -68,7 +68,7 @@ export const FieldJson: ICustomFieldReact<object> = ({
|
|
|
68
68
|
fullWidth
|
|
69
69
|
multiline
|
|
70
70
|
rows={4}
|
|
71
|
-
|
|
71
|
+
slotProps={{ htmlInput: { maxLength: 1280 } }}
|
|
72
72
|
inputRef={inputRef}
|
|
73
73
|
onChange={() => onChange(name, getValue())}
|
|
74
74
|
{...field.mainSlotProps}
|
|
@@ -44,7 +44,7 @@ export const FieldTexarea: ICustomFieldReact<string> = ({
|
|
|
44
44
|
fullWidth
|
|
45
45
|
multiline
|
|
46
46
|
rows={4}
|
|
47
|
-
|
|
47
|
+
slotProps={{ htmlInput: { maxLength: 1280 } }}
|
|
48
48
|
inputRef={inputRef}
|
|
49
49
|
defaultValue={defaultValue}
|
|
50
50
|
onChange={() => onChange(name, getValue())}
|
package/src/index.ts
CHANGED
package/src/pages/EditPage.tsx
CHANGED
|
@@ -95,18 +95,17 @@ export function EditPage(props: EditPageProps) {
|
|
|
95
95
|
<form onSubmit={onSubmit}>
|
|
96
96
|
<Grid
|
|
97
97
|
container
|
|
98
|
-
justifyContent="left"
|
|
99
98
|
spacing={gridSpacing}
|
|
100
|
-
|
|
99
|
+
sx={{ justifyContent: "left", paddingTop: 1 }}
|
|
101
100
|
>
|
|
102
101
|
{children}
|
|
103
102
|
</Grid>
|
|
104
103
|
<Grid
|
|
105
104
|
container
|
|
106
|
-
|
|
107
|
-
display="flex"
|
|
108
|
-
gap={gridSpacing}
|
|
105
|
+
spacing={gridSpacing}
|
|
109
106
|
sx={{
|
|
107
|
+
position: "sticky",
|
|
108
|
+
display: "flex",
|
|
110
109
|
top: "auto",
|
|
111
110
|
bottom: (theme) =>
|
|
112
111
|
MUGlobal.updateWithTheme(gridSpacing, theme.spacing),
|
package/src/pages/ViewPage.tsx
CHANGED
|
@@ -23,18 +23,20 @@ export function ViewPageActionBar(
|
|
|
23
23
|
actionPaddings?: number | Record<string, string | number>;
|
|
24
24
|
}
|
|
25
25
|
) {
|
|
26
|
-
const { actionPaddings = MUGlobal.pagePaddings, ...rest } = props;
|
|
26
|
+
const { actionPaddings = MUGlobal.pagePaddings, sx, ...rest } = props;
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
29
|
<Stack
|
|
30
30
|
className="ET-ViewPage-Actions"
|
|
31
31
|
direction="row"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
spacing={actionPaddings}
|
|
33
|
+
sx={{
|
|
34
|
+
flexWrap: "wrap",
|
|
35
|
+
justifyContent: "center",
|
|
36
|
+
paddingTop: actionPaddings,
|
|
37
|
+
paddingBottom: actionPaddings,
|
|
38
|
+
...sx
|
|
39
|
+
}}
|
|
38
40
|
{...rest}
|
|
39
41
|
></Stack>
|
|
40
42
|
);
|
|
@@ -44,7 +46,8 @@ export function ViewPageActionBar(
|
|
|
44
46
|
* View page props
|
|
45
47
|
*/
|
|
46
48
|
export interface ViewPageProps<T extends DataTypes.StringRecord>
|
|
47
|
-
extends
|
|
49
|
+
extends
|
|
50
|
+
Omit<CommonPageProps, "children">,
|
|
48
51
|
Omit<ViewContainerProps<T>, "data" | "refresh"> {
|
|
49
52
|
/**
|
|
50
53
|
* Actions
|
package/tsconfig.cjs.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
|
-
"target": "
|
|
5
|
-
"module": "
|
|
4
|
+
"target": "ES2025",
|
|
5
|
+
"module": "ESNext",
|
|
6
6
|
"moduleResolution": "bundler",
|
|
7
7
|
"allowJs": false,
|
|
8
8
|
"isolatedModules": true,
|