|
|
|
@ -8,16 +8,21 @@ const props = withDefaults(
|
|
|
|
|
clickable?: boolean |
|
|
|
|
inherit?: boolean |
|
|
|
|
border?: boolean |
|
|
|
|
size?: 'sm' | 'md' |
|
|
|
|
}>(), |
|
|
|
|
{ |
|
|
|
|
clickable: false, |
|
|
|
|
inherit: false, |
|
|
|
|
border: true, |
|
|
|
|
size: 'sm', |
|
|
|
|
}, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
const roleRef = toRef(props, 'role') |
|
|
|
|
const clickableRef = toRef(props, 'clickable') |
|
|
|
|
const borderRef = toRef(props, 'border') |
|
|
|
|
|
|
|
|
|
const sizeSelect = computed(() => props.size) |
|
|
|
|
|
|
|
|
|
const roleProperties = computed(() => { |
|
|
|
|
const role = roleRef.value |
|
|
|
@ -36,14 +41,14 @@ const roleProperties = computed(() => {
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
|
<div |
|
|
|
|
class="flex items-center" |
|
|
|
|
class="flex items-start" |
|
|
|
|
:class="{ |
|
|
|
|
'cursor-pointer': clickableRef, |
|
|
|
|
}" |
|
|
|
|
> |
|
|
|
|
<NcBadge class="!px-2" :color="roleProperties.color" :border="borderRef"> |
|
|
|
|
<NcBadge class="!px-2" :color="roleProperties.color" :border="borderRef" :size="sizeSelect"> |
|
|
|
|
<div |
|
|
|
|
class="badge-text flex items-center gap-2 !h-7" |
|
|
|
|
class="badge-text flex items-center gap-2" |
|
|
|
|
:class="{ |
|
|
|
|
'text-purple-500': roleProperties.color === 'purple', |
|
|
|
|
'text-blue-500': roleProperties.color === 'blue', |
|
|
|
@ -52,6 +57,7 @@ const roleProperties = computed(() => {
|
|
|
|
|
'text-yellow-500': roleProperties.color === 'yellow', |
|
|
|
|
'text-red-500': roleProperties.color === 'red', |
|
|
|
|
'text-gray-300': !roleProperties.color, |
|
|
|
|
sizeSelect, |
|
|
|
|
}" |
|
|
|
|
> |
|
|
|
|
<GeneralIcon :icon="roleProperties.icon" /> |
|
|
|
|