@jsonforms/material-renderers 3.2.1 → 3.3.0-alpha.0
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/lib/complex/MaterialEnumArrayRenderer.d.ts +1 -1
- package/lib/complex/unwrapped.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/jsonforms-react-material.cjs.js +112 -98
- package/lib/jsonforms-react-material.cjs.js.map +1 -1
- package/lib/jsonforms-react-material.esm.js +105 -91
- package/lib/jsonforms-react-material.esm.js.map +1 -1
- package/package.json +6 -6
- package/src/complex/MaterialEnumArrayRenderer.tsx +41 -3
- package/src/complex/MaterialTableControl.tsx +41 -20
- package/src/controls/MaterialDateControl.tsx +42 -39
- package/src/controls/MaterialDateTimeControl.tsx +42 -40
- package/src/controls/MaterialRadioGroup.tsx +2 -4
- package/src/controls/MaterialSliderControl.tsx +1 -1
- package/src/controls/MaterialTimeControl.tsx +42 -40
- package/src/layouts/ExpandPanelRenderer.tsx +44 -23
- package/src/layouts/MaterialArrayLayout.tsx +1 -1
- package/src/mui-controls/MuiAutocomplete.tsx +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useCallback, useMemo, Fragment, useEffect } from 'react';
|
|
2
|
-
import { Hidden, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, Button, Tabs, Tab, TableCell, styled as styled$1, Badge, Tooltip, TableRow, Stack, Grid, Typography, FormHelperText, IconButton, Table, TableHead, TableBody, Autocomplete, TextField, Checkbox, useThemeProps, Input, FilledInput, OutlinedInput, useTheme, InputAdornment, Select, MenuItem, Switch, FormControl, FormGroup, FormControlLabel, Toolbar, ListItem, ListItemAvatar, Avatar, ListItemText, ListItemSecondaryAction, List, InputLabel,
|
|
3
|
-
import { rankWith, isAllOfControl, findMatchingUISchema, createCombinatorRenderInfos, Generate, isLayout, isAnyOfControl, createDefaultValue, Resolve, encode, Paths, formatErrorMessage, errorsAt, or, isObjectArrayControl, isPrimitiveArrayControl, isDescriptionHidden, getAjv, and, uiTypeIs, schemaMatches, hasType, schemaSubPathMatches, resolveSchema, isObjectControl, findUISchema, isOneOfControl, isObjectArray, computeLabel, composePaths,
|
|
2
|
+
import { Hidden, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, Button, Tabs, Tab, TableCell, styled as styled$1, Badge, Tooltip, TableRow, Stack, Grid, Typography, FormHelperText, IconButton, Table, TableHead, TableBody, Autocomplete, TextField, Checkbox, useThemeProps, Input, FilledInput, OutlinedInput, useTheme, InputAdornment, Select, MenuItem, Switch, FormControl, FormLabel, FormGroup, FormControlLabel, Toolbar, ListItem, ListItemAvatar, Avatar, ListItemText, ListItemSecondaryAction, List, InputLabel, RadioGroup, Radio, Slider, Accordion, AccordionSummary, AccordionDetails, Card, CardHeader, CardContent, AppBar, Stepper, Step, StepButton } from '@mui/material';
|
|
3
|
+
import { rankWith, isAllOfControl, findMatchingUISchema, createCombinatorRenderInfos, Generate, isLayout, isAnyOfControl, createDefaultValue, Resolve, encode, Paths, formatErrorMessage, errorsAt, or, isObjectArrayControl, isPrimitiveArrayControl, isDescriptionHidden, getAjv, and, uiTypeIs, schemaMatches, hasType, schemaSubPathMatches, resolveSchema, showAsRequired, isObjectControl, findUISchema, isOneOfControl, isObjectArray, computeLabel, composePaths, isBooleanControl, optionIs, isDateControl, defaultDateFormat, isDateTimeControl, defaultDateTimeFormat, isEnumControl, isIntegerControl, isTimeControl, isNumberControl, isOneOfEnumControl, isRangeControl, isStringControl, defaultTimeFormat, createId, removeId, update, moveUp, moveDown, getFirstPrimitiveProp, withIncreasedRank, isVisible, deriveLabelForUISchemaElement, isObjectArrayWithNesting, isNumberFormatControl, categorizationHasCategory } from '@jsonforms/core';
|
|
4
4
|
import { withJsonFormsAllOfProps, JsonFormsDispatch, withJsonFormsAnyOfProps, DispatchCell, useJsonForms, withJsonFormsArrayLayoutProps, withJsonFormsMultiEnumProps, withJsonFormsDetailProps, withJsonFormsOneOfProps, withJsonFormsLabelProps, withJsonFormsMasterListItemProps, withJsonFormsControlProps, Control, withJsonFormsEnumProps, withTranslateProps, withJsonFormsOneOfEnumProps, withJsonFormsContext, withJsonFormsLayoutProps, withJsonFormsCellProps, withJsonFormsEnumCellProps, withJsonFormsOneOfEnumCellProps } from '@jsonforms/react';
|
|
5
5
|
import omit from 'lodash/omit';
|
|
6
6
|
import isEmpty from 'lodash/isEmpty';
|
|
@@ -222,14 +222,17 @@ const NonEmptyRowComponent = ({ childPath, schema, rowIndex, openDeleteDialog, m
|
|
|
222
222
|
React.createElement(Grid, { container: true, direction: 'row', justifyContent: 'flex-end', alignItems: 'center' },
|
|
223
223
|
showSortButtons ? (React.createElement(Fragment, null,
|
|
224
224
|
React.createElement(Grid, { item: true },
|
|
225
|
-
React.createElement(
|
|
226
|
-
React.createElement(
|
|
225
|
+
React.createElement(Tooltip, { id: 'tooltip-up', title: translations.up, placement: 'bottom', open: enableUp ? undefined : false },
|
|
226
|
+
React.createElement(IconButton, { "aria-label": translations.upAriaLabel, onClick: moveUp, disabled: !enableUp, size: 'large' },
|
|
227
|
+
React.createElement(ArrowUpward, null)))),
|
|
227
228
|
React.createElement(Grid, { item: true },
|
|
228
|
-
React.createElement(
|
|
229
|
-
React.createElement(
|
|
229
|
+
React.createElement(Tooltip, { id: 'tooltip-down', title: translations.down, placement: 'bottom', open: enableDown ? undefined : false },
|
|
230
|
+
React.createElement(IconButton, { "aria-label": translations.downAriaLabel, onClick: moveDown, disabled: !enableDown, size: 'large' },
|
|
231
|
+
React.createElement(ArrowDownward, null)))))) : null,
|
|
230
232
|
React.createElement(Grid, { item: true },
|
|
231
|
-
React.createElement(
|
|
232
|
-
React.createElement(
|
|
233
|
+
React.createElement(Tooltip, { id: 'tooltip-remove', title: translations.removeTooltip, placement: 'bottom' },
|
|
234
|
+
React.createElement(IconButton, { "aria-label": translations.removeAriaLabel, onClick: () => openDeleteDialog(childPath, rowIndex), size: 'large' },
|
|
235
|
+
React.createElement(Delete, null))))))) : null));
|
|
233
236
|
};
|
|
234
237
|
const NonEmptyRow = React.memo(NonEmptyRowComponent);
|
|
235
238
|
const TableRows = ({ data, path, schema, openDeleteDialog, moveUp, moveDown, uischema, config, enabled, cells, translations, }) => {
|
|
@@ -327,7 +330,7 @@ const MuiAutocomplete = (props) => {
|
|
|
327
330
|
handleChange(path, newValue?.value);
|
|
328
331
|
}, inputValue: inputValue, onInputChange: (_event, newInputValue) => {
|
|
329
332
|
setInputValue(newInputValue);
|
|
330
|
-
}, autoHighlight: true,
|
|
333
|
+
}, autoHighlight: true, autoComplete: true, fullWidth: true, options: options, getOptionLabel: getOptionLabel || ((option) => option?.label), freeSolo: false, renderInput: (params) => {
|
|
331
334
|
return (React.createElement(TextField, { label: label, type: 'text', inputProps: params.inputProps, inputRef: params.InputProps.ref, autoFocus: appliedUiSchemaOptions.focus, disabled: !enabled, ...params, id: id, required: required && !appliedUiSchemaOptions.hideRequiredAsterisk, error: !isValid, fullWidth: !appliedUiSchemaOptions.trim, InputLabelProps: data ? { shrink: true } : undefined, onFocus: onFocus, onBlur: onBlur, focused: focused }));
|
|
332
335
|
}, renderOption: renderOption, filterOptions: filterOptions }),
|
|
333
336
|
React.createElement(FormHelperText, { error: !isValid && !showDescription }, firstFormHelperText),
|
|
@@ -562,19 +565,24 @@ const MuiToggle = React.memo(function MuiToggle(props) {
|
|
|
562
565
|
return (React.createElement(Switch, { checked: checked, onChange: (_ev, isChecked) => handleChange(path, isChecked), className: className, id: id, disabled: !enabled, inputProps: inputPropsMerged }));
|
|
563
566
|
});
|
|
564
567
|
|
|
565
|
-
const MaterialEnumArrayRenderer = ({ schema, visible, errors, path, options, data, addItem, removeItem, handleChange: _handleChange, ...otherProps }) => {
|
|
568
|
+
const MaterialEnumArrayRenderer = ({ config, id, schema, visible, errors, description, label, required, path, options, data, addItem, removeItem, handleChange: _handleChange, ...otherProps }) => {
|
|
569
|
+
const [focused, onFocus, onBlur] = useFocus();
|
|
570
|
+
const isValid = errors.length === 0;
|
|
571
|
+
const appliedUiSchemaOptions = merge({}, config, otherProps.uischema.options);
|
|
572
|
+
const showDescription = !isDescriptionHidden(visible, description, focused, appliedUiSchemaOptions.showUnfocusedDescription);
|
|
566
573
|
return (React.createElement(Hidden, { xsUp: !visible },
|
|
567
|
-
React.createElement(FormControl, { component: 'fieldset' },
|
|
574
|
+
React.createElement(FormControl, { component: 'fieldset', fullWidth: !appliedUiSchemaOptions.trim, onFocus: onFocus, onBlur: onBlur },
|
|
575
|
+
React.createElement(FormLabel, { error: !isValid, component: 'legend', required: showAsRequired(required, appliedUiSchemaOptions.hideRequiredAsterisk) }, label),
|
|
568
576
|
React.createElement(FormGroup, { row: true }, options.map((option, index) => {
|
|
569
577
|
const optionPath = Paths.compose(path, `${index}`);
|
|
570
578
|
const checkboxValue = data?.includes(option.value)
|
|
571
579
|
? option.value
|
|
572
580
|
: undefined;
|
|
573
|
-
return (React.createElement(FormControlLabel, { id: option.value, key: option.value, control: React.createElement(MuiCheckbox, { key: 'checkbox-' + option.value, isValid: isEmpty(errors), path: optionPath, handleChange: (_childPath, newValue) => newValue
|
|
581
|
+
return (React.createElement(FormControlLabel, { id: id + '-label-' + option.value, key: option.value, control: React.createElement(MuiCheckbox, { id: id + '-' + option.value, key: 'checkbox-' + option.value, isValid: isEmpty(errors), path: optionPath, handleChange: (_childPath, newValue) => newValue
|
|
574
582
|
? addItem(path, option.value)
|
|
575
583
|
: removeItem(path, option.value), data: checkboxValue, errors: errors, schema: schema, visible: visible, ...otherProps }), label: option.label }));
|
|
576
584
|
})),
|
|
577
|
-
React.createElement(FormHelperText, { error:
|
|
585
|
+
React.createElement(FormHelperText, { error: !isValid }, !isValid ? errors : showDescription ? description : null))));
|
|
578
586
|
};
|
|
579
587
|
const hasOneOfItems = (schema) => schema.oneOf !== undefined &&
|
|
580
588
|
schema.oneOf.length > 0 &&
|
|
@@ -855,6 +863,7 @@ const MaterialDateControl = (props) => {
|
|
|
855
863
|
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
856
864
|
const showDescription = !isDescriptionHidden(visible, description, focused, appliedUiSchemaOptions.showUnfocusedDescription);
|
|
857
865
|
const [key, setKey] = useState(0);
|
|
866
|
+
const [open, setOpen] = useState(false);
|
|
858
867
|
const format = appliedUiSchemaOptions.dateFormat ?? 'YYYY-MM-DD';
|
|
859
868
|
const saveFormat = appliedUiSchemaOptions.dateSaveFormat ?? defaultDateFormat;
|
|
860
869
|
const views = appliedUiSchemaOptions.views ?? ['year', 'day'];
|
|
@@ -868,30 +877,30 @@ const MaterialDateControl = (props) => {
|
|
|
868
877
|
const onChange = useMemo(() => createOnChangeHandler(path, handleChange, saveFormat), [path, handleChange, saveFormat]);
|
|
869
878
|
const onBlurHandler = useMemo(() => createOnBlurHandler(path, handleChange, format, saveFormat, updateChild, onBlur), [path, handleChange, format, saveFormat, updateChild]);
|
|
870
879
|
const value = getData(data, saveFormat);
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
},
|
|
888
|
-
InputLabelProps: data ? { shrink: true } : undefined,
|
|
889
|
-
onFocus: onFocus,
|
|
890
|
-
onBlur: onBlurHandler,
|
|
880
|
+
if (!visible) {
|
|
881
|
+
return null;
|
|
882
|
+
}
|
|
883
|
+
return (React.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs },
|
|
884
|
+
React.createElement(DatePicker, { open: open, onOpen: () => setOpen(true), onClose: () => setOpen(false), key: key, label: label, value: value, onAccept: onChange, format: format, views: views, disabled: !enabled, slotProps: {
|
|
885
|
+
actionBar: ({ wrapperVariant }) => ({
|
|
886
|
+
actions: wrapperVariant === 'desktop' ? [] : ['clear', 'cancel', 'accept'],
|
|
887
|
+
}),
|
|
888
|
+
textField: {
|
|
889
|
+
id: id + '-input',
|
|
890
|
+
required: required && !appliedUiSchemaOptions.hideRequiredAsterisk,
|
|
891
|
+
autoFocus: appliedUiSchemaOptions.focus,
|
|
892
|
+
error: !isValid,
|
|
893
|
+
fullWidth: !appliedUiSchemaOptions.trim,
|
|
894
|
+
inputProps: {
|
|
895
|
+
type: 'text',
|
|
891
896
|
},
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
897
|
+
InputLabelProps: data ? { shrink: true } : undefined,
|
|
898
|
+
onFocus: onFocus,
|
|
899
|
+
onBlur: onBlurHandler,
|
|
900
|
+
},
|
|
901
|
+
} }),
|
|
902
|
+
React.createElement(FormHelperText, { error: !isValid && !showDescription }, firstFormHelperText),
|
|
903
|
+
React.createElement(FormHelperText, { error: !isValid }, secondFormHelperText)));
|
|
895
904
|
};
|
|
896
905
|
const materialDateControlTester = rankWith(4, isDateControl);
|
|
897
906
|
var MaterialDateControl$1 = withJsonFormsControlProps(MaterialDateControl);
|
|
@@ -905,6 +914,7 @@ const MaterialDateTimeControl = (props) => {
|
|
|
905
914
|
const format = appliedUiSchemaOptions.dateTimeFormat ?? 'YYYY-MM-DD HH:mm';
|
|
906
915
|
const saveFormat = appliedUiSchemaOptions.dateTimeSaveFormat ?? defaultDateTimeFormat;
|
|
907
916
|
const [key, setKey] = useState(0);
|
|
917
|
+
const [open, setOpen] = useState(false);
|
|
908
918
|
const views = appliedUiSchemaOptions.views ?? [
|
|
909
919
|
'year',
|
|
910
920
|
'day',
|
|
@@ -921,30 +931,30 @@ const MaterialDateTimeControl = (props) => {
|
|
|
921
931
|
const onChange = useMemo(() => createOnChangeHandler(path, handleChange, saveFormat), [path, handleChange, saveFormat]);
|
|
922
932
|
const onBlurHandler = useMemo(() => createOnBlurHandler(path, handleChange, format, saveFormat, updateChild, onBlur), [path, handleChange, format, saveFormat, updateChild]);
|
|
923
933
|
const value = getData(data, saveFormat);
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
},
|
|
941
|
-
InputLabelProps: data ? { shrink: true } : undefined,
|
|
942
|
-
onFocus: onFocus,
|
|
943
|
-
onBlur: onBlurHandler,
|
|
934
|
+
if (!visible) {
|
|
935
|
+
return null;
|
|
936
|
+
}
|
|
937
|
+
return (React.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs },
|
|
938
|
+
React.createElement(DateTimePicker, { open: open, onOpen: () => setOpen(true), onClose: () => setOpen(false), key: key, label: label, value: value, onAccept: onChange, format: format, ampm: !!appliedUiSchemaOptions.ampm, views: views, disabled: !enabled, slotProps: {
|
|
939
|
+
actionBar: ({ wrapperVariant }) => ({
|
|
940
|
+
actions: wrapperVariant === 'desktop' ? [] : ['clear', 'cancel', 'accept'],
|
|
941
|
+
}),
|
|
942
|
+
textField: {
|
|
943
|
+
id: id + '-input',
|
|
944
|
+
required: required && !appliedUiSchemaOptions.hideRequiredAsterisk,
|
|
945
|
+
autoFocus: appliedUiSchemaOptions.focus,
|
|
946
|
+
error: !isValid,
|
|
947
|
+
fullWidth: !appliedUiSchemaOptions.trim,
|
|
948
|
+
inputProps: {
|
|
949
|
+
type: 'text',
|
|
944
950
|
},
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
951
|
+
InputLabelProps: data ? { shrink: true } : undefined,
|
|
952
|
+
onFocus: onFocus,
|
|
953
|
+
onBlur: onBlurHandler,
|
|
954
|
+
},
|
|
955
|
+
} }),
|
|
956
|
+
React.createElement(FormHelperText, { error: !isValid && !showDescription }, firstFormHelperText),
|
|
957
|
+
React.createElement(FormHelperText, { error: !isValid }, secondFormHelperText)));
|
|
948
958
|
};
|
|
949
959
|
const materialDateTimeControlTester = rankWith(2, isDateTimeControl);
|
|
950
960
|
var MaterialDateTimeControl$1 = withJsonFormsControlProps(MaterialDateTimeControl);
|
|
@@ -991,13 +1001,13 @@ var MaterialOneOfEnumControl$1 = withJsonFormsOneOfEnumProps(withTranslateProps(
|
|
|
991
1001
|
|
|
992
1002
|
const MaterialRadioGroup = (props) => {
|
|
993
1003
|
const [focused, onFocus, onBlur] = useFocus();
|
|
994
|
-
const { config,
|
|
1004
|
+
const { config, label, required, description, errors, data, visible, options, handleChange, path, enabled, } = props;
|
|
995
1005
|
const isValid = errors.length === 0;
|
|
996
1006
|
const appliedUiSchemaOptions = merge({}, config, props.uischema.options);
|
|
997
1007
|
const showDescription = !isDescriptionHidden(visible, description, focused, appliedUiSchemaOptions.showUnfocusedDescription);
|
|
998
1008
|
return (React.createElement(Hidden, { xsUp: !visible },
|
|
999
1009
|
React.createElement(FormControl, { component: 'fieldset', fullWidth: !appliedUiSchemaOptions.trim, onFocus: onFocus, onBlur: onBlur },
|
|
1000
|
-
React.createElement(FormLabel, {
|
|
1010
|
+
React.createElement(FormLabel, { error: !isValid, component: 'legend', required: showAsRequired(required, appliedUiSchemaOptions.hideRequiredAsterisk) }, label),
|
|
1001
1011
|
React.createElement(RadioGroup, { value: props.data ?? '', row: true }, options.map((option) => (React.createElement(FormControlLabel, { value: option.value, key: option.label, control: React.createElement(Radio, { checked: data === option.value, onChange: () => handleChange(path, option.value) }), label: option.label, disabled: !enabled })))),
|
|
1002
1012
|
React.createElement(FormHelperText, { error: !isValid }, !isValid ? errors : showDescription ? description : null))));
|
|
1003
1013
|
};
|
|
@@ -1059,6 +1069,7 @@ const MaterialTimeControl = (props) => {
|
|
|
1059
1069
|
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
1060
1070
|
const isValid = errors.length === 0;
|
|
1061
1071
|
const [key, setKey] = useState(0);
|
|
1072
|
+
const [open, setOpen] = useState(false);
|
|
1062
1073
|
const showDescription = !isDescriptionHidden(visible, description, focused, appliedUiSchemaOptions.showUnfocusedDescription);
|
|
1063
1074
|
const format = appliedUiSchemaOptions.timeFormat ?? 'HH:mm';
|
|
1064
1075
|
const saveFormat = appliedUiSchemaOptions.timeSaveFormat ?? defaultTimeFormat;
|
|
@@ -1073,30 +1084,30 @@ const MaterialTimeControl = (props) => {
|
|
|
1073
1084
|
const onChange = useMemo(() => createOnChangeHandler(path, handleChange, saveFormat), [path, handleChange, saveFormat]);
|
|
1074
1085
|
const onBlurHandler = useMemo(() => createOnBlurHandler(path, handleChange, format, saveFormat, updateChild, onBlur), [path, handleChange, format, saveFormat, updateChild]);
|
|
1075
1086
|
const value = getData(data, saveFormat);
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
},
|
|
1093
|
-
InputLabelProps: data ? { shrink: true } : undefined,
|
|
1094
|
-
onFocus: onFocus,
|
|
1095
|
-
onBlur: onBlurHandler,
|
|
1087
|
+
if (!visible) {
|
|
1088
|
+
return null;
|
|
1089
|
+
}
|
|
1090
|
+
return (React.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs },
|
|
1091
|
+
React.createElement(TimePicker, { open: open, onOpen: () => setOpen(true), onClose: () => setOpen(false), key: key, label: label, value: value, onAccept: onChange, format: format, ampm: !!appliedUiSchemaOptions.ampm, views: views, disabled: !enabled, slotProps: {
|
|
1092
|
+
actionBar: ({ wrapperVariant }) => ({
|
|
1093
|
+
actions: wrapperVariant === 'desktop' ? [] : ['clear', 'cancel', 'accept'],
|
|
1094
|
+
}),
|
|
1095
|
+
textField: {
|
|
1096
|
+
id: id + '-input',
|
|
1097
|
+
required: required && !appliedUiSchemaOptions.hideRequiredAsterisk,
|
|
1098
|
+
autoFocus: appliedUiSchemaOptions.focus,
|
|
1099
|
+
error: !isValid,
|
|
1100
|
+
fullWidth: !appliedUiSchemaOptions.trim,
|
|
1101
|
+
inputProps: {
|
|
1102
|
+
type: 'text',
|
|
1096
1103
|
},
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1104
|
+
InputLabelProps: data ? { shrink: true } : undefined,
|
|
1105
|
+
onFocus: onFocus,
|
|
1106
|
+
onBlur: onBlurHandler,
|
|
1107
|
+
},
|
|
1108
|
+
} }),
|
|
1109
|
+
React.createElement(FormHelperText, { error: !isValid && !showDescription }, firstFormHelperText),
|
|
1110
|
+
React.createElement(FormHelperText, { error: !isValid }, secondFormHelperText)));
|
|
1100
1111
|
};
|
|
1101
1112
|
const materialTimeControlTester = rankWith(4, isTimeControl);
|
|
1102
1113
|
var MaterialTimeControl$1 = withJsonFormsControlProps(MaterialTimeControl);
|
|
@@ -1129,14 +1140,17 @@ const ExpandPanelRendererComponent = (props) => {
|
|
|
1129
1140
|
React.createElement(Grid, { container: true, direction: 'row', justifyContent: 'center', alignItems: 'center' },
|
|
1130
1141
|
showSortButtons && enabled ? (React.createElement(Fragment, null,
|
|
1131
1142
|
React.createElement(Grid, { item: true },
|
|
1132
|
-
React.createElement(
|
|
1133
|
-
React.createElement(
|
|
1143
|
+
React.createElement(Tooltip, { id: 'tooltip-up', title: translations.up, placement: 'bottom', open: enableMoveUp ? undefined : false },
|
|
1144
|
+
React.createElement(IconButton, { onClick: moveUp(path, index), style: iconStyle, disabled: !enableMoveUp, "aria-label": translations.upAriaLabel, size: 'large' },
|
|
1145
|
+
React.createElement(ArrowUpward, null)))),
|
|
1134
1146
|
React.createElement(Grid, { item: true },
|
|
1135
|
-
React.createElement(
|
|
1136
|
-
React.createElement(
|
|
1147
|
+
React.createElement(Tooltip, { id: 'tooltip-down', title: translations.down, placement: 'bottom', open: enableMoveDown ? undefined : false },
|
|
1148
|
+
React.createElement(IconButton, { onClick: moveDown(path, index), style: iconStyle, disabled: !enableMoveDown, "aria-label": translations.downAriaLabel, size: 'large' },
|
|
1149
|
+
React.createElement(ArrowDownward, null)))))) : (''),
|
|
1137
1150
|
enabled && (React.createElement(Grid, { item: true },
|
|
1138
|
-
React.createElement(
|
|
1139
|
-
React.createElement(
|
|
1151
|
+
React.createElement(Tooltip, { id: 'tooltip-remove', title: translations.removeTooltip, placement: 'bottom' },
|
|
1152
|
+
React.createElement(IconButton, { onClick: removeItems(path, [index]), style: iconStyle, "aria-label": translations.removeAriaLabel, size: 'large' },
|
|
1153
|
+
React.createElement(Delete, null))))))))))),
|
|
1140
1154
|
React.createElement(AccordionDetails, null,
|
|
1141
1155
|
React.createElement(JsonFormsDispatch, { enabled: enabled, schema: schema, uischema: foundUISchema, path: childPath, key: childPath, renderers: renderers, cells: cells }))));
|
|
1142
1156
|
};
|
|
@@ -1284,7 +1298,7 @@ const MaterialArrayLayoutComponent = (props) => {
|
|
|
1284
1298
|
React.createElement(ArrayLayoutToolbar, { translations: translations, label: computeLabel(label, required, appliedUiSchemaOptions.hideRequiredAsterisk), description: description, errors: errors, path: path, enabled: enabled, addItem: addItem, createDefault: innerCreateDefaultValue }),
|
|
1285
1299
|
React.createElement("div", null, data > 0 ? (map(range(data), (index) => {
|
|
1286
1300
|
return (React.createElement(ExpandPanelRenderer$1, { enabled: enabled, index: index, expanded: isExpanded(index), schema: schema, path: path, handleExpansion: handleChange, uischema: uischema, renderers: renderers, cells: cells, key: index, rootSchema: rootSchema, enableMoveUp: index != 0, enableMoveDown: index < data - 1, config: config, childLabelProp: appliedUiSchemaOptions.elementLabelProp, uischemas: uischemas, translations: translations }));
|
|
1287
|
-
})) : (React.createElement("p", null,
|
|
1301
|
+
})) : (React.createElement("p", null, translations.noDataMessage)))));
|
|
1288
1302
|
};
|
|
1289
1303
|
const MaterialArrayLayout$1 = React.memo(MaterialArrayLayoutComponent);
|
|
1290
1304
|
|