@jsonforms/core 3.1.0-beta.0 → 3.1.0
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/jsonforms-core.cjs.js +2 -5
- package/lib/jsonforms-core.cjs.js.map +1 -1
- package/lib/jsonforms-core.esm.js +2 -5
- package/lib/jsonforms-core.esm.js.map +1 -1
- package/lib/util/renderer.d.ts +1 -0
- package/package.json +2 -2
- package/src/reducers/core.ts +7 -8
- package/src/util/renderer.ts +1 -0
package/lib/util/renderer.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsonforms/core",
|
|
3
|
-
"version": "3.1.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Core module of JSON Forms",
|
|
5
5
|
"repository": "https://github.com/eclipsesource/jsonforms",
|
|
6
6
|
"bugs": "https://github.com/eclipsesource/jsonforms/issues",
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"typedoc": "^0.19.2",
|
|
100
100
|
"typescript": "4.2.3"
|
|
101
101
|
},
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "7e0115feeced7711b0768d325566aaa6b054c32b"
|
|
103
103
|
}
|
package/src/reducers/core.ts
CHANGED
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
UPDATE_CORE,
|
|
46
46
|
UpdateCoreAction,
|
|
47
47
|
} from '../actions';
|
|
48
|
-
import { createAjv, isOneOfEnumSchema, Reducer } from '../util';
|
|
48
|
+
import { createAjv, decode, isOneOfEnumSchema, Reducer } from '../util';
|
|
49
49
|
import type { JsonSchema, UISchemaElement } from '../models';
|
|
50
50
|
|
|
51
51
|
export const validate = (
|
|
@@ -356,13 +356,9 @@ const getInvalidProperty = (error: ErrorObject): string | undefined => {
|
|
|
356
356
|
};
|
|
357
357
|
|
|
358
358
|
export const getControlPath = (error: ErrorObject) => {
|
|
359
|
-
|
|
360
|
-
//
|
|
361
|
-
|
|
362
|
-
return dataPath.replace(/\//g, '.').substr(1);
|
|
363
|
-
}
|
|
364
|
-
// dataPath was renamed to instancePath in AJV v8
|
|
365
|
-
let controlPath: string = error.instancePath;
|
|
359
|
+
// Up until AJV v7 the path property was called 'dataPath'
|
|
360
|
+
// With AJV v8 the property was renamed to 'instancePath'
|
|
361
|
+
let controlPath = (error as any).dataPath || error.instancePath || '';
|
|
366
362
|
|
|
367
363
|
// change '/' chars to '.'
|
|
368
364
|
controlPath = controlPath.replace(/\//g, '.');
|
|
@@ -374,6 +370,9 @@ export const getControlPath = (error: ErrorObject) => {
|
|
|
374
370
|
|
|
375
371
|
// remove '.' chars at the beginning of paths
|
|
376
372
|
controlPath = controlPath.replace(/^./, '');
|
|
373
|
+
|
|
374
|
+
// decode JSON Pointer escape sequences
|
|
375
|
+
controlPath = decode(controlPath);
|
|
377
376
|
return controlPath;
|
|
378
377
|
};
|
|
379
378
|
|
package/src/util/renderer.ts
CHANGED