# All files / js/components/ui/dropdown-menu DropdownMenuCheckboxItem.vue

0% Statements 0/10
100% Branches 0/0
0% Functions 0/3
0% Lines 0/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42

     <script setup lang="ts">
    import { cn } from '@/lib/utils'
    import { Check } from 'lucide-vue-next'
    import {
      DropdownMenuCheckboxItem,
      type DropdownMenuCheckboxItemEmits,
      type DropdownMenuCheckboxItemProps,
      DropdownMenuItemIndicator,
      useForwardPropsEmits,
    } from 'reka-ui'
    import { computed, type HTMLAttributes } from 'vue'

    const props = defineProps<DropdownMenuCheckboxItemProps & { class?: HTMLAttributes['class'] }>()
    const emits = defineEmits<DropdownMenuCheckboxItemEmits>()

    const delegatedProps = computed(() => {
      const { class: _, ...delegated } = props

      return delegated
    })

    const forwarded = useForwardPropsEmits(delegatedProps, emits)
    </script>

    <template>
      <DropdownMenuCheckboxItem
        data-slot="dropdown-menu-checkbox-item"
        v-bind="forwarded"
        :class=" cn(
          `focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,
          props.class,
        )"
      >
        <span class="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
          <DropdownMenuItemIndicator>
            <Check class="size-4" />
          </DropdownMenuItemIndicator>
        </span>
        <slot />
      </DropdownMenuCheckboxItem>
    </template>