From bdad527afdf8140ad47f4edabc0e3498f8ad53e8 Mon Sep 17 00:00:00 2001 From: Mael Date: Fri, 1 Mar 2024 11:00:38 +0100 Subject: [PATCH] Update CommandDialog.vue to add custom filter-function Add a custom filter-function to CommandDialog --- .../registry/default/ui/command/CommandDialog.vue | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/www/src/lib/registry/default/ui/command/CommandDialog.vue b/apps/www/src/lib/registry/default/ui/command/CommandDialog.vue index 37c8406a..d46606d5 100644 --- a/apps/www/src/lib/registry/default/ui/command/CommandDialog.vue +++ b/apps/www/src/lib/registry/default/ui/command/CommandDialog.vue @@ -4,16 +4,24 @@ import type { DialogRootEmits, DialogRootProps } from 'radix-vue' import Command from './Command.vue' import { Dialog, DialogContent } from '@/lib/registry/default/ui/dialog' -const props = defineProps() +const props = defineProps< + DialogRootProps & { + filterFunction?: (val: Array, term: string) => Array; + } +>(); const emits = defineEmits() const forwarded = useForwardPropsEmits(props, emits) +const forwardedExceptFilterFunction = computed(() => { + const { filterFunction: _, ...rest } = forwarded.value; + return rest; +});