@jsonforms/material-renderers 3.0.0-alpha.2 → 3.0.0-alpha.3

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 (197) hide show
  1. package/docs/assets/js/search.json +1 -1
  2. package/docs/classes/materialanyofstringorenumcontrol.html +1 -1
  3. package/docs/classes/materialtablecontrol.html +2 -2
  4. package/docs/globals.html +79 -79
  5. package/docs/index.html +6 -0
  6. package/docs/interfaces/arraylayouttoolbarprops.html +5 -5
  7. package/docs/interfaces/categorizationstate.html +1 -1
  8. package/docs/interfaces/dispatchpropsofexpandpanel.html +3 -3
  9. package/docs/interfaces/expandpanelprops.html +19 -19
  10. package/docs/interfaces/jsonformstheme.html +39 -46
  11. package/docs/interfaces/materialcategorizationlayoutrendererprops.html +4 -4
  12. package/docs/interfaces/materialtabletoolbarprops.html +9 -9
  13. package/docs/interfaces/muitextinputprops.html +2 -2
  14. package/docs/interfaces/ownpropsofexpandpanel.html +14 -14
  15. package/docs/interfaces/statepropsofexpandpanel.html +16 -16
  16. package/docs/interfaces/tablerowsprop.html +9 -9
  17. package/docs/interfaces/validationprops.html +2 -2
  18. package/docs/interfaces/withoptionlabel.html +7 -4
  19. package/example/index.ts +5 -20
  20. package/lib/additional/ListWithDetailMasterItem.js +8 -8
  21. package/lib/additional/ListWithDetailMasterItem.js.map +1 -1
  22. package/lib/additional/MaterialLabelRenderer.js +3 -3
  23. package/lib/additional/MaterialLabelRenderer.js.map +1 -1
  24. package/lib/additional/MaterialListWithDetailRenderer.js +6 -6
  25. package/lib/additional/MaterialListWithDetailRenderer.js.map +1 -1
  26. package/lib/cells/MaterialDateCell.js +1 -1
  27. package/lib/cells/MaterialDateCell.js.map +1 -1
  28. package/lib/complex/DeleteDialog.js +8 -9
  29. package/lib/complex/DeleteDialog.js.map +1 -1
  30. package/lib/complex/MaterialAllOfRenderer.js +8 -8
  31. package/lib/complex/MaterialAllOfRenderer.js.map +1 -1
  32. package/lib/complex/MaterialAnyOfRenderer.js +3 -3
  33. package/lib/complex/MaterialAnyOfRenderer.js.map +1 -1
  34. package/lib/complex/MaterialArrayControlRenderer.js +2 -2
  35. package/lib/complex/MaterialArrayControlRenderer.js.map +1 -1
  36. package/lib/complex/MaterialEnumArrayRenderer.js +6 -6
  37. package/lib/complex/MaterialEnumArrayRenderer.js.map +1 -1
  38. package/lib/complex/MaterialObjectRenderer.js +2 -2
  39. package/lib/complex/MaterialObjectRenderer.js.map +1 -1
  40. package/lib/complex/MaterialOneOfRenderer.js +10 -10
  41. package/lib/complex/MaterialOneOfRenderer.js.map +1 -1
  42. package/lib/complex/MaterialTableControl.js +27 -28
  43. package/lib/complex/MaterialTableControl.js.map +1 -1
  44. package/lib/complex/NoBorderTableCell.d.ts +2 -2
  45. package/lib/complex/NoBorderTableCell.js +8 -10
  46. package/lib/complex/NoBorderTableCell.js.map +1 -1
  47. package/lib/complex/TableToolbar.js +12 -14
  48. package/lib/complex/TableToolbar.js.map +1 -1
  49. package/lib/complex/ValidationIcon.d.ts +2 -8
  50. package/lib/complex/ValidationIcon.js +9 -13
  51. package/lib/complex/ValidationIcon.js.map +1 -1
  52. package/lib/controls/MaterialAnyOfStringOrEnumControl.js +2 -2
  53. package/lib/controls/MaterialAnyOfStringOrEnumControl.js.map +1 -1
  54. package/lib/controls/MaterialBooleanControl.js +3 -3
  55. package/lib/controls/MaterialBooleanControl.js.map +1 -1
  56. package/lib/controls/MaterialBooleanToggleControl.js +3 -3
  57. package/lib/controls/MaterialBooleanToggleControl.js.map +1 -1
  58. package/lib/controls/MaterialDateControl.js +8 -11
  59. package/lib/controls/MaterialDateControl.js.map +1 -1
  60. package/lib/controls/MaterialDateTimeControl.js +8 -13
  61. package/lib/controls/MaterialDateTimeControl.js.map +1 -1
  62. package/lib/controls/MaterialEnumControl.js.map +1 -1
  63. package/lib/controls/MaterialInputControl.js +7 -7
  64. package/lib/controls/MaterialInputControl.js.map +1 -1
  65. package/lib/controls/MaterialNativeControl.js +3 -4
  66. package/lib/controls/MaterialNativeControl.js.map +1 -1
  67. package/lib/controls/MaterialOneOfEnumControl.js.map +1 -1
  68. package/lib/controls/MaterialOneOfRadioGroupControl.js.map +1 -1
  69. package/lib/controls/MaterialRadioGroup.js +7 -9
  70. package/lib/controls/MaterialRadioGroup.js.map +1 -1
  71. package/lib/controls/MaterialRadioGroupControl.js.map +1 -1
  72. package/lib/controls/MaterialSliderControl.js +9 -9
  73. package/lib/controls/MaterialSliderControl.js.map +1 -1
  74. package/lib/controls/MaterialTimeControl.js +8 -8
  75. package/lib/controls/MaterialTimeControl.js.map +1 -1
  76. package/lib/extended/MuiAutocomplete.d.ts +3 -4
  77. package/lib/extended/MuiAutocomplete.js +3 -4
  78. package/lib/extended/MuiAutocomplete.js.map +1 -1
  79. package/lib/extended/index.d.ts +1 -1
  80. package/lib/extended/index.js +1 -1
  81. package/lib/jsonforms-material.js +248 -43
  82. package/lib/jsonforms-material.js.map +1 -1
  83. package/lib/layouts/ArrayToolbar.js +13 -16
  84. package/lib/layouts/ArrayToolbar.js.map +1 -1
  85. package/lib/layouts/ExpandPanelRenderer.js +24 -29
  86. package/lib/layouts/ExpandPanelRenderer.js.map +1 -1
  87. package/lib/layouts/MaterialArrayLayoutRenderer.js +2 -2
  88. package/lib/layouts/MaterialArrayLayoutRenderer.js.map +1 -1
  89. package/lib/layouts/MaterialCategorizationLayout.js +8 -9
  90. package/lib/layouts/MaterialCategorizationLayout.js.map +1 -1
  91. package/lib/layouts/MaterialCategorizationStepperLayout.js +9 -9
  92. package/lib/layouts/MaterialCategorizationStepperLayout.js.map +1 -1
  93. package/lib/layouts/MaterialGroupLayout.js +8 -8
  94. package/lib/layouts/MaterialGroupLayout.js.map +1 -1
  95. package/lib/mui-controls/MuiCheckbox.js +2 -2
  96. package/lib/mui-controls/MuiCheckbox.js.map +1 -1
  97. package/lib/mui-controls/MuiInputInteger.js +2 -2
  98. package/lib/mui-controls/MuiInputInteger.js.map +1 -1
  99. package/lib/mui-controls/MuiInputNumber.js +2 -2
  100. package/lib/mui-controls/MuiInputNumber.js.map +1 -1
  101. package/lib/mui-controls/MuiInputNumberFormat.js +2 -2
  102. package/lib/mui-controls/MuiInputNumberFormat.js.map +1 -1
  103. package/lib/mui-controls/MuiInputText.d.ts +1 -1
  104. package/lib/mui-controls/MuiInputText.js +9 -9
  105. package/lib/mui-controls/MuiInputText.js.map +1 -1
  106. package/lib/mui-controls/MuiInputTime.js +2 -2
  107. package/lib/mui-controls/MuiInputTime.js.map +1 -1
  108. package/lib/mui-controls/MuiSelect.js +2 -3
  109. package/lib/mui-controls/MuiSelect.js.map +1 -1
  110. package/lib/mui-controls/MuiToggle.js +2 -2
  111. package/lib/mui-controls/MuiToggle.js.map +1 -1
  112. package/lib/util/layout.js +4 -4
  113. package/lib/util/layout.js.map +1 -1
  114. package/lib/util/theme.d.ts +1 -1
  115. package/package.json +17 -20
  116. package/src/additional/ListWithDetailMasterItem.tsx +3 -6
  117. package/src/additional/MaterialLabelRenderer.tsx +1 -1
  118. package/src/additional/MaterialListWithDetailRenderer.tsx +1 -1
  119. package/src/cells/MaterialDateCell.tsx +1 -1
  120. package/src/complex/DeleteDialog.tsx +2 -2
  121. package/src/complex/MaterialAllOfRenderer.tsx +1 -1
  122. package/src/complex/MaterialAnyOfRenderer.tsx +1 -1
  123. package/src/complex/MaterialArrayControlRenderer.tsx +1 -1
  124. package/src/complex/MaterialEnumArrayRenderer.tsx +1 -1
  125. package/src/complex/MaterialObjectRenderer.tsx +1 -1
  126. package/src/complex/MaterialOneOfRenderer.tsx +1 -1
  127. package/src/complex/MaterialTableControl.tsx +9 -13
  128. package/src/complex/NoBorderTableCell.tsx +10 -12
  129. package/src/complex/TableToolbar.tsx +9 -7
  130. package/src/complex/ValidationIcon.tsx +12 -19
  131. package/src/controls/MaterialAnyOfStringOrEnumControl.tsx +1 -2
  132. package/src/controls/MaterialBooleanControl.tsx +1 -1
  133. package/src/controls/MaterialBooleanToggleControl.tsx +1 -1
  134. package/src/controls/MaterialDateControl.tsx +28 -29
  135. package/src/controls/MaterialDateTimeControl.tsx +28 -33
  136. package/src/controls/MaterialEnumControl.tsx +1 -1
  137. package/src/controls/MaterialInputControl.tsx +3 -2
  138. package/src/controls/MaterialNativeControl.tsx +1 -2
  139. package/src/controls/MaterialOneOfEnumControl.tsx +1 -1
  140. package/src/controls/MaterialOneOfRadioGroupControl.tsx +4 -4
  141. package/src/controls/MaterialRadioGroup.tsx +7 -5
  142. package/src/controls/MaterialRadioGroupControl.tsx +1 -1
  143. package/src/controls/MaterialSliderControl.tsx +1 -1
  144. package/src/controls/MaterialTimeControl.tsx +28 -23
  145. package/src/extended/MuiAutocomplete.tsx +9 -6
  146. package/src/extended/index.ts +1 -1
  147. package/src/layouts/ArrayToolbar.tsx +11 -7
  148. package/src/layouts/ExpandPanelRenderer.tsx +17 -15
  149. package/src/layouts/MaterialArrayLayoutRenderer.tsx +1 -1
  150. package/src/layouts/MaterialCategorizationLayout.tsx +2 -3
  151. package/src/layouts/MaterialCategorizationStepperLayout.tsx +1 -1
  152. package/src/layouts/MaterialGroupLayout.tsx +1 -1
  153. package/src/mui-controls/MuiCheckbox.tsx +1 -1
  154. package/src/mui-controls/MuiInputInteger.tsx +1 -1
  155. package/src/mui-controls/MuiInputNumber.tsx +1 -1
  156. package/src/mui-controls/MuiInputNumberFormat.tsx +1 -1
  157. package/src/mui-controls/MuiInputText.tsx +14 -7
  158. package/src/mui-controls/MuiInputTime.tsx +1 -1
  159. package/src/mui-controls/MuiSelect.tsx +2 -2
  160. package/src/mui-controls/MuiToggle.tsx +1 -1
  161. package/src/util/layout.tsx +1 -1
  162. package/src/util/theme.ts +1 -1
  163. package/test/renderers/MaterialAllOfRenderer.test.tsx +1 -1
  164. package/test/renderers/MaterialAnyOfRenderer.test.tsx +1 -1
  165. package/test/renderers/MaterialAnyOfStringOrEnumControl.test.tsx +1 -1
  166. package/test/renderers/MaterialArrayControl.test.tsx +1 -1
  167. package/test/renderers/MaterialArrayLayout.test.tsx +2 -2
  168. package/test/renderers/MaterialBooleanCell.test.tsx +1 -1
  169. package/test/renderers/MaterialBooleanToggleCell.test.tsx +3 -2
  170. package/test/renderers/MaterialBooleanToggleControl.test.tsx +3 -2
  171. package/test/renderers/MaterialCategorizationLayout.test.tsx +2 -2
  172. package/test/renderers/MaterialCategorizationStepperLayout.test.tsx +2 -2
  173. package/test/renderers/MaterialDateCell.test.tsx +1 -1
  174. package/test/renderers/MaterialDateControl.test.tsx +5 -3
  175. package/test/renderers/MaterialDateTimeControl.test.tsx +5 -3
  176. package/test/renderers/MaterialEnumArrayRenderer.test.tsx +1 -1
  177. package/test/renderers/MaterialEnumCell.test.tsx +1 -1
  178. package/test/renderers/MaterialGroupLayout.test.tsx +1 -1
  179. package/test/renderers/MaterialInputControl.test.tsx +1 -1
  180. package/test/renderers/MaterialIntegerCell.test.tsx +1 -1
  181. package/test/renderers/MaterialLabelRenderer.test.tsx +1 -1
  182. package/test/renderers/MaterialLayouts.test.tsx +1 -1
  183. package/test/renderers/MaterialListWithDetailRenderer.test.tsx +2 -2
  184. package/test/renderers/MaterialNativeControl.test.tsx +2 -2
  185. package/test/renderers/MaterialNumberCell.test.tsx +1 -1
  186. package/test/renderers/MaterialObjectControl.test.tsx +1 -1
  187. package/test/renderers/MaterialOneOfEnumCell.test.tsx +1 -1
  188. package/test/renderers/MaterialOneOfRadioGroupControl.test.tsx +1 -1
  189. package/test/renderers/MaterialOneOfRenderer.test.tsx +10 -7
  190. package/test/renderers/MaterialRadioGroupControl.test.tsx +1 -1
  191. package/test/renderers/MaterialSliderControl.test.tsx +2 -2
  192. package/test/renderers/MaterialTextCell.test.tsx +6 -13
  193. package/test/renderers/MaterialTextControl.test.tsx +8 -4
  194. package/test/renderers/MaterialTimeCell.test.tsx +1 -1
  195. package/test/renderers/MaterialTimeControl.test.tsx +5 -3
  196. package/webpack/webpack.build.js +3 -3
  197. package/example/CustomAutocomplete.tsx +0 -54
@@ -32,17 +32,12 @@ import {
32
32
  rankWith
33
33
  } from '@jsonforms/core';
34
34
  import { withJsonFormsControlProps } from '@jsonforms/react';
35
- import { FormHelperText, Hidden } from '@material-ui/core';
36
- import KeyboardArrowLeftIcon from '@material-ui/icons/KeyboardArrowLeft';
37
- import KeyboardArrowRightIcon from '@material-ui/icons/KeyboardArrowRight';
38
- import DateRangeIcon from '@material-ui/icons/DateRange';
39
- import EventIcon from '@material-ui/icons/Event';
40
- import AccessTimeIcon from '@material-ui/icons/AccessTime';
35
+ import { FormHelperText, Hidden, TextField } from '@mui/material';
41
36
  import {
42
- KeyboardDateTimePicker,
43
- MuiPickersUtilsProvider
44
- } from '@material-ui/pickers';
45
- import DayjsUtils from '@date-io/dayjs';
37
+ DateTimePicker,
38
+ LocalizationProvider
39
+ } from '@mui/lab';
40
+ import AdapterDayjs from '@mui/lab/AdapterDayjs';
46
41
  import { createOnChangeHandler, getData, useFocus } from '../util';
47
42
 
48
43
  export const MaterialDateTimeControl = (props: ControlProps) => {
@@ -89,35 +84,35 @@ export const MaterialDateTimeControl = (props: ControlProps) => {
89
84
 
90
85
  return (
91
86
  <Hidden xsUp={!visible}>
92
- <MuiPickersUtilsProvider utils={DayjsUtils}>
93
- <KeyboardDateTimePicker
94
- id={id + '-input'}
95
- required={required && !appliedUiSchemaOptions.hideRequiredAsterisk}
87
+ <LocalizationProvider dateAdapter={AdapterDayjs}>
88
+ <DateTimePicker
96
89
  label={label}
97
- error={!isValid}
98
- fullWidth={!appliedUiSchemaOptions.trim}
99
- onFocus={onFocus}
100
- onBlur={onBlur}
101
- InputLabelProps={data ? { shrink: true } : undefined}
102
90
  value={getData(data, saveFormat)}
103
91
  clearable
104
92
  onChange={onChange}
105
- format={format}
93
+ inputFormat={format}
94
+ disableMaskedInput
106
95
  ampm={!!appliedUiSchemaOptions.ampm}
107
96
  views={appliedUiSchemaOptions.views}
108
97
  disabled={!enabled}
109
- autoFocus={appliedUiSchemaOptions.focus}
110
- cancelLabel={appliedUiSchemaOptions.cancelLabel}
111
- clearLabel={appliedUiSchemaOptions.clearLabel}
112
- okLabel={appliedUiSchemaOptions.okLabel}
113
- leftArrowIcon={<KeyboardArrowLeftIcon />}
114
- rightArrowIcon={<KeyboardArrowRightIcon />}
115
- dateRangeIcon={<DateRangeIcon />}
116
- keyboardIcon={<EventIcon />}
117
- timeIcon={<AccessTimeIcon />}
118
- invalidDateMessage={null}
119
- maxDateMessage={null}
120
- minDateMessage={null}
98
+ cancelText={appliedUiSchemaOptions.cancelLabel}
99
+ clearText={appliedUiSchemaOptions.clearLabel}
100
+ okText={appliedUiSchemaOptions.okLabel}
101
+ renderInput={params => (
102
+ <TextField
103
+ {...params}
104
+ id={id + '-input'}
105
+ required={required && !appliedUiSchemaOptions.hideRequiredAsterisk}
106
+ autoFocus={appliedUiSchemaOptions.focus}
107
+ error={!isValid}
108
+ fullWidth={!appliedUiSchemaOptions.trim}
109
+ inputProps={{ ...params.inputProps, type: 'text' }}
110
+ InputLabelProps={data ? { shrink: true } : undefined}
111
+ onFocus={onFocus}
112
+ onBlur={onBlur}
113
+ variant={'standard'}
114
+ />
115
+ )}
121
116
  />
122
117
  <FormHelperText error={!isValid && !showDescription}>
123
118
  {firstFormHelperText}
@@ -125,7 +120,7 @@ export const MaterialDateTimeControl = (props: ControlProps) => {
125
120
  <FormHelperText error={!isValid}>
126
121
  {secondFormHelperText}
127
122
  </FormHelperText>
128
- </MuiPickersUtilsProvider>
123
+ </LocalizationProvider>
129
124
  </Hidden>
130
125
  );
131
126
  };
@@ -35,7 +35,7 @@ import { MuiSelect } from '../mui-controls/MuiSelect';
35
35
  import { MaterialInputControl } from './MaterialInputControl';
36
36
 
37
37
  export const MaterialEnumControl = (props: ControlProps & OwnPropsOfEnum) => (
38
- <MaterialInputControl {...props} input={MuiSelect} />
38
+ <MaterialInputControl {...props} input={MuiSelect} />
39
39
  );
40
40
 
41
41
  export const materialEnumControlTester: RankedTester = rankWith(
@@ -29,8 +29,8 @@ import {
29
29
  isDescriptionHidden,
30
30
  } from '@jsonforms/core';
31
31
 
32
- import { Hidden, InputLabel } from '@material-ui/core';
33
- import { FormControl, FormHelperText } from '@material-ui/core';
32
+ import { Hidden, InputLabel } from '@mui/material';
33
+ import { FormControl, FormHelperText } from '@mui/material';
34
34
  import merge from 'lodash/merge';
35
35
  import { useFocus } from '../util';
36
36
 
@@ -76,6 +76,7 @@ export const MaterialInputControl = (props: ControlProps & WithInput) => {
76
76
  onFocus={onFocus}
77
77
  onBlur={onBlur}
78
78
  id={id}
79
+ variant={'standard'}
79
80
  >
80
81
  <InputLabel
81
82
  htmlFor={id + '-input'}
@@ -33,9 +33,8 @@ import {
33
33
  RankedTester,
34
34
  rankWith
35
35
  } from '@jsonforms/core';
36
- import { Hidden } from '@material-ui/core';
36
+ import { Hidden, TextField } from '@mui/material';
37
37
  import { withJsonFormsControlProps } from '@jsonforms/react';
38
- import TextField from '@material-ui/core/TextField';
39
38
  import merge from 'lodash/merge';
40
39
  import { useDebouncedChange, useFocus } from '../util';
41
40
 
@@ -35,7 +35,7 @@ import { MuiSelect } from '../mui-controls/MuiSelect';
35
35
  import { MaterialInputControl } from './MaterialInputControl';
36
36
 
37
37
  export const MaterialOneOfEnumControl = (props: ControlProps & OwnPropsOfEnum) => (
38
- <MaterialInputControl {...props} input={MuiSelect} />
38
+ <MaterialInputControl {...props} input={MuiSelect} />
39
39
  );
40
40
 
41
41
  export const materialOneOfEnumControlTester: RankedTester = rankWith(
@@ -36,12 +36,12 @@ import { withJsonFormsOneOfEnumProps } from '@jsonforms/react';
36
36
  import { MaterialRadioGroup } from './MaterialRadioGroup';
37
37
 
38
38
  export const MaterialOneOfRadioGroupControl = (props: ControlProps & OwnPropsOfEnum) => {
39
- return <MaterialRadioGroup {...props}/>;
39
+ return <MaterialRadioGroup {...props}/>;
40
40
  };
41
41
 
42
42
  export const materialOneOfRadioGroupControlTester: RankedTester = rankWith(
43
- 20,
44
- and(isOneOfEnumControl, optionIs('format', 'radio'))
45
- );
43
+ 20,
44
+ and(isOneOfEnumControl, optionIs('format', 'radio'))
45
+ );
46
46
 
47
47
  export default withJsonFormsOneOfEnumProps(MaterialOneOfRadioGroupControl);
@@ -30,15 +30,15 @@ import {
30
30
  isDescriptionHidden,
31
31
  OwnPropsOfEnum
32
32
  } from '@jsonforms/core';
33
- import Radio from '@material-ui/core/Radio';
34
- import RadioGroup from '@material-ui/core/RadioGroup';
35
33
  import {
36
34
  FormControl,
37
35
  FormControlLabel,
38
36
  FormHelperText,
39
37
  FormLabel,
40
- Hidden
41
- } from '@material-ui/core';
38
+ Hidden,
39
+ Radio,
40
+ RadioGroup
41
+ } from '@mui/material';
42
42
  import { useFocus } from '../util';
43
43
 
44
44
  export const MaterialRadioGroup = (props: ControlProps & OwnPropsOfEnum) => {
@@ -54,7 +54,8 @@ export const MaterialRadioGroup = (props: ControlProps & OwnPropsOfEnum) => {
54
54
  visible,
55
55
  options,
56
56
  handleChange,
57
- path
57
+ path,
58
+ enabled
58
59
  } = props;
59
60
  const isValid = errors.length === 0;
60
61
  const appliedUiSchemaOptions = merge(
@@ -99,6 +100,7 @@ export const MaterialRadioGroup = (props: ControlProps & OwnPropsOfEnum) => {
99
100
  key={option.label}
100
101
  control={<Radio checked={data === option.value} />}
101
102
  label={option.label}
103
+ disabled={!enabled}
102
104
  />
103
105
  ))}
104
106
  </RadioGroup>
@@ -32,7 +32,7 @@ import {
32
32
  import { withJsonFormsEnumProps } from '@jsonforms/react';
33
33
  import { MaterialRadioGroup } from './MaterialRadioGroup';
34
34
  export const MaterialRadioGroupControl = (props: ControlProps & OwnPropsOfEnum) => {
35
- return <MaterialRadioGroup {...props} />;
35
+ return <MaterialRadioGroup {...props} />;
36
36
  };
37
37
 
38
38
  export const materialRadioGroupControlTester: RankedTester = rankWith(
@@ -40,7 +40,7 @@ import {
40
40
  Hidden,
41
41
  Slider,
42
42
  Typography
43
- } from '@material-ui/core';
43
+ } from '@mui/material';
44
44
  import merge from 'lodash/merge';
45
45
  import { useFocus } from '../util';
46
46
 
@@ -32,12 +32,12 @@ import {
32
32
  rankWith
33
33
  } from '@jsonforms/core';
34
34
  import { withJsonFormsControlProps } from '@jsonforms/react';
35
- import { FormHelperText, Hidden } from '@material-ui/core';
35
+ import { FormHelperText, Hidden, TextField } from '@mui/material';
36
36
  import {
37
- KeyboardTimePicker,
38
- MuiPickersUtilsProvider
39
- } from '@material-ui/pickers';
40
- import DayjsUtils from '@date-io/dayjs';
37
+ TimePicker,
38
+ LocalizationProvider
39
+ } from '@mui/lab';
40
+ import AdapterDayjs from '@mui/lab/AdapterDayjs';
41
41
  import { createOnChangeHandler, getData, useFocus } from '../util';
42
42
 
43
43
  export const MaterialTimeControl = (props: ControlProps) => {
@@ -84,30 +84,35 @@ export const MaterialTimeControl = (props: ControlProps) => {
84
84
 
85
85
  return (
86
86
  <Hidden xsUp={!visible}>
87
- <MuiPickersUtilsProvider utils={DayjsUtils}>
88
- <KeyboardTimePicker
89
- id={id + '-input'}
90
- required={required && !appliedUiSchemaOptions.hideRequiredAsterisk}
87
+ <LocalizationProvider dateAdapter={AdapterDayjs}>
88
+ <TimePicker
91
89
  label={label}
92
- error={!isValid}
93
- fullWidth={!appliedUiSchemaOptions.trim}
94
- onFocus={onFocus}
95
- onBlur={onBlur}
96
- InputLabelProps={data ? { shrink: true } : undefined}
97
90
  value={getData(data, saveFormat)}
98
91
  clearable
99
92
  onChange={onChange}
100
- format={format}
93
+ inputFormat={format}
94
+ disableMaskedInput
101
95
  ampm={!!appliedUiSchemaOptions.ampm}
102
96
  views={appliedUiSchemaOptions.views}
103
97
  disabled={!enabled}
104
- autoFocus={appliedUiSchemaOptions.focus}
105
- cancelLabel={appliedUiSchemaOptions.cancelLabel}
106
- clearLabel={appliedUiSchemaOptions.clearLabel}
107
- okLabel={appliedUiSchemaOptions.okLabel}
108
- invalidDateMessage={null}
109
- maxDateMessage={null}
110
- minDateMessage={null}
98
+ cancelText={appliedUiSchemaOptions.cancelLabel}
99
+ clearText={appliedUiSchemaOptions.clearLabel}
100
+ okText={appliedUiSchemaOptions.okLabel}
101
+ renderInput={params => (
102
+ <TextField
103
+ {...params}
104
+ id={id + '-input'}
105
+ required={required && !appliedUiSchemaOptions.hideRequiredAsterisk}
106
+ autoFocus={appliedUiSchemaOptions.focus}
107
+ error={!isValid}
108
+ fullWidth={!appliedUiSchemaOptions.trim}
109
+ inputProps={{ ...params.inputProps, type: 'text' }}
110
+ InputLabelProps={data ? { shrink: true } : undefined}
111
+ onFocus={onFocus}
112
+ onBlur={onBlur}
113
+ variant={'standard'}
114
+ />
115
+ )}
111
116
  />
112
117
  <FormHelperText error={!isValid && !showDescription}>
113
118
  {firstFormHelperText}
@@ -115,7 +120,7 @@ export const MaterialTimeControl = (props: ControlProps) => {
115
120
  <FormHelperText error={!isValid}>
116
121
  {secondFormHelperText}
117
122
  </FormHelperText>
118
- </MuiPickersUtilsProvider>
123
+ </LocalizationProvider>
119
124
  </Hidden>
120
125
  );
121
126
  };
@@ -25,15 +25,18 @@
25
25
  import React, { ReactNode } from 'react';
26
26
  import { EnumCellProps, EnumOption, WithClassname } from '@jsonforms/core';
27
27
 
28
- import Input from '@material-ui/core/Input';
29
- import Autocomplete, { AutocompleteRenderOptionState } from '@material-ui/lab/Autocomplete';
28
+ import {
29
+ Autocomplete,
30
+ AutocompleteRenderOptionState,
31
+ Input,
32
+ FilterOptionsState
33
+ } from '@mui/material';
30
34
  import merge from 'lodash/merge';
31
- import { FilterOptionsState } from '@material-ui/lab/useAutocomplete';
32
35
 
33
36
  export interface WithOptionLabel {
34
- getOptionLabel?(option: EnumOption) : string;
35
- renderOption?(option: EnumOption, state: AutocompleteRenderOptionState): ReactNode;
36
- filterOptions?(options: EnumOption[], state: FilterOptionsState<EnumOption>) : EnumOption[];
37
+ getOptionLabel?(option: EnumOption) : string;
38
+ renderOption?(props: React.HTMLAttributes<HTMLLIElement>, option: EnumOption, state: AutocompleteRenderOptionState): ReactNode;
39
+ filterOptions?(options: EnumOption[], state: FilterOptionsState<EnumOption>) : EnumOption[];
37
40
  }
38
41
 
39
42
  export const MuiAutocomplete = (props: EnumCellProps & WithClassname & WithOptionLabel) => {
@@ -36,7 +36,7 @@ import { JsonFormsRendererRegistryEntry } from '@jsonforms/core';
36
36
  import { materialRenderers } from '../';
37
37
 
38
38
  /**
39
- * Includes all 'materialRenderers' and adds additional renderers based on '@material-ui/lab'
39
+ * Includes all 'materialRenderers' and adds additional renderers based on '@mui/lab'
40
40
  */
41
41
  export const extendedMaterialRenderers: JsonFormsRendererRegistryEntry[] = [
42
42
  {
@@ -1,8 +1,12 @@
1
- import { Grid, Hidden, Tooltip } from '@material-ui/core';
2
- import IconButton from '@material-ui/core/IconButton';
3
- import Toolbar from '@material-ui/core/Toolbar';
4
- import Typography from '@material-ui/core/Typography';
5
- import AddIcon from '@material-ui/icons/Add';
1
+ import {
2
+ Grid,
3
+ IconButton,
4
+ Hidden,
5
+ Toolbar,
6
+ Tooltip,
7
+ Typography
8
+ } from '@mui/material';
9
+ import AddIcon from '@mui/icons-material/Add';
6
10
  import React from 'react';
7
11
  import ValidationIcon from '../complex/ValidationIcon';
8
12
  export interface ArrayLayoutToolbarProps {
@@ -22,7 +26,7 @@ export const ArrayLayoutToolbar = React.memo(
22
26
  }: ArrayLayoutToolbarProps) => {
23
27
  return (
24
28
  <Toolbar disableGutters={true}>
25
- <Grid container alignItems='center' justify='space-between'>
29
+ <Grid container alignItems='center' justifyContent='space-between'>
26
30
  <Grid item>
27
31
  <Typography variant={'h6'}>{label}</Typography>
28
32
  </Grid>
@@ -42,7 +46,7 @@ export const ArrayLayoutToolbar = React.memo(
42
46
  <IconButton
43
47
  aria-label={`Add to ${label}`}
44
48
  onClick={addItem(path, createDefault())}
45
- >
49
+ size='large'>
46
50
  <AddIcon />
47
51
  </IconButton>
48
52
  </Tooltip>
@@ -22,16 +22,18 @@ import {
22
22
  createId,
23
23
  removeId
24
24
  } from '@jsonforms/core';
25
- import IconButton from '@material-ui/core/IconButton';
26
- import Accordion from '@material-ui/core/Accordion';
27
- import AccordionSummary from '@material-ui/core/AccordionSummary';
28
- import AccordionDetails from '@material-ui/core/AccordionDetails';
29
- import { Grid } from '@material-ui/core';
30
- import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
31
- import Avatar from '@material-ui/core/Avatar';
32
- import DeleteIcon from '@material-ui/icons/Delete';
33
- import ArrowUpward from '@material-ui/icons/ArrowUpward';
34
- import ArrowDownward from '@material-ui/icons/ArrowDownward';
25
+ import {
26
+ Accordion,
27
+ AccordionSummary,
28
+ AccordionDetails,
29
+ Avatar,
30
+ Grid,
31
+ IconButton
32
+ } from '@mui/material';
33
+ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
34
+ import DeleteIcon from '@mui/icons-material/Delete';
35
+ import ArrowUpward from '@mui/icons-material/ArrowUpward';
36
+ import ArrowDownward from '@mui/icons-material/ArrowDownward';
35
37
 
36
38
  const iconStyle: any = { float: 'right' };
37
39
 
@@ -137,12 +139,12 @@ const ExpandPanelRendererComponent = (props: ExpandPanelProps) => {
137
139
  </Grid>
138
140
  </Grid>
139
141
  <Grid item xs={5} md={3}>
140
- <Grid container justify={'flex-end'}>
142
+ <Grid container justifyContent='flex-end'>
141
143
  <Grid item>
142
144
  <Grid
143
145
  container
144
146
  direction='row'
145
- justify='center'
147
+ justifyContent='center'
146
148
  alignItems='center'
147
149
  >
148
150
  {appliedUiSchemaOptions.showSortButtons ? (
@@ -153,7 +155,7 @@ const ExpandPanelRendererComponent = (props: ExpandPanelProps) => {
153
155
  style={iconStyle}
154
156
  disabled={!enableMoveUp}
155
157
  aria-label={`Move up`}
156
- >
158
+ size='large'>
157
159
  <ArrowUpward />
158
160
  </IconButton>
159
161
  </Grid>
@@ -163,7 +165,7 @@ const ExpandPanelRendererComponent = (props: ExpandPanelProps) => {
163
165
  style={iconStyle}
164
166
  disabled={!enableMoveDown}
165
167
  aria-label={`Move down`}
166
- >
168
+ size='large'>
167
169
  <ArrowDownward />
168
170
  </IconButton>
169
171
  </Grid>
@@ -176,7 +178,7 @@ const ExpandPanelRendererComponent = (props: ExpandPanelProps) => {
176
178
  onClick={removeItems(path, [index])}
177
179
  style={iconStyle}
178
180
  aria-label={`Delete`}
179
- >
181
+ size='large'>
180
182
  <DeleteIcon />
181
183
  </IconButton>
182
184
  </Grid>
@@ -30,7 +30,7 @@ import {
30
30
  RankedTester,
31
31
  rankWith
32
32
  } from '@jsonforms/core';
33
- import { Hidden } from '@material-ui/core';
33
+ import { Hidden } from '@mui/material';
34
34
  import { MaterialArrayLayout } from './MaterialArrayLayout';
35
35
  import { withJsonFormsArrayLayoutProps } from '@jsonforms/react';
36
36
 
@@ -23,8 +23,7 @@
23
23
  THE SOFTWARE.
24
24
  */
25
25
  import React, {useState} from 'react';
26
- import { Hidden, Tab, Tabs } from '@material-ui/core';
27
- import AppBar from '@material-ui/core/AppBar';
26
+ import { AppBar, Hidden, Tab, Tabs } from '@mui/material';
28
27
  import {
29
28
  and,
30
29
  Categorization,
@@ -114,7 +113,7 @@ export const MaterialCategorizationLayoutRenderer = (props: MaterialCategorizati
114
113
  return (
115
114
  <Hidden xsUp={!visible}>
116
115
  <AppBar position='static'>
117
- <Tabs value={activeCategory} onChange={onTabChange} variant='scrollable'>
116
+ <Tabs value={activeCategory} onChange={onTabChange} textColor='inherit' indicatorColor='secondary' variant='scrollable'>
118
117
  {categories.map((e: Category, idx: number) => (
119
118
  <Tab key={idx} label={e.label} />
120
119
  ))}
@@ -24,7 +24,7 @@
24
24
  */
25
25
  import React, {useState} from 'react';
26
26
  import merge from 'lodash/merge';
27
- import { Button, Hidden, Step, StepButton, Stepper } from '@material-ui/core';
27
+ import { Button, Hidden, Step, StepButton, Stepper } from '@mui/material';
28
28
  import {
29
29
  and,
30
30
  Categorization,
@@ -24,7 +24,7 @@
24
24
  */
25
25
  import isEmpty from 'lodash/isEmpty';
26
26
  import React from 'react';
27
- import { Card, CardContent, CardHeader, Hidden } from '@material-ui/core';
27
+ import { Card, CardContent, CardHeader, Hidden } from '@mui/material';
28
28
  import {
29
29
  GroupLayout,
30
30
  LayoutProps,
@@ -24,7 +24,7 @@
24
24
  */
25
25
  import React from 'react';
26
26
  import { CellProps, WithClassname } from '@jsonforms/core';
27
- import Checkbox from '@material-ui/core/Checkbox';
27
+ import { Checkbox } from '@mui/material';
28
28
  import merge from 'lodash/merge';
29
29
 
30
30
  export const MuiCheckbox = React.memo((props: CellProps & WithClassname) => {
@@ -24,7 +24,7 @@
24
24
  */
25
25
  import React from 'react';
26
26
  import { CellProps, WithClassname } from '@jsonforms/core';
27
- import Input from '@material-ui/core/Input';
27
+ import { Input } from '@mui/material';
28
28
  import merge from 'lodash/merge';
29
29
  import { useDebouncedChange } from '../util';
30
30
 
@@ -24,7 +24,7 @@
24
24
  */
25
25
  import React from 'react';
26
26
  import { CellProps, WithClassname } from '@jsonforms/core';
27
- import Input from '@material-ui/core/Input';
27
+ import { Input } from '@mui/material';
28
28
  import merge from 'lodash/merge';
29
29
  import {useDebouncedChange} from '../util';
30
30
 
@@ -24,7 +24,7 @@
24
24
  */
25
25
  import React, {useCallback} from 'react';
26
26
  import { CellProps, Formatted, WithClassname } from '@jsonforms/core';
27
- import Input from '@material-ui/core/Input';
27
+ import { Input } from '@mui/material';
28
28
  import merge from 'lodash/merge';
29
29
  import { useDebouncedChange } from '../util';
30
30
 
@@ -24,14 +24,17 @@
24
24
  */
25
25
  import React, { useState } from 'react';
26
26
  import { CellProps, WithClassname } from '@jsonforms/core';
27
- import Input, { InputProps } from '@material-ui/core/Input';
27
+ import {
28
+ IconButton,
29
+ Input,
30
+ InputAdornment,
31
+ InputBaseComponentProps,
32
+ InputProps,
33
+ useTheme
34
+ } from '@mui/material';
28
35
  import merge from 'lodash/merge';
29
- import IconButton from '@material-ui/core/IconButton';
30
- import InputAdornment from '@material-ui/core/InputAdornment';
31
- import Close from '@material-ui/icons/Close';
32
- import { useTheme } from '@material-ui/core/styles';
36
+ import Close from '@mui/icons-material/Close';
33
37
  import { JsonFormsTheme, useDebouncedChange } from '../util';
34
- import { InputBaseComponentProps } from '@material-ui/core';
35
38
 
36
39
  interface MuiTextInputProps {
37
40
  muiInputProps?: InputProps['inputProps'];
@@ -74,7 +77,10 @@ export const MuiInputText = React.memo((props: CellProps & WithClassname & MuiTe
74
77
 
75
78
  const theme: JsonFormsTheme = useTheme();
76
79
 
77
- const closeStyle = {background: theme.jsonforms?.input?.delete?.background || theme.palette.background.default, borderRadius: '50%'};
80
+ const closeStyle = {
81
+ background: theme.jsonforms?.input?.delete?.background || theme.palette.background.default,
82
+ borderRadius: '50%'
83
+ };
78
84
 
79
85
  return (
80
86
  <Input
@@ -106,6 +112,7 @@ export const MuiInputText = React.memo((props: CellProps & WithClassname & MuiTe
106
112
  <IconButton
107
113
  aria-label='Clear input field'
108
114
  onClick={onClear}
115
+ size='large'
109
116
  >
110
117
  <Close style={closeStyle}/>
111
118
  </IconButton>
@@ -24,7 +24,7 @@
24
24
  */
25
25
  import React from 'react';
26
26
  import { CellProps, WithClassname } from '@jsonforms/core';
27
- import Input from '@material-ui/core/Input';
27
+ import { Input } from '@mui/material';
28
28
  import merge from 'lodash/merge';
29
29
  import { useDebouncedChange } from '../util';
30
30
 
@@ -25,8 +25,7 @@
25
25
  import React from 'react';
26
26
  import { EnumCellProps, WithClassname } from '@jsonforms/core';
27
27
 
28
- import Select from '@material-ui/core/Select';
29
- import { MenuItem } from '@material-ui/core';
28
+ import { MenuItem, Select } from '@mui/material';
30
29
  import merge from 'lodash/merge';
31
30
 
32
31
  export const MuiSelect = React.memo((props: EnumCellProps & WithClassname) => {
@@ -52,6 +51,7 @@ export const MuiSelect = React.memo((props: EnumCellProps & WithClassname) => {
52
51
  value={data !== undefined ? data : ''}
53
52
  onChange={ev => handleChange(path, ev.target.value)}
54
53
  fullWidth={true}
54
+ variant={'standard'}
55
55
  >
56
56
  {[<MenuItem value='' key={'empty'} />].concat(
57
57
  options.map(optionValue => (
@@ -24,7 +24,7 @@
24
24
  */
25
25
  import React from 'react';
26
26
  import { CellProps, WithClassname } from '@jsonforms/core';
27
- import Switch from '@material-ui/core/Switch';
27
+ import { Switch } from '@mui/material';
28
28
  import merge from 'lodash/merge';
29
29
 
30
30
  export const MuiToggle = React.memo((props: CellProps & WithClassname) => {
@@ -35,7 +35,7 @@ import {
35
35
  UISchemaElement
36
36
  } from '@jsonforms/core';
37
37
  import { JsonFormsDispatch, useJsonForms } from '@jsonforms/react';
38
- import { Grid, Hidden } from '@material-ui/core';
38
+ import { Grid, Hidden } from '@mui/material';
39
39
 
40
40
  export const renderLayoutElements = (
41
41
  elements: UISchemaElement[],
package/src/util/theme.ts CHANGED
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { Theme } from '@material-ui/core/styles';
25
+ import { Theme } from '@mui/material';
26
26
 
27
27
  export interface JsonFormsTheme extends Theme {
28
28
  jsonforms?: {
@@ -26,7 +26,7 @@ import './MatchMediaMock';
26
26
  import React from 'react';
27
27
 
28
28
  import Enzyme, { mount, ReactWrapper } from 'enzyme';
29
- import Adapter from 'enzyme-adapter-react-16';
29
+ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
30
30
  import { ControlElement } from '@jsonforms/core';
31
31
  import { MaterialAllOfRenderer, materialRenderers } from '../../src';
32
32
  import { JsonForms, JsonFormsStateProvider } from '@jsonforms/react';