FormFieldLink.vue 850 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { getFieldLinkClasses } from './initializeFieldLinkClasses.ts'
  4. import type { RouteLocationRaw } from 'vue-router'
  5. withDefaults(
  6. defineProps<{
  7. link: RouteLocationRaw
  8. linkIcon?: string
  9. }>(),
  10. {
  11. linkIcon: 'form-field-link',
  12. },
  13. )
  14. const classMap = getFieldLinkClasses()
  15. </script>
  16. <template>
  17. <div :class="classMap.container">
  18. <div
  19. :class="classMap.base"
  20. class="flex h-full items-center focus:outline-none"
  21. >
  22. <CommonLink
  23. v-if="link"
  24. :link="link"
  25. :class="classMap.link"
  26. class="flex items-center justify-center"
  27. open-in-new-tab
  28. >
  29. <CommonIcon :name="linkIcon" size="small" decorative />
  30. </CommonLink>
  31. </div>
  32. </div>
  33. </template>