Skip to content

Commit fa546b5

Browse files
authored
feat: mixed support and more for vue-vuetify
- provides support for mixed types - adjust core resolve to be more compatible with boolean schemas - enhance date controls to show year, year/month etc. depending on the control options - improve performance by converting dayjs format into maska format - use arraySchema from core bindings - additionalProperties UI can be forced via new allowAdditionalPropertiesIfMissing configuration - minor UI changes
1 parent f3e9a7a commit fa546b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2037
-396
lines changed

packages/core/src/util/resolvers.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,19 +123,19 @@ const resolveSchemaWithSegments = (
123123
pathSegments: string[],
124124
rootSchema: JsonSchema
125125
): JsonSchema => {
126-
if (isEmpty(schema)) {
127-
return undefined;
128-
}
129-
130126
// use typeof because schema can by of any type - check singleSegmentResolveSchema below
131-
if (typeof schema.$ref === 'string') {
127+
if (typeof schema?.$ref === 'string') {
132128
schema = resolveSchema(rootSchema, schema.$ref, rootSchema);
133129
}
134130

135131
if (!pathSegments || pathSegments.length === 0) {
136132
return schema;
137133
}
138134

135+
if (isEmpty(schema)) {
136+
return undefined;
137+
}
138+
139139
const [segment, ...remainingSegments] = pathSegments;
140140

141141
if (invalidSegment(segment)) {
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
The MIT License
3+
4+
Copyright (c) 2017-2019 EclipseSource Munich
5+
https://github.com/eclipsesource/jsonforms
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in
15+
all copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
THE SOFTWARE.
24+
*/
25+
import { registerExamples } from '../register';
26+
27+
export const schema = {
28+
type: ['array', 'boolean', 'integer', 'null', 'number', 'object', 'string'],
29+
additionalProperties: true,
30+
items: {
31+
type: ['array', 'boolean', 'integer', 'null', 'number', 'object', 'string'],
32+
},
33+
};
34+
35+
export const uischema = {
36+
type: 'Control',
37+
scope: '#/',
38+
};
39+
40+
const data = undefined as any;
41+
42+
registerExamples([
43+
{
44+
name: 'json-editor',
45+
label: 'JSON Editor',
46+
data,
47+
schema,
48+
uischema,
49+
},
50+
]);

0 commit comments

Comments
 (0)