Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/examples-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@jsonforms/core": "workspace:*",
"@jsonforms/examples": "workspace:*",
"@jsonforms/react": "workspace:*",
"@mui/material": "^7.3.0",
"@mui/material": "^9.0.0",
"@types/react-highlight": "^0.12.5",
"@types/react-tabs": "^2.3.3",
"highlight.js": "^11.3.1",
Expand Down
3 changes: 1 addition & 2 deletions packages/material-renderers/example/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ import {
SelectChangeEvent,
Stack,
TextFieldProps,
ThemeProvider,
createTheme,
} from '@mui/material';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import { renderExample } from '../../examples-react/src/index';
import { materialRenderers, materialCells } from '../src';

Expand Down
34 changes: 17 additions & 17 deletions packages/material-renderers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@
"js"
],
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
"tsconfig": "tsconfig.test.json"
}
]
},
"testEnvironment": "jsdom",
"testMatch": [
Expand All @@ -72,12 +77,7 @@
"testPathIgnorePatterns": [
"/node_modules/",
"/dist/"
],
"globals": {
"ts-jest": {
"tsconfig": "tsconfig.test.json"
}
}
]
},
"nyc": {
"reporter": [
Expand All @@ -91,23 +91,23 @@
"lodash": "^4.17.21"
},
"peerDependencies": {
"@emotion/react": "^11.5.0",
"@emotion/styled": "^11.3.0",
"@emotion/react": "^11.5.0 || ^12.0.0",
"@emotion/styled": "^11.3.0 || ^12.0.0",
"@jsonforms/core": "3.8.0-alpha.2",
"@jsonforms/react": "3.8.0-alpha.2",
"@mui/icons-material": "^7.0.0",
"@mui/material": "^7.0.0",
"@mui/x-date-pickers": "^8.0.0",
"@mui/icons-material": "^9.0.0",
"@mui/material": "^9.0.0",
"@mui/x-date-pickers": "^9.0.0",
"react": "^16.12.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
},
"devDependencies": {
"@emotion/react": "^11.5.0",
"@emotion/styled": "^11.3.0",
"@emotion/react": "^11.5.0 || ^12.0.0",
"@emotion/styled": "^11.3.0 || ^12.0.0",
"@jsonforms/core": "workspace:*",
"@jsonforms/react": "workspace:*",
"@mui/icons-material": "^7.3.0",
"@mui/material": "^7.3.0",
"@mui/x-date-pickers": "^8.11.3",
"@mui/icons-material": "^9.0.1",
"@mui/material": "^9.0.1",
"@mui/x-date-pickers": "^9.3.0",
"@rollup/plugin-commonjs": "^23.0.3",
"@rollup/plugin-json": "^5.0.2",
"@rollup/plugin-node-resolve": "^15.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ import { withJsonFormsMasterListItemProps } from '@jsonforms/react';
import {
Avatar,
IconButton,
ListItemButton,
ListItemAvatar,
ListItemSecondaryAction,
ListItemButton,
ListItemText,
Tooltip,
} from '@mui/material';
Expand All @@ -54,21 +53,20 @@ export const ListWithDetailMasterItem = ({
</ListItemAvatar>
<ListItemText primary={childLabel} />
{enabled && !disableRemove && (
<ListItemSecondaryAction>
<IconButton
aria-label={translations.removeAriaLabel}
onClick={removeItem(path, index)}
size='large'
sx={{ marginLeft: 'auto' }}
>
<Tooltip
id='tooltip-remove'
title={translations.removeTooltip}
placement='bottom'
>
<IconButton
aria-label={translations.removeAriaLabel}
onClick={removeItem(path, index)}
size='large'
>
<Delete />
</IconButton>
<Delete />
</Tooltip>
</ListItemSecondaryAction>
</IconButton>
)}
</ListItemButton>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,11 @@ const NonEmptyRowComponent = ({
>
<Grid
container
direction='row'
justifyContent='flex-end'
alignItems='center'
sx={{
alignItems: 'center',
direction: 'row',
justifyContent: 'flex-end',
}}
>
{showSortButtons ? (
<Fragment>
Expand Down
11 changes: 6 additions & 5 deletions packages/material-renderers/src/complex/NoBorderTableCell.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*
The MIT License

Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand All @@ -22,7 +22,8 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
import { styled, TableCell } from '@mui/material';
import { styled } from '@mui/material/styles';
import { TableCell } from '@mui/material';
import React from 'react';

const StyledTableCell = styled(TableCell)({
Expand Down
8 changes: 5 additions & 3 deletions packages/material-renderers/src/complex/TableToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ const TableToolbar = React.memo(function TableToolbar({
<Stack>
<Grid
container
justifyContent={'flex-start'}
alignItems={'center'}
spacing={2}
sx={{
alignItems: 'center',
justifyContent: 'flex-start',
spacing: 2,
}}
>
<Grid>
<Typography variant={'h6'}>{label}</Typography>
Expand Down
7 changes: 4 additions & 3 deletions packages/material-renderers/src/complex/ValidationIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
*/
import React from 'react';

import { ErrorOutline } from '@mui/icons-material';
import { Badge, Tooltip, styled } from '@mui/material';
import { ErrorOutlined } from '@mui/icons-material';
import { Badge, Tooltip } from '@mui/material';
import { styled } from '@mui/material/styles';

const StyledBadge = styled(Badge)(({ theme }: any) => ({
color: theme.palette.error.main,
Expand All @@ -40,7 +41,7 @@ const ValidationIcon: React.FC<ValidationProps> = ({ errorMessages, id }) => {
return (
<Tooltip id={id} title={errorMessages}>
<StyledBadge badgeContent={errorMessages.split('\n').length}>
<ErrorOutline color='inherit' />
<ErrorOutlined color='inherit' />
</StyledBadge>
</Tooltip>
);
Expand Down
14 changes: 8 additions & 6 deletions packages/material-renderers/src/controls/MaterialDateControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,15 @@ export const MaterialDateControl = (props: ControlProps) => {
error: !isValid,
fullWidth: !appliedUiSchemaOptions.trim,
variant: inputVariant,
inputProps: {
autoFocus: appliedUiSchemaOptions.focus,
type: 'text',
onFocus: onFocus,
onBlur: onBlurHandler,
slotProps: {
htmlInput: {
autoFocus: appliedUiSchemaOptions.focus,
type: 'text',
onFocus,
onBlur: onBlurHandler,
},
inputLabel: data ? { shrink: true } : undefined,
},
InputLabelProps: data ? { shrink: true } : undefined,
},
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,15 @@ export const MaterialDateTimeControl = (props: ControlProps) => {
error: !isValid,
fullWidth: !appliedUiSchemaOptions.trim,
variant: inputVariant,
inputProps: {
autoFocus: appliedUiSchemaOptions.focus,
type: 'text',
onFocus: onFocus,
onBlur: onBlurHandler,
slotProps: {
htmlInput: {
autoFocus: appliedUiSchemaOptions.focus,
type: 'text',
onFocus,
onBlur: onBlurHandler,
},
inputLabel: data ? { shrink: true } : undefined,
},
InputLabelProps: data ? { shrink: true } : undefined,
},
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ export const MaterialNativeControl = (props: ControlProps) => {
onFocus={onFocus}
onBlur={onBlur}
helperText={!isValid ? errors : showDescription ? description : null}
InputLabelProps={{ shrink: true }}
slotProps={{
inputLabel: { shrink: true },
}}
value={inputValue}
onChange={onChange}
/>
Expand Down
14 changes: 8 additions & 6 deletions packages/material-renderers/src/controls/MaterialTimeControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,15 @@ export const MaterialTimeControl = (props: ControlProps) => {
error: !isValid,
fullWidth: !appliedUiSchemaOptions.trim,
variant: inputVariant,
inputProps: {
autoFocus: appliedUiSchemaOptions.focus,
type: 'text',
onBlur: onBlurHandler,
onFocus: onFocus,
slotProps: {
htmlInput: {
autoFocus: appliedUiSchemaOptions.focus,
type: 'text',
onBlur: onBlurHandler,
onFocus: onFocus,
},
inputLabel: data ? { shrink: true } : undefined,
},
InputLabelProps: data ? { shrink: true } : undefined,
},
}}
/>
Expand Down
18 changes: 13 additions & 5 deletions packages/material-renderers/src/layouts/ArrayToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,22 @@ export const ArrayLayoutToolbar = React.memo(function ArrayLayoutToolbar({
}: ArrayLayoutToolbarProps) {
return (
<Toolbar disableGutters={true}>
<Stack width='100%'>
<Grid container alignItems='center' justifyContent='space-between'>
<Stack sx={{ width: '100%' }}>
<Grid
container
sx={{
alignItems: 'center',
justifyContent: 'space-between',
}}
>
<Grid>
<Grid
container
justifyContent={'flex-start'}
alignItems={'center'}
spacing={2}
sx={{
alignItems: 'center',
justifyContent: 'flex-start',
spacing: 2,
}}
>
<Grid>
<Typography variant={'h6'}>{label}</Typography>
Expand Down
27 changes: 21 additions & 6 deletions packages/material-renderers/src/layouts/ExpandPanelRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,14 @@ const ExpandPanelRendererComponent = (props: ExpandPanelProps) => {
onChange={handleExpansion(childPath)}
>
<AccordionSummary expandIcon={<ExpandMore />}>
<Grid container sx={{ width: '100%' }} alignItems={'center'}>
<Grid container sx={{ width: '100%', alignItems: 'center' }}>
<Grid size={{ xs: 7, md: 9 }}>
<Grid container alignItems={'center'}>
<Grid
container
sx={{
alignItems: 'center',
}}
>
<Grid size={{ xs: 2, md: 1 }}>
<Avatar aria-label='Index'>{index + 1}</Avatar>
</Grid>
Expand All @@ -160,13 +165,20 @@ const ExpandPanelRendererComponent = (props: ExpandPanelProps) => {
</Grid>
</Grid>
<Grid size={{ xs: 5, md: 3 }}>
<Grid container justifyContent='flex-end'>
<Grid
container
sx={{
justifyContent: 'flex-end',
}}
>
<Grid>
<Grid
container
direction='row'
justifyContent='center'
alignItems='center'
sx={{
direction: 'row',
justifyContent: 'center',
alignItems: 'center',
}}
>
{showSortButtons && enabled ? (
<Fragment>
Expand All @@ -178,6 +190,7 @@ const ExpandPanelRendererComponent = (props: ExpandPanelProps) => {
open={enableMoveUp ? undefined : false}
>
<IconButton
component='div'
onClick={moveUp(path, index)}
style={iconStyle}
disabled={!enableMoveUp}
Expand All @@ -196,6 +209,7 @@ const ExpandPanelRendererComponent = (props: ExpandPanelProps) => {
open={enableMoveDown ? undefined : false}
>
<IconButton
component='div'
onClick={moveDown(path, index)}
style={iconStyle}
disabled={!enableMoveDown}
Expand All @@ -218,6 +232,7 @@ const ExpandPanelRendererComponent = (props: ExpandPanelProps) => {
placement='bottom'
>
<IconButton
component='div'
onClick={removeItems(path, [index])}
style={iconStyle}
aria-label={translations.removeAriaLabel}
Expand Down
Loading