From 31a6ab59fb802d06fb542d1764766434327c27e1 Mon Sep 17 00:00:00 2001 From: Netfan Date: Thu, 6 Mar 2025 16:11:02 +0800 Subject: [PATCH 1/3] feat: vben checkbox support indeterminate state and transition animation (#5662) --- .../shadcn-ui/src/components/checkbox/checkbox.vue | 2 +- .../ui-kit/shadcn-ui/src/ui/checkbox/Checkbox.vue | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/checkbox/checkbox.vue b/packages/@core/ui-kit/shadcn-ui/src/components/checkbox/checkbox.vue index 3c2e9da2..6d812e86 100644 --- a/packages/@core/ui-kit/shadcn-ui/src/components/checkbox/checkbox.vue +++ b/packages/@core/ui-kit/shadcn-ui/src/components/checkbox/checkbox.vue @@ -7,7 +7,7 @@ import { useForwardPropsEmits } from 'radix-vue'; import { Checkbox } from '../../ui/checkbox'; -const props = defineProps(); +const props = defineProps(); const emits = defineEmits(); diff --git a/packages/@core/ui-kit/shadcn-ui/src/ui/checkbox/Checkbox.vue b/packages/@core/ui-kit/shadcn-ui/src/ui/checkbox/Checkbox.vue index 0fc81375..d771d893 100644 --- a/packages/@core/ui-kit/shadcn-ui/src/ui/checkbox/Checkbox.vue +++ b/packages/@core/ui-kit/shadcn-ui/src/ui/checkbox/Checkbox.vue @@ -5,14 +5,16 @@ import { computed } from 'vue'; import { cn } from '@vben-core/shared/utils'; -import { Check } from 'lucide-vue-next'; +import { Check, Minus } from 'lucide-vue-next'; import { CheckboxIndicator, CheckboxRoot, useForwardPropsEmits, } from 'radix-vue'; -const props = defineProps(); +const props = defineProps< + CheckboxRootProps & { class?: any; indeterminate?: boolean } +>(); const emits = defineEmits(); const delegatedProps = computed(() => { @@ -29,7 +31,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits); v-bind="forwarded" :class=" cn( - 'focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground border-border peer h-4 w-4 shrink-0 rounded-sm border focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50', + 'focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground border-border peer h-4 w-4 shrink-0 rounded-sm border transition focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50', props.class, ) " @@ -38,7 +40,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits); class="flex h-full w-full items-center justify-center text-current" > - + From f86c9f90ad7987bc1debe5d208be21e9cecc2100 Mon Sep 17 00:00:00 2001 From: Netfan Date: Thu, 6 Mar 2025 22:22:45 +0800 Subject: [PATCH 2/3] fix: keepAlive not working for popup `appendToMain` (#5666) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修复弹窗和抽屉 `appendToMain` 时且启用`keepAlive` 时未能正确缓存的问题 --- packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue | 4 +++- packages/@core/ui-kit/popup-ui/src/modal/modal.vue | 4 +++- playground/src/router/routes/modules/examples.ts | 2 ++ playground/src/views/examples/drawer/in-content-demo.vue | 7 ++++++- playground/src/views/examples/drawer/index.vue | 1 + playground/src/views/examples/modal/in-content-demo.vue | 7 ++++++- playground/src/views/examples/modal/index.vue | 2 ++ 7 files changed, 23 insertions(+), 4 deletions(-) diff --git a/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue b/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue index 220d318f..410c3ffe 100644 --- a/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue +++ b/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue @@ -127,7 +127,9 @@ function handleFocusOutside(e: Event) { } const getAppendTo = computed(() => { - return appendToMain.value ? `#${ELEMENT_ID_MAIN_CONTENT}` : undefined; + return appendToMain.value + ? `#${ELEMENT_ID_MAIN_CONTENT}>div:not(.absolute)>div` + : undefined; });