Skip to content

Commit 893ed1d

Browse files
authored
Merge branch 'eclipsesource:master' into allow-random-fields-in-schema
2 parents e0fa1c8 + 3861749 commit 893ed1d

File tree

25 files changed

+193
-76
lines changed

25 files changed

+193
-76
lines changed

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"packages/vue/*",
55
"packages/vue2/*"
66
],
7-
"version": "3.1.0-alpha.0",
7+
"version": "3.1.0-alpha.1",
88
"nohoist": [
99
"core-js",
1010
"vue",

packages/angular-material/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/angular-material/package.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jsonforms/angular-material",
3-
"version": "3.1.0-alpha.0",
3+
"version": "3.1.0-alpha.1",
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",
@@ -13,6 +13,10 @@
1313
"src": "src",
1414
"test": "test"
1515
},
16+
"files": [
17+
"lib",
18+
"src"
19+
],
1620
"keywords": [
1721
"angular",
1822
"material",
@@ -64,8 +68,8 @@
6468
"@angular/material": "^12.0.0 || ^13.0.0 || ^14.0.0",
6569
"@angular/platform-browser": "^12.0.0 || ^13.0.0 || ^14.0.0",
6670
"@angular/router": "^12.0.0 || ^13.0.0 || ^14.0.0",
67-
"@jsonforms/angular": "3.1.0-alpha.0",
68-
"@jsonforms/core": "3.1.0-alpha.0",
71+
"@jsonforms/angular": "3.1.0-alpha.1",
72+
"@jsonforms/core": "3.1.0-alpha.1",
6973
"core-js": "^2.5.3",
7074
"rxjs": "^6.5.3 || ^7.4.0"
7175
},
@@ -85,10 +89,10 @@
8589
"@angular/platform-browser": "^12.0.0",
8690
"@angular/platform-browser-dynamic": "^12.0.0",
8791
"@angular/router": "^12.0.0",
88-
"@jsonforms/angular": "^3.1.0-alpha.0",
89-
"@jsonforms/angular-test": "^3.1.0-alpha.0",
90-
"@jsonforms/core": "^3.1.0-alpha.0",
91-
"@jsonforms/examples": "^3.1.0-alpha.0",
92+
"@jsonforms/angular": "^3.1.0-alpha.1",
93+
"@jsonforms/angular-test": "^3.1.0-alpha.1",
94+
"@jsonforms/core": "^3.1.0-alpha.1",
95+
"@jsonforms/examples": "^3.1.0-alpha.1",
9296
"@rollup/plugin-commonjs": "^23.0.3",
9397
"@rollup/plugin-json": "^5.0.2",
9498
"@rollup/plugin-node-resolve": "^15.0.1",

packages/angular-test/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "@jsonforms/angular-test",
3-
"version": "3.1.0-alpha.0",
3+
"version": "3.1.0-alpha.1",
44
"private": true,
55
"main": "./lib/index.js",
66
"dependencies": {
7-
"@jsonforms/angular": "^3.1.0-alpha.0",
8-
"@jsonforms/core": "^3.1.0-alpha.0"
7+
"@jsonforms/angular": "^3.1.0-alpha.1",
8+
"@jsonforms/core": "^3.1.0-alpha.1"
99
},
1010
"devDependencies": {
1111
"jasmine": "^3.2.0",

packages/angular/package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jsonforms/angular",
3-
"version": "3.1.0-alpha.0",
3+
"version": "3.1.0-alpha.1",
44
"description": "Angular module of JSON Forms",
55
"repository": "https://github.com/eclipsesource/jsonforms",
66
"bugs": "https://github.com/eclipsesource/jsonforms/issues",
@@ -13,6 +13,10 @@
1313
"src": "src",
1414
"test": "test"
1515
},
16+
"files": [
17+
"lib",
18+
"src"
19+
],
1620
"keywords": [
1721
"angular",
1822
"form",
@@ -63,15 +67,15 @@
6367
"peerDependencies": {
6468
"@angular/core": "^12.0.0 || ^13.0.0 || ^14.0.0",
6569
"@angular/forms": "^12.0.0 || ^13.0.0 || ^14.0.0",
66-
"@jsonforms/core": "3.1.0-alpha.0",
70+
"@jsonforms/core": "3.1.0-alpha.1",
6771
"rxjs": "^6.5.3 || ^7.4.0"
6872
},
6973
"devDependencies": {
7074
"@angular/compiler": "^12.0.0",
7175
"@angular/compiler-cli": "^12.0.0",
7276
"@angular/core": "^12.0.0",
7377
"@angular/forms": "^12.0.0",
74-
"@jsonforms/core": "^3.1.0-alpha.0",
78+
"@jsonforms/core": "^3.1.0-alpha.1",
7579
"ava": "~2.4.0",
7680
"copy-webpack-plugin": "^5.0.5",
7781
"cross-env": "^7.0.2",

packages/core/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jsonforms/core",
3-
"version": "3.1.0-alpha.0",
3+
"version": "3.1.0-alpha.1",
44
"description": "Core module of JSON Forms",
55
"repository": "https://github.com/eclipsesource/jsonforms",
66
"bugs": "https://github.com/eclipsesource/jsonforms/issues",
@@ -13,6 +13,10 @@
1313
"src": "src",
1414
"test": "test"
1515
},
16+
"files": [
17+
"lib",
18+
"src"
19+
],
1620
"keywords": [
1721
"form",
1822
"forms",

packages/examples-app/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
22
"name": "@jsonforms/examples-app",
3-
"version": "3.1.0-alpha.0",
3+
"version": "3.1.0-alpha.1",
44
"private": true,
55
"license": "MIT",
66
"type": "module",
7-
"scripts": {
8-
},
7+
"scripts": {},
98
"devDependencies": {
109
"@types/fs-extra": "^9.0.13",
1110
"fs-extra": "^11.1.0"

packages/examples-react/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "@jsonforms/examples-react",
3-
"version": "3.1.0-alpha.0",
3+
"version": "3.1.0-alpha.1",
44
"private": true,
55
"dependencies": {
6-
"@jsonforms/core": "^3.1.0-alpha.0",
7-
"@jsonforms/examples": "^3.1.0-alpha.0",
8-
"@jsonforms/react": "^3.1.0-alpha.0",
6+
"@jsonforms/core": "^3.1.0-alpha.1",
7+
"@jsonforms/examples": "^3.1.0-alpha.1",
8+
"@jsonforms/react": "^3.1.0-alpha.1",
99
"@mui/material": "~5.2.2",
1010
"@types/react-highlight": "^0.12.5",
1111
"@types/react-tabs": "^2.3.3",

packages/examples/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jsonforms/examples",
3-
"version": "3.1.0-alpha.0",
3+
"version": "3.1.0-alpha.1",
44
"description": "JSON Forms Example Data",
55
"repository": "https://github.com/eclipsesource/jsonforms",
66
"bugs": "https://github.com/eclipsesource/jsonforms/issues",
@@ -45,10 +45,10 @@
4545
"ajv-i18n": "^3.5.0"
4646
},
4747
"peerDependencies": {
48-
"@jsonforms/core": "3.1.0-alpha.0"
48+
"@jsonforms/core": "3.1.0-alpha.1"
4949
},
5050
"devDependencies": {
51-
"@jsonforms/core": "^3.1.0-alpha.0",
51+
"@jsonforms/core": "^3.1.0-alpha.1",
5252
"rimraf": "^3.0.2",
5353
"rollup": "^2.78.0",
5454
"rollup-plugin-cleanup": "^3.2.1",

packages/material-renderers/package.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jsonforms/material-renderers",
3-
"version": "3.1.0-alpha.0",
3+
"version": "3.1.0-alpha.1",
44
"description": "Material Renderer Set for JSON Forms",
55
"repository": "https://github.com/eclipsesource/jsonforms",
66
"bugs": "https://github.com/eclipsesource/jsonforms/issues",
@@ -11,6 +11,10 @@
1111
"src": "src",
1212
"webpack": "webpack"
1313
},
14+
"files": [
15+
"lib",
16+
"src"
17+
],
1418
"keywords": [
1519
"material",
1620
"renderer",
@@ -77,17 +81,17 @@
7781
"peerDependencies": {
7882
"@emotion/react": "^11.4.1",
7983
"@emotion/styled": "^11.3.0",
80-
"@jsonforms/core": "3.1.0-alpha.0",
81-
"@jsonforms/react": "3.1.0-alpha.0",
84+
"@jsonforms/core": "3.1.0-alpha.1",
85+
"@jsonforms/react": "3.1.0-alpha.1",
8286
"@mui/icons-material": "~5.2.2",
8387
"@mui/material": "~5.2.2",
8488
"@mui/x-date-pickers": "^5.0.0-beta.5"
8589
},
8690
"devDependencies": {
8791
"@emotion/react": "^11.5.0",
8892
"@emotion/styled": "^11.3.0",
89-
"@jsonforms/core": "^3.1.0-alpha.0",
90-
"@jsonforms/react": "^3.1.0-alpha.0",
93+
"@jsonforms/core": "^3.1.0-alpha.1",
94+
"@jsonforms/react": "^3.1.0-alpha.1",
9195
"@mui/icons-material": "~5.2.0",
9296
"@mui/material": "~5.2.2",
9397
"@mui/x-date-pickers": "^5.0.0-beta.5",

packages/material-renderers/src/controls/MaterialBooleanControl.tsx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,24 @@ export const MaterialBooleanControl = ({
8383
: null;
8484
const secondFormHelperText = showDescription && !isValid ? errors : null;
8585

86+
const descriptionIds = [];
87+
const tooltipId = `${id}-tip`;
88+
const helpId1 = `${id}-help1`;
89+
const helpId2 = `${id}-help2`;
90+
if (showTooltip) {
91+
descriptionIds.push(tooltipId);
92+
}
93+
if (firstFormHelperText) {
94+
descriptionIds.push(helpId1);
95+
}
96+
if (secondFormHelperText) {
97+
descriptionIds.push(helpId2);
98+
}
99+
const ariaDescribedBy = descriptionIds.join(' ');
100+
86101
return (
87102
<Hidden xsUp={!visible}>
88-
<Tooltip title={(showTooltip) ? description : ''}>
103+
<Tooltip id={tooltipId} title={(showTooltip) ? description : ''}>
89104
<FormControlLabel
90105
label={label}
91106
id={id}
@@ -103,14 +118,17 @@ export const MaterialBooleanControl = ({
103118
handleChange={handleChange}
104119
errors={errors}
105120
config={config}
121+
inputProps={{
122+
'aria-describedby': ariaDescribedBy
123+
}}
106124
/>
107125
}
108126
/>
109127
</Tooltip>
110-
<FormHelperText error={!isValid && !showDescription}>
128+
<FormHelperText id={helpId1} error={!isValid && !showDescription}>
111129
{firstFormHelperText}
112130
</FormHelperText>
113-
<FormHelperText error={!isValid}>
131+
<FormHelperText id={helpId2} error={!isValid}>
114132
{secondFormHelperText}
115133
</FormHelperText>
116134
</Hidden>

packages/material-renderers/src/controls/MaterialBooleanToggleControl.tsx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,24 @@ export const MaterialBooleanToggleControl = ({
8585
: null;
8686
const secondFormHelperText = showDescription && !isValid ? errors : null;
8787

88+
const descriptionIds = [];
89+
const tooltipId = `${id}-tip`;
90+
const helpId1 = `${id}-help1`;
91+
const helpId2 = `${id}-help2`;
92+
if (showTooltip) {
93+
descriptionIds.push(tooltipId);
94+
}
95+
if (firstFormHelperText) {
96+
descriptionIds.push(helpId1);
97+
}
98+
if (secondFormHelperText) {
99+
descriptionIds.push(helpId2);
100+
}
101+
const ariaDescribedBy = descriptionIds.join(' ');
102+
88103
return (
89104
<Hidden xsUp={!visible}>
90-
<Tooltip title={(showTooltip) ? description : ''}>
105+
<Tooltip id={tooltipId} title={(showTooltip) ? description : ''}>
91106
<FormControlLabel
92107
label={label}
93108
id={id}
@@ -105,14 +120,17 @@ export const MaterialBooleanToggleControl = ({
105120
handleChange={handleChange}
106121
errors={errors}
107122
config={config}
123+
inputProps={{
124+
'aria-describedby': ariaDescribedBy
125+
}}
108126
/>
109127
}
110128
/>
111129
</Tooltip>
112-
<FormHelperText error={!isValid && !showDescription}>
130+
<FormHelperText id={helpId1} error={!isValid && !showDescription}>
113131
{firstFormHelperText}
114132
</FormHelperText>
115-
<FormHelperText error={!isValid}>
133+
<FormHelperText id={helpId2} error={!isValid}>
116134
{secondFormHelperText}
117135
</FormHelperText>
118136
</Hidden>

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@
2424
*/
2525
import React from 'react';
2626
import { CellProps, WithClassname } from '@jsonforms/core';
27-
import { Checkbox } from '@mui/material';
27+
import { Checkbox, InputProps } from '@mui/material';
2828
import merge from 'lodash/merge';
2929

30-
export const MuiCheckbox = React.memo((props: CellProps & WithClassname) => {
30+
interface MuiCheckboxInputProps {
31+
inputProps?: InputProps['inputProps'];
32+
}
33+
34+
export const MuiCheckbox = React.memo((props: CellProps & WithClassname & MuiCheckboxInputProps) => {
3135
const {
3236
data,
3337
className,
@@ -36,10 +40,13 @@ export const MuiCheckbox = React.memo((props: CellProps & WithClassname) => {
3640
uischema,
3741
path,
3842
handleChange,
39-
config
43+
config,
44+
inputProps
4045
} = props;
4146
const appliedUiSchemaOptions = merge({}, config, uischema.options);
42-
const inputProps = { autoFocus: !!appliedUiSchemaOptions.focus };
47+
const inputPropsMerged = merge({}, inputProps, {
48+
autoFocus: !!appliedUiSchemaOptions.focus
49+
});
4350
// !! causes undefined value to be converted to false, otherwise has no effect
4451
const checked = !!data;
4552

@@ -50,7 +57,7 @@ export const MuiCheckbox = React.memo((props: CellProps & WithClassname) => {
5057
className={className}
5158
id={id}
5259
disabled={!enabled}
53-
inputProps={inputProps}
60+
inputProps={inputPropsMerged}
5461
/>
5562
);
5663
});

0 commit comments

Comments
 (0)