@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.
Files changed (112) hide show
  1. package/__tests__/SwitchAnt.tsx +6 -7
  2. package/lib/cjs/ButtonPopupCheckbox.js +8 -3
  3. package/lib/cjs/ButtonPopupRadio.js +6 -2
  4. package/lib/cjs/ComboBox.js +7 -5
  5. package/lib/cjs/ComboBoxMultiple.js +5 -3
  6. package/lib/cjs/DataGridEx.js +25 -6
  7. package/lib/cjs/DataSteps.js +21 -11
  8. package/lib/cjs/FileUploadButton.js +5 -1
  9. package/lib/cjs/FlexBox.d.ts +2 -2
  10. package/lib/cjs/FlexBox.js +3 -2
  11. package/lib/cjs/InputField.js +3 -4
  12. package/lib/cjs/MoreFab.js +1 -1
  13. package/lib/cjs/NotifierMU.js +12 -5
  14. package/lib/cjs/OptionGroup.js +1 -1
  15. package/lib/cjs/OptionGroupFlag.js +1 -1
  16. package/lib/cjs/QuickList.js +3 -3
  17. package/lib/cjs/ResponsibleContainer.js +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 +8 -5
  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 +8 -5
  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 +14 -14
  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 +15 -10
  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
  111. package/tsconfig.cjs.json +1 -1
  112. package/tsconfig.json +2 -2
@@ -148,7 +148,7 @@ function ButtonPopupList<D extends DnDItemType>(
148
148
  }, [value]);
149
149
 
150
150
  return (
151
- <VBox gap={2}>
151
+ <VBox spacing={2}>
152
152
  <RadioGroup
153
153
  value={currentValue ?? ""}
154
154
  name="radio-buttons-group"
@@ -167,10 +167,12 @@ function ButtonPopupList<D extends DnDItemType>(
167
167
  {items.map((item) => (
168
168
  <Grid
169
169
  size={itemSize}
170
- display="flex"
171
- justifyContent="flex-start"
172
- alignItems="center"
173
- gap={1}
170
+ sx={{
171
+ display: "flex",
172
+ alignItems: "center",
173
+ justifyContent: "flex-start"
174
+ }}
175
+ spacing={1}
174
176
  key={item.id}
175
177
  >
176
178
  <FormControlLabel
@@ -182,7 +184,7 @@ function ButtonPopupList<D extends DnDItemType>(
182
184
  </Grid>
183
185
  </RadioGroup>
184
186
  {onAdd && (
185
- <HBox gap={1}>
187
+ <HBox spacing={1}>
186
188
  <TextField
187
189
  variant="outlined"
188
190
  label={labels?.more}
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.inputProps, { "data-reset": inputReset });
174
+ Object.assign(params.slotProps.htmlInput, { "data-reset": inputReset });
175
175
 
176
176
  if (dataReadonly) {
177
- params.inputProps.onKeyDown = (event) => {
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.inputProps, { autoComplete: inputAutoComplete });
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 gap={0.5} direction="row" width="100%">
255
+ <Stack spacing={0.5} direction="row">
254
256
  <Autocomplete<T, false, false, false>
255
257
  value={stateValue}
256
258
  disabled={disabled}
@@ -172,10 +172,10 @@ export function ComboBoxMultiple<
172
172
  Object.assign(params, { readOnly });
173
173
  }
174
174
 
175
- Object.assign(params.inputProps, { "data-reset": inputReset });
175
+ Object.assign(params.slotProps.htmlInput, { "data-reset": inputReset });
176
176
 
177
177
  if (dataReadonly) {
178
- params.inputProps.onKeyDown = (event) => {
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.inputProps, { autoComplete: inputAutoComplete });
187
+ Object.assign(params.slotProps.htmlInput, {
188
+ autoComplete: inputAutoComplete
189
+ });
188
190
 
189
191
  return params;
190
192
  };
@@ -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}
@@ -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/params";
5
+ import { GridRenderCellParams } from "@mui/x-data-grid/models";
6
6
 
7
7
  /**
8
8
  * Culture table props
@@ -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
- display="flex"
254
- alignItems="center"
255
- borderBottom={boldBorder}
256
- fontWeight={500}
257
- minWidth={widthCalculator.total}
258
- height={headerHeight}
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
- textAlign={GridAlignGet(align, type)}
313
- width={columnWidth(index)}
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
- display="flex"
334
- alignItems="center"
335
- borderTop={thinBorder}
336
- marginTop="1px"
337
- minWidth={widthCalculator.total}
338
- height={bottomHeight - 1}
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
- textAlign={GridAlignGet(align, type)}
362
- width={columnWidth(index)}
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
- ? cellBoxStyle(data)
650
- : cellBoxStyle;
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
- // Shrink
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
- paddingLeft={2}
103
- paddingRight={2}
104
- paddingBottom={2}
105
- gap={2}
106
- justifyContent="space-between"
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
- InputLabelProps={InputLabelProps}
183
- inputProps={{ style: { cursor: "pointer" } }}
184
- InputProps={{
185
- onKeyDown: (event) => {
186
- if (event.key === "Tab") return;
187
- cancelInput(event);
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
- onPaste: cancelInput,
190
- endAdornment: (
191
- <InputAdornment position="end">
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}
@@ -104,11 +104,12 @@ export function FileUploadButton(props: FileUploadButtonProps) {
104
104
  // Layout
105
105
  return (
106
106
  <HBox
107
- alignItems="center"
108
- flexWrap="wrap"
109
- border={(theme) =>
110
- dragOver ? "1px dashed " + theme.palette.warning.main : undefined
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" width="100%" {...props} />;
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="wrap"
24
- width="100%"
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
  }
@@ -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, ...InputProps },
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
- PaperProps={PaperProps}
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
- ? { 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
- })}
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}>
@@ -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<HTMLSpanElement>();
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<HTMLSpanElement>();
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 maxWidth={maxWidth === false ? undefined : maxWidth}>
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
  }
@@ -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
@@ -159,8 +159,8 @@ export function OptionGroup<
159
159
  defaultValue == null
160
160
  ? []
161
161
  : Array.isArray(defaultValue)
162
- ? defaultValue
163
- : [defaultValue],
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 paddingLeft={2} paddingY="7px">
298
- {group}
299
- </Box>
297
+ <Box sx={{ paddingLeft: 2, paddingY: "7px" }}>{group}</Box>
300
298
  )}
301
299
  </FormControl>
302
300
  {helperText && (
@@ -199,8 +199,8 @@ export function OptionGroupFlag<
199
199
  ? typeValue
200
200
  : undefined
201
201
  : event.target.checked
202
- ? value | typeValue
203
- : value ^ typeValue
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 paddingLeft={2} paddingY="7px">
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
- gap = 1,
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 gap={gap} height={height} {...rest}>
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 textAlign="center">{noMatchesLabel}</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
  }
@@ -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
- // Shrink
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="center">
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
- inputRef={ref}
89
+ ref={ref}
90
90
  value={value}
91
91
  onChange={onChangeLocal}
92
92
  {...rest}