diff --git a/example/package.json b/example/package.json index cbe64709..8d1aaa00 100644 --- a/example/package.json +++ b/example/package.json @@ -8,9 +8,9 @@ "clean": "rimraf dist" }, "dependencies": { - "@jsonforms/core": "3.0.0-alpha.1", - "@jsonforms/vue2": "3.0.0-alpha.1", - "@jsonforms/vue2-vuetify": "3.0.0-alpha.1", + "@jsonforms/core": "3.0.0-alpha.2", + "@jsonforms/vue2": "3.0.0-alpha.2", + "@jsonforms/vue2-vuetify": "3.0.0-alpha.2", "@vue/composition-api": "1.0.0-rc.3", "core-js": "^3.6.5", "vue": "^2.6.14", diff --git a/example/src/components/DemoForm.vue b/example/src/components/DemoForm.vue index 19a31c28..868a66b4 100644 --- a/example/src/components/DemoForm.vue +++ b/example/src/components/DemoForm.vue @@ -12,6 +12,7 @@ :validationMode="validationMode" :ajv="ajv" :readonly="readonly" + :i18n="i18n" @change="onChange" /> @@ -58,9 +59,11 @@ import { JsonFormsRendererRegistryEntry, JsonFormsCellRendererRegistryEntry, JsonSchema, + JsonFormsI18nState, } from '@jsonforms/core'; import { JsonForms, JsonFormsChangeEvent } from '@jsonforms/vue2'; import JsonRefs from 'json-refs'; +import { createTranslator } from '../i18n'; export default { name: 'demo-form', @@ -103,6 +106,11 @@ export default { type: Object as PropType, default: undefined, }, + locale: { + required: false, + type: String, + default: 'en', + }, }, data() { return { @@ -111,15 +119,24 @@ export default { resolved: false, error: undefined, } as ResolvedSchema, + i18n: { + locale: this.locale, + translate: createTranslator(this.locale), + } as JsonFormsI18nState, }; }, watch: { example: { deep: true, - handler(newExample: Example, oldExample: Example) { + handler(newExample: Example, oldExample: Example): void { this.resolveSchema(newExample.input.schema); }, }, + locale(newLocale: string): void { + console.log('LOCALE SWITCH', newLocale); + this.i18n.locale = newLocale; + this.i18n.translate = createTranslator(newLocale); + }, }, mounted() { this.resolveSchema(this.example.input.schema); diff --git a/example/src/components/Settings.vue b/example/src/components/Settings.vue index 85a90598..03cd0385 100644 --- a/example/src/components/Settings.vue +++ b/example/src/components/Settings.vue @@ -111,6 +111,23 @@ + + Locale (Mostly in basic example) + + + + + + + + + Options @@ -170,6 +187,20 @@ + + + + + Only applies to basic example + + + @@ -190,6 +221,7 @@ export default { ), restrict: sync('app/jsonforms@config.restrict'), readonly: sync('app/jsonforms@readonly'), + locale: sync('app/jsonforms@locale'), }, data: function () { return { @@ -199,6 +231,10 @@ export default { { text: 'Validate And Hide', value: 'ValidateAndHide' }, { text: 'No Validation', value: 'NoValidation' }, ], + locales: [ + { text: 'English (en)', value: 'en' }, + { text: 'German (de)', value: 'de' }, + ], }; }, }; diff --git a/example/src/examples/basic/schema.json b/example/src/examples/basic/schema.json index 215f8fd8..9ca98a94 100644 --- a/example/src/examples/basic/schema.json +++ b/example/src/examples/basic/schema.json @@ -4,58 +4,54 @@ "name": { "type": "string", "minLength": 3, - "description": "Please enter your name" + "description": "Please enter your name", + "i18n": "name" }, "vegetarian": { - "type": "boolean" + "type": "boolean", + "i18n": "vegetarian" }, "birthDate": { "type": "string", - "format": "date" + "format": "date", + "i18n": "birth" }, "nationality": { "type": "string", - "enum": [ - "DE", - "IT", - "JP", - "US", - "RU", - "Other" - ] + "enum": ["DE", "IT", "JP", "US", "RU", "Other"], + "i18n": "nationality" }, "personalData": { "type": "object", "properties": { "age": { "type": "integer", - "description": "Please enter your age." + "description": "Please enter your age.", + "i18n": "personal-data.age" }, "height": { - "type": "number" + "type": "number", + "i18n": "height" }, "drivingSkill": { "type": "number", "maximum": 10, "minimum": 1, - "default": 7 + "default": 7, + "i18n": "personal-data.driving" } }, - "required": [ - "age", - "height" - ] + "required": ["age", "height"] }, "occupation": { - "type": "string" + "type": "string", + "i18n": "occupation" }, "postalCode": { "type": "string", - "maxLength": 5 + "maxLength": 5, + "i18n": "postal-code" } }, - "required": [ - "occupation", - "nationality" - ] -} \ No newline at end of file + "required": ["occupation", "nationality"] +} diff --git a/example/src/i18n/i18n.ts b/example/src/i18n/i18n.ts new file mode 100644 index 00000000..92ec02ad --- /dev/null +++ b/example/src/i18n/i18n.ts @@ -0,0 +1,91 @@ +import get from 'lodash/get'; + +const en = { + name: { + label: 'Name', + description: 'The name of the person', + }, + vegetarian: { + label: 'Vegetarian', + description: 'Wether the person is a vegetarian', + }, + birth: { + label: 'Birth Date', + description: '', + }, + nationality: { + label: 'Nationality', + description: '', + }, + 'personal-data': { + age: { + label: 'Age', + }, + driving: { + label: 'Driving Skill', + description: 'Indicating experience level', + }, + }, + height: { + label: 'Height', + }, + occupation: { + label: 'Occupation', + description: '', + }, + 'postal-code': { + label: 'Postal Code', + }, + error: { + required: 'field is required', + }, +}; + +const de = { + name: { + label: 'Name', + description: 'Der Name der Person', + }, + vegetarian: { + label: 'Vegetarier', + description: 'Isst die Person vegetarisch?', + }, + birth: { + label: 'Geburtsdatum', + description: '', + }, + nationality: { + label: 'Nationalität', + description: '', + Other: 'Andere', + }, + 'personal-data': { + age: { + label: 'Alter', + }, + driving: { + label: 'Fahrkenntnisse', + description: 'Fahrerfahrung der Person', + }, + }, + height: { + label: 'Größe', + }, + occupation: { + label: 'Beruf', + description: '', + }, + 'postal-code': { + label: 'Postleitzahl', + }, + error: { + required: 'Pflichtfeld', + }, + 'Additional Information': 'Zusätzliche Informationen', +}; + +export const createTranslator = + (locale: 'en' | 'de') => + (key: string, defaultMessage: string | undefined): string | undefined => { + return get(locale === 'en' ? en : de, key) ?? defaultMessage; + }; diff --git a/example/src/i18n/index.ts b/example/src/i18n/index.ts new file mode 100644 index 00000000..e82230f1 --- /dev/null +++ b/example/src/i18n/index.ts @@ -0,0 +1 @@ +export * from './i18n'; diff --git a/example/src/store/modules/app.ts b/example/src/store/modules/app.ts index 53cc416d..9ee350ad 100644 --- a/example/src/store/modules/app.ts +++ b/example/src/store/modules/app.ts @@ -22,6 +22,7 @@ const state: AppState = { renderers: extendedVuetifyRenderers, cells: extendedVuetifyRenderers, ajv, + locale: 'en', }, monaco: { schemaModel: undefined, diff --git a/example/src/store/modules/types.ts b/example/src/store/modules/types.ts index 440eb37a..d4085c63 100644 --- a/example/src/store/modules/types.ts +++ b/example/src/store/modules/types.ts @@ -3,7 +3,7 @@ import { JsonFormsCellRendererRegistryEntry, } from '@jsonforms/core'; import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'; -import AJV from 'ajv'; +import Ajv from 'ajv'; // declare your own store states export interface AppState { @@ -19,7 +19,8 @@ export interface AppState { }; renderers: JsonFormsRendererRegistryEntry[]; cells: JsonFormsCellRendererRegistryEntry[]; - ajv: AJV.Ajv; + ajv: Ajv; + locale: string; }; monaco: { schemaModel: monaco.editor.ITextModel | undefined; diff --git a/example/src/views/example/Example.vue b/example/src/views/example/Example.vue index e16f4b32..d001fcda 100644 --- a/example/src/views/example/Example.vue +++ b/example/src/views/example/Example.vue @@ -20,6 +20,7 @@ :validationMode="validationMode" :ajv="ajv" :readonly="readonly" + :locale="locale" @change="onChange" /> @@ -200,6 +201,7 @@ export default { monacoSchemaModel: sync('app/monaco@schemaModel'), monacoUiSchemaModel: sync('app/monaco@uischemaModel'), monacoDataModel: sync('app/monaco@dataModel'), + locale: sync('app/jsonforms@locale'), }, mounted() { this.setExample( diff --git a/lerna.json b/lerna.json index c11c620a..1ddd0d4d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,4 +1,4 @@ { "packages": ["vue2-vuetify", "example"], - "version": "3.0.0-alpha.1" + "version": "3.0.0-alpha.2" } diff --git a/package-lock.json b/package-lock.json index 0b497fab..029082b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1190,19 +1190,20 @@ } }, "@jsonforms/core": { - "version": "3.0.0-alpha.1", - "resolved": "https://registry.npmjs.org/@jsonforms/core/-/core-3.0.0-alpha.1.tgz", - "integrity": "sha512-wiPk8kMQr91FaBeBSj7U/jPhTH52yF0GC1Z5QIyrexVWz/QP9xwoAZpRaXM1TL4nNzX0Cgl2WBRedxB/4LmNmA==", + "version": "3.0.0-alpha.2", + "resolved": "https://registry.npmjs.org/@jsonforms/core/-/core-3.0.0-alpha.2.tgz", + "integrity": "sha512-5RUqGjJMhV577k0KXtAdgCkVWtTle1wVIKZahe5yWzo7cpLJq7PVfbTMeJsaxZokyw8382uu35K20R71xUPnww==", "requires": { "@types/json-schema": "^7.0.3", - "ajv": "^6.10.2", + "ajv": "^8.6.1", + "ajv-formats": "^2.1.0", "lodash": "^4.17.15" } }, "@jsonforms/vue2": { - "version": "3.0.0-alpha.1", - "resolved": "https://registry.npmjs.org/@jsonforms/vue2/-/vue2-3.0.0-alpha.1.tgz", - "integrity": "sha512-Dk6MGTzFtbex/kiSdZa3as5Plstkk8fh354H6xNXlKrpNQmtpWTCqjS/9odm7GmjoaI4LkihRzmitukSPV61DA==", + "version": "3.0.0-alpha.2", + "resolved": "https://registry.npmjs.org/@jsonforms/vue2/-/vue2-3.0.0-alpha.2.tgz", + "integrity": "sha512-bawO2BhBnv4oj5///C6GBGrgEFu+KnZDpIZztL31J5SQSUlU2HcjjOLPgBqBZkJStnXFUj2RA41Kvsbbwxhk2A==", "requires": { "lodash": "^4.17.15" } @@ -3548,6 +3549,18 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==" }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "optional": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "array-union": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", @@ -3583,6 +3596,27 @@ } } }, + "cosmiconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "optional": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.7.2" + }, + "dependencies": { + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "optional": true + } + } + }, "dir-glob": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", @@ -3625,6 +3659,25 @@ } } }, + "fork-ts-checker-webpack-plugin-v5": { + "version": "npm:fork-ts-checker-webpack-plugin@5.2.1", + "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-5.2.1.tgz", + "integrity": "sha512-SVi+ZAQOGbtAsUWrZvGzz38ga2YqjWvca1pXQFUArIVXqli0lLoDQ8uS0wg0kSpcwpZmaW5jVCZXQebkyUQSsw==", + "optional": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@types/json-schema": "^7.0.5", + "chalk": "^4.1.0", + "cosmiconfig": "^6.0.0", + "deepmerge": "^4.2.2", + "fs-extra": "^9.0.0", + "memfs": "^3.1.2", + "minimatch": "^3.0.4", + "schema-utils": "2.7.0", + "semver": "^7.3.2", + "tapable": "^1.0.0" + } + }, "glob-parent": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", @@ -3682,6 +3735,12 @@ } } }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "optional": true + }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -3717,6 +3776,17 @@ } } }, + "schema-utils": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz", + "integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==", + "optional": true, + "requires": { + "@types/json-schema": "^7.0.4", + "ajv": "^6.12.2", + "ajv-keywords": "^3.4.1" + } + }, "slash": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", @@ -3983,6 +4053,17 @@ "graceful-fs": "^4.1.6" } }, + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "optional": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -4055,6 +4136,17 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" }, + "vue-loader-v16": { + "version": "npm:vue-loader@16.8.2", + "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.2.tgz", + "integrity": "sha512-Nkq+z9mAsMEK+qkXgK+9Ia7D8w9uu9j4ut0IMT5coMfux3rCgIp1QBB1CYwY0M34A1nRMSONEaWXxAAw6xSl/Q==", + "optional": true, + "requires": { + "chalk": "^4.1.0", + "hash-sum": "^2.0.0", + "loader-utils": "^2.0.0" + } + }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -4610,13 +4702,13 @@ } }, "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "8.6.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", + "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", "requires": { "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", "uri-js": "^4.2.2" } }, @@ -4625,6 +4717,14 @@ "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==" }, + "ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "requires": { + "ajv": "^8.0.0" + } + }, "ajv-keywords": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", @@ -6329,6 +6429,11 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, + "cookiejar": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz", + "integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==" + }, "copy-anything": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-2.0.3.tgz", @@ -6478,6 +6583,11 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==" }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -6545,6 +6655,19 @@ "ajv": "^6.1.0", "ajv-errors": "^1.0.0", "ajv-keywords": "^3.1.0" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + } } }, "slash": { @@ -7650,6 +7773,17 @@ "v8-compile-cache": "^2.0.3" }, "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", @@ -7736,6 +7870,11 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", @@ -8583,51 +8722,6 @@ } } }, - "fork-ts-checker-webpack-plugin-v5": { - "version": "npm:fork-ts-checker-webpack-plugin@5.2.1", - "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-5.2.1.tgz", - "integrity": "sha512-SVi+ZAQOGbtAsUWrZvGzz38ga2YqjWvca1pXQFUArIVXqli0lLoDQ8uS0wg0kSpcwpZmaW5jVCZXQebkyUQSsw==", - "optional": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@types/json-schema": "^7.0.5", - "chalk": "^4.1.0", - "cosmiconfig": "^6.0.0", - "deepmerge": "^4.2.2", - "fs-extra": "^9.0.0", - "memfs": "^3.1.2", - "minimatch": "^3.0.4", - "schema-utils": "2.7.0", - "semver": "^7.3.2", - "tapable": "^1.0.0" - }, - "dependencies": { - "cosmiconfig": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", - "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", - "optional": true, - "requires": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.7.2" - } - }, - "schema-utils": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz", - "integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==", - "optional": true, - "requires": { - "@types/json-schema": "^7.0.4", - "ajv": "^6.12.2", - "ajv-keywords": "^3.4.1" - } - } - } - }, "form-data": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", @@ -8638,6 +8732,11 @@ "mime-types": "^2.1.12" } }, + "formidable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz", + "integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==" + }, "forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -9049,6 +9148,14 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" }, + "graphlib": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz", + "integrity": "sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==", + "requires": { + "lodash": "^4.17.15" + } + }, "gzip-size": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.1.tgz", @@ -9088,6 +9195,24 @@ "requires": { "ajv": "^6.12.3", "har-schema": "^2.0.0" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + } } }, "hard-rejection": { @@ -10391,15 +10516,37 @@ "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" }, + "json-refs": { + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/json-refs/-/json-refs-3.0.15.tgz", + "integrity": "sha512-0vOQd9eLNBL18EGl5yYaO44GhixmImes2wiYn9Z3sag3QnehWrYWlB9AFtMxCL2Bj3fyxgDYkxGFEU/chlYssw==", + "requires": { + "commander": "~4.1.1", + "graphlib": "^2.1.8", + "js-yaml": "^3.13.1", + "lodash": "^4.17.15", + "native-promise-only": "^0.8.1", + "path-loader": "^1.0.10", + "slash": "^3.0.0", + "uri-js": "^4.2.2" + }, + "dependencies": { + "commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==" + } + } + }, "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" }, "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -11209,6 +11356,11 @@ "webpack-sources": "^1.1.0" }, "dependencies": { + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "normalize-url": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz", @@ -11237,6 +11389,19 @@ "ajv": "^6.1.0", "ajv-errors": "^1.0.0", "ajv-keywords": "^3.1.0" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + } } }, "sort-keys": { @@ -11677,6 +11842,11 @@ "to-regex": "^3.0.1" } }, + "native-promise-only": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/native-promise-only/-/native-promise-only-0.8.1.tgz", + "integrity": "sha1-IKMYwwy0X3H+et+/eyHJnBRy7xE=" + }, "native-request": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/native-request/-/native-request-1.1.0.tgz", @@ -12032,6 +12202,11 @@ "schema-utils": "^1.0.0" }, "dependencies": { + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "schema-utils": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", @@ -12040,6 +12215,19 @@ "ajv": "^6.1.0", "ajv-errors": "^1.0.0", "ajv-keywords": "^3.1.0" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + } } } } @@ -12689,6 +12877,15 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" }, + "path-loader": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/path-loader/-/path-loader-1.0.10.tgz", + "integrity": "sha512-CMP0v6S6z8PHeJ6NFVyVJm6WyJjIwFvyz2b0n2/4bKdS/0uZa/9sKUlYZzubrn3zuDRU0zIuEDX9DZYQ2ZI8TA==", + "requires": { + "native-promise-only": "^0.8.1", + "superagent": "^3.8.3" + } + }, "path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -12984,6 +13181,11 @@ "schema-utils": "^1.0.0" }, "dependencies": { + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "schema-utils": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", @@ -12992,6 +13194,19 @@ "ajv": "^6.1.0", "ajv-errors": "^1.0.0", "ajv-keywords": "^3.1.0" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + } } } } @@ -14447,6 +14662,11 @@ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -14746,6 +14966,11 @@ "semver": "^7.3.2" }, "dependencies": { + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "loader-utils": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", @@ -14764,6 +14989,19 @@ "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", "ajv-keywords": "^3.5.2" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + } } } } @@ -14781,6 +15019,24 @@ "@types/json-schema": "^7.0.5", "ajv": "^6.12.4", "ajv-keywords": "^3.5.2" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + } } }, "select-hose": { @@ -15702,6 +15958,38 @@ } } }, + "superagent": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.3.tgz", + "integrity": "sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==", + "requires": { + "component-emitter": "^1.2.0", + "cookiejar": "^2.1.0", + "debug": "^3.1.0", + "extend": "^3.0.0", + "form-data": "^2.3.1", + "formidable": "^1.2.0", + "methods": "^1.1.1", + "mime": "^1.4.1", + "qs": "^6.5.1", + "readable-stream": "^2.3.5" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + } + } + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -15792,6 +16080,17 @@ "string-width": "^3.0.0" }, "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", @@ -15807,6 +16106,11 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -15957,6 +16261,11 @@ "locate-path": "^3.0.0" } }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -16011,6 +16320,19 @@ "ajv": "^6.1.0", "ajv-errors": "^1.0.0", "ajv-keywords": "^3.1.0" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + } } }, "ssri": { @@ -16771,6 +17093,11 @@ "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.14.tgz", "integrity": "sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ==" }, + "vue-class-component": { + "version": "7.2.6", + "resolved": "https://registry.npmjs.org/vue-class-component/-/vue-class-component-7.2.6.tgz", + "integrity": "sha512-+eaQXVrAm/LldalI272PpDe3+i4mPis0ORiMYxF6Ae4hyuCh15W8Idet7wPUEs4N4YptgFHGys4UrgNQOMyO6w==" + }, "vue-cli-plugin-vuetify": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/vue-cli-plugin-vuetify/-/vue-cli-plugin-vuetify-2.4.2.tgz", @@ -16831,29 +17158,10 @@ } } }, - "vue-loader-v16": { - "version": "npm:vue-loader@16.8.1", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.1.tgz", - "integrity": "sha512-V53TJbHmzjBhCG5OYI2JWy/aYDspz4oVHKxS43Iy212GjGIG1T3EsB3+GWXFm/1z5VwjdjLmdZUFYM70y77vtQ==", - "optional": true, - "requires": { - "chalk": "^4.1.0", - "hash-sum": "^2.0.0", - "loader-utils": "^2.0.0" - }, - "dependencies": { - "loader-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", - "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", - "optional": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - } - } + "vue-router": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.3.tgz", + "integrity": "sha512-FUlILrW3DGitS2h+Xaw8aRNvGTwtuaxrRkNSHWTizOfLUie7wuYwezeZ50iflRn8YPV5kxmU2LQuu3nM/b3Zsg==" }, "vue-runtime-helpers": { "version": "1.1.2", @@ -16914,6 +17222,11 @@ "schema-utils": "^3.0.0" } }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "loader-utils": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", @@ -16932,10 +17245,36 @@ "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", "ajv-keywords": "^3.5.2" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + } } } } }, + "vuex": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz", + "integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==" + }, + "vuex-pathify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/vuex-pathify/-/vuex-pathify-1.5.1.tgz", + "integrity": "sha512-+0cCPVIeleV8WJyUIQ9ZHqLyz9F5iRm9LzWl6dnCrGbjHFTLfS5H2uS1CtJ0t0BCzAReUrbEsRweAyooe4OqZQ==", + "requires": { + "vue-class-component": "^7.2.6" + } + }, "watchpack": { "version": "1.7.5", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz", @@ -17213,6 +17552,17 @@ "webpack-sources": "^1.4.1" }, "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "braces": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", @@ -17288,6 +17638,11 @@ } } }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -17704,6 +18059,11 @@ } } }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -17785,6 +18145,19 @@ "ajv": "^6.1.0", "ajv-errors": "^1.0.0", "ajv-keywords": "^3.1.0" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + } } }, "semver": { diff --git a/vue2-vuetify/package.json b/vue2-vuetify/package.json index eb6f0f72..bedeab32 100644 --- a/vue2-vuetify/package.json +++ b/vue2-vuetify/package.json @@ -1,6 +1,6 @@ { "name": "@jsonforms/vue2-vuetify", - "version": "3.0.0-alpha.1", + "version": "3.0.0-alpha.2", "description": "Vue 2 Vuetify renderers for JSON Forms", "repository": "https://github.com/eclipsesource/jsonforms-vuetify-renderers", "bugs": "https://github.com/eclipsesource/jsonforms/issues", @@ -33,6 +33,7 @@ "watch": "rollup --watch --config rollup.config.js" }, "dependencies": { + "ajv": "^8.6.1", "dayjs": "^1.10.6", "lodash": "^4.17.15" }, @@ -41,15 +42,16 @@ "@vue/composition-api": "1.0.0-rc.3", "vuetify": "^2.4.0", "@mdi/font": "^5.9.55", - "@jsonforms/core": "^3.0.0-alpha.1", - "@jsonforms/vue2": "^3.0.0-alpha.1" + "@jsonforms/core": "^3.0.0-alpha.2", + "@jsonforms/vue2": "^3.0.0-alpha.2" }, "devDependencies": { + "ajv": "^8.6.1", "@babel/core": "^7.14.6", "@babel/preset-env": "^7.14.7", "@babel/preset-typescript": "^7.14.5", - "@jsonforms/core": "3.0.0-alpha.1", - "@jsonforms/vue2": "3.0.0-alpha.1", + "@jsonforms/core": "3.0.0-alpha.2", + "@jsonforms/vue2": "3.0.0-alpha.2", "@typescript-eslint/eslint-plugin": "^4.18.0", "@typescript-eslint/parser": "^4.18.0", "@vue/eslint-config-prettier": "^6.0.0", diff --git a/vue2-vuetify/src/additional/LabelRenderer.vue b/vue2-vuetify/src/additional/LabelRenderer.vue index cf73c5a8..cce43332 100644 --- a/vue2-vuetify/src/additional/LabelRenderer.vue +++ b/vue2-vuetify/src/additional/LabelRenderer.vue @@ -1,6 +1,6 @@ @@ -10,6 +10,7 @@ import { Layout, rankWith, uiTypeIs, + LabelElement, } from '@jsonforms/core'; import { defineComponent } from '../vue'; import { @@ -18,7 +19,7 @@ import { useJsonFormsLayout, RendererProps, } from '@jsonforms/vue2'; -import { useVuetifyLayout } from '../util'; +import { useVuetifyLayout, useTranslator } from '../util'; import { VLabel } from 'vuetify/lib'; const labelRenderer = defineComponent({ @@ -31,8 +32,23 @@ const labelRenderer = defineComponent({ ...rendererProps(), }, setup(props: RendererProps) { - // reuse layout bindings for label - return useVuetifyLayout(useJsonFormsLayout(props)); + const t = useTranslator(); + const layout = useVuetifyLayout(useJsonFormsLayout(props)); + return { ...layout, t }; + }, + computed: { + translatedLabel(): string | undefined { + if (this.layout.uischema.options?.i18n) { + return this.t( + this.layout.uischema.options.i18n, + (this.layout.uischema as LabelElement).text + ); + } + return this.t( + (this.layout.uischema as LabelElement).text, + (this.layout.uischema as LabelElement).text + ); + }, }, }); diff --git a/vue2-vuetify/src/additional/ListWithDetailRenderer.vue b/vue2-vuetify/src/additional/ListWithDetailRenderer.vue index afd8b149..21f42c98 100644 --- a/vue2-vuetify/src/additional/ListWithDetailRenderer.vue +++ b/vue2-vuetify/src/additional/ListWithDetailRenderer.vue @@ -326,7 +326,9 @@ const controlRenderer = defineComponent({ }, childErrors(index: number): ErrorObject[] { return this.control.childErrors.filter((e) => - e.dataPath.startsWith(this.composePaths(this.control.path, `${index}`)) + e.instancePath.startsWith( + this.composePaths(this.control.path, `${index}`) + ) ); }, }, diff --git a/vue2-vuetify/src/controls/components/ValidationBadge.vue b/vue2-vuetify/src/controls/components/ValidationBadge.vue index 4a4e4a19..fc4e170a 100644 --- a/vue2-vuetify/src/controls/components/ValidationBadge.vue +++ b/vue2-vuetify/src/controls/components/ValidationBadge.vue @@ -38,6 +38,7 @@ import findIndex from 'lodash/findIndex'; import { createControlElement, createLabelDescriptionFrom, + JsonSchema, } from '@jsonforms/core'; export default defineComponent({ @@ -79,7 +80,7 @@ export default defineComponent({ computed: { tooltipMessages(): string[] { const error: { - dataPath: string; + instancePath: string; schemaPath: string; labels: (string | undefined)[]; message: string; @@ -92,11 +93,11 @@ export default defineComponent({ if (index == -1) { error.push({ schemaPath: errorObject.schemaPath, - dataPath: errorObject.dataPath, + instancePath: errorObject.instancePath, labels: [ createLabelDescriptionFrom( - createControlElement(errorObject.dataPath), - errorObject.schema + createControlElement(errorObject.instancePath), + errorObject.schema as JsonSchema ).text, ], message: errorObject.message, @@ -104,8 +105,8 @@ export default defineComponent({ } else { error[index].labels.push( createLabelDescriptionFrom( - createControlElement(errorObject.dataPath), - errorObject.schema + createControlElement(errorObject.instancePath), + errorObject.schema as JsonSchema ).text ); } diff --git a/vue2-vuetify/src/layouts/ArrayLayoutRenderer.vue b/vue2-vuetify/src/layouts/ArrayLayoutRenderer.vue index d2779677..0cf2e5c0 100644 --- a/vue2-vuetify/src/layouts/ArrayLayoutRenderer.vue +++ b/vue2-vuetify/src/layouts/ArrayLayoutRenderer.vue @@ -295,7 +295,9 @@ const controlRenderer = defineComponent({ }, childErrors(index: number): ErrorObject[] { return this.control.childErrors.filter((e) => - e.dataPath.startsWith(this.composePaths(this.control.path, `${index}`)) + e.instancePath.startsWith( + this.composePaths(this.control.path, `${index}`) + ) ); }, }, diff --git a/vue2-vuetify/src/util/composition.ts b/vue2-vuetify/src/util/composition.ts index ddbcffb3..718a70e3 100644 --- a/vue2-vuetify/src/util/composition.ts +++ b/vue2-vuetify/src/util/composition.ts @@ -10,7 +10,7 @@ import cloneDeep from 'lodash/cloneDeep'; import merge from 'lodash/merge'; import { useStyles } from '../styles'; import { computed, ComputedRef, inject, ref } from '../vue'; -import { Ajv } from 'ajv'; +import Ajv from 'ajv'; const useControlAppliedOptions = (input: I) => { return computed(() => @@ -82,6 +82,29 @@ export const useVuetifyControl = < }; }; +export const useTranslator = () => { + const jsonforms = inject('jsonforms'); + + if (!jsonforms) { + throw new Error( + "'jsonforms couldn't be injected. Are you within JSON Forms?" + ); + } + + if (!jsonforms.i18n || !jsonforms.i18n.translate) { + throw new Error( + "'jsonforms i18n couldn't be injected. Are you within JSON Forms?" + ); + } + + const translate = computed(() => { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return jsonforms.i18n!.translate!; + }); + + return translate; +}; + /** * Adds styles and appliedOptions */ diff --git a/vue2-vuetify/src/util/validator.ts b/vue2-vuetify/src/util/validator.ts index e25f7e59..f78b8b33 100644 --- a/vue2-vuetify/src/util/validator.ts +++ b/vue2-vuetify/src/util/validator.ts @@ -1,8 +1,8 @@ import { Options } from 'ajv'; import { createAjv as createAjvCore } from '@jsonforms/core'; -import AJV from 'ajv'; +import Ajv from 'ajv'; -export const createAjv = (options?: Options): AJV.Ajv => { +export const createAjv = (options?: Options): Ajv => { const ajv = createAjvCore(options); ajv.addFormat('password', (_) => true); return ajv;