@jsonforms/material-renderers 3.1.0-alpha.1 → 3.1.0-alpha.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.
- package/README.md +16 -17
- package/lib/additional/ListWithDetailMasterItem.d.ts +2 -0
- package/lib/additional/MaterialListWithDetailRenderer.d.ts +1 -1
- package/lib/additional/index.d.ts +2 -2
- package/lib/additional/unwrapped.d.ts +5 -0
- package/lib/cells/index.d.ts +1 -1
- package/lib/complex/CombinatorProperties.d.ts +1 -2
- package/lib/complex/DeleteDialog.d.ts +5 -1
- package/lib/complex/MaterialAllOfRenderer.d.ts +1 -1
- package/lib/complex/MaterialAnyOfRenderer.d.ts +1 -1
- package/lib/complex/MaterialArrayControlRenderer.d.ts +2 -1
- package/lib/complex/MaterialEnumArrayRenderer.d.ts +1 -1
- package/lib/complex/MaterialObjectRenderer.d.ts +1 -1
- package/lib/complex/MaterialOneOfRenderer.d.ts +1 -1
- package/lib/complex/MaterialTableControl.d.ts +4 -2
- package/lib/complex/NoBorderTableCell.d.ts +2 -2
- package/lib/complex/TableToolbar.d.ts +3 -2
- package/lib/complex/index.d.ts +11 -16
- package/lib/complex/unwrapped.d.ts +9 -0
- package/lib/controls/MaterialBooleanControl.d.ts +1 -1
- package/lib/controls/MaterialBooleanToggleControl.d.ts +1 -1
- package/lib/controls/index.d.ts +8 -26
- package/lib/controls/unwrapped.d.ts +19 -0
- package/lib/index.d.ts +34 -1
- package/lib/jsonforms-react-material.cjs.js +690 -599
- package/lib/jsonforms-react-material.cjs.js.map +1 -1
- package/lib/jsonforms-react-material.esm.js +620 -557
- package/lib/jsonforms-react-material.esm.js.map +1 -1
- package/lib/layouts/ArrayToolbar.d.ts +3 -1
- package/lib/layouts/ExpandPanelRenderer.d.ts +3 -1
- package/lib/layouts/MaterialGroupLayout.d.ts +1 -1
- package/lib/layouts/MaterialHorizontalLayout.d.ts +1 -1
- package/lib/layouts/MaterialVerticalLayout.d.ts +1 -1
- package/lib/layouts/index.d.ts +3 -1
- package/lib/layouts/unwrapped.d.ts +10 -0
- package/lib/mui-controls/MuiCheckbox.d.ts +1 -1
- package/lib/mui-controls/MuiInputInteger.d.ts +1 -1
- package/lib/mui-controls/MuiInputNumber.d.ts +1 -1
- package/lib/mui-controls/MuiInputNumberFormat.d.ts +1 -1
- package/lib/mui-controls/MuiInputText.d.ts +1 -1
- package/lib/mui-controls/MuiInputTime.d.ts +1 -1
- package/lib/mui-controls/MuiSelect.d.ts +1 -1
- package/lib/mui-controls/MuiToggle.d.ts +1 -1
- package/lib/mui-controls/index.d.ts +3 -1
- package/lib/util/layout.d.ts +2 -3
- package/package.json +16 -9
- package/src/additional/ListWithDetailMasterItem.tsx +31 -23
- package/src/additional/MaterialLabelRenderer.tsx +8 -15
- package/src/additional/MaterialListWithDetailRenderer.tsx +8 -5
- package/src/additional/index.ts +12 -4
- package/src/additional/unwrapped.ts +32 -0
- package/src/cells/MaterialBooleanCell.tsx +1 -1
- package/src/cells/MaterialBooleanToggleCell.tsx +2 -2
- package/src/cells/MaterialDateCell.tsx +4 -12
- package/src/cells/MaterialEnumCell.tsx +13 -6
- package/src/cells/MaterialIntegerCell.tsx +1 -1
- package/src/cells/MaterialNumberCell.tsx +1 -1
- package/src/cells/MaterialNumberFormatCell.tsx +1 -1
- package/src/cells/MaterialOneOfEnumCell.tsx +17 -7
- package/src/cells/MaterialTextCell.tsx +1 -1
- package/src/cells/MaterialTimeCell.tsx +1 -1
- package/src/cells/index.ts +7 -7
- package/src/complex/CombinatorProperties.tsx +20 -9
- package/src/complex/DeleteDialog.tsx +48 -37
- package/src/complex/MaterialAllOfRenderer.tsx +2 -2
- package/src/complex/MaterialAnyOfRenderer.tsx +3 -3
- package/src/complex/MaterialArrayControlRenderer.tsx +27 -11
- package/src/complex/MaterialEnumArrayRenderer.tsx +6 -8
- package/src/complex/MaterialObjectRenderer.tsx +6 -3
- package/src/complex/MaterialOneOfRenderer.tsx +105 -88
- package/src/complex/MaterialTableControl.tsx +145 -97
- package/src/complex/NoBorderTableCell.tsx +3 -5
- package/src/complex/TableToolbar.tsx +24 -25
- package/src/complex/ValidationIcon.tsx +10 -18
- package/src/complex/index.ts +35 -32
- package/src/complex/unwrapped.ts +39 -0
- package/src/controls/MaterialAnyOfStringOrEnumControl.tsx +19 -11
- package/src/controls/MaterialBooleanControl.tsx +22 -16
- package/src/controls/MaterialBooleanToggleControl.tsx +22 -16
- package/src/controls/MaterialDateControl.tsx +16 -19
- package/src/controls/MaterialDateTimeControl.tsx +24 -23
- package/src/controls/MaterialEnumControl.tsx +21 -15
- package/src/controls/MaterialInputControl.tsx +7 -8
- package/src/controls/MaterialIntegerControl.tsx +1 -1
- package/src/controls/MaterialNativeControl.tsx +12 -9
- package/src/controls/MaterialNumberControl.tsx +1 -1
- package/src/controls/MaterialOneOfEnumControl.tsx +21 -15
- package/src/controls/MaterialOneOfRadioGroupControl.tsx +5 -3
- package/src/controls/MaterialRadioGroup.tsx +11 -17
- package/src/controls/MaterialRadioGroupControl.tsx +8 -3
- package/src/controls/MaterialSliderControl.tsx +17 -16
- package/src/controls/MaterialTextControl.tsx +1 -1
- package/src/controls/MaterialTimeControl.tsx +19 -22
- package/src/controls/index.ts +36 -72
- package/src/controls/unwrapped.ts +57 -0
- package/src/index.ts +41 -22
- package/src/layouts/ArrayToolbar.tsx +38 -42
- package/src/layouts/ExpandPanelRenderer.tsx +96 -67
- package/src/layouts/MaterialArrayLayout.tsx +21 -16
- package/src/layouts/MaterialArrayLayoutRenderer.tsx +6 -9
- package/src/layouts/MaterialCategorizationLayout.tsx +52 -21
- package/src/layouts/MaterialCategorizationStepperLayout.tsx +60 -44
- package/src/layouts/MaterialGroupLayout.tsx +25 -6
- package/src/layouts/MaterialHorizontalLayout.tsx +18 -4
- package/src/layouts/MaterialVerticalLayout.tsx +18 -4
- package/src/layouts/index.ts +18 -7
- package/src/layouts/unwrapped.ts +41 -0
- package/src/mui-controls/MuiAutocomplete.tsx +51 -35
- package/src/mui-controls/MuiCheckbox.tsx +5 -3
- package/src/mui-controls/MuiInputInteger.tsx +31 -32
- package/src/mui-controls/MuiInputNumber.tsx +16 -16
- package/src/mui-controls/MuiInputNumberFormat.tsx +51 -42
- package/src/mui-controls/MuiInputText.tsx +30 -19
- package/src/mui-controls/MuiInputTime.tsx +11 -12
- package/src/mui-controls/MuiSelect.tsx +15 -6
- package/src/mui-controls/MuiToggle.tsx +5 -3
- package/src/mui-controls/index.ts +3 -1
- package/src/util/datejs.tsx +41 -20
- package/src/util/debounce.ts +26 -11
- package/src/util/focus.ts +7 -7
- package/src/util/i18nDefaults.ts +2 -2
- package/src/util/layout.tsx +47 -42
- package/src/util/theme.ts +2 -2
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import React from 'react';
|
|
26
26
|
import {
|
|
27
|
-
|
|
27
|
+
and,
|
|
28
28
|
ControlProps,
|
|
29
29
|
isOneOfEnumControl,
|
|
30
30
|
optionIs,
|
|
@@ -35,8 +35,10 @@ import {
|
|
|
35
35
|
import { withJsonFormsOneOfEnumProps } from '@jsonforms/react';
|
|
36
36
|
import { MaterialRadioGroup } from './MaterialRadioGroup';
|
|
37
37
|
|
|
38
|
-
export const MaterialOneOfRadioGroupControl = (
|
|
39
|
-
|
|
38
|
+
export const MaterialOneOfRadioGroupControl = (
|
|
39
|
+
props: ControlProps & OwnPropsOfEnum
|
|
40
|
+
) => {
|
|
41
|
+
return <MaterialRadioGroup {...props} />;
|
|
40
42
|
};
|
|
41
43
|
|
|
42
44
|
export const materialOneOfRadioGroupControlTester: RankedTester = rankWith(
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
ControlProps,
|
|
29
29
|
showAsRequired,
|
|
30
30
|
isDescriptionHidden,
|
|
31
|
-
OwnPropsOfEnum
|
|
31
|
+
OwnPropsOfEnum,
|
|
32
32
|
} from '@jsonforms/core';
|
|
33
33
|
import {
|
|
34
34
|
FormControl,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
FormLabel,
|
|
38
38
|
Hidden,
|
|
39
39
|
Radio,
|
|
40
|
-
RadioGroup
|
|
40
|
+
RadioGroup,
|
|
41
41
|
} from '@mui/material';
|
|
42
42
|
import { useFocus } from '../util';
|
|
43
43
|
|
|
@@ -55,21 +55,17 @@ export const MaterialRadioGroup = (props: ControlProps & OwnPropsOfEnum) => {
|
|
|
55
55
|
options,
|
|
56
56
|
handleChange,
|
|
57
57
|
path,
|
|
58
|
-
enabled
|
|
58
|
+
enabled,
|
|
59
59
|
} = props;
|
|
60
60
|
const isValid = errors.length === 0;
|
|
61
|
-
const appliedUiSchemaOptions = merge(
|
|
62
|
-
{},
|
|
63
|
-
config,
|
|
64
|
-
props.uischema.options
|
|
65
|
-
);
|
|
61
|
+
const appliedUiSchemaOptions = merge({}, config, props.uischema.options);
|
|
66
62
|
const showDescription = !isDescriptionHidden(
|
|
67
63
|
visible,
|
|
68
64
|
description,
|
|
69
65
|
focused,
|
|
70
66
|
appliedUiSchemaOptions.showUnfocusedDescription
|
|
71
67
|
);
|
|
72
|
-
const onChange = (_ev:any, value:any) => handleChange(path, value);
|
|
68
|
+
const onChange = (_ev: any, value: any) => handleChange(path, value);
|
|
73
69
|
|
|
74
70
|
return (
|
|
75
71
|
<Hidden xsUp={!visible}>
|
|
@@ -83,18 +79,16 @@ export const MaterialRadioGroup = (props: ControlProps & OwnPropsOfEnum) => {
|
|
|
83
79
|
htmlFor={id}
|
|
84
80
|
error={!isValid}
|
|
85
81
|
component={'legend' as 'label'}
|
|
86
|
-
required={showAsRequired(
|
|
87
|
-
|
|
82
|
+
required={showAsRequired(
|
|
83
|
+
required,
|
|
84
|
+
appliedUiSchemaOptions.hideRequiredAsterisk
|
|
85
|
+
)}
|
|
88
86
|
>
|
|
89
87
|
{label}
|
|
90
88
|
</FormLabel>
|
|
91
89
|
|
|
92
|
-
<RadioGroup
|
|
93
|
-
|
|
94
|
-
onChange={onChange}
|
|
95
|
-
row={true}
|
|
96
|
-
>
|
|
97
|
-
{options.map(option => (
|
|
90
|
+
<RadioGroup value={props.data ?? ''} onChange={onChange} row={true}>
|
|
91
|
+
{options.map((option) => (
|
|
98
92
|
<FormControlLabel
|
|
99
93
|
value={option.value}
|
|
100
94
|
key={option.label}
|
|
@@ -27,11 +27,16 @@ import {
|
|
|
27
27
|
and,
|
|
28
28
|
ControlProps,
|
|
29
29
|
isEnumControl,
|
|
30
|
-
optionIs,
|
|
30
|
+
optionIs,
|
|
31
|
+
OwnPropsOfEnum,
|
|
32
|
+
RankedTester,
|
|
33
|
+
rankWith,
|
|
31
34
|
} from '@jsonforms/core';
|
|
32
|
-
import {
|
|
35
|
+
import { withJsonFormsEnumProps } from '@jsonforms/react';
|
|
33
36
|
import { MaterialRadioGroup } from './MaterialRadioGroup';
|
|
34
|
-
export const MaterialRadioGroupControl = (
|
|
37
|
+
export const MaterialRadioGroupControl = (
|
|
38
|
+
props: ControlProps & OwnPropsOfEnum
|
|
39
|
+
) => {
|
|
35
40
|
return <MaterialRadioGroup {...props} />;
|
|
36
41
|
};
|
|
37
42
|
|
|
@@ -22,14 +22,14 @@
|
|
|
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 React, {useCallback} from 'react';
|
|
25
|
+
import React, { useCallback } from 'react';
|
|
26
26
|
import {
|
|
27
27
|
ControlProps,
|
|
28
28
|
showAsRequired,
|
|
29
29
|
isDescriptionHidden,
|
|
30
30
|
isRangeControl,
|
|
31
31
|
RankedTester,
|
|
32
|
-
rankWith
|
|
32
|
+
rankWith,
|
|
33
33
|
} from '@jsonforms/core';
|
|
34
34
|
import { withJsonFormsControlProps } from '@jsonforms/react';
|
|
35
35
|
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
FormLabel,
|
|
40
40
|
Hidden,
|
|
41
41
|
Slider,
|
|
42
|
-
Typography
|
|
42
|
+
Typography,
|
|
43
43
|
} from '@mui/material';
|
|
44
44
|
import merge from 'lodash/merge';
|
|
45
45
|
import { useFocus } from '../util';
|
|
@@ -58,28 +58,24 @@ export const MaterialSliderControl = (props: ControlProps) => {
|
|
|
58
58
|
visible,
|
|
59
59
|
path,
|
|
60
60
|
required,
|
|
61
|
-
config
|
|
61
|
+
config,
|
|
62
62
|
} = props;
|
|
63
63
|
const isValid = errors.length === 0;
|
|
64
|
-
const appliedUiSchemaOptions = merge(
|
|
65
|
-
{},
|
|
66
|
-
config,
|
|
67
|
-
props.uischema.options
|
|
68
|
-
);
|
|
64
|
+
const appliedUiSchemaOptions = merge({}, config, props.uischema.options);
|
|
69
65
|
const labelStyle: { [x: string]: any } = {
|
|
70
66
|
whiteSpace: 'nowrap',
|
|
71
67
|
overflow: 'hidden',
|
|
72
68
|
textOverflow: 'ellipsis',
|
|
73
|
-
width: '100%'
|
|
69
|
+
width: '100%',
|
|
74
70
|
};
|
|
75
71
|
const rangeContainerStyle: { [x: string]: any } = {
|
|
76
|
-
display: 'flex'
|
|
72
|
+
display: 'flex',
|
|
77
73
|
};
|
|
78
74
|
const rangeItemStyle: { [x: string]: any } = {
|
|
79
|
-
flexGrow: '1'
|
|
75
|
+
flexGrow: '1',
|
|
80
76
|
};
|
|
81
77
|
const sliderStyle: { [x: string]: any } = {
|
|
82
|
-
marginTop: '7px'
|
|
78
|
+
marginTop: '7px',
|
|
83
79
|
};
|
|
84
80
|
|
|
85
81
|
const showDescription = !isDescriptionHidden(
|
|
@@ -89,7 +85,10 @@ export const MaterialSliderControl = (props: ControlProps) => {
|
|
|
89
85
|
appliedUiSchemaOptions.showUnfocusedDescription
|
|
90
86
|
);
|
|
91
87
|
|
|
92
|
-
const onChange = useCallback(
|
|
88
|
+
const onChange = useCallback(
|
|
89
|
+
(_ev: any, value: any) => handleChange(path, Number(value)),
|
|
90
|
+
[path, handleChange]
|
|
91
|
+
);
|
|
93
92
|
|
|
94
93
|
return (
|
|
95
94
|
<Hidden xsUp={!visible}>
|
|
@@ -103,8 +102,10 @@ export const MaterialSliderControl = (props: ControlProps) => {
|
|
|
103
102
|
htmlFor={id}
|
|
104
103
|
error={!isValid}
|
|
105
104
|
component={'legend' as 'label'}
|
|
106
|
-
required={showAsRequired(
|
|
107
|
-
|
|
105
|
+
required={showAsRequired(
|
|
106
|
+
required,
|
|
107
|
+
appliedUiSchemaOptions.hideRequiredAsterisk
|
|
108
|
+
)}
|
|
108
109
|
>
|
|
109
110
|
<Typography id={id + '-typo'} style={labelStyle} variant='caption'>
|
|
110
111
|
{label}
|
|
@@ -29,25 +29,22 @@ import {
|
|
|
29
29
|
isTimeControl,
|
|
30
30
|
isDescriptionHidden,
|
|
31
31
|
RankedTester,
|
|
32
|
-
rankWith
|
|
32
|
+
rankWith,
|
|
33
33
|
} from '@jsonforms/core';
|
|
34
34
|
import { withJsonFormsControlProps } from '@jsonforms/react';
|
|
35
35
|
import { FormHelperText, Hidden } from '@mui/material';
|
|
36
|
-
import {
|
|
37
|
-
TimePicker,
|
|
38
|
-
LocalizationProvider
|
|
39
|
-
} from '@mui/x-date-pickers';
|
|
36
|
+
import { TimePicker, LocalizationProvider } from '@mui/x-date-pickers';
|
|
40
37
|
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
|
41
38
|
import {
|
|
42
39
|
createOnChangeHandler,
|
|
43
40
|
getData,
|
|
44
41
|
ResettableTextField,
|
|
45
|
-
useFocus
|
|
42
|
+
useFocus,
|
|
46
43
|
} from '../util';
|
|
47
44
|
|
|
48
45
|
export const MaterialTimeControl = (props: ControlProps) => {
|
|
49
46
|
const [focused, onFocus, onBlur] = useFocus();
|
|
50
|
-
|
|
47
|
+
const {
|
|
51
48
|
id,
|
|
52
49
|
description,
|
|
53
50
|
errors,
|
|
@@ -59,7 +56,7 @@ export const MaterialTimeControl = (props: ControlProps) => {
|
|
|
59
56
|
path,
|
|
60
57
|
handleChange,
|
|
61
58
|
data,
|
|
62
|
-
config
|
|
59
|
+
config,
|
|
63
60
|
} = props;
|
|
64
61
|
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
65
62
|
const isValid = errors.length === 0;
|
|
@@ -83,11 +80,10 @@ export const MaterialTimeControl = (props: ControlProps) => {
|
|
|
83
80
|
: null;
|
|
84
81
|
const secondFormHelperText = showDescription && !isValid ? errors : null;
|
|
85
82
|
|
|
86
|
-
const onChange = useMemo(
|
|
87
|
-
path,
|
|
88
|
-
handleChange,
|
|
89
|
-
|
|
90
|
-
),[path, handleChange, saveFormat]);
|
|
83
|
+
const onChange = useMemo(
|
|
84
|
+
() => createOnChangeHandler(path, handleChange, saveFormat),
|
|
85
|
+
[path, handleChange, saveFormat]
|
|
86
|
+
);
|
|
91
87
|
|
|
92
88
|
const value = getData(data, saveFormat);
|
|
93
89
|
const valueInInputFormat = value ? value.format(format) : '';
|
|
@@ -106,24 +102,27 @@ export const MaterialTimeControl = (props: ControlProps) => {
|
|
|
106
102
|
disabled={!enabled}
|
|
107
103
|
componentsProps={{
|
|
108
104
|
actionBar: {
|
|
109
|
-
actions: (variant) =>
|
|
110
|
-
|
|
105
|
+
actions: (variant) =>
|
|
106
|
+
variant === 'desktop' ? [] : ['clear', 'cancel', 'accept'],
|
|
107
|
+
},
|
|
111
108
|
}}
|
|
112
|
-
renderInput={params => (
|
|
113
|
-
<ResettableTextField
|
|
109
|
+
renderInput={(params) => (
|
|
110
|
+
<ResettableTextField
|
|
114
111
|
{...params}
|
|
115
112
|
rawValue={data}
|
|
116
113
|
dayjsValueIsValid={value !== null}
|
|
117
114
|
valueInInputFormat={valueInInputFormat}
|
|
118
115
|
focused={focused}
|
|
119
116
|
id={id + '-input'}
|
|
120
|
-
required={
|
|
117
|
+
required={
|
|
118
|
+
required && !appliedUiSchemaOptions.hideRequiredAsterisk
|
|
119
|
+
}
|
|
121
120
|
autoFocus={appliedUiSchemaOptions.focus}
|
|
122
121
|
error={!isValid}
|
|
123
122
|
fullWidth={!appliedUiSchemaOptions.trim}
|
|
124
123
|
inputProps={{
|
|
125
124
|
...params.inputProps,
|
|
126
|
-
type: 'text'
|
|
125
|
+
type: 'text',
|
|
127
126
|
}}
|
|
128
127
|
InputLabelProps={data ? { shrink: true } : undefined}
|
|
129
128
|
onFocus={onFocus}
|
|
@@ -135,9 +134,7 @@ export const MaterialTimeControl = (props: ControlProps) => {
|
|
|
135
134
|
<FormHelperText error={!isValid && !showDescription}>
|
|
136
135
|
{firstFormHelperText}
|
|
137
136
|
</FormHelperText>
|
|
138
|
-
<FormHelperText error={!isValid}>
|
|
139
|
-
{secondFormHelperText}
|
|
140
|
-
</FormHelperText>
|
|
137
|
+
<FormHelperText error={!isValid}>{secondFormHelperText}</FormHelperText>
|
|
141
138
|
</LocalizationProvider>
|
|
142
139
|
</Hidden>
|
|
143
140
|
);
|
package/src/controls/index.ts
CHANGED
|
@@ -22,119 +22,83 @@
|
|
|
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 MaterialAnyOfStringOrEnumControl, {
|
|
26
|
+
materialAnyOfStringOrEnumControlTester,
|
|
27
|
+
} from './MaterialAnyOfStringOrEnumControl';
|
|
25
28
|
import MaterialBooleanControl, {
|
|
26
29
|
materialBooleanControlTester,
|
|
27
|
-
MaterialBooleanControl as MaterialBooleanControlUnwrapped
|
|
28
30
|
} from './MaterialBooleanControl';
|
|
29
31
|
import MaterialBooleanToggleControl, {
|
|
30
32
|
materialBooleanToggleControlTester,
|
|
31
|
-
MaterialBooleanToggleControl as MaterialBooleanToggleControlUnwrapped
|
|
32
33
|
} from './MaterialBooleanToggleControl';
|
|
33
|
-
import MaterialEnumControl, {
|
|
34
|
-
materialEnumControlTester,
|
|
35
|
-
MaterialEnumControl as MaterialEnumControlUnwrapped
|
|
36
|
-
} from './MaterialEnumControl';
|
|
37
|
-
import MaterialNativeControl, {
|
|
38
|
-
materialNativeControlTester,
|
|
39
|
-
MaterialNativeControl as MaterialNativeControlUnwrapped
|
|
40
|
-
} from './MaterialNativeControl';
|
|
41
34
|
import MaterialDateControl, {
|
|
42
35
|
materialDateControlTester,
|
|
43
|
-
MaterialDateControl as MaterialDateControlUnwrapped
|
|
44
36
|
} from './MaterialDateControl';
|
|
45
37
|
import MaterialDateTimeControl, {
|
|
46
38
|
materialDateTimeControlTester,
|
|
47
|
-
MaterialDateTimeControl as MaterialDateTimeControlUnwrapped
|
|
48
39
|
} from './MaterialDateTimeControl';
|
|
49
|
-
import
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
} from './MaterialTimeControl';
|
|
53
|
-
import MaterialSliderControl, {
|
|
54
|
-
materialSliderControlTester,
|
|
55
|
-
MaterialSliderControl as MaterialSliderControlUnwrapped
|
|
56
|
-
} from './MaterialSliderControl';
|
|
57
|
-
import MaterialRadioGroupControl, {
|
|
58
|
-
materialRadioGroupControlTester,
|
|
59
|
-
MaterialRadioGroupControl as MaterialRadioGroupControlUnwrapped
|
|
60
|
-
} from './MaterialRadioGroupControl';
|
|
40
|
+
import MaterialEnumControl, {
|
|
41
|
+
materialEnumControlTester,
|
|
42
|
+
} from './MaterialEnumControl';
|
|
61
43
|
import MaterialIntegerControl, {
|
|
62
44
|
materialIntegerControlTester,
|
|
63
|
-
MaterialIntegerControl as MaterialIntegerControlUnwrapped
|
|
64
45
|
} from './MaterialIntegerControl';
|
|
46
|
+
import MaterialNativeControl, {
|
|
47
|
+
materialNativeControlTester,
|
|
48
|
+
} from './MaterialNativeControl';
|
|
65
49
|
import MaterialNumberControl, {
|
|
66
50
|
materialNumberControlTester,
|
|
67
|
-
MaterialNumberControl as MaterialNumberControlUnwrapped
|
|
68
51
|
} from './MaterialNumberControl';
|
|
69
|
-
import MaterialTextControl, {
|
|
70
|
-
materialTextControlTester,
|
|
71
|
-
MaterialTextControl as MaterialTextControlUnwrapped
|
|
72
|
-
} from './MaterialTextControl';
|
|
73
|
-
|
|
74
|
-
import MaterialAnyOfStringOrEnumControl, {
|
|
75
|
-
materialAnyOfStringOrEnumControlTester,
|
|
76
|
-
MaterialAnyOfStringOrEnumControl as MaterialAnyOfStringOrEnumControlUnwrapped
|
|
77
|
-
} from './MaterialAnyOfStringOrEnumControl';
|
|
78
|
-
|
|
79
52
|
import MaterialOneOfEnumControl, {
|
|
80
53
|
materialOneOfEnumControlTester,
|
|
81
|
-
MaterialOneOfEnumControl as MaterialOneOfEnumControlUnwrapped
|
|
82
54
|
} from './MaterialOneOfEnumControl';
|
|
83
|
-
|
|
84
55
|
import MaterialOneOfRadioGroupControl, {
|
|
85
56
|
materialOneOfRadioGroupControlTester,
|
|
86
|
-
MaterialOneOfRadioGroupControl as MaterialOneOfRadioGroupControlUnwrapped
|
|
87
57
|
} from './MaterialOneOfRadioGroupControl';
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
MaterialNumberControl: MaterialNumberControlUnwrapped,
|
|
101
|
-
MaterialTextControl: MaterialTextControlUnwrapped,
|
|
102
|
-
MaterialAnyOfStringOrEnumControl: MaterialAnyOfStringOrEnumControlUnwrapped,
|
|
103
|
-
MaterialOneOfEnumControl: MaterialOneOfEnumControlUnwrapped,
|
|
104
|
-
MaterialOneOfRadioGroupControl: MaterialOneOfRadioGroupControlUnwrapped
|
|
105
|
-
};
|
|
58
|
+
import MaterialRadioGroupControl, {
|
|
59
|
+
materialRadioGroupControlTester,
|
|
60
|
+
} from './MaterialRadioGroupControl';
|
|
61
|
+
import MaterialSliderControl, {
|
|
62
|
+
materialSliderControlTester,
|
|
63
|
+
} from './MaterialSliderControl';
|
|
64
|
+
import MaterialTextControl, {
|
|
65
|
+
materialTextControlTester,
|
|
66
|
+
} from './MaterialTextControl';
|
|
67
|
+
import MaterialTimeControl, {
|
|
68
|
+
materialTimeControlTester,
|
|
69
|
+
} from './MaterialTimeControl';
|
|
106
70
|
|
|
107
71
|
export {
|
|
72
|
+
MaterialAnyOfStringOrEnumControl,
|
|
73
|
+
materialAnyOfStringOrEnumControlTester,
|
|
108
74
|
MaterialBooleanControl,
|
|
109
75
|
materialBooleanControlTester,
|
|
110
76
|
MaterialBooleanToggleControl,
|
|
111
77
|
materialBooleanToggleControlTester,
|
|
112
|
-
MaterialEnumControl,
|
|
113
|
-
materialEnumControlTester,
|
|
114
|
-
MaterialNativeControl,
|
|
115
|
-
materialNativeControlTester,
|
|
116
78
|
MaterialDateControl,
|
|
117
79
|
materialDateControlTester,
|
|
118
80
|
MaterialDateTimeControl,
|
|
119
81
|
materialDateTimeControlTester,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
MaterialSliderControl,
|
|
123
|
-
materialSliderControlTester,
|
|
124
|
-
MaterialRadioGroupControl,
|
|
125
|
-
materialRadioGroupControlTester,
|
|
82
|
+
MaterialEnumControl,
|
|
83
|
+
materialEnumControlTester,
|
|
126
84
|
MaterialIntegerControl,
|
|
127
85
|
materialIntegerControlTester,
|
|
86
|
+
MaterialNativeControl,
|
|
87
|
+
materialNativeControlTester,
|
|
128
88
|
MaterialNumberControl,
|
|
129
89
|
materialNumberControlTester,
|
|
130
|
-
MaterialTextControl,
|
|
131
|
-
materialTextControlTester,
|
|
132
|
-
MaterialAnyOfStringOrEnumControl,
|
|
133
|
-
materialAnyOfStringOrEnumControlTester,
|
|
134
90
|
MaterialOneOfEnumControl,
|
|
135
91
|
materialOneOfEnumControlTester,
|
|
136
92
|
MaterialOneOfRadioGroupControl,
|
|
137
|
-
materialOneOfRadioGroupControlTester
|
|
93
|
+
materialOneOfRadioGroupControlTester,
|
|
94
|
+
MaterialRadioGroupControl,
|
|
95
|
+
materialRadioGroupControlTester,
|
|
96
|
+
MaterialSliderControl,
|
|
97
|
+
materialSliderControlTester,
|
|
98
|
+
MaterialTextControl,
|
|
99
|
+
materialTextControlTester,
|
|
100
|
+
MaterialTimeControl,
|
|
101
|
+
materialTimeControlTester,
|
|
138
102
|
};
|
|
139
103
|
|
|
140
104
|
export * from './MaterialInputControl';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*
|
|
2
|
+
The MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2017-2019 EclipseSource Munich
|
|
5
|
+
https://github.com/eclipsesource/jsonforms
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in
|
|
15
|
+
all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
THE SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
import { MaterialAnyOfStringOrEnumControl } from './MaterialAnyOfStringOrEnumControl';
|
|
26
|
+
import { MaterialBooleanControl } from './MaterialBooleanControl';
|
|
27
|
+
import { MaterialBooleanToggleControl } from './MaterialBooleanToggleControl';
|
|
28
|
+
import { MaterialDateControl } from './MaterialDateControl';
|
|
29
|
+
import { MaterialDateTimeControl } from './MaterialDateTimeControl';
|
|
30
|
+
import { MaterialEnumControl } from './MaterialEnumControl';
|
|
31
|
+
import { MaterialIntegerControl } from './MaterialIntegerControl';
|
|
32
|
+
import { MaterialNativeControl } from './MaterialNativeControl';
|
|
33
|
+
import { MaterialNumberControl } from './MaterialNumberControl';
|
|
34
|
+
import { MaterialOneOfEnumControl } from './MaterialOneOfEnumControl';
|
|
35
|
+
import { MaterialOneOfRadioGroupControl } from './MaterialOneOfRadioGroupControl';
|
|
36
|
+
import { MaterialRadioGroupControl } from './MaterialRadioGroupControl';
|
|
37
|
+
import { MaterialSliderControl } from './MaterialSliderControl';
|
|
38
|
+
import { MaterialTextControl } from './MaterialTextControl';
|
|
39
|
+
import { MaterialTimeControl } from './MaterialTimeControl';
|
|
40
|
+
|
|
41
|
+
export const UnwrappedControls = {
|
|
42
|
+
MaterialAnyOfStringOrEnumControl,
|
|
43
|
+
MaterialBooleanControl,
|
|
44
|
+
MaterialBooleanToggleControl,
|
|
45
|
+
MaterialDateControl,
|
|
46
|
+
MaterialDateTimeControl,
|
|
47
|
+
MaterialEnumControl,
|
|
48
|
+
MaterialIntegerControl,
|
|
49
|
+
MaterialNativeControl,
|
|
50
|
+
MaterialNumberControl,
|
|
51
|
+
MaterialOneOfEnumControl,
|
|
52
|
+
MaterialOneOfRadioGroupControl,
|
|
53
|
+
MaterialSliderControl,
|
|
54
|
+
MaterialRadioGroupControl,
|
|
55
|
+
MaterialTextControl,
|
|
56
|
+
MaterialTimeControl,
|
|
57
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import {
|
|
26
26
|
JsonFormsCellRendererRegistryEntry,
|
|
27
|
-
JsonFormsRendererRegistryEntry
|
|
27
|
+
JsonFormsRendererRegistryEntry,
|
|
28
28
|
} from '@jsonforms/core';
|
|
29
29
|
import {
|
|
30
30
|
materialAllOfControlTester,
|
|
@@ -38,13 +38,13 @@ import {
|
|
|
38
38
|
materialOneOfControlTester,
|
|
39
39
|
MaterialOneOfRenderer,
|
|
40
40
|
MaterialEnumArrayRenderer,
|
|
41
|
-
materialEnumArrayRendererTester
|
|
41
|
+
materialEnumArrayRendererTester,
|
|
42
42
|
} from './complex';
|
|
43
43
|
import {
|
|
44
44
|
MaterialLabelRenderer,
|
|
45
45
|
materialLabelRendererTester,
|
|
46
46
|
MaterialListWithDetailRenderer,
|
|
47
|
-
materialListWithDetailTester
|
|
47
|
+
materialListWithDetailTester,
|
|
48
48
|
} from './additional';
|
|
49
49
|
import {
|
|
50
50
|
MaterialAnyOfStringOrEnumControl,
|
|
@@ -76,7 +76,7 @@ import {
|
|
|
76
76
|
MaterialTextControl,
|
|
77
77
|
materialTextControlTester,
|
|
78
78
|
MaterialOneOfRadioGroupControl,
|
|
79
|
-
materialOneOfRadioGroupControlTester
|
|
79
|
+
materialOneOfRadioGroupControlTester,
|
|
80
80
|
} from './controls';
|
|
81
81
|
import {
|
|
82
82
|
MaterialArrayLayout,
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
MaterialHorizontalLayout,
|
|
89
89
|
materialHorizontalLayoutTester,
|
|
90
90
|
MaterialVerticalLayout,
|
|
91
|
-
materialVerticalLayoutTester
|
|
91
|
+
materialVerticalLayoutTester,
|
|
92
92
|
} from './layouts';
|
|
93
93
|
import {
|
|
94
94
|
MaterialBooleanCell,
|
|
@@ -110,16 +110,17 @@ import {
|
|
|
110
110
|
MaterialTextCell,
|
|
111
111
|
materialTextCellTester,
|
|
112
112
|
MaterialTimeCell,
|
|
113
|
-
materialTimeCellTester
|
|
113
|
+
materialTimeCellTester,
|
|
114
114
|
} from './cells';
|
|
115
115
|
import MaterialCategorizationStepperLayout, {
|
|
116
|
-
materialCategorizationStepperTester
|
|
116
|
+
materialCategorizationStepperTester,
|
|
117
117
|
} from './layouts/MaterialCategorizationStepperLayout';
|
|
118
118
|
|
|
119
|
+
export * from './additional';
|
|
120
|
+
export * from './cells';
|
|
119
121
|
export * from './complex';
|
|
120
122
|
export * from './controls';
|
|
121
123
|
export * from './layouts';
|
|
122
|
-
export * from './cells';
|
|
123
124
|
export * from './mui-controls';
|
|
124
125
|
export * from './util';
|
|
125
126
|
|
|
@@ -127,10 +128,13 @@ export const materialRenderers: JsonFormsRendererRegistryEntry[] = [
|
|
|
127
128
|
// controls
|
|
128
129
|
{
|
|
129
130
|
tester: materialArrayControlTester,
|
|
130
|
-
renderer: MaterialArrayControlRenderer
|
|
131
|
+
renderer: MaterialArrayControlRenderer,
|
|
131
132
|
},
|
|
132
133
|
{ tester: materialBooleanControlTester, renderer: MaterialBooleanControl },
|
|
133
|
-
{
|
|
134
|
+
{
|
|
135
|
+
tester: materialBooleanToggleControlTester,
|
|
136
|
+
renderer: MaterialBooleanToggleControl,
|
|
137
|
+
},
|
|
134
138
|
{ tester: materialNativeControlTester, renderer: MaterialNativeControl },
|
|
135
139
|
{ tester: materialEnumControlTester, renderer: MaterialEnumControl },
|
|
136
140
|
{ tester: materialIntegerControlTester, renderer: MaterialIntegerControl },
|
|
@@ -138,7 +142,7 @@ export const materialRenderers: JsonFormsRendererRegistryEntry[] = [
|
|
|
138
142
|
{ tester: materialTextControlTester, renderer: MaterialTextControl },
|
|
139
143
|
{ tester: materialDateTimeControlTester, renderer: MaterialDateTimeControl },
|
|
140
144
|
{ tester: materialDateControlTester, renderer: MaterialDateControl },
|
|
141
|
-
{ tester: materialTimeControlTester, renderer: MaterialTimeControl },
|
|
145
|
+
{ tester: materialTimeControlTester, renderer: MaterialTimeControl },
|
|
142
146
|
{ tester: materialSliderControlTester, renderer: MaterialSliderControl },
|
|
143
147
|
{ tester: materialObjectControlTester, renderer: MaterialObjectRenderer },
|
|
144
148
|
{ tester: materialAllOfControlTester, renderer: MaterialAllOfRenderer },
|
|
@@ -146,43 +150,46 @@ export const materialRenderers: JsonFormsRendererRegistryEntry[] = [
|
|
|
146
150
|
{ tester: materialOneOfControlTester, renderer: MaterialOneOfRenderer },
|
|
147
151
|
{
|
|
148
152
|
tester: materialRadioGroupControlTester,
|
|
149
|
-
renderer: MaterialRadioGroupControl
|
|
153
|
+
renderer: MaterialRadioGroupControl,
|
|
150
154
|
},
|
|
151
155
|
{
|
|
152
156
|
tester: materialOneOfRadioGroupControlTester,
|
|
153
|
-
renderer: MaterialOneOfRadioGroupControl
|
|
157
|
+
renderer: MaterialOneOfRadioGroupControl,
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
tester: materialOneOfEnumControlTester,
|
|
161
|
+
renderer: MaterialOneOfEnumControl,
|
|
154
162
|
},
|
|
155
|
-
{ tester: materialOneOfEnumControlTester, renderer: MaterialOneOfEnumControl },
|
|
156
163
|
// layouts
|
|
157
164
|
{ tester: materialGroupTester, renderer: MaterialGroupLayout },
|
|
158
165
|
{
|
|
159
166
|
tester: materialHorizontalLayoutTester,
|
|
160
|
-
renderer: MaterialHorizontalLayout
|
|
167
|
+
renderer: MaterialHorizontalLayout,
|
|
161
168
|
},
|
|
162
169
|
{ tester: materialVerticalLayoutTester, renderer: MaterialVerticalLayout },
|
|
163
170
|
{
|
|
164
171
|
tester: materialCategorizationTester,
|
|
165
|
-
renderer: MaterialCategorizationLayout
|
|
172
|
+
renderer: MaterialCategorizationLayout,
|
|
166
173
|
},
|
|
167
174
|
{
|
|
168
175
|
tester: materialCategorizationStepperTester,
|
|
169
|
-
renderer: MaterialCategorizationStepperLayout
|
|
176
|
+
renderer: MaterialCategorizationStepperLayout,
|
|
170
177
|
},
|
|
171
178
|
{ tester: materialArrayLayoutTester, renderer: MaterialArrayLayout },
|
|
172
179
|
// additional
|
|
173
180
|
{ tester: materialLabelRendererTester, renderer: MaterialLabelRenderer },
|
|
174
181
|
{
|
|
175
182
|
tester: materialListWithDetailTester,
|
|
176
|
-
renderer: MaterialListWithDetailRenderer
|
|
183
|
+
renderer: MaterialListWithDetailRenderer,
|
|
177
184
|
},
|
|
178
185
|
{
|
|
179
186
|
tester: materialAnyOfStringOrEnumControlTester,
|
|
180
|
-
renderer: MaterialAnyOfStringOrEnumControl
|
|
187
|
+
renderer: MaterialAnyOfStringOrEnumControl,
|
|
181
188
|
},
|
|
182
189
|
{
|
|
183
190
|
tester: materialEnumArrayRendererTester,
|
|
184
|
-
renderer: MaterialEnumArrayRenderer
|
|
185
|
-
}
|
|
191
|
+
renderer: MaterialEnumArrayRenderer,
|
|
192
|
+
},
|
|
186
193
|
];
|
|
187
194
|
|
|
188
195
|
export const materialCells: JsonFormsCellRendererRegistryEntry[] = [
|
|
@@ -195,5 +202,17 @@ export const materialCells: JsonFormsCellRendererRegistryEntry[] = [
|
|
|
195
202
|
{ tester: materialNumberFormatCellTester, cell: MaterialNumberFormatCell },
|
|
196
203
|
{ tester: materialOneOfEnumCellTester, cell: MaterialOneOfEnumCell },
|
|
197
204
|
{ tester: materialTextCellTester, cell: MaterialTextCell },
|
|
198
|
-
{ tester: materialTimeCellTester, cell: MaterialTimeCell }
|
|
205
|
+
{ tester: materialTimeCellTester, cell: MaterialTimeCell },
|
|
199
206
|
];
|
|
207
|
+
|
|
208
|
+
import { UnwrappedAdditional } from './additional/unwrapped';
|
|
209
|
+
import { UnwrappedComplex } from './complex/unwrapped';
|
|
210
|
+
import { UnwrappedControls } from './controls/unwrapped';
|
|
211
|
+
import { UnwrappedLayouts } from './layouts/unwrapped';
|
|
212
|
+
|
|
213
|
+
export const Unwrapped = {
|
|
214
|
+
...UnwrappedAdditional,
|
|
215
|
+
...UnwrappedComplex,
|
|
216
|
+
...UnwrappedControls,
|
|
217
|
+
...UnwrappedLayouts,
|
|
218
|
+
};
|