Skip to content

Commit 3d632b7

Browse files
committed
Merge branch 'master' into mixed-support
2 parents d05642a + 5218263 commit 3d632b7

File tree

24 files changed

+12961
-4564
lines changed

24 files changed

+12961
-4564
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18.19.0
1+
22

LICENSE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2019 EclipseSource Munich
4-
https://github.com/eclipsesource/jsonforms
3+
Copyright (c) 2019 EclipseSource GmbH
54

65
Permission is hereby granted, free of charge, to any person obtaining a copy
76
of this software and associated documentation files (the "Software"), to deal

MIGRATION.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Migration guide
22

3+
## Migrating to JSON Forms 3.6
4+
5+
### UI schema type changes
6+
7+
The `UISchemaElement` type was renamed to `BaseUISchemaElement` and a new `UISchemaElement` type was introduced, which is a union of all available UI schema types.
8+
9+
The `Condition` type was renamed to `BaseCondition` and a new `Condition` type was introduced, which is a union of all available condition types.
10+
11+
Both unions include their respective base type for backwards compatibility, but if you run into errors, replace `UISchemaElement` with `BaseUISchemaElement`/`Condition` with `BaseCondition` in your code to restore the old behaviour.
12+
313
## Migrating to JSON Forms 3.5
414

515
### Angular support now targets Angular 18 and Angular 19

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "3.5.1",
2+
"version": "3.6.0-alpha.0",
33
"npmClient": "pnpm",
44
"useWorkspaces": true
55
}

packages/angular-material/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jsonforms/angular-material",
3-
"version": "3.5.1",
3+
"version": "3.6.0-alpha.0",
44
"description": "Material Renderer Set for Angular module of JSON Forms",
55
"repository": "https://github.com/eclipsesource/jsonforms",
66
"bugs": "https://github.com/eclipsesource/jsonforms/issues",
@@ -68,8 +68,8 @@
6868
"@angular/material": "^18.0.0 || ^19.0.0",
6969
"@angular/platform-browser": "^18.0.0 || ^19.0.0",
7070
"@angular/router": "^18.0.0 || ^19.0.0",
71-
"@jsonforms/angular": "3.5.1",
72-
"@jsonforms/core": "3.5.1",
71+
"@jsonforms/angular": "3.6.0-alpha.0",
72+
"@jsonforms/core": "3.6.0-alpha.0",
7373
"dayjs": "^1.11.10",
7474
"rxjs": "^6.6.0 || ^7.4.0"
7575
},

packages/angular/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jsonforms/angular",
3-
"version": "3.5.1",
3+
"version": "3.6.0-alpha.0",
44
"description": "Angular module of JSON Forms",
55
"repository": "https://github.com/eclipsesource/jsonforms",
66
"bugs": "https://github.com/eclipsesource/jsonforms/issues",
@@ -69,7 +69,7 @@
6969
"peerDependencies": {
7070
"@angular/core": "^18.0.0 || ^19.0.0",
7171
"@angular/forms": "^18.0.0 || ^19.0.0",
72-
"@jsonforms/core": "3.5.1",
72+
"@jsonforms/core": "3.6.0-alpha.0",
7373
"rxjs": "^6.6.0 || ^7.4.0"
7474
},
7575
"devDependencies": {

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jsonforms/core",
3-
"version": "3.5.1",
3+
"version": "3.6.0-alpha.0",
44
"description": "Core module of JSON Forms",
55
"repository": "https://github.com/eclipsesource/jsonforms",
66
"bugs": "https://github.com/eclipsesource/jsonforms/issues",

packages/core/src/models/uischema.ts

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/*
22
The MIT License
3-
3+
44
Copyright (c) 2017-2019 EclipseSource Munich
55
https://github.com/eclipsesource/jsonforms
6-
6+
77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal
99
in the Software without restriction, including without limitation the rights
1010
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1111
copies of the Software, and to permit persons to whom the Software is
1212
furnished to do so, subject to the following conditions:
13-
13+
1414
The above copyright notice and this permission notice shall be included in
1515
all copies or substantial portions of the Software.
16-
16+
1717
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1818
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1919
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -114,7 +114,7 @@ export enum RuleEffect {
114114
/**
115115
* Represents a condition to be evaluated.
116116
*/
117-
export interface Condition {
117+
export interface BaseCondition {
118118
/**
119119
* The type of condition.
120120
*/
@@ -124,7 +124,7 @@ export interface Condition {
124124
/**
125125
* A leaf condition.
126126
*/
127-
export interface LeafCondition extends Condition, Scoped {
127+
export interface LeafCondition extends BaseCondition, Scoped {
128128
type: 'LEAF';
129129

130130
/**
@@ -133,7 +133,7 @@ export interface LeafCondition extends Condition, Scoped {
133133
expectedValue: any;
134134
}
135135

136-
export interface SchemaBasedCondition extends Condition, Scoped {
136+
export interface SchemaBasedCondition extends BaseCondition, Scoped {
137137
schema: JsonSchema;
138138

139139
/**
@@ -153,7 +153,7 @@ export interface SchemaBasedCondition extends Condition, Scoped {
153153
/**
154154
* A composable condition.
155155
*/
156-
export interface ComposableCondition extends Condition {
156+
export interface ComposableCondition extends BaseCondition {
157157
conditions: Condition[];
158158
}
159159

@@ -171,10 +171,20 @@ export interface AndCondition extends ComposableCondition {
171171
type: 'AND';
172172
}
173173

174+
/**
175+
* A union of all available conditions.
176+
*/
177+
export type Condition =
178+
| BaseCondition
179+
| LeafCondition
180+
| OrCondition
181+
| AndCondition
182+
| SchemaBasedCondition;
183+
174184
/**
175185
* Common base interface for any UI schema element.
176186
*/
177-
export interface UISchemaElement {
187+
export interface BaseUISchemaElement {
178188
/**
179189
* The type of this UI schema element.
180190
*/
@@ -195,7 +205,7 @@ export interface UISchemaElement {
195205
* Represents a layout element which can order its children
196206
* in a specific way.
197207
*/
198-
export interface Layout extends UISchemaElement {
208+
export interface Layout extends BaseUISchemaElement {
199209
/**
200210
* The child elements of this layout.
201211
*/
@@ -241,7 +251,7 @@ export interface LabelDescription {
241251
/**
242252
* A label element.
243253
*/
244-
export interface LabelElement extends UISchemaElement, Internationalizable {
254+
export interface LabelElement extends BaseUISchemaElement, Internationalizable {
245255
type: 'Label';
246256
/**
247257
* The text of label.
@@ -254,7 +264,7 @@ export interface LabelElement extends UISchemaElement, Internationalizable {
254264
* to which part of the schema the control should be bound.
255265
*/
256266
export interface ControlElement
257-
extends UISchemaElement,
267+
extends BaseUISchemaElement,
258268
Scoped,
259269
Labelable<string | boolean | LabelDescription>,
260270
Internationalizable {
@@ -274,7 +284,7 @@ export interface Category extends Layout, Labeled, Internationalizable {
274284
* the categorization element can be used to represent recursive structures like trees.
275285
*/
276286
export interface Categorization
277-
extends UISchemaElement,
287+
extends BaseUISchemaElement,
278288
Labeled,
279289
Internationalizable {
280290
type: 'Categorization';
@@ -284,3 +294,19 @@ export interface Categorization
284294
*/
285295
elements: (Category | Categorization)[];
286296
}
297+
298+
/**
299+
* A union of all available UI schema elements.
300+
* This includes all layout elements, control elements, label elements,
301+
* group elements, category elements and categorization elements.
302+
*/
303+
export type UISchemaElement =
304+
| BaseUISchemaElement
305+
| ControlElement
306+
| Layout
307+
| LabelElement
308+
| GroupLayout
309+
| Category
310+
| Categorization
311+
| VerticalLayout
312+
| HorizontalLayout;

packages/examples-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jsonforms/examples-app",
3-
"version": "3.5.1",
3+
"version": "3.6.0-alpha.0",
44
"private": true,
55
"license": "MIT",
66
"type": "module",

packages/examples-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jsonforms/examples-react",
3-
"version": "3.5.1",
3+
"version": "3.6.0-alpha.0",
44
"private": true,
55
"dependencies": {
66
"@jsonforms/core": "workspace:*",

packages/examples/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jsonforms/examples",
3-
"version": "3.5.1",
3+
"version": "3.6.0-alpha.0",
44
"description": "JSON Forms Example Data",
55
"repository": "https://github.com/eclipsesource/jsonforms",
66
"bugs": "https://github.com/eclipsesource/jsonforms/issues",
@@ -47,7 +47,7 @@
4747
"lodash": "^4.17.21"
4848
},
4949
"peerDependencies": {
50-
"@jsonforms/core": "3.5.1"
50+
"@jsonforms/core": "3.6.0-alpha.0"
5151
},
5252
"devDependencies": {
5353
"@jsonforms/core": "workspace:*",

packages/material-renderers/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jsonforms/material-renderers",
3-
"version": "3.5.1",
3+
"version": "3.6.0-alpha.0",
44
"description": "Material Renderer Set for JSON Forms",
55
"repository": "https://github.com/eclipsesource/jsonforms",
66
"bugs": "https://github.com/eclipsesource/jsonforms/issues",
@@ -86,8 +86,8 @@
8686
"peerDependencies": {
8787
"@emotion/react": "^11.4.1",
8888
"@emotion/styled": "^11.3.0",
89-
"@jsonforms/core": "3.5.1",
90-
"@jsonforms/react": "3.5.1",
89+
"@jsonforms/core": "3.6.0-alpha.0",
90+
"@jsonforms/react": "3.6.0-alpha.0",
9191
"@mui/icons-material": "^5.11.16 || ^6.0.0",
9292
"@mui/material": "^5.13.0 || ^6.0.0",
9393
"@mui/x-date-pickers": "^6.0.0 || ^7.0.0",

packages/material-renderers/src/additional/ListWithDetailMasterItem.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { withJsonFormsMasterListItemProps } from '@jsonforms/react';
2727
import {
2828
Avatar,
2929
IconButton,
30-
ListItem,
30+
ListItemButton,
3131
ListItemAvatar,
3232
ListItemSecondaryAction,
3333
ListItemText,
@@ -48,7 +48,7 @@ export const ListWithDetailMasterItem = ({
4848
disableRemove,
4949
}: StatePropsOfMasterItem) => {
5050
return (
51-
<ListItem button selected={selected} onClick={handleSelect(index)}>
51+
<ListItemButton selected={selected} onClick={handleSelect(index)}>
5252
<ListItemAvatar>
5353
<Avatar aria-label='Index'>{index + 1}</Avatar>
5454
</ListItemAvatar>
@@ -70,7 +70,7 @@ export const ListWithDetailMasterItem = ({
7070
</Tooltip>
7171
</ListItemSecondaryAction>
7272
)}
73-
</ListItem>
73+
</ListItemButton>
7474
);
7575
};
7676

packages/material-renderers/src/mui-controls/MuiInputInteger.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const MuiInputInteger = React.memo(function MuiInputInteger(
4040
id,
4141
enabled,
4242
uischema,
43+
isValid,
4344
path,
4445
handleChange,
4546
config,
@@ -70,6 +71,7 @@ export const MuiInputInteger = React.memo(function MuiInputInteger(
7071
autoFocus={appliedUiSchemaOptions.focus}
7172
inputProps={inputProps}
7273
fullWidth={true}
74+
error={!isValid}
7375
/>
7476
);
7577
});

packages/material-renderers/src/mui-controls/MuiInputNumber.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export const MuiInputNumber = React.memo(function MuiInputNumber(
3939
id,
4040
enabled,
4141
uischema,
42+
isValid,
4243
path,
4344
handleChange,
4445
config,
@@ -68,6 +69,7 @@ export const MuiInputNumber = React.memo(function MuiInputNumber(
6869
autoFocus={appliedUiSchemaOptions.focus}
6970
inputProps={inputProps}
7071
fullWidth={true}
72+
error={!isValid}
7173
/>
7274
);
7375
});

packages/material-renderers/src/mui-controls/MuiInputTime.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const MuiInputTime = React.memo(function MuiInputTime(
3636
id,
3737
enabled,
3838
uischema,
39+
isValid,
3940
path,
4041
handleChange,
4142
config,
@@ -61,6 +62,7 @@ export const MuiInputTime = React.memo(function MuiInputTime(
6162
disabled={!enabled}
6263
autoFocus={appliedUiSchemaOptions.focus}
6364
fullWidth={true}
65+
error={!isValid}
6466
/>
6567
);
6668
});

packages/material-renderers/src/mui-controls/MuiSelect.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export const MuiSelect = React.memo(function MuiSelect(
4444
enabled,
4545
schema,
4646
uischema,
47+
isValid,
4748
path,
4849
handleChange,
4950
options,
@@ -69,6 +70,7 @@ export const MuiSelect = React.memo(function MuiSelect(
6970
onChange={(ev) => handleChange(path, ev.target.value || undefined)}
7071
fullWidth={true}
7172
multiple={multiple || false}
73+
error={!isValid}
7274
>
7375
{[
7476
<MenuItem value={''} key='jsonforms.enum.none'>

0 commit comments

Comments
 (0)