@jsonforms/material-renderers 3.2.0-beta.0 → 3.2.0-beta.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/additional/MaterialListWithDetailRenderer.d.ts +1 -1
- package/lib/additional/unwrapped.d.ts +1 -1
- package/lib/complex/TableToolbar.d.ts +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/jsonforms-react-material.cjs.js +125 -82
- package/lib/jsonforms-react-material.cjs.js.map +1 -1
- package/lib/jsonforms-react-material.esm.js +131 -92
- package/lib/jsonforms-react-material.esm.js.map +1 -1
- package/lib/layouts/ArrayToolbar.d.ts +1 -0
- package/lib/util/datejs.d.ts +3 -1
- package/package.json +10 -9
- package/src/additional/ListWithDetailMasterItem.tsx +1 -1
- package/src/additional/MaterialListWithDetailRenderer.tsx +2 -0
- package/src/complex/MaterialEnumArrayRenderer.tsx +1 -1
- package/src/complex/MaterialTableControl.tsx +7 -3
- package/src/complex/TableToolbar.tsx +34 -21
- package/src/complex/ValidationIcon.tsx +1 -1
- package/src/controls/MaterialDateControl.tsx +29 -5
- package/src/controls/MaterialDateTimeControl.tsx +29 -5
- package/src/controls/MaterialTimeControl.tsx +29 -5
- package/src/layouts/ArrayToolbar.tsx +53 -40
- package/src/layouts/ExpandPanelRenderer.tsx +6 -4
- package/src/layouts/MaterialArrayLayout.tsx +2 -0
- package/src/mui-controls/MuiInputText.tsx +1 -1
- package/src/util/datejs.tsx +45 -6
|
@@ -1,28 +1,23 @@
|
|
|
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, Grid, Typography,
|
|
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, showAsRequired, isBooleanControl, optionIs, isDateControl, isDateTimeControl, isEnumControl, isIntegerControl, isTimeControl, isNumberControl, isOneOfEnumControl, isRangeControl, isStringControl, createId, removeId, update, moveUp, moveDown, getFirstPrimitiveProp, withIncreasedRank, isVisible, deriveLabelForUISchemaElement, isObjectArrayWithNesting, isNumberFormatControl, categorizationHasCategory } from '@jsonforms/core';
|
|
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, FormLabel, 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, isObjectControl, findUISchema, isOneOfControl, isObjectArray, computeLabel, composePaths, showAsRequired, 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';
|
|
7
7
|
import union from 'lodash/union';
|
|
8
8
|
import startCase from 'lodash/startCase';
|
|
9
9
|
import range from 'lodash/range';
|
|
10
|
-
import
|
|
11
|
-
import ArrowDownward from '@mui/icons-material/ArrowDownward';
|
|
12
|
-
import ArrowUpward from '@mui/icons-material/ArrowUpward';
|
|
10
|
+
import { ErrorOutline, Add, ArrowUpward, ArrowDownward, Delete, Close, ExpandMore } from '@mui/icons-material';
|
|
13
11
|
import { styled } from '@mui/material/styles';
|
|
14
|
-
import AddIcon from '@mui/icons-material/Add';
|
|
15
|
-
import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
|
|
16
12
|
import merge from 'lodash/merge';
|
|
17
13
|
import dayjs from 'dayjs';
|
|
18
14
|
import customParsing from 'dayjs/plugin/customParseFormat';
|
|
19
15
|
import debounce from 'lodash/debounce';
|
|
20
|
-
import Close from '@mui/icons-material/Close';
|
|
21
16
|
import map from 'lodash/map';
|
|
17
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
22
18
|
import { LocalizationProvider, DatePicker, DateTimePicker, TimePicker } from '@mui/x-date-pickers';
|
|
23
19
|
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
|
24
20
|
import get from 'lodash/get';
|
|
25
|
-
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
26
21
|
|
|
27
22
|
const MaterialAllOfRenderer = ({ schema, rootSchema, visible, renderers, cells, path, uischemas, uischema, }) => {
|
|
28
23
|
const delegateUISchema = findMatchingUISchema(uischemas)(schema, uischema.scope, path);
|
|
@@ -100,7 +95,7 @@ var MaterialAnyOfRenderer$1 = withJsonFormsAnyOfProps(MaterialAnyOfRenderer);
|
|
|
100
95
|
const StyledTableCell = styled(TableCell)({
|
|
101
96
|
borderBottom: 'none',
|
|
102
97
|
});
|
|
103
|
-
const NoBorderTableCell = ({ children, ...otherProps }) => (React.createElement(StyledTableCell,
|
|
98
|
+
const NoBorderTableCell = ({ children, ...otherProps }) => (React.createElement(StyledTableCell, { ...otherProps }, children));
|
|
104
99
|
|
|
105
100
|
const StyledBadge = styled$1(Badge)(({ theme }) => ({
|
|
106
101
|
color: theme.palette.error.main,
|
|
@@ -108,25 +103,27 @@ const StyledBadge = styled$1(Badge)(({ theme }) => ({
|
|
|
108
103
|
const ValidationIcon = ({ errorMessages, id }) => {
|
|
109
104
|
return (React.createElement(Tooltip, { id: id, title: errorMessages },
|
|
110
105
|
React.createElement(StyledBadge, { badgeContent: errorMessages.split('\n').length },
|
|
111
|
-
React.createElement(
|
|
106
|
+
React.createElement(ErrorOutline, { color: 'inherit' }))));
|
|
112
107
|
};
|
|
113
108
|
|
|
114
109
|
const fixedCellSmall = {
|
|
115
110
|
paddingLeft: 0,
|
|
116
111
|
paddingRight: 0,
|
|
117
112
|
};
|
|
118
|
-
const TableToolbar = React.memo(function TableToolbar({ numColumns, errors, label, path, addItem, schema, enabled, translations, rootSchema, }) {
|
|
113
|
+
const TableToolbar = React.memo(function TableToolbar({ numColumns, errors, label, description, path, addItem, schema, enabled, translations, rootSchema, }) {
|
|
119
114
|
return (React.createElement(TableRow, null,
|
|
120
115
|
React.createElement(NoBorderTableCell, { colSpan: numColumns },
|
|
121
|
-
React.createElement(
|
|
122
|
-
React.createElement(Grid, {
|
|
123
|
-
React.createElement(
|
|
124
|
-
|
|
125
|
-
React.createElement(
|
|
116
|
+
React.createElement(Stack, null,
|
|
117
|
+
React.createElement(Grid, { container: true, justifyContent: 'flex-start', alignItems: 'center', spacing: 2 },
|
|
118
|
+
React.createElement(Grid, { item: true },
|
|
119
|
+
React.createElement(Typography, { variant: 'h6' }, label)),
|
|
120
|
+
React.createElement(Grid, { item: true }, errors.length !== 0 && (React.createElement(Grid, { item: true },
|
|
121
|
+
React.createElement(ValidationIcon, { id: 'tooltip-validation', errorMessages: errors }))))),
|
|
122
|
+
description && React.createElement(FormHelperText, null, description))),
|
|
126
123
|
enabled ? (React.createElement(NoBorderTableCell, { align: 'right', style: fixedCellSmall },
|
|
127
124
|
React.createElement(Tooltip, { id: 'tooltip-add', title: translations.addTooltip, placement: 'bottom' },
|
|
128
125
|
React.createElement(IconButton, { "aria-label": translations.addAriaLabel, onClick: addItem(path, createDefaultValue(schema, rootSchema)), size: 'large' },
|
|
129
|
-
React.createElement(
|
|
126
|
+
React.createElement(Add, null))))) : null));
|
|
130
127
|
});
|
|
131
128
|
|
|
132
129
|
const styles = {
|
|
@@ -158,7 +155,7 @@ const generateCells = (Cell, schema, rowPath, enabled, cells) => {
|
|
|
158
155
|
enabled,
|
|
159
156
|
cells,
|
|
160
157
|
};
|
|
161
|
-
return React.createElement(Cell,
|
|
158
|
+
return React.createElement(Cell, { key: cellPath, ...props });
|
|
162
159
|
});
|
|
163
160
|
}
|
|
164
161
|
else {
|
|
@@ -168,7 +165,7 @@ const generateCells = (Cell, schema, rowPath, enabled, cells) => {
|
|
|
168
165
|
cellPath: rowPath,
|
|
169
166
|
enabled,
|
|
170
167
|
};
|
|
171
|
-
return React.createElement(Cell,
|
|
168
|
+
return React.createElement(Cell, { key: rowPath, ...props });
|
|
172
169
|
}
|
|
173
170
|
};
|
|
174
171
|
const getValidColumnProps = (scopedSchema) => {
|
|
@@ -214,7 +211,7 @@ const NonEmptyCell = (ownProps) => {
|
|
|
214
211
|
const ctx = useJsonForms();
|
|
215
212
|
const emptyCellProps = ctxToNonEmptyCellProps(ctx, ownProps);
|
|
216
213
|
const isValid = isEmpty(emptyCellProps.errors);
|
|
217
|
-
return React.createElement(NonEmptyCellComponent,
|
|
214
|
+
return React.createElement(NonEmptyCellComponent, { ...emptyCellProps, isValid: isValid });
|
|
218
215
|
};
|
|
219
216
|
const NonEmptyRowComponent = ({ childPath, schema, rowIndex, openDeleteDialog, moveUpCreator, moveDownCreator, enableUp, enableDown, showSortButtons, enabled, cells, path, translations, }) => {
|
|
220
217
|
const moveUp = useMemo(() => moveUpCreator(path, rowIndex), [moveUpCreator, path, rowIndex]);
|
|
@@ -232,7 +229,7 @@ const NonEmptyRowComponent = ({ childPath, schema, rowIndex, openDeleteDialog, m
|
|
|
232
229
|
React.createElement(ArrowDownward, null))))) : null,
|
|
233
230
|
React.createElement(Grid, { item: true },
|
|
234
231
|
React.createElement(IconButton, { "aria-label": translations.removeAriaLabel, onClick: () => openDeleteDialog(childPath, rowIndex), size: 'large' },
|
|
235
|
-
React.createElement(
|
|
232
|
+
React.createElement(Delete, null)))))) : null));
|
|
236
233
|
};
|
|
237
234
|
const NonEmptyRow = React.memo(NonEmptyRowComponent);
|
|
238
235
|
const TableRows = ({ data, path, schema, openDeleteDialog, moveUp, moveDown, uischema, config, enabled, cells, translations, }) => {
|
|
@@ -253,7 +250,7 @@ class MaterialTableControl extends React.Component {
|
|
|
253
250
|
this.addItem = (path, value) => this.props.addItem(path, value);
|
|
254
251
|
}
|
|
255
252
|
render() {
|
|
256
|
-
const { label, path, schema, rootSchema, uischema, errors, openDeleteDialog, visible, enabled, cells, translations, } = this.props;
|
|
253
|
+
const { label, description, path, schema, rootSchema, uischema, errors, openDeleteDialog, visible, enabled, cells, translations, } = this.props;
|
|
257
254
|
const controlElement = uischema;
|
|
258
255
|
const isObjectSchema = schema.type === 'object';
|
|
259
256
|
const headerCells = isObjectSchema
|
|
@@ -262,12 +259,12 @@ class MaterialTableControl extends React.Component {
|
|
|
262
259
|
return (React.createElement(Hidden, { xsUp: !visible },
|
|
263
260
|
React.createElement(Table, null,
|
|
264
261
|
React.createElement(TableHead, null,
|
|
265
|
-
React.createElement(TableToolbar, { errors: errors, label: label, addItem: this.addItem, numColumns: isObjectSchema ? headerCells.length : 1, path: path, uischema: controlElement, schema: schema, rootSchema: rootSchema, enabled: enabled, translations: translations }),
|
|
262
|
+
React.createElement(TableToolbar, { errors: errors, label: label, description: description, addItem: this.addItem, numColumns: isObjectSchema ? headerCells.length : 1, path: path, uischema: controlElement, schema: schema, rootSchema: rootSchema, enabled: enabled, translations: translations }),
|
|
266
263
|
isObjectSchema && (React.createElement(TableRow, null,
|
|
267
264
|
headerCells,
|
|
268
265
|
enabled ? React.createElement(TableCell, null) : null))),
|
|
269
266
|
React.createElement(TableBody, null,
|
|
270
|
-
React.createElement(TableRows,
|
|
267
|
+
React.createElement(TableRows, { openDeleteDialog: openDeleteDialog, translations: translations, ...this.props })))));
|
|
271
268
|
}
|
|
272
269
|
}
|
|
273
270
|
|
|
@@ -299,7 +296,7 @@ const MaterialArrayControlRenderer = (props) => {
|
|
|
299
296
|
}, [setOpen, path, rowData]);
|
|
300
297
|
const deleteClose = useCallback(() => setOpen(false), [setOpen]);
|
|
301
298
|
return (React.createElement(Hidden, { xsUp: !visible },
|
|
302
|
-
React.createElement(MaterialTableControl,
|
|
299
|
+
React.createElement(MaterialTableControl, { ...props, openDeleteDialog: openDeleteDialog }),
|
|
303
300
|
React.createElement(DeleteDialog, { open: open, onCancel: deleteCancel, onConfirm: deleteConfirm, onClose: deleteClose, acceptText: props.translations.deleteDialogAccept, declineText: props.translations.deleteDialogDecline, title: props.translations.deleteDialogTitle, message: props.translations.deleteDialogMessage })));
|
|
304
301
|
};
|
|
305
302
|
const materialArrayControlTester = rankWith(3, or(isObjectArrayControl, isPrimitiveArrayControl));
|
|
@@ -331,7 +328,7 @@ const MuiAutocomplete = (props) => {
|
|
|
331
328
|
}, inputValue: inputValue, onInputChange: (_event, newInputValue) => {
|
|
332
329
|
setInputValue(newInputValue);
|
|
333
330
|
}, autoHighlight: true, autoSelect: true, autoComplete: true, fullWidth: true, options: options, getOptionLabel: getOptionLabel || ((option) => option?.label), freeSolo: false, renderInput: (params) => {
|
|
334
|
-
return (React.createElement(TextField,
|
|
331
|
+
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 }));
|
|
335
332
|
}, renderOption: renderOption, filterOptions: filterOptions }),
|
|
336
333
|
React.createElement(FormHelperText, { error: !isValid && !showDescription }, firstFormHelperText),
|
|
337
334
|
React.createElement(FormHelperText, { error: !isValid }, secondFormHelperText)));
|
|
@@ -348,13 +345,44 @@ const MuiCheckbox = React.memo(function MuiCheckbox(props) {
|
|
|
348
345
|
});
|
|
349
346
|
|
|
350
347
|
dayjs.extend(customParsing);
|
|
351
|
-
const createOnChangeHandler = (path, handleChange, saveFormat) => (
|
|
352
|
-
if (!
|
|
348
|
+
const createOnChangeHandler = (path, handleChange, saveFormat) => (value) => {
|
|
349
|
+
if (!value) {
|
|
353
350
|
handleChange(path, undefined);
|
|
354
|
-
return;
|
|
355
351
|
}
|
|
356
|
-
|
|
357
|
-
|
|
352
|
+
else if (value.toString() !== 'Invalid Date') {
|
|
353
|
+
const formatedDate = formatDate(value, saveFormat);
|
|
354
|
+
handleChange(path, formatedDate);
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
const createOnBlurHandler = (path, handleChange, format, saveFormat, rerenderChild, onBlur) => (e) => {
|
|
358
|
+
const date = dayjs(e.target.value, format);
|
|
359
|
+
const formatedDate = formatDate(date, saveFormat);
|
|
360
|
+
if (formatedDate.toString() === 'Invalid Date') {
|
|
361
|
+
handleChange(path, undefined);
|
|
362
|
+
rerenderChild();
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
handleChange(path, formatedDate);
|
|
366
|
+
}
|
|
367
|
+
onBlur();
|
|
368
|
+
};
|
|
369
|
+
const formatDate = (date, saveFormat) => {
|
|
370
|
+
let formatedDate = date.format(saveFormat);
|
|
371
|
+
const indexOfYear = saveFormat.indexOf('YYYY');
|
|
372
|
+
if (date.year() < 1000 && indexOfYear !== -1) {
|
|
373
|
+
const stringUpToYear = formatedDate.slice(0, indexOfYear);
|
|
374
|
+
const stringFromYear = formatedDate.slice(indexOfYear);
|
|
375
|
+
if (date.year() >= 100) {
|
|
376
|
+
formatedDate = [stringUpToYear, 0, stringFromYear].join('');
|
|
377
|
+
}
|
|
378
|
+
else if (date.year() >= 10) {
|
|
379
|
+
formatedDate = [stringUpToYear, 0, 0, stringFromYear].join('');
|
|
380
|
+
}
|
|
381
|
+
else if (date.year() >= 1) {
|
|
382
|
+
formatedDate = [stringUpToYear, 0, 0, 0, stringFromYear].join('');
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return formatedDate;
|
|
358
386
|
};
|
|
359
387
|
const getData = (data, saveFormat) => {
|
|
360
388
|
if (!data) {
|
|
@@ -384,7 +412,7 @@ const MaterialLayoutRenderer = React.memo(MaterialLayoutRendererComponent);
|
|
|
384
412
|
const withAjvProps = (Component) => function WithAjvProps(props) {
|
|
385
413
|
const ctx = useJsonForms();
|
|
386
414
|
const ajv = getAjv({ jsonforms: { ...ctx } });
|
|
387
|
-
return React.createElement(Component,
|
|
415
|
+
return React.createElement(Component, { ...props, ajv: ajv });
|
|
388
416
|
};
|
|
389
417
|
|
|
390
418
|
const variantToInput = {
|
|
@@ -535,16 +563,16 @@ const MuiToggle = React.memo(function MuiToggle(props) {
|
|
|
535
563
|
});
|
|
536
564
|
|
|
537
565
|
const MaterialEnumArrayRenderer = ({ schema, visible, errors, path, options, data, addItem, removeItem, handleChange: _handleChange, ...otherProps }) => {
|
|
538
|
-
return (React.createElement(Hidden, {
|
|
566
|
+
return (React.createElement(Hidden, { xsUp: !visible },
|
|
539
567
|
React.createElement(FormControl, { component: 'fieldset' },
|
|
540
568
|
React.createElement(FormGroup, { row: true }, options.map((option, index) => {
|
|
541
569
|
const optionPath = Paths.compose(path, `${index}`);
|
|
542
570
|
const checkboxValue = data?.includes(option.value)
|
|
543
571
|
? option.value
|
|
544
572
|
: undefined;
|
|
545
|
-
return (React.createElement(FormControlLabel, { id: option.value, key: option.value, control: React.createElement(MuiCheckbox,
|
|
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
|
|
546
574
|
? addItem(path, option.value)
|
|
547
|
-
: removeItem(path, option.value), data: checkboxValue, errors: errors, schema: schema, visible: visible
|
|
575
|
+
: removeItem(path, option.value), data: checkboxValue, errors: errors, schema: schema, visible: visible, ...otherProps }), label: option.label }));
|
|
548
576
|
})),
|
|
549
577
|
React.createElement(FormHelperText, { error: true }, errors))));
|
|
550
578
|
};
|
|
@@ -619,21 +647,23 @@ const MaterialLabelRenderer = ({ text, visible }) => {
|
|
|
619
647
|
};
|
|
620
648
|
var MaterialLabelRenderer$1 = withJsonFormsLabelProps(MaterialLabelRenderer);
|
|
621
649
|
|
|
622
|
-
const ArrayLayoutToolbar = React.memo(function ArrayLayoutToolbar({ label, errors, addItem, path, enabled, createDefault, translations, }) {
|
|
650
|
+
const ArrayLayoutToolbar = React.memo(function ArrayLayoutToolbar({ label, description, errors, addItem, path, enabled, createDefault, translations, }) {
|
|
623
651
|
return (React.createElement(Toolbar, { disableGutters: true },
|
|
624
|
-
React.createElement(
|
|
625
|
-
React.createElement(Grid, {
|
|
626
|
-
React.createElement(Grid, {
|
|
627
|
-
React.createElement(Grid, {
|
|
628
|
-
React.createElement(
|
|
629
|
-
|
|
630
|
-
React.createElement(
|
|
631
|
-
|
|
632
|
-
React.createElement(Grid, {
|
|
633
|
-
React.createElement(Grid, {
|
|
634
|
-
React.createElement(
|
|
635
|
-
React.createElement(
|
|
636
|
-
React.createElement(
|
|
652
|
+
React.createElement(Stack, null,
|
|
653
|
+
React.createElement(Grid, { container: true, alignItems: 'center', justifyContent: 'space-between' },
|
|
654
|
+
React.createElement(Grid, { item: true },
|
|
655
|
+
React.createElement(Grid, { container: true, justifyContent: 'flex-start', alignItems: 'center', spacing: 2 },
|
|
656
|
+
React.createElement(Grid, { item: true },
|
|
657
|
+
React.createElement(Typography, { variant: 'h6' }, label)),
|
|
658
|
+
React.createElement(Grid, { item: true }, errors.length !== 0 && (React.createElement(Grid, { item: true },
|
|
659
|
+
React.createElement(ValidationIcon, { id: 'tooltip-validation', errorMessages: errors })))))),
|
|
660
|
+
enabled && (React.createElement(Grid, { item: true },
|
|
661
|
+
React.createElement(Grid, { container: true },
|
|
662
|
+
React.createElement(Grid, { item: true },
|
|
663
|
+
React.createElement(Tooltip, { id: 'tooltip-add', title: translations.addTooltip, placement: 'bottom' },
|
|
664
|
+
React.createElement(IconButton, { "aria-label": translations.addTooltip, onClick: addItem(path, createDefault()), size: 'large' },
|
|
665
|
+
React.createElement(AddIcon, null)))))))),
|
|
666
|
+
description && React.createElement(FormHelperText, null, description))));
|
|
637
667
|
});
|
|
638
668
|
|
|
639
669
|
const ListWithDetailMasterItem = ({ index, childLabel, selected, enabled, handleSelect, removeItem, path, translations, }) => {
|
|
@@ -643,11 +673,11 @@ const ListWithDetailMasterItem = ({ index, childLabel, selected, enabled, handle
|
|
|
643
673
|
React.createElement(ListItemText, { primary: childLabel }),
|
|
644
674
|
enabled && (React.createElement(ListItemSecondaryAction, null,
|
|
645
675
|
React.createElement(IconButton, { "aria-label": translations.removeAriaLabel, onClick: removeItem(path, index), size: 'large' },
|
|
646
|
-
React.createElement(
|
|
676
|
+
React.createElement(Delete, null))))));
|
|
647
677
|
};
|
|
648
678
|
var ListWithDetailMasterItem$1 = withJsonFormsMasterListItemProps(ListWithDetailMasterItem);
|
|
649
679
|
|
|
650
|
-
const MaterialListWithDetailRenderer = ({ uischemas, schema, uischema, path, enabled, errors, visible, label, required, removeItems, addItem, data, renderers, cells, config, rootSchema, translations, }) => {
|
|
680
|
+
const MaterialListWithDetailRenderer = ({ uischemas, schema, uischema, path, enabled, errors, visible, label, required, removeItems, addItem, data, renderers, cells, config, rootSchema, translations, description, }) => {
|
|
651
681
|
const [selectedIndex, setSelectedIndex] = useState(undefined);
|
|
652
682
|
const handleRemoveItem = useCallback((p, value) => () => {
|
|
653
683
|
removeItems(p, [value])();
|
|
@@ -666,7 +696,7 @@ const MaterialListWithDetailRenderer = ({ uischemas, schema, uischema, path, ena
|
|
|
666
696
|
setSelectedIndex(undefined);
|
|
667
697
|
}, [schema]);
|
|
668
698
|
return (React.createElement(Hidden, { xsUp: !visible },
|
|
669
|
-
React.createElement(ArrayLayoutToolbar, { translations: translations, label: computeLabel(label, required, appliedUiSchemaOptions.hideRequiredAsterisk), errors: errors, path: path, enabled: enabled, addItem: addItem, createDefault: handleCreateDefaultValue }),
|
|
699
|
+
React.createElement(ArrayLayoutToolbar, { translations: translations, label: computeLabel(label, required, appliedUiSchemaOptions.hideRequiredAsterisk), description: description, errors: errors, path: path, enabled: enabled, addItem: addItem, createDefault: handleCreateDefaultValue }),
|
|
670
700
|
React.createElement(Grid, { container: true, direction: 'row', spacing: 2 },
|
|
671
701
|
React.createElement(Grid, { item: true, xs: 3 },
|
|
672
702
|
React.createElement(List, null, data > 0 ? (map(range(data), (index) => (React.createElement(ListWithDetailMasterItem$1, { index: index, path: path, schema: schema, enabled: enabled, handleSelect: handleListItemClick, removeItem: handleRemoveItem, selected: selectedIndex === index, key: index, translations: translations })))) : (React.createElement("p", null, "No data")))),
|
|
@@ -692,7 +722,7 @@ const MaterialInputControl = (props) => {
|
|
|
692
722
|
return (React.createElement(Hidden, { xsUp: !visible },
|
|
693
723
|
React.createElement(FormControl, { fullWidth: !appliedUiSchemaOptions.trim, onFocus: onFocus, onBlur: onBlur, variant: variant, id: id },
|
|
694
724
|
React.createElement(InputLabel, { htmlFor: id + '-input', error: !isValid, required: showAsRequired(required, appliedUiSchemaOptions.hideRequiredAsterisk) }, label),
|
|
695
|
-
React.createElement(InnerComponent,
|
|
725
|
+
React.createElement(InnerComponent, { ...props, id: id + '-input', isValid: isValid, visible: visible }),
|
|
696
726
|
React.createElement(FormHelperText, { error: !isValid && !showDescription }, firstFormHelperText),
|
|
697
727
|
React.createElement(FormHelperText, { error: !isValid }, secondFormHelperText))));
|
|
698
728
|
};
|
|
@@ -723,7 +753,7 @@ const MuiAutocompleteInputText = (props) => {
|
|
|
723
753
|
};
|
|
724
754
|
class MaterialAnyOfStringOrEnumControl extends Control {
|
|
725
755
|
render() {
|
|
726
|
-
return (React.createElement(MaterialInputControl,
|
|
756
|
+
return (React.createElement(MaterialInputControl, { ...this.props, input: MuiAutocompleteInputText }));
|
|
727
757
|
}
|
|
728
758
|
}
|
|
729
759
|
const hasEnumAndText = (schemas) => {
|
|
@@ -824,8 +854,9 @@ const MaterialDateControl = (props) => {
|
|
|
824
854
|
const isValid = errors.length === 0;
|
|
825
855
|
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
826
856
|
const showDescription = !isDescriptionHidden(visible, description, focused, appliedUiSchemaOptions.showUnfocusedDescription);
|
|
857
|
+
const [key, setKey] = useState(0);
|
|
827
858
|
const format = appliedUiSchemaOptions.dateFormat ?? 'YYYY-MM-DD';
|
|
828
|
-
const saveFormat = appliedUiSchemaOptions.dateSaveFormat ??
|
|
859
|
+
const saveFormat = appliedUiSchemaOptions.dateSaveFormat ?? defaultDateFormat;
|
|
829
860
|
const views = appliedUiSchemaOptions.views ?? ['year', 'day'];
|
|
830
861
|
const firstFormHelperText = showDescription
|
|
831
862
|
? description
|
|
@@ -833,11 +864,13 @@ const MaterialDateControl = (props) => {
|
|
|
833
864
|
? errors
|
|
834
865
|
: null;
|
|
835
866
|
const secondFormHelperText = showDescription && !isValid ? errors : null;
|
|
867
|
+
const updateChild = useCallback(() => setKey((key) => key + 1), []);
|
|
836
868
|
const onChange = useMemo(() => createOnChangeHandler(path, handleChange, saveFormat), [path, handleChange, saveFormat]);
|
|
869
|
+
const onBlurHandler = useMemo(() => createOnBlurHandler(path, handleChange, format, saveFormat, updateChild, onBlur), [path, handleChange, format, saveFormat, updateChild]);
|
|
837
870
|
const value = getData(data, saveFormat);
|
|
838
871
|
return (React.createElement(Hidden, { xsUp: !visible },
|
|
839
872
|
React.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs },
|
|
840
|
-
React.createElement(DatePicker, { label: label, value: value,
|
|
873
|
+
React.createElement(DatePicker, { key: key, label: label, value: value, onAccept: onChange, format: format, views: views, disabled: !enabled, slotProps: {
|
|
841
874
|
actionBar: ({ wrapperVariant }) => ({
|
|
842
875
|
actions: wrapperVariant === 'desktop'
|
|
843
876
|
? []
|
|
@@ -854,7 +887,7 @@ const MaterialDateControl = (props) => {
|
|
|
854
887
|
},
|
|
855
888
|
InputLabelProps: data ? { shrink: true } : undefined,
|
|
856
889
|
onFocus: onFocus,
|
|
857
|
-
onBlur:
|
|
890
|
+
onBlur: onBlurHandler,
|
|
858
891
|
},
|
|
859
892
|
} }),
|
|
860
893
|
React.createElement(FormHelperText, { error: !isValid && !showDescription }, firstFormHelperText),
|
|
@@ -870,7 +903,8 @@ const MaterialDateTimeControl = (props) => {
|
|
|
870
903
|
const isValid = errors.length === 0;
|
|
871
904
|
const showDescription = !isDescriptionHidden(visible, description, focused, appliedUiSchemaOptions.showUnfocusedDescription);
|
|
872
905
|
const format = appliedUiSchemaOptions.dateTimeFormat ?? 'YYYY-MM-DD HH:mm';
|
|
873
|
-
const saveFormat = appliedUiSchemaOptions.dateTimeSaveFormat ??
|
|
906
|
+
const saveFormat = appliedUiSchemaOptions.dateTimeSaveFormat ?? defaultDateTimeFormat;
|
|
907
|
+
const [key, setKey] = useState(0);
|
|
874
908
|
const views = appliedUiSchemaOptions.views ?? [
|
|
875
909
|
'year',
|
|
876
910
|
'day',
|
|
@@ -883,11 +917,13 @@ const MaterialDateTimeControl = (props) => {
|
|
|
883
917
|
? errors
|
|
884
918
|
: null;
|
|
885
919
|
const secondFormHelperText = showDescription && !isValid ? errors : null;
|
|
920
|
+
const updateChild = useCallback(() => setKey((key) => key + 1), []);
|
|
886
921
|
const onChange = useMemo(() => createOnChangeHandler(path, handleChange, saveFormat), [path, handleChange, saveFormat]);
|
|
922
|
+
const onBlurHandler = useMemo(() => createOnBlurHandler(path, handleChange, format, saveFormat, updateChild, onBlur), [path, handleChange, format, saveFormat, updateChild]);
|
|
887
923
|
const value = getData(data, saveFormat);
|
|
888
924
|
return (React.createElement(Hidden, { xsUp: !visible },
|
|
889
925
|
React.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs },
|
|
890
|
-
React.createElement(DateTimePicker, { label: label, value: value,
|
|
926
|
+
React.createElement(DateTimePicker, { key: key, label: label, value: value, onAccept: onChange, format: format, ampm: !!appliedUiSchemaOptions.ampm, views: views, disabled: !enabled, slotProps: {
|
|
891
927
|
actionBar: ({ wrapperVariant }) => ({
|
|
892
928
|
actions: wrapperVariant === 'desktop'
|
|
893
929
|
? []
|
|
@@ -904,7 +940,7 @@ const MaterialDateTimeControl = (props) => {
|
|
|
904
940
|
},
|
|
905
941
|
InputLabelProps: data ? { shrink: true } : undefined,
|
|
906
942
|
onFocus: onFocus,
|
|
907
|
-
onBlur:
|
|
943
|
+
onBlur: onBlurHandler,
|
|
908
944
|
},
|
|
909
945
|
} }),
|
|
910
946
|
React.createElement(FormHelperText, { error: !isValid && !showDescription }, firstFormHelperText),
|
|
@@ -917,12 +953,12 @@ const MaterialEnumControl = (props) => {
|
|
|
917
953
|
const { config, uischema, errors } = props;
|
|
918
954
|
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
919
955
|
const isValid = errors.length === 0;
|
|
920
|
-
return appliedUiSchemaOptions.autocomplete === false ? (React.createElement(MaterialInputControl,
|
|
956
|
+
return appliedUiSchemaOptions.autocomplete === false ? (React.createElement(MaterialInputControl, { ...props, input: MuiSelect })) : (React.createElement(MuiAutocomplete, { ...props, isValid: isValid }));
|
|
921
957
|
};
|
|
922
958
|
const materialEnumControlTester = rankWith(2, isEnumControl);
|
|
923
959
|
var MaterialEnumControl$1 = withJsonFormsEnumProps(withTranslateProps(React.memo(MaterialEnumControl)), false);
|
|
924
960
|
|
|
925
|
-
const MaterialIntegerControl = (props) => (React.createElement(MaterialInputControl,
|
|
961
|
+
const MaterialIntegerControl = (props) => (React.createElement(MaterialInputControl, { ...props, input: MuiInputInteger }));
|
|
926
962
|
const materialIntegerControlTester = rankWith(2, isIntegerControl);
|
|
927
963
|
var MaterialIntegerControl$1 = withJsonFormsControlProps(MaterialIntegerControl);
|
|
928
964
|
|
|
@@ -940,7 +976,7 @@ const MaterialNativeControl = (props) => {
|
|
|
940
976
|
const materialNativeControlTester = rankWith(2, or(isDateControl, isTimeControl));
|
|
941
977
|
var MaterialNativeControl$1 = withJsonFormsControlProps(MaterialNativeControl);
|
|
942
978
|
|
|
943
|
-
const MaterialNumberControl = (props) => (React.createElement(MaterialInputControl,
|
|
979
|
+
const MaterialNumberControl = (props) => (React.createElement(MaterialInputControl, { ...props, input: MuiInputNumber }));
|
|
944
980
|
const materialNumberControlTester = rankWith(2, isNumberControl);
|
|
945
981
|
var MaterialNumberControl$1 = withJsonFormsControlProps(MaterialNumberControl);
|
|
946
982
|
|
|
@@ -948,7 +984,7 @@ const MaterialOneOfEnumControl = (props) => {
|
|
|
948
984
|
const { config, uischema, errors } = props;
|
|
949
985
|
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
950
986
|
const isValid = errors.length === 0;
|
|
951
|
-
return appliedUiSchemaOptions.autocomplete === false ? (React.createElement(MaterialInputControl,
|
|
987
|
+
return appliedUiSchemaOptions.autocomplete === false ? (React.createElement(MaterialInputControl, { ...props, input: MuiSelect })) : (React.createElement(MuiAutocomplete, { ...props, isValid: isValid }));
|
|
952
988
|
};
|
|
953
989
|
const materialOneOfEnumControlTester = rankWith(5, isOneOfEnumControl);
|
|
954
990
|
var MaterialOneOfEnumControl$1 = withJsonFormsOneOfEnumProps(withTranslateProps(React.memo(MaterialOneOfEnumControl)), false);
|
|
@@ -967,13 +1003,13 @@ const MaterialRadioGroup = (props) => {
|
|
|
967
1003
|
};
|
|
968
1004
|
|
|
969
1005
|
const MaterialOneOfRadioGroupControl = (props) => {
|
|
970
|
-
return React.createElement(MaterialRadioGroup,
|
|
1006
|
+
return React.createElement(MaterialRadioGroup, { ...props });
|
|
971
1007
|
};
|
|
972
1008
|
const materialOneOfRadioGroupControlTester = rankWith(20, and(isOneOfEnumControl, optionIs('format', 'radio')));
|
|
973
1009
|
var MaterialOneOfRadioGroupControl$1 = withJsonFormsOneOfEnumProps(MaterialOneOfRadioGroupControl);
|
|
974
1010
|
|
|
975
1011
|
const MaterialRadioGroupControl = (props) => {
|
|
976
|
-
return React.createElement(MaterialRadioGroup,
|
|
1012
|
+
return React.createElement(MaterialRadioGroup, { ...props });
|
|
977
1013
|
};
|
|
978
1014
|
const materialRadioGroupControlTester = rankWith(20, and(isEnumControl, optionIs('format', 'radio')));
|
|
979
1015
|
var MaterialRadioGroupControl$1 = withJsonFormsEnumProps(MaterialRadioGroupControl);
|
|
@@ -1013,7 +1049,7 @@ const MaterialSliderControl = (props) => {
|
|
|
1013
1049
|
const materialSliderControlTester = rankWith(4, isRangeControl);
|
|
1014
1050
|
var MaterialSliderControl$1 = withJsonFormsControlProps(MaterialSliderControl);
|
|
1015
1051
|
|
|
1016
|
-
const MaterialTextControl = (props) => (React.createElement(MaterialInputControl,
|
|
1052
|
+
const MaterialTextControl = (props) => (React.createElement(MaterialInputControl, { ...props, input: MuiInputText }));
|
|
1017
1053
|
const materialTextControlTester = rankWith(1, isStringControl);
|
|
1018
1054
|
var MaterialTextControl$1 = withJsonFormsControlProps(MaterialTextControl);
|
|
1019
1055
|
|
|
@@ -1022,9 +1058,10 @@ const MaterialTimeControl = (props) => {
|
|
|
1022
1058
|
const { id, description, errors, label, uischema, visible, enabled, required, path, handleChange, data, config, } = props;
|
|
1023
1059
|
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
1024
1060
|
const isValid = errors.length === 0;
|
|
1061
|
+
const [key, setKey] = useState(0);
|
|
1025
1062
|
const showDescription = !isDescriptionHidden(visible, description, focused, appliedUiSchemaOptions.showUnfocusedDescription);
|
|
1026
1063
|
const format = appliedUiSchemaOptions.timeFormat ?? 'HH:mm';
|
|
1027
|
-
const saveFormat = appliedUiSchemaOptions.timeSaveFormat ??
|
|
1064
|
+
const saveFormat = appliedUiSchemaOptions.timeSaveFormat ?? defaultTimeFormat;
|
|
1028
1065
|
const views = appliedUiSchemaOptions.views ?? ['hours', 'minutes'];
|
|
1029
1066
|
const firstFormHelperText = showDescription
|
|
1030
1067
|
? description
|
|
@@ -1032,11 +1069,13 @@ const MaterialTimeControl = (props) => {
|
|
|
1032
1069
|
? errors
|
|
1033
1070
|
: null;
|
|
1034
1071
|
const secondFormHelperText = showDescription && !isValid ? errors : null;
|
|
1072
|
+
const updateChild = useCallback(() => setKey((key) => key + 1), []);
|
|
1035
1073
|
const onChange = useMemo(() => createOnChangeHandler(path, handleChange, saveFormat), [path, handleChange, saveFormat]);
|
|
1074
|
+
const onBlurHandler = useMemo(() => createOnBlurHandler(path, handleChange, format, saveFormat, updateChild, onBlur), [path, handleChange, format, saveFormat, updateChild]);
|
|
1036
1075
|
const value = getData(data, saveFormat);
|
|
1037
1076
|
return (React.createElement(Hidden, { xsUp: !visible },
|
|
1038
1077
|
React.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs },
|
|
1039
|
-
React.createElement(TimePicker, { label: label, value: value,
|
|
1078
|
+
React.createElement(TimePicker, { key: key, label: label, value: value, onAccept: onChange, format: format, ampm: !!appliedUiSchemaOptions.ampm, views: views, disabled: !enabled, slotProps: {
|
|
1040
1079
|
actionBar: ({ wrapperVariant }) => ({
|
|
1041
1080
|
actions: wrapperVariant === 'desktop'
|
|
1042
1081
|
? []
|
|
@@ -1053,7 +1092,7 @@ const MaterialTimeControl = (props) => {
|
|
|
1053
1092
|
},
|
|
1054
1093
|
InputLabelProps: data ? { shrink: true } : undefined,
|
|
1055
1094
|
onFocus: onFocus,
|
|
1056
|
-
onBlur:
|
|
1095
|
+
onBlur: onBlurHandler,
|
|
1057
1096
|
},
|
|
1058
1097
|
} }),
|
|
1059
1098
|
React.createElement(FormHelperText, { error: !isValid && !showDescription }, firstFormHelperText),
|
|
@@ -1076,7 +1115,7 @@ const ExpandPanelRendererComponent = (props) => {
|
|
|
1076
1115
|
const showSortButtons = appliedUiSchemaOptions.showSortButtons ||
|
|
1077
1116
|
appliedUiSchemaOptions.showArrayLayoutSortButtons;
|
|
1078
1117
|
return (React.createElement(Accordion, { "aria-labelledby": labelHtmlId, expanded: expanded, onChange: handleExpansion(childPath) },
|
|
1079
|
-
React.createElement(AccordionSummary, { expandIcon: React.createElement(
|
|
1118
|
+
React.createElement(AccordionSummary, { expandIcon: React.createElement(ExpandMore, null) },
|
|
1080
1119
|
React.createElement(Grid, { container: true, alignItems: 'center' },
|
|
1081
1120
|
React.createElement(Grid, { item: true, xs: 7, md: 9 },
|
|
1082
1121
|
React.createElement(Grid, { container: true, alignItems: 'center' },
|
|
@@ -1097,7 +1136,7 @@ const ExpandPanelRendererComponent = (props) => {
|
|
|
1097
1136
|
React.createElement(ArrowDownward, null))))) : (''),
|
|
1098
1137
|
enabled && (React.createElement(Grid, { item: true },
|
|
1099
1138
|
React.createElement(IconButton, { onClick: removeItems(path, [index]), style: iconStyle, "aria-label": translations.removeAriaLabel, size: 'large' },
|
|
1100
|
-
React.createElement(
|
|
1139
|
+
React.createElement(Delete, null)))))))))),
|
|
1101
1140
|
React.createElement(AccordionDetails, null,
|
|
1102
1141
|
React.createElement(JsonFormsDispatch, { enabled: enabled, schema: schema, uischema: foundUISchema, path: childPath, key: childPath, renderers: renderers, cells: cells }))));
|
|
1103
1142
|
};
|
|
@@ -1136,7 +1175,7 @@ const withContextToExpandPanelProps = (Component) => function WithContextToExpan
|
|
|
1136
1175
|
const childLabel = childLabelProp
|
|
1137
1176
|
? get(childData, childLabelProp, '')
|
|
1138
1177
|
: get(childData, getFirstPrimitiveProp(schema), '');
|
|
1139
|
-
return (React.createElement(Component,
|
|
1178
|
+
return (React.createElement(Component, { ...props, ...dispatchProps, childLabel: childLabel, childPath: childPath, uischemas: uischemas }));
|
|
1140
1179
|
};
|
|
1141
1180
|
const withJsonFormsExpandPanelProps = (Component) => withJsonFormsContext(withContextToExpandPanelProps(Component));
|
|
1142
1181
|
var ExpandPanelRenderer$1 = withJsonFormsExpandPanelProps(ExpandPanelRenderer);
|
|
@@ -1149,7 +1188,7 @@ const GroupComponent = React.memo(function GroupComponent({ visible, enabled, ui
|
|
|
1149
1188
|
React.createElement(Card, { style: style },
|
|
1150
1189
|
!isEmpty(label) && React.createElement(CardHeader, { title: label }),
|
|
1151
1190
|
React.createElement(CardContent, null,
|
|
1152
|
-
React.createElement(MaterialLayoutRenderer,
|
|
1191
|
+
React.createElement(MaterialLayoutRenderer, { ...props, visible: visible, enabled: enabled, elements: groupLayout.elements })))));
|
|
1153
1192
|
});
|
|
1154
1193
|
const MaterializedGroupLayoutRenderer = ({ uischema, schema, path, visible, enabled, renderers, cells, direction, label, }) => {
|
|
1155
1194
|
const groupLayout = uischema;
|
|
@@ -1169,7 +1208,7 @@ const MaterialHorizontalLayoutRenderer = ({ uischema, renderers, cells, schema,
|
|
|
1169
1208
|
direction: 'row',
|
|
1170
1209
|
visible,
|
|
1171
1210
|
};
|
|
1172
|
-
return (React.createElement(MaterialLayoutRenderer,
|
|
1211
|
+
return (React.createElement(MaterialLayoutRenderer, { ...childProps, renderers: renderers, cells: cells }));
|
|
1173
1212
|
};
|
|
1174
1213
|
var MaterialHorizontalLayout = withJsonFormsLayoutProps(MaterialHorizontalLayoutRenderer);
|
|
1175
1214
|
|
|
@@ -1184,7 +1223,7 @@ const MaterialVerticalLayoutRenderer = ({ uischema, schema, path, enabled, visib
|
|
|
1184
1223
|
direction: 'column',
|
|
1185
1224
|
visible,
|
|
1186
1225
|
};
|
|
1187
|
-
return (React.createElement(MaterialLayoutRenderer,
|
|
1226
|
+
return (React.createElement(MaterialLayoutRenderer, { ...childProps, renderers: renderers, cells: cells }));
|
|
1188
1227
|
};
|
|
1189
1228
|
var MaterialVerticalLayout = withJsonFormsLayoutProps(MaterialVerticalLayoutRenderer);
|
|
1190
1229
|
|
|
@@ -1228,7 +1267,7 @@ const MaterialCategorizationLayoutRenderer = (props) => {
|
|
|
1228
1267
|
React.createElement(AppBar, { position: 'static' },
|
|
1229
1268
|
React.createElement(Tabs, { value: safeCategory, onChange: onTabChange, textColor: 'inherit', indicatorColor: 'secondary', variant: 'scrollable' }, categories.map((_, idx) => (React.createElement(Tab, { key: idx, label: tabLabels[idx] }))))),
|
|
1230
1269
|
React.createElement("div", { style: { marginTop: '0.5em' } },
|
|
1231
|
-
React.createElement(MaterialLayoutRenderer,
|
|
1270
|
+
React.createElement(MaterialLayoutRenderer, { ...childProps, key: safeCategory }))));
|
|
1232
1271
|
};
|
|
1233
1272
|
var MaterialCategorizationLayout = withAjvProps(withTranslateProps(withJsonFormsLayoutProps(MaterialCategorizationLayoutRenderer)));
|
|
1234
1273
|
|
|
@@ -1239,10 +1278,10 @@ const MaterialArrayLayoutComponent = (props) => {
|
|
|
1239
1278
|
setExpanded(expandedPanel ? panel : false);
|
|
1240
1279
|
}, []);
|
|
1241
1280
|
const isExpanded = (index) => expanded === composePaths(props.path, `${index}`);
|
|
1242
|
-
const { enabled, data, path, schema, uischema, errors, addItem, renderers, cells, label, required, rootSchema, config, uischemas, translations, } = props;
|
|
1281
|
+
const { enabled, data, path, schema, uischema, errors, addItem, renderers, cells, label, required, rootSchema, config, uischemas, translations, description, } = props;
|
|
1243
1282
|
const appliedUiSchemaOptions = merge({}, config, props.uischema.options);
|
|
1244
1283
|
return (React.createElement("div", null,
|
|
1245
|
-
React.createElement(ArrayLayoutToolbar, { translations: translations, label: computeLabel(label, required, appliedUiSchemaOptions.hideRequiredAsterisk), errors: errors, path: path, enabled: enabled, addItem: addItem, createDefault: innerCreateDefaultValue }),
|
|
1284
|
+
React.createElement(ArrayLayoutToolbar, { translations: translations, label: computeLabel(label, required, appliedUiSchemaOptions.hideRequiredAsterisk), description: description, errors: errors, path: path, enabled: enabled, addItem: addItem, createDefault: innerCreateDefaultValue }),
|
|
1246
1285
|
React.createElement("div", null, data > 0 ? (map(range(data), (index) => {
|
|
1247
1286
|
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 }));
|
|
1248
1287
|
})) : (React.createElement("p", null, "No data")))));
|
|
@@ -1252,19 +1291,19 @@ const MaterialArrayLayout$1 = React.memo(MaterialArrayLayoutComponent);
|
|
|
1252
1291
|
const MaterialArrayLayoutRenderer = ({ visible, addItem, ...props }) => {
|
|
1253
1292
|
const addItemCb = useCallback((p, value) => addItem(p, value), [addItem]);
|
|
1254
1293
|
return (React.createElement(Hidden, { xsUp: !visible },
|
|
1255
|
-
React.createElement(MaterialArrayLayout$1,
|
|
1294
|
+
React.createElement(MaterialArrayLayout$1, { visible: visible, addItem: addItemCb, ...props })));
|
|
1256
1295
|
};
|
|
1257
1296
|
const materialArrayLayoutTester = rankWith(4, isObjectArrayWithNesting);
|
|
1258
1297
|
var MaterialArrayLayout = withJsonFormsArrayLayoutProps(MaterialArrayLayoutRenderer);
|
|
1259
1298
|
|
|
1260
1299
|
const MaterialBooleanCell = (props) => {
|
|
1261
|
-
return React.createElement(MuiCheckbox,
|
|
1300
|
+
return React.createElement(MuiCheckbox, { ...props });
|
|
1262
1301
|
};
|
|
1263
1302
|
const materialBooleanCellTester = rankWith(2, isBooleanControl);
|
|
1264
1303
|
var MaterialBooleanCell$1 = withJsonFormsCellProps(MaterialBooleanCell);
|
|
1265
1304
|
|
|
1266
1305
|
const MaterialBooleanToggleCell = (props) => {
|
|
1267
|
-
return React.createElement(MuiToggle,
|
|
1306
|
+
return React.createElement(MuiToggle, { ...props });
|
|
1268
1307
|
};
|
|
1269
1308
|
const materialBooleanToggleCellTester = rankWith(3, and(isBooleanControl, optionIs('toggle', true)));
|
|
1270
1309
|
var MaterialBooleanToggleCell$1 = withJsonFormsCellProps(MaterialBooleanToggleCell);
|
|
@@ -1278,31 +1317,31 @@ const MaterialDateCell = (props) => {
|
|
|
1278
1317
|
const materialDateCellTester = rankWith(2, isDateControl);
|
|
1279
1318
|
var MaterialDateCell$1 = withJsonFormsCellProps(MaterialDateCell);
|
|
1280
1319
|
|
|
1281
|
-
const MaterialEnumCell = (props) => React.createElement(MuiSelect,
|
|
1320
|
+
const MaterialEnumCell = (props) => React.createElement(MuiSelect, { ...props });
|
|
1282
1321
|
const materialEnumCellTester = rankWith(2, isEnumControl);
|
|
1283
1322
|
var MaterialEnumCell$1 = withJsonFormsEnumCellProps(withTranslateProps(React.memo(MaterialEnumCell)), false);
|
|
1284
1323
|
|
|
1285
|
-
const MaterialIntegerCell = (props) => (React.createElement(MuiInputInteger,
|
|
1324
|
+
const MaterialIntegerCell = (props) => (React.createElement(MuiInputInteger, { ...props }));
|
|
1286
1325
|
const materialIntegerCellTester = rankWith(2, isIntegerControl);
|
|
1287
1326
|
var MaterialIntegerCell$1 = withJsonFormsCellProps(MaterialIntegerCell);
|
|
1288
1327
|
|
|
1289
|
-
const MaterialNumberCell = (props) => (React.createElement(MuiInputNumber,
|
|
1328
|
+
const MaterialNumberCell = (props) => (React.createElement(MuiInputNumber, { ...props }));
|
|
1290
1329
|
const materialNumberCellTester = rankWith(2, isNumberControl);
|
|
1291
1330
|
var MaterialNumberCell$1 = withJsonFormsCellProps(MaterialNumberCell);
|
|
1292
1331
|
|
|
1293
|
-
const MaterialNumberFormatCell = (props) => React.createElement(MuiInputNumberFormat,
|
|
1332
|
+
const MaterialNumberFormatCell = (props) => React.createElement(MuiInputNumberFormat, { ...props });
|
|
1294
1333
|
const materialNumberFormatCellTester = rankWith(4, isNumberFormatControl);
|
|
1295
1334
|
var MaterialNumberFormatCell$1 = withJsonFormsCellProps(MaterialNumberFormatCell);
|
|
1296
1335
|
|
|
1297
|
-
const MaterialOneOfEnumCell = (props) => React.createElement(MuiSelect,
|
|
1336
|
+
const MaterialOneOfEnumCell = (props) => React.createElement(MuiSelect, { ...props });
|
|
1298
1337
|
const materialOneOfEnumCellTester = rankWith(2, isOneOfEnumControl);
|
|
1299
1338
|
var MaterialOneOfEnumCell$1 = withJsonFormsOneOfEnumCellProps(withTranslateProps(React.memo(MaterialOneOfEnumCell)), false);
|
|
1300
1339
|
|
|
1301
|
-
const MaterialTextCell = (props) => (React.createElement(MuiInputText,
|
|
1340
|
+
const MaterialTextCell = (props) => (React.createElement(MuiInputText, { ...props }));
|
|
1302
1341
|
const materialTextCellTester = rankWith(1, isStringControl);
|
|
1303
1342
|
var MaterialTextCell$1 = withJsonFormsCellProps(MaterialTextCell);
|
|
1304
1343
|
|
|
1305
|
-
const MaterialTimeCell = (props) => (React.createElement(MuiInputTime,
|
|
1344
|
+
const MaterialTimeCell = (props) => (React.createElement(MuiInputTime, { ...props }));
|
|
1306
1345
|
const materialTimeCellTester = rankWith(2, isTimeControl);
|
|
1307
1346
|
var MaterialTimeCell$1 = withJsonFormsCellProps(MaterialTimeCell);
|
|
1308
1347
|
|
|
@@ -1356,7 +1395,7 @@ const MaterialCategorizationStepperLayoutRenderer = (props) => {
|
|
|
1356
1395
|
React.createElement(Stepper, { activeStep: activeCategory, nonLinear: true }, categories.map((_, idx) => (React.createElement(Step, { key: tabLabels[idx] },
|
|
1357
1396
|
React.createElement(StepButton, { onClick: () => handleStep(idx) }, tabLabels[idx]))))),
|
|
1358
1397
|
React.createElement("div", null,
|
|
1359
|
-
React.createElement(MaterialLayoutRenderer,
|
|
1398
|
+
React.createElement(MaterialLayoutRenderer, { ...childProps })),
|
|
1360
1399
|
appliedUiSchemaOptions.showNavButtons ? (React.createElement("div", { style: buttonWrapperStyle },
|
|
1361
1400
|
React.createElement(Button, { style: buttonNextStyle, variant: 'contained', color: 'primary', disabled: activeCategory >= categories.length - 1, onClick: () => handleStep(activeCategory + 1) }, "Next"),
|
|
1362
1401
|
React.createElement(Button, { style: buttonStyle, color: 'secondary', variant: 'contained', disabled: activeCategory <= 0, onClick: () => handleStep(activeCategory - 1) }, "Previous"))) : (React.createElement(React.Fragment, null))));
|
|
@@ -1487,5 +1526,5 @@ const Unwrapped = {
|
|
|
1487
1526
|
...UnwrappedLayouts,
|
|
1488
1527
|
};
|
|
1489
1528
|
|
|
1490
|
-
export { ArrayLayoutToolbar, CombinatorProperties, CustomizableCells as Customizable, DeleteDialog, ExpandPanelRenderer$1 as ExpandPanelRenderer, ListWithDetailMasterItem, MaterialAllOfRenderer$1 as MaterialAllOfRenderer, MaterialAnyOfRenderer$1 as MaterialAnyOfRenderer, MaterialAnyOfStringOrEnumControl$1 as MaterialAnyOfStringOrEnumControl, MaterialArrayControlRenderer$1 as MaterialArrayControlRenderer, MaterialArrayLayout, MaterialBooleanCell$1 as MaterialBooleanCell, MaterialBooleanControl$1 as MaterialBooleanControl, MaterialBooleanToggleCell$1 as MaterialBooleanToggleCell, MaterialBooleanToggleControl$1 as MaterialBooleanToggleControl, MaterialCategorizationLayout, MaterialDateCell$1 as MaterialDateCell, MaterialDateControl$1 as MaterialDateControl, MaterialDateTimeControl$1 as MaterialDateTimeControl, MaterialEnumArrayRenderer$1 as MaterialEnumArrayRenderer, MaterialEnumCell$1 as MaterialEnumCell, MaterialEnumControl$1 as MaterialEnumControl, MaterialGroupLayout, MaterialHorizontalLayout, MaterialInputControl, MaterialIntegerCell$1 as MaterialIntegerCell, MaterialIntegerControl$1 as MaterialIntegerControl, MaterialLabelRenderer$1 as MaterialLabelRenderer, MaterialLayoutRenderer, MaterialListWithDetailRenderer$1 as MaterialListWithDetailRenderer, MaterialNativeControl$1 as MaterialNativeControl, MaterialNumberCell$1 as MaterialNumberCell, MaterialNumberControl$1 as MaterialNumberControl, MaterialNumberFormatCell$1 as MaterialNumberFormatCell, MaterialObjectRenderer$1 as MaterialObjectRenderer, MaterialOneOfEnumCell$1 as MaterialOneOfEnumCell, MaterialOneOfEnumControl$1 as MaterialOneOfEnumControl, MaterialOneOfRadioGroupControl$1 as MaterialOneOfRadioGroupControl, MaterialOneOfRenderer$1 as MaterialOneOfRenderer, MaterialRadioGroupControl$1 as MaterialRadioGroupControl, MaterialSliderControl$1 as MaterialSliderControl, MaterialTableControl, MaterialTextCell$1 as MaterialTextCell, MaterialTextControl$1 as MaterialTextControl, MaterialTimeCell$1 as MaterialTimeCell, MaterialTimeControl$1 as MaterialTimeControl, MaterialVerticalLayout, MuiAutocomplete, MuiCheckbox, MuiInputInteger, MuiInputNumber, MuiInputNumberFormat, MuiInputText, MuiInputTime, MuiSelect, MuiToggle, NoBorderTableCell, NonEmptyRow, Unwrapped, createOnChangeHandler, ctxDispatchToExpandPanelProps, defaultInputVariant, getData, i18nDefaults, materialAllOfControlTester, materialAnyOfControlTester, materialAnyOfStringOrEnumControlTester, materialArrayControlTester, materialArrayLayoutTester, materialBooleanCellTester, materialBooleanControlTester, materialBooleanToggleCellTester, materialBooleanToggleControlTester, materialCategorizationTester, materialCells, materialDateCellTester, materialDateControlTester, materialDateTimeControlTester, materialEnumArrayRendererTester, materialEnumCellTester, materialEnumControlTester, materialGroupTester, materialHorizontalLayoutTester, materialIntegerCellTester, materialIntegerControlTester, materialLabelRendererTester, materialListWithDetailTester, materialNativeControlTester, materialNumberCellTester, materialNumberControlTester, materialNumberFormatCellTester, materialObjectControlTester, materialOneOfControlTester, materialOneOfEnumCellTester, materialOneOfEnumControlTester, materialOneOfRadioGroupControlTester, materialRadioGroupControlTester, materialRenderers, materialSliderControlTester, materialTextCellTester, materialTextControlTester, materialTimeCellTester, materialTimeControlTester, materialVerticalLayoutTester, renderLayoutElements, useDebouncedChange, useFocus, useInputComponent, useInputVariant, withAjvProps, withContextToExpandPanelProps, withJsonFormsExpandPanelProps };
|
|
1529
|
+
export { ArrayLayoutToolbar, CombinatorProperties, CustomizableCells as Customizable, DeleteDialog, ExpandPanelRenderer$1 as ExpandPanelRenderer, ListWithDetailMasterItem, MaterialAllOfRenderer$1 as MaterialAllOfRenderer, MaterialAnyOfRenderer$1 as MaterialAnyOfRenderer, MaterialAnyOfStringOrEnumControl$1 as MaterialAnyOfStringOrEnumControl, MaterialArrayControlRenderer$1 as MaterialArrayControlRenderer, MaterialArrayLayout, MaterialBooleanCell$1 as MaterialBooleanCell, MaterialBooleanControl$1 as MaterialBooleanControl, MaterialBooleanToggleCell$1 as MaterialBooleanToggleCell, MaterialBooleanToggleControl$1 as MaterialBooleanToggleControl, MaterialCategorizationLayout, MaterialDateCell$1 as MaterialDateCell, MaterialDateControl$1 as MaterialDateControl, MaterialDateTimeControl$1 as MaterialDateTimeControl, MaterialEnumArrayRenderer$1 as MaterialEnumArrayRenderer, MaterialEnumCell$1 as MaterialEnumCell, MaterialEnumControl$1 as MaterialEnumControl, MaterialGroupLayout, MaterialHorizontalLayout, MaterialInputControl, MaterialIntegerCell$1 as MaterialIntegerCell, MaterialIntegerControl$1 as MaterialIntegerControl, MaterialLabelRenderer$1 as MaterialLabelRenderer, MaterialLayoutRenderer, MaterialListWithDetailRenderer$1 as MaterialListWithDetailRenderer, MaterialNativeControl$1 as MaterialNativeControl, MaterialNumberCell$1 as MaterialNumberCell, MaterialNumberControl$1 as MaterialNumberControl, MaterialNumberFormatCell$1 as MaterialNumberFormatCell, MaterialObjectRenderer$1 as MaterialObjectRenderer, MaterialOneOfEnumCell$1 as MaterialOneOfEnumCell, MaterialOneOfEnumControl$1 as MaterialOneOfEnumControl, MaterialOneOfRadioGroupControl$1 as MaterialOneOfRadioGroupControl, MaterialOneOfRenderer$1 as MaterialOneOfRenderer, MaterialRadioGroupControl$1 as MaterialRadioGroupControl, MaterialSliderControl$1 as MaterialSliderControl, MaterialTableControl, MaterialTextCell$1 as MaterialTextCell, MaterialTextControl$1 as MaterialTextControl, MaterialTimeCell$1 as MaterialTimeCell, MaterialTimeControl$1 as MaterialTimeControl, MaterialVerticalLayout, MuiAutocomplete, MuiCheckbox, MuiInputInteger, MuiInputNumber, MuiInputNumberFormat, MuiInputText, MuiInputTime, MuiSelect, MuiToggle, NoBorderTableCell, NonEmptyRow, Unwrapped, createOnBlurHandler, createOnChangeHandler, ctxDispatchToExpandPanelProps, defaultInputVariant, formatDate, getData, i18nDefaults, materialAllOfControlTester, materialAnyOfControlTester, materialAnyOfStringOrEnumControlTester, materialArrayControlTester, materialArrayLayoutTester, materialBooleanCellTester, materialBooleanControlTester, materialBooleanToggleCellTester, materialBooleanToggleControlTester, materialCategorizationTester, materialCells, materialDateCellTester, materialDateControlTester, materialDateTimeControlTester, materialEnumArrayRendererTester, materialEnumCellTester, materialEnumControlTester, materialGroupTester, materialHorizontalLayoutTester, materialIntegerCellTester, materialIntegerControlTester, materialLabelRendererTester, materialListWithDetailTester, materialNativeControlTester, materialNumberCellTester, materialNumberControlTester, materialNumberFormatCellTester, materialObjectControlTester, materialOneOfControlTester, materialOneOfEnumCellTester, materialOneOfEnumControlTester, materialOneOfRadioGroupControlTester, materialRadioGroupControlTester, materialRenderers, materialSliderControlTester, materialTextCellTester, materialTextControlTester, materialTimeCellTester, materialTimeControlTester, materialVerticalLayoutTester, renderLayoutElements, useDebouncedChange, useFocus, useInputComponent, useInputVariant, withAjvProps, withContextToExpandPanelProps, withJsonFormsExpandPanelProps };
|
|
1491
1530
|
//# sourceMappingURL=jsonforms-react-material.esm.js.map
|