@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.
- package/docs/assets/js/search.json +1 -1
- package/docs/classes/materialanyofstringorenumcontrol.html +1 -1
- package/docs/classes/materialtablecontrol.html +2 -2
- package/docs/globals.html +79 -79
- package/docs/index.html +6 -0
- package/docs/interfaces/arraylayouttoolbarprops.html +5 -5
- package/docs/interfaces/categorizationstate.html +1 -1
- package/docs/interfaces/dispatchpropsofexpandpanel.html +3 -3
- package/docs/interfaces/expandpanelprops.html +19 -19
- package/docs/interfaces/jsonformstheme.html +39 -46
- package/docs/interfaces/materialcategorizationlayoutrendererprops.html +4 -4
- package/docs/interfaces/materialtabletoolbarprops.html +9 -9
- package/docs/interfaces/muitextinputprops.html +2 -2
- package/docs/interfaces/ownpropsofexpandpanel.html +14 -14
- package/docs/interfaces/statepropsofexpandpanel.html +16 -16
- package/docs/interfaces/tablerowsprop.html +9 -9
- package/docs/interfaces/validationprops.html +2 -2
- package/docs/interfaces/withoptionlabel.html +7 -4
- package/example/index.ts +5 -20
- package/lib/additional/ListWithDetailMasterItem.js +8 -8
- package/lib/additional/ListWithDetailMasterItem.js.map +1 -1
- package/lib/additional/MaterialLabelRenderer.js +3 -3
- package/lib/additional/MaterialLabelRenderer.js.map +1 -1
- package/lib/additional/MaterialListWithDetailRenderer.js +6 -6
- package/lib/additional/MaterialListWithDetailRenderer.js.map +1 -1
- package/lib/cells/MaterialDateCell.js +1 -1
- package/lib/cells/MaterialDateCell.js.map +1 -1
- package/lib/complex/DeleteDialog.js +8 -9
- package/lib/complex/DeleteDialog.js.map +1 -1
- package/lib/complex/MaterialAllOfRenderer.js +8 -8
- package/lib/complex/MaterialAllOfRenderer.js.map +1 -1
- package/lib/complex/MaterialAnyOfRenderer.js +3 -3
- package/lib/complex/MaterialAnyOfRenderer.js.map +1 -1
- package/lib/complex/MaterialArrayControlRenderer.js +2 -2
- package/lib/complex/MaterialArrayControlRenderer.js.map +1 -1
- package/lib/complex/MaterialEnumArrayRenderer.js +6 -6
- package/lib/complex/MaterialEnumArrayRenderer.js.map +1 -1
- package/lib/complex/MaterialObjectRenderer.js +2 -2
- package/lib/complex/MaterialObjectRenderer.js.map +1 -1
- package/lib/complex/MaterialOneOfRenderer.js +10 -10
- package/lib/complex/MaterialOneOfRenderer.js.map +1 -1
- package/lib/complex/MaterialTableControl.js +27 -28
- package/lib/complex/MaterialTableControl.js.map +1 -1
- package/lib/complex/NoBorderTableCell.d.ts +2 -2
- package/lib/complex/NoBorderTableCell.js +8 -10
- package/lib/complex/NoBorderTableCell.js.map +1 -1
- package/lib/complex/TableToolbar.js +12 -14
- package/lib/complex/TableToolbar.js.map +1 -1
- package/lib/complex/ValidationIcon.d.ts +2 -8
- package/lib/complex/ValidationIcon.js +9 -13
- package/lib/complex/ValidationIcon.js.map +1 -1
- package/lib/controls/MaterialAnyOfStringOrEnumControl.js +2 -2
- package/lib/controls/MaterialAnyOfStringOrEnumControl.js.map +1 -1
- package/lib/controls/MaterialBooleanControl.js +3 -3
- package/lib/controls/MaterialBooleanControl.js.map +1 -1
- package/lib/controls/MaterialBooleanToggleControl.js +3 -3
- package/lib/controls/MaterialBooleanToggleControl.js.map +1 -1
- package/lib/controls/MaterialDateControl.js +8 -11
- package/lib/controls/MaterialDateControl.js.map +1 -1
- package/lib/controls/MaterialDateTimeControl.js +8 -13
- package/lib/controls/MaterialDateTimeControl.js.map +1 -1
- package/lib/controls/MaterialEnumControl.js.map +1 -1
- package/lib/controls/MaterialInputControl.js +7 -7
- package/lib/controls/MaterialInputControl.js.map +1 -1
- package/lib/controls/MaterialNativeControl.js +3 -4
- package/lib/controls/MaterialNativeControl.js.map +1 -1
- package/lib/controls/MaterialOneOfEnumControl.js.map +1 -1
- package/lib/controls/MaterialOneOfRadioGroupControl.js.map +1 -1
- package/lib/controls/MaterialRadioGroup.js +7 -9
- package/lib/controls/MaterialRadioGroup.js.map +1 -1
- package/lib/controls/MaterialRadioGroupControl.js.map +1 -1
- package/lib/controls/MaterialSliderControl.js +9 -9
- package/lib/controls/MaterialSliderControl.js.map +1 -1
- package/lib/controls/MaterialTimeControl.js +8 -8
- package/lib/controls/MaterialTimeControl.js.map +1 -1
- package/lib/extended/MuiAutocomplete.d.ts +3 -4
- package/lib/extended/MuiAutocomplete.js +3 -4
- package/lib/extended/MuiAutocomplete.js.map +1 -1
- package/lib/extended/index.d.ts +1 -1
- package/lib/extended/index.js +1 -1
- package/lib/jsonforms-material.js +248 -43
- package/lib/jsonforms-material.js.map +1 -1
- package/lib/layouts/ArrayToolbar.js +13 -16
- package/lib/layouts/ArrayToolbar.js.map +1 -1
- package/lib/layouts/ExpandPanelRenderer.js +24 -29
- package/lib/layouts/ExpandPanelRenderer.js.map +1 -1
- package/lib/layouts/MaterialArrayLayoutRenderer.js +2 -2
- package/lib/layouts/MaterialArrayLayoutRenderer.js.map +1 -1
- package/lib/layouts/MaterialCategorizationLayout.js +8 -9
- package/lib/layouts/MaterialCategorizationLayout.js.map +1 -1
- package/lib/layouts/MaterialCategorizationStepperLayout.js +9 -9
- package/lib/layouts/MaterialCategorizationStepperLayout.js.map +1 -1
- package/lib/layouts/MaterialGroupLayout.js +8 -8
- package/lib/layouts/MaterialGroupLayout.js.map +1 -1
- package/lib/mui-controls/MuiCheckbox.js +2 -2
- package/lib/mui-controls/MuiCheckbox.js.map +1 -1
- package/lib/mui-controls/MuiInputInteger.js +2 -2
- package/lib/mui-controls/MuiInputInteger.js.map +1 -1
- package/lib/mui-controls/MuiInputNumber.js +2 -2
- package/lib/mui-controls/MuiInputNumber.js.map +1 -1
- package/lib/mui-controls/MuiInputNumberFormat.js +2 -2
- package/lib/mui-controls/MuiInputNumberFormat.js.map +1 -1
- package/lib/mui-controls/MuiInputText.d.ts +1 -1
- package/lib/mui-controls/MuiInputText.js +9 -9
- package/lib/mui-controls/MuiInputText.js.map +1 -1
- package/lib/mui-controls/MuiInputTime.js +2 -2
- package/lib/mui-controls/MuiInputTime.js.map +1 -1
- package/lib/mui-controls/MuiSelect.js +2 -3
- package/lib/mui-controls/MuiSelect.js.map +1 -1
- package/lib/mui-controls/MuiToggle.js +2 -2
- package/lib/mui-controls/MuiToggle.js.map +1 -1
- package/lib/util/layout.js +4 -4
- package/lib/util/layout.js.map +1 -1
- package/lib/util/theme.d.ts +1 -1
- package/package.json +17 -20
- package/src/additional/ListWithDetailMasterItem.tsx +3 -6
- package/src/additional/MaterialLabelRenderer.tsx +1 -1
- package/src/additional/MaterialListWithDetailRenderer.tsx +1 -1
- package/src/cells/MaterialDateCell.tsx +1 -1
- package/src/complex/DeleteDialog.tsx +2 -2
- package/src/complex/MaterialAllOfRenderer.tsx +1 -1
- package/src/complex/MaterialAnyOfRenderer.tsx +1 -1
- package/src/complex/MaterialArrayControlRenderer.tsx +1 -1
- package/src/complex/MaterialEnumArrayRenderer.tsx +1 -1
- package/src/complex/MaterialObjectRenderer.tsx +1 -1
- package/src/complex/MaterialOneOfRenderer.tsx +1 -1
- package/src/complex/MaterialTableControl.tsx +9 -13
- package/src/complex/NoBorderTableCell.tsx +10 -12
- package/src/complex/TableToolbar.tsx +9 -7
- package/src/complex/ValidationIcon.tsx +12 -19
- package/src/controls/MaterialAnyOfStringOrEnumControl.tsx +1 -2
- package/src/controls/MaterialBooleanControl.tsx +1 -1
- package/src/controls/MaterialBooleanToggleControl.tsx +1 -1
- package/src/controls/MaterialDateControl.tsx +28 -29
- package/src/controls/MaterialDateTimeControl.tsx +28 -33
- package/src/controls/MaterialEnumControl.tsx +1 -1
- package/src/controls/MaterialInputControl.tsx +3 -2
- package/src/controls/MaterialNativeControl.tsx +1 -2
- package/src/controls/MaterialOneOfEnumControl.tsx +1 -1
- package/src/controls/MaterialOneOfRadioGroupControl.tsx +4 -4
- package/src/controls/MaterialRadioGroup.tsx +7 -5
- package/src/controls/MaterialRadioGroupControl.tsx +1 -1
- package/src/controls/MaterialSliderControl.tsx +1 -1
- package/src/controls/MaterialTimeControl.tsx +28 -23
- package/src/extended/MuiAutocomplete.tsx +9 -6
- package/src/extended/index.ts +1 -1
- package/src/layouts/ArrayToolbar.tsx +11 -7
- package/src/layouts/ExpandPanelRenderer.tsx +17 -15
- package/src/layouts/MaterialArrayLayoutRenderer.tsx +1 -1
- package/src/layouts/MaterialCategorizationLayout.tsx +2 -3
- package/src/layouts/MaterialCategorizationStepperLayout.tsx +1 -1
- package/src/layouts/MaterialGroupLayout.tsx +1 -1
- package/src/mui-controls/MuiCheckbox.tsx +1 -1
- package/src/mui-controls/MuiInputInteger.tsx +1 -1
- package/src/mui-controls/MuiInputNumber.tsx +1 -1
- package/src/mui-controls/MuiInputNumberFormat.tsx +1 -1
- package/src/mui-controls/MuiInputText.tsx +14 -7
- package/src/mui-controls/MuiInputTime.tsx +1 -1
- package/src/mui-controls/MuiSelect.tsx +2 -2
- package/src/mui-controls/MuiToggle.tsx +1 -1
- package/src/util/layout.tsx +1 -1
- package/src/util/theme.ts +1 -1
- package/test/renderers/MaterialAllOfRenderer.test.tsx +1 -1
- package/test/renderers/MaterialAnyOfRenderer.test.tsx +1 -1
- package/test/renderers/MaterialAnyOfStringOrEnumControl.test.tsx +1 -1
- package/test/renderers/MaterialArrayControl.test.tsx +1 -1
- package/test/renderers/MaterialArrayLayout.test.tsx +2 -2
- package/test/renderers/MaterialBooleanCell.test.tsx +1 -1
- package/test/renderers/MaterialBooleanToggleCell.test.tsx +3 -2
- package/test/renderers/MaterialBooleanToggleControl.test.tsx +3 -2
- package/test/renderers/MaterialCategorizationLayout.test.tsx +2 -2
- package/test/renderers/MaterialCategorizationStepperLayout.test.tsx +2 -2
- package/test/renderers/MaterialDateCell.test.tsx +1 -1
- package/test/renderers/MaterialDateControl.test.tsx +5 -3
- package/test/renderers/MaterialDateTimeControl.test.tsx +5 -3
- package/test/renderers/MaterialEnumArrayRenderer.test.tsx +1 -1
- package/test/renderers/MaterialEnumCell.test.tsx +1 -1
- package/test/renderers/MaterialGroupLayout.test.tsx +1 -1
- package/test/renderers/MaterialInputControl.test.tsx +1 -1
- package/test/renderers/MaterialIntegerCell.test.tsx +1 -1
- package/test/renderers/MaterialLabelRenderer.test.tsx +1 -1
- package/test/renderers/MaterialLayouts.test.tsx +1 -1
- package/test/renderers/MaterialListWithDetailRenderer.test.tsx +2 -2
- package/test/renderers/MaterialNativeControl.test.tsx +2 -2
- package/test/renderers/MaterialNumberCell.test.tsx +1 -1
- package/test/renderers/MaterialObjectControl.test.tsx +1 -1
- package/test/renderers/MaterialOneOfEnumCell.test.tsx +1 -1
- package/test/renderers/MaterialOneOfRadioGroupControl.test.tsx +1 -1
- package/test/renderers/MaterialOneOfRenderer.test.tsx +10 -7
- package/test/renderers/MaterialRadioGroupControl.test.tsx +1 -1
- package/test/renderers/MaterialSliderControl.test.tsx +2 -2
- package/test/renderers/MaterialTextCell.test.tsx +6 -13
- package/test/renderers/MaterialTextControl.test.tsx +8 -4
- package/test/renderers/MaterialTimeCell.test.tsx +1 -1
- package/test/renderers/MaterialTimeControl.test.tsx +5 -3
- package/webpack/webpack.build.js +3 -3
- 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
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
} from '@
|
|
45
|
-
import
|
|
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
|
-
<
|
|
93
|
-
<
|
|
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
|
-
|
|
93
|
+
inputFormat={format}
|
|
94
|
+
disableMaskedInput
|
|
106
95
|
ampm={!!appliedUiSchemaOptions.ampm}
|
|
107
96
|
views={appliedUiSchemaOptions.views}
|
|
108
97
|
disabled={!enabled}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
</
|
|
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
|
-
|
|
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
|
|
33
|
-
import { FormControl, FormHelperText } from '@material
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
39
|
+
return <MaterialRadioGroup {...props}/>;
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
export const materialOneOfRadioGroupControlTester: RankedTester = rankWith(
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
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
|
-
|
|
35
|
+
return <MaterialRadioGroup {...props} />;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
export const materialRadioGroupControlTester: RankedTester = rankWith(
|
|
@@ -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
|
|
35
|
+
import { FormHelperText, Hidden, TextField } from '@mui/material';
|
|
36
36
|
import {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} from '@
|
|
40
|
-
import
|
|
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
|
-
<
|
|
88
|
-
<
|
|
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
|
-
|
|
93
|
+
inputFormat={format}
|
|
94
|
+
disableMaskedInput
|
|
101
95
|
ampm={!!appliedUiSchemaOptions.ampm}
|
|
102
96
|
views={appliedUiSchemaOptions.views}
|
|
103
97
|
disabled={!enabled}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
</
|
|
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
|
|
29
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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) => {
|
package/src/extended/index.ts
CHANGED
|
@@ -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 '@
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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'
|
|
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
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
import
|
|
34
|
-
import
|
|
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
|
|
142
|
+
<Grid container justifyContent='flex-end'>
|
|
141
143
|
<Grid item>
|
|
142
144
|
<Grid
|
|
143
145
|
container
|
|
144
146
|
direction='row'
|
|
145
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 = {
|
|
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
|
|
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
|
|
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
|
|
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) => {
|
package/src/util/layout.tsx
CHANGED
|
@@ -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
|
|
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
|
|
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-
|
|
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';
|