Skip to content
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

initial contribution for vue-vuetify renderer set #2341

Merged
merged 88 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
418050c
Initial JSON Forms Vuetify Renderers setup
sdirix Aug 5, 2021
ab42f4c
Integrate Vuetify
sdirix Sep 8, 2021
6974a2c
Adds EnumControlRenderer
yaffol Sep 16, 2021
5afeb20
Add OneOfEnum control renderer
yaffol Sep 16, 2021
576682e
Add complete Vuetify based renderer set
kchobantonov Sep 22, 2021
d57ba10
Polish contributed Vuetify renderer set
sdirix Sep 26, 2021
58dac02
Improve example app
kchobantonov Oct 26, 2021
1f89e57
I18n integration
sdirix Oct 28, 2021
db03376
Prepare renderer set package.json for release
sdirix Nov 8, 2021
9a59747
Dispatch text changes immediately
sdirix Dec 15, 2021
070e895
Expand new array layout items by default
sdirix Dec 15, 2021
4c5e614
v3.0.0-alpha.3
sdirix Dec 15, 2021
f2e5916
Update to JSON Forms 3.0.0-beta.0
sdirix Jan 10, 2022
f8f5b62
Add debouncing to performance critical inputs
sdirix Jan 10, 2022
0aae0e9
Build in CommonJS and ESM formats
sdirix Jan 10, 2022
b2e04d1
v3.0.0-beta.0
sdirix Jan 17, 2022
832247d
Fix example app
sdirix Jan 25, 2022
02df211
Improve rendering for nested objects
sdirix Jan 24, 2022
bc98cde
Adapt Array Item Avatar
sdirix Jan 30, 2022
60abda6
Show validation marker on array items
sdirix Jan 30, 2022
0aa3c41
Show confirmation dialog when deleting array items
sdirix Jan 31, 2022
36a7442
Configure Vuetify components via UI Schema options
kchobantonov Jan 31, 2022
2a0dcbb
Update to JSON Forms 3.0.0-beta.1
sdirix Jan 31, 2022
3ab51fe
v3.0.0-beta.1
sdirix Jan 31, 2022
70ebd1f
Attach popups to application root (#39)
sdirix Feb 14, 2022
b37fa91
v3.0.0-beta.1.1
sdirix Feb 14, 2022
97d3817
Properly clear date/time values
sdirix May 5, 2022
1164151
Expand first array item initially
sdirix May 9, 2022
05ccab6
Offer breakpoint option for horizontal layouts
sdirix May 11, 2022
d09a86a
Update to JSON Forms 3.0.0-beta.2
sdirix May 13, 2022
3932286
v3.0.0-beta.2
sdirix May 13, 2022
ac42850
Offer array layout v-expansion-panels configuration via 'vuetifyProps'
yaffol Jun 24, 2022
2fa2689
Fix config merging in layout renderers
sdirix May 18, 2022
6135bb3
Fix v-checkbox and v-switch states
seydx Jun 24, 2022
4056fec
Add tests and fix minor issues
kchobantonov Jun 28, 2022
46f146e
Update to JSON Forms 3.0.0-beta.4
sdirix Jun 27, 2022
22b123f
v3.0.0-beta.4
sdirix Jun 28, 2022
9214ec8
Fix build typings
sdirix Jun 28, 2022
2e453da
Align ESM build with JSON Forms 'core' and 'vue2'
sdirix Jun 28, 2022
09f45c8
v3.0.0-beta.4.1
sdirix Jun 28, 2022
f6701d5
fix - npm run watch
kchobantonov Jul 1, 2022
0c1082c
Add form-only view to example app
kchobantonov Jul 25, 2022
a8e4db1
Use Vuetify pickers for date and time controls
kchobantonov Jul 25, 2022
e669b5f
Update to JSON Forms 3.0.0-rc.0 and Vue 2.7
sdirix Jul 22, 2022
5300f2f
Translate UI Schema elements
sdirix Jul 25, 2022
03006b5
Combine collapse and manual column weights
sdirix Jul 25, 2022
ec2d01e
Sync picker date changes
kchobantonov Jul 26, 2022
7b431f9
Export validation badge and icons
sdirix Jul 26, 2022
70afa02
v3.0.0-rc.0
sdirix Jul 26, 2022
ed55bd0
Allow binding `v-menu` props via UI Schema options
kchobantonov Aug 12, 2022
467df9b
Offer customizations for array layout
yaffol Aug 22, 2022
3515729
Update to JSON Forms 3.0.0-rc.1
sdirix Aug 22, 2022
8399853
v3.0.0-rc.1
sdirix Aug 22, 2022
07cf6ca
Allow falsy values as allowed values for enums (#73)
kchobantonov Oct 20, 2022
55d0871
Fix renderers' data length checks for undefined data (#82)
kchobantonov Oct 21, 2022
3c2848b
Add masked string renderer (#78)
kchobantonov Oct 21, 2022
2cd2576
Update Demo with i18n support and add enum label translation (#76)
kchobantonov Oct 26, 2022
4be33da
Allow configuring date/time control action visiblity (#83)
kchobantonov Oct 26, 2022
456963c
Datetime NPE fixes and save timezone per default for time control (#84)
kchobantonov Oct 31, 2022
3fb8648
Update to JSON Forms 3.0
sdirix Oct 31, 2022
0019a86
v3.0.0
sdirix Oct 31, 2022
3f97278
Add additional props renderer & enhance allOf, anyOf, oneOf, data, nu…
kchobantonov Dec 9, 2022
6365d67
Update to JSON Forms 3.1.0-alpha.0
sdirix Dec 12, 2022
4d55c96
v3.1.0-alpha.0
sdirix Dec 12, 2022
ac363c2
Update environment to Vue 3 and Vuetify 3
sdirix Apr 3, 2023
02d8b2c
Adapt vue-vuetify to Vue 3 and Vuetify 3
sdirix Apr 3, 2023
0ba36d5
Adapt example app for Vue 3 and Vuetify 3
sdirix Apr 3, 2023
e28891c
Use dev build in example app
sdirix Apr 3, 2023
add63e7
Polish Vue 3 renderer set
sdirix Jun 26, 2023
1d05beb
Update to JSON Forms 3.1.0
sdirix Jun 26, 2023
920aa81
Adapt README for release
sdirix Jun 26, 2023
6672704
v3.1.0-preview.0
sdirix Jun 26, 2023
2bfe692
Fix build
sdirix Jun 26, 2023
9f8f34f
fix(EnumControlRenderer.vue): change @change event to @update:modelVa…
yaffol Nov 7, 2023
c90f05f
chore: update to JSON Forms 3.2.0-alpha.3
sdirix Nov 24, 2023
ff6bb6e
v3.2.0-preview-alpha.3
sdirix Nov 24, 2023
cf808ce
chore: update to JSON Forms 3.2.1
yaffol Mar 18, 2024
e3455b4
feat: add touch error filtering
yaffol Mar 20, 2024
4e1f1e6
Adds arrayList.title class and cardProps binding to ArrayLayoutRenderer
yaffol Nov 27, 2023
069503a
build: adds explicit `exports` section in package.json
yaffol Apr 23, 2024
1723db1
feat: export control renderer entries
yaffol Apr 23, 2024
29c010d
fix: radio control
Toilal May 28, 2024
582afae
chore: update to JSON Forms 3.3.0
sdirix May 28, 2024
523ec95
v3.3.0-preview.0
sdirix May 31, 2024
3efac5c
chore: move example-app into vue-vuetify
sdirix Aug 21, 2024
d7b7dc3
chore: merge jsonforms-vuetify-renderers into main repository
sdirix Aug 21, 2024
d1e562e
chore: integrate jsonforms-vuetify-renderers
kchobantonov Aug 21, 2024
b6ad627
chore: polish vue-vuetify integration
sdirix Aug 21, 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
21 changes: 9 additions & 12 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,18 @@ body:
placeholder: v3.0.0
- type: dropdown
attributes:
label: Framework
label: Package
multiple: true
options:
- Core
- React
- Angular
- Vue
- Other (please specify in the Additional context field)
- type: dropdown
attributes:
label: RendererSet
multiple: true
options:
- Material
- Vanilla
- React Bindings
- React Material Renderers
- React Vanilla Renderers
- Angular Bindings
- Angular Material Renderers
- Vue Bindings
- Vue Vanilla Renderers
- Vue Vuetify Renderers
- Other (please specify in the Additional context field)
- type: textarea
attributes:
Expand Down
21 changes: 9 additions & 12 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,18 @@ body:
## Describe for which setup you like to have the improvement
- type: dropdown
attributes:
label: Framework
label: Package
multiple: true
options:
- Core
- React
- Angular
- Vue
- Other (please specify in the Additional context field)
- type: dropdown
attributes:
label: RendererSet
multiple: true
options:
- Material
- Vanilla
- React Bindings
- React Material Renderers
- React Vanilla Renderers
- Angular Bindings
- Angular Material Renderers
- Vue Bindings
- Vue Vanilla Renderers
- Vue Vuetify Renderers
- Other (please specify in the Additional context field)
- type: textarea
attributes:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
cd ../vanilla-renderers && pnpm pkg set peerDependencies.@jsonforms/core="${{ github.event.inputs.next_version }}" && pnpm pkg set peerDependencies.@jsonforms/react="${{ github.event.inputs.next_version }}"
cd ../vue && pnpm pkg set peerDependencies.@jsonforms/core="${{ github.event.inputs.next_version }}"
cd ../vue-vanilla && pnpm pkg set peerDependencies.@jsonforms/core="${{ github.event.inputs.next_version }}" && pnpm pkg set peerDependencies.@jsonforms/vue="${{ github.event.inputs.next_version }}"
cd ../vue-vuetify && pnpm pkg set peerDependencies.@jsonforms/core="${{ github.event.inputs.next_version }}" && pnpm pkg set peerDependencies.@jsonforms/vue="${{ github.event.inputs.next_version }}"

- name: "Tag and Commit"
run: |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ In this case, you can try to clean the repository with `git clean -dfx`. Beware
- Run React Material examples: `cd packages/material-renderers && pnpm run dev`
- Run Angular Material examples: `cd packages/angular-material && pnpm run dev`
- Run Vue Vanilla dev setup: `cd packages/vue-vanilla && pnpm run serve`
- Run Vue Vuetify dev setup: `cd packages/vue-vuetify && pnpm run dev`

### Dependency & Release management

Expand Down
2 changes: 1 addition & 1 deletion packages/angular-material/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"@angular/router": "^17.0.0 || ^18.0.0",
"@jsonforms/angular": "3.4.0-alpha.2",
"@jsonforms/core": "3.4.0-alpha.2",
"dayjs": "^1.11.7",
"dayjs": "^1.11.10",
"rxjs": "^6.6.0 || ^7.4.0"
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/mappers/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,7 @@ export const mapStateToLabelProps = (
config: getConfig(state),
renderers: props.renderers || getRenderers(state),
cells: props.cells || getCells(state),
uischema,
};
};

Expand Down
31 changes: 21 additions & 10 deletions packages/core/src/util/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,27 @@
import find from 'lodash/find';
import type { JsonSchema } from '../models';

export const getFirstPrimitiveProp = (schema: any) => {
if (schema.properties) {
return find(Object.keys(schema.properties), (propName) => {
const prop = schema.properties[propName];
return (
prop.type === 'string' ||
prop.type === 'number' ||
prop.type === 'integer'
);
});
export const getFirstPrimitiveProp = (schema: unknown) => {
if (
schema &&
typeof schema === 'object' &&
'properties' in schema &&
schema.properties
) {
return find(
Object.keys(schema.properties),
(propName: keyof typeof schema.properties) => {
const prop: unknown = schema.properties[propName];
return (
prop &&
typeof prop === 'object' &&
'type' in prop &&
(prop.type === 'string' ||
prop.type === 'number' ||
prop.type === 'integer')
);
}
);
}
return undefined;
};
Expand Down
1 change: 1 addition & 0 deletions packages/examples-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ <h1>JSON Forms Examples</h1>
<li><a href="react-material">React Material Renderers</a></li>
<li><a href="angular-material">Angular Material Renderers</a></li>
<li><a href="vue-vanilla">Vue Vanilla Renderers</a></li>
<li><a href="vue-vuetify">Vue Vuetify Renderers</a></li>
</ul>
</body>
</html>
1 change: 1 addition & 0 deletions packages/examples-app/prepare-examples-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const examples = {
'react-material': join(packagesDir, 'material-renderers', 'example', 'dist'),
'angular-material': join(packagesDir, 'angular-material', 'example', 'dist'),
'vue-vanilla': join(packagesDir, 'vue-vanilla', 'example', 'dist'),
'vue-vuetify': join(packagesDir, 'vue-vuetify', 'example', 'dist'),
};

// Clean and recreate dist dir
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"doc": "typedoc --name 'JSON Forms Examples' --excludeExternals --out docs src"
},
"dependencies": {
"ajv-i18n": "^3.5.0",
"ajv-i18n": "^4.2.0",
"lodash": "^4.17.21"
},
"peerDependencies": {
Expand Down
131 changes: 131 additions & 0 deletions packages/examples/src/examples/additional-properties.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
/*
The MIT License

Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
import { registerExamples } from '../register';

export const schema = {
$schema: 'http://json-schema.org/draft-07/schema#',
type: 'object',
properties: {
propertiesString: {
type: 'string',
},
},
propertyNames: {
minLength: 2,
},
patternProperties: {
'^string$': {
type: 'string',
},
'^number$': {
type: 'number',
},
'^integer$': {
type: 'integer',
},
'^object$': {
type: 'object',
properties: {
prop1: {
type: 'string',
},
},
},
'^boolean$': {
type: 'boolean',
},
'^stringArray$': {
type: 'array',
items: {
type: 'string',
},
},
'^numberArray$': {
type: 'array',
items: {
type: 'number',
},
},
'^integerArray$': {
type: 'array',
items: {
type: 'integer',
},
},
'^objectArray$': {
type: 'array',
items: {
type: 'object',
properties: {
prop1: {
type: 'string',
},
},
},
},
'^booleanArray$': {
type: 'array',
items: {
type: 'boolean',
},
},
},
additionalProperties: {
type: 'string',
title: 'Additional Properties',
},
maxProperties: 15,
};

export const uischema = {
type: 'Control',
scope: '#/',
};

const data = {
propertiesString: 'data',
string: 'string value',
number: 10.2,
integer: 11,
object: {
prop1: 'prop 1 value',
},
boolean: true,
stringArray: ['value1', 'value2'],
numberArray: [12.2],
integerArray: [33],
objectArray: [{ prop1: 'prop1 val' }, {}],
booleanArray: [false, true],
};

registerExamples([
{
name: 'additional-properties',
label: 'Additional Properties',
data,
schema,
uischema,
},
]);
7 changes: 3 additions & 4 deletions packages/examples/src/examples/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ import {
Translator,
} from '@jsonforms/core';
import get from 'lodash/get';
// TODO change import when types are available for ajv-i18n (from v4.x)
// eslint-disable-next-line @typescript-eslint/no-var-requires
const localize = require('ajv-i18n');
import localize from 'ajv-i18n/localize';

export const onChange =
(dispatch: Dispatch<AnyAction>) =>
Expand All @@ -43,7 +41,8 @@ export const onChange =
if (!extensionState) {
return;
}
const localiseFunc = localize[extensionState.locale.split('-')[0]];
const localiseFunc =
localize[extensionState.locale.split('-')[0] as keyof typeof localize];
localiseFunc(errors);
dispatch(updateErrors(errors));
};
Expand Down
78 changes: 78 additions & 0 deletions packages/examples/src/examples/login.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
The MIT License

Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
import { registerExamples } from '../register';

export const schema = {
type: 'object',
properties: {
username: {
type: 'string',
description: 'Login Name',
},
password: {
type: 'string',
format: 'password',
description: 'Login password',
},
},
required: ['username', 'password'],
};

export const uischema = {
type: 'VerticalLayout',
elements: [
{
type: 'Label',
text: 'Login Information',
},
{
type: 'HorizontalLayout',
elements: [
{
type: 'Control',
scope: '#/properties/username',
},
{
type: 'Control',
scope: '#/properties/password',
},
],
},
],
};

const data = {
username: 'john.doe@email.com',
};

registerExamples([
{
name: 'login',
label: 'Login Form',
data,
schema,
uischema,
},
]);
Loading
Loading