2021-01-30 16:17:04 +00:00
|
|
|
<template>
|
2022-10-17 11:41:00 +00:00
|
|
|
<BaseButton class="dropdown-item">
|
2022-07-20 15:08:46 +00:00
|
|
|
<span class="icon" v-if="icon">
|
2022-10-17 11:41:00 +00:00
|
|
|
<Icon :icon="icon"/>
|
2021-01-30 16:17:04 +00:00
|
|
|
</span>
|
|
|
|
<span>
|
2022-10-17 11:41:00 +00:00
|
|
|
<slot />
|
2021-01-30 16:17:04 +00:00
|
|
|
</span>
|
2022-10-17 11:41:00 +00:00
|
|
|
</BaseButton>
|
2021-01-30 16:17:04 +00:00
|
|
|
</template>
|
|
|
|
|
2021-12-04 14:47:32 +00:00
|
|
|
<script lang="ts" setup>
|
2022-10-17 11:41:00 +00:00
|
|
|
import BaseButton, { type BaseButtonProps } from '@/components/base//BaseButton.vue'
|
|
|
|
import Icon from '@/components/misc/Icon'
|
|
|
|
import type { IconProp } from '@fortawesome/fontawesome-svg-core'
|
2022-07-20 15:08:46 +00:00
|
|
|
|
2023-06-20 13:22:19 +00:00
|
|
|
export interface DropDownItemProps extends /* @vue-ignore */ BaseButtonProps {
|
2022-10-17 11:41:00 +00:00
|
|
|
icon?: IconProp,
|
|
|
|
}
|
2022-07-20 15:08:46 +00:00
|
|
|
|
2022-10-17 11:41:00 +00:00
|
|
|
defineProps<DropDownItemProps>()
|
2021-01-30 16:17:04 +00:00
|
|
|
</script>
|
2022-07-20 15:08:46 +00:00
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.dropdown-item {
|
|
|
|
color: var(--text);
|
|
|
|
display: block;
|
|
|
|
font-size: 0.875rem;
|
|
|
|
line-height: 1.5;
|
|
|
|
padding: $item-padding;
|
|
|
|
position: relative;
|
|
|
|
text-align: inherit;
|
|
|
|
white-space: nowrap;
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: left !important;
|
|
|
|
|
|
|
|
&.is-active {
|
|
|
|
background-color: var(--link);
|
|
|
|
color: var(--link-invert);
|
|
|
|
}
|
|
|
|
|
2022-11-12 10:46:39 +00:00
|
|
|
&:hover:not(.is-disabled) {
|
|
|
|
background-color: var(--grey-100);
|
2022-07-20 15:08:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&.is-disabled {
|
|
|
|
cursor: not-allowed;
|
2022-11-12 10:46:39 +00:00
|
|
|
}
|
|
|
|
}
|
2022-07-20 15:08:46 +00:00
|
|
|
|
2022-11-12 10:46:39 +00:00
|
|
|
.icon {
|
|
|
|
padding-right: .5rem;
|
|
|
|
|
|
|
|
&:not(.has-text-success) {
|
|
|
|
color: var(--grey-300) !important;
|
2022-07-20 15:08:46 +00:00
|
|
|
}
|
|
|
|
}
|
2022-11-12 10:46:39 +00:00
|
|
|
|
|
|
|
.has-text-danger .icon {
|
|
|
|
color: var(--danger) !important;
|
|
|
|
}
|
2022-07-20 15:08:46 +00:00
|
|
|
</style>
|