@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.
- 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 +2 -2
- 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 +2 -2
- 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 +8 -8
- 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 +2 -3
- 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/src/ComboBox.tsx
CHANGED
|
@@ -151,7 +151,7 @@ export function ComboBox<
|
|
|
151
151
|
const localValue: T | null | undefined =
|
|
152
152
|
idValue != null
|
|
153
153
|
? localOptions.find((o) => o[idField] === idValue)
|
|
154
|
-
: defaultValue ?? value;
|
|
154
|
+
: (defaultValue ?? value);
|
|
155
155
|
|
|
156
156
|
// State
|
|
157
157
|
// null for controlled
|
|
@@ -171,10 +171,10 @@ export function ComboBox<
|
|
|
171
171
|
Object.assign(params, { readOnly });
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
Object.assign(params.
|
|
174
|
+
Object.assign(params.slotProps.htmlInput, { "data-reset": inputReset });
|
|
175
175
|
|
|
176
176
|
if (dataReadonly) {
|
|
177
|
-
params.
|
|
177
|
+
params.slotProps.htmlInput.onKeyDown = (event) => {
|
|
178
178
|
if (Keyboard.isTypingContent(event.key)) {
|
|
179
179
|
event.preventDefault();
|
|
180
180
|
}
|
|
@@ -183,7 +183,9 @@ export function ComboBox<
|
|
|
183
183
|
|
|
184
184
|
// https://stackoverflow.com/questions/15738259/disabling-chrome-autofill
|
|
185
185
|
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html
|
|
186
|
-
Object.assign(params.
|
|
186
|
+
Object.assign(params.slotProps.htmlInput, {
|
|
187
|
+
autoComplete: inputAutoComplete
|
|
188
|
+
});
|
|
187
189
|
|
|
188
190
|
return params;
|
|
189
191
|
};
|
|
@@ -250,7 +252,7 @@ export function ComboBox<
|
|
|
250
252
|
disabled={disabled}
|
|
251
253
|
/>
|
|
252
254
|
{/* Previous input will reset first with "disableClearable = false", next input trigger change works */}
|
|
253
|
-
<Stack
|
|
255
|
+
<Stack spacing={0.5} direction="row">
|
|
254
256
|
<Autocomplete<T, false, false, false>
|
|
255
257
|
value={stateValue}
|
|
256
258
|
disabled={disabled}
|
package/src/ComboBoxMultiple.tsx
CHANGED
|
@@ -172,10 +172,10 @@ export function ComboBoxMultiple<
|
|
|
172
172
|
Object.assign(params, { readOnly });
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
Object.assign(params.
|
|
175
|
+
Object.assign(params.slotProps.htmlInput, { "data-reset": inputReset });
|
|
176
176
|
|
|
177
177
|
if (dataReadonly) {
|
|
178
|
-
params.
|
|
178
|
+
params.slotProps.htmlInput.onKeyDown = (event) => {
|
|
179
179
|
if (Keyboard.isTypingContent(event.key)) {
|
|
180
180
|
event.preventDefault();
|
|
181
181
|
}
|
|
@@ -184,7 +184,9 @@ export function ComboBoxMultiple<
|
|
|
184
184
|
|
|
185
185
|
// https://stackoverflow.com/questions/15738259/disabling-chrome-autofill
|
|
186
186
|
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html
|
|
187
|
-
Object.assign(params.
|
|
187
|
+
Object.assign(params.slotProps.htmlInput, {
|
|
188
|
+
autoComplete: inputAutoComplete
|
|
189
|
+
});
|
|
188
190
|
|
|
189
191
|
return params;
|
|
190
192
|
};
|
package/src/ComboBoxPro.tsx
CHANGED
|
@@ -138,7 +138,7 @@ export function ComboBoxPro<D extends ListType2 = ListType2>(
|
|
|
138
138
|
)}
|
|
139
139
|
getOptionLabel={getOptionLabel}
|
|
140
140
|
getOptionKey={getOptionKey}
|
|
141
|
-
isOptionEqualToValue={(option, value) => option.id === value.id}
|
|
141
|
+
isOptionEqualToValue={(option, value) => option.id === (value as D).id}
|
|
142
142
|
noOptionsText={noOptionsText}
|
|
143
143
|
loadingText={loadingText}
|
|
144
144
|
openText={openText}
|
package/src/CultureDataTable.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { DataTable, DataTableProps } from "./DataTable";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { ListType1 } from "@etsoo/shared";
|
|
4
4
|
import { useAppContext } from "./app/ReactApp";
|
|
5
|
-
import { GridRenderCellParams } from "@mui/x-data-grid/models
|
|
5
|
+
import { GridRenderCellParams } from "@mui/x-data-grid/models";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Culture table props
|
package/src/DataGridEx.tsx
CHANGED
|
@@ -250,12 +250,14 @@ export function DataGridEx<T extends object>(props: DataGridExProps<T>) {
|
|
|
250
250
|
return (
|
|
251
251
|
<Box
|
|
252
252
|
className="DataGridEx-Header"
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
253
|
+
sx={{
|
|
254
|
+
display: "flex",
|
|
255
|
+
alignItems: "center",
|
|
256
|
+
borderBottom: boldBorder,
|
|
257
|
+
fontWeight: 500,
|
|
258
|
+
minWidth: widthCalculator.total,
|
|
259
|
+
height: headerHeight
|
|
260
|
+
}}
|
|
259
261
|
>
|
|
260
262
|
{columns.map((column, index) => {
|
|
261
263
|
// Destruct
|
|
@@ -309,8 +311,10 @@ export function DataGridEx<T extends object>(props: DataGridExProps<T>) {
|
|
|
309
311
|
return (
|
|
310
312
|
<Box
|
|
311
313
|
key={field ?? index.toString()}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
+
sx={{
|
|
315
|
+
textAlign: GridAlignGet(align, type),
|
|
316
|
+
width: columnWidth(index)
|
|
317
|
+
}}
|
|
314
318
|
>
|
|
315
319
|
<Box
|
|
316
320
|
className="DataGridEx-Cell"
|
|
@@ -330,12 +334,14 @@ export function DataGridEx<T extends object>(props: DataGridExProps<T>) {
|
|
|
330
334
|
return (
|
|
331
335
|
<Box
|
|
332
336
|
className="DataGridEx-Footer"
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
337
|
+
sx={{
|
|
338
|
+
display: "flex",
|
|
339
|
+
alignItems: "center",
|
|
340
|
+
borderTop: thinBorder,
|
|
341
|
+
marginTop: "1px",
|
|
342
|
+
minHeight: widthCalculator.total,
|
|
343
|
+
height: bottomHeight - 1
|
|
344
|
+
}}
|
|
339
345
|
>
|
|
340
346
|
{columns.map((column, index) => {
|
|
341
347
|
// Destruct
|
|
@@ -358,8 +364,10 @@ export function DataGridEx<T extends object>(props: DataGridExProps<T>) {
|
|
|
358
364
|
return (
|
|
359
365
|
<Box
|
|
360
366
|
key={"bottom-" + (field ?? index.toString())}
|
|
361
|
-
|
|
362
|
-
|
|
367
|
+
sx={{
|
|
368
|
+
textAlign: GridAlignGet(align, type),
|
|
369
|
+
width: columnWidth(index)
|
|
370
|
+
}}
|
|
363
371
|
>
|
|
364
372
|
<Box
|
|
365
373
|
className="DataGridEx-Cell"
|
|
@@ -646,13 +654,12 @@ export function DataGridEx<T extends object>(props: DataGridExProps<T>) {
|
|
|
646
654
|
data == null || cellBoxStyle == null
|
|
647
655
|
? undefined
|
|
648
656
|
: typeof cellBoxStyle === "function"
|
|
649
|
-
|
|
650
|
-
|
|
657
|
+
? cellBoxStyle(data)
|
|
658
|
+
: cellBoxStyle;
|
|
651
659
|
|
|
652
660
|
const cellProps: BoxProps = {
|
|
653
661
|
className: "DataGridEx-Cell",
|
|
654
|
-
textAlign: GridAlignGet(align, type),
|
|
655
|
-
sx: { ...boxStyle }
|
|
662
|
+
sx: { textAlign: GridAlignGet(align, type), ...boxStyle }
|
|
656
663
|
};
|
|
657
664
|
|
|
658
665
|
const child = cellRenderer({
|
package/src/DataSteps.tsx
CHANGED
|
@@ -65,17 +65,16 @@ export function DataSteps<T extends object>(props: DataStepsProps<T>) {
|
|
|
65
65
|
|
|
66
66
|
// Destruct
|
|
67
67
|
const {
|
|
68
|
-
InputLabelProps = {},
|
|
69
68
|
jsonValue,
|
|
70
69
|
valueFormatter = (_data) => "...",
|
|
71
70
|
onValueChange,
|
|
72
71
|
steps,
|
|
73
72
|
value = "",
|
|
73
|
+
slotProps,
|
|
74
74
|
...rest
|
|
75
75
|
} = props;
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
InputLabelProps.shrink ??= MUGlobal.searchFieldShrink;
|
|
77
|
+
const { input, htmlInput, inputLabel, ...restSlotProps } = slotProps ?? {};
|
|
79
78
|
|
|
80
79
|
// Current index
|
|
81
80
|
const indexRef = React.useRef<number>(-1);
|
|
@@ -99,11 +98,13 @@ export function DataSteps<T extends object>(props: DataStepsProps<T>) {
|
|
|
99
98
|
...rest,
|
|
100
99
|
buttons: (n, callback) => (
|
|
101
100
|
<HBox
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
101
|
+
spacing={2}
|
|
102
|
+
sx={{
|
|
103
|
+
justifyContent: "space-between",
|
|
104
|
+
paddingLeft: 2,
|
|
105
|
+
paddingRight: 2,
|
|
106
|
+
paddingBottom: 2
|
|
107
|
+
}}
|
|
107
108
|
>
|
|
108
109
|
{index === 0 ? (
|
|
109
110
|
<Button
|
|
@@ -179,21 +180,25 @@ export function DataSteps<T extends object>(props: DataStepsProps<T>) {
|
|
|
179
180
|
return (
|
|
180
181
|
<TextField
|
|
181
182
|
autoComplete="off"
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
183
|
+
slotProps={{
|
|
184
|
+
input: {
|
|
185
|
+
onKeyDown: (event) => {
|
|
186
|
+
if (event.key === "Tab") return;
|
|
187
|
+
cancelInput(event);
|
|
188
|
+
},
|
|
189
|
+
onPaste: cancelInput,
|
|
190
|
+
endAdornment: (
|
|
191
|
+
<InputAdornment position="end">
|
|
192
|
+
<IconButton edge="end" size="small">
|
|
193
|
+
<StartIcon />
|
|
194
|
+
</IconButton>
|
|
195
|
+
</InputAdornment>
|
|
196
|
+
),
|
|
197
|
+
...input
|
|
188
198
|
},
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
<IconButton edge="end" size="small">
|
|
193
|
-
<StartIcon />
|
|
194
|
-
</IconButton>
|
|
195
|
-
</InputAdornment>
|
|
196
|
-
)
|
|
199
|
+
htmlInput: { style: { cursor: "pointer" }, ...htmlInput },
|
|
200
|
+
inputLabel: { shrink: MUGlobal.searchFieldShrink, ...inputLabel },
|
|
201
|
+
...restSlotProps
|
|
197
202
|
}}
|
|
198
203
|
onClick={() => showStep(0)}
|
|
199
204
|
value={localValue}
|
package/src/FileUploadButton.tsx
CHANGED
|
@@ -104,11 +104,12 @@ export function FileUploadButton(props: FileUploadButtonProps) {
|
|
|
104
104
|
// Layout
|
|
105
105
|
return (
|
|
106
106
|
<HBox
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
sx={{
|
|
108
|
+
alignItems: "center",
|
|
109
|
+
flexWrap: "wrap",
|
|
110
|
+
border: (theme) =>
|
|
111
|
+
dragOver ? "1px dashed " + theme.palette.warning.main : undefined
|
|
112
|
+
}}
|
|
112
113
|
spacing={0.5}
|
|
113
114
|
{...(dropFilesLabel == null
|
|
114
115
|
? undefined
|
package/src/FlexBox.tsx
CHANGED
|
@@ -5,8 +5,8 @@ import Stack, { StackProps } from "@mui/material/Stack";
|
|
|
5
5
|
* @param props Props
|
|
6
6
|
* @returns Component
|
|
7
7
|
*/
|
|
8
|
-
export function HBox(props: Omit<StackProps, "ref">) {
|
|
9
|
-
return <Stack direction="row"
|
|
8
|
+
export function HBox(props: Omit<StackProps, "ref" | "direction">) {
|
|
9
|
+
return <Stack direction="row" {...props} />;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -15,14 +15,14 @@ export function HBox(props: Omit<StackProps, "ref">) {
|
|
|
15
15
|
* @returns Component
|
|
16
16
|
*/
|
|
17
17
|
export function HBoxList(props: Omit<StackProps, "direction">) {
|
|
18
|
+
const { sx, ...rest } = props;
|
|
19
|
+
|
|
18
20
|
return (
|
|
19
21
|
<Stack
|
|
20
22
|
spacing={1}
|
|
21
|
-
gap={1}
|
|
22
23
|
direction="row"
|
|
23
|
-
flexWrap
|
|
24
|
-
|
|
25
|
-
{...props}
|
|
24
|
+
sx={{ flexWrap: "wrap", ...sx }}
|
|
25
|
+
{...rest}
|
|
26
26
|
/>
|
|
27
27
|
);
|
|
28
28
|
}
|
|
@@ -32,6 +32,6 @@ export function HBoxList(props: Omit<StackProps, "direction">) {
|
|
|
32
32
|
* @param props Props
|
|
33
33
|
* @returns Component
|
|
34
34
|
*/
|
|
35
|
-
export function VBox(props: Omit<StackProps, "ref">) {
|
|
35
|
+
export function VBox(props: Omit<StackProps, "ref" | "direction">) {
|
|
36
36
|
return <Stack direction="column" {...props} />;
|
|
37
37
|
}
|
package/src/InputField.tsx
CHANGED
|
@@ -33,8 +33,6 @@ export type InputFieldProps = TextFieldProps & {
|
|
|
33
33
|
export function InputField(props: InputFieldProps) {
|
|
34
34
|
// Destruct
|
|
35
35
|
const {
|
|
36
|
-
InputProps = {},
|
|
37
|
-
inputProps = {},
|
|
38
36
|
slotProps,
|
|
39
37
|
onChange,
|
|
40
38
|
onChangeDelay,
|
|
@@ -88,10 +86,9 @@ export function InputField(props: InputFieldProps) {
|
|
|
88
86
|
slotProps={{
|
|
89
87
|
htmlInput: {
|
|
90
88
|
["data-min-chars"]: changeDelay?.[1],
|
|
91
|
-
...htmlInput
|
|
92
|
-
...inputProps
|
|
89
|
+
...htmlInput
|
|
93
90
|
},
|
|
94
|
-
input: { readOnly, ...input
|
|
91
|
+
input: { readOnly, ...input },
|
|
95
92
|
inputLabel: {
|
|
96
93
|
shrink: MUGlobal.inputFieldShrink,
|
|
97
94
|
...inputLabel
|
package/src/MoreFab.tsx
CHANGED
|
@@ -165,7 +165,7 @@ export function MoreFab(props: MoreFabProps) {
|
|
|
165
165
|
transformOrigin={transformOrigin}
|
|
166
166
|
open={open}
|
|
167
167
|
onClose={handleClose}
|
|
168
|
-
|
|
168
|
+
slotProps={{ paper: PaperProps }}
|
|
169
169
|
>
|
|
170
170
|
{actionsLocal.map(({ label, icon, action }, index) =>
|
|
171
171
|
label === "-" ? (
|
|
@@ -182,13 +182,13 @@ export function MoreFab(props: MoreFabProps) {
|
|
|
182
182
|
}
|
|
183
183
|
: { component: Link, to: action }
|
|
184
184
|
: Array.isArray(action)
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
185
|
+
? { component: Link, to: action[0], state: action[1] }
|
|
186
|
+
: {
|
|
187
|
+
onClick: (event: React.MouseEvent) => {
|
|
188
|
+
handleClose();
|
|
189
|
+
if (typeof action === "function") action(event);
|
|
190
|
+
}
|
|
191
|
+
})}
|
|
192
192
|
>
|
|
193
193
|
{icon != null && <ListItemIcon>{icon}</ListItemIcon>}
|
|
194
194
|
<ListItemText inset={icon == null && hasIcon}>
|
package/src/NotifierMU.tsx
CHANGED
|
@@ -380,7 +380,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
380
380
|
|
|
381
381
|
const mRef = content.props.mRef;
|
|
382
382
|
|
|
383
|
-
const errorRef = React.createRef<
|
|
383
|
+
const errorRef = React.createRef<HTMLDivElement>();
|
|
384
384
|
|
|
385
385
|
const setError = (error?: string) => {
|
|
386
386
|
if (errorRef.current == null) return;
|
|
@@ -449,8 +449,8 @@ export class NotificationMU extends NotificationReact {
|
|
|
449
449
|
<DialogContent {...inputProps}>
|
|
450
450
|
{content}
|
|
451
451
|
<Typography
|
|
452
|
+
component="div"
|
|
452
453
|
variant="caption"
|
|
453
|
-
display="block"
|
|
454
454
|
ref={errorRef}
|
|
455
455
|
color="error"
|
|
456
456
|
/>
|
|
@@ -512,7 +512,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
512
512
|
} = this.inputProps ?? {};
|
|
513
513
|
|
|
514
514
|
const inputRef = React.createRef<HTMLInputElement>();
|
|
515
|
-
const errorRef = React.createRef<
|
|
515
|
+
const errorRef = React.createRef<HTMLDivElement>();
|
|
516
516
|
|
|
517
517
|
const setError = (error?: string) => {
|
|
518
518
|
if (errorRef.current == null) return;
|
|
@@ -657,8 +657,8 @@ export class NotificationMU extends NotificationReact {
|
|
|
657
657
|
)}
|
|
658
658
|
{localInputs}
|
|
659
659
|
<Typography
|
|
660
|
+
component="div"
|
|
660
661
|
variant="caption"
|
|
661
|
-
display="block"
|
|
662
662
|
ref={errorRef}
|
|
663
663
|
color="error"
|
|
664
664
|
/>
|
|
@@ -747,11 +747,11 @@ export class NotificationMU extends NotificationReact {
|
|
|
747
747
|
{...options}
|
|
748
748
|
>
|
|
749
749
|
<Box
|
|
750
|
-
display="flex"
|
|
751
|
-
flexDirection="column"
|
|
752
|
-
flexWrap="nowrap"
|
|
753
|
-
alignItems="center"
|
|
754
750
|
sx={{
|
|
751
|
+
display: "flex",
|
|
752
|
+
flexDirection: "column",
|
|
753
|
+
flexWrap: "nowrap",
|
|
754
|
+
alignItems: "center",
|
|
755
755
|
"& > :not(style) + :not(style)": {
|
|
756
756
|
marginTop: (theme) => theme.spacing(1)
|
|
757
757
|
}
|
|
@@ -759,7 +759,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
759
759
|
>
|
|
760
760
|
<CircularProgress {...setupProps} />
|
|
761
761
|
{content && (
|
|
762
|
-
<Box
|
|
762
|
+
<Box sx={{ maxWidth: maxWidth === false ? undefined : maxWidth }}>
|
|
763
763
|
{content}
|
|
764
764
|
</Box>
|
|
765
765
|
)}
|
|
@@ -918,11 +918,11 @@ export class NotifierMU extends NotifierReact {
|
|
|
918
918
|
open
|
|
919
919
|
>
|
|
920
920
|
<Box
|
|
921
|
-
display="flex"
|
|
922
|
-
flexDirection="column"
|
|
923
|
-
flexWrap="nowrap"
|
|
924
921
|
key={`box-${alignText}`}
|
|
925
922
|
sx={{
|
|
923
|
+
display: "flex",
|
|
924
|
+
flexDirection: "column",
|
|
925
|
+
flexWrap: "nowrap",
|
|
926
926
|
"& > :not(style) + :not(style)": {
|
|
927
927
|
marginTop: (theme) => theme.spacing(1)
|
|
928
928
|
}
|
package/src/NumberInputField.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { InputField, InputFieldProps } from "./InputField";
|
|
|
3
3
|
import { Currency } from "@etsoo/appscript";
|
|
4
4
|
import { NumberUtils } from "@etsoo/shared";
|
|
5
5
|
import InputAdornment from "@mui/material/InputAdornment";
|
|
6
|
+
import { NumberFieldInput } from "@base-ui/react/number-field";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Number input field properties
|
package/src/OptionGroup.tsx
CHANGED
|
@@ -159,8 +159,8 @@ export function OptionGroup<
|
|
|
159
159
|
defaultValue == null
|
|
160
160
|
? []
|
|
161
161
|
: Array.isArray(defaultValue)
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
? defaultValue
|
|
163
|
+
: [defaultValue],
|
|
164
164
|
[defaultValue]
|
|
165
165
|
);
|
|
166
166
|
|
|
@@ -294,9 +294,7 @@ export function OptionGroup<
|
|
|
294
294
|
}}
|
|
295
295
|
/>
|
|
296
296
|
) : (
|
|
297
|
-
<Box
|
|
298
|
-
{group}
|
|
299
|
-
</Box>
|
|
297
|
+
<Box sx={{ paddingLeft: 2, paddingY: "7px" }}>{group}</Box>
|
|
300
298
|
)}
|
|
301
299
|
</FormControl>
|
|
302
300
|
{helperText && (
|
package/src/OptionGroupFlag.tsx
CHANGED
|
@@ -199,8 +199,8 @@ export function OptionGroupFlag<
|
|
|
199
199
|
? typeValue
|
|
200
200
|
: undefined
|
|
201
201
|
: event.target.checked
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
? value | typeValue
|
|
203
|
+
: value ^ typeValue
|
|
204
204
|
) as (T[D] & number) | undefined;
|
|
205
205
|
|
|
206
206
|
if (onValueChange) onValueChange(newValue);
|
|
@@ -248,9 +248,7 @@ export function OptionGroupFlag<
|
|
|
248
248
|
}}
|
|
249
249
|
/>
|
|
250
250
|
) : (
|
|
251
|
-
<Box
|
|
252
|
-
{group}
|
|
253
|
-
</Box>
|
|
251
|
+
<Box sx={{ paddingLeft: 2, paddingY: "7px" }}>{group}</Box>
|
|
254
252
|
)}
|
|
255
253
|
</FormControl>
|
|
256
254
|
{helperText && (
|
package/src/QuickList.tsx
CHANGED
|
@@ -88,9 +88,9 @@ export function QuickList<T extends ListType2 = ListType2>(
|
|
|
88
88
|
itemProps,
|
|
89
89
|
loadData,
|
|
90
90
|
noMatchesLabel = app?.get("noMatches"),
|
|
91
|
-
|
|
92
|
-
height = "480px",
|
|
91
|
+
spacing = 1,
|
|
93
92
|
onItemClick,
|
|
93
|
+
sx,
|
|
94
94
|
...rest
|
|
95
95
|
} = props;
|
|
96
96
|
|
|
@@ -115,7 +115,7 @@ export function QuickList<T extends ListType2 = ListType2>(
|
|
|
115
115
|
|
|
116
116
|
// Layout
|
|
117
117
|
return (
|
|
118
|
-
<VBox
|
|
118
|
+
<VBox spacing={spacing} sx={{ height: "480px", ...sx }} {...rest}>
|
|
119
119
|
<InputField
|
|
120
120
|
label={label}
|
|
121
121
|
onChangeDelay={(event) => {
|
|
@@ -131,7 +131,7 @@ export function QuickList<T extends ListType2 = ListType2>(
|
|
|
131
131
|
{loading ? (
|
|
132
132
|
<LinearProgress />
|
|
133
133
|
) : items.length === 0 ? (
|
|
134
|
-
<Typography
|
|
134
|
+
<Typography align="center">{noMatchesLabel}</Typography>
|
|
135
135
|
) : (
|
|
136
136
|
<List>
|
|
137
137
|
{items.map((item) => (
|
|
@@ -408,11 +408,11 @@ export function ResponsibleContainer<T extends object, F>(
|
|
|
408
408
|
ref={dimensions[0][0]}
|
|
409
409
|
className="SearchBox"
|
|
410
410
|
sx={{
|
|
411
|
+
marginBottom: hasFields
|
|
412
|
+
? `${searchBarBottom}px!important`
|
|
413
|
+
: undefined,
|
|
411
414
|
height: hasFields ? searchBarHeight : 0
|
|
412
415
|
}}
|
|
413
|
-
marginBottom={
|
|
414
|
-
hasFields ? `${searchBarBottom}px!important` : undefined
|
|
415
|
-
}
|
|
416
416
|
>
|
|
417
417
|
{searchBar}
|
|
418
418
|
</Box>
|
package/src/SearchBar.tsx
CHANGED
|
@@ -362,14 +362,14 @@ export function SearchBar(props: SearchBarProps) {
|
|
|
362
362
|
<Stack
|
|
363
363
|
ref={dimensions[0][0]}
|
|
364
364
|
className="SearchBarContainer"
|
|
365
|
-
justifyContent="center"
|
|
366
|
-
alignItems="center"
|
|
367
365
|
direction="row"
|
|
368
366
|
spacing={`${itemGap}px`}
|
|
369
|
-
width={width}
|
|
370
|
-
overflow="hidden"
|
|
371
|
-
paddingTop="6px"
|
|
372
367
|
sx={{
|
|
368
|
+
alignItems: "center",
|
|
369
|
+
justifyContent: "center",
|
|
370
|
+
width,
|
|
371
|
+
overflow: "hidden",
|
|
372
|
+
paddingTop: "6px",
|
|
373
373
|
"& > :not(style)": {
|
|
374
374
|
flexBasis: "auto",
|
|
375
375
|
flexGrow: 0,
|
|
@@ -429,10 +429,10 @@ export function SearchBar(props: SearchBarProps) {
|
|
|
429
429
|
>
|
|
430
430
|
<Stack
|
|
431
431
|
direction="column"
|
|
432
|
-
alignItems="stretch"
|
|
433
432
|
spacing={2}
|
|
434
|
-
padding={2}
|
|
435
433
|
sx={{
|
|
434
|
+
padding: 2,
|
|
435
|
+
alignItems: "stretch",
|
|
436
436
|
"& > :not(style)": {
|
|
437
437
|
minWidth: "100px"
|
|
438
438
|
}
|
package/src/SearchField.tsx
CHANGED
|
@@ -32,25 +32,16 @@ export function SearchField(props: SearchFieldProps) {
|
|
|
32
32
|
// Destruct
|
|
33
33
|
const {
|
|
34
34
|
changeDelay,
|
|
35
|
-
InputLabelProps = {},
|
|
36
|
-
InputProps = {},
|
|
37
|
-
inputProps = {},
|
|
38
35
|
onChange,
|
|
39
36
|
readOnly,
|
|
40
37
|
size = MUGlobal.searchFieldSize,
|
|
41
38
|
variant = MUGlobal.searchFieldVariant,
|
|
42
39
|
minChars = 0,
|
|
40
|
+
slotProps,
|
|
43
41
|
...rest
|
|
44
42
|
} = props;
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
InputLabelProps.shrink ??= MUGlobal.searchFieldShrink;
|
|
48
|
-
|
|
49
|
-
// Read only
|
|
50
|
-
if (readOnly != null) InputProps.readOnly = readOnly;
|
|
51
|
-
|
|
52
|
-
// Min characters
|
|
53
|
-
inputProps["data-min-chars"] = minChars;
|
|
44
|
+
const { input, inputLabel, htmlInput, ...restSlotProps } = slotProps ?? {};
|
|
54
45
|
|
|
55
46
|
const isMounted = React.useRef(true);
|
|
56
47
|
const delayed =
|
|
@@ -90,12 +81,15 @@ export function SearchField(props: SearchFieldProps) {
|
|
|
90
81
|
// Layout
|
|
91
82
|
return (
|
|
92
83
|
<TextField
|
|
93
|
-
InputLabelProps={InputLabelProps}
|
|
94
|
-
InputProps={InputProps}
|
|
95
|
-
inputProps={inputProps}
|
|
96
84
|
onChange={onChangeEx}
|
|
97
85
|
size={size}
|
|
98
86
|
variant={variant}
|
|
87
|
+
slotProps={{
|
|
88
|
+
input: { readOnly, ...input },
|
|
89
|
+
inputLabel: { shrink: MUGlobal.searchFieldShrink, ...inputLabel },
|
|
90
|
+
htmlInput: { ["data-min-chars"]: minChars, ...htmlInput },
|
|
91
|
+
...restSlotProps
|
|
92
|
+
}}
|
|
99
93
|
{...rest}
|
|
100
94
|
/>
|
|
101
95
|
);
|
package/src/SwitchAnt.tsx
CHANGED
|
@@ -72,7 +72,7 @@ export function SwitchAnt(props: SwitchAntProps) {
|
|
|
72
72
|
|
|
73
73
|
// Layout
|
|
74
74
|
return (
|
|
75
|
-
<Stack direction="row" spacing={1} alignItems
|
|
75
|
+
<Stack direction="row" spacing={1} sx={{ alignItems: "center" }}>
|
|
76
76
|
<Typography
|
|
77
77
|
onClick={() => controlChecked && ref.current?.click()}
|
|
78
78
|
sx={{
|
|
@@ -86,7 +86,7 @@ export function SwitchAnt(props: SwitchAntProps) {
|
|
|
86
86
|
</Typography>
|
|
87
87
|
<Switch
|
|
88
88
|
checked={controlChecked}
|
|
89
|
-
|
|
89
|
+
ref={ref}
|
|
90
90
|
value={value}
|
|
91
91
|
onChange={onChangeLocal}
|
|
92
92
|
{...rest}
|
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>}
|