2018-01-29 06:07:31 +01:00
|
|
|
<a rel="nofollow noopener"
|
|
|
|
target="_blank"
|
2018-05-02 02:05:36 +02:00
|
|
|
{href}
|
|
|
|
aria-label={ariaLabel}
|
2018-08-27 00:38:45 +02:00
|
|
|
class={computedClass}>
|
2018-05-02 02:05:36 +02:00
|
|
|
<slot></slot>{#if showIcon}
|
2018-03-16 16:42:10 +01:00
|
|
|
<svg class="external-link-svg">
|
2018-12-10 09:13:54 +01:00
|
|
|
<use xlink:href="#fa-external-link" />
|
2018-01-29 06:07:31 +01:00
|
|
|
</svg>
|
2018-05-02 02:05:36 +02:00
|
|
|
{/if}</a>
|
2018-01-29 04:01:51 +01:00
|
|
|
<style>
|
2018-01-29 06:07:31 +01:00
|
|
|
.external-link-with-icon {
|
2018-01-29 04:01:51 +01:00
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
}
|
2018-03-16 16:42:10 +01:00
|
|
|
.external-link-with-icon .external-link-svg {
|
2018-01-29 04:01:51 +01:00
|
|
|
margin-left: 4px;
|
|
|
|
width: 14px;
|
|
|
|
height: 14px;
|
|
|
|
fill: var(--deemphasized-text-color);
|
|
|
|
}
|
2018-03-16 16:42:10 +01:00
|
|
|
.external-link-with-icon.normal-icon-color .external-link-svg {
|
2018-02-10 23:35:21 +01:00
|
|
|
fill: var(--body-text-color);
|
|
|
|
}
|
2018-04-30 07:13:41 +02:00
|
|
|
</style>
|
|
|
|
<script>
|
2018-08-27 00:38:45 +02:00
|
|
|
import { classname } from '../_utils/classname'
|
|
|
|
|
2018-04-30 07:13:41 +02:00
|
|
|
export default {
|
|
|
|
data: () => ({
|
2018-04-30 18:57:49 +02:00
|
|
|
className: void 0,
|
|
|
|
normalIconColor: false,
|
|
|
|
ariaLabel: '',
|
|
|
|
showIcon: false
|
2018-08-27 00:38:45 +02:00
|
|
|
}),
|
|
|
|
computed: {
|
|
|
|
computedClass: ({ className, showIcon, normalIconColor }) => (classname(
|
|
|
|
'external-link',
|
|
|
|
className,
|
|
|
|
showIcon && 'external-link-with-icon',
|
|
|
|
normalIconColor && 'normal-icon-color'
|
|
|
|
))
|
|
|
|
}
|
2018-04-30 07:13:41 +02:00
|
|
|
}
|
2018-12-10 09:13:54 +01:00
|
|
|
</script>
|