@jsonforms/material-renderers 3.4.0-alpha.0 → 3.4.0-alpha.1
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/jsonforms-react-material.cjs.js +27 -16
- package/lib/jsonforms-react-material.cjs.js.map +1 -1
- package/lib/jsonforms-react-material.esm.js +15 -10
- package/lib/jsonforms-react-material.esm.js.map +1 -1
- package/lib/mui-controls/MuiSelect.d.ts +2 -2
- package/lib/util/theme.d.ts +3 -0
- package/package.json +7 -7
- package/src/additional/ListWithDetailMasterItem.tsx +1 -1
- package/src/complex/MaterialTableControl.tsx +3 -5
- package/src/complex/TableToolbar.tsx +1 -1
- package/src/complex/ValidationIcon.tsx +1 -1
- package/src/layouts/ExpandPanelRenderer.tsx +4 -6
- package/src/mui-controls/MuiInputText.tsx +1 -1
- package/src/mui-controls/MuiSelect.tsx +8 -2
- package/src/util/theme.ts +4 -0
|
@@ -7,16 +7,21 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
7
7
|
import union from 'lodash/union';
|
|
8
8
|
import startCase from 'lodash/startCase';
|
|
9
9
|
import range from 'lodash/range';
|
|
10
|
-
import
|
|
10
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
11
|
+
import ArrowDownward from '@mui/icons-material/ArrowDownward';
|
|
12
|
+
import ArrowUpward from '@mui/icons-material/ArrowUpward';
|
|
11
13
|
import { styled } from '@mui/material/styles';
|
|
14
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
15
|
+
import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
|
|
12
16
|
import merge from 'lodash/merge';
|
|
13
17
|
import dayjs from 'dayjs';
|
|
14
18
|
import customParsing from 'dayjs/plugin/customParseFormat';
|
|
15
19
|
import debounce from 'lodash/debounce';
|
|
20
|
+
import Close from '@mui/icons-material/Close';
|
|
16
21
|
import map from 'lodash/map';
|
|
17
|
-
import AddIcon from '@mui/icons-material/Add';
|
|
18
22
|
import { LocalizationProvider, DatePicker, DateTimePicker, TimePicker } from '@mui/x-date-pickers';
|
|
19
23
|
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
|
24
|
+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
20
25
|
|
|
21
26
|
const MaterialAllOfRenderer = ({ schema, rootSchema, visible, renderers, cells, path, uischemas, uischema, }) => {
|
|
22
27
|
const delegateUISchema = findMatchingUISchema(uischemas)(schema, uischema.scope, path);
|
|
@@ -107,7 +112,7 @@ const StyledBadge = styled$1(Badge)(({ theme }) => ({
|
|
|
107
112
|
const ValidationIcon = ({ errorMessages, id }) => {
|
|
108
113
|
return (React.createElement(Tooltip, { id: id, title: errorMessages },
|
|
109
114
|
React.createElement(StyledBadge, { badgeContent: errorMessages.split('\n').length },
|
|
110
|
-
React.createElement(
|
|
115
|
+
React.createElement(ErrorOutlineIcon, { color: 'inherit' }))));
|
|
111
116
|
};
|
|
112
117
|
|
|
113
118
|
const fixedCellSmall = {
|
|
@@ -127,7 +132,7 @@ const TableToolbar = React.memo(function TableToolbar({ numColumns, errors, labe
|
|
|
127
132
|
enabled && !disableAdd ? (React.createElement(NoBorderTableCell, { align: 'right', style: fixedCellSmall },
|
|
128
133
|
React.createElement(Tooltip, { id: 'tooltip-add', title: translations.addTooltip, placement: 'bottom' },
|
|
129
134
|
React.createElement(IconButton, { "aria-label": translations.addAriaLabel, onClick: addItem(path, createDefaultValue(schema, rootSchema)), size: 'large' },
|
|
130
|
-
React.createElement(
|
|
135
|
+
React.createElement(AddIcon, null))))) : null));
|
|
131
136
|
});
|
|
132
137
|
|
|
133
138
|
const styles = {
|
|
@@ -236,7 +241,7 @@ const NonEmptyRowComponent = ({ childPath, schema, rowIndex, openDeleteDialog, m
|
|
|
236
241
|
!disableRemove ? (React.createElement(Grid, { item: true },
|
|
237
242
|
React.createElement(Tooltip, { id: 'tooltip-remove', title: translations.removeTooltip, placement: 'bottom' },
|
|
238
243
|
React.createElement(IconButton, { "aria-label": translations.removeAriaLabel, onClick: () => openDeleteDialog(childPath, rowIndex), size: 'large' },
|
|
239
|
-
React.createElement(
|
|
244
|
+
React.createElement(DeleteIcon, null))))) : null))) : null));
|
|
240
245
|
};
|
|
241
246
|
const NonEmptyRow = React.memo(NonEmptyRowComponent);
|
|
242
247
|
const TableRows = ({ data, path, schema, openDeleteDialog, moveUp, moveDown, uischema, config, enabled, cells, translations, disableRemove, }) => {
|
|
@@ -560,10 +565,10 @@ const MuiInputTime = React.memo(function MuiInputTime(props) {
|
|
|
560
565
|
});
|
|
561
566
|
|
|
562
567
|
const MuiSelect = React.memo(function MuiSelect(props) {
|
|
563
|
-
const { data, className, id, enabled, schema, uischema, path, handleChange, options, config, label, t, } = props;
|
|
568
|
+
const { data, className, id, enabled, schema, uischema, path, handleChange, options, config, label, t, multiple, } = props;
|
|
564
569
|
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
565
570
|
const noneOptionLabel = useMemo(() => t('enum.none', i18nDefaults['enum.none'], { schema, uischema, path }), [t, schema, uischema, path]);
|
|
566
|
-
return (React.createElement(Select, { className: className, id: id, label: label, disabled: !enabled, autoFocus: appliedUiSchemaOptions.focus, value: data !== undefined ? data : '', onChange: (ev) => handleChange(path, ev.target.value || undefined), fullWidth: true }, [
|
|
571
|
+
return (React.createElement(Select, { className: className, id: id, label: label, disabled: !enabled, autoFocus: appliedUiSchemaOptions.focus, value: data !== undefined ? data : '', onChange: (ev) => handleChange(path, ev.target.value || undefined), fullWidth: true, multiple: multiple || false }, [
|
|
567
572
|
React.createElement(MenuItem, { value: '', key: 'jsonforms.enum.none' },
|
|
568
573
|
React.createElement("em", null, noneOptionLabel)),
|
|
569
574
|
].concat(options.map((optionValue) => (React.createElement(MenuItem, { value: optionValue.value, key: optionValue.value }, optionValue.label))))));
|
|
@@ -705,7 +710,7 @@ const ListWithDetailMasterItem = ({ index, childLabel, selected, enabled, handle
|
|
|
705
710
|
enabled && !disableRemove && (React.createElement(ListItemSecondaryAction, null,
|
|
706
711
|
React.createElement(Tooltip, { id: 'tooltip-remove', title: translations.removeTooltip, placement: 'bottom' },
|
|
707
712
|
React.createElement(IconButton, { "aria-label": translations.removeAriaLabel, onClick: removeItem(path, index), size: 'large' },
|
|
708
|
-
React.createElement(
|
|
713
|
+
React.createElement(DeleteIcon, null)))))));
|
|
709
714
|
};
|
|
710
715
|
var ListWithDetailMasterItem$1 = withJsonFormsMasterListItemProps(ListWithDetailMasterItem);
|
|
711
716
|
|
|
@@ -1169,7 +1174,7 @@ const ExpandPanelRendererComponent = (props) => {
|
|
|
1169
1174
|
const showSortButtons = appliedUiSchemaOptions.showSortButtons ||
|
|
1170
1175
|
appliedUiSchemaOptions.showArrayLayoutSortButtons;
|
|
1171
1176
|
return (React.createElement(Accordion, { "aria-labelledby": labelHtmlId, expanded: expanded, onChange: handleExpansion(childPath) },
|
|
1172
|
-
React.createElement(AccordionSummary, { expandIcon: React.createElement(
|
|
1177
|
+
React.createElement(AccordionSummary, { expandIcon: React.createElement(ExpandMoreIcon, null) },
|
|
1173
1178
|
React.createElement(Grid, { container: true, alignItems: 'center' },
|
|
1174
1179
|
React.createElement(Grid, { item: true, xs: 7, md: 9 },
|
|
1175
1180
|
React.createElement(Grid, { container: true, alignItems: 'center' },
|
|
@@ -1193,7 +1198,7 @@ const ExpandPanelRendererComponent = (props) => {
|
|
|
1193
1198
|
enabled && !disableRemove && (React.createElement(Grid, { item: true },
|
|
1194
1199
|
React.createElement(Tooltip, { id: 'tooltip-remove', title: translations.removeTooltip, placement: 'bottom' },
|
|
1195
1200
|
React.createElement(IconButton, { onClick: removeItems(path, [index]), style: iconStyle, "aria-label": translations.removeAriaLabel, size: 'large' },
|
|
1196
|
-
React.createElement(
|
|
1201
|
+
React.createElement(DeleteIcon, null))))))))))),
|
|
1197
1202
|
React.createElement(AccordionDetails, null,
|
|
1198
1203
|
React.createElement(JsonFormsDispatch, { enabled: enabled, schema: schema, uischema: foundUISchema, path: childPath, key: childPath, renderers: renderers, cells: cells }))));
|
|
1199
1204
|
};
|