Skip to content

Commit 279eeef

Browse files
authored
Merge branch 'master' into separate-readonly-from-disabled
2 parents f24a9f3 + e3d804d commit 279eeef

14 files changed

Lines changed: 655 additions & 303 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
## JSON Forms Project information
2+
3+
JSON Forms is a declarative framework for efficiently building form-based web UIs.
4+
These UIs are targeted at entering, modifying and viewing data and are usually embedded within an application.
5+
6+
Any UI is defined by using two schemata:
7+
- The JSON schema defines the underlying data to be shown in the UI (objects, properties, and their types)
8+
- The UI schema defines how this data is rendered as a form, e.g. the order of controls, their visibility, and the layout.
9+
If no UI schema is given, JSON Forms generates one based on the given JSON schema.
10+
11+
We put great emphasis on the customizability and extensibility of JSON Forms.
12+
13+
### Architecture overview
14+
15+
The JSON Forms mono repository consists of these packages:
16+
- `@jsonforms/core` in `packages/core`: Provides utilities for managing and rendering JSON Schema based forms.
17+
The core package is independent of any UI technology.
18+
- `@jsonforms/react` in `packages/react`, `@jsonforms/angular` in `packages/angular`, `@jsonforms/vue` in `packages/vue`.
19+
These use the core package to provide specialized bindings for React, Angular and Vue, leveraging each respective's state management and rendering systems.
20+
- For React we maintain two renderer sets: The `@jsonforms/material-renderers` in `packages/material-renderers`, which are based on the popular Material-UI framework and `@jsonforms/vanilla-renderers` in `packages/vanilla-renderers` which provides pure HTML5 renderers.
21+
For Angular we provide an Angular Material based renderer set (`@jsonforms/angular-material` in `packages/angular-material`). For Vue we provide a HTML5 based renderer set `@jsonforms/vue-vanilla` in `packages/vue-vanilla` and a Vuetify based one `@jsonforms/vue-vuetify` in `packages/vue-vuetify`.
22+
23+
### Mono-repo Setup
24+
25+
- Package Manager: pnpm with lerna for orchestration
26+
- Dependency Management: Each package declares all its dependencies explicitly (no hoisting assumptions). We aim to use the same dependency versions across packages (e.g. for Typescript or Jest)
27+
- Testing: Independent test setup per package. Tests are implemented in separate folder `test` or `tests` within a package.
28+
- Build: Each package has its own build configuration. Rollup is the default tool except if there are other typical tools for the respective technology (e.g. Angular)
29+
- Linting and Formatting: Each package has its own `.eslintrc.js` and `.prettierrc.js` config
30+
- Typescript: Packages extend common base config `tsconfig.base.js`
31+
32+
### Core principles
33+
34+
JSON Forms uses a reducer-style approach for its state management.
35+
The form-wide state is manipulated via the reducers in `packages/core/src/reducers`.
36+
37+
Renderers are registered in a registry, consisting of tester, renderer pairs.
38+
For each UI Schema element to be rendered, all testers are asked for their priority.
39+
The highest priority wins and the respective renderer gets full control over rendering.
40+
The renderer may dispatch back to JSON Forms to render children elements.
41+
42+
Dispatchers only receive a minimal amount of properties, e.g. which part of the JSON Schema they are refering to and which UI Schema element is to be rendered.
43+
Mappers in packages/core/src/mappers are then used to determine the actual props for the renderers to work with, combining the handed over dispatch props and the form-wide state.
44+
45+
The binding packages `@jsonforms/react`, `@jsonforms/angular` and `@jsonforms/vue` bind these functionalities to mechanisms of their respective framework.
46+
The renderers then use the bound functionalities and usually do not interact with `@jsonforms/core` directly.
47+
48+
### Coding Guidelines
49+
50+
When creating new functions we prefer the arrow style approach
51+
52+
### Development Guidelines
53+
54+
The framework is popular, therefore we never break adopters if we don't have to.
55+
Consider this for all changes.

CLAUDE.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# General project information
2+
3+
For information on project setup, architecture, and core principles refer to @.prompts/project-info.prompttemplate
4+
5+
## Build Commands
6+
7+
### Full Repository
8+
9+
```bash
10+
pnpm install # Install dependencies
11+
pnpm run build # Build all packages
12+
pnpm run lint # Lint all packages
13+
pnpm run lint:fix # Lint and auto-fix
14+
pnpm run test # Test all packages
15+
pnpm run clean # Clean build artifacts
16+
```
17+
18+
### Single Package (Preferred for Iterative Development)
19+
20+
```bash
21+
# Build
22+
pnpm lerna run build --scope=@jsonforms/core
23+
24+
# Lint
25+
pnpm lerna run lint --scope=@jsonforms/core
26+
27+
# Test
28+
pnpm lerna run test --scope=@jsonforms/core
29+
```
30+
31+
### Package Names
32+
33+
- `@jsonforms/core` - Core utilities (UI-framework independent)
34+
- `@jsonforms/react`, `@jsonforms/angular`, `@jsonforms/vue` - Framework bindings
35+
- `@jsonforms/material-renderers`, `@jsonforms/vanilla-renderers` - React renderer sets
36+
- `@jsonforms/angular-material` - Angular renderer set
37+
- `@jsonforms/vue-vanilla`, `@jsonforms/vue-vuetify` - Vue renderer sets
38+
39+
### Build Order Dependencies
40+
41+
`core``react`/`angular`/`vue` → renderer packages

packages/core/src/mappers/renderer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,11 @@ export const oneOfToEnumOptionMapper = (
349349
if (t) {
350350
// prefer schema keys as they can be more specialized
351351
if (e.i18n) {
352-
label = t(e.i18n, label);
352+
label = t(e.i18n, label, { schema: e });
353353
} else if (fallbackI18nKey) {
354-
label = t(`${fallbackI18nKey}.${label}`, label);
354+
label = t(`${fallbackI18nKey}.${label}`, label, { schema: e });
355355
} else {
356-
label = t(label, label);
356+
label = t(label, label, { schema: e });
357357
}
358358
}
359359
return {

packages/vue-vuetify/dev/components/ExampleAppBar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const appStore = useAppStore();
2424
<v-container fill-height fluid justify-end
2525
><v-row dense>
2626
<v-col>
27-
<v-tooltip bottom>
27+
<v-tooltip location="bottom">
2828
<template v-slot:activator="{ props }">
2929
<v-btn
3030
icon
@@ -42,7 +42,7 @@ const appStore = useAppStore();
4242
</v-col>
4343
<v-col><theme-changer /> </v-col>
4444
<v-col>
45-
<v-tooltip bottom>
45+
<v-tooltip location="bottom">
4646
<template v-slot:activator="{ props }">
4747
<v-btn
4848
large

packages/vue-vuetify/dev/components/ExampleSettings.vue

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
262262
<v-container>
263263
<v-row>
264264
<v-col>
265-
<v-tooltip bottom>
265+
<v-tooltip location="bottom">
266266
<template v-slot:activator="{ props }">
267267
<v-switch
268268
v-model="appStore.overrideControlTemplate"
@@ -282,7 +282,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
282282
<v-row><v-col>Options</v-col></v-row>
283283
<v-row>
284284
<v-col>
285-
<v-tooltip bottom>
285+
<v-tooltip location="bottom">
286286
<template v-slot:activator="{ props }">
287287
<v-switch
288288
v-model="appStore.jsonforms.config.hideRequiredAsterisk"
@@ -296,7 +296,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
296296
</v-row>
297297
<v-row>
298298
<v-col>
299-
<v-tooltip bottom>
299+
<v-tooltip location="bottom">
300300
<template v-slot:activator="{ props }">
301301
<v-switch
302302
v-model="appStore.jsonforms.config.showUnfocusedDescription"
@@ -310,7 +310,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
310310
</v-row>
311311
<v-row>
312312
<v-col>
313-
<v-tooltip bottom>
313+
<v-tooltip location="bottom">
314314
<template v-slot:activator="{ props }">
315315
<v-switch
316316
v-model="appStore.jsonforms.config.restrict"
@@ -325,7 +325,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
325325
</v-row>
326326
<v-row>
327327
<v-col>
328-
<v-tooltip bottom>
328+
<v-tooltip location="bottom">
329329
<template v-slot:activator="{ props }">
330330
<v-switch
331331
v-model="appStore.jsonforms.config.separateReadonlyFromDisabled"
@@ -355,7 +355,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
355355
</v-row>
356356
<v-row>
357357
<v-col>
358-
<v-tooltip bottom>
358+
<v-tooltip location="bottom">
359359
<template v-slot:activator="{ props }">
360360
<v-switch
361361
v-model="appStore.jsonforms.config.collapseNewItems"
@@ -369,7 +369,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
369369
</v-row>
370370
<v-row>
371371
<v-col>
372-
<v-tooltip bottom>
372+
<v-tooltip location="bottom">
373373
<template v-slot:activator="{ props }">
374374
<v-switch
375375
v-model="appStore.jsonforms.config.hideArraySummaryValidation"
@@ -383,7 +383,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
383383
</v-row>
384384
<v-row>
385385
<v-col>
386-
<v-tooltip bottom>
386+
<v-tooltip location="bottom">
387387
<template v-slot:activator="{ props }">
388388
<v-switch
389389
v-model="appStore.jsonforms.config.initCollapsed"
@@ -397,7 +397,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
397397
</v-row>
398398
<v-row>
399399
<v-col>
400-
<v-tooltip bottom>
400+
<v-tooltip location="bottom">
401401
<template v-slot:activator="{ props }">
402402
<v-switch
403403
v-model="appStore.jsonforms.config.hideAvatar"
@@ -411,7 +411,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
411411
</v-row>
412412
<v-row>
413413
<v-col>
414-
<v-tooltip bottom>
414+
<v-tooltip location="bottom">
415415
<template v-slot:activator="{ props }">
416416
<v-switch
417417
v-model="
@@ -427,7 +427,29 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
427427
</v-row>
428428
<v-row>
429429
<v-col>
430-
<v-tooltip bottom>
430+
<v-tooltip location="bottom">
431+
<template v-slot:activator="{ props }">
432+
<v-combobox
433+
v-model="
434+
appStore.jsonforms.config.filterErrorKeywordsBeforeTouch
435+
"
436+
label="Filter Error Keywords Before Touch"
437+
placeholder="e.g., required, minLength, pattern"
438+
chips
439+
closable-chips
440+
multiple
441+
clearable
442+
v-bind="props"
443+
></v-combobox>
444+
</template>
445+
Hide specific AJV error keywords until the control is touched.
446+
Requires "Enable Filter Errors Before Touch".
447+
</v-tooltip>
448+
</v-col>
449+
</v-row>
450+
<v-row>
451+
<v-col>
452+
<v-tooltip location="bottom">
431453
<template v-slot:activator="{ props }">
432454
<v-switch
433455
v-model="

packages/vue-vuetify/dev/components/ThemeChanger.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const setTheme = (theme: string) => {
2323
offset-y
2424
>
2525
<template v-slot:activator="{ props: propsMenu }">
26-
<v-tooltip bottom>
26+
<v-tooltip location="bottom">
2727
<template v-slot:activator="{ props: propsTooltip }">
2828
<v-btn large icon dark>
2929
<v-icon

packages/vue-vuetify/dev/store/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const appstore = reactive({
3333
hideAvatar: false,
3434
hideArraySummaryValidation: false,
3535
enableFilterErrorsBeforeTouch: false,
36+
filterErrorKeywordsBeforeTouch: ['required'],
3637
allowAdditionalPropertiesIfMissing: false,
3738
},
3839
locale: useLocalStorage('vuetify-example-locale', 'en'),

packages/vue-vuetify/dev/views/ExampleView.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ const handleAction = (action: Action) => {
355355
<v-toolbar flat>
356356
<v-toolbar-title>Data</v-toolbar-title>
357357
<v-spacer></v-spacer>
358-
<v-tooltip bottom>
358+
<v-tooltip location="bottom">
359359
<template v-slot:activator="{ props }">
360360
<v-btn
361361
icon
@@ -367,7 +367,7 @@ const handleAction = (action: Action) => {
367367
</template>
368368
{{ `Reload Example Data` }}
369369
</v-tooltip>
370-
<v-tooltip bottom>
370+
<v-tooltip location="bottom">
371371
<template v-slot:activator="{ props }">
372372
<v-btn
373373
icon
@@ -402,15 +402,15 @@ const handleAction = (action: Action) => {
402402
<v-toolbar flat>
403403
<v-toolbar-title>Schema</v-toolbar-title>
404404
<v-spacer></v-spacer>
405-
<v-tooltip bottom>
405+
<v-tooltip location="bottom">
406406
<template v-slot:activator="{ props }">
407407
<v-btn icon @click="reloadMonacoSchema" v-bind="props">
408408
<v-icon>$reload</v-icon>
409409
</v-btn>
410410
</template>
411411
{{ `Reload Example Schema` }}
412412
</v-tooltip>
413-
<v-tooltip bottom>
413+
<v-tooltip location="bottom">
414414
<template v-slot:activator="{ props }">
415415
<v-btn icon @click="saveMonacoSchema" v-bind="props">
416416
<v-icon>$save</v-icon>
@@ -435,15 +435,15 @@ const handleAction = (action: Action) => {
435435
<v-toolbar flat>
436436
<v-toolbar-title>UI Schema</v-toolbar-title>
437437
<v-spacer></v-spacer>
438-
<v-tooltip bottom>
438+
<v-tooltip location="bottom">
439439
<template v-slot:activator="{ props }">
440440
<v-btn icon @click="reloadMonacoUiSchema" v-bind="props">
441441
<v-icon>$reload</v-icon>
442442
</v-btn>
443443
</template>
444444
{{ `Reload Example UI Schema` }}
445445
</v-tooltip>
446-
<v-tooltip bottom>
446+
<v-tooltip location="bottom">
447447
<template v-slot:activator="{ props }">
448448
<v-btn icon @click="saveMonacoUiSchema" v-bind="props">
449449
<v-icon>$save</v-icon>
@@ -468,15 +468,15 @@ const handleAction = (action: Action) => {
468468
<v-toolbar flat>
469469
<v-toolbar-title>Data</v-toolbar-title>
470470
<v-spacer></v-spacer>
471-
<v-tooltip bottom>
471+
<v-tooltip location="bottom">
472472
<template v-slot:activator="{ props }">
473473
<v-btn icon @click="reloadMonacoData" v-bind="props">
474474
<v-icon>$reload</v-icon>
475475
</v-btn>
476476
</template>
477477
{{ `Reload Example Data` }}
478478
</v-tooltip>
479-
<v-tooltip bottom>
479+
<v-tooltip location="bottom">
480480
<template v-slot:activator="{ props }">
481481
<v-btn icon @click="saveMonacoData" v-bind="props">
482482
<v-icon>$save</v-icon>

packages/vue-vuetify/src/additional/ListWithDetailRenderer.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
v-if="control.childErrors.length > 0"
1616
:errors="control.childErrors"
1717
/>
18-
<v-tooltip bottom>
18+
<v-tooltip location="bottom">
1919
<template v-slot:activator="{ props }">
2020
<v-btn
2121
icon
@@ -81,7 +81,7 @@
8181
</validation-badge>
8282
</template>
8383
<v-list-item-title>
84-
<v-tooltip bottom>
84+
<v-tooltip location="bottom">
8585
<template v-slot:activator="{ props }">
8686
<span
8787
v-bind="props"
@@ -142,7 +142,7 @@
142142
</template>
143143
{{ control.translations.down }}
144144
</v-tooltip>
145-
<v-tooltip bottom>
145+
<v-tooltip location="bottom">
146146
<template v-slot:activator="{ props }">
147147
<v-btn
148148
v-bind="props"

0 commit comments

Comments
 (0)