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