LCOV - code coverage report
Current view: top level - packages/design-system/src/components/input-group - InputGroupAddon.vue Coverage Total Hit
Test: ComfyUI E2E Coverage Lines: 50.0 % 8 4
Test Date: 2026-11-17 04:17:53

            Line data    Source code
       1           16 : <script setup lang="ts">
       2              : import type { HTMLAttributes } from 'vue'
       3              : 
       4              : import { cn } from '@comfyorg/tailwind-utils'
       5              : 
       6              : import type { InputGroupAddonVariants } from './inputGroup.variants'
       7              : import { inputGroupAddonVariants } from './inputGroup.variants'
       8              : 
       9              : const { align = 'inline-start', class: className } = defineProps<{
      10              :   align?: InputGroupAddonVariants['align']
      11              :   class?: HTMLAttributes['class']
      12              : }>()
      13              : 
      14         2355 : function focusControl(event: MouseEvent) {
      15            0 :   if (!(event.target instanceof Element) || event.target.closest('button'))
      16            0 :     return
      17            0 :   if (!(event.currentTarget instanceof HTMLElement)) return
      18            0 :   event.currentTarget.parentElement?.querySelector('input')?.focus()
      19              : }
      20           21 : </script>
      21              : 
      22              : <template>
      23           21 :   <div
      24              :     role="group"
      25              :     data-slot="input-group-addon"
      26              :     :data-align="align"
      27              :     :class="cn(inputGroupAddonVariants({ align }), className)"
      28              :     @click="focusControl"
      29              :   >
      30              :     <slot />
      31              :   </div>
      32              : </template>
        

Generated by: LCOV version 2.0-1