2022-05-12 07:05:26 +00:00
|
|
|
<script lang="ts">
|
2022-09-21 08:08:25 +00:00
|
|
|
import { Employee } from '@hcengineering/contact'
|
|
|
|
import { WithLookup } from '@hcengineering/core'
|
|
|
|
import { IntlString } from '@hcengineering/platform'
|
2023-01-14 10:54:54 +00:00
|
|
|
import { PersonLabelTooltip } from '..'
|
2022-07-02 18:49:22 +00:00
|
|
|
import PersonPresenter from '../components/PersonPresenter.svelte'
|
2023-03-09 09:05:42 +00:00
|
|
|
import contact from '../plugin'
|
2022-05-12 07:05:26 +00:00
|
|
|
|
2022-06-07 08:57:05 +00:00
|
|
|
export let value: WithLookup<Employee> | null | undefined
|
2023-01-14 10:54:54 +00:00
|
|
|
export let tooltipLabels: PersonLabelTooltip | undefined = undefined
|
2022-05-12 07:05:26 +00:00
|
|
|
export let shouldShowAvatar: boolean = true
|
2022-05-18 05:35:34 +00:00
|
|
|
export let shouldShowName: boolean = true
|
2022-06-08 06:18:47 +00:00
|
|
|
export let shouldShowPlaceholder = false
|
2022-05-18 05:35:34 +00:00
|
|
|
export let onEmployeeEdit: ((event: MouseEvent) => void) | undefined = undefined
|
2022-06-10 16:10:15 +00:00
|
|
|
export let avatarSize: 'inline' | 'tiny' | 'x-small' | 'small' | 'medium' | 'large' | 'x-large' = 'x-small'
|
2022-06-24 12:36:08 +00:00
|
|
|
export let isInteractive = true
|
|
|
|
export let inline = false
|
2022-09-09 03:44:33 +00:00
|
|
|
export let disableClick = false
|
2023-01-14 10:54:54 +00:00
|
|
|
export let defaultName: IntlString | undefined = undefined
|
2023-03-14 05:08:23 +00:00
|
|
|
export let element: HTMLElement | undefined = undefined
|
2022-05-12 07:05:26 +00:00
|
|
|
</script>
|
|
|
|
|
2023-03-17 03:52:32 +00:00
|
|
|
<PersonPresenter
|
|
|
|
bind:element
|
|
|
|
{value}
|
|
|
|
{tooltipLabels}
|
|
|
|
onEdit={onEmployeeEdit}
|
|
|
|
{shouldShowAvatar}
|
|
|
|
{shouldShowName}
|
|
|
|
{avatarSize}
|
|
|
|
{shouldShowPlaceholder}
|
|
|
|
isInteractive={isInteractive && !disableClick}
|
|
|
|
{inline}
|
|
|
|
{defaultName}
|
|
|
|
statusLabel={value?.active === false && shouldShowName ? contact.string.Inactive : undefined}
|
|
|
|
/>
|