Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions packages/vue-vuetify/dev/components/ExampleAppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const appStore = useAppStore();
<v-container fill-height fluid justify-end
><v-row dense>
<v-col>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
icon
Expand All @@ -42,7 +42,7 @@ const appStore = useAppStore();
</v-col>
<v-col><theme-changer /> </v-col>
<v-col>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
large
Expand Down
44 changes: 33 additions & 11 deletions packages/vue-vuetify/dev/components/ExampleSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
<v-container>
<v-row>
<v-col>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-switch
v-model="appStore.overrideControlTemplate"
Expand All @@ -282,7 +282,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
<v-row><v-col>Options</v-col></v-row>
<v-row>
<v-col>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-switch
v-model="appStore.jsonforms.config.hideRequiredAsterisk"
Expand All @@ -296,7 +296,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
</v-row>
<v-row>
<v-col>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-switch
v-model="appStore.jsonforms.config.showUnfocusedDescription"
Expand All @@ -310,7 +310,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
</v-row>
<v-row>
<v-col>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-switch
v-model="appStore.jsonforms.config.restrict"
Expand All @@ -325,7 +325,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
</v-row>
<v-row>
<v-col>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-switch
v-model="appStore.jsonforms.readonly"
Expand All @@ -339,7 +339,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
</v-row>
<v-row>
<v-col>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-switch
v-model="appStore.jsonforms.config.collapseNewItems"
Expand All @@ -353,7 +353,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
</v-row>
<v-row>
<v-col>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-switch
v-model="appStore.jsonforms.config.hideArraySummaryValidation"
Expand All @@ -367,7 +367,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
</v-row>
<v-row>
<v-col>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-switch
v-model="appStore.jsonforms.config.initCollapsed"
Expand All @@ -381,7 +381,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
</v-row>
<v-row>
<v-col>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-switch
v-model="appStore.jsonforms.config.hideAvatar"
Expand All @@ -395,7 +395,7 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
</v-row>
<v-row>
<v-col>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-switch
v-model="
Expand All @@ -411,7 +411,29 @@ const layouts = appstoreLayouts.map((value: AppstoreLayouts) => ({
</v-row>
<v-row>
<v-col>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-combobox
v-model="
appStore.jsonforms.config.filterErrorKeywordsBeforeTouch
"
label="Filter Error Keywords Before Touch"
placeholder="e.g., required, minLength, pattern"
chips
closable-chips
multiple
clearable
v-bind="props"
></v-combobox>
</template>
Hide specific AJV error keywords until the control is touched.
Requires "Enable Filter Errors Before Touch".
</v-tooltip>
</v-col>
</v-row>
<v-row>
<v-col>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-switch
v-model="
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-vuetify/dev/components/ThemeChanger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const setTheme = (theme: string) => {
offset-y
>
<template v-slot:activator="{ props: propsMenu }">
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props: propsTooltip }">
<v-btn large icon dark>
<v-icon
Expand Down
1 change: 1 addition & 0 deletions packages/vue-vuetify/dev/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const appstore = reactive({
hideAvatar: false,
hideArraySummaryValidation: false,
enableFilterErrorsBeforeTouch: false,
filterErrorKeywordsBeforeTouch: ['required'],
allowAdditionalPropertiesIfMissing: false,
},
locale: useLocalStorage('vuetify-example-locale', 'en'),
Expand Down
16 changes: 8 additions & 8 deletions packages/vue-vuetify/dev/views/ExampleView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ const handleAction = (action: Action) => {
<v-toolbar flat>
<v-toolbar-title>Data</v-toolbar-title>
<v-spacer></v-spacer>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
icon
Expand All @@ -367,7 +367,7 @@ const handleAction = (action: Action) => {
</template>
{{ `Reload Example Data` }}
</v-tooltip>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
icon
Expand Down Expand Up @@ -402,15 +402,15 @@ const handleAction = (action: Action) => {
<v-toolbar flat>
<v-toolbar-title>Schema</v-toolbar-title>
<v-spacer></v-spacer>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn icon @click="reloadMonacoSchema" v-bind="props">
<v-icon>$reload</v-icon>
</v-btn>
</template>
{{ `Reload Example Schema` }}
</v-tooltip>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn icon @click="saveMonacoSchema" v-bind="props">
<v-icon>$save</v-icon>
Expand All @@ -435,15 +435,15 @@ const handleAction = (action: Action) => {
<v-toolbar flat>
<v-toolbar-title>UI Schema</v-toolbar-title>
<v-spacer></v-spacer>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn icon @click="reloadMonacoUiSchema" v-bind="props">
<v-icon>$reload</v-icon>
</v-btn>
</template>
{{ `Reload Example UI Schema` }}
</v-tooltip>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn icon @click="saveMonacoUiSchema" v-bind="props">
<v-icon>$save</v-icon>
Expand All @@ -468,15 +468,15 @@ const handleAction = (action: Action) => {
<v-toolbar flat>
<v-toolbar-title>Data</v-toolbar-title>
<v-spacer></v-spacer>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn icon @click="reloadMonacoData" v-bind="props">
<v-icon>$reload</v-icon>
</v-btn>
</template>
{{ `Reload Example Data` }}
</v-tooltip>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn icon @click="saveMonacoData" v-bind="props">
<v-icon>$save</v-icon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
v-if="control.childErrors.length > 0"
:errors="control.childErrors"
/>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
icon
Expand Down Expand Up @@ -80,7 +80,7 @@
</validation-badge>
</template>
<v-list-item-title>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<span
v-bind="props"
Expand Down Expand Up @@ -135,7 +135,7 @@
</template>
{{ control.translations.down }}
</v-tooltip>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
v-bind="props"
Expand Down
8 changes: 4 additions & 4 deletions packages/vue-vuetify/src/complex/ArrayControlRenderer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
v-if="control.childErrors.length > 0"
:errors="control.childErrors"
/>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
icon
Expand Down Expand Up @@ -110,7 +110,7 @@
: 'fixed-cell-small'
"
>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
v-bind="props"
Expand All @@ -131,7 +131,7 @@
</template>
{{ control.translations.up }}
</v-tooltip>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
v-bind="props"
Expand All @@ -152,7 +152,7 @@
</template>
{{ control.translations.down }}
</v-tooltip>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
v-bind="props"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@change="propertyNameChange"
></json-forms
></v-col>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
icon
Expand Down Expand Up @@ -64,7 +64,7 @@
:cells="control.cells"
/></v-col>
<v-col v-if="control.enabled" class="flex-shrink-1 flex-grow-0">
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
v-bind="props"
Expand Down
8 changes: 4 additions & 4 deletions packages/vue-vuetify/src/layouts/ArrayLayoutRenderer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
:styles="styles"
:icons="icons"
>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
icon
Expand Down Expand Up @@ -109,7 +109,7 @@
align-self="center"
v-if="appliedOptions.showSortButtons"
>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
v-bind="props"
Expand All @@ -135,7 +135,7 @@
align-self="center"
v-if="appliedOptions.showSortButtons"
>
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
v-bind="props"
Expand All @@ -160,7 +160,7 @@
</v-tooltip>
</v-col>
<v-col align-self="center">
<v-tooltip bottom>
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
v-bind="props"
Expand Down
35 changes: 32 additions & 3 deletions packages/vue-vuetify/src/util/composition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
defaultJsonFormsI18nState,
getArrayTranslations,
getCombinatorTranslations,
getControlPath,
getFirstPrimitiveProp,
isDescriptionHidden,
type ControlElement,
Expand Down Expand Up @@ -176,10 +177,38 @@ export const useVuetifyControl = <
isFocused.value = false;
};

const jsonforms = useJsonForms();
const filteredErrors = computed(() => {
return touched.value || !appliedOptions.value.enableFilterErrorsBeforeTouch
? input.control.value.errors
: '';
// Always show errors if touched, no errors exist, or filtering is not enabled
if (
touched.value ||
!input.control.value.errors ||
!appliedOptions.value.enableFilterErrorsBeforeTouch
) {
return input.control.value.errors;
}

const filterKeywords = appliedOptions.value.filterErrorKeywordsBeforeTouch;

// Filtering is enabled - check if specific keywords are configured
if (Array.isArray(filterKeywords) && filterKeywords.length > 0) {
// Granular filtering: only hide specific error keywords
const errorsAtControl =
jsonforms.core?.errors?.filter(
(error) => input.control.value.path === getControlPath(error),
) ?? [];

const allErrorsFiltered =
errorsAtControl.length > 0 &&
errorsAtControl.every(
(error) => error.keyword && filterKeywords.includes(error.keyword),
);

return allErrorsFiltered ? '' : input.control.value.errors;
}

// default, all errors are filtered
return '';
});

const persistentHint = (): boolean => {
Expand Down