Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
100c462
make sure that the transition is vertical when the vertical option is…
kchobantonov Mar 12, 2023
32e01da
make vertical option visible when showing the uischema
kchobantonov Mar 12, 2023
a15d0f8
make vertical false the default
kchobantonov Mar 12, 2023
712f02a
remove full-height that adds additional space
kchobantonov Mar 12, 2023
82be7b5
place the contact of the tabs when in horizontail mode to be inside v…
kchobantonov Mar 12, 2023
5a0cebd
remove full-height
kchobantonov Mar 12, 2023
03cb282
check for null values for schema or data
kchobantonov Mar 12, 2023
2d17997
use specific function from lodash to not bring every function from it
kchobantonov Mar 12, 2023
8159553
stremline types
kchobantonov Mar 12, 2023
77ca55f
add vuetify v-bind for v-tab and v-tab-item
kchobantonov Mar 12, 2023
54058bc
allow more v elements to be customized, including button label transl…
kchobantonov Mar 12, 2023
2c84b1d
allow default messages with parameters to be translated
kchobantonov Mar 13, 2023
49a1966
remove console log
kchobantonov Mar 13, 2023
b696b82
add translations
kchobantonov Mar 13, 2023
b07e62a
add vuetifyProps configuration
kchobantonov Mar 13, 2023
1e53d47
use tripple equal
kchobantonov Mar 13, 2023
12ae66e
refactor vuetifyProps by eliminating duplicate code
kchobantonov Mar 13, 2023
2d54dc5
update to version 3.1.0-alpha.3
kchobantonov May 20, 2023
b10452c
use the available message translations from jsonforms core
kchobantonov May 20, 2023
63cbd3d
Merge remote-tracking branch 'upstream/main' into fixes-layouts
sdirix Jun 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "example",
"version": "3.1.0-alpha.0",
"version": "3.1.0-alpha.3",
"private": true,
"scripts": {
"build": "vue-cli-service build",
"serve": "vue-cli-service serve",
"clean": "rimraf dist"
},
"dependencies": {
"@jsonforms/core": "3.1.0-alpha.0",
"@jsonforms/vue2": "3.1.0-alpha.0",
"@jsonforms/vue2-vuetify": "3.1.0-alpha.0",
"@jsonforms/core": "3.1.0-alpha.3",
"@jsonforms/vue2": "3.1.0-alpha.3",
"@jsonforms/vue2-vuetify": "3.1.0-alpha.3",
"ajv-keywords": "^5.1.0",
"core-js": "^3.9.1",
"json-refs": "^3.0.15",
Expand Down
8 changes: 4 additions & 4 deletions example/src/components/DemoForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@

<script lang="ts">
import { PropType } from 'vue';
import { Example, ResolvedSchema } from '@/core/types';
import { Ajv } from 'ajv';
import { JsonExample, ResolvedSchema } from '@/core/types';
import type Ajv from 'ajv';
import {
ValidationMode,
JsonFormsUISchemaRegistryEntry,
Expand All @@ -71,7 +71,7 @@ export default {
JsonForms,
},
props: {
example: { type: Object as PropType<Example>, required: true },
example: { type: Object as PropType<JsonExample>, required: true },
renderers: {
required: true,
type: Array as PropType<JsonFormsRendererRegistryEntry[]>,
Expand Down Expand Up @@ -128,7 +128,7 @@ export default {
watch: {
example: {
deep: true,
handler(newExample: Example, oldExample: Example): void {
handler(newExample: JsonExample, oldExample: JsonExample): void {
this.resolveSchema(newExample.input.schema);
this.i18n.translate = createTranslator(
this.locale,
Expand Down
14 changes: 14 additions & 0 deletions example/src/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,34 @@ import {
UISchemaElement,
JsonSchema,
JsonFormsRendererRegistryEntry,
JsonFormsUISchemaRegistryEntry,
} from '@jsonforms/core';

export type Example = {
id: string;
title: string;
note?: string;
input: {
schema?: JsonSchema;
uischema?: UISchemaElement;
uischemas?: JsonFormsUISchemaRegistryEntry[];
data: string | number | boolean | any[] | Record<string, any>;
i18n?: Record<string, any>;
renderers?: JsonFormsRendererRegistryEntry[];
};
};

export type JsonExampleInput = Omit<Example['input'], 'uischemas'> & {
uischemas?: {
tester: string;
uischema: UISchemaElement;
}[];
};

export type JsonExample = Omit<Example, 'input'> & {
input: JsonExampleInput;
};

export type ResolvedSchema = {
schema?: JsonSchema;
resolved: boolean;
Expand Down
5 changes: 3 additions & 2 deletions example/src/examples/categorization-stepper-nav/uischema.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
],
"options": {
"variant": "stepper",
"showNavButtons": true
"showNavButtons": true,
"vertical": false
}
}
}
5 changes: 3 additions & 2 deletions example/src/examples/categorization-stepper/uischema.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
}
],
"options": {
"variant": "stepper"
"variant": "stepper",
"vertical": false
}
}
}
7 changes: 5 additions & 2 deletions example/src/examples/categorization/uischema.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,8 @@
}
}
}
]
}
],
"options": {
"vertical": false
}
}
3 changes: 2 additions & 1 deletion example/src/examples/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ import { input as rule } from './rule';
import { input as verticalLayout } from './vertical-layout';
import { input as huge } from './huge';
import { input as ifThenElse } from './if-then-else';
import { JsonExample } from '@/core/types';

export const examples = [
export const examples: JsonExample[] = [
{
id: 'main',
title: 'Main',
Expand Down
6 changes: 3 additions & 3 deletions example/src/i18n/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export const createTranslator = (
defaultMessage: string | undefined,
values?: any
): string | undefined => {
if (!localeTranslations) return defaultMessage;

const message = get(localeTranslations, id);
const message = localeTranslations
? get(localeTranslations, id)
: defaultMessage;
if (message && values) {
return translateWithParams(message, values) ?? defaultMessage;
}
Expand Down
36 changes: 18 additions & 18 deletions example/src/views/example/Example.vue
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@

<script lang="ts">
import { examples } from '@/examples';
import { find } from 'lodash';
import find from 'lodash/find';
import { sync } from 'vuex-pathify';

import DemoForm from '@/components/DemoForm.vue';
Expand All @@ -259,7 +259,7 @@ import {
EditorApi,
getMonacoModelForUri,
} from '@/core/jsonSchemaValidation';
import { Example } from '@/core/types';
import { JsonExample } from '@/core/types';
import type { JsonFormsRendererRegistryEntry } from '@jsonforms/core';
import { JsonFormsChangeEvent } from '@jsonforms/vue2';
import {
Expand All @@ -286,7 +286,7 @@ export default {
return {
activeTab: 0,
examples,
example: undefined,
example: undefined as JsonExample | undefined,
errors: undefined as
| ErrorObject<string, Record<string, any>, unknown>[]
| undefined,
Expand Down Expand Up @@ -314,34 +314,34 @@ export default {
return this.$route.query?.view === 'form-only';
},
},
mounted() {
mounted(): void {
this.setExample(
find(this.examples, (example) => example.id === this.$route.params.id)
);
},
watch: {
'$route.params.id'(id) {
'$route.params.id'(id: string): void {
this.setExample(find(this.examples, (example) => example.id === id));
},
},
methods: {
onChange(event: JsonFormsChangeEvent) {
onChange(event: JsonFormsChangeEvent): void {
this.$store.set(
'app/monaco@dataModel',
getMonacoModelForUri(
monaco.Uri.parse(this.toDataUri(this.example.id)),
monaco.Uri.parse(this.toDataUri(this.example!.id)),
event.data ? JSON.stringify(event.data, null, 2) : ''
)
);
this.errors = event.errors;
},
setExample(example: Example): void {
setExample(example?: JsonExample): void {
if (example) {
this.example = cloneDeep(example);
this.updateMonacoModels(this.example);
}
},
reloadMonacoSchema() {
reloadMonacoSchema(): void {
const example = find(
this.examples,
(example) => example.id === this.$route.params.id
Expand All @@ -360,7 +360,7 @@ export default {
this.toast('Original example schema loaded. Apply it to take effect.');
}
},
saveMonacoSchema() {
saveMonacoSchema(): void {
const model = this.monacoSchemaModel as monaco.editor.ITextModel;
const example = this.example;

Expand All @@ -384,7 +384,7 @@ export default {
}
}
},
reloadMonacoUiSchema() {
reloadMonacoUiSchema(): void {
const example = find(
this.examples,
(example) => example.id === this.$route.params.id
Expand All @@ -405,7 +405,7 @@ export default {
);
}
},
saveMonacoUiSchema() {
saveMonacoUiSchema(): void {
const model = this.monacoUiSchemaModel as monaco.editor.ITextModel;
const example = this.example;

Expand All @@ -430,7 +430,7 @@ export default {
}
}
},
reloadMonacoData() {
reloadMonacoData(): void {
const example = find(
this.examples,
(example) => example.id === this.$route.params.id
Expand All @@ -449,7 +449,7 @@ export default {
this.toast('Original example data loaded. Apply it to take effect.');
}
},
saveMonacoData() {
saveMonacoData(): void {
const model = this.monacoDataModel as monaco.editor.ITextModel;
const example = this.example;

Expand All @@ -473,7 +473,7 @@ export default {
}
}
},
reloadMonacoI18N() {
reloadMonacoI18N(): void {
const example = find(
this.examples,
(example) => example.id === this.$route.params.id
Expand All @@ -492,7 +492,7 @@ export default {
this.toast('Original example i18n loaded. Apply it to take effect.');
}
},
saveMonacoI18N() {
saveMonacoI18N(): void {
const model = this.monacoI18NModel as monaco.editor.ITextModel;
const example = this.example;

Expand All @@ -517,7 +517,7 @@ export default {
}
}
},
registerValidations(editor: EditorApi) {
registerValidations(editor: EditorApi): void {
configureJsonSchemaValidation(editor, ['*.schema.json']);
configureUISchemaValidation(editor, ['*.uischema.json']);
for (let example of examples) {
Expand All @@ -536,7 +536,7 @@ export default {
}
}
},
updateMonacoModels(example) {
updateMonacoModels(example: JsonExample): void {
this.$store.set(
'app/monaco@schemaModel',
getMonacoModelForUri(
Expand Down
7 changes: 2 additions & 5 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"packages": [
"vue2-vuetify",
"example"
],
"version": "3.1.0-alpha.0"
"packages": ["vue2-vuetify", "example"],
"version": "3.1.0-alpha.3"
}
10 changes: 5 additions & 5 deletions vue2-vuetify/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jsonforms/vue2-vuetify",
"version": "3.1.0-alpha.0",
"version": "3.1.0-alpha.3",
"description": "Vue 2 Vuetify renderers for JSON Forms",
"repository": "https://github.com/eclipsesource/jsonforms-vuetify-renderers",
"bugs": "https://github.com/eclipsesource/jsonforms/issues",
Expand Down Expand Up @@ -48,8 +48,8 @@
"v-mask": "^2.3.0"
},
"peerDependencies": {
"@jsonforms/core": "3.1.0-alpha.0",
"@jsonforms/vue2": "3.1.0-alpha.0",
"@jsonforms/core": "3.1.0-alpha.3",
"@jsonforms/vue2": "3.1.0-alpha.3",
"@mdi/font": "^5.9.55",
"vue": "^2.7.0",
"vuetify": "^2.4.0"
Expand All @@ -58,8 +58,8 @@
"@babel/core": "^7.14.6",
"@babel/preset-env": "^7.14.7",
"@babel/preset-typescript": "^7.14.5",
"@jsonforms/core": "3.1.0-alpha.0",
"@jsonforms/vue2": "3.1.0-alpha.0",
"@jsonforms/core": "3.1.0-alpha.3",
"@jsonforms/vue2": "3.1.0-alpha.3",
"@mdi/font": "^5.9.55",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-node-resolve": "^9.0.0",
Expand Down
Loading