From fcf726f953d8d4c5dd5793ce425f38bfc51bf34a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E5=85=B4=E9=A1=BA?= <101850164+JeromeTseng@users.noreply.github.com> Date: Mon, 15 Jun 2026 16:38:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DTree=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=8D=E6=94=AF=E6=8C=81=E5=8D=8A=E9=80=89=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=88=E5=AD=90=E8=8A=82=E7=82=B9=E5=85=A8=E9=80=89?= =?UTF-8?q?=E6=97=B6=E7=88=B6=E8=8A=82=E7=82=B9=E9=80=89=E4=B8=AD=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E4=B8=BA=E5=8B=BE=E9=80=89=E7=8A=B6=E6=80=81=EF=BC=8C?= =?UTF-8?q?=E5=AD=90=E8=8A=82=E7=82=B9=E9=83=A8=E5=88=86=E9=80=89=E4=B8=AD?= =?UTF-8?q?=E6=97=B6=E7=88=B6=E8=8A=82=E7=82=B9=E5=9B=BE=E6=A0=87=E4=B8=BA?= =?UTF-8?q?=E5=87=8F=E5=8F=B7=EF=BC=8C=E4=B9=9F=E5=B0=B1=E6=98=AF=E7=89=88?= =?UTF-8?q?=E5=8B=BE=E9=80=89=E7=8A=B6=E6=80=81=EF=BC=8C=E5=AD=90=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E6=9C=AA=E8=A2=AB=E9=80=89=E4=B8=AD=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E7=88=B6=E8=8A=82=E7=82=B9=E4=B8=8D=E8=A2=AB=E9=80=89=E4=B8=AD?= =?UTF-8?q?=EF=BC=89=20(#8050)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui-kit/shadcn-ui/src/ui/checkbox/Checkbox.vue | 14 ++++++++++---- .../@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue | 5 +++-- 2 files changed, 13 insertions(+), 6 deletions(-) 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 20c804eb4..87e93702d 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,16 +5,19 @@ import type { HTMLAttributes } from 'vue'; import { cn } from '@vben-core/shared/utils'; -import { Check } from '@lucide/vue'; +import { Check, Minus } from '@lucide/vue'; import { reactiveOmit } from '@vueuse/core'; import { CheckboxIndicator, CheckboxRoot, useForwardPropsEmits } from 'reka-ui'; const props = defineProps< - CheckboxRootProps & { class?: HTMLAttributes['class'] } + CheckboxRootProps & { + class?: HTMLAttributes['class']; + indeterminate?: boolean; + } >(); const emits = defineEmits(); -const delegatedProps = reactiveOmit(props, 'class'); +const delegatedProps = reactiveOmit(props, 'class', 'indeterminate'); const forwarded = useForwardPropsEmits(delegatedProps, emits); @@ -27,6 +30,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits); :class=" cn( 'peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50', + indeterminate && 'bg-primary text-primary-foreground border-primary', props.class, ) " @@ -34,9 +38,11 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits); - + + diff --git a/packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue b/packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue index 81d5e4eda..0a6e8806d 100644 --- a/packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue +++ b/packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue @@ -227,7 +227,7 @@ function onSelect(item: FlattenedItem>, isSelected: boolean) { } if ( - !props.checkStrictly && + props.checkStrictly && props.multiple && props.autoCheckParent && isSelected @@ -246,7 +246,7 @@ function onSelect(item: FlattenedItem>, isSelected: boolean) { }); } if ( - !props.checkStrictly && + props.checkStrictly && props.multiple && props.autoCheckParent && !isSelected @@ -307,6 +307,7 @@ defineExpose({ v-model:expanded="expanded as string[]" :default-expanded="defaultExpandedKeys as string[]" :propagate-select="!checkStrictly" + :bubble-select="!checkStrictly" :multiple="multiple" :disabled="disabled" :selection-behavior="allowClear || multiple ? 'toggle' : 'replace'"