Skip to content

Fix vue3 #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 69 commits into
base: vue3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
d8e5ee9
fix createDefaultValue
kchobantonov May 14, 2024
90f4aa9
initrial changes to the example project to migate to vite and latest …
kchobantonov May 15, 2024
84ee53b
format code
kchobantonov May 15, 2024
8020f73
make the jsonform logo theme aware
kchobantonov May 15, 2024
c7e4641
fix monaco models
kchobantonov May 16, 2024
453fc40
format code
kchobantonov May 16, 2024
967900a
remove obsolate import
kchobantonov May 16, 2024
4e28965
format code
kchobantonov May 16, 2024
87aae1a
fix model save
kchobantonov May 16, 2024
b060489
fix data validation
kchobantonov May 16, 2024
1be2037
use pnpm, update lerna, fix run watch
kchobantonov May 17, 2024
2aa67ee
use the same prettier config as jsonforms
kchobantonov May 17, 2024
d97f65e
fix /deep/ syntax with :deep() - apply formatting
kchobantonov May 17, 2024
6609149
fix masked control
kchobantonov May 18, 2024
c8c1a06
allow more settings, add more examples
kchobantonov May 18, 2024
2f25834
update example
kchobantonov May 18, 2024
5bfdcd7
formatting
kchobantonov May 18, 2024
489b824
import the css without scope
kchobantonov May 18, 2024
3587ec8
fix css processing
kchobantonov May 18, 2024
4e33408
specify the default color for VCheckbox to be primary as it was in vu…
kchobantonov May 18, 2024
4364a8e
use variant="text" instead of just text which is no longer supported …
kchobantonov May 18, 2024
dd24fea
fix radios
kchobantonov May 18, 2024
0598898
fix documentation
kchobantonov May 18, 2024
6ef1258
add selection color and value
kchobantonov May 19, 2024
bf42dde
sync dark mode with local storage
kchobantonov May 19, 2024
0e24f59
add indeterminate
kchobantonov May 19, 2024
e33d1f6
format
kchobantonov May 19, 2024
11eb855
format
kchobantonov May 19, 2024
c87c803
allow setting theme, dark, blueprint, variants as preferences
kchobantonov May 19, 2024
f7411ce
fix categorization stepper
kchobantonov May 19, 2024
825931b
remove unused widgets
kchobantonov May 19, 2024
7119b54
formatting and use scoped css
kchobantonov May 19, 2024
8dfd7a0
add VNumberInput for future if we ever going to use it - for not it i…
kchobantonov May 19, 2024
b47865d
date changes
kchobantonov May 19, 2024
5bdb01a
fix mask
kchobantonov May 19, 2024
9d79763
fix clearable
kchobantonov May 19, 2024
a5e8737
update date controller
kchobantonov May 20, 2024
ea9b303
fix i18n, enable the list with detail renderer
kchobantonov May 20, 2024
465cecd
fix list with details
kchobantonov May 20, 2024
1c9db6d
fix css class
kchobantonov May 20, 2024
8c71818
validation ui fixes
kchobantonov May 20, 2024
d7a9d99
remove unused var
kchobantonov May 20, 2024
3ddefb9
align error icon on the right
kchobantonov May 20, 2024
b5730cd
fix i18n
kchobantonov May 20, 2024
56a4476
replace fab with icon since it is no longer supported
kchobantonov May 20, 2024
af6b32e
use ValidationMode type
kchobantonov May 21, 2024
41e48b0
use shallowRef
kchobantonov May 21, 2024
95ce639
make the svg logos primary color agnostic
kchobantonov May 21, 2024
3ce3d67
update date example and renderer
kchobantonov May 21, 2024
af2ed73
update time controller
kchobantonov May 21, 2024
c577f96
add datetime controller
kchobantonov May 21, 2024
5bbc924
fix @change
kchobantonov May 21, 2024
4445955
allow configuraion for v-table
kchobantonov May 22, 2024
865be35
remove deprecated attribute
kchobantonov May 22, 2024
e19978e
fix tests, use vitest and vite for vue-vuetify, fix linting issues
kchobantonov May 27, 2024
45586ae
make iconset configurable and not use mdi in the library explicitly, …
kchobantonov May 27, 2024
dea0545
sync locale with vuetify
kchobantonov May 27, 2024
1f50ee0
fix icons
kchobantonov May 27, 2024
f50fb7a
fix icons, overide the calendar icon for fa in vuetify
kchobantonov May 27, 2024
7238258
sync dayjs locale
kchobantonov May 27, 2024
6452b36
update date renderer to support dynamic mask
kchobantonov May 28, 2024
ab265ad
use computed model and mask
kchobantonov May 28, 2024
0578e92
fix date/time controls, masking and expose localized formatting
kchobantonov May 29, 2024
76ea0ac
dynamically load renderers to prevent vite to treeshake the render fu…
kchobantonov May 29, 2024
6ee1619
update the documentation how to use the renderers to prevent the tree…
kchobantonov May 29, 2024
1d8ee3d
fix tests
kchobantonov May 29, 2024
1cb00b7
organize imports, add default placeholder for string mask renderer, r…
kchobantonov May 29, 2024
3acf9f1
update lock file
kchobantonov May 29, 2024
4e75cd9
expose jsonforms as composite
kchobantonov May 29, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
lib
stats.html
coverage
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,40 @@
# JSON Forms Vuetify renderers

This is a monorepo containing the JSON Forms Vue 2 Vuetify renderers and an example application.
This is a monorepo containing the JSON Forms Vue 3 Vuetify renderers and an example application.

See [jsonforms-vuetify-renderers.netlify.app](https://jsonforms-vuetify-renderers.netlify.app) for the deployed example application.

## JSON Forms

See [jsonforms.io](https://jsonforms.io/) and the [main repository](https://github.com/eclipsesource/jsonforms) for more information about JSON Forms.

## Vue2 Vuetify renderer set
## Vue3 Vuetify renderer set

See the [README](https://github.com/eclipsesource/jsonforms-vuetify-renderers/blob/main/vue2-vuetify/README.md) of the Vue 2 Vuetify renderer set for detailed instructions on how to consume and use the JSON Forms Vue 2 Vuetify renderer set.

## Developer documentation

Use Node 12+
Use Node v18.19+

### Initial setup

- Install monorepo dependencies: `npm ci`
- Hook up dependencies between packages: `npm run init`
- Install [node.js](https://nodejs.org/) (only Node v18.19+ < 19 is currently supported)
- Install pnpm: <https://pnpm.io/installation> (use pnpm 8.6.2+)
- Clone this repository
- Install dependencies: `pnpm i --frozen-lockfile`

### Scripts

- Build the renderer set: `npm run build`
- Build and watch the renderer set: `npm run watch`
- Remove build artifacts: `npm run clean`
- Run example app: `npm run example:serve`
- Build example app for production: `npm run example:build`
- Build the renderer set: `pnpm run build`
- Build and watch the renderer set: `pnpm run watch`
- Remove build artifacts: `pnpm run clean`
- Run example app: `pnpm run example:dev`
- Build example app for production: `pnpm run example:build`
- Run Tests: `pnpm run test`
- Linting: `pnpm run lint`

Recommendations:

- For development use `npm run watch` combined with `npm run example:serve`.
- To test production use `npm run build` combined with `npm run example:build`.
Then serve the built application from `example/dist` with a web server of your choice, e.g. `npx http-server example/dist`.
- For development use `pnpm run watch` combined with `pnpm run example:dev`.
- To test production use `pnpm run build` combined with `pnpm run example:build`.
Then serve the built application from `example/dist` with a web server of your choice, e.g. `npx http-server example/dist` or use `pnpm run example:preview`
9 changes: 5 additions & 4 deletions example/.eslintrc.js → example/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
require('@rushstack/eslint-patch/modern-module-resolution');

module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/essential',
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/typescript/recommended',
'@vue/prettier',
'@vue/eslint-config-prettier',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier/skip-formatting',
],
parserOptions: {
ecmaVersion: 2020,
Expand Down
6 changes: 6 additions & 0 deletions example/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
$schema: 'http://json.schemastore.org/prettierrc',
singleQuote: true,
jsxSingleQuote: true,
endOfLine: 'auto',
};
4 changes: 0 additions & 4 deletions example/.prettierrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

## Scripts

- `npm run serve` to start the application
- `npm run build` to build the application
- `pnpm run dev` to start the application
- `pnpm run build` to build the application
3 changes: 0 additions & 3 deletions example/babel.config.js

This file was deleted.

1 change: 1 addition & 0 deletions example/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
18 changes: 18 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"
/>
<title>JSON Forms Vue 3 Vuetify example</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
78 changes: 49 additions & 29 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,64 @@
"name": "example",
"version": "3.2.0-preview-alpha.3",
"private": true,
"type": "module",
"scripts": {
"build": "vue-cli-service build",
"serve": "vue-cli-service serve",
"dev": "vite",
"prebuild": "rimraf dist",
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"test:unit": "vitest",
"build-only": "vite build",
"type-check": "vue-tsc --build --force",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"format": "prettier --write src/",
"clean": "rimraf dist"
},
"dependencies": {
"@jsonforms/core": "3.2.0-alpha.3",
"@jsonforms/vue": "3.2.0-alpha.3",
"@jsonforms/vue-vuetify": "^3.2.0-preview-alpha.3",
"@jsonforms/core": "3.2.1",
"@jsonforms/vue": "3.2.1",
"@jsonforms/vue-vuetify": "workspace:*",
"@vueuse/core": "^10.9.0",
"ajv": "^8.6.1",
"ajv-keywords": "^5.1.0",
"core-js": "^3.9.1",
"dayjs": "^1.10.6",
"json-refs": "^3.0.15",
"monaco-editor": "^0.38.0",
"vue": "^3.2.47",
"vue-router": "^4.1.6",
"vuetify": "^3.1.12",
"vuex": "^4.1.0"
"lodash": "^4.17.15",
"monaco-editor": "^0.48.0",
"pinia": "^2.1.7",
"vue": "^3.4.21",
"vue-router": "^4.3.0",
"vuetify": "^3.6.6"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-plugin-typescript": "~5.0.8",
"@vue/cli-service": "~5.0.0",
"@vue/eslint-config-prettier": "^7.1.0",
"@vue/eslint-config-typescript": "^11.0.0",
"eslint": "^8.37.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^9.10.0",
"monaco-editor-webpack-plugin": "^7.0.1",
"prettier": "^2.8.7",
"@fortawesome/fontawesome-free": "^6.5.2",
"@mdi/font": "^7.4.47",
"@rushstack/eslint-patch": "^1.8.0",
"@tsconfig/node20": "^20.1.4",
"@types/jsdom": "^21.1.6",
"@types/lodash": "^4.14.172",
"@types/node": "^20.12.5",
"@types/splitpanes": "^2.2.6",
"@vitejs/plugin-vue": "^5.0.4",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"@vue/test-utils": "^2.4.5",
"@vue/tsconfig": "^0.5.1",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.23.0",
"jsdom": "^24.0.0",
"npm-run-all2": "^6.1.2",
"prettier": "^3.2.5",
"rimraf": "^4.4.1",
"sass": "~1.32.0",
"sass-loader": "^10.0.0",
"typescript": "~4.7.4",
"vue-cli-plugin-vuetify": "~2.5.8",
"vuex-pathify": "^3.0.0-beta",
"webpack-plugin-vuetify": "^2.0.1"
"sass": "^1.75.0",
"typescript": "~5.4.0",
"vite": "^5.2.8",
"vite-plugin-node-polyfills": "^0.21.0",
"vite-plugin-vue-devtools": "^7.0.25",
"vite-plugin-vuetify": "^2.0.3",
"vitest": "^1.4.0",
"vue-tsc": "^2.0.11"
}
}
19 changes: 0 additions & 19 deletions example/public/index.html

This file was deleted.

12 changes: 6 additions & 6 deletions example/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script setup lang="ts">
import { RouterView } from 'vue-router';
</script>

<template>
<router-view />
</template>

<script lang="ts">
export default { name: 'App' };
</script>

<style scoped>
@import '~@jsonforms/vue-vuetify/lib/jsonforms-vue-vuetify.esm.css';
<style>
@import '@jsonforms/vue-vuetify/lib/jsonforms-vue-vuetify.css';
</style>
59 changes: 59 additions & 0 deletions example/src/assets/JsonFormsLogo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<template>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 150 100"
:width="width"
:height="height"
preserveAspectRatio="xMidYMid meet"
>
<g
xmlns="http://www.w3.org/2000/svg"
transform="translate(0.000000,95.000000) scale(0.100000,-0.100000)"
:fill="primaryColor"
stroke="none"
id="g6"
>
<path
d="M161 937 c-49 -24 -62 -65 -70 -221 -7 -156 -15 -177 -67 -190 -18 -5 -24 -13 -24 -35 0 -22 7 -31 30 -41 48 -20 57 -50 62 -212 4 -121 8 -152 24 -180 25 -42 91 -67 131 -49 36 16 28 52 -14 63 -18 5 -36 14 -40 21 -4 6 -10 75 -13 152 -6 151 -22 208 -69 231 l-22 11 25 17 c47 30 59 70 65 219 6 146 10 157 58 157 28 0 37 14 29 46 -5 20 -12 24 -44 24 -20 0 -48 -6 -61 -13z"
id="path8"
/>
<path
d="M1204 936 c-11 -29 1 -51 28 -54 49 -6 58 -33 58 -172 0 -141 13 -185 64 -209 l29 -14 -25 -13 c-46 -24 -61 -75 -68 -229 -3 -77 -9 -146 -13 -152 -4 -7 -22 -16 -40 -21 -22 -6 -33 -15 -35 -30 -5 -32 33 -47 86 -32 66 17 74 38 83 210 8 162 23 214 66 231 36 13 32 64 -6 77 -46 16 -54 44 -60 202 -7 158 -17 191 -67 210 -38 15 -94 12 -100 -4z"
id="path10"
/>
<path
d="M467 923 c-15 -2 -43 -20 -62 -38 -45 -45 -47 -71 -43 -450 4 -430 -23 -400 368 -400 395 0 365 -37 365 445 0 479 27 444 -345 446 -140 1 -268 0 -283 -3z m553 -73 c19 -19 20 -33 20 -372 0 -313 -2 -353 -17 -370 -15 -17 -37 -18 -290 -18 -260 0 -274 1 -293 20 -19 19 -20 33 -20 370 0 337 1 351 20 370 19 19 33 20 290 20 257 0 271 -1 290 -20z"
id="path12"
/>
<path
d="M500 740 c0 -19 7 -20 235 -20 228 0 235 1 235 20 0 19 -7 20 -235 20 -228 0 -235 -1 -235 -20z"
id="path14"
/>
<path
d="M500 590 c0 -19 7 -20 235 -20 228 0 235 1 235 20 0 19 -7 20 -235 20 -228 0 -235 -1 -235 -20z"
id="path16"
/>
<path
d="M500 410 c0 -19 7 -20 235 -20 228 0 235 1 235 20 0 19 -7 20 -235 20 -228 0 -235 -1 -235 -20z"
id="path18"
/>
<path
d="M500 240 c0 -19 7 -20 235 -20 228 0 235 1 235 20 0 19 -7 20 -235 20 -228 0 -235 -1 -235 -20z"
id="path20"
/>
</g>
</svg>
</template>

<script lang="ts" setup>
import { computed } from 'vue';
import { useTheme } from 'vuetify';

const theme = useTheme();
defineProps<{
width: string | number;
height: string | number;
}>();

const primaryColor = computed(() => theme.current.value.colors.primary);
</script>
Loading