@rjsf/mui 6.5.1 → 6.5.2

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 (38) hide show
  1. package/dist/index.cjs +181 -73
  2. package/dist/index.cjs.map +2 -2
  3. package/dist/mui.esm.js +181 -73
  4. package/dist/mui.esm.js.map +2 -2
  5. package/dist/mui.umd.js +181 -73
  6. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +3 -3
  7. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
  8. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +3 -3
  9. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
  10. package/lib/DescriptionField/DescriptionField.js +3 -4
  11. package/lib/DescriptionField/DescriptionField.js.map +1 -1
  12. package/lib/ErrorList/ErrorList.js +4 -4
  13. package/lib/ErrorList/ErrorList.js.map +1 -1
  14. package/lib/FieldHelpTemplate/FieldHelpTemplate.js +3 -4
  15. package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
  16. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +4 -4
  17. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
  18. package/lib/SubmitButton/SubmitButton.js +3 -3
  19. package/lib/SubmitButton/SubmitButton.js.map +1 -1
  20. package/lib/TitleField/TitleField.js +5 -5
  21. package/lib/TitleField/TitleField.js.map +1 -1
  22. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +3 -5
  23. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
  24. package/lib/tsconfig.tsbuildinfo +1 -1
  25. package/lib/util.d.ts +19 -0
  26. package/lib/util.js +9 -0
  27. package/lib/util.js.map +1 -1
  28. package/package.json +9 -9
  29. package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +25 -9
  30. package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +19 -7
  31. package/src/DescriptionField/DescriptionField.tsx +8 -4
  32. package/src/ErrorList/ErrorList.tsx +19 -9
  33. package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +4 -5
  34. package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +22 -6
  35. package/src/SubmitButton/SubmitButton.tsx +9 -4
  36. package/src/TitleField/TitleField.tsx +20 -8
  37. package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +5 -7
  38. package/src/util.ts +36 -0
package/dist/mui.umd.js CHANGED
@@ -17,6 +17,15 @@
17
17
  }
18
18
  return muiProps;
19
19
  }
20
+ function computeSxProps(sxProps, muiProps) {
21
+ if (!muiProps) {
22
+ return sxProps;
23
+ }
24
+ if (Array.isArray(muiProps?.sx)) {
25
+ return [sxProps, ...muiProps.sx];
26
+ }
27
+ return { ...sxProps, ...muiProps?.sx };
28
+ }
20
29
  function AddButton({
21
30
  uiSchema,
22
31
  registry,
@@ -49,19 +58,43 @@
49
58
  fontWeight: "bold",
50
59
  minWidth: 0
51
60
  };
52
- const { rjsfSlotProps: muiSlotProps } = getMuiProps(uiOptions);
53
- return /* @__PURE__ */ jsxRuntime.jsxs(Grid4, { container: true, alignItems: "center", ...muiSlotProps?.arrayItemGridContainer, children: [
54
- /* @__PURE__ */ jsxRuntime.jsx(
55
- Grid4,
56
- {
57
- size: { xs: 8, sm: 9, md: 10, lg: 11, xl: 11.25 },
58
- style: { overflow: "auto" },
59
- ...muiSlotProps?.arrayItemGridItem,
60
- children: /* @__PURE__ */ jsxRuntime.jsx(Box, { mb: 2, ...muiSlotProps?.arrayItemOuterBox, children: /* @__PURE__ */ jsxRuntime.jsx(Paper, { elevation: 2, ...muiSlotProps?.arrayItemPaper, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { p: 2, ...muiSlotProps?.arrayItemInnerBox, children }) }) })
61
- }
62
- ),
63
- hasToolbar && /* @__PURE__ */ jsxRuntime.jsx(Grid4, { sx: { mt: hasDescription ? -5 : -1.5 }, ...muiSlotProps?.arrayItemToolbarGrid, children: /* @__PURE__ */ jsxRuntime.jsx(ArrayFieldItemButtonsTemplate, { ...buttonsProps, style: btnStyle }) })
64
- ] });
61
+ const {
62
+ rjsfSlotProps: {
63
+ arrayItemGridContainer,
64
+ arrayItemGridItem,
65
+ arrayItemInnerBox,
66
+ arrayItemOuterBox,
67
+ arrayItemPaper,
68
+ arrayItemToolbarGrid
69
+ } = {}
70
+ } = getMuiProps(uiOptions);
71
+ return /* @__PURE__ */ jsxRuntime.jsxs(
72
+ Grid4,
73
+ {
74
+ container: true,
75
+ ...arrayItemGridContainer,
76
+ sx: computeSxProps({ alignItems: "center" }, arrayItemGridContainer),
77
+ children: [
78
+ /* @__PURE__ */ jsxRuntime.jsx(
79
+ Grid4,
80
+ {
81
+ size: { xs: 8, sm: 9, md: 10, lg: 11, xl: 11.25 },
82
+ ...arrayItemGridItem,
83
+ sx: computeSxProps({ overflow: "auto" }, arrayItemGridItem),
84
+ children: /* @__PURE__ */ jsxRuntime.jsx(Box, { ...arrayItemOuterBox, sx: computeSxProps({ mb: 2 }, arrayItemOuterBox), children: /* @__PURE__ */ jsxRuntime.jsx(Paper, { elevation: 2, ...arrayItemPaper, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { ...arrayItemInnerBox, sx: computeSxProps({ p: 2 }, arrayItemInnerBox), children }) }) })
85
+ }
86
+ ),
87
+ hasToolbar && /* @__PURE__ */ jsxRuntime.jsx(
88
+ Grid4,
89
+ {
90
+ ...arrayItemToolbarGrid,
91
+ sx: computeSxProps({ mt: hasDescription ? -5 : -1.5 }, arrayItemToolbarGrid),
92
+ children: /* @__PURE__ */ jsxRuntime.jsx(ArrayFieldItemButtonsTemplate, { ...buttonsProps, style: btnStyle })
93
+ }
94
+ )
95
+ ]
96
+ }
97
+ );
65
98
  }
66
99
  function ArrayFieldTemplate(props) {
67
100
  const {
@@ -93,8 +126,16 @@
93
126
  const {
94
127
  ButtonTemplates: { AddButton: AddButton2 }
95
128
  } = registry.templates;
96
- const { rjsfSlotProps: muiSlotProps } = getMuiProps(uiOptions);
97
- return /* @__PURE__ */ jsxRuntime.jsx(Paper, { elevation: 2, ...muiSlotProps?.arrayPaper, children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { p: 2, ...muiSlotProps?.arrayBox, children: [
129
+ const {
130
+ rjsfSlotProps: {
131
+ arrayPaper,
132
+ arrayBox,
133
+ arrayAddButtonGridContainer,
134
+ arrayAddButtonGridItem,
135
+ arrayAddButtonBox
136
+ } = {}
137
+ } = getMuiProps(uiOptions);
138
+ return /* @__PURE__ */ jsxRuntime.jsx(Paper, { elevation: 2, ...arrayPaper, children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { ...arrayBox, sx: computeSxProps({ p: 2 }, arrayBox), children: [
98
139
  /* @__PURE__ */ jsxRuntime.jsx(
99
140
  ArrayFieldTitleTemplate,
100
141
  {
@@ -119,17 +160,25 @@
119
160
  ),
120
161
  !showOptionalDataControlInTitle ? optionalDataControl : void 0,
121
162
  items,
122
- canAdd && /* @__PURE__ */ jsxRuntime.jsx(Grid4, { container: true, justifyContent: "flex-end", ...muiSlotProps?.arrayAddButtonGridContainer, children: /* @__PURE__ */ jsxRuntime.jsx(Grid4, { ...muiSlotProps?.arrayAddButtonGridItem, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { mt: 2, ...muiSlotProps?.arrayAddButtonBox, children: /* @__PURE__ */ jsxRuntime.jsx(
123
- AddButton2,
163
+ canAdd && /* @__PURE__ */ jsxRuntime.jsx(
164
+ Grid4,
124
165
  {
125
- id: utils.buttonId(fieldPathId, "add"),
126
- className: "rjsf-array-item-add",
127
- onClick: onAddClick,
128
- disabled: disabled || readonly,
129
- uiSchema,
130
- registry
166
+ container: true,
167
+ ...arrayAddButtonGridContainer,
168
+ sx: computeSxProps({ justifyContent: "flex-end" }, arrayAddButtonGridContainer),
169
+ children: /* @__PURE__ */ jsxRuntime.jsx(Grid4, { ...arrayAddButtonGridItem, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { ...arrayAddButtonBox, sx: computeSxProps({ mt: 2 }, arrayAddButtonBox), children: /* @__PURE__ */ jsxRuntime.jsx(
170
+ AddButton2,
171
+ {
172
+ id: utils.buttonId(fieldPathId, "add"),
173
+ className: "rjsf-array-item-add",
174
+ onClick: onAddClick,
175
+ disabled: disabled || readonly,
176
+ uiSchema,
177
+ registry
178
+ }
179
+ ) }) })
131
180
  }
132
- ) }) }) })
181
+ )
133
182
  ] }) });
134
183
  }
135
184
  var TYPES_THAT_SHRINK_LABEL = ["date", "datetime-local", "file", "time"];
@@ -231,10 +280,18 @@
231
280
  function DescriptionField(props) {
232
281
  const { id, description, registry, uiSchema } = props;
233
282
  const uiOptions = utils.getUiOptions(uiSchema);
234
- const muiProps = getMuiProps(uiOptions);
235
- const { rjsfSlotProps: muiSlotProps } = muiProps;
283
+ const { rjsfSlotProps: { descTypography } = {} } = getMuiProps(uiOptions);
236
284
  if (description) {
237
- return /* @__PURE__ */ jsxRuntime.jsx(Typography, { id, variant: "subtitle2", style: { marginTop: "5px" }, ...muiSlotProps?.descTypography, children: /* @__PURE__ */ jsxRuntime.jsx(core.RichDescription, { description, registry, uiSchema }) });
285
+ return /* @__PURE__ */ jsxRuntime.jsx(
286
+ Typography,
287
+ {
288
+ id,
289
+ variant: "subtitle2",
290
+ ...descTypography,
291
+ sx: computeSxProps({ mt: 0.625 }, descTypography),
292
+ children: /* @__PURE__ */ jsxRuntime.jsx(core.RichDescription, { description, registry, uiSchema })
293
+ }
294
+ );
238
295
  }
239
296
  return null;
240
297
  }
@@ -245,13 +302,23 @@
245
302
  }) {
246
303
  const { translateString } = registry;
247
304
  const uiOptions = utils.getUiOptions(uiSchema);
248
- const { rjsfSlotProps: muiSlotProps } = getMuiProps(uiOptions);
249
- return /* @__PURE__ */ jsxRuntime.jsx(Paper, { elevation: 2, ...muiSlotProps?.errorPaper, children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { mb: 2, p: 2, ...muiSlotProps?.errorBox, children: [
250
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h6", ...muiSlotProps?.errorTypography, children: translateString(utils.TranslatableString.ErrorsLabel) }),
251
- /* @__PURE__ */ jsxRuntime.jsx(List, { dense: true, ...muiSlotProps?.errorList, children: errors.map((error, i) => {
252
- return /* @__PURE__ */ jsxRuntime.jsxs(ListItem, { ...muiSlotProps?.errorListItem, children: [
253
- /* @__PURE__ */ jsxRuntime.jsx(ListItemIcon, { ...muiSlotProps?.errorListItemIcon, children: /* @__PURE__ */ jsxRuntime.jsx(ErrorIcon, { color: "error" }) }),
254
- /* @__PURE__ */ jsxRuntime.jsx(ListItemText, { primary: error.stack, ...muiSlotProps?.errorListItemText })
305
+ const {
306
+ rjsfSlotProps: {
307
+ errorPaper,
308
+ errorBox,
309
+ errorTypography,
310
+ errorList,
311
+ errorListItem,
312
+ errorListItemIcon,
313
+ errorListItemText
314
+ } = {}
315
+ } = getMuiProps(uiOptions);
316
+ return /* @__PURE__ */ jsxRuntime.jsx(Paper, { elevation: 2, ...errorPaper, children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { ...errorBox, sx: computeSxProps({ mb: 2, p: 2 }, errorBox), children: [
317
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h6", ...errorTypography, children: translateString(utils.TranslatableString.ErrorsLabel) }),
318
+ /* @__PURE__ */ jsxRuntime.jsx(List, { dense: true, ...errorList, children: errors.map((error, i) => {
319
+ return /* @__PURE__ */ jsxRuntime.jsxs(ListItem, { ...errorListItem, children: [
320
+ /* @__PURE__ */ jsxRuntime.jsx(ListItemIcon, { ...errorListItemIcon, children: /* @__PURE__ */ jsxRuntime.jsx(ErrorIcon, { color: "error" }) }),
321
+ /* @__PURE__ */ jsxRuntime.jsx(ListItemText, { primary: error.stack, ...errorListItemText })
255
322
  ] }, i);
256
323
  }) })
257
324
  ] }) });
@@ -356,15 +423,14 @@
356
423
  return null;
357
424
  }
358
425
  const uiOptions = utils.getUiOptions(uiSchema);
359
- const muiProps = getMuiProps(uiOptions);
360
- const { rjsfSlotProps: muiSlotProps } = muiProps;
426
+ const { rjsfSlotProps: { helpFormHelperText } = {} } = getMuiProps(uiOptions);
361
427
  return /* @__PURE__ */ jsxRuntime.jsx(
362
428
  FormHelperText,
363
429
  {
364
430
  component: "div",
365
431
  id: utils.helpId(fieldPathId),
366
- style: { marginTop: "5px" },
367
- ...muiSlotProps?.helpFormHelperText,
432
+ ...helpFormHelperText,
433
+ sx: computeSxProps({ mt: 0.625 }, helpFormHelperText),
368
434
  children: /* @__PURE__ */ jsxRuntime.jsx(core.RichHelp, { help, registry, uiSchema })
369
435
  }
370
436
  );
@@ -482,7 +548,9 @@
482
548
  const {
483
549
  ButtonTemplates: { AddButton: AddButton2 }
484
550
  } = registry.templates;
485
- const { rjsfSlotProps: muiSlotProps } = getMuiProps(uiOptions);
551
+ const {
552
+ rjsfSlotProps: { objectGridContainer, objectGridItem, objectAddButtonGridContainer, objectAddButtonGridItem } = {}
553
+ } = getMuiProps(uiOptions);
486
554
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
487
555
  title && /* @__PURE__ */ jsxRuntime.jsx(
488
556
  TitleFieldTemplate,
@@ -506,27 +574,53 @@
506
574
  registry
507
575
  }
508
576
  ),
509
- /* @__PURE__ */ jsxRuntime.jsxs(Grid4, { container: true, spacing: 2, style: { marginTop: "10px" }, ...muiSlotProps?.objectGridContainer, children: [
510
- !showOptionalDataControlInTitle ? optionalDataControl : void 0,
511
- properties.map(
512
- (element, index) => (
513
- // Remove the <Grid> if the inner element is hidden as the <Grid>
514
- // itself would otherwise still take up space.
515
- element.hidden ? element.content : /* @__PURE__ */ jsxRuntime.jsx(Grid4, { size: { xs: 12 }, style: { marginBottom: "10px" }, ...muiSlotProps?.objectGridItem, children: element.content }, index)
516
- )
517
- )
518
- ] }),
519
- utils.canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsxRuntime.jsx(Grid4, { container: true, justifyContent: "flex-end", ...muiSlotProps?.objectAddButtonGridContainer, children: /* @__PURE__ */ jsxRuntime.jsx(Grid4, { ...muiSlotProps?.objectAddButtonGridItem, children: /* @__PURE__ */ jsxRuntime.jsx(
520
- AddButton2,
577
+ /* @__PURE__ */ jsxRuntime.jsxs(
578
+ Grid4,
521
579
  {
522
- id: utils.buttonId(fieldPathId, "add"),
523
- className: "rjsf-object-property-expand",
524
- onClick: onAddProperty,
525
- disabled: disabled || readonly,
526
- uiSchema,
527
- registry
580
+ container: true,
581
+ spacing: 2,
582
+ ...objectGridContainer,
583
+ sx: computeSxProps({ mt: 1.25 }, objectGridContainer),
584
+ children: [
585
+ !showOptionalDataControlInTitle ? optionalDataControl : void 0,
586
+ properties.map(
587
+ (element, index) => (
588
+ // Remove the <Grid> if the inner element is hidden as the <Grid>
589
+ // itself would otherwise still take up space.
590
+ element.hidden ? element.content : /* @__PURE__ */ jsxRuntime.jsx(
591
+ Grid4,
592
+ {
593
+ size: { xs: 12 },
594
+ ...objectGridItem,
595
+ sx: computeSxProps({ mb: 1.25 }, objectGridItem),
596
+ children: element.content
597
+ },
598
+ index
599
+ )
600
+ )
601
+ )
602
+ ]
603
+ }
604
+ ),
605
+ utils.canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsxRuntime.jsx(
606
+ Grid4,
607
+ {
608
+ container: true,
609
+ ...objectAddButtonGridContainer,
610
+ sx: computeSxProps({ justifyContent: "flex-end" }, objectAddButtonGridContainer),
611
+ children: /* @__PURE__ */ jsxRuntime.jsx(Grid4, { ...objectAddButtonGridItem, children: /* @__PURE__ */ jsxRuntime.jsx(
612
+ AddButton2,
613
+ {
614
+ id: utils.buttonId(fieldPathId, "add"),
615
+ className: "rjsf-object-property-expand",
616
+ onClick: onAddProperty,
617
+ disabled: disabled || readonly,
618
+ uiSchema,
619
+ registry
620
+ }
621
+ ) })
528
622
  }
529
- ) }) })
623
+ )
530
624
  ] });
531
625
  }
532
626
  function OptionalDataControlsTemplate(props) {
@@ -565,8 +659,8 @@
565
659
  return null;
566
660
  }
567
661
  const uiOptions = utils.getUiOptions(uiSchema);
568
- const { rjsfSlotProps: muiSlotProps, ...otherMuiProps } = getMuiProps(uiOptions);
569
- return /* @__PURE__ */ jsxRuntime.jsx(Box, { marginTop: 3, ...muiSlotProps?.submitBox, children: /* @__PURE__ */ jsxRuntime.jsx(
662
+ const { rjsfSlotProps: { submitBox, submitButton } = {}, ...otherMuiProps } = getMuiProps(uiOptions);
663
+ return /* @__PURE__ */ jsxRuntime.jsx(Box, { ...submitBox, sx: computeSxProps({ mt: 3 }, submitBox), children: /* @__PURE__ */ jsxRuntime.jsx(
570
664
  Button,
571
665
  {
572
666
  type: "submit",
@@ -574,7 +668,7 @@
574
668
  color: "primary",
575
669
  ...submitButtonProps,
576
670
  ...otherMuiProps,
577
- ...muiSlotProps?.submitButton,
671
+ ...submitButton,
578
672
  children: submitText
579
673
  }
580
674
  ) });
@@ -582,17 +676,33 @@
582
676
  function TitleField(props) {
583
677
  const { id, title, optionalDataControl, uiSchema } = props;
584
678
  const uiOptions = utils.getUiOptions(uiSchema);
585
- const { rjsfSlotProps: muiSlotProps } = getMuiProps(uiOptions);
586
- let heading = /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h5", ...muiSlotProps?.titleTypography, children: title });
679
+ const {
680
+ rjsfSlotProps: {
681
+ titleBox,
682
+ titleDivider,
683
+ titleTypography,
684
+ titleGridContainer,
685
+ titleGridItem,
686
+ titleOptionalDataGridItem
687
+ } = {}
688
+ } = getMuiProps(uiOptions);
689
+ let heading = /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h5", ...titleTypography, children: title });
587
690
  if (optionalDataControl) {
588
- heading = /* @__PURE__ */ jsxRuntime.jsxs(Grid4, { container: true, spacing: 0, ...muiSlotProps?.titleGridContainer, children: [
589
- /* @__PURE__ */ jsxRuntime.jsx(Grid4, { size: "grow", ...muiSlotProps?.titleGridItem, children: heading }),
590
- /* @__PURE__ */ jsxRuntime.jsx(Grid4, { justifyContent: "flex-end", ...muiSlotProps?.titleOptionalDataGridItem, children: optionalDataControl })
691
+ heading = /* @__PURE__ */ jsxRuntime.jsxs(Grid4, { container: true, spacing: 0, ...titleGridContainer, children: [
692
+ /* @__PURE__ */ jsxRuntime.jsx(Grid4, { size: "grow", ...titleGridItem, children: heading }),
693
+ /* @__PURE__ */ jsxRuntime.jsx(
694
+ Grid4,
695
+ {
696
+ ...titleOptionalDataGridItem,
697
+ sx: computeSxProps({ justifyContent: "flex-end" }, titleOptionalDataGridItem),
698
+ children: optionalDataControl
699
+ }
700
+ )
591
701
  ] });
592
702
  }
593
- return /* @__PURE__ */ jsxRuntime.jsxs(Box, { id, mb: 1, mt: 1, ...muiSlotProps?.titleBox, children: [
703
+ return /* @__PURE__ */ jsxRuntime.jsxs(Box, { id, ...titleBox, sx: computeSxProps({ mb: 1, mt: 1 }, titleBox), children: [
594
704
  heading,
595
- /* @__PURE__ */ jsxRuntime.jsx(Divider, { ...muiSlotProps?.titleDivider })
705
+ /* @__PURE__ */ jsxRuntime.jsx(Divider, { ...titleDivider })
596
706
  ] });
597
707
  }
598
708
  function WrapIfAdditionalTemplate(props) {
@@ -623,21 +733,19 @@
623
733
  fontWeight: "bold"
624
734
  };
625
735
  const uiOptions = utils.getUiOptions(uiSchema);
626
- const { rjsfSlotProps } = getMuiProps(uiOptions);
627
- const muiSlotProps = rjsfSlotProps;
736
+ const { rjsfSlotProps: { wrapGridContainer, wrapKeyGridItem, wrapChildrenGridItem, wrapRemoveButtonGridItem } = {} } = getMuiProps(uiOptions);
628
737
  if (!additional) {
629
738
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames, style, children });
630
739
  }
631
- const { wrapGridContainer, wrapKeyGridItem, wrapChildrenGridItem, wrapRemoveButtonGridItem } = muiSlotProps || {};
632
740
  return /* @__PURE__ */ jsxRuntime.jsxs(
633
741
  Grid4,
634
742
  {
635
743
  container: true,
636
- alignItems: "flex-start",
637
744
  spacing: 2,
638
745
  className: classNames,
639
746
  style,
640
747
  ...wrapGridContainer,
748
+ sx: computeSxProps({ alignItems: "flex-start" }, wrapGridContainer),
641
749
  children: [
642
750
  /* @__PURE__ */ jsxRuntime.jsx(Grid4, { size: 5.5, ...wrapKeyGridItem, children: /* @__PURE__ */ jsxRuntime.jsx(
643
751
  TextField,
@@ -655,7 +763,7 @@
655
763
  label
656
764
  ) }),
657
765
  /* @__PURE__ */ jsxRuntime.jsx(Grid4, { size: 5.5, ...wrapChildrenGridItem, children }),
658
- /* @__PURE__ */ jsxRuntime.jsx(Grid4, { sx: { mt: 1.5 }, ...wrapRemoveButtonGridItem, children: /* @__PURE__ */ jsxRuntime.jsx(
766
+ /* @__PURE__ */ jsxRuntime.jsx(Grid4, { ...wrapRemoveButtonGridItem, sx: computeSxProps({ mt: 1.5 }, wrapRemoveButtonGridItem), children: /* @__PURE__ */ jsxRuntime.jsx(
659
767
  RemoveButton2,
660
768
  {
661
769
  id: utils.buttonId(id, "remove"),
@@ -3,7 +3,7 @@ import Box from '@mui/material/Box';
3
3
  import Grid from '@mui/material/Grid';
4
4
  import Paper from '@mui/material/Paper';
5
5
  import { getUiOptions, getTemplate, } from '@rjsf/utils';
6
- import { getMuiProps } from '../util.js';
6
+ import { computeSxProps, getMuiProps } from '../util.js';
7
7
  /** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
8
8
  *
9
9
  * @param props - The `ArrayFieldItemTemplateProps` props for the component
@@ -19,7 +19,7 @@ export default function ArrayFieldItemTemplate(props) {
19
19
  fontWeight: 'bold',
20
20
  minWidth: 0,
21
21
  };
22
- const { rjsfSlotProps: muiSlotProps } = getMuiProps(uiOptions);
23
- return (_jsxs(Grid, { container: true, alignItems: 'center', ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.arrayItemGridContainer, children: [_jsx(Grid, { size: { xs: 8, sm: 9, md: 10, lg: 11, xl: 11.25 }, style: { overflow: 'auto' }, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.arrayItemGridItem, children: _jsx(Box, { mb: 2, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.arrayItemOuterBox, children: _jsx(Paper, { elevation: 2, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.arrayItemPaper, children: _jsx(Box, { p: 2, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.arrayItemInnerBox, children: children }) }) }) }), hasToolbar && (_jsx(Grid, { sx: { mt: hasDescription ? -5 : -1.5 }, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.arrayItemToolbarGrid, children: _jsx(ArrayFieldItemButtonsTemplate, { ...buttonsProps, style: btnStyle }) }))] }));
22
+ const { rjsfSlotProps: { arrayItemGridContainer, arrayItemGridItem, arrayItemInnerBox, arrayItemOuterBox, arrayItemPaper, arrayItemToolbarGrid, } = {}, } = getMuiProps(uiOptions);
23
+ return (_jsxs(Grid, { container: true, ...arrayItemGridContainer, sx: computeSxProps({ alignItems: 'center' }, arrayItemGridContainer), children: [_jsx(Grid, { size: { xs: 8, sm: 9, md: 10, lg: 11, xl: 11.25 }, ...arrayItemGridItem, sx: computeSxProps({ overflow: 'auto' }, arrayItemGridItem), children: _jsx(Box, { ...arrayItemOuterBox, sx: computeSxProps({ mb: 2 }, arrayItemOuterBox), children: _jsx(Paper, { elevation: 2, ...arrayItemPaper, children: _jsx(Box, { ...arrayItemInnerBox, sx: computeSxProps({ p: 2 }, arrayItemInnerBox), children: children }) }) }) }), hasToolbar && (_jsx(Grid, { ...arrayItemToolbarGrid, sx: computeSxProps({ mt: hasDescription ? -5 : -1.5 }, arrayItemToolbarGrid), children: _jsx(ArrayFieldItemButtonsTemplate, { ...buttonsProps, style: btnStyle }) }))] }));
24
24
  }
25
25
  //# sourceMappingURL=ArrayFieldItemTemplate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ArrayFieldItemTemplate.js","sourceRoot":"","sources":["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AAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,oBAAoB,CAAC,YAEvF,KAAC,6BAA6B,OAAK,YAAY,EAAE,KAAK,EAAE,QAAQ,GAAI,GAC/D,CACR,IACI,CACR,CAAC;AACJ,CAAC"}
@@ -3,7 +3,7 @@ import Box from '@mui/material/Box';
3
3
  import Grid from '@mui/material/Grid';
4
4
  import Paper from '@mui/material/Paper';
5
5
  import { getTemplate, getUiOptions, buttonId, } from '@rjsf/utils';
6
- import { getMuiProps } from '../util.js';
6
+ import { computeSxProps, getMuiProps } from '../util.js';
7
7
  /** The `ArrayFieldTemplate` component is the template used to render all items in an array.
8
8
  *
9
9
  * @param props - The `ArrayFieldTemplateProps` props for the component
@@ -16,7 +16,7 @@ export default function ArrayFieldTemplate(props) {
16
16
  const showOptionalDataControlInTitle = !readonly && !disabled;
17
17
  // Button templates are not overridden in the uiSchema
18
18
  const { ButtonTemplates: { AddButton }, } = registry.templates;
19
- const { rjsfSlotProps: muiSlotProps } = getMuiProps(uiOptions);
20
- return (_jsx(Paper, { elevation: 2, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.arrayPaper, children: _jsxs(Box, { p: 2, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.arrayBox, children: [_jsx(ArrayFieldTitleTemplate, { fieldPathId: fieldPathId, title: uiOptions.title || title, schema: schema, uiSchema: uiSchema, required: required, registry: registry, optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : undefined }), _jsx(ArrayFieldDescriptionTemplate, { fieldPathId: fieldPathId, description: uiOptions.description || schema.description, schema: schema, uiSchema: uiSchema, registry: registry }), !showOptionalDataControlInTitle ? optionalDataControl : undefined, items, canAdd && (_jsx(Grid, { container: true, justifyContent: 'flex-end', ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.arrayAddButtonGridContainer, children: _jsx(Grid, { ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.arrayAddButtonGridItem, children: _jsx(Box, { mt: 2, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.arrayAddButtonBox, children: _jsx(AddButton, { id: buttonId(fieldPathId, 'add'), className: 'rjsf-array-item-add', onClick: onAddClick, disabled: disabled || readonly, uiSchema: uiSchema, registry: registry }) }) }) }))] }) }));
19
+ const { rjsfSlotProps: { arrayPaper, arrayBox, arrayAddButtonGridContainer, arrayAddButtonGridItem, arrayAddButtonBox, } = {}, } = getMuiProps(uiOptions);
20
+ return (_jsx(Paper, { elevation: 2, ...arrayPaper, children: _jsxs(Box, { ...arrayBox, sx: computeSxProps({ p: 2 }, arrayBox), children: [_jsx(ArrayFieldTitleTemplate, { fieldPathId: fieldPathId, title: uiOptions.title || title, schema: schema, uiSchema: uiSchema, required: required, registry: registry, optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : undefined }), _jsx(ArrayFieldDescriptionTemplate, { fieldPathId: fieldPathId, description: uiOptions.description || schema.description, schema: schema, uiSchema: uiSchema, registry: registry }), !showOptionalDataControlInTitle ? optionalDataControl : undefined, items, canAdd && (_jsx(Grid, { container: true, ...arrayAddButtonGridContainer, sx: computeSxProps({ justifyContent: 'flex-end' }, arrayAddButtonGridContainer), children: _jsx(Grid, { ...arrayAddButtonGridItem, children: _jsx(Box, { ...arrayAddButtonBox, sx: computeSxProps({ mt: 2 }, arrayAddButtonBox), children: _jsx(AddButton, { id: buttonId(fieldPathId, 'add'), className: 'rjsf-array-item-add', onClick: onAddClick, disabled: disabled || readonly, uiSchema: uiSchema, registry: registry }) }) }) }))] }) }));
21
21
  }
22
22
  //# sourceMappingURL=ArrayFieldTemplate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ArrayFieldTemplate.js","sourceRoot":"","sources":["../../src/ArrayFieldTemplate/ArrayFieldTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,GAAiB,MAAM,mBAAmB,CAAC;AAClD,OAAO,IAAmB,MAAM,oBAAoB,CAA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AAE,QAAQ,EAClB,mBAAmB,EAAE,8BAA8B,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,GACrF,EACF,KAAC,6BAA6B,IAC5B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,SAAS,CAAC,WAAW,IAAI,MAAM,CAAC,WAAW,EACxD,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,EACD,CAAC,8BAA8B,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,EACjE,KAAK,EACL,MAAM,IAAI,CACT,KAAC,IAAI,IACH,SAAS,WACL,2BAA2B,EAC/B,EAAE,EAAE,cAAc,CAAY,EAAE,cAAc,EAAE,UAAU,EAAE,EAAE,2BAA2B,CAAC,YAE1F,KAAC,IAAI,OAAK,sBAAsB,YAC9B,KAAC,GAAG,OAAK,iBAAiB,EAAE,EAAE,EAAE,cAAc,CAAW,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,iBAAiB,CAAC,YACpF,KAAC,SAAS,IACR,EAAE,EAAE,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,EAChC,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,GACE,GACD,GACF,CACR,IACG,GACA,CACT,CAAC;AACJ,CAAC"}
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import Typography from '@mui/material/Typography';
3
3
  import { getUiOptions, } from '@rjsf/utils';
4
4
  import { RichDescription } from '@rjsf/core';
5
- import { getMuiProps } from '../util.js';
5
+ import { computeSxProps, getMuiProps } from '../util.js';
6
6
  /** The `DescriptionField` is the template to use to render the description of a field
7
7
  *
8
8
  * @param props - The `DescriptionFieldProps` for this component
@@ -10,10 +10,9 @@ import { getMuiProps } from '../util.js';
10
10
  export default function DescriptionField(props) {
11
11
  const { id, description, registry, uiSchema } = props;
12
12
  const uiOptions = getUiOptions(uiSchema);
13
- const muiProps = getMuiProps(uiOptions);
14
- const { rjsfSlotProps: muiSlotProps } = muiProps;
13
+ const { rjsfSlotProps: { descTypography } = {} } = getMuiProps(uiOptions);
15
14
  if (description) {
16
- return (_jsx(Typography, { id: id, variant: 'subtitle2', style: { marginTop: '5px' }, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.descTypography, children: _jsx(RichDescription, { description: description, registry: registry, uiSchema: uiSchema }) }));
15
+ return (_jsx(Typography, { id: id, variant: 'subtitle2', ...descTypography, sx: computeSxProps({ mt: 0.625 }, descTypography), children: _jsx(RichDescription, { description: description, registry: registry, uiSchema: uiSchema }) }));
17
16
  }
18
17
  return null;
19
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DescriptionField.js","sourceRoot":"","sources":["../../src/DescriptionField/DescriptionField.tsx"],"names":[],"mappings":";AAAA,OAAO,UAA+B,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAML,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAWtC;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAItC,KAAqC;IACrC,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEtD,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,WAAW,CAAoC,SAAS,CAAC,CAAC;IAC3E,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC;IAEjD,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,CACL,KAAC,UAAU,IAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EA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@@ -8,7 +8,7 @@ import ListItemText from '@mui/material/ListItemText';
8
8
  import Paper from '@mui/material/Paper';
9
9
  import Typography from '@mui/material/Typography';
10
10
  import { TranslatableString, getUiOptions, } from '@rjsf/utils';
11
- import { getMuiProps } from '../util.js';
11
+ import { computeSxProps, getMuiProps } from '../util.js';
12
12
  /** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
13
13
  *
14
14
  * @param props - The `ErrorListProps` for this component
@@ -16,9 +16,9 @@ import { getMuiProps } from '../util.js';
16
16
  export default function ErrorList({ errors, registry, uiSchema, }) {
17
17
  const { translateString } = registry;
18
18
  const uiOptions = getUiOptions(uiSchema);
19
- const { rjsfSlotProps: muiSlotProps } = getMuiProps(uiOptions);
20
- return (_jsx(Paper, { elevation: 2, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.errorPaper, children: _jsxs(Box, { mb: 2, p: 2, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.errorBox, children: [_jsx(Typography, { variant: 'h6', ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.errorTypography, children: translateString(TranslatableString.ErrorsLabel) }), _jsx(List, { dense: true, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.errorList, children: errors.map((error, i) => {
21
- return (_jsxs(ListItem, { ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.errorListItem, children: [_jsx(ListItemIcon, { ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.errorListItemIcon, children: _jsx(ErrorIcon, { color: 'error' }) }), _jsx(ListItemText, { primary: error.stack, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.errorListItemText })] }, i));
19
+ const { rjsfSlotProps: { errorPaper, errorBox, errorTypography, errorList, errorListItem, errorListItemIcon, errorListItemText, } = {}, } = getMuiProps(uiOptions);
20
+ return (_jsx(Paper, { elevation: 2, ...errorPaper, children: _jsxs(Box, { ...errorBox, sx: computeSxProps({ mb: 2, p: 2 }, errorBox), children: [_jsx(Typography, { variant: 'h6', ...errorTypography, children: translateString(TranslatableString.ErrorsLabel) }), _jsx(List, { dense: true, ...errorList, children: errors.map((error, i) => {
21
+ return (_jsxs(ListItem, { ...errorListItem, children: [_jsx(ListItemIcon, { ...errorListItemIcon, children: _jsx(ErrorIcon, { color: 'error' }) }), _jsx(ListItemText, { primary: error.stack, ...errorListItemText })] }, i));
22
22
  }) })] }) }));
23
23
  }
24
24
  //# sourceMappingURL=ErrorList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorList.js","sourceRoot":"","sources":["../../src/ErrorList/ErrorList.tsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,GAAiB,MAAM,mBAAmB,CAAC;AAClD,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AACrD,OAAO,QAA2B,MAAM,wBAAwB,CAAC;AACjE,OAAO,YAAmC,MAAM,4BAA4B,CAAC;AAC7E,OAAO,YAAmC,MAAM,4BAA4B,CAAC;AAC7E,OAAO,KAAqB,MAAM,qBAAqB,CAAC;AACxD,OAAO,UAA+B,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAML,kBAAkB,EAClB,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAuBtC;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAoF,EACnH,MAAM,EACN,QAAQ,EACR,QAAQ,GACgB;IACxB,MAAM,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC;IAErC,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,WAAW,CAA6B,SAAS,CAAC,CAAC;IAE3F,OAAO,CACL,KAAC,KAAK,IAAC,SAAS,EAAE,CAAC,KAAM,YAAY,aAAZ,YAAY,uBAAZ,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AACJ,CAAC"}
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { RichHelp } from '@rjsf/core';
3
3
  import { helpId, getUiOptions, } from '@rjsf/utils';
4
4
  import FormHelperText from '@mui/material/FormHelperText';
5
- import { getMuiProps } from '../util.js';
5
+ import { computeSxProps, getMuiProps } from '../util.js';
6
6
  /** The `FieldHelpTemplate` component renders any help desired for a field
7
7
  *
8
8
  * @param props - The `FieldHelpProps` to be rendered
@@ -13,8 +13,7 @@ export default function FieldHelpTemplate(props) {
13
13
  return null;
14
14
  }
15
15
  const uiOptions = getUiOptions(uiSchema);
16
- const muiProps = getMuiProps(uiOptions);
17
- const { rjsfSlotProps: muiSlotProps } = muiProps;
18
- return (_jsx(FormHelperText, { component: 'div', id: helpId(fieldPathId), style: { marginTop: '5px' }, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.helpFormHelperText, children: _jsx(RichHelp, { help: help, registry: registry, uiSchema: uiSchema }) }));
16
+ const { rjsfSlotProps: { helpFormHelperText } = {} } = getMuiProps(uiOptions);
17
+ return (_jsx(FormHelperText, { component: 'div', id: helpId(fieldPathId), ...helpFormHelperText, sx: computeSxProps({ mt: 0.625 }, helpFormHelperText), children: _jsx(RichHelp, { help: help, registry: registry, uiSchema: uiSchema }) }));
19
18
  }
20
19
  //# sourceMappingURL=FieldHelpTemplate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FieldHelpTemplate.js","sourceRoot":"","sources":["../../src/FieldHelpTemplate/FieldHelpTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EACL,MAAM,EAKN,YAAY,GAEb,MAAM,aAAa,CAAC;AACrB,OAAO,cAAuC,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAWtC;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAIvC,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AAU,QAAQ,CAAC,CAAC;IAClD,MAAM,EAAE,aAAa,EAAE,EAAE,kBAAkB,EAAE,GAAG,EAAE,EAAE,GAAG,WAAW,CAAqC,SAAS,CAAC,CAAC;IAElH,OAAO,CACL,KAAC,cAAc,IACb,SAAS,EAAC,KAAK,EACf,EAAE,EAAE,MAAM,CAAC,WAAW,CAAC,KACnB,kBAAkB,EACtB,EAAE,EAAE,cAAc,CAAsB,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,kBAAkB,CAAC,YAE1E,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAI,GACjD,CAClB,CAAC;AACJ,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import Grid from '@mui/material/Grid';
3
3
  import { canExpand, descriptionId, getTemplate, getUiOptions, titleId, buttonId, } from '@rjsf/utils';
4
- import { getMuiProps } from '../util.js';
4
+ import { computeSxProps, getMuiProps } from '../util.js';
5
5
  /** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
6
6
  * title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
7
7
  * the properties.
@@ -16,10 +16,10 @@ export default function ObjectFieldTemplate(props) {
16
16
  const showOptionalDataControlInTitle = !readonly && !disabled;
17
17
  // Button templates are not overridden in the uiSchema
18
18
  const { ButtonTemplates: { AddButton }, } = registry.templates;
19
- const { rjsfSlotProps: muiSlotProps } = getMuiProps(uiOptions);
20
- return (_jsxs(_Fragment, { children: [title && (_jsx(TitleFieldTemplate, { id: titleId(fieldPathId), title: title, required: required, schema: schema, uiSchema: uiSchema, registry: registry, optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : undefined })), description && (_jsx(DescriptionFieldTemplate, { id: descriptionId(fieldPathId), description: description, schema: schema, uiSchema: uiSchema, registry: registry })), _jsxs(Grid, { container: true, spacing: 2, style: { marginTop: '10px' }, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.objectGridContainer, children: [!showOptionalDataControlInTitle ? optionalDataControl : undefined, properties.map((element, index) =>
19
+ const { rjsfSlotProps: { objectGridContainer, objectGridItem, objectAddButtonGridContainer, objectAddButtonGridItem } = {}, } = getMuiProps(uiOptions);
20
+ return (_jsxs(_Fragment, { children: [title && (_jsx(TitleFieldTemplate, { id: titleId(fieldPathId), title: title, required: required, schema: schema, uiSchema: uiSchema, registry: registry, optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : undefined })), description && (_jsx(DescriptionFieldTemplate, { id: descriptionId(fieldPathId), description: description, schema: schema, uiSchema: uiSchema, registry: registry })), _jsxs(Grid, { container: true, spacing: 2, ...objectGridContainer, sx: computeSxProps({ mt: 1.25 }, objectGridContainer), children: [!showOptionalDataControlInTitle ? optionalDataControl : undefined, properties.map((element, index) =>
21
21
  // Remove the <Grid> if the inner element is hidden as the <Grid>
22
22
  // itself would otherwise still take up space.
23
- element.hidden ? (element.content) : (_jsx(Grid, { size: { xs: 12 }, style: { marginBottom: '10px' }, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.objectGridItem, children: element.content }, index)))] }), canExpand(schema, uiSchema, formData) && (_jsx(Grid, { container: true, justifyContent: 'flex-end', ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.objectAddButtonGridContainer, children: _jsx(Grid, { ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.objectAddButtonGridItem, children: _jsx(AddButton, { id: buttonId(fieldPathId, 'add'), className: 'rjsf-object-property-expand', onClick: onAddProperty, disabled: disabled || readonly, uiSchema: uiSchema, registry: registry }) }) }))] }));
23
+ element.hidden ? (element.content) : (_jsx(Grid, { size: { xs: 12 }, ...objectGridItem, sx: computeSxProps({ mb: 1.25 }, objectGridItem), children: element.content }, index)))] }), canExpand(schema, uiSchema, formData) && (_jsx(Grid, { container: true, ...objectAddButtonGridContainer, sx: computeSxProps({ justifyContent: 'flex-end' }, objectAddButtonGridContainer), children: _jsx(Grid, { ...objectAddButtonGridItem, children: _jsx(AddButton, { id: buttonId(fieldPathId, 'add'), className: 'rjsf-object-property-expand', onClick: onAddProperty, disabled: disabled || readonly, uiSchema: uiSchema, registry: registry }) }) }))] }));
24
24
  }
25
25
  //# sourceMappingURL=ObjectFieldTemplate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectFieldTemplate.js","sourceRoot":"","sources":["../../src/ObjectFieldTemplate/ObjectFieldTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAML,SAAS,EACT,aAAa,EACb,WAAW,EACX,YAAY,EACZ,OAAO,EACP,QAAQ,GACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAiBtC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAIzC,KAAwC;IACxC,MAAM,EACJ,WAAW,EACX,KAAK,EACL,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,MAAM,EACN,QAAQ,EACR,mBAAmB,EACnB,aAAa,EACb,QAAQ,GACT,GAAG,KAAK,CAAC;IACV,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,kBAAkB,GAAG,WAAW,CAAgC,oBAAoB,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IACjH,MAAM,wBAAwB,GAAG,WAAW,CAC1C,0BAA0B,EAC1B,QAAQ,EACR,SAAS,CACV,CAAC;IACF,MAAM,8BAA8B,GAAG,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC;IAC9D,sDAAsD;IACtD,MAAM,EACJ,eAAe,EAAE,EAAE,SAAS,EAAE,GAC/B,GAAG,QAAQ,CAAC,SAAS,CAAC;IAEvB,MAAM,EAAE,aAA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CAChB,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IACH,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,KAEZ,cAAc,EAClB,EAAE,EAAE,cAAc,CAAY,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,cAAc,CAAC,YAE1D,OAAO,CAAC,OAAO,IAJX,KAAK,CAKL,CACR,CACF,IACI,EACN,SAAS,CAAU,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CACjD,KAAC,IAAI,IACH,SAAS,WACL,4BAA4B,EAChC,EAAE,EAAE,cAAc,CAAY,EAAE,cAAc,EAAE,UAAU,EAAE,EAAE,4BAA4B,CAAC,YAE3F,KAAC,IAAI,OAAK,uBAAuB,YAC/B,KAAC,SAAS,IACR,EAAE,EAAE,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,EAChC,SAAS,EAAC,6BAA6B,EACvC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,GACG,GACF,CACR,IACA,CACJ,CAAC;AACJ,CAAC"}
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import Box from '@mui/material/Box';
3
3
  import Button from '@mui/material/Button';
4
4
  import { getSubmitButtonOptions, getUiOptions, } from '@rjsf/utils';
5
- import { getMuiProps } from '../util.js';
5
+ import { computeSxProps, getMuiProps } from '../util.js';
6
6
  /** The `SubmitButton` renders a button that represent the `Submit` action on a form
7
7
  */
8
8
  export default function SubmitButton({ uiSchema }) {
@@ -11,7 +11,7 @@ export default function SubmitButton({ uiSchema }) {
11
11
  return null;
12
12
  }
13
13
  const uiOptions = getUiOptions(uiSchema);
14
- const { rjsfSlotProps: muiSlotProps, ...otherMuiProps } = getMuiProps(uiOptions);
15
- return (_jsx(Box, { marginTop: 3, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.submitBox, children: _jsx(Button, { type: 'submit', variant: 'contained', color: 'primary', ...submitButtonProps, ...otherMuiProps, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.submitButton, children: submitText }) }));
14
+ const { rjsfSlotProps: { submitBox, submitButton } = {}, ...otherMuiProps } = getMuiProps(uiOptions);
15
+ return (_jsx(Box, { ...submitBox, sx: computeSxProps({ mt: 3 }, submitBox), children: _jsx(Button, { type: 'submit', variant: 'contained', color: 'primary', ...submitButtonProps, ...otherMuiProps, ...submitButton, children: submitText }) }));
16
16
  }
17
17
  //# sourceMappingURL=SubmitButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubmitButton.js","sourceRoot":"","sources":["../../src/SubmitButton/SubmitButton.tsx"],"names":[],"mappings":";AAAA,OAAO,GAAiB,MAAM,mBAAmB,CAAC;AAClD,OAAO,MAAuB,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EACL,sBAAsB,EAMtB,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAatC;GACG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAIlC,EAAE,QAAQ,EAA8B;IACxC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,iBAAiB,GAAG,EAAE,EAAE,GAAG,sBAAsB,CAAU,QAAQ,CAAC,CAAC;IAC1G,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,aAAa,EAAE,GAAG,WAAW,CAAgC,SAAS,CAAC,CAAC;IAEhH,OAAO,CACL,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,KAAM,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,SAAS,YAC5C,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EAC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