@jsonforms/material-renderers 3.7.0-alpha.1 → 3.7.0-alpha.3

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/package.json CHANGED
@@ -1,11 +1,18 @@
1
1
  {
2
2
  "name": "@jsonforms/material-renderers",
3
- "version": "3.7.0-alpha.1",
3
+ "version": "3.7.0-alpha.3",
4
4
  "description": "Material Renderer Set for JSON Forms",
5
- "repository": "https://github.com/eclipsesource/jsonforms",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/eclipsesource/jsonforms.git",
8
+ "directory": "packages/material-renderers"
9
+ },
6
10
  "bugs": "https://github.com/eclipsesource/jsonforms/issues",
7
11
  "homepage": "http://jsonforms.io/",
8
12
  "license": "MIT",
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
9
16
  "directories": {
10
17
  "example": "example",
11
18
  "src": "src",
@@ -73,11 +80,11 @@
73
80
  "peerDependencies": {
74
81
  "@emotion/react": "^11.5.0",
75
82
  "@emotion/styled": "^11.3.0",
76
- "@jsonforms/core": "3.7.0-alpha.1",
77
- "@jsonforms/react": "3.7.0-alpha.1",
83
+ "@jsonforms/core": "3.7.0-alpha.3",
84
+ "@jsonforms/react": "3.7.0-alpha.3",
78
85
  "@mui/icons-material": "^7.0.0",
79
86
  "@mui/material": "^7.0.0",
80
- "@mui/x-date-pickers": "^7.28.0",
87
+ "@mui/x-date-pickers": "^8.0.0",
81
88
  "react": "^16.12.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
82
89
  },
83
90
  "devDependencies": {
@@ -85,7 +92,7 @@
85
92
  "@emotion/styled": "^11.3.0",
86
93
  "@mui/icons-material": "^7.3.0",
87
94
  "@mui/material": "^7.3.0",
88
- "@mui/x-date-pickers": "^7.29.4",
95
+ "@mui/x-date-pickers": "^8.11.3",
89
96
  "@rollup/plugin-commonjs": "^23.0.3",
90
97
  "@rollup/plugin-json": "^5.0.2",
91
98
  "@rollup/plugin-node-resolve": "^15.0.1",
@@ -126,8 +133,8 @@
126
133
  "webpack": "^5.78.0",
127
134
  "webpack-cli": "^5.1.4",
128
135
  "webpack-dev-server": "^4.15.1",
129
- "@jsonforms/core": "3.7.0-alpha.1",
130
- "@jsonforms/react": "3.7.0-alpha.1"
136
+ "@jsonforms/core": "3.7.0-alpha.3",
137
+ "@jsonforms/react": "3.7.0-alpha.3"
131
138
  },
132
139
  "scripts": {
133
140
  "build": "rollup -c rollup.config.js",
@@ -41,10 +41,12 @@ import {
41
41
  createOnChangeHandler,
42
42
  getData,
43
43
  useFocus,
44
+ useInputVariant,
44
45
  } from '../util';
45
46
 
46
47
  export const MaterialDateControl = (props: ControlProps) => {
47
48
  const [focused, onFocus, onBlur] = useFocus();
49
+ const inputVariant = useInputVariant();
48
50
  const {
49
51
  description,
50
52
  id,
@@ -75,6 +77,7 @@ export const MaterialDateControl = (props: ControlProps) => {
75
77
  const saveFormat = appliedUiSchemaOptions.dateSaveFormat ?? defaultDateFormat;
76
78
 
77
79
  const views = appliedUiSchemaOptions.views ?? ['year', 'day'];
80
+ const closeOnSelect = appliedUiSchemaOptions.closeOnSelect ?? true;
78
81
 
79
82
  const firstFormHelperText = showDescription
80
83
  ? description
@@ -100,7 +103,7 @@ export const MaterialDateControl = (props: ControlProps) => {
100
103
  updateChild,
101
104
  onBlur
102
105
  ),
103
- [path, handleChange, format, saveFormat, updateChild]
106
+ [path, handleChange, format, saveFormat, updateChild, onBlur]
104
107
  );
105
108
  const value = getData(data, saveFormat);
106
109
 
@@ -121,23 +124,25 @@ export const MaterialDateControl = (props: ControlProps) => {
121
124
  format={format}
122
125
  views={views}
123
126
  disabled={!enabled}
127
+ closeOnSelect={closeOnSelect}
124
128
  slotProps={{
125
- actionBar: ({ wrapperVariant }) => ({
129
+ actionBar: ({ pickerVariant }) => ({
126
130
  actions:
127
- wrapperVariant === 'desktop' ? [] : ['clear', 'cancel', 'accept'],
131
+ pickerVariant === 'desktop' ? [] : ['clear', 'cancel', 'accept'],
128
132
  }),
129
133
  textField: {
130
134
  id: id + '-input',
131
135
  required: required && !appliedUiSchemaOptions.hideRequiredAsterisk,
132
- autoFocus: appliedUiSchemaOptions.focus,
133
136
  error: !isValid,
134
137
  fullWidth: !appliedUiSchemaOptions.trim,
138
+ variant: inputVariant,
135
139
  inputProps: {
140
+ autoFocus: appliedUiSchemaOptions.focus,
136
141
  type: 'text',
142
+ onFocus: onFocus,
143
+ onBlur: onBlurHandler,
137
144
  },
138
145
  InputLabelProps: data ? { shrink: true } : undefined,
139
- onFocus: onFocus,
140
- onBlur: onBlurHandler,
141
146
  },
142
147
  }}
143
148
  />
@@ -41,10 +41,12 @@ import {
41
41
  createOnChangeHandler,
42
42
  getData,
43
43
  useFocus,
44
+ useInputVariant,
44
45
  } from '../util';
45
46
 
46
47
  export const MaterialDateTimeControl = (props: ControlProps) => {
47
48
  const [focused, onFocus, onBlur] = useFocus();
49
+ const inputVariant = useInputVariant();
48
50
  const {
49
51
  id,
50
52
  description,
@@ -82,6 +84,7 @@ export const MaterialDateTimeControl = (props: ControlProps) => {
82
84
  'hours',
83
85
  'minutes',
84
86
  ];
87
+ const closeOnSelect = appliedUiSchemaOptions.closeOnSelect ?? true;
85
88
 
86
89
  const firstFormHelperText = showDescription
87
90
  ? description
@@ -124,27 +127,30 @@ export const MaterialDateTimeControl = (props: ControlProps) => {
124
127
  label={label}
125
128
  value={value}
126
129
  onAccept={onChange}
130
+ onChange={onChange}
127
131
  format={format}
128
132
  ampm={!!appliedUiSchemaOptions.ampm}
129
133
  views={views}
134
+ closeOnSelect={closeOnSelect}
130
135
  disabled={!enabled}
131
136
  slotProps={{
132
- actionBar: ({ wrapperVariant }) => ({
137
+ actionBar: ({ pickerVariant }) => ({
133
138
  actions:
134
- wrapperVariant === 'desktop' ? [] : ['clear', 'cancel', 'accept'],
139
+ pickerVariant === 'desktop' ? [] : ['clear', 'cancel', 'accept'],
135
140
  }),
136
141
  textField: {
137
142
  id: id + '-input',
138
143
  required: required && !appliedUiSchemaOptions.hideRequiredAsterisk,
139
- autoFocus: appliedUiSchemaOptions.focus,
140
144
  error: !isValid,
141
145
  fullWidth: !appliedUiSchemaOptions.trim,
146
+ variant: inputVariant,
142
147
  inputProps: {
148
+ autoFocus: appliedUiSchemaOptions.focus,
143
149
  type: 'text',
150
+ onFocus: onFocus,
151
+ onBlur: onBlurHandler,
144
152
  },
145
153
  InputLabelProps: data ? { shrink: true } : undefined,
146
- onFocus: onFocus,
147
- onBlur: onBlurHandler,
148
154
  },
149
155
  }}
150
156
  />
@@ -41,10 +41,12 @@ import {
41
41
  createOnChangeHandler,
42
42
  getData,
43
43
  useFocus,
44
+ useInputVariant,
44
45
  } from '../util';
45
46
 
46
47
  export const MaterialTimeControl = (props: ControlProps) => {
47
48
  const [focused, onFocus, onBlur] = useFocus();
49
+ const inputVariant = useInputVariant();
48
50
  const {
49
51
  id,
50
52
  description,
@@ -76,6 +78,7 @@ export const MaterialTimeControl = (props: ControlProps) => {
76
78
  const saveFormat = appliedUiSchemaOptions.timeSaveFormat ?? defaultTimeFormat;
77
79
 
78
80
  const views = appliedUiSchemaOptions.views ?? ['hours', 'minutes'];
81
+ const closeOnSelect = appliedUiSchemaOptions.closeOnSelect ?? true;
79
82
 
80
83
  const firstFormHelperText = showDescription
81
84
  ? description
@@ -118,27 +121,30 @@ export const MaterialTimeControl = (props: ControlProps) => {
118
121
  label={label}
119
122
  value={value}
120
123
  onAccept={onChange}
124
+ onChange={onChange}
121
125
  format={format}
122
126
  ampm={!!appliedUiSchemaOptions.ampm}
123
127
  views={views}
128
+ closeOnSelect={closeOnSelect}
124
129
  disabled={!enabled}
125
130
  slotProps={{
126
- actionBar: ({ wrapperVariant }) => ({
131
+ actionBar: ({ pickerVariant }) => ({
127
132
  actions:
128
- wrapperVariant === 'desktop' ? [] : ['clear', 'cancel', 'accept'],
133
+ pickerVariant === 'desktop' ? [] : ['clear', 'cancel', 'accept'],
129
134
  }),
130
135
  textField: {
131
136
  id: id + '-input',
132
137
  required: required && !appliedUiSchemaOptions.hideRequiredAsterisk,
133
- autoFocus: appliedUiSchemaOptions.focus,
134
138
  error: !isValid,
135
139
  fullWidth: !appliedUiSchemaOptions.trim,
140
+ variant: inputVariant,
136
141
  inputProps: {
142
+ autoFocus: appliedUiSchemaOptions.focus,
137
143
  type: 'text',
144
+ onBlur: onBlurHandler,
145
+ onFocus: onFocus,
138
146
  },
139
147
  InputLabelProps: data ? { shrink: true } : undefined,
140
- onFocus: onFocus,
141
- onBlur: onBlurHandler,
142
148
  },
143
149
  }}
144
150
  />
@@ -96,6 +96,7 @@ export const MaterialCategorizationLayoutRenderer = (
96
96
  enabled,
97
97
  selected,
98
98
  onChange,
99
+ config,
99
100
  ajv,
100
101
  t,
101
102
  } = props;
@@ -106,9 +107,9 @@ export const MaterialCategorizationLayoutRenderer = (
106
107
  const categories = useMemo(
107
108
  () =>
108
109
  categorization.elements.filter((category: Category) =>
109
- isVisible(category, data, undefined, ajv)
110
+ isVisible(category, data, undefined, ajv, config)
110
111
  ),
111
- [categorization, data, ajv]
112
+ [categorization, data, ajv, config]
112
113
  );
113
114
 
114
115
  if (categorization !== previousCategorization) {
@@ -107,9 +107,9 @@ export const MaterialCategorizationStepperLayoutRenderer = (
107
107
  const categories = useMemo(
108
108
  () =>
109
109
  categorization.elements.filter((category: Category) =>
110
- isVisible(category, data, undefined, ajv)
110
+ isVisible(category, data, undefined, ajv, config)
111
111
  ),
112
- [categorization, data, ajv]
112
+ [categorization, data, ajv, config]
113
113
  );
114
114
  const childProps: MaterialLayoutRendererProps = {
115
115
  elements: categories[activeCategory].elements,